diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 17e16913..6e685dba 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,14 +13,17 @@ jobs: uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 17 + java-version: 21 cache: 'gradle' - name: Build and publish with Gradle run: | cd ./klang - ./gradlew build publish --info + ./gradlew publishAll --info env: VERSION: ${{ github.event.release.tag_name }} - URL: ${{ vars.GITLAB_URL }} - TOKEN: ${{ secrets.GITLAB_TOKEN }} + SONATYPE_LOGIN: ${{ secrets.SONATYPE_LOGIN }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + PGP_PUBLIC: ${{ secrets.PGP_PUBLIC }} + PGP_PRIVATE: ${{ secrets.PGP_PRIVATE }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 94f32a35..4aed950f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,16 +13,19 @@ concurrency: jobs: tests: strategy: + fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [macos-14, ubuntu-latest] runs-on: ${{ matrix.os }} steps: + - name: print architecture + run: uname -m - uses: actions/checkout@v3 - name: Set up JDK uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 17 + java-version: 21 cache: 'gradle' - name: Cache Gradle packages uses: actions/cache@v3 @@ -30,7 +33,15 @@ jobs: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} restore-keys: ${{ runner.os }}-gradle - - name: Build & test klang + - name: Build & test klang macos + if: matrix.os == 'macos-14' + run: | + cd ./klang + ./gradlew test + - name: Build & test klang ubuntu + if: matrix.os == 'ubuntu-latest' + env: + LIBCLANG_PATH: "/usr/lib/llvm-15/lib/libclang-15.so.1" run: | cd ./klang ./gradlew test diff --git a/.gitignore b/.gitignore index 22540597..8694bc9b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,9 @@ gradle-app.setting .classpath /.idea/ /toolkit/*.log + +# Ignore native libraries +*.dll +*.dylib +*.so +*.jar diff --git a/.run/generate binding.run.xml b/.run/generate binding.run.xml deleted file mode 100644 index 6319132d..00000000 --- a/.run/generate binding.run.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - true - true - false - false - - - - \ No newline at end of file diff --git a/.run/run integration test.run.xml b/.run/run integration test.run.xml deleted file mode 100644 index ad27f438..00000000 --- a/.run/run integration test.run.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - false - true - false - true - - - \ No newline at end of file diff --git a/README.md b/README.md index ded46d61..d037a3c9 100644 --- a/README.md +++ b/README.md @@ -1 +1,42 @@ -Experimental toolkit to auto generate binding from C/C++/Objective C library to Kotlin \ No newline at end of file +# Klang Toolkit + +*Experimental toolkit to generate bindings from C/C++/Objective-C library to Kotlin using Clang.* + +## Status Overview + +Currently, we are in the experimental phase of parsing headers. We have two main approaches: + +### Approach 1: Standalone LibClang 15 Library + +- **Advantages** + - More accurate header parsing. +- **Disadvantages** + - LibClang is part of the LLVM toolchain. + +### Approach 2: Clang 15 from Docker for JSON AST Generation + +- **Advantages** + - Easier to use. +- **Disadvantages** + - Limited information on JSON AST. + - Requires Docker on host for JSON AST generation. + - Hard to use OS-specific headers. + +We can generate a good enough binding with JNA on a C library. Check the `bindings` folder for examples. + +## Known Issues + +Currently, with Gradle, the native library is loaded multiple times on the daemon. Therefore, the Klang plugin does not +support the Gradle daemon. + +## Additional Information + +The `Jextract` code is embedded almost as is, and the license may differ from Klang toolkit. + +This project embeds C headers from different sources; namely: + +1. `/klang/src/main/resource/darwin-headers.zip` is obtained from XCode. Refer to `/usr/bin/xcrun --show-sdk-path`. +2. `/klang/src/main/resource/c-headers.zip` is obtained from Clang 15 headers. + +Clang dynamic libraries (version 15) are embedded. These are fetched +from [prebuilt version on GitHub](https://github.com/klang-toolkit/libclang-binary/releases/tag/15). \ No newline at end of file diff --git a/bindings/angle/binaries/build.gradle.kts b/bindings/angle/binaries/build.gradle.kts new file mode 100644 index 00000000..f75408d9 --- /dev/null +++ b/bindings/angle/binaries/build.gradle.kts @@ -0,0 +1,34 @@ +import org.jetbrains.kotlin.de.undercouch.gradle.tasks.download.Download + +plugins { + kotlin("jvm") version libs.versions.kotlin + `maven-publish` +} + +publishing { + publications { + create("mavenJava") { from(components["java"]) } + } +} +version = "chrome-122.0.6261" + +val directory = project.file("src/main/resources") +val baseUrl = "https://github.com/klang-toolkit/ANGLE-binary/releases/download/$version/" +val fileToDownload = listOf( + "libEGL.dylib" to directory.resolve("darwin").resolve("libEGL.dylib"), + "libGLESv2.dylib" to directory.resolve("darwin").resolve("libGLESv2.dylib"), + "libEGL.dll" to directory.resolve("win32").resolve("libEGL.dylib"), + "libGLESv2.dll" to directory.resolve("win32").resolve("libGLESv2.dylib"), +).forEach { (fileName, target) -> + val url = "$baseUrl$fileName" + val taskName = "downloadFile-$fileName" + tasks.register(taskName) { + onlyIf { !target.exists() } + src(url) + dest(target) + } + + tasks.named("processResources") { + dependsOn(taskName) + } +} \ No newline at end of file diff --git a/bindings/angle/build.gradle.kts b/bindings/angle/build.gradle.kts index 636afdab..eb2f7901 100644 --- a/bindings/angle/build.gradle.kts +++ b/bindings/angle/build.gradle.kts @@ -1,7 +1,19 @@ +plugins { + kotlin("jvm") version libs.versions.kotlin + id("com.gradle.plugin-publish") version "1.0.0" +} + +repositories { + mavenCentral() +} +group = "io.ygdrasil" +version = "1.0.0-SNAPSHOT" -allprojects { +subprojects { + apply(plugin = "maven-publish") + apply(plugin = "org.jetbrains.kotlin.jvm") repositories { mavenCentral() @@ -9,6 +21,39 @@ allprojects { group = "io.ygdrasil" version = "1.0.0-SNAPSHOT" + + publishing { + + publications { + create("maven") { + from(components["java"]) + + pom { + name = "Klang-${project.name}" + description = "Angle binding" + url = "https://ygdrasil.io/" + licenses { + license { + name = "MIT" + url = "https://opensource.org/license/mit/" + } + } + developers { + developer { + id = "alexandremo" + name = "Alexandre Mommers" + email = "alexandre dot mommers at gmail do com" + } + } + scm { + connection = "scm:git:git://github.com/ygdrasil-io/klang.git" + developerConnection = "scm:git:ssh//git@github.com:ygdrasil-io/klang.git" + url = "https://github.com/ygdrasil-io/klang" + } + } + } + } + } } diff --git a/bindings/angle/example/build.gradle.kts b/bindings/angle/example/build.gradle.kts index 9fd1eedf..eb3203fc 100644 --- a/bindings/angle/example/build.gradle.kts +++ b/bindings/angle/example/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - kotlin("jvm") version "1.9.10" + kotlin("jvm") version libs.versions.kotlin } dependencies { diff --git a/bindings/angle/example/src/main/kotlin/example/HelloTriangle.kt b/bindings/angle/example/src/main/kotlin/example/HelloTriangle.kt index cd04e424..f9e2f9ee 100644 --- a/bindings/angle/example/src/main/kotlin/example/HelloTriangle.kt +++ b/bindings/angle/example/src/main/kotlin/example/HelloTriangle.kt @@ -52,16 +52,16 @@ class HelloTriangle : SampleApplication("HelloTriangle") { libGLESv2Library.glViewport(0, 0, window.width, window.height) // Clear the color buffer - libGLESv2Library.glClear(GL_COLOR_BUFFER_BIT) + libGLESv2Library.glClear(GL_COLOR_BUFFER_BIT.toInt()) // Use the program object libGLESv2Library.glUseProgram(mProgram) // Load the vertex data - libGLESv2Library.glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE.toByte(), 0, verticesBuffer) + libGLESv2Library.glVertexAttribPointer(0, 3, GL_FLOAT.toInt(), GL_FALSE.toByte(), 0, verticesBuffer) libGLESv2Library.glEnableVertexAttribArray(0) - libGLESv2Library.glDrawArrays(GL_TRIANGLES, 0, 3) + libGLESv2Library.glDrawArrays(GL_TRIANGLES.toInt(), 0, 3) } } diff --git a/bindings/angle/example/src/main/kotlin/example/toolkit/EGLPlatformParameters.kt b/bindings/angle/example/src/main/kotlin/example/toolkit/EGLPlatformParameters.kt index 9e62e0bb..796d69f7 100644 --- a/bindings/angle/example/src/main/kotlin/example/toolkit/EGLPlatformParameters.kt +++ b/bindings/angle/example/src/main/kotlin/example/toolkit/EGLPlatformParameters.kt @@ -1,28 +1,23 @@ package example.toolkit -import libangle.EGL_DONT_CARE -import libangle.EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE -import libangle.EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE -import libangle.Feature +import libangle.* import java.util.* class PlatformMethods class EGLPlatformParameters { var renderer: Int = EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE - var majorVersion: Int = EGL_DONT_CARE - var minorVersion: Int = EGL_DONT_CARE + var majorVersion: Int = EGL_DONT_CARE.toInt() + var minorVersion: Int = EGL_DONT_CARE.toInt() var deviceType: Int = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE - var presentPath: Int = EGL_DONT_CARE - var debugLayersEnabled: Int = EGL_DONT_CARE - var robustness: Int = EGL_DONT_CARE - var displayPowerPreference: Int = EGL_DONT_CARE + var presentPath: Int = EGL_DONT_CARE.toInt() + var debugLayersEnabled: Int = EGL_DONT_CARE.toInt() + var robustness: Int = EGL_DONT_CARE.toInt() + var displayPowerPreference: Int = EGL_DONT_CARE.toInt() var enabledFeatureOverrides: MutableList = ArrayList() var disabledFeatureOverrides: MutableList = ArrayList() var platformMethods: PlatformMethods? = null - constructor() // Constructor por defecto - constructor(renderer: Int) { this.renderer = renderer } diff --git a/bindings/angle/example/src/main/kotlin/example/toolkit/EGLWindow.kt b/bindings/angle/example/src/main/kotlin/example/toolkit/EGLWindow.kt index f7e3ef39..e51195c1 100644 --- a/bindings/angle/example/src/main/kotlin/example/toolkit/EGLWindow.kt +++ b/bindings/angle/example/src/main/kotlin/example/toolkit/EGLWindow.kt @@ -31,28 +31,7 @@ class EGLWindow(window: OSWindow) { } fun initializeDisplay(osWindow: OSWindow, glWindowingLibrary: Library, driverType: GLESDriverType, params: EGLPlatformParameters): Boolean { - if (driverType == GLESDriverType.ZinkEGL) { - val driDirStream = StringBuilder() - val s = GetPathSeparator() - driDirStream.append(GetModuleDirectory()).append("mesa").append(s).append("src").append(s).append("gallium").append(s).append("targets").append(s).append("dri") - val driDir = driDirStream.toString() - - SetEnvironmentVar("MESA_LOADER_DRIVER_OVERRIDE", "zink") - SetEnvironmentVar("LIBGL_DRIVERS_PATH", driDir) - } - - if (ANGLE_USE_UTIL_LOADER) { - var getProcAddress: PFNEGLGETPROCADDRESSPROC - glWindowingLibrary.getAs("eglGetProcAddress", getProcAddress) - if (getProcAddress == null) { - println("Cannot load eglGetProcAddress") - return false - } - - // Likely we will need to use a fallback to Library::getAs on non-ANGLE platforms. - LoadUtilEGL(getProcAddress) - } // EGL_NO_DISPLAY + EGL_EXTENSIONS returns NULL before Android 10 val extensionString = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS) as String? @@ -210,7 +189,6 @@ enum class GLESDriverType { AngleVulkanSecondariesEGL, SystemEGL, SystemWGL, - ZinkEGL, } enum class GLWindowResult { diff --git a/bindings/angle/libangle/src/main/kotlin/libangle/Feature.kt b/bindings/angle/example/src/main/kotlin/example/toolkit/Feature.kt similarity index 93% rename from bindings/angle/libangle/src/main/kotlin/libangle/Feature.kt rename to bindings/angle/example/src/main/kotlin/example/toolkit/Feature.kt index 89713000..15df630d 100644 --- a/bindings/angle/libangle/src/main/kotlin/libangle/Feature.kt +++ b/bindings/angle/example/src/main/kotlin/example/toolkit/Feature.kt @@ -1,8 +1,10 @@ -package libangle +package example.toolkit -enum class Feature { +enum class Feature +{ AddAndTrueToLoopCondition, AddMockTextureNoRenderTarget, + AdjustClearColorPrecision, AdjustSrcDstRegionForBlitFramebuffer, AllocateNonZeroMemory, AllowAstcFormats, @@ -25,6 +27,8 @@ enum class Feature { AllowTranslateUniformBlockToStructuredBuffer, AlwaysCallUseProgramAfterLink, AlwaysPreferStagedTextureUploads, + AlwaysResolveMultisampleRenderBuffers, + AlwaysRunLinkSubJobsThreaded, AlwaysUnbindFramebufferTexture2D, AlwaysUseManagedStorageModeForBuffers, AlwaysUseSharedStorageModeForBuffers, @@ -33,6 +37,7 @@ enum class Feature { AsyncCommandBufferReset, AsyncCommandQueue, Avoid1BitAlphaTextureFormats, + AvoidOpSelectWithMismatchingRelaxedPrecision, AvoidStencilTextureSwizzle, BindCompleteFramebufferForTimerQueries, BindTransformFeedbackBufferBeforeBindBufferRange, @@ -47,10 +52,12 @@ enum class Feature { ClampPointSize, ClearToZeroOrOneBroken, ClipSrcRegionForBlitFramebuffer, + CompileJobIsThreadSafe, CompileMetalShaders, CompressVertexData, CopyIOSurfaceToNonIOSurfaceForReadOptimization, CopyTextureToBufferForReadOptimization, + CorruptProgramBinaryForTesting, DecodeEncodeSRGBForGenerateMipmap, DeferFlushUntilEndRenderPass, DepthStencilBlitExtraCopy, @@ -65,6 +72,7 @@ enum class Feature { DisableMetalOnNvidia, DisableMultisampledRenderToTexture, DisableNativeParallelCompile, + DisablePipelineCacheLoadForTesting, DisableProgramBinary, DisableProgramCaching, DisableProgramCachingForTransformFeedback, @@ -74,6 +82,7 @@ enum class Feature { DisableRenderSnorm, DisableRWTextureTier2Support, DisableSemaphoreFd, + DisableSeparateShaderObjects, DisableStagedInitializationOfPackedTextureFormats, DisableSyncControlSupport, DisableTextureClampToBorder, @@ -93,6 +102,7 @@ enum class Feature { EmulateAlphaToCoverage, EmulateAtan2Float, EmulateClipDistanceState, + EmulateClipOrigin, EmulateCopyTexImage2D, EmulateCopyTexImage2DFromRenderbuffers, EmulateDithering, @@ -146,10 +156,12 @@ enum class Feature { ForceGlErrorChecking, ForceInitShaderVariables, ForceMaxUniformBufferSize16KB, + ForceMinimumMaxVertexAttributes, ForceNearestFiltering, ForceNearestMipFiltering, ForceNonCSBaseMipmapGeneration, ForceRobustResourceInit, + ForceSampleUsageForAhbBackedImages, ForceSubmitImmutableTextureUpdates, ForceTextureLodOffset1, ForceTextureLodOffset2, @@ -170,6 +182,7 @@ enum class Feature { HasTextureSwizzle, InitFragmentOutputVariables, InitializeCurrentVertexAttributes, + InjectAsmStatementIntoLoopBodies, IntelDisableFastMath, IntelExplicitBoolCastWorkaround, KeepBufferShadowCopy, @@ -179,7 +192,7 @@ enum class Feature { LimitMaxMSAASamplesTo4, LimitSampleCountTo2, LimitWebglMaxTextureSizeTo4096, - LinkJobIsNotThreadSafe, + LinkJobIsThreadSafe, LoadMetalShadersFromBlobCache, LogMemoryReportCallbacks, LogMemoryReportStats, @@ -205,11 +218,13 @@ enum class Feature { PreferDeviceLocalMemoryHostVisible, PreferDrawClearOverVkCmdClearAttachments, PreferDriverUniformOverSpecConst, + PreferHostCachedForNonStaticBufferUsage, PreferLinearFilterForYUV, PreferMonolithicPipelinesOverLibraries, PreferSkippingInvalidateForEmulatedFormats, PreferSubmitAtFBOBoundary, PreferSubmitOnAnySamplesPassedQueryEnd, + PreTransformTextureCubeGradDerivatives, PrintMetalShaders, PromotePackedFormatsTo8BitPerChannel, ProvokingVertex, @@ -219,10 +234,12 @@ enum class Feature { RegenerateStructNames, RemoveDynamicIndexingOfSwizzledVector, RemoveInvariantAndCentroidForESSL3, + RequireCachedBitForStagingBuffer, RequireGpuFamily2, RequireMsl21, RescopeGlobalVariables, ResetTexImage2DBaseLevel, + ResyncDepthRangeOnClipControl, RetainSPIRVDebugInfo, RewriteFloatUnaryMinusOperator, RewriteRepeatedAssignToSwizzled, @@ -257,6 +274,7 @@ enum class Feature { SupportsExtendedDynamicState2, SupportsExternalFenceCapabilities, SupportsExternalFenceFd, + SupportsExternalFormatResolve, SupportsExternalMemoryDmaBufAndModifiers, SupportsExternalMemoryFd, SupportsExternalMemoryFuchsia, @@ -264,7 +282,6 @@ enum class Feature { SupportsExternalSemaphoreCapabilities, SupportsExternalSemaphoreFd, SupportsExternalSemaphoreFuchsia, - SupportsFilteringPrecision, SupportsFormatFeatureFlags2, SupportsFragmentShaderInterlockARB, SupportsFragmentShaderInterlockNV, @@ -293,6 +310,7 @@ enum class Feature { SupportsMultisampledRenderToSingleSampled, SupportsMultisampledRenderToSingleSampledGOOGLEX, SupportsMultiview, + SupportsNonConstantLoopIndexing, SupportsPipelineCreationCacheControl, SupportsPipelineCreationFeedback, SupportsPipelineProtectedAccess, @@ -346,6 +364,7 @@ enum class Feature { UseDepthWriteEnableDynamicState, UseFrontFaceDynamicState, UseInstancedPointSpriteEmulation, + UseIntermediateTextureForGenerateMipmap, UseMultipleDescriptorsForExternalFormats, UseNonZeroStencilWriteMaskStaticState, UsePrimitiveRestartEnableDynamicState, @@ -362,7 +381,9 @@ enum class Feature { VertexIDDoesNotIncludeBaseVertex, WaitIdleBeforeSwapchainRecreation, WarmUpPipelineCacheAtLink, + WriteHelperSampleMask, ZeroMaxLodWorkaround, InvalidEnum, -} \ No newline at end of file + //EnumCount = InvalidEnum, +}; \ No newline at end of file diff --git a/bindings/angle/gradle.properties b/bindings/angle/gradle.properties new file mode 100644 index 00000000..1a9f3845 --- /dev/null +++ b/bindings/angle/gradle.properties @@ -0,0 +1,3 @@ +# Enable to use panama class on klang gradle plugin +org.gradle.jvmargs=--enable-preview +org.gradle.daemon=false \ No newline at end of file diff --git a/bindings/angle/gradle/libs.versions.toml b/bindings/angle/gradle/libs.versions.toml index 12809027..849f8965 100644 --- a/bindings/angle/gradle/libs.versions.toml +++ b/bindings/angle/gradle/libs.versions.toml @@ -2,6 +2,7 @@ kotest = "5.6.1" klang = "0.0.0" jna = "5.13.0" +kotlin = "1.9.22" [libraries] kotest = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" } diff --git a/bindings/angle/gradle/wrapper/gradle-wrapper.jar b/bindings/angle/gradle/wrapper/gradle-wrapper.jar index c1962a79..7f93135c 100644 Binary files a/bindings/angle/gradle/wrapper/gradle-wrapper.jar and b/bindings/angle/gradle/wrapper/gradle-wrapper.jar differ diff --git a/bindings/angle/gradle/wrapper/gradle-wrapper.properties b/bindings/angle/gradle/wrapper/gradle-wrapper.properties index c30b486a..a80b22ce 100644 --- a/bindings/angle/gradle/wrapper/gradle-wrapper.properties +++ b/bindings/angle/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/bindings/angle/gradlew b/bindings/angle/gradlew index aeb74cbb..0adc8e1a 100755 --- a/bindings/angle/gradlew +++ b/bindings/angle/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. diff --git a/bindings/angle/libangle/build.gradle.kts b/bindings/angle/libangle/build.gradle.kts index 4fe64dee..78a5a796 100644 --- a/bindings/angle/libangle/build.gradle.kts +++ b/bindings/angle/libangle/build.gradle.kts @@ -1,6 +1,8 @@ +import io.ygdrasil.ParsingMethod import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent -import java.net.URL +import java.net.URI +import io.ygdrasil.noMacros buildscript { dependencies { @@ -14,7 +16,7 @@ buildscript { } plugins { - kotlin("jvm") version "1.9.10" + kotlin("jvm") version libs.versions.kotlin alias(libs.plugins.klang) } @@ -49,12 +51,16 @@ sourceSets.main { java.srcDirs(buildDir) } -val headerUrl = URL("https://github.com/klang-toolkit/ANGLE-binary/releases/download/2-beta/headers.zip") +val headerUrl = URI("https://github.com/klang-toolkit/ANGLE-binary/releases/download/2-beta/headers.zip") + .toURL() klang { + + parsingMethod = ParsingMethod.Libclang + download(headerUrl) .let(::unpack) - .let { parse(fileToParse = "EGL/egl.h", at = it) { } } + .let { parse(fileToParse = "EGL/egl.h", at = it, noMacros) { } } generateBinding("libangle", "EGL") } diff --git a/bindings/angle/libangle/src/main/kotlin/libangle/Constants.kt b/bindings/angle/libangle/src/main/kotlin/libangle/Constants.kt deleted file mode 100644 index 99a3d169..00000000 --- a/bindings/angle/libangle/src/main/kotlin/libangle/Constants.kt +++ /dev/null @@ -1,111 +0,0 @@ -package libangle - -const val EGL_COLOR_COMPONENT_TYPE_EXT = 0x3339 -const val EGL_COLOR_COMPONENT_TYPE_FIXED_EXT = 0x333A -const val EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT = 0x333B - -const val EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT = 0x30BF -const val EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT = 0x3138 -const val EGL_NO_RESET_NOTIFICATION_EXT = 0x31BE -const val EGL_LOSE_CONTEXT_ON_RESET_EXT = 0x31BF - -const val EGL_ALPHA_FORMAT = 0x3088 -const val EGL_ALPHA_FORMAT_NONPRE = 0x308B -const val EGL_ALPHA_FORMAT_PRE = 0x308C -const val EGL_ALPHA_MASK_SIZE = 0x303E -const val EGL_BUFFER_PRESERVED = 0x3094 -const val EGL_BUFFER_DESTROYED = 0x3095 -const val EGL_CLIENT_APIS = 0x308D -const val EGL_COLORSPACE = 0x3087 -const val EGL_COLORSPACE_sRGB = 0x3089 -const val EGL_COLORSPACE_LINEAR = 0x308A -const val EGL_COLOR_BUFFER_TYPE = 0x303F -const val EGL_CONTEXT_CLIENT_TYPE = 0x3097 -const val EGL_DISPLAY_SCALING = 10000 -const val EGL_HORIZONTAL_RESOLUTION = 0x3090 -const val EGL_LUMINANCE_BUFFER = 0x308F -const val EGL_LUMINANCE_SIZE = 0x303D -const val EGL_OPENGL_ES_BIT = 0x0001 -const val EGL_OPENVG_BIT = 0x0002 -const val EGL_OPENGL_ES_API = 0x30A0 -const val EGL_OPENVG_API = 0x30A1 -const val EGL_OPENVG_IMAGE = 0x3096 -const val EGL_PIXEL_ASPECT_RATIO = 0x3092 -const val EGL_RENDERABLE_TYPE = 0x3040 -const val EGL_RENDER_BUFFER = 0x3086 -const val EGL_RGB_BUFFER = 0x308E -const val EGL_SINGLE_BUFFER = 0x3085 -const val EGL_SWAP_BEHAVIOR = 0x3093 -const val EGL_UNKNOWN = -1 -const val EGL_VERTICAL_RESOLUTION = 0x3091 - -const val EGL_PLATFORM_ANGLE_ANGLE = 0x3202 -const val EGL_PLATFORM_ANGLE_TYPE_ANGLE = 0x3203 -const val EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE = 0x3204 -const val EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE = 0x3205 -const val EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE = 0x3206 -const val EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED_ANGLE = 0x3451 -const val EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE = 0x3209 -const val EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE = 0x320A -const val EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE = 0x345E -const val EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE = 0x348F - -const val EGL_ALPHA_SIZE = 0x3021 -const val EGL_BAD_ACCESS = 0x3002 -const val EGL_BAD_ALLOC = 0x3003 -const val EGL_BAD_ATTRIBUTE = 0x3004 -const val EGL_BAD_CONFIG = 0x3005 -const val EGL_BAD_CONTEXT = 0x3006 -const val EGL_BAD_CURRENT_SURFACE = 0x3007 -const val EGL_BAD_DISPLAY = 0x3008 -const val EGL_BAD_MATCH = 0x3009 -const val EGL_BAD_NATIVE_PIXMAP = 0x300A -const val EGL_BAD_NATIVE_WINDOW = 0x300B -const val EGL_BAD_PARAMETER = 0x300C -const val EGL_BAD_SURFACE = 0x300D -const val EGL_BLUE_SIZE = 0x3022 -const val EGL_BUFFER_SIZE = 0x3020 -const val EGL_CONFIG_CAVEAT = 0x3027 -const val EGL_CONFIG_ID = 0x3028 -const val EGL_CORE_NATIVE_ENGINE = 0x305B -const val EGL_DEPTH_SIZE = 0x3025 -const val EGL_DONT_CARE = -1 -const val EGL_DRAW = 0x3059 -const val EGL_EXTENSIONS = 0x3055 -const val EGL_FALSE = 0 -const val EGL_GREEN_SIZE = 0x3023 -const val EGL_HEIGHT = 0x3056 -const val EGL_LARGEST_PBUFFER = 0x3058 -const val EGL_LEVEL = 0x3029 -const val EGL_MAX_PBUFFER_HEIGHT = 0x302A -const val EGL_MAX_PBUFFER_PIXELS = 0x302B -const val EGL_MAX_PBUFFER_WIDTH = 0x302C -const val EGL_NATIVE_RENDERABLE = 0x302D -const val EGL_NATIVE_VISUAL_ID = 0x302E -const val EGL_NATIVE_VISUAL_TYPE = 0x302F -const val EGL_NONE = 0x3038 -const val EGL_NON_CONFORMANT_CONFIG = 0x3051 -const val EGL_NOT_INITIALIZED = 0x3001 -const val EGL_NO_CONTEXT: EGLContext? = null -const val EGL_NO_DISPLAY: EGLDisplay? = null -const val EGL_NO_SURFACE: EGLSurface? = null -const val EGL_PBUFFER_BIT = 0x0001 -const val EGL_PIXMAP_BIT = 0x0002 -const val EGL_READ = 0x305A -const val EGL_RED_SIZE = 0x3024 -const val EGL_SAMPLES = 0x3031 -const val EGL_SAMPLE_BUFFERS = 0x3032 -const val EGL_SLOW_CONFIG = 0x3050 -const val EGL_STENCIL_SIZE = 0x3026 -const val EGL_SUCCESS = 0x3000 -const val EGL_SURFACE_TYPE = 0x3033 -const val EGL_TRANSPARENT_BLUE_VALUE = 0x3035 -const val EGL_TRANSPARENT_GREEN_VALUE = 0x3036 -const val EGL_TRANSPARENT_RED_VALUE = 0x3037 -const val EGL_TRANSPARENT_RGB = 0x3052 -const val EGL_TRANSPARENT_TYPE = 0x3034 -const val EGL_TRUE = 1 -const val EGL_VENDOR = 0x3053 -const val EGL_VERSION = 0x3054 -const val EGL_WIDTH = 0x3057 -const val EGL_WINDOW_BIT = 0x0004 diff --git a/bindings/angle/libangle/src/main/kotlin/libangle/FixTypeAlias.kt b/bindings/angle/libangle/src/main/kotlin/libangle/FixTypeAlias.kt deleted file mode 100644 index 6465de2f..00000000 --- a/bindings/angle/libangle/src/main/kotlin/libangle/FixTypeAlias.kt +++ /dev/null @@ -1,4 +0,0 @@ -package libangle - - -typealias GLuint = Int \ No newline at end of file diff --git a/bindings/angle/libangle/src/main/kotlin/libangle/Library.kt b/bindings/angle/libangle/src/main/kotlin/libangle/Library.kt deleted file mode 100644 index 84884ce3..00000000 --- a/bindings/angle/libangle/src/main/kotlin/libangle/Library.kt +++ /dev/null @@ -1,4 +0,0 @@ -package libangle - -class Library { -} \ No newline at end of file diff --git a/bindings/angle/libangle/src/main/kotlin/libangle/UnionDelegate.kt b/bindings/angle/libangle/src/main/kotlin/libangle/UnionDelegate.kt deleted file mode 100644 index 5f1d44fa..00000000 --- a/bindings/angle/libangle/src/main/kotlin/libangle/UnionDelegate.kt +++ /dev/null @@ -1 +0,0 @@ -package libangle diff --git a/bindings/angle/libangle/src/main/kotlin/main.kt b/bindings/angle/libangle/src/main/kotlin/main.kt deleted file mode 100644 index e82bfd5c..00000000 --- a/bindings/angle/libangle/src/main/kotlin/main.kt +++ /dev/null @@ -1,49 +0,0 @@ -import com.sun.jna.Native -import com.sun.jna.ptr.IntByReference -import libangle.EGLDisplay -import libangle.EGLSurface -import libangle.libEGLLibrary -import java.awt.Component -import java.lang.reflect.Field -import javax.swing.JFrame - - -fun main() { - val frame = JFrame("test").apply { - setSize(800, 600) - pack() - isVisible = true - } - val windowId = Native.getComponentID(frame) - println("windowId: $windowId") - val field: Field = Component::class.java.getDeclaredField("peer") - field.setAccessible(true) - val peer = field.get(frame) - println("peer: $peer") - //frame.peer - //val context = Context(frame) - -} - - -class Window : JFrame("test") { - -} - - -class Context(val mDisplay: EGLDisplay) { - - lateinit var mSurface: EGLSurface - - init { - val majorVersion = IntByReference() - majorVersion.value = 3 - val minorVersion = IntByReference() - majorVersion.value = 2 - libEGLLibrary.eglInitialize(mDisplay, majorVersion.pointer, minorVersion.pointer) - } - - fun swap() { - libEGLLibrary.eglSwapBuffers(mDisplay, mSurface) - } -} \ No newline at end of file diff --git a/bindings/angle/libgles/build.gradle.kts b/bindings/angle/libgles/build.gradle.kts index 38d25e1e..5f86ff0c 100644 --- a/bindings/angle/libgles/build.gradle.kts +++ b/bindings/angle/libgles/build.gradle.kts @@ -1,8 +1,10 @@ +import io.ygdrasil.ParsingMethod import klang.domain.typeOf import klang.domain.unchecked import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent -import java.net.URL +import java.net.URI +import io.ygdrasil.noMacros buildscript { dependencies { @@ -16,7 +18,7 @@ buildscript { } plugins { - kotlin("jvm") version "1.9.10" + kotlin("jvm") version libs.versions.kotlin alias(libs.plugins.klang) } @@ -50,15 +52,19 @@ sourceSets.main { java.srcDirs(buildDir) } -val headerUrl = URL("https://github.com/klang-toolkit/ANGLE-binary/releases/download/2-beta/headers.zip") +val headerUrl = URI("https://github.com/klang-toolkit/ANGLE-binary/releases/download/2-beta/headers.zip") + .toURL() klang { + + parsingMethod = ParsingMethod.Libclang + download(headerUrl) .let(::unpack) .let { - parse(fileToParse = "GLES3/gl3.h", at = it) { + parse(fileToParse = "GLES3/gl3.h", at = it, noMacros) { findFunctionByName("glShaderSource")?.let { function -> - function.arguments.first { it.name == "string" }.apply { + function.arguments.first { it.name?.value == "string" }.apply { type = typeOf("char *").unchecked() } } diff --git a/bindings/angle/libgles/src/main/kotlin/libgles/Constants.kt b/bindings/angle/libgles/src/main/kotlin/libgles/Constants.kt deleted file mode 100644 index 256220b8..00000000 --- a/bindings/angle/libgles/src/main/kotlin/libgles/Constants.kt +++ /dev/null @@ -1,382 +0,0 @@ -package libgles - - -const val GL_DEPTH_BUFFER_BIT = 0x00000100 -const val GL_STENCIL_BUFFER_BIT = 0x00000400 -const val GL_COLOR_BUFFER_BIT = 0x00004000 -const val GL_FALSE = 0 -const val GL_TRUE = 1 -const val GL_POINTS = 0x0000 -const val GL_LINES = 0x0001 -const val GL_LINE_LOOP = 0x0002 -const val GL_LINE_STRIP = 0x0003 -const val GL_TRIANGLES = 0x0004 -const val GL_TRIANGLE_STRIP = 0x0005 -const val GL_TRIANGLE_FAN = 0x0006 -const val GL_ZERO = 0 -const val GL_ONE = 1 -const val GL_SRC_COLOR = 0x0300 -const val GL_ONE_MINUS_SRC_COLOR = 0x0301 -const val GL_SRC_ALPHA = 0x0302 -const val GL_ONE_MINUS_SRC_ALPHA = 0x0303 -const val GL_DST_ALPHA = 0x0304 -const val GL_ONE_MINUS_DST_ALPHA = 0x0305 -const val GL_DST_COLOR = 0x0306 -const val GL_ONE_MINUS_DST_COLOR = 0x0307 -const val GL_SRC_ALPHA_SATURATE = 0x0308 -const val GL_FUNC_ADD = 0x8006 -const val GL_BLEND_EQUATION = 0x8009 -const val GL_BLEND_EQUATION_RGB = 0x8009 -const val GL_BLEND_EQUATION_ALPHA = 0x883D -const val GL_FUNC_SUBTRACT = 0x800A -const val GL_FUNC_REVERSE_SUBTRACT = 0x800B -const val GL_BLEND_DST_RGB = 0x80C8 -const val GL_BLEND_SRC_RGB = 0x80C9 -const val GL_BLEND_DST_ALPHA = 0x80CA -const val GL_BLEND_SRC_ALPHA = 0x80CB -const val GL_CONSTANT_COLOR = 0x8001 -const val GL_ONE_MINUS_CONSTANT_COLOR = 0x8002 -const val GL_CONSTANT_ALPHA = 0x8003 -const val GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004 -const val GL_BLEND_COLOR = 0x8005 -const val GL_ARRAY_BUFFER = 0x8892 -const val GL_ELEMENT_ARRAY_BUFFER = 0x8893 -const val GL_ARRAY_BUFFER_BINDING = 0x8894 -const val GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895 -const val GL_STREAM_DRAW = 0x88E0 -const val GL_STATIC_DRAW = 0x88E4 -const val GL_DYNAMIC_DRAW = 0x88E8 -const val GL_BUFFER_SIZE = 0x8764 -const val GL_BUFFER_USAGE = 0x8765 -const val GL_CURRENT_VERTEX_ATTRIB = 0x8626 -const val GL_FRONT = 0x0404 -const val GL_BACK = 0x0405 -const val GL_FRONT_AND_BACK = 0x0408 -const val GL_TEXTURE_2D = 0x0DE1 -const val GL_CULL_FACE = 0x0B44 -const val GL_BLEND = 0x0BE2 -const val GL_DITHER = 0x0BD0 -const val GL_STENCIL_TEST = 0x0B90 -const val GL_DEPTH_TEST = 0x0B71 -const val GL_SCISSOR_TEST = 0x0C11 -const val GL_POLYGON_OFFSET_FILL = 0x8037 -const val GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E -const val GL_SAMPLE_COVERAGE = 0x80A0 -const val GL_NO_ERROR = 0 -const val GL_INVALID_ENUM = 0x0500 -const val GL_INVALID_VALUE = 0x0501 -const val GL_INVALID_OPERATION = 0x0502 -const val GL_OUT_OF_MEMORY = 0x0505 -const val GL_CW = 0x0900 -const val GL_CCW = 0x0901 -const val GL_LINE_WIDTH = 0x0B21 -const val GL_ALIASED_POINT_SIZE_RANGE = 0x846D -const val GL_ALIASED_LINE_WIDTH_RANGE = 0x846E -const val GL_CULL_FACE_MODE = 0x0B45 -const val GL_FRONT_FACE = 0x0B46 -const val GL_DEPTH_RANGE = 0x0B70 -const val GL_DEPTH_WRITEMASK = 0x0B72 -const val GL_DEPTH_CLEAR_VALUE = 0x0B73 -const val GL_DEPTH_FUNC = 0x0B74 -const val GL_STENCIL_CLEAR_VALUE = 0x0B91 -const val GL_STENCIL_FUNC = 0x0B92 -const val GL_STENCIL_FAIL = 0x0B94 -const val GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95 -const val GL_STENCIL_PASS_DEPTH_PASS = 0x0B96 -const val GL_STENCIL_REF = 0x0B97 -const val GL_STENCIL_VALUE_MASK = 0x0B93 -const val GL_STENCIL_WRITEMASK = 0x0B98 -const val GL_STENCIL_BACK_FUNC = 0x8800 -const val GL_STENCIL_BACK_FAIL = 0x8801 -const val GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802 -const val GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803 -const val GL_STENCIL_BACK_REF = 0x8CA3 -const val GL_STENCIL_BACK_VALUE_MASK = 0x8CA4 -const val GL_STENCIL_BACK_WRITEMASK = 0x8CA5 -const val GL_VIEWPORT = 0x0BA2 -const val GL_SCISSOR_BOX = 0x0C10 -const val GL_COLOR_CLEAR_VALUE = 0x0C22 -const val GL_COLOR_WRITEMASK = 0x0C23 -const val GL_UNPACK_ALIGNMENT = 0x0CF5 -const val GL_PACK_ALIGNMENT = 0x0D05 -const val GL_MAX_TEXTURE_SIZE = 0x0D33 -const val GL_MAX_VIEWPORT_DIMS = 0x0D3A -const val GL_SUBPIXEL_BITS = 0x0D50 -const val GL_RED_BITS = 0x0D52 -const val GL_GREEN_BITS = 0x0D53 -const val GL_BLUE_BITS = 0x0D54 -const val GL_ALPHA_BITS = 0x0D55 -const val GL_DEPTH_BITS = 0x0D56 -const val GL_STENCIL_BITS = 0x0D57 -const val GL_POLYGON_OFFSET_UNITS = 0x2A00 -const val GL_POLYGON_OFFSET_FACTOR = 0x8038 -const val GL_TEXTURE_BINDING_2D = 0x8069 -const val GL_SAMPLE_BUFFERS = 0x80A8 -const val GL_SAMPLES = 0x80A9 -const val GL_SAMPLE_COVERAGE_VALUE = 0x80AA -const val GL_SAMPLE_COVERAGE_INVERT = 0x80 -const val GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2 -const val GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3 -const val GL_DONT_CARE = 0x1100 -const val GL_FASTEST = 0x1101 -const val GL_NICEST = 0x1102 -const val GL_GENERATE_MIPMAP_HINT = 0x8192 -const val GL_BYTE = 0x1400 -const val GL_UNSIGNED_BYTE = 0x1401 -const val GL_SHORT = 0x1402 -const val GL_UNSIGNED_SHORT = 0x1403 -const val GL_INT = 0x1404 -const val GL_UNSIGNED_INT = 0x1405 -const val GL_FLOAT = 0x1406 -const val GL_FIXED = 0x140C -const val GL_DEPTH_COMPONENT = 0x1902 -const val GL_ALPHA = 0x1906 -const val GL_RGB = 0x1907 -const val GL_RGBA = 0x1908 -const val GL_LUMINANCE = 0x1909 -const val GL_LUMINANCE_ALPHA = 0x190A -const val GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033 -const val GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034 -const val GL_UNSIGNED_SHORT_5_6_5 = 0x8363 -const val GL_FRAGMENT_SHADER = 0x8B30 -const val GL_VERTEX_SHADER = 0x8B31 -const val GL_MAX_VERTEX_ATTRIBS = 0x8869 -const val GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB -const val GL_MAX_VARYING_VECTORS = 0x8DFC -const val GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D -const val GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C -const val GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872 -const val GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD -const val GL_SHADER_TYPE = 0x8B4F -const val GL_DELETE_STATUS = 0x8B80 -const val GL_LINK_STATUS = 0x8B82 -const val GL_VALIDATE_STATUS = 0x8B83 -const val GL_ATTACHED_SHADERS = 0x8B85 -const val GL_ACTIVE_UNIFORMS = 0x8B86 -const val GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87 -const val GL_ACTIVE_ATTRIBUTES = 0x8B89 -const val GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A -const val GL_SHADING_LANGUAGE_VERSION = 0x8B8C -const val GL_CURRENT_PROGRAM = 0x8B8D -const val GL_NEVER = 0x0200 -const val GL_LESS = 0x0201 -const val GL_EQUAL = 0x0202 -const val GL_LEQUAL = 0x0203 -const val GL_GREATER = 0x0204 -const val GL_NOTEQUAL = 0x0205 -const val GL_GEQUAL = 0x0206 -const val GL_ALWAYS = 0x0207 -const val GL_KEEP = 0x1E00 -const val GL_REPLACE = 0x1E01 -const val GL_INCR = 0x1E02 -const val GL_DECR = 0x1E03 -const val GL_INVERT = 0x150A -const val GL_INCR_WRAP = 0x8507 -const val GL_DECR_WRAP = 0x8508 -const val GL_VENDOR = 0x1F00 -const val GL_RENDERER = 0x1F01 -const val GL_VERSION = 0x1F02 -const val GL_EXTENSIONS = 0x1F03 -const val GL_NEAREST = 0x2600 -const val GL_LINEAR = 0x2601 -const val GL_NEAREST_MIPMAP_NEAREST = 0x2700 -const val GL_LINEAR_MIPMAP_NEAREST = 0x2701 -const val GL_NEAREST_MIPMAP_LINEAR = 0x2702 -const val GL_LINEAR_MIPMAP_LINEAR = 0x2703 -const val GL_TEXTURE_MAG_FILTER = 0x2800 -const val GL_TEXTURE_MIN_FILTER = 0x2801 -const val GL_TEXTURE_WRAP_S = 0x2802 -const val GL_TEXTURE_WRAP_T = 0x2803 -const val GL_TEXTURE = 0x1702 -const val GL_TEXTURE_CUBE_MAP = 0x8513 -const val GL_TEXTURE_BINDING_CUBE_MAP = 0x8514 -const val GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515 -const val GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516 -const val GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517 -const val GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518 -const val GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519 -const val GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A -const val GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C -const val GL_TEXTURE0 = 0x84C0 -const val GL_TEXTURE1 = 0x84C1 -const val GL_TEXTURE2 = 0x84C2 -const val GL_TEXTURE3 = 0x84C3 -const val GL_TEXTURE4 = 0x84C4 -const val GL_TEXTURE5 = 0x84C5 -const val GL_TEXTURE6 = 0x84C6 -const val GL_TEXTURE7 = 0x84C7 -const val GL_TEXTURE8 = 0x84C8 -const val GL_TEXTURE9 = 0x84C9 -const val GL_TEXTURE10 = 0x84CA -const val GL_TEXTURE11 = 0x84CB -const val GL_TEXTURE12 = 0x84CC -const val GL_TEXTURE13 = 0x84CD -const val GL_TEXTURE14 = 0x84CE -const val GL_TEXTURE15 = 0x84CF -const val GL_TEXTURE16 = 0x84D0 -const val GL_TEXTURE17 = 0x84D1 -const val GL_TEXTURE18 = 0x84D2 -const val GL_TEXTURE19 = 0x84D3 -const val GL_TEXTURE20 = 0x84D4 -const val GL_TEXTURE21 = 0x84D5 -const val GL_TEXTURE22 = 0x84D6 -const val GL_TEXTURE23 = 0x84D7 -const val GL_TEXTURE24 = 0x84D8 -const val GL_TEXTURE25 = 0x84D9 -const val GL_TEXTURE26 = 0x84DA -const val GL_TEXTURE27 = 0x84DB -const val GL_TEXTURE28 = 0x84DC -const val GL_TEXTURE29 = 0x84DD -const val GL_TEXTURE30 = 0x84DE -const val GL_TEXTURE31 = 0x84DF -const val GL_ACTIVE_TEXTURE = 0x84E0 -const val GL_REPEAT = 0x2901 -const val GL_CLAMP_TO_EDGE = 0x812F -const val GL_MIRRORED_REPEAT = 0x8370 -const val GL_FLOAT_VEC2 = 0x8B50 -const val GL_FLOAT_VEC3 = 0x8B51 -const val GL_FLOAT_VEC4 = 0x8B52 -const val GL_INT_VEC2 = 0x8B53 -const val GL_INT_VEC3 = 0x8B54 -const val GL_INT_VEC4 = 0x8B55 -const val GL_BOOL = 0x8B56 -const val GL_BOOL_VEC2 = 0x8B57 -const val GL_BOOL_VEC3 = 0x8B58 -const val GL_BOOL_VEC4 = 0x8B59 -const val GL_FLOAT_MAT2 = 0x8B5A -const val GL_FLOAT_MAT3 = 0x8B5B -const val GL_FLOAT_MAT4 = 0x8B5C -const val GL_SAMPLER_2D = 0x8B5E -const val GL_SAMPLER_CUBE = 0x8B60 -const val GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622 -const val GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623 -const val GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624 -const val GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625 -const val GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A -const val GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645 -const val GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F -const val GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A -const val GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B -const val GL_COMPILE_STATUS = 0x8B81 -const val GL_INFO_LOG_LENGTH = 0x8B84 -const val GL_SHADER_SOURCE_LENGTH = 0x8B88 -const val GL_SHADER_COMPILER = 0x8DFA -const val GL_SHADER_BINARY_FORMATS = 0x8DF8 -const val GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9 -const val GL_LOW_FLOAT = 0x8DF0 -const val GL_MEDIUM_FLOAT = 0x8DF1 -const val GL_HIGH_FLOAT = 0x8DF2 -const val GL_LOW_INT = 0x8DF3 -const val GL_MEDIUM_INT = 0x8DF4 -const val GL_HIGH_INT = 0x8DF5 -const val GL_FRAMEBUFFER = 0x8D40 -const val GL_RENDERBUFFER = 0x8D41 -const val GL_RGBA4 = 0x8056 -const val GL_RGB5_A1 = 0x8057 -const val GL_RGB565 = 0x8D62 -const val GL_DEPTH_COMPONENT16 = 0x81A5 -const val GL_STENCIL_INDEX8 = 0x8D48 -const val GL_RENDERBUFFER_WIDTH = 0x8D42 -const val GL_RENDERBUFFER_HEIGHT = 0x8D43 -const val GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44 -const val GL_RENDERBUFFER_RED_SIZE = 0x8D50 -const val GL_RENDERBUFFER_GREEN_SIZE = 0x8D51 -const val GL_RENDERBUFFER_BLUE_SIZE = 0x8D52 -const val GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53 -const val GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54 -const val GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55 -const val GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0 -const val GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1 -const val GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2 -const val GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3 -const val GL_COLOR_ATTACHMENT0 = 0x8CE0 -const val GL_DEPTH_ATTACHMENT = 0x8D00 -const val GL_STENCIL_ATTACHMENT = 0x8D20 -const val GL_NONE = 0 -const val GL_FRAMEBUFFER_COMPLETE = 0x8CD5 -const val GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6 -const val GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7 -const val GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9 -const val GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD -const val GL_FRAMEBUFFER_BINDING = 0x8CA6 -const val GL_RENDERBUFFER_BINDING = 0x8CA7 -const val GL_MAX_RENDERBUFFER_SIZE = 0x84E8 -const val GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506 - -const val GL_GEOMETRY_SHADER_EXT = 0x8DD9 -const val GL_GEOMETRY_SHADER_BIT_EXT = 0x00000004 -const val GL_GEOMETRY_LINKED_VERTICES_OUT_EXT = 0x8916 -const val GL_GEOMETRY_LINKED_INPUT_TYPE_EXT = 0x8917 -const val GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT = 0x8918 -const val GL_GEOMETRY_SHADER_INVOCATIONS_EXT = 0x887F -const val GL_LAYER_PROVOKING_VERTEX_EXT = 0x825E -const val GL_LINES_ADJACENCY_EXT = 0x000A -const val GL_LINE_STRIP_ADJACENCY_EXT = 0x000B -const val GL_TRIANGLES_ADJACENCY_EXT = 0x000C -const val GL_TRIANGLE_STRIP_ADJACENCY_EXT = 0x000D -const val GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = 0x8DDF -const val GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT = 0x8A2C -const val GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT = 0x8A32 -const val GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT = 0x9123 -const val GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT = 0x9124 -const val GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT = 0x8DE0 -const val GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = 0x8DE1 -const val GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT = 0x8E5A -const val GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = 0x8C29 -const val GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT = 0x92CF -const val GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT = 0x92D5 -const val GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT = 0x90CD -const val GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT = 0x90D7 -const val GL_FIRST_VERTEX_CONVENTION_EXT = 0x8E4D -const val GL_LAST_VERTEX_CONVENTION_EXT = 0x8E4E -const val GL_UNDEFINED_VERTEX_EXT = 0x8260 -const val GL_PRIMITIVES_GENERATED_EXT = 0x8C87 -const val GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT = 0x9312 -const val GL_MAX_FRAMEBUFFER_LAYERS_EXT = 0x9317 -const val GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = 0x8DA8 -const val GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = 0x8DA7 -const val GL_REFERENCED_BY_GEOMETRY_SHADER_EXT = 0x9309 - -const val GL_PATCHES_EXT = 0x000E -const val GL_PATCH_VERTICES_EXT = 0x8E72 -const val GL_TESS_CONTROL_OUTPUT_VERTICES_EXT = 0x8E75 -const val GL_TESS_GEN_MODE_EXT = 0x8E76 -const val GL_TESS_GEN_SPACING_EXT = 0x8E77 -const val GL_TESS_GEN_VERTEX_ORDER_EXT = 0x8E78 -const val GL_TESS_GEN_POINT_MODE_EXT = 0x8E79 -const val GL_ISOLINES_EXT = 0x8E7A -const val GL_QUADS_EXT = 0x0007 -const val GL_FRACTIONAL_ODD_EXT = 0x8E7B -const val GL_FRACTIONAL_EVEN_EXT = 0x8E7C -const val GL_MAX_PATCH_VERTICES_EXT = 0x8E7D -const val GL_MAX_TESS_GEN_LEVEL_EXT = 0x8E7E -const val GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT = 0x8E7F -const val GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT = 0x8E80 -const val GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT = 0x8E81 -const val GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT = 0x8E82 -const val GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT = 0x8E83 -const val GL_MAX_TESS_PATCH_COMPONENTS_EXT = 0x8E84 -const val GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT = 0x8E85 -const val GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT = 0x8E86 -const val GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT = 0x8E89 -const val GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT = 0x8E8A -const val GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT = 0x886C -const val GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT = 0x886D -const val GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT = 0x8E1E -const val GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT = 0x8E1F -const val GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT = 0x92CD -const val GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT = 0x92CE -const val GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT = 0x92D3 -const val GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT = 0x92D4 -const val GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT = 0x90CB -const val GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT = 0x90CC -const val GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT = 0x90D8 -const val GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT = 0x90D9 -const val GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221 -const val GL_IS_PER_PATCH_EXT = 0x92E7 -const val GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT = 0x9307 -const val GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT = 0x9308 -const val GL_TESS_CONTROL_SHADER_EXT = 0x8E88 -const val GL_TESS_EVALUATION_SHADER_EXT = 0x8E87 -const val GL_TESS_CONTROL_SHADER_BIT_EXT = 0x00000008 -const val GL_TESS_EVALUATION_SHADER_BIT_EXT = 0x00000010 \ No newline at end of file diff --git a/bindings/angle/libgles/src/main/kotlin/libgles/FixTypeAlias.kt b/bindings/angle/libgles/src/main/kotlin/libgles/FixTypeAlias.kt deleted file mode 100644 index fecfe574..00000000 --- a/bindings/angle/libgles/src/main/kotlin/libgles/FixTypeAlias.kt +++ /dev/null @@ -1,2 +0,0 @@ -package libges - diff --git a/bindings/angle/libgles/src/main/kotlin/libgles/UnionDelegate.kt b/bindings/angle/libgles/src/main/kotlin/libgles/UnionDelegate.kt deleted file mode 100644 index fa8630c9..00000000 --- a/bindings/angle/libgles/src/main/kotlin/libgles/UnionDelegate.kt +++ /dev/null @@ -1 +0,0 @@ -package libgles diff --git a/bindings/angle/libgles/src/main/kotlin/main.kt b/bindings/angle/libgles/src/main/kotlin/main.kt deleted file mode 100644 index e82bfd5c..00000000 --- a/bindings/angle/libgles/src/main/kotlin/main.kt +++ /dev/null @@ -1,49 +0,0 @@ -import com.sun.jna.Native -import com.sun.jna.ptr.IntByReference -import libangle.EGLDisplay -import libangle.EGLSurface -import libangle.libEGLLibrary -import java.awt.Component -import java.lang.reflect.Field -import javax.swing.JFrame - - -fun main() { - val frame = JFrame("test").apply { - setSize(800, 600) - pack() - isVisible = true - } - val windowId = Native.getComponentID(frame) - println("windowId: $windowId") - val field: Field = Component::class.java.getDeclaredField("peer") - field.setAccessible(true) - val peer = field.get(frame) - println("peer: $peer") - //frame.peer - //val context = Context(frame) - -} - - -class Window : JFrame("test") { - -} - - -class Context(val mDisplay: EGLDisplay) { - - lateinit var mSurface: EGLSurface - - init { - val majorVersion = IntByReference() - majorVersion.value = 3 - val minorVersion = IntByReference() - majorVersion.value = 2 - libEGLLibrary.eglInitialize(mDisplay, majorVersion.pointer, minorVersion.pointer) - } - - fun swap() { - libEGLLibrary.eglSwapBuffers(mDisplay, mSurface) - } -} \ No newline at end of file diff --git a/bindings/angle/settings.gradle.kts b/bindings/angle/settings.gradle.kts index 3e7005ca..168f462b 100644 --- a/bindings/angle/settings.gradle.kts +++ b/bindings/angle/settings.gradle.kts @@ -8,7 +8,7 @@ pluginManagement { } } -include(":libgles") -include(":libangle") +include(":libgles", ":libangle", ":binaries") findProject(":libangle")?.name = "angle4k" +findProject(":binaries")?.name = "angle-binaries" include("example") diff --git a/bindings/clang/gradle/wrapper/gradle-wrapper.properties b/bindings/clang/gradle/wrapper/gradle-wrapper.properties index 17a8ddce..3499ded5 100644 --- a/bindings/clang/gradle/wrapper/gradle-wrapper.properties +++ b/bindings/clang/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/bindings/darwin/darwin/foundation/.gitignore b/bindings/darwin/darwin/foundation/.gitignore index b63da455..2fa99da5 100644 --- a/bindings/darwin/darwin/foundation/.gitignore +++ b/bindings/darwin/darwin/foundation/.gitignore @@ -39,4 +39,7 @@ bin/ .vscode/ ### Mac OS ### -.DS_Store \ No newline at end of file +.DS_Store + + +*.jar diff --git a/bindings/darwin/darwin/foundation/build.gradle.kts b/bindings/darwin/darwin/foundation/build.gradle.kts index fe17730e..2f47f8d6 100644 --- a/bindings/darwin/darwin/foundation/build.gradle.kts +++ b/bindings/darwin/darwin/foundation/build.gradle.kts @@ -2,12 +2,20 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { - kotlin("jvm") + kotlin("jvm") version libs.versions.kotlin } +repositories { + mavenLocal() + mavenCentral() +} + +group = "io.ygdrasil" +version = "0.0.0" + dependencies { api ("net.java.dev.jna:jna:5.13.0") - implementation(project(":klang")) + api("$group:klang:$version") testImplementation("org.junit.jupiter:junit-jupiter") testImplementation(libs.kotest) } @@ -31,3 +39,17 @@ tasks.test { sourceSets.main { //java.srcDirs("src/main/generated") } + +kotlin { + jvmToolchain(21) + + sourceSets.all { + languageSettings { + java { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + } + languageVersion = "2.0" + } + } +} diff --git a/bindings/darwin/darwin/foundation/gradle/libs.versions.toml b/bindings/darwin/darwin/foundation/gradle/libs.versions.toml new file mode 100644 index 00000000..3678e8bf --- /dev/null +++ b/bindings/darwin/darwin/foundation/gradle/libs.versions.toml @@ -0,0 +1,11 @@ +[versions] +arrow = "1.2.0" +kotest = "5.6.1" +kotlinpoet = "1.14.2" +kotlin = "1.9.22" + +[libraries] +arrow-core = { module = "io.arrow-kt:arrow-core", version.ref = "arrow" } +arrow-fx-coroutines = { module = "io.arrow-kt:arrow-fx-coroutines", version.ref = "arrow" } +kotest = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" } +kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" } \ No newline at end of file diff --git a/bindings/darwin/darwin/foundation/gradle/wrapper/gradle-wrapper.properties b/bindings/darwin/darwin/foundation/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..1af9e093 --- /dev/null +++ b/bindings/darwin/darwin/foundation/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/bindings/darwin/darwin/foundation/gradlew b/bindings/darwin/darwin/foundation/gradlew new file mode 100755 index 00000000..1aa94a42 --- /dev/null +++ b/bindings/darwin/darwin/foundation/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/bindings/darwin/darwin/foundation/gradlew.bat b/bindings/darwin/darwin/foundation/gradlew.bat new file mode 100644 index 00000000..93e3f59f --- /dev/null +++ b/bindings/darwin/darwin/foundation/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/bindings/darwin/darwin/foundation/settings.gradle.kts b/bindings/darwin/darwin/foundation/settings.gradle.kts new file mode 100644 index 00000000..99baa252 --- /dev/null +++ b/bindings/darwin/darwin/foundation/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "darwin-foundation" diff --git a/bindings/darwin/darwin/foundation/src/main/kotlin/generation/Generate.kt b/bindings/darwin/darwin/foundation/src/main/kotlin/generation/Generate.kt index ca6a6083..35b3d5ed 100644 --- a/bindings/darwin/darwin/foundation/src/main/kotlin/generation/Generate.kt +++ b/bindings/darwin/darwin/foundation/src/main/kotlin/generation/Generate.kt @@ -5,12 +5,13 @@ import klang.domain.NativeDeclaration import klang.domain.NativeEnumeration import klang.domain.ObjectiveCClass import klang.findDeclarationByName +import klang.generator.JnaBindingGenerator import klang.generator.generateKotlinFile import klang.parser.json.ParserRepository import klang.parser.json.parseAstJson import java.io.File -const val baseDirectory = "binding/darwin/foundation/" +const val baseDirectory = "binding/darwin/darwin/foundation/" const val astPath = "${baseDirectory}src/main/objective-c/cocoa.m.ast.json" const val outputDirectory = "${baseDirectory}src/main/generated/" @@ -35,13 +36,16 @@ fun main() { cleanupTargetPath() + with(JnaBindingGenerator) { + generateKotlinFiles(File(outputDirectory), "darwin", "na") + } + declarations .filterIsInstance() - .filter { it.name != "NSString" } - .filter { it.name == "NSWindow" || it is NativeEnumeration } + .filter { it.name.toString() != "NSString" } + .filter { it.name.toString() == "NSWindow" || it is NativeEnumeration } .forEach(::generateKotlinFile) - } @@ -50,7 +54,7 @@ fun main() { private fun generateKotlinFile(declaration: NativeDeclaration) { when (declaration) { is ObjectiveCClass -> declaration.generateKotlinFile("${outputDirectory}darwin/") - is NativeEnumeration -> declaration.generateKotlinFile(outputDirectory) + //is NativeEnumeration -> declaration.toSpecAsEnumeration("darwin")//outputDirectory) else -> println("Not implemented: $declaration") } } diff --git a/bindings/darwin/darwin/foundation/src/main/kotlin/generation/TypeRefToKotlinType.kt b/bindings/darwin/darwin/foundation/src/main/kotlin/generation/TypeRefToKotlinType.kt index 66c237d1..46ae5bfe 100644 --- a/bindings/darwin/darwin/foundation/src/main/kotlin/generation/TypeRefToKotlinType.kt +++ b/bindings/darwin/darwin/foundation/src/main/kotlin/generation/TypeRefToKotlinType.kt @@ -9,7 +9,7 @@ internal fun TypeRef.toKotlinType(): String = when (this) { is ResolvedTypeRef -> toKotlinType() } -private fun ResolvedTypeRef.toKotlinType(): String = typeName +private fun ResolvedTypeRef.toKotlinType(): String = typeName.toString() private fun UnresolvedTypeRef.toKotlinType(): String = when (referenceAsString) { "void" -> "Unit" diff --git a/bindings/darwin/darwin/foundation/src/main/kotlin/klang/generator/NativeEnumeration.kt b/bindings/darwin/darwin/foundation/src/main/kotlin/klang/generator/NativeEnumeration.kt deleted file mode 100644 index 3c33aee7..00000000 --- a/bindings/darwin/darwin/foundation/src/main/kotlin/klang/generator/NativeEnumeration.kt +++ /dev/null @@ -1,13 +0,0 @@ -package klang.generator - -import com.squareup.kotlinpoet.FileSpec -import klang.domain.NativeEnumeration -import klang.mapper.toSpec -import java.io.File - -internal fun NativeEnumeration.generateKotlinFile(outputDirectory: String) { - FileSpec.builder("darwin", "${name}NativeEnumeration") - .addType(this.toSpec()) - .build() - .writeTo(File(outputDirectory)) -} \ No newline at end of file diff --git a/bindings/darwin/darwin/foundation/src/main/kotlin/klang/generator/ObjectiveCClass.kt b/bindings/darwin/darwin/foundation/src/main/kotlin/klang/generator/ObjectiveCClass.kt index 0df77502..4a229e6c 100644 --- a/bindings/darwin/darwin/foundation/src/main/kotlin/klang/generator/ObjectiveCClass.kt +++ b/bindings/darwin/darwin/foundation/src/main/kotlin/klang/generator/ObjectiveCClass.kt @@ -1,6 +1,7 @@ package klang.generator import generation.toKotlinType +import klang.domain.NotBlankString import klang.domain.ObjectiveCClass import java.io.File @@ -40,5 +41,5 @@ private fun ObjectiveCClass.Method.generateMethod(): String { return "\tfun ${name.toMethodName()}(${arguments.joinToString { "${it.name}: ${it.type.toKotlinType()}" }}): ${returnType.toKotlinType()} = ObjectiveC.objc_msgSend(id, sel(\"${name}\"), ${arguments.joinToString { it.name }})" } -private fun String.toMethodName(): String +private fun NotBlankString.toMethodName(): String = split(":").first() diff --git a/bindings/sdl/binaries/build.gradle.kts b/bindings/sdl/binaries/build.gradle.kts new file mode 100644 index 00000000..b7b2173a --- /dev/null +++ b/bindings/sdl/binaries/build.gradle.kts @@ -0,0 +1,27 @@ +import org.jetbrains.kotlin.de.undercouch.gradle.tasks.download.Download + +plugins { + kotlin("jvm") version libs.versions.kotlin +} + + + +val directory = project.file("src/main/resources") +val baseUrl = "https://github.com/klang-toolkit/SDL-binary/releases/download/2.30.0/" +val fileToDownload = listOf( + "libSDL2-aarch64.dylib" to directory.resolve("darwin-aarch64").resolve("libSDL2.dylib"), + "libSDL2-amd64.dylib" to directory.resolve("darwin-amd64").resolve("libSDL2.dylib"), + "libSDL2.dll" to directory.resolve("win32").resolve("libSDL2.dll"), +).forEach { (fileName, target) -> + val url = "$baseUrl$fileName" + val taskName = "downloadFile-$fileName" + tasks.register(taskName) { + onlyIf { !target.exists() } + src(url) + dest(target) + } + + tasks.named("processResources") { + dependsOn(taskName) + } +} \ No newline at end of file diff --git a/bindings/sdl/build.gradle.kts b/bindings/sdl/build.gradle.kts index 636afdab..718c42f9 100644 --- a/bindings/sdl/build.gradle.kts +++ b/bindings/sdl/build.gradle.kts @@ -1,14 +1,60 @@ +plugins { + kotlin("jvm") version libs.versions.kotlin + id("com.gradle.plugin-publish") version "1.0.0" +} + +repositories { + mavenCentral() +} + +group = "io.ygdrasil" +version = "1.0.0-SNAPSHOT" -allprojects { +subprojects { + apply(plugin = "maven-publish") + apply(plugin = "org.jetbrains.kotlin.jvm") - repositories { - mavenCentral() - } + repositories { + mavenCentral() + } group = "io.ygdrasil" version = "1.0.0-SNAPSHOT" + + publishing { + + publications { + create("maven") { + from(components["java"]) + + pom { + name = "Klang-${project.name}" + description = "SDL2 binding" + url = "https://ygdrasil.io/" + licenses { + license { + name = "MIT" + url = "https://opensource.org/license/mit/" + } + } + developers { + developer { + id = "alexandremo" + name = "Alexandre Mommers" + email = "alexandre dot mommers at gmail do com" + } + } + scm { + connection = "scm:git:git://github.com/ygdrasil-io/klang.git" + developerConnection = "scm:git:ssh//git@github.com:ygdrasil-io/klang.git" + url = "https://github.com/ygdrasil-io/klang" + } + } + } + } + } } diff --git a/bindings/sdl/examples/snake/build.gradle.kts b/bindings/sdl/examples/snake/build.gradle.kts new file mode 100644 index 00000000..12fbb434 --- /dev/null +++ b/bindings/sdl/examples/snake/build.gradle.kts @@ -0,0 +1,39 @@ + +plugins { + kotlin("jvm") version libs.versions.kotlin + application + id("org.beryx.jlink") version "3.0.1" +} + +version = "1.0.0" + +dependencies { + api(project(":sdl2-4k")) + api(project(":sdl2-binaries")) + testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation(libs.kotest) +} + +application { + mainModule = "io.ygdrasil" + mainClass.set("io.ygdrasil.snake.MainKt") + applicationDefaultJvmArgs += "-XstartOnFirstThread" + //tasks.run.get().workingDir = project.projectDir.resolve("src").resolve("main").resolve("resources") +} + +jlink { + addOptions("--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages") + launcher{ + moduleName = "io.ygdrasil" + //name = "Snake" + jvmArgs = listOf("-XstartOnFirstThread") + } +} + + +tasks.named("compileJava", JavaCompile::class.java) { + options.compilerArgumentProviders.add(CommandLineArgumentProvider { + // Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work + listOf("--patch-module", "io.ygdrasil=${sourceSets["main"].output.asPath}") + }) +} \ No newline at end of file diff --git a/bindings/sdl/examples/snake/src/main/java/module-info.java b/bindings/sdl/examples/snake/src/main/java/module-info.java new file mode 100644 index 00000000..2eee13a8 --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/java/module-info.java @@ -0,0 +1,5 @@ +module io.ygdrasil { + requires kotlin.stdlib; + requires com.sun.jna; + requires io.ygdrasil.libsdl; +} \ No newline at end of file diff --git a/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/App.kt b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/App.kt new file mode 100644 index 00000000..9e4c2266 --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/App.kt @@ -0,0 +1,55 @@ +package io.ygdrasil.sdl + +import com.sun.jna.Library +import io.ygdrasil.libsdl.* + +private class App : AutoCloseable, AppContext { + + override val window: SDL_Window = createWindow() + override val renderer: SDL_Renderer = createRenderer() + override val textures = mutableListOf() + override val controllers: List = findControllers() + + override fun addTexture(filename: String) = renderer.loadTexture(filename) + .also(textures::add) + + override fun removeTexture(texture: SDL_Texture) { + if (textures.remove(texture)) { + SDL_DestroyTexture(texture) + } + } + + override fun close() { + textures.forEach(::SDL_DestroyTexture) + controllers.forEach(::SDL_GameControllerClose) + SDL_DestroyRenderer(renderer) + SDL_DestroyWindow(window) + SDL_Quit() + } + + private fun createWindow() = SDL_CreateWindow( + "", SDL_WINDOWPOS_CENTERED.toInt(), + SDL_WINDOWPOS_CENTERED.toInt(), 1, 1, + SDL_WindowFlags.SDL_WINDOW_SHOWN.value + ) ?: error("fail to create window ${SDL_GetError()}") + + private fun createRenderer() = SDL_CreateRenderer( + window, -1, SDL_RendererFlags.SDL_RENDERER_ACCELERATED or SDL_RendererFlags.SDL_RENDERER_PRESENTVSYNC + ) ?: error("fail to create renderer") + + private fun findControllers() = (0 until SDL_NumJoysticks()).mapNotNull { index -> + SDL_GameControllerOpen(index).also { if (it == null) println("fail to get controller at index $index") } + } + +} + +fun app( + block: AppContext.() -> Unit +) { + + if (SDL_Init(SDL_INIT_EVERYTHING.toInt()) != 0) { + error("SDL_Init Error: ${SDL_GetError()}") + } + + App().use(block) +} \ No newline at end of file diff --git a/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/Context.kt b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/Context.kt new file mode 100644 index 00000000..6414afb9 --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/Context.kt @@ -0,0 +1,14 @@ +package io.ygdrasil.sdl + +import io.ygdrasil.libsdl.* + +interface AppContext { + val window: SDL_Window + val renderer: SDL_Renderer + val textures: MutableList + val controllers: List + + fun addTexture(filename: String): SDL_Texture + fun removeTexture(texture: SDL_Texture) +} + diff --git a/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/Rect.kt b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/Rect.kt new file mode 100644 index 00000000..a1a750df --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/Rect.kt @@ -0,0 +1,10 @@ +package io.ygdrasil.sdl + +import io.ygdrasil.libsdl.SDL_Rect + +fun rect(x: Int, y: Int, w: Int, h: Int) = SDL_Rect().also { + it.x = x + it.y = y + it.w = w + it.h = h +} \ No newline at end of file diff --git a/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/Texture.kt b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/Texture.kt new file mode 100644 index 00000000..f994f861 --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/sdl/Texture.kt @@ -0,0 +1,29 @@ +package io.ygdrasil.sdl + +import com.sun.jna.Native +import io.ygdrasil.libsdl.* +import java.io.InputStream +import java.nio.ByteBuffer + +internal fun SDL_Renderer.loadTexture(fileName: String): SDL_Texture { + println("load texture $fileName") + val resourceStream = findClassPathResource(fileName) ?: error("fail to find resource with name filename") + val (buffer, bufferSize) = resourceStream.toBuffer() + val bufferPointer = Native.getDirectBufferPointer(buffer) + val res = SDL_RWFromMem(bufferPointer, bufferSize) + val image = SDL_LoadBMP_RW(res, 1) + val texture = SDL_CreateTextureFromSurface(this, image) ?: error("fail to create texture from filename $fileName") + SDL_FreeSurface(image) + return texture +} + +private fun InputStream.toBuffer(): Pair { + val resourceBytes = readAllBytes() + val buffer = ByteBuffer.allocateDirect(resourceBytes.size) + buffer.put(resourceBytes) + val bufferSize = resourceBytes.size + return Pair(buffer, bufferSize) +} + +private fun findClassPathResource(fileName: String): InputStream? = + AppContext::class.java.classLoader.getResourceAsStream(fileName) \ No newline at end of file diff --git a/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/snake/SnakeView.kt b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/snake/SnakeView.kt new file mode 100644 index 00000000..b7846299 --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/snake/SnakeView.kt @@ -0,0 +1,312 @@ +package io.ygdrasil.snake + +import com.sun.jna.ptr.IntByReference +import com.sun.jna.ptr.PointerByReference +import io.ygdrasil.libsdl.* +import io.ygdrasil.sdl.AppContext +import io.ygdrasil.sdl.rect +import java.io.File + +class SnakeView( + context: AppContext +) : AutoCloseable, AppContext by context { + + var game = initialGameState + var ticks = 0 + val speed = 10 + + private val font = Font() + private val sprites = Sprites() + private val pixelWidth = game.width * sprites.w + private val pixelHeight = game.height * sprites.h + + init { + SDL_SetWindowSize(window, pixelWidth, pixelHeight) + SDL_SetWindowTitle(window, "io/ygdrasil/snake") + + //playMusic() + } + + fun draw(game: Game) { + SDL_RenderClear(renderer) + SDL_SetRenderDrawColor( + renderer, + (200 / 2).toByte(), + (230 / 2).toByte(), + (151 / 2).toByte(), + SDL_ALPHA_OPAQUE.toByte() + ) + + val grassW = 256 + val grassScaledW = 400 // scale grass up to reduce its resolution so that it's similar to snake sprites + 0.until(pixelWidth / grassW + 1).forEach { x -> + 0.until(pixelHeight / grassW + 1).forEach { y -> + sprites.render(sprites.grassRect, rect(x * grassW, y * grassW, grassScaledW, grassScaledW)) + } + } + + game.apples.cells.forEach { + sprites.render(sprites.appleRect, cellRect(it)) + } + + game.snake.tail.dropLast(1).forEachIndexed { i, it -> + val index = i + 1 + val direction = direction(from = game.snake.cells[index - 1], to = it) + val nextDirection = direction(from = it, to = game.snake.cells[index + 1]) + + val srcRect = if (direction == nextDirection) { + when (direction) { + Direction.right, Direction.left -> sprites.bodyHorRect + Direction.up, Direction.down -> sprites.bodyVertRect + } + } else if ((direction == Direction.left && nextDirection == Direction.down) || (direction == Direction.up && nextDirection == Direction.right)) { + sprites.bodyLeftDownRect + } else if ((direction == Direction.left && nextDirection == Direction.up) || (direction == Direction.down && nextDirection == Direction.right)) { + sprites.bodyLeftUpRect + } else if ((direction == Direction.right && nextDirection == Direction.down) || (direction == Direction.up && nextDirection == Direction.left)) { + sprites.bodyRightDownRect + } else if ((direction == Direction.right && nextDirection == Direction.up) || (direction == Direction.down && nextDirection == Direction.left)) { + sprites.bodyRightUpRect + } else { + sprites.emptyRect + } + sprites.render(srcRect, cellRect(it)) + } + + val tipRect = when (game.snake.cells.let { direction(from = it.last(), to = it[it.size - 2]) }) { + Direction.up -> sprites.tipUpRect + Direction.down -> sprites.tipDownRect + Direction.left -> sprites.tipLeftRect + Direction.right -> sprites.tipRightRect + } + sprites.render(tipRect, cellRect(game.snake.tail.last())) + + val headRect = when (game.snake.direction) { + Direction.up -> sprites.headUpRect + Direction.down -> sprites.headDownRect + Direction.left -> sprites.headLeftRect + Direction.right -> sprites.headRightRect + } + sprites.render(headRect, cellRect(game.snake.head)) + + if (game.isOver) { + renderStringCentered(3, game.width, "game over") + renderStringCentered(5, game.width, "your score is ${game.score}") + } + + SDL_RenderPresent(renderer) + + } + + fun delay(timeMs: Int) { + SDL_Delay(timeMs) + } + + fun readCommands(): List { + val result = ArrayList() + val event = SDL_Event() + while (SDL_PollEvent(event) != 0) { + event.read() + println("event(${event.type}): ${SDL_EventType.of(event.type)}") + when (SDL_EventType.of(event.type)) { + SDL_EventType.SDL_WINDOWEVENT -> { + val windowEvent = SDL_WindowEventID.of(event.window.event.toInt()) + println("controllerButtonEvent(${windowEvent})") + + if (windowEvent == SDL_WindowEventID.SDL_WINDOWEVENT_SHOWN) { + //playMusic() + } + } + + SDL_EventType.SDL_QUIT -> result.add(UserCommand.quit) + SDL_EventType.SDL_CONTROLLERBUTTONDOWN -> { + val controllerButtonEvent = event.cbutton + val button = controllerButtonEvent.button.toInt() + println("controllerButtonEvent($button): ${SDL_GameControllerButton.of(button)}") + val command = when (SDL_GameControllerButton.of(button)) { + SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_UP -> UserCommand.up + SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_DOWN -> UserCommand.down + SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_LEFT -> UserCommand.left + SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_RIGHT -> UserCommand.right + SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_START -> UserCommand.restart + SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_BACK -> UserCommand.quit + else -> null + } + if (command != null) result.add(command) + } + + SDL_EventType.SDL_KEYDOWN -> { + val keyboardEvent = event.key + val keysym = keyboardEvent.keysym + println("keyboardEvent(${keysym.scancode}): ${SDL_Scancode.of(keysym.scancode)}") + val command = when (SDL_Scancode.of(keysym.scancode)) { + SDL_Scancode.SDL_SCANCODE_I -> UserCommand.up + SDL_Scancode.SDL_SCANCODE_J -> UserCommand.left + SDL_Scancode.SDL_SCANCODE_K -> UserCommand.down + SDL_Scancode.SDL_SCANCODE_L -> UserCommand.right + SDL_Scancode.SDL_SCANCODE_R -> UserCommand.restart + SDL_Scancode.SDL_SCANCODE_Q -> UserCommand.quit + else -> null + } + if (command != null) result.add(command) + } + + else -> Unit + } + } + return result + } + + private fun playMusic() { + val fileName = "Crowander-Stop-on-a-Bench.wav" + val paths = listOf(fileName, "resources/$fileName", "../resources/$fileName") + val filePath = paths.find { File(it).canRead() } ?: error("Can't find sound file.") + val audioFile = SDL_RWFromFile(filePath, "rb") + val audio_spec = SDL_AudioSpec() + val audio_buf = PointerByReference() + val audio_len = IntByReference() + SDL_LoadWAV_RW( + src = audioFile, + freesrc = 1, + spec = audio_spec, + audio_buf.pointer, + audio_len.pointer + ) + + val deviceName = SDL_GetAudioDeviceName(0, 0) + val device_id = SDL_OpenAudioDevice(deviceName, 0, audio_spec, SDL_AudioSpec(), 0) + SDL_QueueAudio(device_id, audio_buf.value, audio_len.value) + SDL_PauseAudioDevice(device_id, 0) + } + + private fun direction(from: Cell, to: Cell): Direction = when { + from.x == to.x && from.y > to.y -> Direction.up + from.x == to.x && from.y < to.y -> Direction.down + from.x > to.x && from.y == to.y -> Direction.left + from.x < to.x && from.y == to.y -> Direction.right + else -> error("") + } + + private fun cellRect(cell: Cell): SDL_Rect { + val x = cell.x * sprites.w + val y = cell.y * sprites.h + return rect(x, y, sprites.w, sprites.h) + } + + private fun renderStringCentered(y: Int, width: Int, s: String) { + var x = (width / 2) - (s.length / 2) + if (x.rem(2) != 0) x-- + renderString(Cell(x, y), s) + } + + private fun renderString(atCell: Cell, s: String) { + s.toCharArray().forEachIndexed { i, c -> + font.render(c, cellRect(atCell.copy(x = atCell.x + i))) + } + } + + enum class UserCommand { + up, down, left, right, restart, quit + } + + + private inner class Font { + val w = 48 + val h = 46 + + val texture = addTexture("Font16_42_Normal4_sheet.bmp") + private val letters = mapOf( + 'A' to textureRect(0, 0, -7), + 'B' to textureRect(1, 0), + 'C' to textureRect(2, 0, -9), + 'D' to textureRect(3, 0), + 'E' to textureRect(4, 0, -5), + 'F' to textureRect(5, 0, -5), + 'G' to textureRect(6, 0), + 'H' to textureRect(7, 0, -7), + 'I' to textureRect(8, 0, -15), + 'J' to textureRect(9, 0, -5), + 'K' to textureRect(0, 1, -10), + 'L' to textureRect(1, 1, -5), + 'M' to textureRect(2, 1), + 'N' to textureRect(3, 1), + 'O' to textureRect(4, 1, -7), + 'P' to textureRect(5, 1, -7), + 'Q' to textureRect(6, 1), + 'R' to textureRect(7, 1), + 'S' to textureRect(8, 1), + 'T' to textureRect(9, 1), + 'U' to textureRect(0, 2, -13), + 'V' to textureRect(1, 2, -10), + 'W' to textureRect(2, 2), + 'X' to textureRect(3, 2), + 'Y' to textureRect(4, 2, -5), + 'Z' to textureRect(5, 2), + '0' to textureRect(2, 5), + '1' to textureRect(3, 5, -15), + '2' to textureRect(4, 5), + '3' to textureRect(5, 5), + '4' to textureRect(6, 5), + '5' to textureRect(7, 5), + '6' to textureRect(8, 5), + '7' to textureRect(9, 5), + '8' to textureRect(0, 6), + '9' to textureRect(1, 6), + ' ' to rect(0, 0, 0, 0) + ) + + fun render(char: Char, cellRect: SDL_Rect) { + val charRect = letters[char.uppercaseChar()] ?: (letters[' '] ?: error("")) + SDL_RenderCopy(renderer, texture, charRect, cellRect) + } + + private fun textureRect(x: Int, y: Int, wAdjust: Int = 0): SDL_Rect { + val xShift = x * w + val yShift = y * h + return rect(xShift, yShift, w + wAdjust, h) + } + } + + private inner class Sprites { + val w = 64 + val h = 64 + + val texture = addTexture("snake-graphics.bmp") + val grassTexture = addTexture("grass.bmp") + + val headUpRect = textureRect(3, 0) + val headRightRect = textureRect(4, 0) + val headLeftRect = textureRect(3, 1) + val headDownRect = textureRect(4, 1) + + val tipUpRect = textureRect(3, 2) + val tipRightRect = textureRect(4, 2) + val tipLeftRect = textureRect(3, 3) + val tipDownRect = textureRect(4, 3) + + val bodyHorRect = textureRect(1, 0) + val bodyVertRect = textureRect(2, 1) + val bodyLeftDownRect = textureRect(0, 0) + val bodyLeftUpRect = textureRect(0, 1) + val bodyRightDownRect = textureRect(2, 0) + val bodyRightUpRect = textureRect(2, 2) + + val appleRect = textureRect(0, 3) + val emptyRect = textureRect(0, 2) + + val grassRect = rect(0, 0, 256, 256) + + private fun textureRect(x: Int, y: Int) = rect(x * w, y * h, w, h) + + fun render(srcRect: SDL_Rect, dstRect: SDL_Rect) { + if (srcRect == grassRect) SDL_RenderCopy(renderer, grassTexture, srcRect, dstRect) + else SDL_RenderCopy(renderer, texture, srcRect, dstRect) + } + } + + override fun close() { + removeTexture(sprites.texture) + removeTexture(sprites.grassTexture) + removeTexture(font.texture) + } +} diff --git a/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/snake/domain.kt b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/snake/domain.kt new file mode 100644 index 00000000..ff3ebeaa --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/snake/domain.kt @@ -0,0 +1,86 @@ +package io.ygdrasil.snake + +import kotlin.math.max +import kotlin.random.Random + +data class Game( + val width: Int, + val height: Int, + val snake: Snake, + val apples: Apples = Apples(width, height) +) { + val isOver = + snake.tail.contains(snake.head) || + snake.cells.any { it.x < 0 || it.x >= width || it.y < 0 || it.y >= height } + + val score = snake.cells.size + + fun update(direction: Direction? = null): Game { + if (isOver) return this + val (newSnake, newApples) = snake.turn(direction).move().eat(apples.grow()) + return copy(snake = newSnake, apples = newApples) + } +} + +val initialGameState = Game( + width = 20, + height = 10, + snake = Snake( + cells = listOf(Cell(4, 4), Cell(3, 4), Cell(2, 4), Cell(1, 4), Cell(0, 4)), + direction = Direction.right + ) +) + +data class Snake( + val cells: List, + val direction: Direction, + val eatenApples: Int = 0 +) { + val head = cells.first() + val tail = cells.subList(1, cells.size) + + fun move(): Snake { + val newHead = head.move(direction) + val newTail = if (eatenApples == 0) cells.dropLast(1) else cells + return copy( + cells = listOf(newHead) + newTail, + eatenApples = max(eatenApples - 1, 0) + ) + } + + fun turn(newDirection: Direction?): Snake { + if (newDirection == null || newDirection.isOpposite(direction)) return this + return copy(direction = newDirection) + } + + fun eat(apples: Apples): Pair { + if (!apples.cells.contains(head)) return Pair(this, apples) + return Pair( + copy(eatenApples = eatenApples + 1), + apples.copy(cells = apples.cells - head) + ) + } +} + +data class Apples( + val fieldWidth: Int, + val fieldHeight: Int, + val cells: Set = emptySet(), + val growthSpeed: Int = 3, + val random: Random = Random +) { + fun grow(): Apples { + if (random.nextInt(growthSpeed) != 0) return this + return copy(cells = cells + Cell(random.nextInt(fieldWidth), random.nextInt(fieldHeight))) + } +} + +data class Cell(val x: Int, val y: Int) { + fun move(direction: Direction) = Cell(x + direction.dx, y + direction.dy) +} + +enum class Direction(val dx: Int, val dy: Int) { + up(0, -1), down(0, 1), left(-1, 0), right(1, 0); + + fun isOpposite(that: Direction) = dx + that.dx == 0 && dy + that.dy == 0 +} \ No newline at end of file diff --git a/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/snake/main.kt b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/snake/main.kt new file mode 100644 index 00000000..dfc53c9c --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/snake/main.kt @@ -0,0 +1,35 @@ +package io.ygdrasil.snake + +import io.ygdrasil.sdl.app + +fun main() = app { + + SnakeView(this).use { view -> + + while (true) { + + view.draw(view.game) + + view.delay(1000 / 60) + view.ticks++ + if (view.ticks >= view.speed) { + view.game = view.game.update() + view.ticks = 0 + } + + view.readCommands().forEach { command -> + var direction: Direction? = null + when (command) { + SnakeView.UserCommand.up -> direction = Direction.up + SnakeView.UserCommand.down -> direction = Direction.down + SnakeView.UserCommand.left -> direction = Direction.left + SnakeView.UserCommand.right -> direction = Direction.right + SnakeView.UserCommand.restart -> view.game = initialGameState + SnakeView.UserCommand.quit -> return@app + } + view.game = view.game.update(direction) + view.draw(view.game) + } + } + } +} diff --git a/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/tetris/SDLView.kt b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/tetris/SDLView.kt new file mode 100644 index 00000000..34ef8bfa --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/tetris/SDLView.kt @@ -0,0 +1,465 @@ +package io.ygdrasil.tetris + +import com.sun.jna.ptr.IntByReference +import io.ygdrasil.libsdl.* + +class SDLView(private val width: Int, private val height: Int) : GameFieldVisualizer, UserInput { + + fun error(message: Any): Nothing { + if (this::renderer.isInitialized) SDL_DestroyRenderer(renderer) + if (this::window.isInitialized) SDL_DestroyWindow(window) + println("$message: ${SDL_GetError()}") + SDL_Quit() + throw IllegalStateException() + } + + private val CELL_SIZE = 20 + private val COLORS = 10 + private val CELLS_WIDTH = COLORS * CELL_SIZE + private val CELLS_HEIGHT = 3 * CELL_SIZE + private val SYMBOL_SIZE = 21 + private val INFO_MARGIN = 10 + private val MARGIN = 2 + private val BORDER_WIDTH = 18 + private val INFO_SPACE_WIDTH = SYMBOL_SIZE * (2 + 8) + private val LINES_LABEL_WIDTH = 104 + private val SCORE_LABEL_WIDTH = 107 + private val LEVEL_LABEL_WIDTH = 103 + private val NEXT_LABEL_WIDTH = 85 + private val TETRISES_LABEL_WIDTH = 162 + + private var ratio: Float + + private fun stretch(value: Int) = (value.toFloat() * ratio + 0.5).toInt() + + inner class GamePadButtons(width: Int, height: Int, gamePadHeight: Int) { + val MOVE_BUTTON_SIZE = 50 + val ROTATE_BUTTON_SIZE = 80 + val BUTTONS_MARGIN = 25 + + val leftRect: SDL_Rect + val rightRect: SDL_Rect + val downRect: SDL_Rect + val dropRect: SDL_Rect + val rotateRect: SDL_Rect + + init { + val moveButtonsWidth = 3 * MOVE_BUTTON_SIZE + 2 * BUTTONS_MARGIN + BUTTONS_MARGIN + val x = (width - moveButtonsWidth - ROTATE_BUTTON_SIZE) / 2 - MOVE_BUTTON_SIZE + val y2 = (gamePadHeight - 2 * MOVE_BUTTON_SIZE - BUTTONS_MARGIN) / 2 + leftRect = SDL_Rect() + leftRect.w = MOVE_BUTTON_SIZE + leftRect.h = MOVE_BUTTON_SIZE + leftRect.x = x + leftRect.y = height - gamePadHeight + y2 + MOVE_BUTTON_SIZE + BUTTONS_MARGIN + + downRect = SDL_Rect() + downRect.w = MOVE_BUTTON_SIZE + downRect.h = MOVE_BUTTON_SIZE + downRect.x = x + MOVE_BUTTON_SIZE + BUTTONS_MARGIN + downRect.y = leftRect.y + + dropRect = SDL_Rect().apply { + this.x = MOVE_BUTTON_SIZE + y = MOVE_BUTTON_SIZE + h = downRect.x + w =height - gamePadHeight + y2 + } + + rightRect = SDL_Rect() + rightRect.w = MOVE_BUTTON_SIZE + rightRect.h = MOVE_BUTTON_SIZE + rightRect.x = x + 2 * MOVE_BUTTON_SIZE + 2 * BUTTONS_MARGIN + rightRect.y = height - gamePadHeight + y2 + MOVE_BUTTON_SIZE + BUTTONS_MARGIN + + rotateRect = SDL_Rect() + rotateRect.w = ROTATE_BUTTON_SIZE + rotateRect.h = ROTATE_BUTTON_SIZE + rotateRect.x = x + moveButtonsWidth + rotateRect.y = height - gamePadHeight + y2 - BUTTONS_MARGIN + } + + fun getCommandAt(x: Int, y: Int): UserCommand? { + return when { + inside(leftRect, x, y) -> UserCommand.LEFT + inside(rightRect, x, y) -> UserCommand.RIGHT + inside(downRect, x, y) -> UserCommand.DOWN + inside(dropRect, x, y) -> UserCommand.DROP + inside(rotateRect, x, y) -> UserCommand.ROTATE + else -> null + } + } + + private fun inside(rect: SDL_Rect, x: Int, y: Int): Boolean { + return x >= stretch(rect.x) && x <= stretch(rect.x + rect.w) + && y >= stretch(rect.y) && y <= stretch(rect.y + rect.h) + } + + } + + private val field: Field = Array(height) { ByteArray(width) } + private val nextPieceField: Field = Array(4) { ByteArray(4) } + private var linesCleared: Int = 0 + private var level: Int = 0 + private var score: Int = 0 + private var tetrises: Int = 0 + + private var displayWidth: Int = 0 + private var displayHeight: Int = 0 + private val fieldWidth: Int + private val fieldHeight: Int + private var windowX: Int + private var windowY: Int + private lateinit var window: SDL_Window + private lateinit var renderer: SDL_Renderer + private val texture: SDL_Texture + private val gamePadButtons: GamePadButtons? + + init { + if (SDL_Init(SDL_INIT_EVERYTHING.toInt()) != 0) { + throw Error("SDL_Init Error: ${SDL_GetError()}") + } + + val platform: String = SDL_GetPlatform() ?: error("fail to get platform") + + val displayMode = SDL_DisplayMode() + if (SDL_GetCurrentDisplayMode(0, displayMode) != 0) { + println("SDL_GetCurrentDisplayMode Error: ${SDL_GetError()}") + SDL_Quit() + throw Error() + } + displayWidth = displayMode.w + displayHeight = displayMode.h + fieldWidth = width * (CELL_SIZE + MARGIN) + MARGIN + BORDER_WIDTH * 2 + fieldHeight = height * (CELL_SIZE + MARGIN) + MARGIN + BORDER_WIDTH * 2 + var windowWidth = fieldWidth + INFO_SPACE_WIDTH + var windowHeight: Int + if (platform == "iOS") { + val gamePadHeight = (displayHeight * windowWidth - fieldHeight * displayWidth) / displayWidth + windowHeight = fieldHeight + gamePadHeight + gamePadButtons = GamePadButtons(windowWidth, windowHeight, gamePadHeight) + windowX = 0 + windowY = 0 + ratio = displayHeight.toFloat() / windowHeight + windowWidth = displayWidth + windowHeight = displayHeight + } else { + windowHeight = fieldHeight + gamePadButtons = null + windowX = (displayWidth - windowWidth) / 2 + windowY = (displayHeight - windowHeight) / 2 + ratio = 1.0f + } + + window = SDL_CreateWindow( + "Tetris", windowX, windowY, windowWidth, windowHeight, + SDL_WindowFlags.SDL_WINDOW_SHOWN or SDL_WindowFlags.SDL_WINDOW_ALLOW_HIGHDPI + ) ?: error("") + + renderer = SDL_CreateRenderer(window, -1, SDL_RendererFlags.SDL_RENDERER_ACCELERATED or SDL_RendererFlags.SDL_RENDERER_PRESENTVSYNC) + ?: error("") + + val realWidth = IntByReference() + val realHeight = IntByReference() + SDL_GetRendererOutputSize(renderer, realWidth.pointer, realHeight.pointer) + if (platform != "iOS" && windowHeight != realHeight.value) { + println("DPI differs ${realWidth} x ${realHeight} vs $windowWidth x $windowHeight") + ratio = realHeight.value.toFloat() / windowHeight + } + + texture = loadImage(renderer, "tetris_all.bmp") + } + + private fun loadImage(ren: SDL_Renderer, imagePath: String): SDL_Texture { + val bmp = SDL_LoadBMP_RW(SDL_RWFromFile(imagePath, "rb"), 1) + + val tex = SDL_CreateTextureFromSurface(ren, bmp) ?: error("") + SDL_FreeSurface(bmp) + return tex + } + + override fun drawCell(x: Int, y: Int, cell: Byte) { + field[x][y] = cell + } + + override fun drawNextPieceCell(x: Int, y: Int, cell: Byte) { + nextPieceField[x][y] = cell + } + + override fun setInfo(linesCleared: Int, level: Int, score: Int, tetrises: Int) { + this.linesCleared = linesCleared + this.level = level + this.score = score + this.tetrises = tetrises + } + + override fun refresh() { + SDL_RenderClear(renderer) + drawField() + drawInfo() + drawNextPiece() + drawGamePad() + SDL_RenderPresent(renderer) + } + + private fun drawBorder(topLeftX: Int, topLeftY: Int, width: Int, height: Int) { + // Upper-left corner. + var srcX = CELLS_WIDTH + var srcY = 0 + var destX = topLeftX + var destY = topLeftY + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH + MARGIN, BORDER_WIDTH) + + // Upper margin. + srcX += BORDER_WIDTH + MARGIN + destX += BORDER_WIDTH + MARGIN + for (i in 0..width - 1) { + copyRect(srcX, srcY, destX, destY, CELL_SIZE + MARGIN, BORDER_WIDTH) + destX += CELL_SIZE + MARGIN + } + + // Upper-right corner. + srcX += CELL_SIZE + MARGIN + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH, BORDER_WIDTH + MARGIN) + + // Right margin. + srcY += BORDER_WIDTH + MARGIN + destY += BORDER_WIDTH + MARGIN + for (j in 0..height - 1) { + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH, CELL_SIZE + MARGIN) + destY += CELL_SIZE + MARGIN + } + + // Left margin. + srcX = CELLS_WIDTH + srcY = BORDER_WIDTH + destX = topLeftX + destY = topLeftY + BORDER_WIDTH + for (j in 0..height - 1) { + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH, CELL_SIZE + MARGIN) + destY += CELL_SIZE + MARGIN + } + + // Left-down corner. + srcY += CELL_SIZE + MARGIN + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH, BORDER_WIDTH + MARGIN) + + // Down marign. + srcX += BORDER_WIDTH + srcY += MARGIN + destX += BORDER_WIDTH + destY += MARGIN + for (i in 0..width - 1) { + copyRect(srcX, srcY, destX, destY, CELL_SIZE + MARGIN, BORDER_WIDTH) + destX += CELL_SIZE + MARGIN + + } + // Right-down corner. + srcX += CELL_SIZE + MARGIN + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH + MARGIN, BORDER_WIDTH) + } + + private fun drawField() { + drawField( + field = field, + topLeftX = 0, + topLeftY = 0, + width = width, + height = height + ) + } + + private fun drawNextPiece() { + drawInt( + labelSrcX = LEVEL_LABEL_WIDTH, + labelSrcY = CELLS_HEIGHT + SYMBOL_SIZE, + labelDestX = fieldWidth + SYMBOL_SIZE, + labelDestY = getInfoY(5), + labelWidth = NEXT_LABEL_WIDTH, + totalDigits = 0, + value = 0 + ) + drawField( + field = nextPieceField, + topLeftX = fieldWidth + SYMBOL_SIZE, + topLeftY = getInfoY(6), + width = 4, + height = 4 + ) + } + + private fun drawField(field: Field, topLeftX: Int, topLeftY: Int, width: Int, height: Int) { + drawBorder( + topLeftX = topLeftX, + topLeftY = topLeftY, + width = width, + height = height + ) + for (i in 0..height - 1) + for (j in 0..width - 1) { + val cell = field[i][j].toInt() + if (cell == 0) continue + copyRect( + srcX = (level % COLORS) * CELL_SIZE, + srcY = (3 - cell) * CELL_SIZE, + destX = topLeftX + BORDER_WIDTH + MARGIN + j * (CELL_SIZE + MARGIN), + destY = topLeftY + BORDER_WIDTH + MARGIN + i * (CELL_SIZE + MARGIN), + width = CELL_SIZE, + height = CELL_SIZE + ) + } + } + + private fun drawInfo() { + drawInt( + labelSrcX = LINES_LABEL_WIDTH, + labelSrcY = CELLS_HEIGHT, + labelDestX = fieldWidth + SYMBOL_SIZE, + labelDestY = getInfoY(0), + labelWidth = SCORE_LABEL_WIDTH, + totalDigits = 6, + value = score + ) + drawInt( + labelSrcX = 0, + labelSrcY = CELLS_HEIGHT, + labelDestX = fieldWidth + SYMBOL_SIZE, + labelDestY = getInfoY(1), + labelWidth = LINES_LABEL_WIDTH, + totalDigits = 3, + value = linesCleared + ) + drawInt( + labelSrcX = 0, + labelSrcY = CELLS_HEIGHT + SYMBOL_SIZE, + labelDestX = fieldWidth + SYMBOL_SIZE, + labelDestY = getInfoY(2), + labelWidth = LEVEL_LABEL_WIDTH, + totalDigits = 2, + value = level + ) + drawInt( + labelSrcX = 0, + labelSrcY = CELLS_HEIGHT + SYMBOL_SIZE * 2, + labelDestX = fieldWidth + SYMBOL_SIZE, + labelDestY = getInfoY(3), + labelWidth = TETRISES_LABEL_WIDTH, + totalDigits = 2, + value = tetrises + ) + } + + private fun getInfoY(line: Int): Int { + return SYMBOL_SIZE * (2 * line + 1) + INFO_MARGIN * line + } + + private fun drawInt( + labelSrcX: Int, labelSrcY: Int, labelDestX: Int, labelDestY: Int, + labelWidth: Int, totalDigits: Int, value: Int + ) { + copyRect( + srcX = labelSrcX, + srcY = labelSrcY, + destX = labelDestX, + destY = labelDestY, + width = labelWidth, + height = SYMBOL_SIZE + ) + val digits = IntArray(totalDigits) + var x = value + for (i in 0..totalDigits - 1) { + digits[totalDigits - 1 - i] = x % 10 + x = x / 10 + } + for (i in 0..totalDigits - 1) { + copyRect( + srcX = digits[i] * SYMBOL_SIZE, + srcY = CELLS_HEIGHT + 3 * SYMBOL_SIZE, + destX = labelDestX + SYMBOL_SIZE + i * SYMBOL_SIZE, + destY = labelDestY + SYMBOL_SIZE, + width = SYMBOL_SIZE, + height = SYMBOL_SIZE + ) + } + } + + private fun drawGamePad() { + if (gamePadButtons == null) return + SDL_SetRenderDrawColor(renderer, 127, 127, 127, SDL_ALPHA_OPAQUE.toByte()) + fillRect(gamePadButtons.leftRect) + fillRect(gamePadButtons.downRect) + fillRect(gamePadButtons.dropRect) + fillRect(gamePadButtons.rightRect) + fillRect(gamePadButtons.rotateRect) + SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE.toByte()) + } + + private fun fillRect(rect: SDL_Rect) { + val stretchedRect = SDL_Rect().apply { + w = stretch(rect.w) + h = stretch(rect.h) + x = stretch(rect.x) + y = stretch(rect.y) + } + SDL_RenderFillRect(renderer, stretchedRect) + } + + + private fun copyRect(srcX: Int, srcY: Int, destX: Int, destY: Int, width: Int, height: Int) { + val srcRect = SDL_Rect().apply { + w = width + h = height + x = srcX + y = srcY + } + val destRect = SDL_Rect().apply { + w = stretch(width) + h = stretch(height) + x = stretch(destX) + y = stretch(destY) + } + SDL_RenderCopy(renderer, texture, srcRect, destRect) + } + + override fun readCommands(): List { + val commands = mutableListOf() + val event = SDL_Event() + SDL_PollEvent(event) + while (event != null) { + when (SDL_EventType.of(event.type)) { + SDL_EventType.SDL_QUIT -> commands.add(UserCommand.EXIT) + SDL_EventType.SDL_KEYDOWN -> { + val keyboardEvent = event.key + when (keyboardEvent.keysym.scancode.toInt()) { + SDL_Scancode.SDL_SCANCODE_LEFT.value -> commands.add(UserCommand.LEFT) + SDL_Scancode.SDL_SCANCODE_RIGHT.value -> commands.add(UserCommand.RIGHT) + SDL_Scancode.SDL_SCANCODE_DOWN.value -> commands.add(UserCommand.DOWN) + SDL_Scancode.SDL_SCANCODE_Z.value, SDL_Scancode.SDL_SCANCODE_SPACE.value -> commands.add(UserCommand.ROTATE) + SDL_Scancode.SDL_SCANCODE_UP.value -> commands.add(UserCommand.DROP) + SDL_Scancode.SDL_SCANCODE_ESCAPE.value -> commands.add(UserCommand.EXIT) + } + } + SDL_EventType.SDL_MOUSEBUTTONDOWN -> if (gamePadButtons != null) { + val mouseEvent = event as SDL_MouseButtonEvent + val x = mouseEvent.x + val y = mouseEvent.y + val command = gamePadButtons.getCommandAt(x, y) + if (command != null) + commands.add(command) + } + + else -> { } + } + + SDL_PollEvent(event) + } + return commands + } + + fun destroy() { + SDL_DestroyTexture(texture) + SDL_DestroyRenderer(renderer) + SDL_DestroyWindow(window) + SDL_Quit() + } +} diff --git a/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/tetris/Tetris.kt b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/tetris/Tetris.kt new file mode 100644 index 00000000..b56b40bc --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/tetris/Tetris.kt @@ -0,0 +1,489 @@ +package io.ygdrasil.tetris + +import io.ygdrasil.libsdl.SDL_Delay +import kotlin.random.Random + +typealias Field = Array + +enum class Move { + LEFT, + RIGHT, + DOWN, + ROTATE +} + +enum class PlacementResult(val linesCleared: Int = 0, val bonus: Int = 0) { + NOTHING, + GAMEOVER, + // For values of bonuses see https://tetris.wiki/Scoring + SINGLE(1, 40), + DOUBLE(2, 100), + TRIPLE(3, 300), + TETRIS(4, 1200) +} + +const val EMPTY: Byte = 0 +const val CELL1: Byte = 1 +const val CELL2: Byte = 2 +const val CELL3: Byte = 3 +const val BRICK: Byte = -1 + +class Point(var x: Int, var y: Int) + +operator fun Point.plus(other: Point): Point { + return Point(x + other.x, y + other.y) +} + +class PiecePosition(piece: Piece, private val origin: Point) { + private var p = piece.origin + val x get() = p.x + origin.x + val y get() = p.y + origin.y + + var state: Int private set + val numberOfStates = piece.numberOfStates + + init { + state = 0 + } + + fun makeMove(move: Move) { + when (move) { + Move.LEFT -> --p.y + Move.RIGHT -> ++p.y + Move.DOWN -> ++p.x + Move.ROTATE -> state = (state + 1) % numberOfStates + } + } + + fun unMakeMove(move: Move) { + when (move) { + Move.LEFT -> ++p.y + Move.RIGHT -> --p.y + Move.DOWN -> --p.x + Move.ROTATE -> state = (state + numberOfStates - 1) % numberOfStates + } + } +} + +/* + * We use Nintendo Rotation System, right-handed version. + * See https://tetris.wiki/Nintendo_Rotation_System + */ +enum class Piece(private val origin_: Point, private vararg val states: Field) { + T( + Point(-1, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY), + byteArrayOf(CELL1, CELL1, CELL1), + byteArrayOf(EMPTY, CELL1, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL1, EMPTY), + byteArrayOf(CELL1, CELL1, EMPTY), + byteArrayOf(EMPTY, CELL1, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL1, EMPTY), + byteArrayOf(CELL1, CELL1, CELL1), + byteArrayOf(EMPTY, EMPTY, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL1, EMPTY), + byteArrayOf(EMPTY, CELL1, CELL1), + byteArrayOf(EMPTY, CELL1, EMPTY)) + ), + J( + Point(-1, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY), + byteArrayOf(CELL2, CELL2, CELL2), + byteArrayOf(EMPTY, EMPTY, CELL2)), + arrayOf( + byteArrayOf(EMPTY, CELL2, EMPTY), + byteArrayOf(EMPTY, CELL2, EMPTY), + byteArrayOf(CELL2, CELL2, EMPTY)), + arrayOf( + byteArrayOf(CELL2, EMPTY, EMPTY), + byteArrayOf(CELL2, CELL2, CELL2), + byteArrayOf(EMPTY, EMPTY, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL2, CELL2), + byteArrayOf(EMPTY, CELL2, EMPTY), + byteArrayOf(EMPTY, CELL2, EMPTY)) + ), + Z( + Point(-1, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY), + byteArrayOf(CELL3, CELL3, EMPTY), + byteArrayOf(EMPTY, CELL3, CELL3)), + arrayOf( + byteArrayOf(EMPTY, EMPTY, CELL3), + byteArrayOf(EMPTY, CELL3, CELL3), + byteArrayOf(EMPTY, CELL3, EMPTY)) + ), + O( + Point(0, -1), + arrayOf( + byteArrayOf(CELL1, CELL1), + byteArrayOf(CELL1, CELL1)) + ), + S( + Point(-1, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY), + byteArrayOf(EMPTY, CELL2, CELL2), + byteArrayOf(CELL2, CELL2, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL2, EMPTY), + byteArrayOf(EMPTY, CELL2, CELL2), + byteArrayOf(EMPTY, EMPTY, CELL2)) + ), + L( + Point(-1, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY), + byteArrayOf(CELL3, CELL3, CELL3), + byteArrayOf(CELL3, EMPTY, EMPTY)), + arrayOf( + byteArrayOf(CELL3, CELL3, EMPTY), + byteArrayOf(EMPTY, CELL3, EMPTY), + byteArrayOf(EMPTY, CELL3, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, EMPTY, CELL3), + byteArrayOf(CELL3, CELL3, CELL3), + byteArrayOf(EMPTY, EMPTY, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL3, EMPTY), + byteArrayOf(EMPTY, CELL3, EMPTY), + byteArrayOf(EMPTY, CELL3, CELL3)) + ), + I( + Point(-2, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY, EMPTY), + byteArrayOf(EMPTY, EMPTY, EMPTY, EMPTY), + byteArrayOf(CELL1, CELL1, CELL1, CELL1), + byteArrayOf(EMPTY, EMPTY, EMPTY, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, EMPTY, CELL1, EMPTY), + byteArrayOf(EMPTY, EMPTY, CELL1, EMPTY), + byteArrayOf(EMPTY, EMPTY, CELL1, EMPTY), + byteArrayOf(EMPTY, EMPTY, CELL1, EMPTY)) + ); + + val origin get() = Point(origin_.x, origin_.y) + val numberOfStates: Int = states.size + + fun canBePlaced(field: Field, position: PiecePosition): Boolean { + val piece = states[position.state] + val x = position.x + val y = position.y + for (i in piece.indices) { + val pieceRow = piece[i] + val boardRow = field[x + i] + for (j in pieceRow.indices) { + if (pieceRow[j] != EMPTY && boardRow[y + j] != EMPTY) + return false + } + } + return true + } + + fun place(field: Field, position: PiecePosition) { + val piece = states[position.state] + val x = position.x + val y = position.y + for (i in piece.indices) { + val pieceRow = piece[i] + for (j in pieceRow.indices) { + if (pieceRow[j] != EMPTY) field[x + i][y + j] = pieceRow[j] + } + } + } + + fun unPlace(field: Field, position: PiecePosition) { + val piece = states[position.state] + val x = position.x + val y = position.y + for (i in piece.indices) { + val pieceRow = piece[i] + for (j in pieceRow.indices) { + if (pieceRow[j] != EMPTY) field[x + i][y + j] = EMPTY + } + } + } +} + +interface GameFieldVisualizer { + fun drawCell(x: Int, y: Int, cell: Byte) + fun drawNextPieceCell(x: Int, y: Int, cell: Byte) + fun setInfo(linesCleared: Int, level: Int, score: Int, tetrises: Int) + fun refresh() +} + +enum class UserCommand { + LEFT, + RIGHT, + DOWN, + DROP, + ROTATE, + EXIT +} + +interface UserInput { + fun readCommands(): List +} + +class GameField(val width: Int, val height: Int, val visualizer: GameFieldVisualizer) { + private val MARGIN = 4 + + private val field: Field = Array(height + MARGIN * 2) { ByteArray(width + MARGIN * 2) } + private val origin: Point + private val nextPieceField: Field + + init { + for (i in field.indices) { + val row = field[i] + for (j in row.indices) { + if (i >= (MARGIN + height) // Bottom (field is flipped over). + || (j < MARGIN) // Left + || (j >= MARGIN + width)) // Right + row[j] = BRICK + } + } + // Coordinates are relative to the central axis and top of the field. + origin = Point(MARGIN, MARGIN + (width + 1) / 2) + nextPieceField = Array(4) { ByteArray(4) } + } + + lateinit var currentPiece: Piece + lateinit var nextPiece: Piece + lateinit var currentPosition: PiecePosition + + fun reset() { + for (i in 0..height - 1) + for (j in 0..width - 1) + field[i + MARGIN][j + MARGIN] = 0 + nextPiece = getNextPiece(false) + switchCurrentPiece() + } + + private fun getNextPiece(denyPrevious: Boolean): Piece { + val pieces = Piece.values() + if (!denyPrevious) + return pieces[Random.nextInt(pieces.size)] + while (true) { + val nextPiece = pieces[Random.nextInt(pieces.size)] + if (nextPiece != currentPiece) return nextPiece + } + } + + private fun switchCurrentPiece() { + currentPiece = nextPiece + nextPiece = getNextPiece(denyPrevious = true) // Forbid repeating the same piece for better distribution. + currentPosition = PiecePosition(currentPiece, origin) + } + + fun makeMove(move: Move): Boolean { + currentPosition.makeMove(move) + if (currentPiece.canBePlaced(field, currentPosition)) + return true + currentPosition.unMakeMove(move) + return false + } + + /** + * Places current piece at its current location. + */ + fun place(): PlacementResult { + currentPiece.place(field, currentPosition) + val linesCleared = clearLines() + if (isOutOfBorders()) return PlacementResult.GAMEOVER + switchCurrentPiece() + if (!currentPiece.canBePlaced(field, currentPosition)) + return PlacementResult.GAMEOVER + when (linesCleared) { + 1 -> return PlacementResult.SINGLE + 2 -> return PlacementResult.DOUBLE + 3 -> return PlacementResult.TRIPLE + 4 -> return PlacementResult.TETRIS + else -> return PlacementResult.NOTHING + } + } + + private fun clearLines(): Int { + val clearedLines = mutableListOf() + for (i in 0..height - 1) { + val row = field[i + MARGIN] + if ((0..width - 1).all { j -> row[j + MARGIN] != EMPTY }) { + clearedLines.add(i + MARGIN) + (0..width - 1).forEach { j -> row[j + MARGIN] = EMPTY } + } + } + if (clearedLines.size == 0) return 0 + draw(false) + visualizer.refresh() + SDL_Delay(500) + for (i in clearedLines) { + for (k in i - 1 downTo 1) + for (j in 0..width - 1) + field[k + 1][j + MARGIN] = field[k][j + MARGIN] + } + draw(false) + visualizer.refresh() + return clearedLines.size + } + + private fun isOutOfBorders(): Boolean { + for (i in 0 until MARGIN) + for (j in 0 until width) + if (field[i][j + MARGIN] != EMPTY) + return true + return false + } + + fun draw() { + draw(true) + drawNextPiece() + } + + private fun drawNextPiece() { + for (i in 0..3) + for (j in 0..3) + nextPieceField[i][j] = 0 + nextPiece.place(nextPieceField, PiecePosition(nextPiece, Point(1, 2))) + for (i in 0..3) + for (j in 0..3) + visualizer.drawNextPieceCell(i, j, nextPieceField[i][j]) + } + + private fun draw(drawCurrentPiece: Boolean) { + if (drawCurrentPiece) + currentPiece.place(field, currentPosition) + for (i in 0..height - 1) + for (j in 0..width - 1) + visualizer.drawCell(i, j, field[i + MARGIN][j + MARGIN]) + if (drawCurrentPiece) + currentPiece.unPlace(field, currentPosition) + } +} + +class Game(width: Int, height: Int, val visualizer: GameFieldVisualizer, val userInput: UserInput) { + private val field = GameField(width, height, visualizer) + + private var gameOver = true + private var startLevel = 0 + private var leveledUp = false + private var level = 0 + private var linesClearedAtCurrentLevel = 0 + private var linesCleared = 0 + private var tetrises = 0 + private var score = 0 + + /* + * For speed constants and level up thresholds see https://tetris.wiki/Tetris_(NES,_Nintendo) + */ + private val speeds = intArrayOf(48, 43, 38, 33, 28, 23, 18, 13, 8, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) + private val levelUpThreshold + get() = + if (leveledUp) 10 + else minOf(startLevel * 10 + 10, maxOf(100, startLevel * 10 - 50)) + private val speed get() = if (level < 29) speeds[level] else 1 + + private var ticks = 0 + + fun startNewGame() { + gameOver = false + startLevel = level + leveledUp = false + this.level = level + linesClearedAtCurrentLevel = 0 + linesCleared = 0 + tetrises = 0 + score = 0 + ticks = 0 + field.reset() + + visualizer.setInfo(linesCleared, level, score, tetrises) + field.draw() + visualizer.refresh() + + mainLoop() + } + + private fun placePiece() { + val placementResult = field.place() + ticks = 0 + when (placementResult) { + PlacementResult.NOTHING -> return + PlacementResult.GAMEOVER -> { + gameOver = true + return + } + else -> { + linesCleared += placementResult.linesCleared + linesClearedAtCurrentLevel += placementResult.linesCleared + score += placementResult.bonus * (level + 1) + if (placementResult == PlacementResult.TETRIS) + ++tetrises + val levelUpThreshold = levelUpThreshold + if (linesClearedAtCurrentLevel >= levelUpThreshold) { + ++level + linesClearedAtCurrentLevel -= levelUpThreshold + leveledUp = true + } + + visualizer.setInfo(linesCleared, level, score, tetrises) + } + } + } + + /* + * Number of additional gravity shifts before locking a piece landed on the ground. + * This is needed in order to let user to move a piece to the left/right before locking. + */ + private val LOCK_DELAY = 1 + + private fun mainLoop() { + var attemptsToLock = 0 + while (!gameOver) { + SDL_Delay((1000 / 60)) // Refresh rate - 60 frames per second. + val commands = userInput.readCommands() + for (cmd in commands) { + val success: Boolean + when (cmd) { + UserCommand.EXIT -> return + UserCommand.LEFT -> success = field.makeMove(Move.LEFT) + UserCommand.RIGHT -> success = field.makeMove(Move.RIGHT) + UserCommand.ROTATE -> success = field.makeMove(Move.ROTATE) + UserCommand.DOWN -> { + success = field.makeMove(Move.DOWN) + if (!success) placePiece() + } + UserCommand.DROP -> { + while (field.makeMove(Move.DOWN)) { + } + success = true + placePiece() + } + } + if (success) { + field.draw() + visualizer.refresh() + } + } + ++ticks + if (ticks < speed) continue + if (!field.makeMove(Move.DOWN)) { + if (++attemptsToLock >= LOCK_DELAY) { + placePiece() + attemptsToLock = 0 + } + } + field.draw() + visualizer.refresh() + ticks -= speed + } + } + +} + diff --git a/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/tetris/main.kt b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/tetris/main.kt new file mode 100644 index 00000000..ca988910 --- /dev/null +++ b/bindings/sdl/examples/snake/src/main/kotlin/io/ygdrasil/tetris/main.kt @@ -0,0 +1,11 @@ +package io.ygdrasil.tetris + + +fun main() { + + val visualizer = SDLView(10, 20) + val game = Game(10, 20, visualizer, visualizer) + game.startNewGame() + + return +} \ No newline at end of file diff --git a/bindings/sdl/libsdl/src/main/resources/Crowander-Stop-on-a-Bench.wav b/bindings/sdl/examples/snake/src/main/resources/Crowander-Stop-on-a-Bench.wav similarity index 100% rename from bindings/sdl/libsdl/src/main/resources/Crowander-Stop-on-a-Bench.wav rename to bindings/sdl/examples/snake/src/main/resources/Crowander-Stop-on-a-Bench.wav diff --git a/bindings/sdl/libsdl/src/main/resources/Font16_42_Normal4_sheet.bmp b/bindings/sdl/examples/snake/src/main/resources/Font16_42_Normal4_sheet.bmp similarity index 100% rename from bindings/sdl/libsdl/src/main/resources/Font16_42_Normal4_sheet.bmp rename to bindings/sdl/examples/snake/src/main/resources/Font16_42_Normal4_sheet.bmp diff --git a/bindings/sdl/libsdl/src/main/resources/License.txt b/bindings/sdl/examples/snake/src/main/resources/License.txt similarity index 100% rename from bindings/sdl/libsdl/src/main/resources/License.txt rename to bindings/sdl/examples/snake/src/main/resources/License.txt diff --git a/bindings/sdl/libsdl/src/main/resources/grass.bmp b/bindings/sdl/examples/snake/src/main/resources/grass.bmp similarity index 100% rename from bindings/sdl/libsdl/src/main/resources/grass.bmp rename to bindings/sdl/examples/snake/src/main/resources/grass.bmp diff --git a/bindings/sdl/libsdl/src/main/resources/snake-graphics.bmp b/bindings/sdl/examples/snake/src/main/resources/snake-graphics.bmp similarity index 100% rename from bindings/sdl/libsdl/src/main/resources/snake-graphics.bmp rename to bindings/sdl/examples/snake/src/main/resources/snake-graphics.bmp diff --git a/bindings/sdl/examples/tetris/build.gradle.kts b/bindings/sdl/examples/tetris/build.gradle.kts new file mode 100644 index 00000000..00ea6754 --- /dev/null +++ b/bindings/sdl/examples/tetris/build.gradle.kts @@ -0,0 +1,19 @@ + +plugins { + kotlin("jvm") version libs.versions.kotlin + application +} + +dependencies { + api(project(":sdl2-4k")) + api(project(":sdl2-binaries")) + testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation(libs.kotest) +} + + +application { + mainClass.set("tetris.MainKt") + applicationDefaultJvmArgs += "-XstartOnFirstThread" + tasks.run.get().workingDir = project.projectDir.resolve("src").resolve("main").resolve("resources") +} \ No newline at end of file diff --git a/bindings/sdl/examples/tetris/src/main/kotlin/SDLView.kt b/bindings/sdl/examples/tetris/src/main/kotlin/SDLView.kt new file mode 100644 index 00000000..17b8863a --- /dev/null +++ b/bindings/sdl/examples/tetris/src/main/kotlin/SDLView.kt @@ -0,0 +1,465 @@ +package tetris + +import com.sun.jna.ptr.IntByReference +import io.ygdrasil.libsdl.* + +class SDLView(private val width: Int, private val height: Int) : GameFieldVisualizer, UserInput { + + fun error(message: Any): Nothing { + if (this::renderer.isInitialized) SDL_DestroyRenderer(renderer) + if (this::window.isInitialized) SDL_DestroyWindow(window) + println("$message: ${SDL_GetError()}") + SDL_Quit() + throw IllegalStateException() + } + + private val CELL_SIZE = 20 + private val COLORS = 10 + private val CELLS_WIDTH = COLORS * CELL_SIZE + private val CELLS_HEIGHT = 3 * CELL_SIZE + private val SYMBOL_SIZE = 21 + private val INFO_MARGIN = 10 + private val MARGIN = 2 + private val BORDER_WIDTH = 18 + private val INFO_SPACE_WIDTH = SYMBOL_SIZE * (2 + 8) + private val LINES_LABEL_WIDTH = 104 + private val SCORE_LABEL_WIDTH = 107 + private val LEVEL_LABEL_WIDTH = 103 + private val NEXT_LABEL_WIDTH = 85 + private val TETRISES_LABEL_WIDTH = 162 + + private var ratio: Float + + private fun stretch(value: Int) = (value.toFloat() * ratio + 0.5).toInt() + + inner class GamePadButtons(width: Int, height: Int, gamePadHeight: Int) { + val MOVE_BUTTON_SIZE = 50 + val ROTATE_BUTTON_SIZE = 80 + val BUTTONS_MARGIN = 25 + + val leftRect: SDL_Rect + val rightRect: SDL_Rect + val downRect: SDL_Rect + val dropRect: SDL_Rect + val rotateRect: SDL_Rect + + init { + val moveButtonsWidth = 3 * MOVE_BUTTON_SIZE + 2 * BUTTONS_MARGIN + BUTTONS_MARGIN + val x = (width - moveButtonsWidth - ROTATE_BUTTON_SIZE) / 2 - MOVE_BUTTON_SIZE + val y2 = (gamePadHeight - 2 * MOVE_BUTTON_SIZE - BUTTONS_MARGIN) / 2 + leftRect = SDL_Rect() + leftRect.w = MOVE_BUTTON_SIZE + leftRect.h = MOVE_BUTTON_SIZE + leftRect.x = x + leftRect.y = height - gamePadHeight + y2 + MOVE_BUTTON_SIZE + BUTTONS_MARGIN + + downRect = SDL_Rect() + downRect.w = MOVE_BUTTON_SIZE + downRect.h = MOVE_BUTTON_SIZE + downRect.x = x + MOVE_BUTTON_SIZE + BUTTONS_MARGIN + downRect.y = leftRect.y + + dropRect = SDL_Rect().apply { + this.x = MOVE_BUTTON_SIZE + y = MOVE_BUTTON_SIZE + h = downRect.x + w =height - gamePadHeight + y2 + } + + rightRect = SDL_Rect() + rightRect.w = MOVE_BUTTON_SIZE + rightRect.h = MOVE_BUTTON_SIZE + rightRect.x = x + 2 * MOVE_BUTTON_SIZE + 2 * BUTTONS_MARGIN + rightRect.y = height - gamePadHeight + y2 + MOVE_BUTTON_SIZE + BUTTONS_MARGIN + + rotateRect = SDL_Rect() + rotateRect.w = ROTATE_BUTTON_SIZE + rotateRect.h = ROTATE_BUTTON_SIZE + rotateRect.x = x + moveButtonsWidth + rotateRect.y = height - gamePadHeight + y2 - BUTTONS_MARGIN + } + + fun getCommandAt(x: Int, y: Int): UserCommand? { + return when { + inside(leftRect, x, y) -> UserCommand.LEFT + inside(rightRect, x, y) -> UserCommand.RIGHT + inside(downRect, x, y) -> UserCommand.DOWN + inside(dropRect, x, y) -> UserCommand.DROP + inside(rotateRect, x, y) -> UserCommand.ROTATE + else -> null + } + } + + private fun inside(rect: SDL_Rect, x: Int, y: Int): Boolean { + return x >= stretch(rect.x) && x <= stretch(rect.x + rect.w) + && y >= stretch(rect.y) && y <= stretch(rect.y + rect.h) + } + + } + + private val field: Field = Array(height) { ByteArray(width) } + private val nextPieceField: Field = Array(4) { ByteArray(4) } + private var linesCleared: Int = 0 + private var level: Int = 0 + private var score: Int = 0 + private var tetrises: Int = 0 + + private var displayWidth: Int = 0 + private var displayHeight: Int = 0 + private val fieldWidth: Int + private val fieldHeight: Int + private var windowX: Int + private var windowY: Int + private lateinit var window: SDL_Window + private lateinit var renderer: SDL_Renderer + private val texture: SDL_Texture + private val gamePadButtons: GamePadButtons? + + init { + if (SDL_Init(SDL_INIT_EVERYTHING.toInt()) != 0) { + throw Error("SDL_Init Error: ${SDL_GetError()}") + } + + val platform: String = SDL_GetPlatform() ?: error("fail to get platform") + + val displayMode = SDL_DisplayMode() + if (SDL_GetCurrentDisplayMode(0, displayMode) != 0) { + println("SDL_GetCurrentDisplayMode Error: ${SDL_GetError()}") + SDL_Quit() + throw Error() + } + displayWidth = displayMode.w + displayHeight = displayMode.h + fieldWidth = width * (CELL_SIZE + MARGIN) + MARGIN + BORDER_WIDTH * 2 + fieldHeight = height * (CELL_SIZE + MARGIN) + MARGIN + BORDER_WIDTH * 2 + var windowWidth = fieldWidth + INFO_SPACE_WIDTH + var windowHeight: Int + if (platform == "iOS") { + val gamePadHeight = (displayHeight * windowWidth - fieldHeight * displayWidth) / displayWidth + windowHeight = fieldHeight + gamePadHeight + gamePadButtons = GamePadButtons(windowWidth, windowHeight, gamePadHeight) + windowX = 0 + windowY = 0 + ratio = displayHeight.toFloat() / windowHeight + windowWidth = displayWidth + windowHeight = displayHeight + } else { + windowHeight = fieldHeight + gamePadButtons = null + windowX = (displayWidth - windowWidth) / 2 + windowY = (displayHeight - windowHeight) / 2 + ratio = 1.0f + } + + window = SDL_CreateWindow( + "Tetris", windowX, windowY, windowWidth, windowHeight, + SDL_WindowFlags.SDL_WINDOW_SHOWN or SDL_WindowFlags.SDL_WINDOW_ALLOW_HIGHDPI + ) ?: error("") + + renderer = SDL_CreateRenderer(window, -1, SDL_RendererFlags.SDL_RENDERER_ACCELERATED or SDL_RendererFlags.SDL_RENDERER_PRESENTVSYNC) + ?: error("") + + val realWidth = IntByReference() + val realHeight = IntByReference() + SDL_GetRendererOutputSize(renderer, realWidth.pointer, realHeight.pointer) + if (platform != "iOS" && windowHeight != realHeight.value) { + println("DPI differs ${realWidth} x ${realHeight} vs $windowWidth x $windowHeight") + ratio = realHeight.value.toFloat() / windowHeight + } + + texture = loadImage(renderer, "tetris_all.bmp") + } + + private fun loadImage(ren: SDL_Renderer, imagePath: String): SDL_Texture { + val bmp = SDL_LoadBMP_RW(SDL_RWFromFile(imagePath, "rb"), 1) + + val tex = SDL_CreateTextureFromSurface(ren, bmp) ?: error("") + SDL_FreeSurface(bmp) + return tex + } + + override fun drawCell(x: Int, y: Int, cell: Byte) { + field[x][y] = cell + } + + override fun drawNextPieceCell(x: Int, y: Int, cell: Byte) { + nextPieceField[x][y] = cell + } + + override fun setInfo(linesCleared: Int, level: Int, score: Int, tetrises: Int) { + this.linesCleared = linesCleared + this.level = level + this.score = score + this.tetrises = tetrises + } + + override fun refresh() { + SDL_RenderClear(renderer) + drawField() + drawInfo() + drawNextPiece() + drawGamePad() + SDL_RenderPresent(renderer) + } + + private fun drawBorder(topLeftX: Int, topLeftY: Int, width: Int, height: Int) { + // Upper-left corner. + var srcX = CELLS_WIDTH + var srcY = 0 + var destX = topLeftX + var destY = topLeftY + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH + MARGIN, BORDER_WIDTH) + + // Upper margin. + srcX += BORDER_WIDTH + MARGIN + destX += BORDER_WIDTH + MARGIN + for (i in 0..width - 1) { + copyRect(srcX, srcY, destX, destY, CELL_SIZE + MARGIN, BORDER_WIDTH) + destX += CELL_SIZE + MARGIN + } + + // Upper-right corner. + srcX += CELL_SIZE + MARGIN + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH, BORDER_WIDTH + MARGIN) + + // Right margin. + srcY += BORDER_WIDTH + MARGIN + destY += BORDER_WIDTH + MARGIN + for (j in 0..height - 1) { + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH, CELL_SIZE + MARGIN) + destY += CELL_SIZE + MARGIN + } + + // Left margin. + srcX = CELLS_WIDTH + srcY = BORDER_WIDTH + destX = topLeftX + destY = topLeftY + BORDER_WIDTH + for (j in 0..height - 1) { + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH, CELL_SIZE + MARGIN) + destY += CELL_SIZE + MARGIN + } + + // Left-down corner. + srcY += CELL_SIZE + MARGIN + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH, BORDER_WIDTH + MARGIN) + + // Down marign. + srcX += BORDER_WIDTH + srcY += MARGIN + destX += BORDER_WIDTH + destY += MARGIN + for (i in 0..width - 1) { + copyRect(srcX, srcY, destX, destY, CELL_SIZE + MARGIN, BORDER_WIDTH) + destX += CELL_SIZE + MARGIN + + } + // Right-down corner. + srcX += CELL_SIZE + MARGIN + copyRect(srcX, srcY, destX, destY, BORDER_WIDTH + MARGIN, BORDER_WIDTH) + } + + private fun drawField() { + drawField( + field = field, + topLeftX = 0, + topLeftY = 0, + width = width, + height = height + ) + } + + private fun drawNextPiece() { + drawInt( + labelSrcX = LEVEL_LABEL_WIDTH, + labelSrcY = CELLS_HEIGHT + SYMBOL_SIZE, + labelDestX = fieldWidth + SYMBOL_SIZE, + labelDestY = getInfoY(5), + labelWidth = NEXT_LABEL_WIDTH, + totalDigits = 0, + value = 0 + ) + drawField( + field = nextPieceField, + topLeftX = fieldWidth + SYMBOL_SIZE, + topLeftY = getInfoY(6), + width = 4, + height = 4 + ) + } + + private fun drawField(field: Field, topLeftX: Int, topLeftY: Int, width: Int, height: Int) { + drawBorder( + topLeftX = topLeftX, + topLeftY = topLeftY, + width = width, + height = height + ) + for (i in 0..height - 1) + for (j in 0..width - 1) { + val cell = field[i][j].toInt() + if (cell == 0) continue + copyRect( + srcX = (level % COLORS) * CELL_SIZE, + srcY = (3 - cell) * CELL_SIZE, + destX = topLeftX + BORDER_WIDTH + MARGIN + j * (CELL_SIZE + MARGIN), + destY = topLeftY + BORDER_WIDTH + MARGIN + i * (CELL_SIZE + MARGIN), + width = CELL_SIZE, + height = CELL_SIZE + ) + } + } + + private fun drawInfo() { + drawInt( + labelSrcX = LINES_LABEL_WIDTH, + labelSrcY = CELLS_HEIGHT, + labelDestX = fieldWidth + SYMBOL_SIZE, + labelDestY = getInfoY(0), + labelWidth = SCORE_LABEL_WIDTH, + totalDigits = 6, + value = score + ) + drawInt( + labelSrcX = 0, + labelSrcY = CELLS_HEIGHT, + labelDestX = fieldWidth + SYMBOL_SIZE, + labelDestY = getInfoY(1), + labelWidth = LINES_LABEL_WIDTH, + totalDigits = 3, + value = linesCleared + ) + drawInt( + labelSrcX = 0, + labelSrcY = CELLS_HEIGHT + SYMBOL_SIZE, + labelDestX = fieldWidth + SYMBOL_SIZE, + labelDestY = getInfoY(2), + labelWidth = LEVEL_LABEL_WIDTH, + totalDigits = 2, + value = level + ) + drawInt( + labelSrcX = 0, + labelSrcY = CELLS_HEIGHT + SYMBOL_SIZE * 2, + labelDestX = fieldWidth + SYMBOL_SIZE, + labelDestY = getInfoY(3), + labelWidth = TETRISES_LABEL_WIDTH, + totalDigits = 2, + value = tetrises + ) + } + + private fun getInfoY(line: Int): Int { + return SYMBOL_SIZE * (2 * line + 1) + INFO_MARGIN * line + } + + private fun drawInt( + labelSrcX: Int, labelSrcY: Int, labelDestX: Int, labelDestY: Int, + labelWidth: Int, totalDigits: Int, value: Int + ) { + copyRect( + srcX = labelSrcX, + srcY = labelSrcY, + destX = labelDestX, + destY = labelDestY, + width = labelWidth, + height = SYMBOL_SIZE + ) + val digits = IntArray(totalDigits) + var x = value + for (i in 0..totalDigits - 1) { + digits[totalDigits - 1 - i] = x % 10 + x = x / 10 + } + for (i in 0..totalDigits - 1) { + copyRect( + srcX = digits[i] * SYMBOL_SIZE, + srcY = CELLS_HEIGHT + 3 * SYMBOL_SIZE, + destX = labelDestX + SYMBOL_SIZE + i * SYMBOL_SIZE, + destY = labelDestY + SYMBOL_SIZE, + width = SYMBOL_SIZE, + height = SYMBOL_SIZE + ) + } + } + + private fun drawGamePad() { + if (gamePadButtons == null) return + SDL_SetRenderDrawColor(renderer, 127, 127, 127, SDL_ALPHA_OPAQUE.toByte()) + fillRect(gamePadButtons.leftRect) + fillRect(gamePadButtons.downRect) + fillRect(gamePadButtons.dropRect) + fillRect(gamePadButtons.rightRect) + fillRect(gamePadButtons.rotateRect) + SDL_SetRenderDrawColor(renderer, 0, 0, 0, SDL_ALPHA_OPAQUE.toByte()) + } + + private fun fillRect(rect: SDL_Rect) { + val stretchedRect = SDL_Rect().apply { + w = stretch(rect.w) + h = stretch(rect.h) + x = stretch(rect.x) + y = stretch(rect.y) + } + SDL_RenderFillRect(renderer, stretchedRect) + } + + + private fun copyRect(srcX: Int, srcY: Int, destX: Int, destY: Int, width: Int, height: Int) { + val srcRect = SDL_Rect().apply { + w = width + h = height + x = srcX + y = srcY + } + val destRect = SDL_Rect().apply { + w = stretch(width) + h = stretch(height) + x = stretch(destX) + y = stretch(destY) + } + SDL_RenderCopy(renderer, texture, srcRect, destRect) + } + + override fun readCommands(): List { + val commands = mutableListOf() + val event = SDL_Event() + SDL_PollEvent(event) + while (event != null) { + when (SDL_EventType.of(event.type)) { + SDL_EventType.SDL_QUIT -> commands.add(UserCommand.EXIT) + SDL_EventType.SDL_KEYDOWN -> { + val keyboardEvent = event.key + when (keyboardEvent.keysym.scancode.toInt()) { + SDL_Scancode.SDL_SCANCODE_LEFT.value -> commands.add(UserCommand.LEFT) + SDL_Scancode.SDL_SCANCODE_RIGHT.value -> commands.add(UserCommand.RIGHT) + SDL_Scancode.SDL_SCANCODE_DOWN.value -> commands.add(UserCommand.DOWN) + SDL_Scancode.SDL_SCANCODE_Z.value, SDL_Scancode.SDL_SCANCODE_SPACE.value -> commands.add(UserCommand.ROTATE) + SDL_Scancode.SDL_SCANCODE_UP.value -> commands.add(UserCommand.DROP) + SDL_Scancode.SDL_SCANCODE_ESCAPE.value -> commands.add(UserCommand.EXIT) + } + } + SDL_EventType.SDL_MOUSEBUTTONDOWN -> if (gamePadButtons != null) { + val mouseEvent = event as SDL_MouseButtonEvent + val x = mouseEvent.x + val y = mouseEvent.y + val command = gamePadButtons.getCommandAt(x, y) + if (command != null) + commands.add(command) + } + + else -> { } + } + + SDL_PollEvent(event) + } + return commands + } + + fun destroy() { + SDL_DestroyTexture(texture) + SDL_DestroyRenderer(renderer) + SDL_DestroyWindow(window) + SDL_Quit() + } +} diff --git a/bindings/sdl/examples/tetris/src/main/kotlin/Tetris.kt b/bindings/sdl/examples/tetris/src/main/kotlin/Tetris.kt new file mode 100644 index 00000000..6ce7e6f4 --- /dev/null +++ b/bindings/sdl/examples/tetris/src/main/kotlin/Tetris.kt @@ -0,0 +1,489 @@ +package tetris + +import io.ygdrasil.libsdl.SDL_Delay +import kotlin.random.Random + +typealias Field = Array + +enum class Move { + LEFT, + RIGHT, + DOWN, + ROTATE +} + +enum class PlacementResult(val linesCleared: Int = 0, val bonus: Int = 0) { + NOTHING, + GAMEOVER, + // For values of bonuses see https://tetris.wiki/Scoring + SINGLE(1, 40), + DOUBLE(2, 100), + TRIPLE(3, 300), + TETRIS(4, 1200) +} + +const val EMPTY: Byte = 0 +const val CELL1: Byte = 1 +const val CELL2: Byte = 2 +const val CELL3: Byte = 3 +const val BRICK: Byte = -1 + +class Point(var x: Int, var y: Int) + +operator fun Point.plus(other: Point): Point { + return Point(x + other.x, y + other.y) +} + +class PiecePosition(piece: Piece, private val origin: Point) { + private var p = piece.origin + val x get() = p.x + origin.x + val y get() = p.y + origin.y + + var state: Int private set + val numberOfStates = piece.numberOfStates + + init { + state = 0 + } + + fun makeMove(move: Move) { + when (move) { + Move.LEFT -> --p.y + Move.RIGHT -> ++p.y + Move.DOWN -> ++p.x + Move.ROTATE -> state = (state + 1) % numberOfStates + } + } + + fun unMakeMove(move: Move) { + when (move) { + Move.LEFT -> ++p.y + Move.RIGHT -> --p.y + Move.DOWN -> --p.x + Move.ROTATE -> state = (state + numberOfStates - 1) % numberOfStates + } + } +} + +/* + * We use Nintendo Rotation System, right-handed version. + * See https://tetris.wiki/Nintendo_Rotation_System + */ +enum class Piece(private val origin_: Point, private vararg val states: Field) { + T( + Point(-1, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY), + byteArrayOf(CELL1, CELL1, CELL1), + byteArrayOf(EMPTY, CELL1, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL1, EMPTY), + byteArrayOf(CELL1, CELL1, EMPTY), + byteArrayOf(EMPTY, CELL1, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL1, EMPTY), + byteArrayOf(CELL1, CELL1, CELL1), + byteArrayOf(EMPTY, EMPTY, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL1, EMPTY), + byteArrayOf(EMPTY, CELL1, CELL1), + byteArrayOf(EMPTY, CELL1, EMPTY)) + ), + J( + Point(-1, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY), + byteArrayOf(CELL2, CELL2, CELL2), + byteArrayOf(EMPTY, EMPTY, CELL2)), + arrayOf( + byteArrayOf(EMPTY, CELL2, EMPTY), + byteArrayOf(EMPTY, CELL2, EMPTY), + byteArrayOf(CELL2, CELL2, EMPTY)), + arrayOf( + byteArrayOf(CELL2, EMPTY, EMPTY), + byteArrayOf(CELL2, CELL2, CELL2), + byteArrayOf(EMPTY, EMPTY, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL2, CELL2), + byteArrayOf(EMPTY, CELL2, EMPTY), + byteArrayOf(EMPTY, CELL2, EMPTY)) + ), + Z( + Point(-1, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY), + byteArrayOf(CELL3, CELL3, EMPTY), + byteArrayOf(EMPTY, CELL3, CELL3)), + arrayOf( + byteArrayOf(EMPTY, EMPTY, CELL3), + byteArrayOf(EMPTY, CELL3, CELL3), + byteArrayOf(EMPTY, CELL3, EMPTY)) + ), + O( + Point(0, -1), + arrayOf( + byteArrayOf(CELL1, CELL1), + byteArrayOf(CELL1, CELL1)) + ), + S( + Point(-1, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY), + byteArrayOf(EMPTY, CELL2, CELL2), + byteArrayOf(CELL2, CELL2, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL2, EMPTY), + byteArrayOf(EMPTY, CELL2, CELL2), + byteArrayOf(EMPTY, EMPTY, CELL2)) + ), + L( + Point(-1, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY), + byteArrayOf(CELL3, CELL3, CELL3), + byteArrayOf(CELL3, EMPTY, EMPTY)), + arrayOf( + byteArrayOf(CELL3, CELL3, EMPTY), + byteArrayOf(EMPTY, CELL3, EMPTY), + byteArrayOf(EMPTY, CELL3, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, EMPTY, CELL3), + byteArrayOf(CELL3, CELL3, CELL3), + byteArrayOf(EMPTY, EMPTY, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, CELL3, EMPTY), + byteArrayOf(EMPTY, CELL3, EMPTY), + byteArrayOf(EMPTY, CELL3, CELL3)) + ), + I( + Point(-2, -2), + arrayOf( + byteArrayOf(EMPTY, EMPTY, EMPTY, EMPTY), + byteArrayOf(EMPTY, EMPTY, EMPTY, EMPTY), + byteArrayOf(CELL1, CELL1, CELL1, CELL1), + byteArrayOf(EMPTY, EMPTY, EMPTY, EMPTY)), + arrayOf( + byteArrayOf(EMPTY, EMPTY, CELL1, EMPTY), + byteArrayOf(EMPTY, EMPTY, CELL1, EMPTY), + byteArrayOf(EMPTY, EMPTY, CELL1, EMPTY), + byteArrayOf(EMPTY, EMPTY, CELL1, EMPTY)) + ); + + val origin get() = Point(origin_.x, origin_.y) + val numberOfStates: Int = states.size + + fun canBePlaced(field: Field, position: PiecePosition): Boolean { + val piece = states[position.state] + val x = position.x + val y = position.y + for (i in piece.indices) { + val pieceRow = piece[i] + val boardRow = field[x + i] + for (j in pieceRow.indices) { + if (pieceRow[j] != EMPTY && boardRow[y + j] != EMPTY) + return false + } + } + return true + } + + fun place(field: Field, position: PiecePosition) { + val piece = states[position.state] + val x = position.x + val y = position.y + for (i in piece.indices) { + val pieceRow = piece[i] + for (j in pieceRow.indices) { + if (pieceRow[j] != EMPTY) field[x + i][y + j] = pieceRow[j] + } + } + } + + fun unPlace(field: Field, position: PiecePosition) { + val piece = states[position.state] + val x = position.x + val y = position.y + for (i in piece.indices) { + val pieceRow = piece[i] + for (j in pieceRow.indices) { + if (pieceRow[j] != EMPTY) field[x + i][y + j] = EMPTY + } + } + } +} + +interface GameFieldVisualizer { + fun drawCell(x: Int, y: Int, cell: Byte) + fun drawNextPieceCell(x: Int, y: Int, cell: Byte) + fun setInfo(linesCleared: Int, level: Int, score: Int, tetrises: Int) + fun refresh() +} + +enum class UserCommand { + LEFT, + RIGHT, + DOWN, + DROP, + ROTATE, + EXIT +} + +interface UserInput { + fun readCommands(): List +} + +class GameField(val width: Int, val height: Int, val visualizer: GameFieldVisualizer) { + private val MARGIN = 4 + + private val field: Field = Array(height + MARGIN * 2) { ByteArray(width + MARGIN * 2) } + private val origin: Point + private val nextPieceField: Field + + init { + for (i in field.indices) { + val row = field[i] + for (j in row.indices) { + if (i >= (MARGIN + height) // Bottom (field is flipped over). + || (j < MARGIN) // Left + || (j >= MARGIN + width)) // Right + row[j] = BRICK + } + } + // Coordinates are relative to the central axis and top of the field. + origin = Point(MARGIN, MARGIN + (width + 1) / 2) + nextPieceField = Array(4) { ByteArray(4) } + } + + lateinit var currentPiece: Piece + lateinit var nextPiece: Piece + lateinit var currentPosition: PiecePosition + + fun reset() { + for (i in 0..height - 1) + for (j in 0..width - 1) + field[i + MARGIN][j + MARGIN] = 0 + nextPiece = getNextPiece(false) + switchCurrentPiece() + } + + private fun getNextPiece(denyPrevious: Boolean): Piece { + val pieces = Piece.values() + if (!denyPrevious) + return pieces[Random.nextInt(pieces.size)] + while (true) { + val nextPiece = pieces[Random.nextInt(pieces.size)] + if (nextPiece != currentPiece) return nextPiece + } + } + + private fun switchCurrentPiece() { + currentPiece = nextPiece + nextPiece = getNextPiece(denyPrevious = true) // Forbid repeating the same piece for better distribution. + currentPosition = PiecePosition(currentPiece, origin) + } + + fun makeMove(move: Move): Boolean { + currentPosition.makeMove(move) + if (currentPiece.canBePlaced(field, currentPosition)) + return true + currentPosition.unMakeMove(move) + return false + } + + /** + * Places current piece at its current location. + */ + fun place(): PlacementResult { + currentPiece.place(field, currentPosition) + val linesCleared = clearLines() + if (isOutOfBorders()) return PlacementResult.GAMEOVER + switchCurrentPiece() + if (!currentPiece.canBePlaced(field, currentPosition)) + return PlacementResult.GAMEOVER + when (linesCleared) { + 1 -> return PlacementResult.SINGLE + 2 -> return PlacementResult.DOUBLE + 3 -> return PlacementResult.TRIPLE + 4 -> return PlacementResult.TETRIS + else -> return PlacementResult.NOTHING + } + } + + private fun clearLines(): Int { + val clearedLines = mutableListOf() + for (i in 0..height - 1) { + val row = field[i + MARGIN] + if ((0..width - 1).all { j -> row[j + MARGIN] != EMPTY }) { + clearedLines.add(i + MARGIN) + (0..width - 1).forEach { j -> row[j + MARGIN] = EMPTY } + } + } + if (clearedLines.size == 0) return 0 + draw(false) + visualizer.refresh() + SDL_Delay(500) + for (i in clearedLines) { + for (k in i - 1 downTo 1) + for (j in 0..width - 1) + field[k + 1][j + MARGIN] = field[k][j + MARGIN] + } + draw(false) + visualizer.refresh() + return clearedLines.size + } + + private fun isOutOfBorders(): Boolean { + for (i in 0 until MARGIN) + for (j in 0 until width) + if (field[i][j + MARGIN] != EMPTY) + return true + return false + } + + fun draw() { + draw(true) + drawNextPiece() + } + + private fun drawNextPiece() { + for (i in 0..3) + for (j in 0..3) + nextPieceField[i][j] = 0 + nextPiece.place(nextPieceField, PiecePosition(nextPiece, Point(1, 2))) + for (i in 0..3) + for (j in 0..3) + visualizer.drawNextPieceCell(i, j, nextPieceField[i][j]) + } + + private fun draw(drawCurrentPiece: Boolean) { + if (drawCurrentPiece) + currentPiece.place(field, currentPosition) + for (i in 0..height - 1) + for (j in 0..width - 1) + visualizer.drawCell(i, j, field[i + MARGIN][j + MARGIN]) + if (drawCurrentPiece) + currentPiece.unPlace(field, currentPosition) + } +} + +class Game(width: Int, height: Int, val visualizer: GameFieldVisualizer, val userInput: UserInput) { + private val field = GameField(width, height, visualizer) + + private var gameOver = true + private var startLevel = 0 + private var leveledUp = false + private var level = 0 + private var linesClearedAtCurrentLevel = 0 + private var linesCleared = 0 + private var tetrises = 0 + private var score = 0 + + /* + * For speed constants and level up thresholds see https://tetris.wiki/Tetris_(NES,_Nintendo) + */ + private val speeds = intArrayOf(48, 43, 38, 33, 28, 23, 18, 13, 8, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) + private val levelUpThreshold + get() = + if (leveledUp) 10 + else minOf(startLevel * 10 + 10, maxOf(100, startLevel * 10 - 50)) + private val speed get() = if (level < 29) speeds[level] else 1 + + private var ticks = 0 + + fun startNewGame() { + gameOver = false + startLevel = level + leveledUp = false + this.level = level + linesClearedAtCurrentLevel = 0 + linesCleared = 0 + tetrises = 0 + score = 0 + ticks = 0 + field.reset() + + visualizer.setInfo(linesCleared, level, score, tetrises) + field.draw() + visualizer.refresh() + + mainLoop() + } + + private fun placePiece() { + val placementResult = field.place() + ticks = 0 + when (placementResult) { + PlacementResult.NOTHING -> return + PlacementResult.GAMEOVER -> { + gameOver = true + return + } + else -> { + linesCleared += placementResult.linesCleared + linesClearedAtCurrentLevel += placementResult.linesCleared + score += placementResult.bonus * (level + 1) + if (placementResult == PlacementResult.TETRIS) + ++tetrises + val levelUpThreshold = levelUpThreshold + if (linesClearedAtCurrentLevel >= levelUpThreshold) { + ++level + linesClearedAtCurrentLevel -= levelUpThreshold + leveledUp = true + } + + visualizer.setInfo(linesCleared, level, score, tetrises) + } + } + } + + /* + * Number of additional gravity shifts before locking a piece landed on the ground. + * This is needed in order to let user to move a piece to the left/right before locking. + */ + private val LOCK_DELAY = 1 + + private fun mainLoop() { + var attemptsToLock = 0 + while (!gameOver) { + SDL_Delay((1000 / 60)) // Refresh rate - 60 frames per second. + val commands = userInput.readCommands() + for (cmd in commands) { + val success: Boolean + when (cmd) { + UserCommand.EXIT -> return + UserCommand.LEFT -> success = field.makeMove(Move.LEFT) + UserCommand.RIGHT -> success = field.makeMove(Move.RIGHT) + UserCommand.ROTATE -> success = field.makeMove(Move.ROTATE) + UserCommand.DOWN -> { + success = field.makeMove(Move.DOWN) + if (!success) placePiece() + } + UserCommand.DROP -> { + while (field.makeMove(Move.DOWN)) { + } + success = true + placePiece() + } + } + if (success) { + field.draw() + visualizer.refresh() + } + } + ++ticks + if (ticks < speed) continue + if (!field.makeMove(Move.DOWN)) { + if (++attemptsToLock >= LOCK_DELAY) { + placePiece() + attemptsToLock = 0 + } + } + field.draw() + visualizer.refresh() + ticks -= speed + } + } + +} + diff --git a/bindings/sdl/examples/tetris/src/main/kotlin/main.kt b/bindings/sdl/examples/tetris/src/main/kotlin/main.kt new file mode 100644 index 00000000..b78e5c5a --- /dev/null +++ b/bindings/sdl/examples/tetris/src/main/kotlin/main.kt @@ -0,0 +1,11 @@ +package tetris + + +fun main() { + + val visualizer = SDLView(10, 20) + val game = Game(10, 20, visualizer, visualizer) + game.startNewGame() + + return +} \ No newline at end of file diff --git a/bindings/sdl/examples/tetris/src/main/resources/tetris_all.bmp b/bindings/sdl/examples/tetris/src/main/resources/tetris_all.bmp new file mode 100644 index 00000000..e5c57a6c Binary files /dev/null and b/bindings/sdl/examples/tetris/src/main/resources/tetris_all.bmp differ diff --git a/bindings/sdl/gradle.properties b/bindings/sdl/gradle.properties new file mode 100644 index 00000000..1a9f3845 --- /dev/null +++ b/bindings/sdl/gradle.properties @@ -0,0 +1,3 @@ +# Enable to use panama class on klang gradle plugin +org.gradle.jvmargs=--enable-preview +org.gradle.daemon=false \ No newline at end of file diff --git a/bindings/sdl/gradle/libs.versions.toml b/bindings/sdl/gradle/libs.versions.toml index 12809027..849f8965 100644 --- a/bindings/sdl/gradle/libs.versions.toml +++ b/bindings/sdl/gradle/libs.versions.toml @@ -2,6 +2,7 @@ kotest = "5.6.1" klang = "0.0.0" jna = "5.13.0" +kotlin = "1.9.22" [libraries] kotest = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" } diff --git a/bindings/sdl/gradle/wrapper/gradle-wrapper.properties b/bindings/sdl/gradle/wrapper/gradle-wrapper.properties index c30b486a..3499ded5 100644 --- a/bindings/sdl/gradle/wrapper/gradle-wrapper.properties +++ b/bindings/sdl/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/bindings/sdl/libsdl/build.gradle.kts b/bindings/sdl/libsdl/build.gradle.kts index 33786408..f76e2ce8 100644 --- a/bindings/sdl/libsdl/build.gradle.kts +++ b/bindings/sdl/libsdl/build.gradle.kts @@ -1,8 +1,10 @@ +import io.ygdrasil.ParsingMethod +import klang.domain.TypeRefField import klang.domain.typeOf import klang.domain.unchecked import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent -import java.net.URL +import java.net.URI buildscript { dependencies { @@ -16,7 +18,7 @@ buildscript { } plugins { - kotlin("jvm") version "1.9.10" + kotlin("jvm") version libs.versions.kotlin alias(libs.plugins.klang) } @@ -50,12 +52,16 @@ sourceSets.main { java.srcDirs(buildDir) } -val headerUrl = URL("https://github.com/klang-toolkit/SDL-binary/releases/download/2.28.2-Alpha3/headers.zip") +val headerUrl = URI("https://github.com/klang-toolkit/SDL-binary/releases/download/2.30.0/headers.zip") + .toURL() ?: error("cannot create header url") klang { + + parsingMethod = ParsingMethod.Libclang + download(headerUrl) .let(::unpack) - .let { + .let { it -> parse(fileToParse = "SDL2/SDL.h", at = it) { findTypeAliasByName("Uint8")?.apply { // Type is dumped as Int instead of char @@ -64,15 +70,25 @@ klang { // Replace SDL_PixelFormat by void * to avoid circular dependency when calculating size of structure findStructureByName("SDL_PixelFormat")?.apply { - fields = fields.map { (name, fields) -> - when (name) { - "next" -> name to typeOf("void *").unchecked() - else -> name to fields - } - } + fields = fields + .filterIsInstance() + .map { (name, fields) -> + when (name) { + "next" -> name to typeOf("void *").unchecked() + else -> name to fields + } + }.map { TypeRefField(it.first, it.second) } } } + parse(fileToParse = "SDL2/SDL_syswm.h", at = it) } - generateBinding("libsdl", "SDL2") + generateBinding("io.ygdrasil.libsdl", "SDL2") } + +tasks.named("compileJava", JavaCompile::class.java) { + options.compilerArgumentProviders.add(CommandLineArgumentProvider { + // Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work + listOf("--patch-module", "io.ygdrasil.libsdl=${sourceSets["main"].output.asPath}") + }) +} \ No newline at end of file diff --git a/bindings/sdl/libsdl/src/main/java/module-info.java b/bindings/sdl/libsdl/src/main/java/module-info.java new file mode 100644 index 00000000..4bffb2f3 --- /dev/null +++ b/bindings/sdl/libsdl/src/main/java/module-info.java @@ -0,0 +1,5 @@ +module io.ygdrasil.libsdl { + requires kotlin.stdlib; + requires com.sun.jna; + exports io.ygdrasil.libsdl; +} \ No newline at end of file diff --git a/bindings/sdl/libsdl/src/main/kotlin/libsdl/Constants.kt b/bindings/sdl/libsdl/src/main/kotlin/libsdl/Constants.kt deleted file mode 100644 index 89f05881..00000000 --- a/bindings/sdl/libsdl/src/main/kotlin/libsdl/Constants.kt +++ /dev/null @@ -1,16 +0,0 @@ -package libsdl - -const val SDL_INIT_TIMER: Int = 0x00000001 -const val SDL_INIT_AUDIO: Int = 0x00000010 -const val SDL_INIT_VIDEO: Int = 0x00000020 // SDL_INIT_VIDEO implies SDL_INIT_EVENTS -const val SDL_INIT_JOYSTICK: Int = 0x00000200 // SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS -const val SDL_INIT_HAPTIC: Int = 0x00001000 -const val SDL_INIT_GAMECONTROLLER: Int = 0x00002000 // SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK -const val SDL_INIT_EVENTS: Int = 0x00004000 -const val SDL_INIT_SENSOR: Int = 0x00008000 -const val SDL_INIT_NOPARACHUTE: Int = 0x00100000 // compatibility; this flag is ignored. - -val SDL_INIT_EVERYTHING: Int = SDL_INIT_TIMER or SDL_INIT_AUDIO or SDL_INIT_VIDEO or SDL_INIT_EVENTS or SDL_INIT_JOYSTICK or SDL_INIT_HAPTIC or SDL_INIT_GAMECONTROLLER or SDL_INIT_SENSOR - - -const val SDL_ALPHA_OPAQUE: Byte = 255.toByte() \ No newline at end of file diff --git a/bindings/sdl/libsdl/src/main/kotlin/libsdl/FixTypeAlias.kt b/bindings/sdl/libsdl/src/main/kotlin/libsdl/FixTypeAlias.kt index a47079eb..08daf7e4 100644 --- a/bindings/sdl/libsdl/src/main/kotlin/libsdl/FixTypeAlias.kt +++ b/bindings/sdl/libsdl/src/main/kotlin/libsdl/FixTypeAlias.kt @@ -1,92 +1,5 @@ -package libsdl +package io.ygdrasil.libsdl import com.sun.jna.Pointer -import com.sun.jna.PointerType -import com.sun.jna.ptr.PointerByReference -typealias SDL_iconv_t = Pointer -typealias SDL_JoystickGUID = Pointer - -public class SDL_Haptic : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_AudioStream : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_hid_device : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_GameController : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_Sensor : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_sem : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_Joystick : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} \ No newline at end of file +typealias va_list = Pointer diff --git a/bindings/sdl/libsdl/src/main/kotlin/libsdl/UnionDelegate.kt b/bindings/sdl/libsdl/src/main/kotlin/libsdl/UnionDelegate.kt index a6d61fe1..4d355b0a 100644 --- a/bindings/sdl/libsdl/src/main/kotlin/libsdl/UnionDelegate.kt +++ b/bindings/sdl/libsdl/src/main/kotlin/libsdl/UnionDelegate.kt @@ -1,6 +1,6 @@ -package libsdl +package io.ygdrasil.libsdl -import libsdl.SDL_EventType.* +import io.ygdrasil.libsdl.SDL_EventType.* object SDL_HapticEffectDelegate { fun read(union: SDL_HapticEffect) { diff --git a/bindings/sdl/libsdl/src/main/kotlin/main.kt b/bindings/sdl/libsdl/src/main/kotlin/main.kt deleted file mode 100644 index 2e435ec9..00000000 --- a/bindings/sdl/libsdl/src/main/kotlin/main.kt +++ /dev/null @@ -1,49 +0,0 @@ -import com.sun.jna.Pointer -import libsdl.SDL_WindowFlags -import libsdl.libSDL2Library - -typealias unnamed = Pointer - -const val SDL_INIT_TIMER: Int = 0x00000001 -const val SDL_INIT_AUDIO: Int = 0x00000010 -const val SDL_INIT_VIDEO: Int = 0x00000020 // SDL_INIT_VIDEO implies SDL_INIT_EVENTS -const val SDL_INIT_JOYSTICK: Int = 0x00000200 // SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS -const val SDL_INIT_HAPTIC: Int = 0x00001000 -const val SDL_INIT_GAMECONTROLLER: Int = 0x00002000 // SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK -const val SDL_INIT_EVENTS: Int = 0x00004000 -const val SDL_INIT_SENSOR: Int = 0x00008000 -const val SDL_INIT_NOPARACHUTE: Int = 0x00100000 // compatibility; this flag is ignored. - -val SDL_INIT_EVERYTHING: Int = SDL_INIT_TIMER or SDL_INIT_AUDIO or SDL_INIT_VIDEO or SDL_INIT_EVENTS or SDL_INIT_JOYSTICK or SDL_INIT_HAPTIC or SDL_INIT_GAMECONTROLLER or SDL_INIT_SENSOR - -const val SDL_WINDOWPOS_CENTERED_MASK: Int = 0x2FFF0000 - -fun SDL_WINDOWPOS_CENTERED_DISPLAY(X: Int): Int { - return SDL_WINDOWPOS_CENTERED_MASK or X -} - -val SDL_WINDOWPOS_CENTERED: Int = SDL_WINDOWPOS_CENTERED_DISPLAY(0) - -fun main() { - libSDL2Library.SDL_Init(0) - - if (libSDL2Library.SDL_Init(SDL_INIT_EVERYTHING) != 0) { - println("error initializing SDL: ${libSDL2Library.SDL_GetError()}" ); - return - } - libSDL2Library.SDL_CreateWindow( - "Game", - SDL_WINDOWPOS_CENTERED, - SDL_WINDOWPOS_CENTERED, - 800, 600, - SDL_WindowFlags.SDL_WINDOW_SHOWN or SDL_WindowFlags.SDL_WINDOW_RESIZABLE - ) - do { - - - // Set to ~60 fps. - // 1000 ms/ 60 fps = 1/16 s^2/frame - libSDL2Library.SDL_Delay(16); - } while (true) - -} \ No newline at end of file diff --git a/bindings/sdl/libsdl/src/main/kotlin/snake/main.kt b/bindings/sdl/libsdl/src/main/kotlin/snake/main.kt deleted file mode 100644 index aa26f7a8..00000000 --- a/bindings/sdl/libsdl/src/main/kotlin/snake/main.kt +++ /dev/null @@ -1,472 +0,0 @@ -package snake - - -import SDL_WINDOWPOS_CENTERED -import com.sun.jna.Native -import com.sun.jna.Pointer -import com.sun.jna.ptr.IntByReference -import com.sun.jna.ptr.PointerByReference -import libsdl.* -import java.io.File -import java.nio.ByteBuffer -import kotlin.math.max -import kotlin.random.Random - - -fun main() { - val initialGame = Game( - width = 20, - height = 10, - snake = Snake( - cells = listOf(Cell(4, 4), Cell(3, 4), Cell(2, 4), Cell(1, 4), Cell(0, 4)), - direction = Direction.right - ) - ) - var game = initialGame - - SdlUI(game.width, game.height).use { sdlUI -> - - var ticks = 0 - val speed = 10 - while (true) { - - sdlUI.draw(game) - - sdlUI.delay(1000 / 60) - ticks++ - if (ticks >= speed) { - game = game.update() - ticks -= speed - } - - sdlUI.readCommands().forEach { command -> - var direction: Direction? = null - when (command) { - SdlUI.UserCommand.up -> direction = Direction.up - SdlUI.UserCommand.down -> direction = Direction.down - SdlUI.UserCommand.left -> direction = Direction.left - SdlUI.UserCommand.right -> direction = Direction.right - SdlUI.UserCommand.restart -> game = initialGame - SdlUI.UserCommand.quit -> return - } - game = game.update(direction) - sdlUI.draw(game) - } - } - } -} - -class SdlUI(width: Int, height: Int): AutoCloseable { - private val window: SDL_Window - private val renderer: SDL_Renderer - private val controller: SDL_GameController? - private val font: Font - private val sprites: Sprites - - private val pixelWidth = width * Sprites.w - private val pixelHeight = height * Sprites.h - - init { - if (libSDL2Library.SDL_Init(SDL_INIT_EVERYTHING) != 0) { - println("SDL_Init Error: ${libSDL2Library.SDL_GetError()}") - throw Error() - } - - window = libSDL2Library.SDL_CreateWindow("Snake", SDL_WINDOWPOS_CENTERED, - SDL_WINDOWPOS_CENTERED, pixelWidth, pixelHeight, - SDL_WindowFlags.SDL_WINDOW_SHOWN.value - ) - - renderer = libSDL2Library.SDL_CreateRenderer( - window, -1, SDL_RendererFlags.SDL_RENDERER_ACCELERATED or SDL_RendererFlags.SDL_RENDERER_PRESENTVSYNC - ) - - controller = when (libSDL2Library.SDL_NumJoysticks() != 0) { - true -> libSDL2Library.SDL_GameControllerOpen(0) - false -> null - } - - font = Font(renderer) - sprites = Sprites(renderer) - - playMusic() - } - - fun draw(game: Game) { - libSDL2Library.SDL_RenderClear(renderer) - libSDL2Library.SDL_SetRenderDrawColor(renderer, (200 / 2).toByte(), (230 / 2).toByte(), (151 / 2).toByte(), SDL_ALPHA_OPAQUE) - - val grassW = 256 - val grassScaledW = 400 // scale grass up to reduce its resolution so that it's similar to snake sprites - 0.until(pixelWidth / grassW + 1).forEach { x -> - 0.until(pixelHeight / grassW + 1).forEach { y -> - sprites.render(sprites.grassRect, allocRect(x * grassW, y * grassW, grassScaledW, grassScaledW)) - } - } - - game.apples.cells.forEach { - sprites.render(sprites.appleRect, cellRect(it)) - } - - game.snake.tail.dropLast(1).forEachIndexed { i, it -> - val index = i + 1 - val direction = direction(from = game.snake.cells[index - 1], to = it) - val nextDirection = direction(from = it, to = game.snake.cells[index + 1]) - - val srcRect = if (direction == nextDirection) { - when (direction) { - Direction.right, Direction.left -> sprites.bodyHorRect - Direction.up, Direction.down -> sprites.bodyVertRect - } - } else if ((direction == Direction.left && nextDirection == Direction.down) || (direction == Direction.up && nextDirection == Direction.right)) { - sprites.bodyLeftDownRect - } else if ((direction == Direction.left && nextDirection == Direction.up) || (direction == Direction.down && nextDirection == Direction.right)) { - sprites.bodyLeftUpRect - } else if ((direction == Direction.right && nextDirection == Direction.down) || (direction == Direction.up && nextDirection == Direction.left)) { - sprites.bodyRightDownRect - } else if ((direction == Direction.right && nextDirection == Direction.up) || (direction == Direction.down && nextDirection == Direction.left)) { - sprites.bodyRightUpRect - } else { - sprites.emptyRect - } - sprites.render(srcRect, cellRect(it)) - } - - val tipRect = when (game.snake.cells.let { direction(from = it.last(), to = it[it.size - 2]) }) { - Direction.up -> sprites.tipUpRect - Direction.down -> sprites.tipDownRect - Direction.left -> sprites.tipLeftRect - Direction.right -> sprites.tipRightRect - } - sprites.render(tipRect, cellRect(game.snake.tail.last())) - - val headRect = when (game.snake.direction) { - Direction.up -> sprites.headUpRect - Direction.down -> sprites.headDownRect - Direction.left -> sprites.headLeftRect - Direction.right -> sprites.headRightRect - } - sprites.render(headRect, cellRect(game.snake.head)) - - if (game.isOver) { - renderStringCentered(3, game.width, "game over") - renderStringCentered(5, game.width, "your score is ${game.score}") - } - - libSDL2Library.SDL_RenderPresent(renderer) - - } - - fun delay(timeMs: Int) { - libSDL2Library.SDL_Delay(timeMs) - } - - fun readCommands(): List { - val result = ArrayList() - val event = SDL_Event() - while (libSDL2Library.SDL_PollEvent(event) != 0) { - event.read() - println("event(${event.type}): ${SDL_EventType.of(event.type)}") - when (SDL_EventType.of(event.type)) { - SDL_EventType.SDL_WINDOWEVENT -> { - val windowEvent = SDL_WindowEventID.of(event.window.event.toInt()) - println("controllerButtonEvent(${windowEvent})") - - if (windowEvent == SDL_WindowEventID.SDL_WINDOWEVENT_SHOWN) { - //playMusic() - } - } - SDL_EventType.SDL_QUIT -> result.add(UserCommand.quit) - SDL_EventType.SDL_CONTROLLERBUTTONDOWN -> { - val controllerButtonEvent = event.cbutton - val button = controllerButtonEvent.button.toInt() - println("controllerButtonEvent($button): ${SDL_GameControllerButton.of(button)}") - val command = when (SDL_GameControllerButton.of(button)) { - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_UP -> UserCommand.up - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_DOWN -> UserCommand.down - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_LEFT -> UserCommand.left - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_RIGHT -> UserCommand.right - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_START -> UserCommand.restart - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_BACK -> UserCommand.quit - else -> null - } - if (command != null) result.add(command) - } - SDL_EventType.SDL_KEYDOWN -> { - val keyboardEvent = event.key - val keysym = keyboardEvent.keysym - println("keyboardEvent(${keysym.scancode}): ${SDL_Scancode.of(keysym.scancode)}") - val command = when (SDL_Scancode.of(keysym.scancode)) { - SDL_Scancode.SDL_SCANCODE_I -> UserCommand.up - SDL_Scancode.SDL_SCANCODE_J -> UserCommand.left - SDL_Scancode.SDL_SCANCODE_K -> UserCommand.down - SDL_Scancode.SDL_SCANCODE_L -> UserCommand.right - SDL_Scancode.SDL_SCANCODE_R -> UserCommand.restart - SDL_Scancode.SDL_SCANCODE_Q -> UserCommand.quit - else -> null - } - if (command != null) result.add(command) - } - else -> Unit - } - } - return result - } - - private fun playMusic() { - val fileName = "Crowander-Stop-on-a-Bench.wav" - val paths = listOf(fileName, "resources/$fileName", "../resources/$fileName") - val filePath = paths.find { File(it).canRead() } ?: error("Can't find sound file.") - val audioFile = libSDL2Library.SDL_RWFromFile(filePath, "rb") - val audio_spec = SDL_AudioSpec() - val audio_buf = PointerByReference() - val audio_len = IntByReference() - libSDL2Library.SDL_LoadWAV_RW( - src = audioFile, - freesrc = 1, - spec = audio_spec, - audio_buf.pointer, - audio_len.pointer - ) - - val deviceName = libSDL2Library.SDL_GetAudioDeviceName(0, 0) - val device_id = libSDL2Library.SDL_OpenAudioDevice(deviceName, 0, audio_spec, SDL_AudioSpec(), 0) - libSDL2Library.SDL_QueueAudio(device_id, audio_buf.value, audio_len.value) - libSDL2Library.SDL_PauseAudioDevice(device_id, 0) - } - - private fun direction(from: Cell, to: Cell): Direction = when { - from.x == to.x && from.y > to.y -> Direction.up - from.x == to.x && from.y < to.y -> Direction.down - from.x > to.x && from.y == to.y -> Direction.left - from.x < to.x && from.y == to.y -> Direction.right - else -> error("") - } - - private fun cellRect(cell: Cell): SDL_Rect { - val x = cell.x * Sprites.w - val y = cell.y * Sprites.h - return allocRect(x, y, Sprites.w, Sprites.h) - } - - private fun renderStringCentered(y: Int, width: Int, s: String) { - var x = (width / 2) - (s.length / 2) - if (x.rem(2) != 0) x-- - renderString(Cell(x, y), s) - } - - private fun renderString(atCell: Cell, s: String) { - s.toCharArray().forEachIndexed { i, c -> - font.render(c, cellRect(atCell.copy(x = atCell.x + i))) - } - } - - enum class UserCommand { - up, down, left, right, restart, quit - } - - - class Font(private val renderer: SDL_Renderer) { - companion object { - const val w = 48 - const val h = 46 - } - - internal val texture = renderer.loadTexture("Font16_42_Normal4_sheet.bmp") - private val letters: Map - - init { - letters = mapOf( - 'A' to textureRect(0, 0, -7), - 'B' to textureRect(1, 0), - 'C' to textureRect(2, 0, -9), - 'D' to textureRect(3, 0), - 'E' to textureRect(4, 0, -5), - 'F' to textureRect(5, 0, -5), - 'G' to textureRect(6, 0), - 'H' to textureRect(7, 0, -7), - 'I' to textureRect(8, 0, -15), - 'J' to textureRect(9, 0, -5), - 'K' to textureRect(0, 1, -10), - 'L' to textureRect(1, 1, -5), - 'M' to textureRect(2, 1), - 'N' to textureRect(3, 1), - 'O' to textureRect(4, 1, -7), - 'P' to textureRect(5, 1, -7), - 'Q' to textureRect(6, 1), - 'R' to textureRect(7, 1), - 'S' to textureRect(8, 1), - 'T' to textureRect(9, 1), - 'U' to textureRect(0, 2, -13), - 'V' to textureRect(1, 2, -10), - 'W' to textureRect(2, 2), - 'X' to textureRect(3, 2), - 'Y' to textureRect(4, 2, -5), - 'Z' to textureRect(5, 2), - '0' to textureRect(2, 5), - '1' to textureRect(3, 5, -15), - '2' to textureRect(4, 5), - '3' to textureRect(5, 5), - '4' to textureRect(6, 5), - '5' to textureRect(7, 5), - '6' to textureRect(8, 5), - '7' to textureRect(9, 5), - '8' to textureRect(0, 6), - '9' to textureRect(1, 6), - ' ' to allocRect(0, 0, 0, 0) - ) - } - - fun render(char: Char, cellRect: SDL_Rect) { - val charRect = letters[char.uppercaseChar()] ?: (letters[' '] ?: error("")) - libSDL2Library.SDL_RenderCopy(renderer, texture, charRect, cellRect) - } - - private fun textureRect(x: Int, y: Int, wAdjust: Int = 0): SDL_Rect { - val xShift = x * w - val yShift = y * h - return allocRect(xShift, yShift, w + wAdjust, h) - } - } - - class Sprites(private val renderer: SDL_Renderer) { - companion object { - const val w = 64 - const val h = 64 - } - - internal val texture = renderer.loadTexture("snake-graphics.bmp") - internal val grassTexture = renderer.loadTexture("grass.bmp") - - val headUpRect = textureRect(3, 0) - val headRightRect = textureRect(4, 0) - val headLeftRect = textureRect(3, 1) - val headDownRect = textureRect(4, 1) - - val tipUpRect = textureRect(3, 2) - val tipRightRect = textureRect(4, 2) - val tipLeftRect = textureRect(3, 3) - val tipDownRect = textureRect(4, 3) - - val bodyHorRect = textureRect(1, 0) - val bodyVertRect = textureRect(2, 1) - val bodyLeftDownRect = textureRect(0, 0) - val bodyLeftUpRect = textureRect(0, 1) - val bodyRightDownRect = textureRect(2, 0) - val bodyRightUpRect = textureRect(2, 2) - - val appleRect = textureRect(0, 3) - val emptyRect = textureRect(0, 2) - - val grassRect = allocRect(0, 0, 256, 256) - - private fun textureRect(x: Int, y: Int) = allocRect(x * w, y * h, w, h) - - fun render(srcRect: SDL_Rect, dstRect: SDL_Rect) { - if (srcRect == grassRect) libSDL2Library.SDL_RenderCopy(renderer, grassTexture, srcRect, dstRect) - else libSDL2Library.SDL_RenderCopy(renderer, texture, srcRect, dstRect) - } - } - - companion object { - fun SDL_Renderer.loadTexture(fileName: String): SDL_Texture { - val paths = listOf(fileName, "resources/$fileName", "../resources/$fileName") - val filePath = paths.find { File(it).canRead() } ?: error("Can't find image file.") - - val bmp = libSDL2Library.SDL_LoadBMP_RW(libSDL2Library.SDL_RWFromFile(filePath, "rb"), 1) - - return libSDL2Library.SDL_CreateTextureFromSurface(this@loadTexture, bmp) - } - - fun allocRect(x: Int, y: Int, w: Int, h: Int) = SDL_Rect().also { - it.x = x - it.y = y - it.w = w - it.h = h - } - } - - override fun close() { - controller.takeIf { it != null } - ?.let { libSDL2Library.SDL_GameControllerClose(it) } - libSDL2Library.SDL_DestroyTexture(sprites.texture) - libSDL2Library.SDL_DestroyTexture(sprites.grassTexture) - libSDL2Library.SDL_DestroyTexture(font.texture) - libSDL2Library.SDL_DestroyRenderer(renderer) - libSDL2Library.SDL_DestroyWindow(window) - libSDL2Library.SDL_Quit() - } -} - -data class Game( - val width: Int, - val height: Int, - val snake: Snake, - val apples: Apples = Apples(width, height) -) { - val isOver = - snake.tail.contains(snake.head) || - snake.cells.any { it.x < 0 || it.x >= width || it.y < 0 || it.y >= height } - - val score = snake.cells.size - - fun update(direction: Direction? = null): Game { - if (isOver) return this - val (newSnake, newApples) = snake.turn(direction).move().eat(apples.grow()) - return copy(snake = newSnake, apples = newApples) - } -} - -data class Snake( - val cells: List, - val direction: Direction, - val eatenApples: Int = 0 -) { - val head = cells.first() - val tail = cells.subList(1, cells.size) - - fun move(): Snake { - val newHead = head.move(direction) - val newTail = if (eatenApples == 0) cells.dropLast(1) else cells - return copy( - cells = listOf(newHead) + newTail, - eatenApples = max(eatenApples - 1, 0) - ) - } - - fun turn(newDirection: Direction?): Snake { - if (newDirection == null || newDirection.isOpposite(direction)) return this - return copy(direction = newDirection) - } - - fun eat(apples: Apples): Pair { - if (!apples.cells.contains(head)) return Pair(this, apples) - return Pair( - copy(eatenApples = eatenApples + 1), - apples.copy(cells = apples.cells - head) - ) - } -} - -data class Apples( - val fieldWidth: Int, - val fieldHeight: Int, - val cells: Set = emptySet(), - val growthSpeed: Int = 3, - val random: Random = Random -) { - fun grow(): Apples { - if (random.nextInt(growthSpeed) != 0) return this - return copy(cells = cells + Cell(random.nextInt(fieldWidth), random.nextInt(fieldHeight))) - } -} - -data class Cell(val x: Int, val y: Int) { - fun move(direction: Direction) = Cell(x + direction.dx, y + direction.dy) -} - -enum class Direction(val dx: Int, val dy: Int) { - up(0, -1), down(0, 1), left(-1, 0), right(1, 0); - - fun isOpposite(that: Direction) = dx + that.dx == 0 && dy + that.dy == 0 -} \ No newline at end of file diff --git a/bindings/sdl/settings.gradle.kts b/bindings/sdl/settings.gradle.kts index 4325a12b..12e90d21 100644 --- a/bindings/sdl/settings.gradle.kts +++ b/bindings/sdl/settings.gradle.kts @@ -8,6 +8,8 @@ pluginManagement { } } -include(":libsdl") -findProject(":libsdl")?.name = "sdl4k" +include(":libsdl", ":binaries", ":examples:snake", ":examples:tetris") +findProject(":libsdl")?.name = "sdl2-4k" +findProject(":binaries")?.name = "sdl2-binaries" + diff --git a/bindings/sdl2wgpu/build.gradle.kts b/bindings/sdl2wgpu/build.gradle.kts new file mode 100644 index 00000000..b0696f62 --- /dev/null +++ b/bindings/sdl2wgpu/build.gradle.kts @@ -0,0 +1,31 @@ +import org.apache.tools.ant.taskdefs.condition.Os + +plugins { + `cpp-library` + `maven-publish` +} + +group = "io.ygdrasil" +version = "1.0.0-SNAPSHOT" + +library { + + linkage = listOf(Linkage.SHARED) + + targetMachines.add(machines.windows.x86_64) + targetMachines.add(machines.linux.architecture("aarch64")) + targetMachines.add(machines.linux.x86_64) + targetMachines.add(machines.macOS.x86_64) + targetMachines.add(machines.macOS.architecture("aarch64")) +} + +tasks.withType().configureEach { + + if (Os.isFamily(Os.FAMILY_MAC)) { + compilerArgs.addAll("-x", "objective-c++") + } +} + +tasks.withType().configureEach { + linkerArgs.add("-Wl,-undefined,dynamic_lookup") +} diff --git a/bindings/sdl2wgpu/gradle/libs.versions.toml b/bindings/sdl2wgpu/gradle/libs.versions.toml new file mode 100644 index 00000000..7a38d765 --- /dev/null +++ b/bindings/sdl2wgpu/gradle/libs.versions.toml @@ -0,0 +1,14 @@ +[versions] +kotest = "5.6.1" +klang = "0.0.0" +jna = "5.13.0" +kotlin = "1.9.22" +wgpu = "v0.19.1.1" + + +[libraries] +kotest = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" } +jna = { module = "net.java.dev.jna:jna", version.ref = "jna" } + +[plugins] +klang = { id = "io.ygdrasil.klang-plugin", version.ref = "klang" } \ No newline at end of file diff --git a/bindings/sdl2wgpu/gradle/wrapper/gradle-wrapper.properties b/bindings/sdl2wgpu/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..a80b22ce --- /dev/null +++ b/bindings/sdl2wgpu/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/bindings/sdl2wgpu/gradlew b/bindings/sdl2wgpu/gradlew new file mode 100755 index 00000000..1aa94a42 --- /dev/null +++ b/bindings/sdl2wgpu/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/bindings/sdl2wgpu/gradlew.bat b/bindings/sdl2wgpu/gradlew.bat new file mode 100644 index 00000000..93e3f59f --- /dev/null +++ b/bindings/sdl2wgpu/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/bindings/sdl2wgpu/settings.gradle.kts b/bindings/sdl2wgpu/settings.gradle.kts new file mode 100644 index 00000000..1010e0a9 --- /dev/null +++ b/bindings/sdl2wgpu/settings.gradle.kts @@ -0,0 +1,10 @@ +rootProject.name = "sdl2wgpu" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + mavenLocal() + } +} + diff --git a/bindings/sdl2wgpu/src/main/cpp/sdl2webgpu.cpp b/bindings/sdl2wgpu/src/main/cpp/sdl2webgpu.cpp new file mode 100644 index 00000000..1dc8502c --- /dev/null +++ b/bindings/sdl2wgpu/src/main/cpp/sdl2webgpu.cpp @@ -0,0 +1,139 @@ +/** + * This is an extension of SDL2 for WebGPU, abstracting away the details of + * OS-specific operations. + * + * This file is part of the "Learn WebGPU for C++" book. + * https://eliemichel.github.io/LearnWebGPU + * + * Most of this code comes from the wgpu-native triangle example: + * https://github.com/gfx-rs/wgpu-native/blob/master/examples/triangle/main.c + * + * MIT License + * Copyright (c) 2022-2023 Elie Michel and the wgpu-native authors + * + * 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. + */ + +#include "sdl2webgpu.h" + +#include + +#if defined(SDL_VIDEO_DRIVER_COCOA) +#include +#include +#include +#endif + +#include +#include + +WGPUSurface SDL_GetWGPUSurface(WGPUInstance instance, SDL_Window* window) { + SDL_SysWMinfo windowWMInfo; + SDL_VERSION(&windowWMInfo.version); + SDL_GetWindowWMInfo(window, &windowWMInfo); + +#if defined(SDL_VIDEO_DRIVER_COCOA) + { + id metal_layer = NULL; + NSWindow* ns_window = windowWMInfo.info.cocoa.window; + [ns_window.contentView setWantsLayer : YES] ; + metal_layer = [CAMetalLayer layer]; + [ns_window.contentView setLayer : metal_layer]; + + WGPUSurfaceDescriptor surfaceDescriptor; + surfaceDescriptor.label = NULL; + + WGPUSurfaceDescriptorFromMetalLayer metalLayerDescriptor; + metalLayerDescriptor.chain.next = NULL; + metalLayerDescriptor.chain.sType = WGPUSType_SurfaceDescriptorFromMetalLayer; + metalLayerDescriptor.layer = metal_layer; + + surfaceDescriptor.nextInChain = reinterpret_cast(&metalLayerDescriptor); + + return wgpuInstanceCreateSurface(instance, &surfaceDescriptor); + } +#elif defined(SDL_VIDEO_DRIVER_X11) + { + Display* x11_display = windowWMInfo.info.x11.display; + Window x11_window = windowWMInfo.info.x11.window; + return wgpuInstanceCreateSurface( + instance, + &(WGPUSurfaceDescriptor){ + .label = NULL, + .nextInChain = + (const WGPUChainedStruct*)&( + WGPUSurfaceDescriptorFromXlibWindow) { + .chain = + (WGPUChainedStruct){ + .next = NULL, + .sType = WGPUSType_SurfaceDescriptorFromXlibWindow, + }, + .display = x11_display, + .window = x11_window, + }, + }); + } +#elif defined(SDL_VIDEO_DRIVER_WAYLAND) + { + struct wl_display* wayland_display = windowWMInfo.info.wl.display; + struct wl_surface* wayland_surface = windowWMInfo.info.wl.display; + return wgpuInstanceCreateSurface( + instance, + &(WGPUSurfaceDescriptor){ + .label = NULL, + .nextInChain = + (const WGPUChainedStruct*)&( + WGPUSurfaceDescriptorFromWaylandSurface) { + .chain = + (WGPUChainedStruct){ + .next = NULL, + .sType = + WGPUSType_SurfaceDescriptorFromWaylandSurface, + }, + .display = wayland_display, + .surface = wayland_surface, + }, + }); + } +#elif defined(SDL_VIDEO_DRIVER_WINDOWS) + { + HWND hwnd = windowWMInfo.info.win.window; + HINSTANCE hinstance = GetModuleHandle(NULL); + return wgpuInstanceCreateSurface( + instance, + &(WGPUSurfaceDescriptor){ + .label = NULL, + .nextInChain = + (const WGPUChainedStruct*)&( + WGPUSurfaceDescriptorFromWindowsHWND) { + .chain = + (WGPUChainedStruct){ + .next = NULL, + .sType = WGPUSType_SurfaceDescriptorFromWindowsHWND, + }, + .hinstance = hinstance, + .hwnd = hwnd, + }, + }); + } +#else + // TODO: See SDL_syswm.h for other possible enum values! +#error "Unsupported WGPU_TARGET" +#endif +} diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL.h new file mode 100644 index 00000000..0b81a215 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL.h @@ -0,0 +1,233 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL.h + * + * Main include header for the SDL library + */ + + +#ifndef SDL_h_ +#define SDL_h_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* As of version 0.5, SDL is loaded dynamically into the application */ + +/** + * \name SDL_INIT_* + * + * These are the flags which may be passed to SDL_Init(). You should + * specify the subsystems which you will be using in your application. + */ +/* @{ */ +#define SDL_INIT_TIMER 0x00000001u +#define SDL_INIT_AUDIO 0x00000010u +#define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ +#define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */ +#define SDL_INIT_HAPTIC 0x00001000u +#define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ +#define SDL_INIT_EVENTS 0x00004000u +#define SDL_INIT_SENSOR 0x00008000u +#define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */ +#define SDL_INIT_EVERYTHING ( \ + SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ + SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \ + ) +/* @} */ + +/** + * Initialize the SDL library. + * + * SDL_Init() simply forwards to calling SDL_InitSubSystem(). Therefore, the + * two may be used interchangeably. Though for readability of your code + * SDL_InitSubSystem() might be preferred. + * + * The file I/O (for example: SDL_RWFromFile) and threading (SDL_CreateThread) + * subsystems are initialized by default. Message boxes + * (SDL_ShowSimpleMessageBox) also attempt to work without initializing the + * video subsystem, in hopes of being useful in showing an error dialog when + * SDL_Init fails. You must specifically initialize other subsystems if you + * use them in your application. + * + * Logging (such as SDL_Log) works without initialization, too. + * + * `flags` may be any of the following OR'd together: + * + * - `SDL_INIT_TIMER`: timer subsystem + * - `SDL_INIT_AUDIO`: audio subsystem + * - `SDL_INIT_VIDEO`: video subsystem; automatically initializes the events + * subsystem + * - `SDL_INIT_JOYSTICK`: joystick subsystem; automatically initializes the + * events subsystem + * - `SDL_INIT_HAPTIC`: haptic (force feedback) subsystem + * - `SDL_INIT_GAMECONTROLLER`: controller subsystem; automatically + * initializes the joystick subsystem + * - `SDL_INIT_EVENTS`: events subsystem + * - `SDL_INIT_EVERYTHING`: all of the above subsystems + * - `SDL_INIT_NOPARACHUTE`: compatibility; this flag is ignored + * + * Subsystem initialization is ref-counted, you must call SDL_QuitSubSystem() + * for each SDL_InitSubSystem() to correctly shutdown a subsystem manually (or + * call SDL_Quit() to force shutdown). If a subsystem is already loaded then + * this call will increase the ref-count and return. + * + * \param flags subsystem initialization flags + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_InitSubSystem + * \sa SDL_Quit + * \sa SDL_SetMainReady + * \sa SDL_WasInit + */ +extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); + +/** + * Compatibility function to initialize the SDL library. + * + * In SDL2, this function and SDL_Init() are interchangeable. + * + * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Init + * \sa SDL_Quit + * \sa SDL_QuitSubSystem + */ +extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); + +/** + * Shut down specific SDL subsystems. + * + * If you start a subsystem using a call to that subsystem's init function + * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(), + * SDL_QuitSubSystem() and SDL_WasInit() will not work. You will need to use + * that subsystem's quit function (SDL_VideoQuit()) directly instead. But + * generally, you should not be using those functions directly anyhow; use + * SDL_Init() instead. + * + * You still need to call SDL_Quit() even if you close all open subsystems + * with SDL_QuitSubSystem(). + * + * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_InitSubSystem + * \sa SDL_Quit + */ +extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); + +/** + * Get a mask of the specified subsystems which are currently initialized. + * + * \param flags any of the flags used by SDL_Init(); see SDL_Init for details. + * \returns a mask of all initialized subsystems if `flags` is 0, otherwise it + * returns the initialization status of the specified subsystems. + * + * The return value does not include SDL_INIT_NOPARACHUTE. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Init + * \sa SDL_InitSubSystem + */ +extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); + +/** + * Clean up all initialized subsystems. + * + * You should call this function even if you have already shutdown each + * initialized subsystem with SDL_QuitSubSystem(). It is safe to call this + * function even in the case of errors in initialization. + * + * If you start a subsystem using a call to that subsystem's init function + * (for example SDL_VideoInit()) instead of SDL_Init() or SDL_InitSubSystem(), + * then you must use that subsystem's quit function (SDL_VideoQuit()) to shut + * it down before calling SDL_Quit(). But generally, you should not be using + * those functions directly anyhow; use SDL_Init() instead. + * + * You can use this function with atexit() to ensure that it is run when your + * application is shutdown, but it is not wise to do this from a library or + * other dynamically loaded code. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Init + * \sa SDL_QuitSubSystem + */ +extern DECLSPEC void SDLCALL SDL_Quit(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_assert.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_assert.h new file mode 100644 index 00000000..597acdc0 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_assert.h @@ -0,0 +1,320 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDL_assert_h_ +#define SDL_assert_h_ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef SDL_ASSERT_LEVEL +#ifdef SDL_DEFAULT_ASSERT_LEVEL +#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL +#elif defined(_DEBUG) || defined(DEBUG) || \ + (defined(__GNUC__) && !defined(__OPTIMIZE__)) +#define SDL_ASSERT_LEVEL 2 +#else +#define SDL_ASSERT_LEVEL 1 +#endif +#endif /* SDL_ASSERT_LEVEL */ + +/* +These are macros and not first class functions so that the debugger breaks +on the assertion line and not in some random guts of SDL, and so each +assert can have unique static variables associated with it. +*/ + +#if defined(_MSC_VER) +/* Don't include intrin.h here because it contains C++ code */ + extern void __cdecl __debugbreak(void); + #define SDL_TriggerBreakpoint() __debugbreak() +#elif _SDL_HAS_BUILTIN(__builtin_debugtrap) + #define SDL_TriggerBreakpoint() __builtin_debugtrap() +#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) ) + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) +#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */ + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" ) +#elif defined(__APPLE__) && defined(__arm__) + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" ) +#elif defined(__386__) && defined(__WATCOMC__) + #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } +#elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__) + #include + #define SDL_TriggerBreakpoint() raise(SIGTRAP) +#else + /* How do we trigger breakpoints on this platform? */ + #define SDL_TriggerBreakpoint() +#endif + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ +# define SDL_FUNCTION __func__ +#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__)) +# define SDL_FUNCTION __FUNCTION__ +#else +# define SDL_FUNCTION "???" +#endif +#define SDL_FILE __FILE__ +#define SDL_LINE __LINE__ + +/* +sizeof (x) makes the compiler still parse the expression even without +assertions enabled, so the code is always checked at compile time, but +doesn't actually generate code for it, so there are no side effects or +expensive checks at run time, just the constant size of what x WOULD be, +which presumably gets optimized out as unused. +This also solves the problem of... + + int somevalue = blah(); + SDL_assert(somevalue == 1); + +...which would cause compiles to complain that somevalue is unused if we +disable assertions. +*/ + +/* "while (0,0)" fools Microsoft's compiler's /W4 warning level into thinking + this condition isn't constant. And looks like an owl's face! */ +#ifdef _MSC_VER /* stupid /W4 warnings. */ +#define SDL_NULL_WHILE_LOOP_CONDITION (0,0) +#else +#define SDL_NULL_WHILE_LOOP_CONDITION (0) +#endif + +#define SDL_disabled_assert(condition) \ + do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) + +typedef enum +{ + SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */ + SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */ + SDL_ASSERTION_ABORT, /**< Terminate the program. */ + SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ + SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ +} SDL_AssertState; + +typedef struct SDL_AssertData +{ + int always_ignore; + unsigned int trigger_count; + const char *condition; + const char *filename; + int linenum; + const char *function; + const struct SDL_AssertData *next; +} SDL_AssertData; + +/* Never call this directly. Use the SDL_assert* macros. */ +extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *, + const char *, + const char *, int) +#if defined(__clang__) +#if __has_feature(attribute_analyzer_noreturn) +/* this tells Clang's static analysis that we're a custom assert function, + and that the analyzer should assume the condition was always true past this + SDL_assert test. */ + __attribute__((analyzer_noreturn)) +#endif +#endif +; + +/* the do {} while(0) avoids dangling else problems: + if (x) SDL_assert(y); else blah(); + ... without the do/while, the "else" could attach to this macro's "if". + We try to handle just the minimum we need here in a macro...the loop, + the static vars, and break points. The heavy lifting is handled in + SDL_ReportAssertion(), in SDL_assert.c. +*/ +#define SDL_enabled_assert(condition) \ + do { \ + while ( !(condition) ) { \ + static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \ + const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \ + if (sdl_assert_state == SDL_ASSERTION_RETRY) { \ + continue; /* go again. */ \ + } else if (sdl_assert_state == SDL_ASSERTION_BREAK) { \ + SDL_TriggerBreakpoint(); \ + } \ + break; /* not retrying. */ \ + } \ + } while (SDL_NULL_WHILE_LOOP_CONDITION) + +/* Enable various levels of assertions. */ +#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ +# define SDL_assert(condition) SDL_disabled_assert(condition) +# define SDL_assert_release(condition) SDL_disabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 1 /* release settings. */ +# define SDL_assert(condition) SDL_disabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */ +# define SDL_assert(condition) SDL_enabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */ +# define SDL_assert(condition) SDL_enabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition) +#else +# error Unknown assertion level. +#endif + +/* this assertion is never disabled at any level. */ +#define SDL_assert_always(condition) SDL_enabled_assert(condition) + + +/** + * A callback that fires when an SDL assertion fails. + * + * \param data a pointer to the SDL_AssertData structure corresponding to the + * current assertion + * \param userdata what was passed as `userdata` to SDL_SetAssertionHandler() + * \returns an SDL_AssertState value indicating how to handle the failure. + */ +typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( + const SDL_AssertData* data, void* userdata); + +/** + * Set an application-defined assertion handler. + * + * This function allows an application to show its own assertion UI and/or + * force the response to an assertion failure. If the application doesn't + * provide this, SDL will try to do the right thing, popping up a + * system-specific GUI dialog, and probably minimizing any fullscreen windows. + * + * This callback may fire from any thread, but it runs wrapped in a mutex, so + * it will only fire from one thread at a time. + * + * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! + * + * \param handler the SDL_AssertionHandler function to call when an assertion + * fails or NULL for the default handler + * \param userdata a pointer that is passed to `handler` + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetAssertionHandler + */ +extern DECLSPEC void SDLCALL SDL_SetAssertionHandler( + SDL_AssertionHandler handler, + void *userdata); + +/** + * Get the default assertion handler. + * + * This returns the function pointer that is called by default when an + * assertion is triggered. This is an internal function provided by SDL, that + * is used for assertions when SDL_SetAssertionHandler() hasn't been used to + * provide a different function. + * + * \returns the default SDL_AssertionHandler that is called when an assert + * triggers. + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_GetAssertionHandler + */ +extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetDefaultAssertionHandler(void); + +/** + * Get the current assertion handler. + * + * This returns the function pointer that is called when an assertion is + * triggered. This is either the value last passed to + * SDL_SetAssertionHandler(), or if no application-specified function is set, + * is equivalent to calling SDL_GetDefaultAssertionHandler(). + * + * The parameter `puserdata` is a pointer to a void*, which will store the + * "userdata" pointer that was passed to SDL_SetAssertionHandler(). This value + * will always be NULL for the default handler. If you don't care about this + * data, it is safe to pass a NULL pointer to this function to ignore it. + * + * \param puserdata pointer which is filled with the "userdata" pointer that + * was passed to SDL_SetAssertionHandler() + * \returns the SDL_AssertionHandler that is called when an assert triggers. + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_SetAssertionHandler + */ +extern DECLSPEC SDL_AssertionHandler SDLCALL SDL_GetAssertionHandler(void **puserdata); + +/** + * Get a list of all assertion failures. + * + * This function gets all assertions triggered since the last call to + * SDL_ResetAssertionReport(), or the start of the program. + * + * The proper way to examine this data looks something like this: + * + * ```c + * const SDL_AssertData *item = SDL_GetAssertionReport(); + * while (item) { + * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n", + * item->condition, item->function, item->filename, + * item->linenum, item->trigger_count, + * item->always_ignore ? "yes" : "no"); + * item = item->next; + * } + * ``` + * + * \returns a list of all failed assertions or NULL if the list is empty. This + * memory should not be modified or freed by the application. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ResetAssertionReport + */ +extern DECLSPEC const SDL_AssertData * SDLCALL SDL_GetAssertionReport(void); + +/** + * Clear the list of all assertion failures. + * + * This function will clear the list of all assertions triggered up to that + * point. Immediately following this call, SDL_GetAssertionReport will return + * no items. In addition, any previously-triggered assertions will be reset to + * a trigger_count of zero, and their always_ignore state will be false. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetAssertionReport + */ +extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); + + +/* these had wrong naming conventions until 2.0.4. Please update your app! */ +#define SDL_assert_state SDL_AssertState +#define SDL_assert_data SDL_AssertData + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_assert_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_atomic.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_atomic.h new file mode 100644 index 00000000..7c12b48e --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_atomic.h @@ -0,0 +1,414 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_atomic.h + * + * Atomic operations. + * + * IMPORTANT: + * If you are not an expert in concurrent lockless programming, you should + * only be using the atomic lock and reference counting functions in this + * file. In all other cases you should be protecting your data structures + * with full mutexes. + * + * The list of "safe" functions to use are: + * SDL_AtomicLock() + * SDL_AtomicUnlock() + * SDL_AtomicIncRef() + * SDL_AtomicDecRef() + * + * Seriously, here be dragons! + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * + * You can find out a little more about lockless programming and the + * subtle issues that can arise here: + * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx + * + * There's also lots of good information here: + * http://www.1024cores.net/home/lock-free-algorithms + * http://preshing.com/ + * + * These operations may or may not actually be implemented using + * processor specific atomic operations. When possible they are + * implemented as true processor specific atomic operations. When that + * is not possible the are implemented using locks that *do* use the + * available atomic operations. + * + * All of the atomic operations that modify memory are full memory barriers. + */ + +#ifndef SDL_atomic_h_ +#define SDL_atomic_h_ + +#include +#include + +#include + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name SDL AtomicLock + * + * The atomic locks are efficient spinlocks using CPU instructions, + * but are vulnerable to starvation and can spin forever if a thread + * holding a lock has been terminated. For this reason you should + * minimize the code executed inside an atomic lock and never do + * expensive things like API or system calls while holding them. + * + * The atomic locks are not safe to lock recursively. + * + * Porting Note: + * The spin lock functions and type are required and can not be + * emulated because they are used in the atomic emulation code. + */ +/* @{ */ + +typedef int SDL_SpinLock; + +/** + * Try to lock a spin lock by setting it to a non-zero value. + * + * ***Please note that spinlocks are dangerous if you don't know what you're + * doing. Please be careful using any sort of spinlock!*** + * + * \param lock a pointer to a lock variable + * \returns SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already + * held. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AtomicLock + * \sa SDL_AtomicUnlock + */ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); + +/** + * Lock a spin lock by setting it to a non-zero value. + * + * ***Please note that spinlocks are dangerous if you don't know what you're + * doing. Please be careful using any sort of spinlock!*** + * + * \param lock a pointer to a lock variable + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AtomicTryLock + * \sa SDL_AtomicUnlock + */ +extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); + +/** + * Unlock a spin lock by setting it to 0. + * + * Always returns immediately. + * + * ***Please note that spinlocks are dangerous if you don't know what you're + * doing. Please be careful using any sort of spinlock!*** + * + * \param lock a pointer to a lock variable + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AtomicLock + * \sa SDL_AtomicTryLock + */ +extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); + +/* @} *//* SDL AtomicLock */ + + +/** + * The compiler barrier prevents the compiler from reordering + * reads and writes to globally visible variables across the call. + */ +#if defined(_MSC_VER) && (_MSC_VER > 1200) && !defined(__clang__) +void _ReadWriteBarrier(void); +#pragma intrinsic(_ReadWriteBarrier) +#define SDL_CompilerBarrier() _ReadWriteBarrier() +#elif (defined(__GNUC__) && !defined(__EMSCRIPTEN__)) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) +/* This is correct for all CPUs when using GCC or Solaris Studio 12.1+. */ +#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory") +#elif defined(__WATCOMC__) +extern __inline void SDL_CompilerBarrier(void); +#pragma aux SDL_CompilerBarrier = "" parm [] modify exact []; +#else +#define SDL_CompilerBarrier() \ +{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); } +#endif + +/** + * Memory barriers are designed to prevent reads and writes from being + * reordered by the compiler and being seen out of order on multi-core CPUs. + * + * A typical pattern would be for thread A to write some data and a flag, and + * for thread B to read the flag and get the data. In this case you would + * insert a release barrier between writing the data and the flag, + * guaranteeing that the data write completes no later than the flag is + * written, and you would insert an acquire barrier between reading the flag + * and reading the data, to ensure that all the reads associated with the flag + * have completed. + * + * In this pattern you should always see a release barrier paired with an + * acquire barrier and you should gate the data reads/writes with a single + * flag variable. + * + * For more information on these semantics, take a look at the blog post: + * http://preshing.com/20120913/acquire-and-release-semantics + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC void SDLCALL SDL_MemoryBarrierReleaseFunction(void); +extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquireFunction(void); + +#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") +#elif defined(__GNUC__) && defined(__aarch64__) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") +#elif defined(__GNUC__) && defined(__arm__) +#if 0 /* defined(__LINUX__) || defined(__ANDROID__) */ +/* Information from: + https://chromium.googlesource.com/chromium/chromium/+/trunk/base/atomicops_internals_arm_gcc.h#19 + + The Linux kernel provides a helper function which provides the right code for a memory barrier, + hard-coded at address 0xffff0fa0 +*/ +typedef void (*SDL_KernelMemoryBarrierFunc)(); +#define SDL_MemoryBarrierRelease() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)() +#define SDL_MemoryBarrierAcquire() ((SDL_KernelMemoryBarrierFunc)0xffff0fa0)() +#elif 0 /* defined(__QNXNTO__) */ +#include + +#define SDL_MemoryBarrierRelease() __cpu_membarrier() +#define SDL_MemoryBarrierAcquire() __cpu_membarrier() +#else +#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) || defined(__ARM_ARCH_8A__) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") +#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_5TE__) +#ifdef __thumb__ +/* The mcr instruction isn't available in thumb mode, use real functions */ +#define SDL_MEMORY_BARRIER_USES_FUNCTION +#define SDL_MemoryBarrierRelease() SDL_MemoryBarrierReleaseFunction() +#define SDL_MemoryBarrierAcquire() SDL_MemoryBarrierAcquireFunction() +#else +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") +#endif /* __thumb__ */ +#else +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory") +#endif /* __LINUX__ || __ANDROID__ */ +#endif /* __GNUC__ && __arm__ */ +#else +#if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5120)) +/* This is correct for all CPUs on Solaris when using Solaris Studio 12.1+. */ +#include +#define SDL_MemoryBarrierRelease() __machine_rel_barrier() +#define SDL_MemoryBarrierAcquire() __machine_acq_barrier() +#else +/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */ +#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier() +#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier() +#endif +#endif + +/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */ +#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) + #define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */ +#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__) + #define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory") +#elif (defined(__powerpc__) || defined(__powerpc64__)) + #define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27"); +#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) + #define SDL_CPUPauseInstruction() _mm_pause() /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */ +#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64)) + #define SDL_CPUPauseInstruction() __yield() +#elif defined(__WATCOMC__) && defined(__386__) + extern __inline void SDL_CPUPauseInstruction(void); + #pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause" +#else + #define SDL_CPUPauseInstruction() +#endif + + +/** + * \brief A type representing an atomic integer value. It is a struct + * so people don't accidentally use numeric operations on it. + */ +typedef struct { int value; } SDL_atomic_t; + +/** + * Set an atomic variable to a new value if it is currently an old value. + * + * ***Note: If you don't know what this function is for, you shouldn't use + * it!*** + * + * \param a a pointer to an SDL_atomic_t variable to be modified + * \param oldval the old value + * \param newval the new value + * \returns SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AtomicCASPtr + * \sa SDL_AtomicGet + * \sa SDL_AtomicSet + */ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); + +/** + * Set an atomic variable to a value. + * + * This function also acts as a full memory barrier. + * + * ***Note: If you don't know what this function is for, you shouldn't use + * it!*** + * + * \param a a pointer to an SDL_atomic_t variable to be modified + * \param v the desired value + * \returns the previous value of the atomic variable. + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_AtomicGet + */ +extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int v); + +/** + * Get the value of an atomic variable. + * + * ***Note: If you don't know what this function is for, you shouldn't use + * it!*** + * + * \param a a pointer to an SDL_atomic_t variable + * \returns the current value of an atomic variable. + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_AtomicSet + */ +extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a); + +/** + * Add to an atomic variable. + * + * This function also acts as a full memory barrier. + * + * ***Note: If you don't know what this function is for, you shouldn't use + * it!*** + * + * \param a a pointer to an SDL_atomic_t variable to be modified + * \param v the desired value to add + * \returns the previous value of the atomic variable. + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_AtomicDecRef + * \sa SDL_AtomicIncRef + */ +extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int v); + +/** + * \brief Increment an atomic variable used as a reference count. + */ +#ifndef SDL_AtomicIncRef +#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1) +#endif + +/** + * \brief Decrement an atomic variable used as a reference count. + * + * \return SDL_TRUE if the variable reached zero after decrementing, + * SDL_FALSE otherwise + */ +#ifndef SDL_AtomicDecRef +#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1) +#endif + +/** + * Set a pointer to a new value if it is currently an old value. + * + * ***Note: If you don't know what this function is for, you shouldn't use + * it!*** + * + * \param a a pointer to a pointer + * \param oldval the old pointer value + * \param newval the new pointer value + * \returns SDL_TRUE if the pointer was set, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AtomicCAS + * \sa SDL_AtomicGetPtr + * \sa SDL_AtomicSetPtr + */ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval); + +/** + * Set a pointer to a value atomically. + * + * ***Note: If you don't know what this function is for, you shouldn't use + * it!*** + * + * \param a a pointer to a pointer + * \param v the desired pointer value + * \returns the previous value of the pointer. + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_AtomicCASPtr + * \sa SDL_AtomicGetPtr + */ +extern DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); + +/** + * Get the value of a pointer atomically. + * + * ***Note: If you don't know what this function is for, you shouldn't use + * it!*** + * + * \param a a pointer to a pointer + * \returns the current value of a pointer. + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_AtomicCASPtr + * \sa SDL_AtomicSetPtr + */ +extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif + +#include + +#endif /* SDL_atomic_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_audio.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_audio.h new file mode 100644 index 00000000..2eeb542b --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_audio.h @@ -0,0 +1,1500 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/* !!! FIXME: several functions in here need Doxygen comments. */ + +/** + * \file SDL_audio.h + * + * Access to the raw audio mixing buffer for the SDL library. + */ + +#ifndef SDL_audio_h_ +#define SDL_audio_h_ + +#include +#include +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Audio format flags. + * + * These are what the 16 bits in SDL_AudioFormat currently mean... + * (Unspecified bits are always zero). + * + * \verbatim + ++-----------------------sample is signed if set + || + || ++-----------sample is bigendian if set + || || + || || ++---sample is float if set + || || || + || || || +---sample bit size---+ + || || || | | + 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 + \endverbatim + * + * There are macros in SDL 2.0 and later to query these bits. + */ +typedef Uint16 SDL_AudioFormat; + +/** + * \name Audio flags + */ +/* @{ */ + +#define SDL_AUDIO_MASK_BITSIZE (0xFF) +#define SDL_AUDIO_MASK_DATATYPE (1<<8) +#define SDL_AUDIO_MASK_ENDIAN (1<<12) +#define SDL_AUDIO_MASK_SIGNED (1<<15) +#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) +#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) +#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) +#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) +#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) +#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) +#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) + +/** + * \name Audio format flags + * + * Defaults to LSB byte order. + */ +/* @{ */ +#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ +#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ +#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ +#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ +#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ +#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ +#define AUDIO_U16 AUDIO_U16LSB +#define AUDIO_S16 AUDIO_S16LSB +/* @} */ + +/** + * \name int32 support + */ +/* @{ */ +#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ +#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ +#define AUDIO_S32 AUDIO_S32LSB +/* @} */ + +/** + * \name float32 support + */ +/* @{ */ +#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */ +#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */ +#define AUDIO_F32 AUDIO_F32LSB +/* @} */ + +/** + * \name Native audio byte ordering + */ +/* @{ */ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define AUDIO_U16SYS AUDIO_U16LSB +#define AUDIO_S16SYS AUDIO_S16LSB +#define AUDIO_S32SYS AUDIO_S32LSB +#define AUDIO_F32SYS AUDIO_F32LSB +#else +#define AUDIO_U16SYS AUDIO_U16MSB +#define AUDIO_S16SYS AUDIO_S16MSB +#define AUDIO_S32SYS AUDIO_S32MSB +#define AUDIO_F32SYS AUDIO_F32MSB +#endif +/* @} */ + +/** + * \name Allow change flags + * + * Which audio format changes are allowed when opening a device. + */ +/* @{ */ +#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 +#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 +#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 +#define SDL_AUDIO_ALLOW_SAMPLES_CHANGE 0x00000008 +#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE|SDL_AUDIO_ALLOW_SAMPLES_CHANGE) +/* @} */ + +/* @} *//* Audio flags */ + +/** + * This function is called when the audio device needs more data. + * + * \param userdata An application-specific parameter saved in + * the SDL_AudioSpec structure + * \param stream A pointer to the audio data buffer. + * \param len The length of that buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + * + * You can choose to avoid callbacks and use SDL_QueueAudio() instead, if + * you like. Just open your audio device with a NULL callback. + */ +typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, + int len); + +/** + * The calculated values in this structure are calculated by SDL_OpenAudio(). + * + * For multi-channel audio, the default SDL channel mapping is: + * 2: FL FR (stereo) + * 3: FL FR LFE (2.1 surround) + * 4: FL FR BL BR (quad) + * 5: FL FR LFE BL BR (4.1 surround) + * 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR) + * 7: FL FR FC LFE BC SL SR (6.1 surround) + * 8: FL FR FC LFE BL BR SL SR (7.1 surround) + */ +typedef struct SDL_AudioSpec +{ + int freq; /**< DSP frequency -- samples per second */ + SDL_AudioFormat format; /**< Audio data format */ + Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ + Uint8 silence; /**< Audio buffer silence value (calculated) */ + Uint16 samples; /**< Audio buffer size in sample FRAMES (total samples divided by channel count) */ + Uint16 padding; /**< Necessary for some compile environments */ + Uint32 size; /**< Audio buffer size in bytes (calculated) */ + SDL_AudioCallback callback; /**< Callback that feeds the audio device (NULL to use SDL_QueueAudio()). */ + void *userdata; /**< Userdata passed to callback (ignored for NULL callbacks). */ +} SDL_AudioSpec; + + +struct SDL_AudioCVT; +typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, + SDL_AudioFormat format); + +/** + * \brief Upper limit of filters in SDL_AudioCVT + * + * The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is + * currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, + * one of which is the terminating NULL pointer. + */ +#define SDL_AUDIOCVT_MAX_FILTERS 9 + +/** + * \struct SDL_AudioCVT + * \brief A structure to hold a set of audio conversion filters and buffers. + * + * Note that various parts of the conversion pipeline can take advantage + * of SIMD operations (like SSE2, for example). SDL_AudioCVT doesn't require + * you to pass it aligned data, but can possibly run much faster if you + * set both its (buf) field to a pointer that is aligned to 16 bytes, and its + * (len) field to something that's a multiple of 16, if possible. + */ +#if defined(__GNUC__) && !defined(__CHERI_PURE_CAPABILITY__) +/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't + pad it out to 88 bytes to guarantee ABI compatibility between compilers. + This is not a concern on CHERI architectures, where pointers must be stored + at aligned locations otherwise they will become invalid, and thus structs + containing pointers cannot be packed without giving a warning or error. + vvv + The next time we rev the ABI, make sure to size the ints and add padding. +*/ +#define SDL_AUDIOCVT_PACKED __attribute__((packed)) +#else +#define SDL_AUDIOCVT_PACKED +#endif +/* */ +typedef struct SDL_AudioCVT +{ + int needed; /**< Set to 1 if conversion possible */ + SDL_AudioFormat src_format; /**< Source audio format */ + SDL_AudioFormat dst_format; /**< Target audio format */ + double rate_incr; /**< Rate conversion increment */ + Uint8 *buf; /**< Buffer to hold entire audio data */ + int len; /**< Length of original audio buffer */ + int len_cvt; /**< Length of converted audio buffer */ + int len_mult; /**< buffer must be len*len_mult big */ + double len_ratio; /**< Given len, final size is len*len_ratio */ + SDL_AudioFilter filters[SDL_AUDIOCVT_MAX_FILTERS + 1]; /**< NULL-terminated list of filter functions */ + int filter_index; /**< Current audio conversion function */ +} SDL_AUDIOCVT_PACKED SDL_AudioCVT; + + +/* Function prototypes */ + +/** + * \name Driver discovery functions + * + * These functions return the list of built in audio drivers, in the + * order that they are normally initialized by default. + */ +/* @{ */ + +/** + * Use this function to get the number of built-in audio drivers. + * + * This function returns a hardcoded number. This never returns a negative + * value; if there are no drivers compiled into this build of SDL, this + * function returns zero. The presence of a driver in this list does not mean + * it will function, it just means SDL is capable of interacting with that + * interface. For example, a build of SDL might have esound support, but if + * there's no esound server available, SDL's esound driver would fail if used. + * + * By default, SDL tries all drivers, in its preferred order, until one is + * found to be usable. + * + * \returns the number of built-in audio drivers. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetAudioDriver + */ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); + +/** + * Use this function to get the name of a built in audio driver. + * + * The list of audio drivers is given in the order that they are normally + * initialized by default; the drivers that seem more reasonable to choose + * first (as far as the SDL developers believe) are earlier in the list. + * + * The names of drivers are all simple, low-ASCII identifiers, like "alsa", + * "coreaudio" or "xaudio2". These never have Unicode characters, and are not + * meant to be proper names. + * + * \param index the index of the audio driver; the value ranges from 0 to + * SDL_GetNumAudioDrivers() - 1 + * \returns the name of the audio driver at the requested index, or NULL if an + * invalid index was specified. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetNumAudioDrivers + */ +extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); +/* @} */ + +/** + * \name Initialization and cleanup + * + * \internal These functions are used internally, and should not be used unless + * you have a specific need to specify the audio driver you want to + * use. You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/* @{ */ + +/** + * Use this function to initialize a particular audio driver. + * + * This function is used internally, and should not be used unless you have a + * specific need to designate the audio driver you want to use. You should + * normally use SDL_Init() or SDL_InitSubSystem(). + * + * \param driver_name the name of the desired audio driver + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AudioQuit + */ +extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); + +/** + * Use this function to shut down audio if you initialized it with + * SDL_AudioInit(). + * + * This function is used internally, and should not be used unless you have a + * specific need to specify the audio driver you want to use. You should + * normally use SDL_Quit() or SDL_QuitSubSystem(). + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AudioInit + */ +extern DECLSPEC void SDLCALL SDL_AudioQuit(void); +/* @} */ + +/** + * Get the name of the current audio driver. + * + * The returned string points to internal static memory and thus never becomes + * invalid, even if you quit the audio subsystem and initialize a new driver + * (although such a case would return a different static string from another + * call to this function, of course). As such, you should not modify or free + * the returned string. + * + * \returns the name of the current audio driver or NULL if no driver has been + * initialized. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AudioInit + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); + +/** + * This function is a legacy means of opening the audio device. + * + * This function remains for compatibility with SDL 1.2, but also because it's + * slightly easier to use than the new functions in SDL 2.0. The new, more + * powerful, and preferred way to do this is SDL_OpenAudioDevice(). + * + * This function is roughly equivalent to: + * + * ```c + * SDL_OpenAudioDevice(NULL, 0, desired, obtained, SDL_AUDIO_ALLOW_ANY_CHANGE); + * ``` + * + * With two notable exceptions: + * + * - If `obtained` is NULL, we use `desired` (and allow no changes), which + * means desired will be modified to have the correct values for silence, + * etc, and SDL will convert any differences between your app's specific + * request and the hardware behind the scenes. + * - The return value is always success or failure, and not a device ID, which + * means you can only have one device open at a time with this function. + * + * \param desired an SDL_AudioSpec structure representing the desired output + * format. Please refer to the SDL_OpenAudioDevice + * documentation for details on how to prepare this structure. + * \param obtained an SDL_AudioSpec structure filled in with the actual + * parameters, or NULL. + * \returns 0 if successful, placing the actual hardware parameters in the + * structure pointed to by `obtained`. + * + * If `obtained` is NULL, the audio data passed to the callback + * function will be guaranteed to be in the requested format, and + * will be automatically converted to the actual hardware audio + * format if necessary. If `obtained` is NULL, `desired` will have + * fields modified. + * + * This function returns a negative error code on failure to open the + * audio device or failure to set up the audio thread; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CloseAudio + * \sa SDL_LockAudio + * \sa SDL_PauseAudio + * \sa SDL_UnlockAudio + */ +extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, + SDL_AudioSpec * obtained); + +/** + * SDL Audio Device IDs. + * + * A successful call to SDL_OpenAudio() is always device id 1, and legacy + * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls + * always returns devices >= 2 on success. The legacy calls are good both + * for backwards compatibility and when you don't care about multiple, + * specific, or capture devices. + */ +typedef Uint32 SDL_AudioDeviceID; + +/** + * Get the number of built-in audio devices. + * + * This function is only valid after successfully initializing the audio + * subsystem. + * + * Note that audio capture support is not implemented as of SDL 2.0.4, so the + * `iscapture` parameter is for future expansion and should always be zero for + * now. + * + * This function will return -1 if an explicit list of devices can't be + * determined. Returning -1 is not an error. For example, if SDL is set up to + * talk to a remote audio server, it can't list every one available on the + * Internet, but it will still allow a specific host to be specified in + * SDL_OpenAudioDevice(). + * + * In many common cases, when this function returns a value <= 0, it can still + * successfully open the default device (NULL for first argument of + * SDL_OpenAudioDevice()). + * + * This function may trigger a complete redetect of available hardware. It + * should not be called for each iteration of a loop, but rather once at the + * start of a loop: + * + * ```c + * // Don't do this: + * for (int i = 0; i < SDL_GetNumAudioDevices(0); i++) + * + * // do this instead: + * const int count = SDL_GetNumAudioDevices(0); + * for (int i = 0; i < count; ++i) { do_something_here(); } + * ``` + * + * \param iscapture zero to request playback devices, non-zero to request + * recording devices + * \returns the number of available devices exposed by the current driver or + * -1 if an explicit list of devices can't be determined. A return + * value of -1 does not necessarily mean an error condition. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetAudioDeviceName + * \sa SDL_OpenAudioDevice + */ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); + +/** + * Get the human-readable name of a specific audio device. + * + * This function is only valid after successfully initializing the audio + * subsystem. The values returned by this function reflect the latest call to + * SDL_GetNumAudioDevices(); re-call that function to redetect available + * hardware. + * + * The string returned by this function is UTF-8 encoded, read-only, and + * managed internally. You are not to free it. If you need to keep the string + * for any length of time, you should make your own copy of it, as it will be + * invalid next time any of several other SDL functions are called. + * + * \param index the index of the audio device; valid values range from 0 to + * SDL_GetNumAudioDevices() - 1 + * \param iscapture non-zero to query the list of recording devices, zero to + * query the list of output devices. + * \returns the name of the audio device at the requested index, or NULL on + * error. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetNumAudioDevices + * \sa SDL_GetDefaultAudioInfo + */ +extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, + int iscapture); + +/** + * Get the preferred audio format of a specific audio device. + * + * This function is only valid after a successfully initializing the audio + * subsystem. The values returned by this function reflect the latest call to + * SDL_GetNumAudioDevices(); re-call that function to redetect available + * hardware. + * + * `spec` will be filled with the sample rate, sample format, and channel + * count. + * + * \param index the index of the audio device; valid values range from 0 to + * SDL_GetNumAudioDevices() - 1 + * \param iscapture non-zero to query the list of recording devices, zero to + * query the list of output devices. + * \param spec The SDL_AudioSpec to be initialized by this function. + * \returns 0 on success, nonzero on error + * + * \since This function is available since SDL 2.0.16. + * + * \sa SDL_GetNumAudioDevices + * \sa SDL_GetDefaultAudioInfo + */ +extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index, + int iscapture, + SDL_AudioSpec *spec); + + +/** + * Get the name and preferred format of the default audio device. + * + * Some (but not all!) platforms have an isolated mechanism to get information + * about the "default" device. This can actually be a completely different + * device that's not in the list you get from SDL_GetAudioDeviceSpec(). It can + * even be a network address! (This is discussed in SDL_OpenAudioDevice().) + * + * As a result, this call is not guaranteed to be performant, as it can query + * the sound server directly every time, unlike the other query functions. You + * should call this function sparingly! + * + * `spec` will be filled with the sample rate, sample format, and channel + * count, if a default device exists on the system. If `name` is provided, + * will be filled with either a dynamically-allocated UTF-8 string or NULL. + * + * \param name A pointer to be filled with the name of the default device (can + * be NULL). Please call SDL_free() when you are done with this + * pointer! + * \param spec The SDL_AudioSpec to be initialized by this function. + * \param iscapture non-zero to query the default recording device, zero to + * query the default output device. + * \returns 0 on success, nonzero on error + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_GetAudioDeviceName + * \sa SDL_GetAudioDeviceSpec + * \sa SDL_OpenAudioDevice + */ +extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name, + SDL_AudioSpec *spec, + int iscapture); + + +/** + * Open a specific audio device. + * + * SDL_OpenAudio(), unlike this function, always acts on device ID 1. As such, + * this function will never return a 1 so as not to conflict with the legacy + * function. + * + * Please note that SDL 2.0 before 2.0.5 did not support recording; as such, + * this function would fail if `iscapture` was not zero. Starting with SDL + * 2.0.5, recording is implemented and this value can be non-zero. + * + * Passing in a `device` name of NULL requests the most reasonable default + * (and is equivalent to what SDL_OpenAudio() does to choose a device). The + * `device` name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but + * some drivers allow arbitrary and driver-specific strings, such as a + * hostname/IP address for a remote audio server, or a filename in the + * diskaudio driver. + * + * An opened audio device starts out paused, and should be enabled for playing + * by calling SDL_PauseAudioDevice(devid, 0) when you are ready for your audio + * callback function to be called. Since the audio driver may modify the + * requested size of the audio buffer, you should allocate any local mixing + * buffers after you open the audio device. + * + * The audio callback runs in a separate thread in most cases; you can prevent + * race conditions between your callback and other threads without fully + * pausing playback with SDL_LockAudioDevice(). For more information about the + * callback, see SDL_AudioSpec. + * + * Managing the audio spec via 'desired' and 'obtained': + * + * When filling in the desired audio spec structure: + * + * - `desired->freq` should be the frequency in sample-frames-per-second (Hz). + * - `desired->format` should be the audio format (`AUDIO_S16SYS`, etc). + * - `desired->samples` is the desired size of the audio buffer, in _sample + * frames_ (with stereo output, two samples--left and right--would make a + * single sample frame). This number should be a power of two, and may be + * adjusted by the audio driver to a value more suitable for the hardware. + * Good values seem to range between 512 and 8096 inclusive, depending on + * the application and CPU speed. Smaller values reduce latency, but can + * lead to underflow if the application is doing heavy processing and cannot + * fill the audio buffer in time. Note that the number of sample frames is + * directly related to time by the following formula: `ms = + * (sampleframes*1000)/freq` + * - `desired->size` is the size in _bytes_ of the audio buffer, and is + * calculated by SDL_OpenAudioDevice(). You don't initialize this. + * - `desired->silence` is the value used to set the buffer to silence, and is + * calculated by SDL_OpenAudioDevice(). You don't initialize this. + * - `desired->callback` should be set to a function that will be called when + * the audio device is ready for more data. It is passed a pointer to the + * audio buffer, and the length in bytes of the audio buffer. This function + * usually runs in a separate thread, and so you should protect data + * structures that it accesses by calling SDL_LockAudioDevice() and + * SDL_UnlockAudioDevice() in your code. Alternately, you may pass a NULL + * pointer here, and call SDL_QueueAudio() with some frequency, to queue + * more audio samples to be played (or for capture devices, call + * SDL_DequeueAudio() with some frequency, to obtain audio samples). + * - `desired->userdata` is passed as the first parameter to your callback + * function. If you passed a NULL callback, this value is ignored. + * + * `allowed_changes` can have the following flags OR'd together: + * + * - `SDL_AUDIO_ALLOW_FREQUENCY_CHANGE` + * - `SDL_AUDIO_ALLOW_FORMAT_CHANGE` + * - `SDL_AUDIO_ALLOW_CHANNELS_CHANGE` + * - `SDL_AUDIO_ALLOW_SAMPLES_CHANGE` + * - `SDL_AUDIO_ALLOW_ANY_CHANGE` + * + * These flags specify how SDL should behave when a device cannot offer a + * specific feature. If the application requests a feature that the hardware + * doesn't offer, SDL will always try to get the closest equivalent. + * + * For example, if you ask for float32 audio format, but the sound card only + * supports int16, SDL will set the hardware to int16. If you had set + * SDL_AUDIO_ALLOW_FORMAT_CHANGE, SDL will change the format in the `obtained` + * structure. If that flag was *not* set, SDL will prepare to convert your + * callback's float32 audio to int16 before feeding it to the hardware and + * will keep the originally requested format in the `obtained` structure. + * + * The resulting audio specs, varying depending on hardware and on what + * changes were allowed, will then be written back to `obtained`. + * + * If your application can only handle one specific data format, pass a zero + * for `allowed_changes` and let SDL transparently handle any differences. + * + * \param device a UTF-8 string reported by SDL_GetAudioDeviceName() or a + * driver-specific name as appropriate. NULL requests the most + * reasonable default device. + * \param iscapture non-zero to specify a device should be opened for + * recording, not playback + * \param desired an SDL_AudioSpec structure representing the desired output + * format; see SDL_OpenAudio() for more information + * \param obtained an SDL_AudioSpec structure filled in with the actual output + * format; see SDL_OpenAudio() for more information + * \param allowed_changes 0, or one or more flags OR'd together + * \returns a valid device ID that is > 0 on success or 0 on failure; call + * SDL_GetError() for more information. + * + * For compatibility with SDL 1.2, this will never return 1, since + * SDL reserves that ID for the legacy SDL_OpenAudio() function. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CloseAudioDevice + * \sa SDL_GetAudioDeviceName + * \sa SDL_LockAudioDevice + * \sa SDL_OpenAudio + * \sa SDL_PauseAudioDevice + * \sa SDL_UnlockAudioDevice + */ +extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice( + const char *device, + int iscapture, + const SDL_AudioSpec *desired, + SDL_AudioSpec *obtained, + int allowed_changes); + + + +/** + * \name Audio state + * + * Get the current audio state. + */ +/* @{ */ +typedef enum +{ + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED +} SDL_AudioStatus; + +/** + * This function is a legacy means of querying the audio device. + * + * New programs might want to use SDL_GetAudioDeviceStatus() instead. This + * function is equivalent to calling... + * + * ```c + * SDL_GetAudioDeviceStatus(1); + * ``` + * + * ...and is only useful if you used the legacy SDL_OpenAudio() function. + * + * \returns the SDL_AudioStatus of the audio device opened by SDL_OpenAudio(). + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetAudioDeviceStatus + */ +extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void); + +/** + * Use this function to get the current audio state of an audio device. + * + * \param dev the ID of an audio device previously opened with + * SDL_OpenAudioDevice() + * \returns the SDL_AudioStatus of the specified audio device. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_PauseAudioDevice + */ +extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); +/* @} *//* Audio State */ + +/** + * \name Pause audio functions + * + * These functions pause and unpause the audio callback processing. + * They should be called with a parameter of 0 after opening the audio + * device to start playing sound. This is so you can safely initialize + * data for your callback function after opening the audio device. + * Silence will be written to the audio device during the pause. + */ +/* @{ */ + +/** + * This function is a legacy means of pausing the audio device. + * + * New programs might want to use SDL_PauseAudioDevice() instead. This + * function is equivalent to calling... + * + * ```c + * SDL_PauseAudioDevice(1, pause_on); + * ``` + * + * ...and is only useful if you used the legacy SDL_OpenAudio() function. + * + * \param pause_on non-zero to pause, 0 to unpause + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetAudioStatus + * \sa SDL_PauseAudioDevice + */ +extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); + +/** + * Use this function to pause and unpause audio playback on a specified + * device. + * + * This function pauses and unpauses the audio callback processing for a given + * device. Newly-opened audio devices start in the paused state, so you must + * call this function with **pause_on**=0 after opening the specified audio + * device to start playing sound. This allows you to safely initialize data + * for your callback function after opening the audio device. Silence will be + * written to the audio device while paused, and the audio callback is + * guaranteed to not be called. Pausing one device does not prevent other + * unpaused devices from running their callbacks. + * + * Pausing state does not stack; even if you pause a device several times, a + * single unpause will start the device playing again, and vice versa. This is + * different from how SDL_LockAudioDevice() works. + * + * If you just need to protect a few variables from race conditions vs your + * callback, you shouldn't pause the audio device, as it will lead to dropouts + * in the audio playback. Instead, you should use SDL_LockAudioDevice(). + * + * \param dev a device opened by SDL_OpenAudioDevice() + * \param pause_on non-zero to pause, 0 to unpause + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LockAudioDevice + */ +extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, + int pause_on); +/* @} *//* Pause audio functions */ + +/** + * Load the audio data of a WAVE file into memory. + * + * Loading a WAVE file requires `src`, `spec`, `audio_buf` and `audio_len` to + * be valid pointers. The entire data portion of the file is then loaded into + * memory and decoded if necessary. + * + * If `freesrc` is non-zero, the data source gets automatically closed and + * freed before the function returns. + * + * Supported formats are RIFF WAVE files with the formats PCM (8, 16, 24, and + * 32 bits), IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and + * A-law and mu-law (8 bits). Other formats are currently unsupported and + * cause an error. + * + * If this function succeeds, the pointer returned by it is equal to `spec` + * and the pointer to the audio data allocated by the function is written to + * `audio_buf` and its length in bytes to `audio_len`. The SDL_AudioSpec + * members `freq`, `channels`, and `format` are set to the values of the audio + * data in the buffer. The `samples` member is set to a sane default and all + * others are set to zero. + * + * It's necessary to use SDL_FreeWAV() to free the audio data returned in + * `audio_buf` when it is no longer used. + * + * Because of the underspecification of the .WAV format, there are many + * problematic files in the wild that cause issues with strict decoders. To + * provide compatibility with these files, this decoder is lenient in regards + * to the truncation of the file, the fact chunk, and the size of the RIFF + * chunk. The hints `SDL_HINT_WAVE_RIFF_CHUNK_SIZE`, + * `SDL_HINT_WAVE_TRUNCATION`, and `SDL_HINT_WAVE_FACT_CHUNK` can be used to + * tune the behavior of the loading process. + * + * Any file that is invalid (due to truncation, corruption, or wrong values in + * the headers), too big, or unsupported causes an error. Additionally, any + * critical I/O error from the data source will terminate the loading process + * with an error. The function returns NULL on error and in all cases (with + * the exception of `src` being NULL), an appropriate error message will be + * set. + * + * It is required that the data source supports seeking. + * + * Example: + * + * ```c + * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, &spec, &buf, &len); + * ``` + * + * Note that the SDL_LoadWAV macro does this same thing for you, but in a less + * messy way: + * + * ```c + * SDL_LoadWAV("sample.wav", &spec, &buf, &len); + * ``` + * + * \param src The data source for the WAVE data + * \param freesrc If non-zero, SDL will _always_ free the data source + * \param spec An SDL_AudioSpec that will be filled in with the wave file's + * format details + * \param audio_buf A pointer filled with the audio data, allocated by the + * function. + * \param audio_len A pointer filled with the length of the audio data buffer + * in bytes + * \returns This function, if successfully called, returns `spec`, which will + * be filled with the audio data format of the wave source data. + * `audio_buf` will be filled with a pointer to an allocated buffer + * containing the audio data, and `audio_len` is filled with the + * length of that audio buffer in bytes. + * + * This function returns NULL if the .WAV file cannot be opened, uses + * an unknown data format, or is corrupt; call SDL_GetError() for + * more information. + * + * When the application is done with the data returned in + * `audio_buf`, it should call SDL_FreeWAV() to dispose of it. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FreeWAV + * \sa SDL_LoadWAV + */ +extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, + int freesrc, + SDL_AudioSpec * spec, + Uint8 ** audio_buf, + Uint32 * audio_len); + +/** + * Loads a WAV from a file. + * Compatibility convenience function. + */ +#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ + SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) + +/** + * Free data previously allocated with SDL_LoadWAV() or SDL_LoadWAV_RW(). + * + * After a WAVE file has been opened with SDL_LoadWAV() or SDL_LoadWAV_RW() + * its data can eventually be freed with SDL_FreeWAV(). It is safe to call + * this function with a NULL pointer. + * + * \param audio_buf a pointer to the buffer created by SDL_LoadWAV() or + * SDL_LoadWAV_RW() + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LoadWAV + * \sa SDL_LoadWAV_RW + */ +extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); + +/** + * Initialize an SDL_AudioCVT structure for conversion. + * + * Before an SDL_AudioCVT structure can be used to convert audio data it must + * be initialized with source and destination information. + * + * This function will zero out every field of the SDL_AudioCVT, so it must be + * called before the application fills in the final buffer information. + * + * Once this function has returned successfully, and reported that a + * conversion is necessary, the application fills in the rest of the fields in + * SDL_AudioCVT, now that it knows how large a buffer it needs to allocate, + * and then can call SDL_ConvertAudio() to complete the conversion. + * + * \param cvt an SDL_AudioCVT structure filled in with audio conversion + * information + * \param src_format the source format of the audio data; for more info see + * SDL_AudioFormat + * \param src_channels the number of channels in the source + * \param src_rate the frequency (sample-frames-per-second) of the source + * \param dst_format the destination format of the audio data; for more info + * see SDL_AudioFormat + * \param dst_channels the number of channels in the destination + * \param dst_rate the frequency (sample-frames-per-second) of the destination + * \returns 1 if the audio filter is prepared, 0 if no conversion is needed, + * or a negative error code on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ConvertAudio + */ +extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, + SDL_AudioFormat src_format, + Uint8 src_channels, + int src_rate, + SDL_AudioFormat dst_format, + Uint8 dst_channels, + int dst_rate); + +/** + * Convert audio data to a desired audio format. + * + * This function does the actual audio data conversion, after the application + * has called SDL_BuildAudioCVT() to prepare the conversion information and + * then filled in the buffer details. + * + * Once the application has initialized the `cvt` structure using + * SDL_BuildAudioCVT(), allocated an audio buffer and filled it with audio + * data in the source format, this function will convert the buffer, in-place, + * to the desired format. + * + * The data conversion may go through several passes; any given pass may + * possibly temporarily increase the size of the data. For example, SDL might + * expand 16-bit data to 32 bits before resampling to a lower frequency, + * shrinking the data size after having grown it briefly. Since the supplied + * buffer will be both the source and destination, converting as necessary + * in-place, the application must allocate a buffer that will fully contain + * the data during its largest conversion pass. After SDL_BuildAudioCVT() + * returns, the application should set the `cvt->len` field to the size, in + * bytes, of the source data, and allocate a buffer that is `cvt->len * + * cvt->len_mult` bytes long for the `buf` field. + * + * The source data should be copied into this buffer before the call to + * SDL_ConvertAudio(). Upon successful return, this buffer will contain the + * converted audio, and `cvt->len_cvt` will be the size of the converted data, + * in bytes. Any bytes in the buffer past `cvt->len_cvt` are undefined once + * this function returns. + * + * \param cvt an SDL_AudioCVT structure that was previously set up by + * SDL_BuildAudioCVT(). + * \returns 0 if the conversion was completed successfully or a negative error + * code on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_BuildAudioCVT + */ +extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); + +/* SDL_AudioStream is a new audio conversion interface. + The benefits vs SDL_AudioCVT: + - it can handle resampling data in chunks without generating + artifacts, when it doesn't have the complete buffer available. + - it can handle incoming data in any variable size. + - You push data as you have it, and pull it when you need it + */ +/* this is opaque to the outside world. */ +struct _SDL_AudioStream; +typedef struct _SDL_AudioStream SDL_AudioStream; + +/** + * Create a new audio stream. + * + * \param src_format The format of the source audio + * \param src_channels The number of channels of the source audio + * \param src_rate The sampling rate of the source audio + * \param dst_format The format of the desired audio output + * \param dst_channels The number of channels of the desired audio output + * \param dst_rate The sampling rate of the desired audio output + * \returns 0 on success, or -1 on error. + * + * \since This function is available since SDL 2.0.7. + * + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC SDL_AudioStream * SDLCALL SDL_NewAudioStream(const SDL_AudioFormat src_format, + const Uint8 src_channels, + const int src_rate, + const SDL_AudioFormat dst_format, + const Uint8 dst_channels, + const int dst_rate); + +/** + * Add data to be converted/resampled to the stream. + * + * \param stream The stream the audio data is being added to + * \param buf A pointer to the audio data to add + * \param len The number of bytes to write to the stream + * \returns 0 on success, or -1 on error. + * + * \since This function is available since SDL 2.0.7. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamPut(SDL_AudioStream *stream, const void *buf, int len); + +/** + * Get converted/resampled data from the stream + * + * \param stream The stream the audio is being requested from + * \param buf A buffer to fill with audio data + * \param len The maximum number of bytes to fill + * \returns the number of bytes read from the stream, or -1 on error + * + * \since This function is available since SDL 2.0.7. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamGet(SDL_AudioStream *stream, void *buf, int len); + +/** + * Get the number of converted/resampled bytes available. + * + * The stream may be buffering data behind the scenes until it has enough to + * resample correctly, so this number might be lower than what you expect, or + * even be zero. Add more data or flush the stream if you need the data now. + * + * \since This function is available since SDL 2.0.7. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamAvailable(SDL_AudioStream *stream); + +/** + * Tell the stream that you're done sending data, and anything being buffered + * should be converted/resampled and made available immediately. + * + * It is legal to add more data to a stream after flushing, but there will be + * audio gaps in the output. Generally this is intended to signal the end of + * input, so the complete output becomes available. + * + * \since This function is available since SDL 2.0.7. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamClear + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC int SDLCALL SDL_AudioStreamFlush(SDL_AudioStream *stream); + +/** + * Clear any pending data in the stream without converting it + * + * \since This function is available since SDL 2.0.7. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_FreeAudioStream + */ +extern DECLSPEC void SDLCALL SDL_AudioStreamClear(SDL_AudioStream *stream); + +/** + * Free an audio stream + * + * \since This function is available since SDL 2.0.7. + * + * \sa SDL_NewAudioStream + * \sa SDL_AudioStreamPut + * \sa SDL_AudioStreamGet + * \sa SDL_AudioStreamAvailable + * \sa SDL_AudioStreamFlush + * \sa SDL_AudioStreamClear + */ +extern DECLSPEC void SDLCALL SDL_FreeAudioStream(SDL_AudioStream *stream); + +#define SDL_MIX_MAXVOLUME 128 + +/** + * This function is a legacy means of mixing audio. + * + * This function is equivalent to calling... + * + * ```c + * SDL_MixAudioFormat(dst, src, format, len, volume); + * ``` + * + * ...where `format` is the obtained format of the audio device from the + * legacy SDL_OpenAudio() function. + * + * \param dst the destination for the mixed audio + * \param src the source audio buffer to be mixed + * \param len the length of the audio buffer in bytes + * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME + * for full audio volume + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_MixAudioFormat + */ +extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, + Uint32 len, int volume); + +/** + * Mix audio data in a specified format. + * + * This takes an audio buffer `src` of `len` bytes of `format` data and mixes + * it into `dst`, performing addition, volume adjustment, and overflow + * clipping. The buffer pointed to by `dst` must also be `len` bytes of + * `format` data. + * + * This is provided for convenience -- you can mix your own audio data. + * + * Do not use this function for mixing together more than two streams of + * sample data. The output from repeated application of this function may be + * distorted by clipping, because there is no accumulator with greater range + * than the input (not to mention this being an inefficient way of doing it). + * + * It is a common misconception that this function is required to write audio + * data to an output stream in an audio callback. While you can do that, + * SDL_MixAudioFormat() is really only needed when you're mixing a single + * audio stream with a volume adjustment. + * + * \param dst the destination for the mixed audio + * \param src the source audio buffer to be mixed + * \param format the SDL_AudioFormat structure representing the desired audio + * format + * \param len the length of the audio buffer in bytes + * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME + * for full audio volume + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, + const Uint8 * src, + SDL_AudioFormat format, + Uint32 len, int volume); + +/** + * Queue more audio on non-callback devices. + * + * If you are looking to retrieve queued audio from a non-callback capture + * device, you want SDL_DequeueAudio() instead. SDL_QueueAudio() will return + * -1 to signify an error if you use it with capture devices. + * + * SDL offers two ways to feed audio to the device: you can either supply a + * callback that SDL triggers with some frequency to obtain more audio (pull + * method), or you can supply no callback, and then SDL will expect you to + * supply data at regular intervals (push method) with this function. + * + * There are no limits on the amount of data you can queue, short of + * exhaustion of address space. Queued data will drain to the device as + * necessary without further intervention from you. If the device needs audio + * but there is not enough queued, it will play silence to make up the + * difference. This means you will have skips in your audio playback if you + * aren't routinely queueing sufficient data. + * + * This function copies the supplied data, so you are safe to free it when the + * function returns. This function is thread-safe, but queueing to the same + * device from two threads at once does not promise which buffer will be + * queued first. + * + * You may not queue audio on a device that is using an application-supplied + * callback; doing so returns an error. You have to use the audio callback or + * queue audio with this function, but not both. + * + * You should not call SDL_LockAudio() on the device before queueing; SDL + * handles locking internally for this function. + * + * Note that SDL2 does not support planar audio. You will need to resample + * from planar audio formats into a non-planar one (see SDL_AudioFormat) + * before queuing audio. + * + * \param dev the device ID to which we will queue audio + * \param data the data to queue to the device for later playback + * \param len the number of bytes (not samples!) to which `data` points + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.4. + * + * \sa SDL_ClearQueuedAudio + * \sa SDL_GetQueuedAudioSize + */ +extern DECLSPEC int SDLCALL SDL_QueueAudio(SDL_AudioDeviceID dev, const void *data, Uint32 len); + +/** + * Dequeue more audio on non-callback devices. + * + * If you are looking to queue audio for output on a non-callback playback + * device, you want SDL_QueueAudio() instead. SDL_DequeueAudio() will always + * return 0 if you use it with playback devices. + * + * SDL offers two ways to retrieve audio from a capture device: you can either + * supply a callback that SDL triggers with some frequency as the device + * records more audio data, (push method), or you can supply no callback, and + * then SDL will expect you to retrieve data at regular intervals (pull + * method) with this function. + * + * There are no limits on the amount of data you can queue, short of + * exhaustion of address space. Data from the device will keep queuing as + * necessary without further intervention from you. This means you will + * eventually run out of memory if you aren't routinely dequeueing data. + * + * Capture devices will not queue data when paused; if you are expecting to + * not need captured audio for some length of time, use SDL_PauseAudioDevice() + * to stop the capture device from queueing more data. This can be useful + * during, say, level loading times. When unpaused, capture devices will start + * queueing data from that point, having flushed any capturable data available + * while paused. + * + * This function is thread-safe, but dequeueing from the same device from two + * threads at once does not promise which thread will dequeue data first. + * + * You may not dequeue audio from a device that is using an + * application-supplied callback; doing so returns an error. You have to use + * the audio callback, or dequeue audio with this function, but not both. + * + * You should not call SDL_LockAudio() on the device before dequeueing; SDL + * handles locking internally for this function. + * + * \param dev the device ID from which we will dequeue audio + * \param data a pointer into where audio data should be copied + * \param len the number of bytes (not samples!) to which (data) points + * \returns the number of bytes dequeued, which could be less than requested; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_ClearQueuedAudio + * \sa SDL_GetQueuedAudioSize + */ +extern DECLSPEC Uint32 SDLCALL SDL_DequeueAudio(SDL_AudioDeviceID dev, void *data, Uint32 len); + +/** + * Get the number of bytes of still-queued audio. + * + * For playback devices: this is the number of bytes that have been queued for + * playback with SDL_QueueAudio(), but have not yet been sent to the hardware. + * + * Once we've sent it to the hardware, this function can not decide the exact + * byte boundary of what has been played. It's possible that we just gave the + * hardware several kilobytes right before you called this function, but it + * hasn't played any of it yet, or maybe half of it, etc. + * + * For capture devices, this is the number of bytes that have been captured by + * the device and are waiting for you to dequeue. This number may grow at any + * time, so this only informs of the lower-bound of available data. + * + * You may not queue or dequeue audio on a device that is using an + * application-supplied callback; calling this function on such a device + * always returns 0. You have to use the audio callback or queue audio, but + * not both. + * + * You should not call SDL_LockAudio() on the device before querying; SDL + * handles locking internally for this function. + * + * \param dev the device ID of which we will query queued audio size + * \returns the number of bytes (not samples!) of queued audio. + * + * \since This function is available since SDL 2.0.4. + * + * \sa SDL_ClearQueuedAudio + * \sa SDL_QueueAudio + * \sa SDL_DequeueAudio + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetQueuedAudioSize(SDL_AudioDeviceID dev); + +/** + * Drop any queued audio data waiting to be sent to the hardware. + * + * Immediately after this call, SDL_GetQueuedAudioSize() will return 0. For + * output devices, the hardware will start playing silence if more audio isn't + * queued. For capture devices, the hardware will start filling the empty + * queue with new data if the capture device isn't paused. + * + * This will not prevent playback of queued audio that's already been sent to + * the hardware, as we can not undo that, so expect there to be some fraction + * of a second of audio that might still be heard. This can be useful if you + * want to, say, drop any pending music or any unprocessed microphone input + * during a level change in your game. + * + * You may not queue or dequeue audio on a device that is using an + * application-supplied callback; calling this function on such a device + * always returns 0. You have to use the audio callback or queue audio, but + * not both. + * + * You should not call SDL_LockAudio() on the device before clearing the + * queue; SDL handles locking internally for this function. + * + * This function always succeeds and thus returns void. + * + * \param dev the device ID of which to clear the audio queue + * + * \since This function is available since SDL 2.0.4. + * + * \sa SDL_GetQueuedAudioSize + * \sa SDL_QueueAudio + * \sa SDL_DequeueAudio + */ +extern DECLSPEC void SDLCALL SDL_ClearQueuedAudio(SDL_AudioDeviceID dev); + + +/** + * \name Audio lock functions + * + * The lock manipulated by these functions protects the callback function. + * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that + * the callback function is not running. Do not call these from the callback + * function or you will cause deadlock. + */ +/* @{ */ + +/** + * This function is a legacy means of locking the audio device. + * + * New programs might want to use SDL_LockAudioDevice() instead. This function + * is equivalent to calling... + * + * ```c + * SDL_LockAudioDevice(1); + * ``` + * + * ...and is only useful if you used the legacy SDL_OpenAudio() function. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LockAudioDevice + * \sa SDL_UnlockAudio + * \sa SDL_UnlockAudioDevice + */ +extern DECLSPEC void SDLCALL SDL_LockAudio(void); + +/** + * Use this function to lock out the audio callback function for a specified + * device. + * + * The lock manipulated by these functions protects the audio callback + * function specified in SDL_OpenAudioDevice(). During a + * SDL_LockAudioDevice()/SDL_UnlockAudioDevice() pair, you can be guaranteed + * that the callback function for that device is not running, even if the + * device is not paused. While a device is locked, any other unpaused, + * unlocked devices may still run their callbacks. + * + * Calling this function from inside your audio callback is unnecessary. SDL + * obtains this lock before calling your function, and releases it when the + * function returns. + * + * You should not hold the lock longer than absolutely necessary. If you hold + * it too long, you'll experience dropouts in your audio playback. Ideally, + * your application locks the device, sets a few variables and unlocks again. + * Do not do heavy work while holding the lock for a device. + * + * It is safe to lock the audio device multiple times, as long as you unlock + * it an equivalent number of times. The callback will not run until the + * device has been unlocked completely in this way. If your application fails + * to unlock the device appropriately, your callback will never run, you might + * hear repeating bursts of audio, and SDL_CloseAudioDevice() will probably + * deadlock. + * + * Internally, the audio device lock is a mutex; if you lock from two threads + * at once, not only will you block the audio callback, you'll block the other + * thread. + * + * \param dev the ID of the device to be locked + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_UnlockAudioDevice + */ +extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); + +/** + * This function is a legacy means of unlocking the audio device. + * + * New programs might want to use SDL_UnlockAudioDevice() instead. This + * function is equivalent to calling... + * + * ```c + * SDL_UnlockAudioDevice(1); + * ``` + * + * ...and is only useful if you used the legacy SDL_OpenAudio() function. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LockAudio + * \sa SDL_UnlockAudioDevice + */ +extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); + +/** + * Use this function to unlock the audio callback function for a specified + * device. + * + * This function should be paired with a previous SDL_LockAudioDevice() call. + * + * \param dev the ID of the device to be unlocked + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LockAudioDevice + */ +extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); +/* @} *//* Audio lock functions */ + +/** + * This function is a legacy means of closing the audio device. + * + * This function is equivalent to calling... + * + * ```c + * SDL_CloseAudioDevice(1); + * ``` + * + * ...and is only useful if you used the legacy SDL_OpenAudio() function. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_OpenAudio + */ +extern DECLSPEC void SDLCALL SDL_CloseAudio(void); + +/** + * Use this function to shut down audio processing and close the audio device. + * + * The application should close open audio devices once they are no longer + * needed. Calling this function will wait until the device's audio callback + * is not running, release the audio hardware and then clean up internal + * state. No further audio will play from this device once this function + * returns. + * + * This function may block briefly while pending audio data is played by the + * hardware, so that applications don't drop the last buffer of data they + * supplied. + * + * The device ID is invalid as soon as the device is closed, and is eligible + * for reuse in a new SDL_OpenAudioDevice() call immediately. + * + * \param dev an audio device previously opened with SDL_OpenAudioDevice() + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_OpenAudioDevice + */ +extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_audio_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_bits.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_bits.h new file mode 100644 index 00000000..ce32dc13 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_bits.h @@ -0,0 +1,126 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_bits.h + * + * Functions for fiddling with bits and bitmasks. + */ + +#ifndef SDL_bits_h_ +#define SDL_bits_h_ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_bits.h + */ + +/** + * Get the index of the most significant bit. Result is undefined when called + * with 0. This operation can also be stated as "count leading zeroes" and + * "log base 2". + * + * \return the index of the most significant bit, or -1 if the value is 0. + */ +#if defined(__WATCOMC__) && defined(__386__) +extern __inline int _SDL_bsr_watcom(Uint32); +#pragma aux _SDL_bsr_watcom = \ + "bsr eax, eax" \ + parm [eax] nomemory \ + value [eax] \ + modify exact [eax] nomemory; +#endif + +SDL_FORCE_INLINE int +SDL_MostSignificantBitIndex32(Uint32 x) +{ +#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) + /* Count Leading Zeroes builtin in GCC. + * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html + */ + if (x == 0) { + return -1; + } + return 31 - __builtin_clz(x); +#elif defined(__WATCOMC__) && defined(__386__) + if (x == 0) { + return -1; + } + return _SDL_bsr_watcom(x); +#elif defined(_MSC_VER) + unsigned long index; + if (_BitScanReverse(&index, x)) { + return index; + } + return -1; +#else + /* Based off of Bit Twiddling Hacks by Sean Eron Anderson + * , released in the public domain. + * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog + */ + const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; + const int S[] = {1, 2, 4, 8, 16}; + + int msbIndex = 0; + int i; + + if (x == 0) { + return -1; + } + + for (i = 4; i >= 0; i--) + { + if (x & b[i]) + { + x >>= S[i]; + msbIndex |= S[i]; + } + } + + return msbIndex; +#endif +} + +SDL_FORCE_INLINE SDL_bool +SDL_HasExactlyOneBitSet32(Uint32 x) +{ + if (x && !(x & (x - 1))) { + return SDL_TRUE; + } + return SDL_FALSE; +} + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_bits_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_blendmode.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_blendmode.h new file mode 100644 index 00000000..cdd84e77 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_blendmode.h @@ -0,0 +1,198 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_blendmode.h + * + * Header file declaring the SDL_BlendMode enumeration + */ + +#ifndef SDL_blendmode_h_ +#define SDL_blendmode_h_ + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The blend mode used in SDL_RenderCopy() and drawing operations. + */ +typedef enum +{ + SDL_BLENDMODE_NONE = 0x00000000, /**< no blending + dstRGBA = srcRGBA */ + SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending + dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) + dstA = srcA + (dstA * (1-srcA)) */ + SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending + dstRGB = (srcRGB * srcA) + dstRGB + dstA = dstA */ + SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate + dstRGB = srcRGB * dstRGB + dstA = dstA */ + SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply + dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) + dstA = dstA */ + SDL_BLENDMODE_INVALID = 0x7FFFFFFF + + /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */ + +} SDL_BlendMode; + +/** + * \brief The blend operation used when combining source and destination pixel components + */ +typedef enum +{ + SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ + SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ + SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */ + SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */ +} SDL_BlendOperation; + +/** + * \brief The normalized factor used to multiply pixel components + */ +typedef enum +{ + SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */ + SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */ + SDL_BLENDFACTOR_SRC_COLOR = 0x3, /**< srcR, srcG, srcB, srcA */ + SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, /**< 1-srcR, 1-srcG, 1-srcB, 1-srcA */ + SDL_BLENDFACTOR_SRC_ALPHA = 0x5, /**< srcA, srcA, srcA, srcA */ + SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, /**< 1-srcA, 1-srcA, 1-srcA, 1-srcA */ + SDL_BLENDFACTOR_DST_COLOR = 0x7, /**< dstR, dstG, dstB, dstA */ + SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */ + SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */ + SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */ +} SDL_BlendFactor; + +/** + * Compose a custom blend mode for renderers. + * + * The functions SDL_SetRenderDrawBlendMode and SDL_SetTextureBlendMode accept + * the SDL_BlendMode returned by this function if the renderer supports it. + * + * A blend mode controls how the pixels from a drawing operation (source) get + * combined with the pixels from the render target (destination). First, the + * components of the source and destination pixels get multiplied with their + * blend factors. Then, the blend operation takes the two products and + * calculates the result that will get stored in the render target. + * + * Expressed in pseudocode, it would look like this: + * + * ```c + * dstRGB = colorOperation(srcRGB * srcColorFactor, dstRGB * dstColorFactor); + * dstA = alphaOperation(srcA * srcAlphaFactor, dstA * dstAlphaFactor); + * ``` + * + * Where the functions `colorOperation(src, dst)` and `alphaOperation(src, + * dst)` can return one of the following: + * + * - `src + dst` + * - `src - dst` + * - `dst - src` + * - `min(src, dst)` + * - `max(src, dst)` + * + * The red, green, and blue components are always multiplied with the first, + * second, and third components of the SDL_BlendFactor, respectively. The + * fourth component is not used. + * + * The alpha component is always multiplied with the fourth component of the + * SDL_BlendFactor. The other components are not used in the alpha + * calculation. + * + * Support for these blend modes varies for each renderer. To check if a + * specific SDL_BlendMode is supported, create a renderer and pass it to + * either SDL_SetRenderDrawBlendMode or SDL_SetTextureBlendMode. They will + * return with an error if the blend mode is not supported. + * + * This list describes the support of custom blend modes for each renderer in + * SDL 2.0.6. All renderers support the four blend modes listed in the + * SDL_BlendMode enumeration. + * + * - **direct3d**: Supports all operations with all factors. However, some + * factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and + * `SDL_BLENDOPERATION_MAXIMUM`. + * - **direct3d11**: Same as Direct3D 9. + * - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all + * factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly with SDL + * 2.0.6. + * - **opengles**: Supports the `SDL_BLENDOPERATION_ADD` operation with all + * factors. Color and alpha factors need to be the same. OpenGL ES 1 + * implementation specific: May also support `SDL_BLENDOPERATION_SUBTRACT` + * and `SDL_BLENDOPERATION_REV_SUBTRACT`. May support color and alpha + * operations being different from each other. May support color and alpha + * factors being different from each other. + * - **opengles2**: Supports the `SDL_BLENDOPERATION_ADD`, + * `SDL_BLENDOPERATION_SUBTRACT`, `SDL_BLENDOPERATION_REV_SUBTRACT` + * operations with all factors. + * - **psp**: No custom blend mode support. + * - **software**: No custom blend mode support. + * + * Some renderers do not provide an alpha component for the default render + * target. The `SDL_BLENDFACTOR_DST_ALPHA` and + * `SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA` factors do not have an effect in this + * case. + * + * \param srcColorFactor the SDL_BlendFactor applied to the red, green, and + * blue components of the source pixels + * \param dstColorFactor the SDL_BlendFactor applied to the red, green, and + * blue components of the destination pixels + * \param colorOperation the SDL_BlendOperation used to combine the red, + * green, and blue components of the source and + * destination pixels + * \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of + * the source pixels + * \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of + * the destination pixels + * \param alphaOperation the SDL_BlendOperation used to combine the alpha + * component of the source and destination pixels + * \returns an SDL_BlendMode that represents the chosen factors and + * operations. + * + * \since This function is available since SDL 2.0.6. + * + * \sa SDL_SetRenderDrawBlendMode + * \sa SDL_GetRenderDrawBlendMode + * \sa SDL_SetTextureBlendMode + * \sa SDL_GetTextureBlendMode + */ +extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, + SDL_BlendFactor dstColorFactor, + SDL_BlendOperation colorOperation, + SDL_BlendFactor srcAlphaFactor, + SDL_BlendFactor dstAlphaFactor, + SDL_BlendOperation alphaOperation); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_blendmode_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_clipboard.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_clipboard.h new file mode 100644 index 00000000..6a287b5d --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_clipboard.h @@ -0,0 +1,141 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_clipboard.h + * + * Include file for SDL clipboard handling + */ + +#ifndef SDL_clipboard_h_ +#define SDL_clipboard_h_ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * Put UTF-8 text into the clipboard. + * + * \param text the text to store in the clipboard + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetClipboardText + * \sa SDL_HasClipboardText + */ +extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); + +/** + * Get UTF-8 text from the clipboard, which must be freed with SDL_free(). + * + * This functions returns empty string if there was not enough memory left for + * a copy of the clipboard's content. + * + * \returns the clipboard text on success or an empty string on failure; call + * SDL_GetError() for more information. Caller must call SDL_free() + * on the returned pointer when done with it (even if there was an + * error). + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HasClipboardText + * \sa SDL_SetClipboardText + */ +extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); + +/** + * Query whether the clipboard exists and contains a non-empty text string. + * + * \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetClipboardText + * \sa SDL_SetClipboardText + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); + +/** + * Put UTF-8 text into the primary selection. + * + * \param text the text to store in the primary selection + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.26.0. + * + * \sa SDL_GetPrimarySelectionText + * \sa SDL_HasPrimarySelectionText + */ +extern DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text); + +/** + * Get UTF-8 text from the primary selection, which must be freed with + * SDL_free(). + * + * This functions returns empty string if there was not enough memory left for + * a copy of the primary selection's content. + * + * \returns the primary selection text on success or an empty string on + * failure; call SDL_GetError() for more information. Caller must + * call SDL_free() on the returned pointer when done with it (even if + * there was an error). + * + * \since This function is available since SDL 2.26.0. + * + * \sa SDL_HasPrimarySelectionText + * \sa SDL_SetPrimarySelectionText + */ +extern DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void); + +/** + * Query whether the primary selection exists and contains a non-empty text + * string. + * + * \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it + * does not. + * + * \since This function is available since SDL 2.26.0. + * + * \sa SDL_GetPrimarySelectionText + * \sa SDL_SetPrimarySelectionText + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_clipboard_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_config.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_config.h new file mode 100644 index 00000000..a168a00c --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_config.h @@ -0,0 +1,61 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDL_config_h_ +#define SDL_config_h_ + +#include + +/** + * \file SDL_config.h + */ + +/* Add any platform that doesn't build using the configure system. */ +#if defined(__WIN32__) +#include +#elif defined(__WINRT__) +#include +#elif defined(__WINGDK__) +#include +#elif defined(__XBOXONE__) || defined(__XBOXSERIES__) +#include +#elif defined(__MACOSX__) +#include +#elif defined(__IPHONEOS__) +#include +#elif defined(__ANDROID__) +#include +#elif defined(__OS2__) +#include +#elif defined(__EMSCRIPTEN__) +#include +#elif defined(__NGAGE__) +#include +#else +/* This is a minimal configuration just to get SDL running on new platforms. */ +#include +#endif /* platform config */ + +#ifdef USING_GENERATED_CONFIG_H +#error Wrong SDL_config.h, check your include path? +#endif + +#endif /* SDL_config_h_ */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_config_macosx.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_config_macosx.h new file mode 100644 index 00000000..2f36d7af --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_config_macosx.h @@ -0,0 +1,277 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDL_config_macosx_h_ +#define SDL_config_macosx_h_ +#define SDL_config_h_ + +#include + +/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ +#include + +/* This is a set of defines to configure the SDL features */ + +#ifdef __LP64__ + #define SIZEOF_VOIDP 8 +#else + #define SIZEOF_VOIDP 4 +#endif + +/* Useful headers */ +#define STDC_HEADERS 1 +#define HAVE_ALLOCA_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_FLOAT_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STRING_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_LIBUNWIND_H 1 + +/* C library functions */ +#define HAVE_DLOPEN 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_BSEARCH 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOK_R 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_STRCASESTR 1 +#define HAVE_VSSCANF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ACOS 1 +#define HAVE_ACOSF 1 +#define HAVE_ASIN 1 +#define HAVE_ASINF 1 +#define HAVE_ATAN 1 +#define HAVE_ATANF 1 +#define HAVE_ATAN2 1 +#define HAVE_ATAN2F 1 +#define HAVE_CEIL 1 +#define HAVE_CEILF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COPYSIGNF 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_EXP 1 +#define HAVE_EXPF 1 +#define HAVE_FABS 1 +#define HAVE_FABSF 1 +#define HAVE_FLOOR 1 +#define HAVE_FLOORF 1 +#define HAVE_FMOD 1 +#define HAVE_FMODF 1 +#define HAVE_LOG 1 +#define HAVE_LOGF 1 +#define HAVE_LOG10 1 +#define HAVE_LOG10F 1 +#define HAVE_LROUND 1 +#define HAVE_LROUNDF 1 +#define HAVE_POW 1 +#define HAVE_POWF 1 +#define HAVE_ROUND 1 +#define HAVE_ROUNDF 1 +#define HAVE_SCALBN 1 +#define HAVE_SCALBNF 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SQRTF 1 +#define HAVE_TAN 1 +#define HAVE_TANF 1 +#define HAVE_TRUNC 1 +#define HAVE_TRUNCF 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_SYSCTLBYNAME 1 + +#if defined(__has_include) && (defined(__i386__) || defined(__x86_64)) +# if __has_include() +# define HAVE_IMMINTRIN_H 1 +# endif +#endif + +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070) +#define HAVE_O_CLOEXEC 1 +#endif + +#define HAVE_GCC_ATOMICS 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_HIDAPI 1 +#define SDL_JOYSTICK_IOKIT 1 +#define SDL_JOYSTICK_VIRTUAL 1 +#define SDL_HAPTIC_IOKIT 1 + +/* The MFI controller support requires ARC Objective C runtime */ +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 && !defined(__i386__) +#define SDL_JOYSTICK_MFI 1 +#endif + +/* Enable the dummy sensor driver */ +#define SDL_SENSOR_DUMMY 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_COCOA 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 +#undef SDL_VIDEO_DRIVER_X11 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/opt/X11/lib/libX11.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/opt/X11/lib/libXext.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/opt/X11/lib/libXi.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/opt/X11/lib/libXrandr.2.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/opt/X11/lib/libXss.1.dylib" +#define SDL_VIDEO_DRIVER_X11_XDBE 1 +#define SDL_VIDEO_DRIVER_X11_XRANDR 1 +#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 +#define SDL_VIDEO_DRIVER_X11_XSHAPE 1 +#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 + +#ifdef MAC_OS_X_VERSION_10_8 +/* + * No matter the versions targeted, this is the 10.8 or later SDK, so you have + * to use the external Xquartz, which is a more modern Xlib. Previous SDKs + * used an older Xlib. + */ +#define SDL_VIDEO_DRIVER_X11_XINPUT2 1 +#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1 +#endif + +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif + +#ifndef SDL_VIDEO_RENDER_OGL_ES2 +#define SDL_VIDEO_RENDER_OGL_ES2 1 +#endif + +/* Metal only supported on 64-bit architectures with 10.11+ */ +#if TARGET_RT_64_BIT && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100) +#define SDL_PLATFORM_SUPPORTS_METAL 1 +#else +#define SDL_PLATFORM_SUPPORTS_METAL 0 +#endif + +#ifndef SDL_VIDEO_RENDER_METAL +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_RENDER_METAL 1 +#else +#define SDL_VIDEO_RENDER_METAL 0 +#endif +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_ES2 +#define SDL_VIDEO_OPENGL_ES2 1 +#endif +#ifndef SDL_VIDEO_OPENGL_EGL +#define SDL_VIDEO_OPENGL_EGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_CGL +#define SDL_VIDEO_OPENGL_CGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_GLX +#define SDL_VIDEO_OPENGL_GLX 1 +#endif + +/* Enable Vulkan and Metal support */ +#ifndef SDL_VIDEO_VULKAN +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_VULKAN 1 +#else +#define SDL_VIDEO_VULKAN 0 +#endif +#endif + +#ifndef SDL_VIDEO_METAL +#if SDL_PLATFORM_SUPPORTS_METAL +#define SDL_VIDEO_METAL 1 +#else +#define SDL_VIDEO_METAL 0 +#endif +#endif + +/* Enable system power support */ +#define SDL_POWER_MACOSX 1 + +/* enable filesystem support */ +#define SDL_FILESYSTEM_COCOA 1 + +/* Enable assembly routines */ +#ifdef __ppc__ +#define SDL_ALTIVEC_BLITTERS 1 +#endif + +#endif /* SDL_config_macosx_h_ */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_copying.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_copying.h new file mode 100644 index 00000000..b6028bab --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_copying.h @@ -0,0 +1,20 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_cpuinfo.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_cpuinfo.h new file mode 100644 index 00000000..900224db --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_cpuinfo.h @@ -0,0 +1,594 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_cpuinfo.h + * + * CPU feature detection for SDL. + */ + +#ifndef SDL_cpuinfo_h_ +#define SDL_cpuinfo_h_ + +#include + +/* Need to do this here because intrin.h has C++ code in it */ +/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ +#if defined(_MSC_VER) && (_MSC_VER >= 1500) && (defined(_M_IX86) || defined(_M_X64)) +#ifdef __clang__ +/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version, + so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */ + +#ifndef __PRFCHWINTRIN_H +#define __PRFCHWINTRIN_H + +static __inline__ void __attribute__((__always_inline__, __nodebug__)) +_m_prefetch(void *__P) +{ + __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */); +} + +#endif /* __PRFCHWINTRIN_H */ +#endif /* __clang__ */ +#include +#ifndef _WIN64 +#ifndef __MMX__ +#define __MMX__ +#endif +#ifndef __3dNOW__ +#define __3dNOW__ +#endif +#endif +#ifndef __SSE__ +#define __SSE__ +#endif +#ifndef __SSE2__ +#define __SSE2__ +#endif +#ifndef __SSE3__ +#define __SSE3__ +#endif +#elif defined(__MINGW64_VERSION_MAJOR) +#include +#if !defined(SDL_DISABLE_ARM_NEON_H) && defined(__ARM_NEON) +# include +#endif +#else +/* altivec.h redefining bool causes a number of problems, see bugs 3993 and 4392, so you need to explicitly define SDL_ENABLE_ALTIVEC_H to have it included. */ +#if defined(HAVE_ALTIVEC_H) && defined(__ALTIVEC__) && !defined(__APPLE_ALTIVEC__) && defined(SDL_ENABLE_ALTIVEC_H) +#include +#endif +#if !defined(SDL_DISABLE_ARM_NEON_H) +# if defined(__ARM_NEON) +# include +# elif defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__) +/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */ +# if defined(_M_ARM) +# include +# include +# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ +# endif +# if defined (_M_ARM64) +# include +# include +# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */ +# define __ARM_ARCH 8 +# endif +# endif +#endif +#endif /* compiler version */ + +#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H) +#include +#endif +#if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX_H) +#include +#define __LSX__ +#endif +#if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX_H) +#include +#define __LASX__ +#endif +#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H) +#include +#else +#if defined(__MMX__) && !defined(SDL_DISABLE_MMINTRIN_H) +#include +#endif +#if defined(__SSE__) && !defined(SDL_DISABLE_XMMINTRIN_H) +#include +#endif +#if defined(__SSE2__) && !defined(SDL_DISABLE_EMMINTRIN_H) +#include +#endif +#if defined(__SSE3__) && !defined(SDL_DISABLE_PMMINTRIN_H) +#include +#endif +#endif /* HAVE_IMMINTRIN_H */ + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* This is a guess for the cacheline size used for padding. + * Most x86 processors have a 64 byte cache line. + * The 64-bit PowerPC processors have a 128 byte cache line. + * We'll use the larger value to be generally safe. + */ +#define SDL_CACHELINE_SIZE 128 + +/** + * Get the number of CPU cores available. + * + * \returns the total number of logical CPU cores. On CPUs that include + * technologies such as hyperthreading, the number of logical cores + * may be more than the number of physical cores. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_GetCPUCount(void); + +/** + * Determine the L1 cache line size of the CPU. + * + * This is useful for determining multi-threaded structure padding or SIMD + * prefetch sizes. + * + * \returns the L1 cache line size of the CPU, in bytes. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void); + +/** + * Determine whether the CPU has the RDTSC instruction. + * + * This always returns false on CPUs that aren't using Intel instruction sets. + * + * \returns SDL_TRUE if the CPU has the RDTSC instruction or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Has3DNow + * \sa SDL_HasAltiVec + * \sa SDL_HasAVX + * \sa SDL_HasAVX2 + * \sa SDL_HasMMX + * \sa SDL_HasSSE + * \sa SDL_HasSSE2 + * \sa SDL_HasSSE3 + * \sa SDL_HasSSE41 + * \sa SDL_HasSSE42 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); + +/** + * Determine whether the CPU has AltiVec features. + * + * This always returns false on CPUs that aren't using PowerPC instruction + * sets. + * + * \returns SDL_TRUE if the CPU has AltiVec features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Has3DNow + * \sa SDL_HasAVX + * \sa SDL_HasAVX2 + * \sa SDL_HasMMX + * \sa SDL_HasRDTSC + * \sa SDL_HasSSE + * \sa SDL_HasSSE2 + * \sa SDL_HasSSE3 + * \sa SDL_HasSSE41 + * \sa SDL_HasSSE42 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); + +/** + * Determine whether the CPU has MMX features. + * + * This always returns false on CPUs that aren't using Intel instruction sets. + * + * \returns SDL_TRUE if the CPU has MMX features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Has3DNow + * \sa SDL_HasAltiVec + * \sa SDL_HasAVX + * \sa SDL_HasAVX2 + * \sa SDL_HasRDTSC + * \sa SDL_HasSSE + * \sa SDL_HasSSE2 + * \sa SDL_HasSSE3 + * \sa SDL_HasSSE41 + * \sa SDL_HasSSE42 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); + +/** + * Determine whether the CPU has 3DNow! features. + * + * This always returns false on CPUs that aren't using AMD instruction sets. + * + * \returns SDL_TRUE if the CPU has 3DNow! features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HasAltiVec + * \sa SDL_HasAVX + * \sa SDL_HasAVX2 + * \sa SDL_HasMMX + * \sa SDL_HasRDTSC + * \sa SDL_HasSSE + * \sa SDL_HasSSE2 + * \sa SDL_HasSSE3 + * \sa SDL_HasSSE41 + * \sa SDL_HasSSE42 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); + +/** + * Determine whether the CPU has SSE features. + * + * This always returns false on CPUs that aren't using Intel instruction sets. + * + * \returns SDL_TRUE if the CPU has SSE features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Has3DNow + * \sa SDL_HasAltiVec + * \sa SDL_HasAVX + * \sa SDL_HasAVX2 + * \sa SDL_HasMMX + * \sa SDL_HasRDTSC + * \sa SDL_HasSSE2 + * \sa SDL_HasSSE3 + * \sa SDL_HasSSE41 + * \sa SDL_HasSSE42 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); + +/** + * Determine whether the CPU has SSE2 features. + * + * This always returns false on CPUs that aren't using Intel instruction sets. + * + * \returns SDL_TRUE if the CPU has SSE2 features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Has3DNow + * \sa SDL_HasAltiVec + * \sa SDL_HasAVX + * \sa SDL_HasAVX2 + * \sa SDL_HasMMX + * \sa SDL_HasRDTSC + * \sa SDL_HasSSE + * \sa SDL_HasSSE3 + * \sa SDL_HasSSE41 + * \sa SDL_HasSSE42 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); + +/** + * Determine whether the CPU has SSE3 features. + * + * This always returns false on CPUs that aren't using Intel instruction sets. + * + * \returns SDL_TRUE if the CPU has SSE3 features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Has3DNow + * \sa SDL_HasAltiVec + * \sa SDL_HasAVX + * \sa SDL_HasAVX2 + * \sa SDL_HasMMX + * \sa SDL_HasRDTSC + * \sa SDL_HasSSE + * \sa SDL_HasSSE2 + * \sa SDL_HasSSE41 + * \sa SDL_HasSSE42 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); + +/** + * Determine whether the CPU has SSE4.1 features. + * + * This always returns false on CPUs that aren't using Intel instruction sets. + * + * \returns SDL_TRUE if the CPU has SSE4.1 features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Has3DNow + * \sa SDL_HasAltiVec + * \sa SDL_HasAVX + * \sa SDL_HasAVX2 + * \sa SDL_HasMMX + * \sa SDL_HasRDTSC + * \sa SDL_HasSSE + * \sa SDL_HasSSE2 + * \sa SDL_HasSSE3 + * \sa SDL_HasSSE42 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); + +/** + * Determine whether the CPU has SSE4.2 features. + * + * This always returns false on CPUs that aren't using Intel instruction sets. + * + * \returns SDL_TRUE if the CPU has SSE4.2 features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Has3DNow + * \sa SDL_HasAltiVec + * \sa SDL_HasAVX + * \sa SDL_HasAVX2 + * \sa SDL_HasMMX + * \sa SDL_HasRDTSC + * \sa SDL_HasSSE + * \sa SDL_HasSSE2 + * \sa SDL_HasSSE3 + * \sa SDL_HasSSE41 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); + +/** + * Determine whether the CPU has AVX features. + * + * This always returns false on CPUs that aren't using Intel instruction sets. + * + * \returns SDL_TRUE if the CPU has AVX features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_Has3DNow + * \sa SDL_HasAltiVec + * \sa SDL_HasAVX2 + * \sa SDL_HasMMX + * \sa SDL_HasRDTSC + * \sa SDL_HasSSE + * \sa SDL_HasSSE2 + * \sa SDL_HasSSE3 + * \sa SDL_HasSSE41 + * \sa SDL_HasSSE42 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX(void); + +/** + * Determine whether the CPU has AVX2 features. + * + * This always returns false on CPUs that aren't using Intel instruction sets. + * + * \returns SDL_TRUE if the CPU has AVX2 features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.4. + * + * \sa SDL_Has3DNow + * \sa SDL_HasAltiVec + * \sa SDL_HasAVX + * \sa SDL_HasMMX + * \sa SDL_HasRDTSC + * \sa SDL_HasSSE + * \sa SDL_HasSSE2 + * \sa SDL_HasSSE3 + * \sa SDL_HasSSE41 + * \sa SDL_HasSSE42 + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX2(void); + +/** + * Determine whether the CPU has AVX-512F (foundation) features. + * + * This always returns false on CPUs that aren't using Intel instruction sets. + * + * \returns SDL_TRUE if the CPU has AVX-512F features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.9. + * + * \sa SDL_HasAVX + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAVX512F(void); + +/** + * Determine whether the CPU has ARM SIMD (ARMv6) features. + * + * This is different from ARM NEON, which is a different instruction set. + * + * This always returns false on CPUs that aren't using ARM instruction sets. + * + * \returns SDL_TRUE if the CPU has ARM SIMD features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.12. + * + * \sa SDL_HasNEON + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void); + +/** + * Determine whether the CPU has NEON (ARM SIMD) features. + * + * This always returns false on CPUs that aren't using ARM instruction sets. + * + * \returns SDL_TRUE if the CPU has ARM NEON features or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void); + +/** + * Determine whether the CPU has LSX (LOONGARCH SIMD) features. + * + * This always returns false on CPUs that aren't using LOONGARCH instruction + * sets. + * + * \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if + * not. + * + * \since This function is available since SDL 2.24.0. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void); + +/** + * Determine whether the CPU has LASX (LOONGARCH SIMD) features. + * + * This always returns false on CPUs that aren't using LOONGARCH instruction + * sets. + * + * \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if + * not. + * + * \since This function is available since SDL 2.24.0. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void); + +/** + * Get the amount of RAM configured in the system. + * + * \returns the amount of RAM configured in the system in MiB. + * + * \since This function is available since SDL 2.0.1. + */ +extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void); + +/** + * Report the alignment this system needs for SIMD allocations. + * + * This will return the minimum number of bytes to which a pointer must be + * aligned to be compatible with SIMD instructions on the current machine. For + * example, if the machine supports SSE only, it will return 16, but if it + * supports AVX-512F, it'll return 64 (etc). This only reports values for + * instruction sets SDL knows about, so if your SDL build doesn't have + * SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and + * not 64 for the AVX-512 instructions that exist but SDL doesn't know about. + * Plan accordingly. + * + * \returns the alignment in bytes needed for available, known SIMD + * instructions. + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void); + +/** + * Allocate memory in a SIMD-friendly way. + * + * This will allocate a block of memory that is suitable for use with SIMD + * instructions. Specifically, it will be properly aligned and padded for the + * system's supported vector instructions. + * + * The memory returned will be padded such that it is safe to read or write an + * incomplete vector at the end of the memory block. This can be useful so you + * don't have to drop back to a scalar fallback at the end of your SIMD + * processing loop to deal with the final elements without overflowing the + * allocated buffer. + * + * You must free this memory with SDL_FreeSIMD(), not free() or SDL_free() or + * delete[], etc. + * + * Note that SDL will only deal with SIMD instruction sets it is aware of; for + * example, SDL 2.0.8 knows that SSE wants 16-byte vectors (SDL_HasSSE()), and + * AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't know that AVX-512 wants + * 64. To be clear: if you can't decide to use an instruction set with an + * SDL_Has*() function, don't use that instruction set with memory allocated + * through here. + * + * SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't + * out of memory, but you are not allowed to dereference it (because you only + * own zero bytes of that buffer). + * + * \param len The length, in bytes, of the block to allocate. The actual + * allocated block might be larger due to padding, etc. + * \returns a pointer to the newly-allocated block, NULL if out of memory. + * + * \since This function is available since SDL 2.0.10. + * + * \sa SDL_SIMDGetAlignment + * \sa SDL_SIMDRealloc + * \sa SDL_SIMDFree + */ +extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len); + +/** + * Reallocate memory obtained from SDL_SIMDAlloc + * + * It is not valid to use this function on a pointer from anything but + * SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc, + * SDL_malloc, memalign, new[], etc. + * + * \param mem The pointer obtained from SDL_SIMDAlloc. This function also + * accepts NULL, at which point this function is the same as + * calling SDL_SIMDAlloc with a NULL pointer. + * \param len The length, in bytes, of the block to allocated. The actual + * allocated block might be larger due to padding, etc. Passing 0 + * will return a non-NULL pointer, assuming the system isn't out of + * memory. + * \returns a pointer to the newly-reallocated block, NULL if out of memory. + * + * \since This function is available since SDL 2.0.14. + * + * \sa SDL_SIMDGetAlignment + * \sa SDL_SIMDAlloc + * \sa SDL_SIMDFree + */ +extern DECLSPEC void * SDLCALL SDL_SIMDRealloc(void *mem, const size_t len); + +/** + * Deallocate memory obtained from SDL_SIMDAlloc + * + * It is not valid to use this function on a pointer from anything but + * SDL_SIMDAlloc() or SDL_SIMDRealloc(). It can't be used on pointers from + * malloc, realloc, SDL_malloc, memalign, new[], etc. + * + * However, SDL_SIMDFree(NULL) is a legal no-op. + * + * The memory pointed to by `ptr` is no longer valid for access upon return, + * and may be returned to the system or reused by a future allocation. The + * pointer passed to this function is no longer safe to dereference once this + * function returns, and should be discarded. + * + * \param ptr The pointer, returned from SDL_SIMDAlloc or SDL_SIMDRealloc, to + * deallocate. NULL is a legal no-op. + * + * \since This function is available since SDL 2.0.10. + * + * \sa SDL_SIMDAlloc + * \sa SDL_SIMDRealloc + */ +extern DECLSPEC void SDLCALL SDL_SIMDFree(void *ptr); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_cpuinfo_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_endian.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_endian.h new file mode 100644 index 00000000..62f7ae49 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_endian.h @@ -0,0 +1,348 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_endian.h + * + * Functions for reading and writing endian-specific values + */ + +#ifndef SDL_endian_h_ +#define SDL_endian_h_ + +#include + +#if defined(_MSC_VER) && (_MSC_VER >= 1400) +/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version, + so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */ +#ifdef __clang__ +#ifndef __PRFCHWINTRIN_H +#define __PRFCHWINTRIN_H +static __inline__ void __attribute__((__always_inline__, __nodebug__)) +_m_prefetch(void *__P) +{ + __builtin_prefetch(__P, 0, 3 /* _MM_HINT_T0 */); +} +#endif /* __PRFCHWINTRIN_H */ +#endif /* __clang__ */ + +#include +#endif + +/** + * \name The two types of endianness + */ +/* @{ */ +#define SDL_LIL_ENDIAN 1234 +#define SDL_BIG_ENDIAN 4321 +/* @} */ + +#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#ifdef __linux__ +#include +#define SDL_BYTEORDER __BYTE_ORDER +#elif defined(__OpenBSD__) || defined(__DragonFly__) +#include +#define SDL_BYTEORDER BYTE_ORDER +#elif defined(__FreeBSD__) || defined(__NetBSD__) +#include +#define SDL_BYTEORDER BYTE_ORDER +/* predefs from newer gcc and clang versions: */ +#elif defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__BYTE_ORDER__) +#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#error Unsupported endianness +#endif /**/ +#else +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MIPSEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \ + defined(__sparc__) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#endif +#endif /* __linux__ */ +#endif /* !SDL_BYTEORDER */ + +#ifndef SDL_FLOATWORDORDER /* Not defined in SDL_config.h? */ +/* predefs from newer gcc versions: */ +#if defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__FLOAT_WORD_ORDER__) +#if (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__) +#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN +#elif (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__) +#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN +#else +#error Unsupported endianness +#endif /**/ +#elif defined(__MAVERICK__) +/* For Maverick, float words are always little-endian. */ +#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN +#elif (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) && !defined(__ARM_EABI__) +/* For FPA, float words are always big-endian. */ +#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN +#else +/* By default, assume that floats words follow the memory system mode. */ +#define SDL_FLOATWORDORDER SDL_BYTEORDER +#endif /* __FLOAT_WORD_ORDER__ */ +#endif /* !SDL_FLOATWORDORDER */ + + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_endian.h + */ + +/* various modern compilers may have builtin swap */ +#if defined(__GNUC__) || defined(__clang__) +# define HAS_BUILTIN_BSWAP16 (_SDL_HAS_BUILTIN(__builtin_bswap16)) || \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) +# define HAS_BUILTIN_BSWAP32 (_SDL_HAS_BUILTIN(__builtin_bswap32)) || \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) +# define HAS_BUILTIN_BSWAP64 (_SDL_HAS_BUILTIN(__builtin_bswap64)) || \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + + /* this one is broken */ +# define HAS_BROKEN_BSWAP (__GNUC__ == 2 && __GNUC_MINOR__ <= 95) +#else +# define HAS_BUILTIN_BSWAP16 0 +# define HAS_BUILTIN_BSWAP32 0 +# define HAS_BUILTIN_BSWAP64 0 +# define HAS_BROKEN_BSWAP 0 +#endif + +#if HAS_BUILTIN_BSWAP16 +#define SDL_Swap16(x) __builtin_bswap16(x) +#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL) +#pragma intrinsic(_byteswap_ushort) +#define SDL_Swap16(x) _byteswap_ushort(x) +#elif defined(__i386__) && !HAS_BROKEN_BSWAP +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); + return x; +} +#elif defined(__x86_64__) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); + return x; +} +#elif (defined(__powerpc__) || defined(__ppc__)) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + int result; + + __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); + return (Uint16)result; +} +#elif (defined(__m68k__) && !defined(__mcoldfire__)) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; +} +#elif defined(__WATCOMC__) && defined(__386__) +extern __inline Uint16 SDL_Swap16(Uint16); +#pragma aux SDL_Swap16 = \ + "xchg al, ah" \ + parm [ax] \ + modify [ax]; +#else +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + return SDL_static_cast(Uint16, ((x << 8) | (x >> 8))); +} +#endif + +#if HAS_BUILTIN_BSWAP32 +#define SDL_Swap32(x) __builtin_bswap32(x) +#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL) +#pragma intrinsic(_byteswap_ulong) +#define SDL_Swap32(x) _byteswap_ulong(x) +#elif defined(__i386__) && !HAS_BROKEN_BSWAP +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("bswap %0": "=r"(x):"0"(x)); + return x; +} +#elif defined(__x86_64__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("bswapl %0": "=r"(x):"0"(x)); + return x; +} +#elif (defined(__powerpc__) || defined(__ppc__)) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + Uint32 result; + + __asm__("rlwimi %0,%2,24,16,23": "=&r"(result): "0" (x>>24), "r"(x)); + __asm__("rlwimi %0,%2,8,8,15" : "=&r"(result): "0" (result), "r"(x)); + __asm__("rlwimi %0,%2,24,0,7" : "=&r"(result): "0" (result), "r"(x)); + return result; +} +#elif (defined(__m68k__) && !defined(__mcoldfire__)) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; +} +#elif defined(__WATCOMC__) && defined(__386__) +extern __inline Uint32 SDL_Swap32(Uint32); +#pragma aux SDL_Swap32 = \ + "bswap eax" \ + parm [eax] \ + modify [eax]; +#else +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) | + ((x >> 8) & 0x0000FF00) | (x >> 24))); +} +#endif + +#if HAS_BUILTIN_BSWAP64 +#define SDL_Swap64(x) __builtin_bswap64(x) +#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL) +#pragma intrinsic(_byteswap_uint64) +#define SDL_Swap64(x) _byteswap_uint64(x) +#elif defined(__i386__) && !HAS_BROKEN_BSWAP +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + union { + struct { + Uint32 a, b; + } s; + Uint64 u; + } v; + v.u = x; + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1" + : "=r"(v.s.a), "=r"(v.s.b) + : "0" (v.s.a), "1"(v.s.b)); + return v.u; +} +#elif defined(__x86_64__) +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + __asm__("bswapq %0": "=r"(x):"0"(x)); + return x; +} +#elif defined(__WATCOMC__) && defined(__386__) +extern __inline Uint64 SDL_Swap64(Uint64); +#pragma aux SDL_Swap64 = \ + "bswap eax" \ + "bswap edx" \ + "xchg eax,edx" \ + parm [eax edx] \ + modify [eax edx]; +#else +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + Uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x >>= 32; + hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x = SDL_Swap32(lo); + x <<= 32; + x |= SDL_Swap32(hi); + return (x); +} +#endif + + +SDL_FORCE_INLINE float +SDL_SwapFloat(float x) +{ + union { + float f; + Uint32 ui32; + } swapper; + swapper.f = x; + swapper.ui32 = SDL_Swap32(swapper.ui32); + return swapper.f; +} + +/* remove extra macros */ +#undef HAS_BROKEN_BSWAP +#undef HAS_BUILTIN_BSWAP16 +#undef HAS_BUILTIN_BSWAP32 +#undef HAS_BUILTIN_BSWAP64 + +/** + * \name Swap to native + * Byteswap item from the specified endianness to the native endianness. + */ +/* @{ */ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define SDL_SwapLE16(X) (X) +#define SDL_SwapLE32(X) (X) +#define SDL_SwapLE64(X) (X) +#define SDL_SwapFloatLE(X) (X) +#define SDL_SwapBE16(X) SDL_Swap16(X) +#define SDL_SwapBE32(X) SDL_Swap32(X) +#define SDL_SwapBE64(X) SDL_Swap64(X) +#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) +#else +#define SDL_SwapLE16(X) SDL_Swap16(X) +#define SDL_SwapLE32(X) SDL_Swap32(X) +#define SDL_SwapLE64(X) SDL_Swap64(X) +#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) +#define SDL_SwapBE16(X) (X) +#define SDL_SwapBE32(X) (X) +#define SDL_SwapBE64(X) (X) +#define SDL_SwapFloatBE(X) (X) +#endif +/* @} *//* Swap to native */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_endian_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_error.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_error.h new file mode 100644 index 00000000..0cf4f6d7 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_error.h @@ -0,0 +1,163 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_error.h + * + * Simple error message routines for SDL. + */ + +#ifndef SDL_error_h_ +#define SDL_error_h_ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Public functions */ + + +/** + * Set the SDL error message for the current thread. + * + * Calling this function will replace any previous error message that was set. + * + * This function always returns -1, since SDL frequently uses -1 to signify an + * failing result, leading to this idiom: + * + * ```c + * if (error_code) { + * return SDL_SetError("This operation has failed: %d", error_code); + * } + * ``` + * + * \param fmt a printf()-style message format string + * \param ... additional parameters matching % tokens in the `fmt` string, if + * any + * \returns always -1. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ClearError + * \sa SDL_GetError + */ +extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); + +/** + * Retrieve a message about the last error that occurred on the current + * thread. + * + * It is possible for multiple errors to occur before calling SDL_GetError(). + * Only the last error is returned. + * + * The message is only applicable when an SDL function has signaled an error. + * You must check the return values of SDL function calls to determine when to + * appropriately call SDL_GetError(). You should *not* use the results of + * SDL_GetError() to decide if an error has occurred! Sometimes SDL will set + * an error string even when reporting success. + * + * SDL will *not* clear the error string for successful API calls. You *must* + * check return values for failure cases before you can assume the error + * string applies. + * + * Error strings are set per-thread, so an error set in a different thread + * will not interfere with the current thread's operation. + * + * The returned string is internally allocated and must not be freed by the + * application. + * + * \returns a message with information about the specific error that occurred, + * or an empty string if there hasn't been an error message set since + * the last call to SDL_ClearError(). The message is only applicable + * when an SDL function has signaled an error. You must check the + * return values of SDL function calls to determine when to + * appropriately call SDL_GetError(). + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ClearError + * \sa SDL_SetError + */ +extern DECLSPEC const char *SDLCALL SDL_GetError(void); + +/** + * Get the last error message that was set for the current thread. + * + * This allows the caller to copy the error string into a provided buffer, but + * otherwise operates exactly the same as SDL_GetError(). + * + * \param errstr A buffer to fill with the last error message that was set for + * the current thread + * \param maxlen The size of the buffer pointed to by the errstr parameter + * \returns the pointer passed in as the `errstr` parameter. + * + * \since This function is available since SDL 2.0.14. + * + * \sa SDL_GetError + */ +extern DECLSPEC char * SDLCALL SDL_GetErrorMsg(char *errstr, int maxlen); + +/** + * Clear any previous error message for this thread. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetError + * \sa SDL_SetError + */ +extern DECLSPEC void SDLCALL SDL_ClearError(void); + +/** + * \name Internal error functions + * + * \internal + * Private error reporting function - used internally. + */ +/* @{ */ +#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) +#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) +typedef enum +{ + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR +} SDL_errorcode; +/* SDL_Error() unconditionally returns -1. */ +extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); +/* @} *//* Internal error functions */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_error_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_events.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_events.h new file mode 100644 index 00000000..9b2ca2a3 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_events.h @@ -0,0 +1,1166 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_events.h + * + * Include file for SDL event handling. + */ + +#ifndef SDL_events_h_ +#define SDL_events_h_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* General keyboard/mouse state definitions */ +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 + +/** + * The types of events that can be delivered. + */ +typedef enum +{ + SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ + + /* Application events */ + SDL_QUIT = 0x100, /**< User-requested quit */ + + /* These application events have special meaning on iOS, see README-ios.md for details */ + SDL_APP_TERMINATING, /**< The application is being terminated by the OS + Called on iOS in applicationWillTerminate() + Called on Android in onDestroy() + */ + SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible. + Called on iOS in applicationDidReceiveMemoryWarning() + Called on Android in onLowMemory() + */ + SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background + Called on iOS in applicationWillResignActive() + Called on Android in onPause() + */ + SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time + Called on iOS in applicationDidEnterBackground() + Called on Android in onPause() + */ + SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground + Called on iOS in applicationWillEnterForeground() + Called on Android in onResume() + */ + SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive + Called on iOS in applicationDidBecomeActive() + Called on Android in onResume() + */ + + SDL_LOCALECHANGED, /**< The user's locale preferences have changed. */ + + /* Display events */ + SDL_DISPLAYEVENT = 0x150, /**< Display state change */ + + /* Window events */ + SDL_WINDOWEVENT = 0x200, /**< Window state change */ + SDL_SYSWMEVENT, /**< System specific event */ + + /* Keyboard events */ + SDL_KEYDOWN = 0x300, /**< Key pressed */ + SDL_KEYUP, /**< Key released */ + SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ + SDL_TEXTINPUT, /**< Keyboard text input */ + SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an + input language or keyboard layout change. + */ + SDL_TEXTEDITING_EXT, /**< Extended keyboard text editing (composition) */ + + /* Mouse events */ + SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ + SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ + SDL_MOUSEBUTTONUP, /**< Mouse button released */ + SDL_MOUSEWHEEL, /**< Mouse wheel motion */ + + /* Joystick events */ + SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ + SDL_JOYBALLMOTION, /**< Joystick trackball motion */ + SDL_JOYHATMOTION, /**< Joystick hat position change */ + SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ + SDL_JOYBUTTONUP, /**< Joystick button released */ + SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */ + SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */ + SDL_JOYBATTERYUPDATED, /**< Joystick battery level change */ + + /* Game controller events */ + SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */ + SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */ + SDL_CONTROLLERBUTTONUP, /**< Game controller button released */ + SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ + SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ + SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ + SDL_CONTROLLERTOUCHPADDOWN, /**< Game controller touchpad was touched */ + SDL_CONTROLLERTOUCHPADMOTION, /**< Game controller touchpad finger was moved */ + SDL_CONTROLLERTOUCHPADUP, /**< Game controller touchpad finger was lifted */ + SDL_CONTROLLERSENSORUPDATE, /**< Game controller sensor was updated */ + + /* Touch events */ + SDL_FINGERDOWN = 0x700, + SDL_FINGERUP, + SDL_FINGERMOTION, + + /* Gesture events */ + SDL_DOLLARGESTURE = 0x800, + SDL_DOLLARRECORD, + SDL_MULTIGESTURE, + + /* Clipboard events */ + SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard or primary selection changed */ + + /* Drag and drop events */ + SDL_DROPFILE = 0x1000, /**< The system requests a file open */ + SDL_DROPTEXT, /**< text/plain drag-and-drop event */ + SDL_DROPBEGIN, /**< A new set of drops is beginning (NULL filename) */ + SDL_DROPCOMPLETE, /**< Current set of drops is now complete (NULL filename) */ + + /* Audio hotplug events */ + SDL_AUDIODEVICEADDED = 0x1100, /**< A new audio device is available */ + SDL_AUDIODEVICEREMOVED, /**< An audio device has been removed. */ + + /* Sensor events */ + SDL_SENSORUPDATE = 0x1200, /**< A sensor was updated */ + + /* Render events */ + SDL_RENDER_TARGETS_RESET = 0x2000, /**< The render targets have been reset and their contents need to be updated */ + SDL_RENDER_DEVICE_RESET, /**< The device has been reset and all textures need to be recreated */ + + /* Internal events */ + SDL_POLLSENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */ + + /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, + * and should be allocated with SDL_RegisterEvents() + */ + SDL_USEREVENT = 0x8000, + + /** + * This last event is only for bounding internal arrays + */ + SDL_LASTEVENT = 0xFFFF +} SDL_EventType; + +/** + * \brief Fields shared by every event + */ +typedef struct SDL_CommonEvent +{ + Uint32 type; + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ +} SDL_CommonEvent; + +/** + * \brief Display state change event data (event.display.*) + */ +typedef struct SDL_DisplayEvent +{ + Uint32 type; /**< ::SDL_DISPLAYEVENT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 display; /**< The associated display index */ + Uint8 event; /**< ::SDL_DisplayEventID */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint32 data1; /**< event dependent data */ +} SDL_DisplayEvent; + +/** + * \brief Window state change event data (event.window.*) + */ +typedef struct SDL_WindowEvent +{ + Uint32 type; /**< ::SDL_WINDOWEVENT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The associated window */ + Uint8 event; /**< ::SDL_WindowEventID */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint32 data1; /**< event dependent data */ + Sint32 data2; /**< event dependent data */ +} SDL_WindowEvent; + +/** + * \brief Keyboard button event structure (event.key.*) + */ +typedef struct SDL_KeyboardEvent +{ + Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with keyboard focus, if any */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 repeat; /**< Non-zero if this is a key repeat */ + Uint8 padding2; + Uint8 padding3; + SDL_Keysym keysym; /**< The key that was pressed or released */ +} SDL_KeyboardEvent; + +#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text editing event structure (event.edit.*) + */ +typedef struct SDL_TextEditingEvent +{ + Uint32 type; /**< ::SDL_TEXTEDITING */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with keyboard focus, if any */ + char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ + Sint32 start; /**< The start cursor of selected editing text */ + Sint32 length; /**< The length of selected editing text */ +} SDL_TextEditingEvent; + +/** + * \brief Extended keyboard text editing event structure (event.editExt.*) when text would be + * truncated if stored in the text buffer SDL_TextEditingEvent + */ +typedef struct SDL_TextEditingExtEvent +{ + Uint32 type; /**< ::SDL_TEXTEDITING_EXT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with keyboard focus, if any */ + char* text; /**< The editing text, which should be freed with SDL_free(), and will not be NULL */ + Sint32 start; /**< The start cursor of selected editing text */ + Sint32 length; /**< The length of selected editing text */ +} SDL_TextEditingExtEvent; + +#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text input event structure (event.text.*) + */ +typedef struct SDL_TextInputEvent +{ + Uint32 type; /**< ::SDL_TEXTINPUT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with keyboard focus, if any */ + char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ +} SDL_TextInputEvent; + +/** + * \brief Mouse motion event structure (event.motion.*) + */ +typedef struct SDL_MouseMotionEvent +{ + Uint32 type; /**< ::SDL_MOUSEMOTION */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Uint32 state; /**< The current button state */ + Sint32 x; /**< X coordinate, relative to window */ + Sint32 y; /**< Y coordinate, relative to window */ + Sint32 xrel; /**< The relative motion in the X direction */ + Sint32 yrel; /**< The relative motion in the Y direction */ +} SDL_MouseMotionEvent; + +/** + * \brief Mouse button event structure (event.button.*) + */ +typedef struct SDL_MouseButtonEvent +{ + Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Uint8 button; /**< The mouse button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 clicks; /**< 1 for single-click, 2 for double-click, etc. */ + Uint8 padding1; + Sint32 x; /**< X coordinate, relative to window */ + Sint32 y; /**< Y coordinate, relative to window */ +} SDL_MouseButtonEvent; + +/** + * \brief Mouse wheel event structure (event.wheel.*) + */ +typedef struct SDL_MouseWheelEvent +{ + Uint32 type; /**< ::SDL_MOUSEWHEEL */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ + Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ + Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */ + float preciseX; /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */ + float preciseY; /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */ + Sint32 mouseX; /**< X coordinate, relative to window (added in 2.26.0) */ + Sint32 mouseY; /**< Y coordinate, relative to window (added in 2.26.0) */ +} SDL_MouseWheelEvent; + +/** + * \brief Joystick axis motion event structure (event.jaxis.*) + */ +typedef struct SDL_JoyAxisEvent +{ + Uint32 type; /**< ::SDL_JOYAXISMOTION */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 axis; /**< The joystick axis index */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 value; /**< The axis value (range: -32768 to 32767) */ + Uint16 padding4; +} SDL_JoyAxisEvent; + +/** + * \brief Joystick trackball motion event structure (event.jball.*) + */ +typedef struct SDL_JoyBallEvent +{ + Uint32 type; /**< ::SDL_JOYBALLMOTION */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 ball; /**< The joystick trackball index */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_JoyBallEvent; + +/** + * \brief Joystick hat position change event structure (event.jhat.*) + */ +typedef struct SDL_JoyHatEvent +{ + Uint32 type; /**< ::SDL_JOYHATMOTION */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 hat; /**< The joystick hat index */ + Uint8 value; /**< The hat position value. + * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP + * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT + * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN + * + * Note that zero means the POV is centered. + */ + Uint8 padding1; + Uint8 padding2; +} SDL_JoyHatEvent; + +/** + * \brief Joystick button event structure (event.jbutton.*) + */ +typedef struct SDL_JoyButtonEvent +{ + Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 button; /**< The joystick button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; +} SDL_JoyButtonEvent; + +/** + * \brief Joystick device event structure (event.jdevice.*) + */ +typedef struct SDL_JoyDeviceEvent +{ + Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */ +} SDL_JoyDeviceEvent; + +/** + * \brief Joysick battery level change event structure (event.jbattery.*) + */ +typedef struct SDL_JoyBatteryEvent +{ + Uint32 type; /**< ::SDL_JOYBATTERYUPDATED */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + SDL_JoystickPowerLevel level; /**< The joystick battery level */ +} SDL_JoyBatteryEvent; + +/** + * \brief Game controller axis motion event structure (event.caxis.*) + */ +typedef struct SDL_ControllerAxisEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 value; /**< The axis value (range: -32768 to 32767) */ + Uint16 padding4; +} SDL_ControllerAxisEvent; + + +/** + * \brief Game controller button event structure (event.cbutton.*) + */ +typedef struct SDL_ControllerButtonEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 button; /**< The controller button (SDL_GameControllerButton) */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; +} SDL_ControllerButtonEvent; + + +/** + * \brief Controller device event structure (event.cdevice.*) + */ +typedef struct SDL_ControllerDeviceEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ +} SDL_ControllerDeviceEvent; + +/** + * \brief Game controller touchpad event structure (event.ctouchpad.*) + */ +typedef struct SDL_ControllerTouchpadEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Sint32 touchpad; /**< The index of the touchpad */ + Sint32 finger; /**< The index of the finger on the touchpad */ + float x; /**< Normalized in the range 0...1 with 0 being on the left */ + float y; /**< Normalized in the range 0...1 with 0 being at the top */ + float pressure; /**< Normalized in the range 0...1 */ +} SDL_ControllerTouchpadEvent; + +/** + * \brief Game controller sensor event structure (event.csensor.*) + */ +typedef struct SDL_ControllerSensorEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERSENSORUPDATE */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_JoystickID which; /**< The joystick instance id */ + Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */ + float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */ + Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */ +} SDL_ControllerSensorEvent; + +/** + * \brief Audio device event structure (event.adevice.*) + */ +typedef struct SDL_AudioDeviceEvent +{ + Uint32 type; /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 which; /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */ + Uint8 iscapture; /**< zero if an output device, non-zero if a capture device. */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; +} SDL_AudioDeviceEvent; + + +/** + * \brief Touch finger event structure (event.tfinger.*) + */ +typedef struct SDL_TouchFingerEvent +{ + Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_TouchID touchId; /**< The touch device id */ + SDL_FingerID fingerId; + float x; /**< Normalized in the range 0...1 */ + float y; /**< Normalized in the range 0...1 */ + float dx; /**< Normalized in the range -1...1 */ + float dy; /**< Normalized in the range -1...1 */ + float pressure; /**< Normalized in the range 0...1 */ + Uint32 windowID; /**< The window underneath the finger, if any */ +} SDL_TouchFingerEvent; + + +/** + * \brief Multiple Finger Gesture Event (event.mgesture.*) + */ +typedef struct SDL_MultiGestureEvent +{ + Uint32 type; /**< ::SDL_MULTIGESTURE */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_TouchID touchId; /**< The touch device id */ + float dTheta; + float dDist; + float x; + float y; + Uint16 numFingers; + Uint16 padding; +} SDL_MultiGestureEvent; + + +/** + * \brief Dollar Gesture Event (event.dgesture.*) + */ +typedef struct SDL_DollarGestureEvent +{ + Uint32 type; /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_TouchID touchId; /**< The touch device id */ + SDL_GestureID gestureId; + Uint32 numFingers; + float error; + float x; /**< Normalized center of gesture */ + float y; /**< Normalized center of gesture */ +} SDL_DollarGestureEvent; + + +/** + * \brief An event used to request a file open by the system (event.drop.*) + * This event is enabled by default, you can disable it with SDL_EventState(). + * \note If this event is enabled, you must free the filename in the event. + */ +typedef struct SDL_DropEvent +{ + Uint32 type; /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + char *file; /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */ + Uint32 windowID; /**< The window that was dropped on, if any */ +} SDL_DropEvent; + + +/** + * \brief Sensor event structure (event.sensor.*) + */ +typedef struct SDL_SensorEvent +{ + Uint32 type; /**< ::SDL_SENSORUPDATE */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Sint32 which; /**< The instance ID of the sensor */ + float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */ + Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */ +} SDL_SensorEvent; + +/** + * \brief The "quit requested" event + */ +typedef struct SDL_QuitEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ +} SDL_QuitEvent; + +/** + * \brief OS Specific event + */ +typedef struct SDL_OSEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ +} SDL_OSEvent; + +/** + * \brief A user-defined event type (event.user.*) + */ +typedef struct SDL_UserEvent +{ + Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + Uint32 windowID; /**< The associated window if any */ + Sint32 code; /**< User defined event code */ + void *data1; /**< User defined data pointer */ + void *data2; /**< User defined data pointer */ +} SDL_UserEvent; + + +struct SDL_SysWMmsg; +typedef struct SDL_SysWMmsg SDL_SysWMmsg; + +/** + * \brief A video driver dependent system event (event.syswm.*) + * This event is disabled by default, you can enable it with SDL_EventState() + * + * \note If you want to use this event, you should include SDL_syswm.h. + */ +typedef struct SDL_SysWMEvent +{ + Uint32 type; /**< ::SDL_SYSWMEVENT */ + Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */ + SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ +} SDL_SysWMEvent; + +/** + * \brief General event structure + */ +typedef union SDL_Event +{ + Uint32 type; /**< Event type, shared with all events */ + SDL_CommonEvent common; /**< Common event data */ + SDL_DisplayEvent display; /**< Display event data */ + SDL_WindowEvent window; /**< Window event data */ + SDL_KeyboardEvent key; /**< Keyboard event data */ + SDL_TextEditingEvent edit; /**< Text editing event data */ + SDL_TextEditingExtEvent editExt; /**< Extended text editing event data */ + SDL_TextInputEvent text; /**< Text input event data */ + SDL_MouseMotionEvent motion; /**< Mouse motion event data */ + SDL_MouseButtonEvent button; /**< Mouse button event data */ + SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ + SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ + SDL_JoyBallEvent jball; /**< Joystick ball event data */ + SDL_JoyHatEvent jhat; /**< Joystick hat event data */ + SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ + SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ + SDL_JoyBatteryEvent jbattery; /**< Joystick battery event data */ + SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ + SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ + SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ + SDL_ControllerTouchpadEvent ctouchpad; /**< Game Controller touchpad event data */ + SDL_ControllerSensorEvent csensor; /**< Game Controller sensor event data */ + SDL_AudioDeviceEvent adevice; /**< Audio device event data */ + SDL_SensorEvent sensor; /**< Sensor event data */ + SDL_QuitEvent quit; /**< Quit request event data */ + SDL_UserEvent user; /**< Custom event data */ + SDL_SysWMEvent syswm; /**< System dependent window event data */ + SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ + SDL_MultiGestureEvent mgesture; /**< Gesture event data */ + SDL_DollarGestureEvent dgesture; /**< Gesture event data */ + SDL_DropEvent drop; /**< Drag and drop event data */ + + /* This is necessary for ABI compatibility between Visual C++ and GCC. + Visual C++ will respect the push pack pragma and use 52 bytes (size of + SDL_TextEditingEvent, the largest structure for 32-bit and 64-bit + architectures) for this union, and GCC will use the alignment of the + largest datatype within the union, which is 8 bytes on 64-bit + architectures. + + So... we'll add padding to force the size to be 56 bytes for both. + + On architectures where pointers are 16 bytes, this needs rounding up to + the next multiple of 16, 64, and on architectures where pointers are + even larger the size of SDL_UserEvent will dominate as being 3 pointers. + */ + Uint8 padding[sizeof(void *) <= 8 ? 56 : sizeof(void *) == 16 ? 64 : 3 * sizeof(void *)]; +} SDL_Event; + +/* Make sure we haven't broken binary compatibility */ +SDL_COMPILE_TIME_ASSERT(SDL_Event, sizeof(SDL_Event) == sizeof(((SDL_Event *)NULL)->padding)); + + +/* Function prototypes */ + +/** + * Pump the event loop, gathering events from the input devices. + * + * This function updates the event queue and internal input device state. + * + * **WARNING**: This should only be run in the thread that initialized the + * video subsystem, and for extra safety, you should consider only doing those + * things on the main thread in any case. + * + * SDL_PumpEvents() gathers all the pending input information from devices and + * places it in the event queue. Without calls to SDL_PumpEvents() no events + * would ever be placed on the queue. Often the need for calls to + * SDL_PumpEvents() is hidden from the user since SDL_PollEvent() and + * SDL_WaitEvent() implicitly call SDL_PumpEvents(). However, if you are not + * polling or waiting for events (e.g. you are filtering them), then you must + * call SDL_PumpEvents() to force an event queue update. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_PollEvent + * \sa SDL_WaitEvent + */ +extern DECLSPEC void SDLCALL SDL_PumpEvents(void); + +/* @{ */ +typedef enum +{ + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT +} SDL_eventaction; + +/** + * Check the event queue for messages and optionally return them. + * + * `action` may be any of the following: + * + * - `SDL_ADDEVENT`: up to `numevents` events will be added to the back of the + * event queue. + * - `SDL_PEEKEVENT`: `numevents` events at the front of the event queue, + * within the specified minimum and maximum type, will be returned to the + * caller and will _not_ be removed from the queue. + * - `SDL_GETEVENT`: up to `numevents` events at the front of the event queue, + * within the specified minimum and maximum type, will be returned to the + * caller and will be removed from the queue. + * + * You may have to call SDL_PumpEvents() before calling this function. + * Otherwise, the events may not be ready to be filtered when you call + * SDL_PeepEvents(). + * + * This function is thread-safe. + * + * \param events destination buffer for the retrieved events + * \param numevents if action is SDL_ADDEVENT, the number of events to add + * back to the event queue; if action is SDL_PEEKEVENT or + * SDL_GETEVENT, the maximum number of events to retrieve + * \param action action to take; see [[#action|Remarks]] for details + * \param minType minimum value of the event type to be considered; + * SDL_FIRSTEVENT is a safe choice + * \param maxType maximum value of the event type to be considered; + * SDL_LASTEVENT is a safe choice + * \returns the number of events actually stored or a negative error code on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_PollEvent + * \sa SDL_PumpEvents + * \sa SDL_PushEvent + */ +extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, + SDL_eventaction action, + Uint32 minType, Uint32 maxType); +/* @} */ + +/** + * Check for the existence of a certain event type in the event queue. + * + * If you need to check for a range of event types, use SDL_HasEvents() + * instead. + * + * \param type the type of event to be queried; see SDL_EventType for details + * \returns SDL_TRUE if events matching `type` are present, or SDL_FALSE if + * events matching `type` are not present. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HasEvents + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); + + +/** + * Check for the existence of certain event types in the event queue. + * + * If you need to check for a single event type, use SDL_HasEvent() instead. + * + * \param minType the low end of event type to be queried, inclusive; see + * SDL_EventType for details + * \param maxType the high end of event type to be queried, inclusive; see + * SDL_EventType for details + * \returns SDL_TRUE if events with type >= `minType` and <= `maxType` are + * present, or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HasEvents + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); + +/** + * Clear events of a specific type from the event queue. + * + * This will unconditionally remove any events from the queue that match + * `type`. If you need to remove a range of event types, use SDL_FlushEvents() + * instead. + * + * It's also normal to just ignore events you don't care about in your event + * loop without calling this function. + * + * This function only affects currently queued events. If you want to make + * sure that all pending OS events are flushed, you can call SDL_PumpEvents() + * on the main thread immediately before the flush call. + * + * \param type the type of event to be cleared; see SDL_EventType for details + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FlushEvents + */ +extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); + +/** + * Clear events of a range of types from the event queue. + * + * This will unconditionally remove any events from the queue that are in the + * range of `minType` to `maxType`, inclusive. If you need to remove a single + * event type, use SDL_FlushEvent() instead. + * + * It's also normal to just ignore events you don't care about in your event + * loop without calling this function. + * + * This function only affects currently queued events. If you want to make + * sure that all pending OS events are flushed, you can call SDL_PumpEvents() + * on the main thread immediately before the flush call. + * + * \param minType the low end of event type to be cleared, inclusive; see + * SDL_EventType for details + * \param maxType the high end of event type to be cleared, inclusive; see + * SDL_EventType for details + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FlushEvent + */ +extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); + +/** + * Poll for currently pending events. + * + * If `event` is not NULL, the next event is removed from the queue and stored + * in the SDL_Event structure pointed to by `event`. The 1 returned refers to + * this event, immediately stored in the SDL Event structure -- not an event + * to follow. + * + * If `event` is NULL, it simply returns 1 if there is an event in the queue, + * but will not remove it from the queue. + * + * As this function may implicitly call SDL_PumpEvents(), you can only call + * this function in the thread that set the video mode. + * + * SDL_PollEvent() is the favored way of receiving system events since it can + * be done from the main loop and does not suspend the main loop while waiting + * on an event to be posted. + * + * The common practice is to fully process the event queue once every frame, + * usually as a first step before updating the game's state: + * + * ```c + * while (game_is_still_running) { + * SDL_Event event; + * while (SDL_PollEvent(&event)) { // poll until all events are handled! + * // decide what to do with this event. + * } + * + * // update game state, draw the current frame + * } + * ``` + * + * \param event the SDL_Event structure to be filled with the next event from + * the queue, or NULL + * \returns 1 if there is a pending event or 0 if there are none available. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetEventFilter + * \sa SDL_PeepEvents + * \sa SDL_PushEvent + * \sa SDL_SetEventFilter + * \sa SDL_WaitEvent + * \sa SDL_WaitEventTimeout + */ +extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); + +/** + * Wait indefinitely for the next available event. + * + * If `event` is not NULL, the next event is removed from the queue and stored + * in the SDL_Event structure pointed to by `event`. + * + * As this function may implicitly call SDL_PumpEvents(), you can only call + * this function in the thread that initialized the video subsystem. + * + * \param event the SDL_Event structure to be filled in with the next event + * from the queue, or NULL + * \returns 1 on success or 0 if there was an error while waiting for events; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_PollEvent + * \sa SDL_PumpEvents + * \sa SDL_WaitEventTimeout + */ +extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); + +/** + * Wait until the specified timeout (in milliseconds) for the next available + * event. + * + * If `event` is not NULL, the next event is removed from the queue and stored + * in the SDL_Event structure pointed to by `event`. + * + * As this function may implicitly call SDL_PumpEvents(), you can only call + * this function in the thread that initialized the video subsystem. + * + * \param event the SDL_Event structure to be filled in with the next event + * from the queue, or NULL + * \param timeout the maximum number of milliseconds to wait for the next + * available event + * \returns 1 on success or 0 if there was an error while waiting for events; + * call SDL_GetError() for more information. This also returns 0 if + * the timeout elapsed without an event arriving. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_PollEvent + * \sa SDL_PumpEvents + * \sa SDL_WaitEvent + */ +extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, + int timeout); + +/** + * Add an event to the event queue. + * + * The event queue can actually be used as a two way communication channel. + * Not only can events be read from the queue, but the user can also push + * their own events onto it. `event` is a pointer to the event structure you + * wish to push onto the queue. The event is copied into the queue, and the + * caller may dispose of the memory pointed to after SDL_PushEvent() returns. + * + * Note: Pushing device input events onto the queue doesn't modify the state + * of the device within SDL. + * + * This function is thread-safe, and can be called from other threads safely. + * + * Note: Events pushed onto the queue with SDL_PushEvent() get passed through + * the event filter but events added with SDL_PeepEvents() do not. + * + * For pushing application-specific events, please use SDL_RegisterEvents() to + * get an event type that does not conflict with other code that also wants + * its own custom event types. + * + * \param event the SDL_Event to be added to the queue + * \returns 1 on success, 0 if the event was filtered, or a negative error + * code on failure; call SDL_GetError() for more information. A + * common reason for error is the event queue being full. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_PeepEvents + * \sa SDL_PollEvent + * \sa SDL_RegisterEvents + */ +extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); + +/** + * A function pointer used for callbacks that watch the event queue. + * + * \param userdata what was passed as `userdata` to SDL_SetEventFilter() + * or SDL_AddEventWatch, etc + * \param event the event that triggered the callback + * \returns 1 to permit event to be added to the queue, and 0 to disallow + * it. When used with SDL_AddEventWatch, the return value is ignored. + * + * \sa SDL_SetEventFilter + * \sa SDL_AddEventWatch + */ +typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); + +/** + * Set up a filter to process all events before they change internal state and + * are posted to the internal event queue. + * + * If the filter function returns 1 when called, then the event will be added + * to the internal queue. If it returns 0, then the event will be dropped from + * the queue, but the internal state will still be updated. This allows + * selective filtering of dynamically arriving events. + * + * **WARNING**: Be very careful of what you do in the event filter function, + * as it may run in a different thread! + * + * On platforms that support it, if the quit event is generated by an + * interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the + * application at the next event poll. + * + * There is one caveat when dealing with the ::SDL_QuitEvent event type. The + * event filter is only called when the window manager desires to close the + * application window. If the event filter returns 1, then the window will be + * closed, otherwise the window will remain open if possible. + * + * Note: Disabled events never make it to the event filter function; see + * SDL_EventState(). + * + * Note: If you just want to inspect events without filtering, you should use + * SDL_AddEventWatch() instead. + * + * Note: Events pushed onto the queue with SDL_PushEvent() get passed through + * the event filter, but events pushed onto the queue with SDL_PeepEvents() do + * not. + * + * \param filter An SDL_EventFilter function to call when an event happens + * \param userdata a pointer that is passed to `filter` + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AddEventWatch + * \sa SDL_EventState + * \sa SDL_GetEventFilter + * \sa SDL_PeepEvents + * \sa SDL_PushEvent + */ +extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, + void *userdata); + +/** + * Query the current event filter. + * + * This function can be used to "chain" filters, by saving the existing filter + * before replacing it with a function that will call that saved filter. + * + * \param filter the current callback function will be stored here + * \param userdata the pointer that is passed to the current event filter will + * be stored here + * \returns SDL_TRUE on success or SDL_FALSE if there is no event filter set. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetEventFilter + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, + void **userdata); + +/** + * Add a callback to be triggered when an event is added to the event queue. + * + * `filter` will be called when an event happens, and its return value is + * ignored. + * + * **WARNING**: Be very careful of what you do in the event filter function, + * as it may run in a different thread! + * + * If the quit event is generated by a signal (e.g. SIGINT), it will bypass + * the internal queue and be delivered to the watch callback immediately, and + * arrive at the next event poll. + * + * Note: the callback is called for events posted by the user through + * SDL_PushEvent(), but not for disabled events, nor for events by a filter + * callback set with SDL_SetEventFilter(), nor for events posted by the user + * through SDL_PeepEvents(). + * + * \param filter an SDL_EventFilter function to call when an event happens. + * \param userdata a pointer that is passed to `filter` + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_DelEventWatch + * \sa SDL_SetEventFilter + */ +extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, + void *userdata); + +/** + * Remove an event watch callback added with SDL_AddEventWatch(). + * + * This function takes the same input as SDL_AddEventWatch() to identify and + * delete the corresponding callback. + * + * \param filter the function originally passed to SDL_AddEventWatch() + * \param userdata the pointer originally passed to SDL_AddEventWatch() + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AddEventWatch + */ +extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, + void *userdata); + +/** + * Run a specific filter function on the current event queue, removing any + * events for which the filter returns 0. + * + * See SDL_SetEventFilter() for more information. Unlike SDL_SetEventFilter(), + * this function does not change the filter permanently, it only uses the + * supplied filter until this function returns. + * + * \param filter the SDL_EventFilter function to call when an event happens + * \param userdata a pointer that is passed to `filter` + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetEventFilter + * \sa SDL_SetEventFilter + */ +extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, + void *userdata); + +/* @{ */ +#define SDL_QUERY -1 +#define SDL_IGNORE 0 +#define SDL_DISABLE 0 +#define SDL_ENABLE 1 + +/** + * Set the state of processing events by type. + * + * `state` may be any of the following: + * + * - `SDL_QUERY`: returns the current processing state of the specified event + * - `SDL_IGNORE` (aka `SDL_DISABLE`): the event will automatically be dropped + * from the event queue and will not be filtered + * - `SDL_ENABLE`: the event will be processed normally + * + * \param type the type of event; see SDL_EventType for details + * \param state how to process the event + * \returns `SDL_DISABLE` or `SDL_ENABLE`, representing the processing state + * of the event before this function makes any changes to it. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetEventState + */ +extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); +/* @} */ +#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY) + +/** + * Allocate a set of user-defined events, and return the beginning event + * number for that set of events. + * + * Calling this function with `numevents` <= 0 is an error and will return + * (Uint32)-1. + * + * Note, (Uint32)-1 means the maximum unsigned 32-bit integer value (or + * 0xFFFFFFFF), but is clearer to write. + * + * \param numevents the number of events to be allocated + * \returns the beginning event number, or (Uint32)-1 if there are not enough + * user-defined events left. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_PushEvent + */ +extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_events_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_filesystem.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_filesystem.h new file mode 100644 index 00000000..3c3b5336 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_filesystem.h @@ -0,0 +1,149 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_filesystem.h + * + * \brief Include file for filesystem SDL API functions + */ + +#ifndef SDL_filesystem_h_ +#define SDL_filesystem_h_ + +#include + +#include + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Get the directory where the application was run from. + * + * This is not necessarily a fast call, so you should call this once near + * startup and save the string if you need it. + * + * **Mac OS X and iOS Specific Functionality**: If the application is in a + * ".app" bundle, this function returns the Resource directory (e.g. + * MyApp.app/Contents/Resources/). This behaviour can be overridden by adding + * a property to the Info.plist file. Adding a string key with the name + * SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the + * behaviour. + * + * Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an + * application in /Applications/SDLApp/MyApp.app): + * + * - `resource`: bundle resource directory (the default). For example: + * `/Applications/SDLApp/MyApp.app/Contents/Resources` + * - `bundle`: the Bundle directory. For example: + * `/Applications/SDLApp/MyApp.app/` + * - `parent`: the containing directory of the bundle. For example: + * `/Applications/SDLApp/` + * + * **Nintendo 3DS Specific Functionality**: This function returns "romfs" + * directory of the application as it is uncommon to store resources outside + * the executable. As such it is not a writable directory. + * + * The returned path is guaranteed to end with a path separator ('\' on + * Windows, '/' on most other platforms). + * + * The pointer returned is owned by the caller. Please call SDL_free() on the + * pointer when done with it. + * + * \returns an absolute path in UTF-8 encoding to the application data + * directory. NULL will be returned on error or when the platform + * doesn't implement this functionality, call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.1. + * + * \sa SDL_GetPrefPath + */ +extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); + +/** + * Get the user-and-app-specific path where files can be written. + * + * Get the "pref dir". This is meant to be where users can write personal + * files (preferences and save games, etc) that are specific to your + * application. This directory is unique per user, per application. + * + * This function will decide the appropriate location in the native + * filesystem, create the directory if necessary, and return a string of the + * absolute path to the directory in UTF-8 encoding. + * + * On Windows, the string might look like: + * + * `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\` + * + * On Linux, the string might look like: + * + * `/home/bob/.local/share/My Program Name/` + * + * On Mac OS X, the string might look like: + * + * `/Users/bob/Library/Application Support/My Program Name/` + * + * You should assume the path returned by this function is the only safe place + * to write files (and that SDL_GetBasePath(), while it might be writable, or + * even the parent of the returned path, isn't where you should be writing + * things). + * + * Both the org and app strings may become part of a directory name, so please + * follow these rules: + * + * - Try to use the same org string (_including case-sensitivity_) for all + * your applications that use this function. + * - Always use a unique app string for each one, and make sure it never + * changes for an app once you've decided on it. + * - Unicode characters are legal, as long as it's UTF-8 encoded, but... + * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game + * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. + * + * The returned path is guaranteed to end with a path separator ('\' on + * Windows, '/' on most other platforms). + * + * The pointer returned is owned by the caller. Please call SDL_free() on the + * pointer when done with it. + * + * \param org the name of your organization + * \param app the name of your application + * \returns a UTF-8 string of the user directory in platform-dependent + * notation. NULL if there's a problem (creating directory failed, + * etc.). + * + * \since This function is available since SDL 2.0.1. + * + * \sa SDL_GetBasePath + */ +extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_filesystem_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_gamecontroller.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_gamecontroller.h new file mode 100644 index 00000000..266e7067 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_gamecontroller.h @@ -0,0 +1,1074 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_gamecontroller.h + * + * Include file for SDL game controller event handling + */ + +#ifndef SDL_gamecontroller_h_ +#define SDL_gamecontroller_h_ + +#include +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_gamecontroller.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_GAMECONTROLLER flag. This causes SDL to scan the system + * for game controllers, and load appropriate drivers. + * + * If you would like to receive controller updates while the application + * is in the background, you should set the following hint before calling + * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS + */ + +/** + * The gamecontroller structure used to identify an SDL game controller + */ +struct _SDL_GameController; +typedef struct _SDL_GameController SDL_GameController; + +typedef enum +{ + SDL_CONTROLLER_TYPE_UNKNOWN = 0, + SDL_CONTROLLER_TYPE_XBOX360, + SDL_CONTROLLER_TYPE_XBOXONE, + SDL_CONTROLLER_TYPE_PS3, + SDL_CONTROLLER_TYPE_PS4, + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO, + SDL_CONTROLLER_TYPE_VIRTUAL, + SDL_CONTROLLER_TYPE_PS5, + SDL_CONTROLLER_TYPE_AMAZON_LUNA, + SDL_CONTROLLER_TYPE_GOOGLE_STADIA, + SDL_CONTROLLER_TYPE_NVIDIA_SHIELD, + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT, + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT, + SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR +} SDL_GameControllerType; + +typedef enum +{ + SDL_CONTROLLER_BINDTYPE_NONE = 0, + SDL_CONTROLLER_BINDTYPE_BUTTON, + SDL_CONTROLLER_BINDTYPE_AXIS, + SDL_CONTROLLER_BINDTYPE_HAT +} SDL_GameControllerBindType; + +/** + * Get the SDL joystick layer binding for this controller button/axis mapping + */ +typedef struct SDL_GameControllerButtonBind +{ + SDL_GameControllerBindType bindType; + union + { + int button; + int axis; + struct { + int hat; + int hat_mask; + } hat; + } value; + +} SDL_GameControllerButtonBind; + + +/** + * To count the number of game controllers in the system for the following: + * + * ```c + * int nJoysticks = SDL_NumJoysticks(); + * int nGameControllers = 0; + * for (int i = 0; i < nJoysticks; i++) { + * if (SDL_IsGameController(i)) { + * nGameControllers++; + * } + * } + * ``` + * + * Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is: + * guid,name,mappings + * + * Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones. + * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices. + * The mapping format for joystick is: + * bX - a joystick button, index X + * hX.Y - hat X with value Y + * aX - axis X of the joystick + * Buttons can be used as a controller axis and vice versa. + * + * This string shows an example of a valid mapping for a controller + * + * ```c + * "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7", + * ``` + */ + +/** + * Load a set of Game Controller mappings from a seekable SDL data stream. + * + * You can call this function several times, if needed, to load different + * database files. + * + * If a new mapping is loaded for an already known controller GUID, the later + * version will overwrite the one currently loaded. + * + * Mappings not belonging to the current platform or with no platform field + * specified will be ignored (i.e. mappings for Linux will be ignored in + * Windows, etc). + * + * This function will load the text database entirely in memory before + * processing it, so take this into consideration if you are in a memory + * constrained environment. + * + * \param rw the data stream for the mappings to be added + * \param freerw non-zero to close the stream after being read + * \returns the number of mappings added or -1 on error; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_GameControllerAddMapping + * \sa SDL_GameControllerAddMappingsFromFile + * \sa SDL_GameControllerMappingForGUID + */ +extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw); + +/** + * Load a set of mappings from a file, filtered by the current SDL_GetPlatform() + * + * Convenience macro. + */ +#define SDL_GameControllerAddMappingsFromFile(file) SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Add support for controllers that SDL is unaware of or to cause an existing + * controller to have a different binding. + * + * The mapping string has the format "GUID,name,mapping", where GUID is the + * string value from SDL_JoystickGetGUIDString(), name is the human readable + * string for the device and mappings are controller mappings to joystick + * ones. Under Windows there is a reserved GUID of "xinput" that covers all + * XInput devices. The mapping format for joystick is: {| |bX |a joystick + * button, index X |- |hX.Y |hat X with value Y |- |aX |axis X of the joystick + * |} Buttons can be used as a controller axes and vice versa. + * + * This string shows an example of a valid mapping for a controller: + * + * ```c + * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7" + * ``` + * + * \param mappingString the mapping string + * \returns 1 if a new mapping is added, 0 if an existing mapping is updated, + * -1 on error; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerMapping + * \sa SDL_GameControllerMappingForGUID + */ +extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping(const char* mappingString); + +/** + * Get the number of mappings installed. + * + * \returns the number of mappings. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerNumMappings(void); + +/** + * Get the mapping at a particular index. + * + * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if + * the index is out of range. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForIndex(int mapping_index); + +/** + * Get the game controller mapping string for a given GUID. + * + * The returned string must be freed with SDL_free(). + * + * \param guid a structure containing the GUID for which a mapping is desired + * \returns a mapping string or NULL on error; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickGetDeviceGUID + * \sa SDL_JoystickGetGUID + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID guid); + +/** + * Get the current mapping of a Game Controller. + * + * The returned string must be freed with SDL_free(). + * + * Details about mappings are discussed with SDL_GameControllerAddMapping(). + * + * \param gamecontroller the game controller you want to get the current + * mapping for + * \returns a string that has the controller's mapping or NULL if no mapping + * is available; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerAddMapping + * \sa SDL_GameControllerMappingForGUID + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller); + +/** + * Check if the given joystick is supported by the game controller interface. + * + * `joystick_index` is the same as the `device_index` passed to + * SDL_JoystickOpen(). + * + * \param joystick_index the device_index of a device, up to + * SDL_NumJoysticks() + * \returns SDL_TRUE if the given joystick is supported by the game controller + * interface, SDL_FALSE if it isn't or it's an invalid index. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerNameForIndex + * \sa SDL_GameControllerOpen + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); + +/** + * Get the implementation dependent name for the game controller. + * + * This function can be called before any controllers are opened. + * + * `joystick_index` is the same as the `device_index` passed to + * SDL_JoystickOpen(). + * + * \param joystick_index the device_index of a device, from zero to + * SDL_NumJoysticks()-1 + * \returns the implementation-dependent name for the game controller, or NULL + * if there is no name or the index is invalid. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerName + * \sa SDL_GameControllerOpen + * \sa SDL_IsGameController + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); + +/** + * Get the implementation dependent path for the game controller. + * + * This function can be called before any controllers are opened. + * + * `joystick_index` is the same as the `device_index` passed to + * SDL_JoystickOpen(). + * + * \param joystick_index the device_index of a device, from zero to + * SDL_NumJoysticks()-1 + * \returns the implementation-dependent path for the game controller, or NULL + * if there is no path or the index is invalid. + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_GameControllerPath + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_index); + +/** + * Get the type of a game controller. + * + * This can be called before any controllers are opened. + * + * \param joystick_index the device_index of a device, from zero to + * SDL_NumJoysticks()-1 + * \returns the controller type. + * + * \since This function is available since SDL 2.0.12. + */ +extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index); + +/** + * Get the mapping of a game controller. + * + * This can be called before any controllers are opened. + * + * \param joystick_index the device_index of a device, from zero to + * SDL_NumJoysticks()-1 + * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if + * no mapping is available. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC char *SDLCALL SDL_GameControllerMappingForDeviceIndex(int joystick_index); + +/** + * Open a game controller for use. + * + * `joystick_index` is the same as the `device_index` passed to + * SDL_JoystickOpen(). + * + * The index passed as an argument refers to the N'th game controller on the + * system. This index is not the value which will identify this controller in + * future controller events. The joystick's instance id (SDL_JoystickID) will + * be used there instead. + * + * \param joystick_index the device_index of a device, up to + * SDL_NumJoysticks() + * \returns a gamecontroller identifier or NULL if an error occurred; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerClose + * \sa SDL_GameControllerNameForIndex + * \sa SDL_IsGameController + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index); + +/** + * Get the SDL_GameController associated with an instance id. + * + * \param joyid the instance id to get the SDL_GameController for + * \returns an SDL_GameController on success or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.4. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid); + +/** + * Get the SDL_GameController associated with a player index. + * + * Please note that the player index is _not_ the device index, nor is it the + * instance id! + * + * \param player_index the player index, which is not the device index or the + * instance id! + * \returns the SDL_GameController associated with a player index. + * + * \since This function is available since SDL 2.0.12. + * + * \sa SDL_GameControllerGetPlayerIndex + * \sa SDL_GameControllerSetPlayerIndex + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index); + +/** + * Get the implementation-dependent name for an opened game controller. + * + * This is the same name as returned by SDL_GameControllerNameForIndex(), but + * it takes a controller identifier instead of the (unstable) device index. + * + * \param gamecontroller a game controller identifier previously returned by + * SDL_GameControllerOpen() + * \returns the implementation dependent name for the game controller, or NULL + * if there is no name or the identifier passed is invalid. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerNameForIndex + * \sa SDL_GameControllerOpen + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); + +/** + * Get the implementation-dependent path for an opened game controller. + * + * This is the same path as returned by SDL_GameControllerNameForIndex(), but + * it takes a controller identifier instead of the (unstable) device index. + * + * \param gamecontroller a game controller identifier previously returned by + * SDL_GameControllerOpen() + * \returns the implementation dependent path for the game controller, or NULL + * if there is no path or the identifier passed is invalid. + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_GameControllerPathForIndex + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerPath(SDL_GameController *gamecontroller); + +/** + * Get the type of this currently opened controller + * + * This is the same name as returned by SDL_GameControllerTypeForIndex(), but + * it takes a controller identifier instead of the (unstable) device index. + * + * \param gamecontroller the game controller object to query. + * \returns the controller type. + * + * \since This function is available since SDL 2.0.12. + */ +extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller); + +/** + * Get the player index of an opened game controller. + * + * For XInput controllers this returns the XInput user index. + * + * \param gamecontroller the game controller object to query. + * \returns the player index for controller, or -1 if it's not available. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller); + +/** + * Set the player index of an opened game controller. + * + * \param gamecontroller the game controller object to adjust. + * \param player_index Player index to assign to this controller, or -1 to + * clear the player index and turn off player LEDs. + * + * \since This function is available since SDL 2.0.12. + */ +extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index); + +/** + * Get the USB vendor ID of an opened controller, if available. + * + * If the vendor ID isn't available this function returns 0. + * + * \param gamecontroller the game controller object to query. + * \return the USB vendor ID, or zero if unavailable. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller); + +/** + * Get the USB product ID of an opened controller, if available. + * + * If the product ID isn't available this function returns 0. + * + * \param gamecontroller the game controller object to query. + * \return the USB product ID, or zero if unavailable. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller); + +/** + * Get the product version of an opened controller, if available. + * + * If the product version isn't available this function returns 0. + * + * \param gamecontroller the game controller object to query. + * \return the USB product version, or zero if unavailable. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller); + +/** + * Get the firmware version of an opened controller, if available. + * + * If the firmware version isn't available this function returns 0. + * + * \param gamecontroller the game controller object to query. + * \return the controller firmware version, or zero if unavailable. + * + * \since This function is available since SDL 2.24.0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller); + +/** + * Get the serial number of an opened controller, if available. + * + * Returns the serial number of the controller, or NULL if it is not + * available. + * + * \param gamecontroller the game controller object to query. + * \return the serial number, or NULL if unavailable. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller); + +/** + * Check if a controller has been opened and is currently connected. + * + * \param gamecontroller a game controller identifier previously returned by + * SDL_GameControllerOpen() + * \returns SDL_TRUE if the controller has been opened and is currently + * connected, or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerClose + * \sa SDL_GameControllerOpen + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller); + +/** + * Get the Joystick ID from a Game Controller. + * + * This function will give you a SDL_Joystick object, which allows you to use + * the SDL_Joystick functions with a SDL_GameController object. This would be + * useful for getting a joystick's position at any given time, even if it + * hasn't moved (moving it would produce an event, which would have the axis' + * value). + * + * The pointer returned is owned by the SDL_GameController. You should not + * call SDL_JoystickClose() on it, for example, since doing so will likely + * cause SDL to crash. + * + * \param gamecontroller the game controller object that you want to get a + * joystick from + * \returns a SDL_Joystick object; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller); + +/** + * Query or change current state of Game Controller events. + * + * If controller events are disabled, you must call SDL_GameControllerUpdate() + * yourself and check the state of the controller when you want controller + * information. + * + * Any number can be passed to SDL_GameControllerEventState(), but only -1, 0, + * and 1 will have any effect. Other numbers will just be returned. + * + * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE` + * \returns the same value passed to the function, with exception to -1 + * (SDL_QUERY), which will return the current state. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickEventState + */ +extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state); + +/** + * Manually pump game controller updates if not using the loop. + * + * This function is called automatically by the event loop if events are + * enabled. Under such circumstances, it will not be necessary to call this + * function. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); + + +/** + * The list of axes available from a controller + * + * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX, + * and are centered within ~8000 of zero, though advanced UI will allow users to set + * or autodetect the dead zone, which varies between controllers. + * + * Trigger axis values range from 0 to SDL_JOYSTICK_AXIS_MAX. + */ +typedef enum +{ + SDL_CONTROLLER_AXIS_INVALID = -1, + SDL_CONTROLLER_AXIS_LEFTX, + SDL_CONTROLLER_AXIS_LEFTY, + SDL_CONTROLLER_AXIS_RIGHTX, + SDL_CONTROLLER_AXIS_RIGHTY, + SDL_CONTROLLER_AXIS_TRIGGERLEFT, + SDL_CONTROLLER_AXIS_TRIGGERRIGHT, + SDL_CONTROLLER_AXIS_MAX +} SDL_GameControllerAxis; + +/** + * Convert a string into SDL_GameControllerAxis enum. + * + * This function is called internally to translate SDL_GameController mapping + * strings for the underlying joystick device into the consistent + * SDL_GameController mapping. You do not normally need to call this function + * unless you are parsing SDL_GameController mappings in your own code. + * + * Note specially that "righttrigger" and "lefttrigger" map to + * `SDL_CONTROLLER_AXIS_TRIGGERRIGHT` and `SDL_CONTROLLER_AXIS_TRIGGERLEFT`, + * respectively. + * + * \param str string representing a SDL_GameController axis + * \returns the SDL_GameControllerAxis enum corresponding to the input string, + * or `SDL_CONTROLLER_AXIS_INVALID` if no match was found. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerGetStringForAxis + */ +extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *str); + +/** + * Convert from an SDL_GameControllerAxis enum to a string. + * + * The caller should not SDL_free() the returned string. + * + * \param axis an enum value for a given SDL_GameControllerAxis + * \returns a string for the given axis, or NULL if an invalid axis is + * specified. The string returned is of the format used by + * SDL_GameController mapping strings. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerGetAxisFromString + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis); + +/** + * Get the SDL joystick layer binding for a controller axis mapping. + * + * \param gamecontroller a game controller + * \param axis an axis enum value (one of the SDL_GameControllerAxis values) + * \returns a SDL_GameControllerButtonBind describing the bind. On failure + * (like the given Controller axis doesn't exist on the device), its + * `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerGetBindForButton + */ +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL +SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, + SDL_GameControllerAxis axis); + +/** + * Query whether a game controller has a given axis. + * + * This merely reports whether the controller's mapping defined this axis, as + * that is all the information SDL has about the physical device. + * + * \param gamecontroller a game controller + * \param axis an axis enum value (an SDL_GameControllerAxis value) + * \returns SDL_TRUE if the controller has this axis, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC SDL_bool SDLCALL +SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); + +/** + * Get the current state of an axis control on a game controller. + * + * The axis indices start at index 0. + * + * The state is a value ranging from -32768 to 32767. Triggers, however, range + * from 0 to 32767 (they never return a negative value). + * + * \param gamecontroller a game controller + * \param axis an axis index (one of the SDL_GameControllerAxis values) + * \returns axis state (including 0) on success or 0 (also) on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerGetButton + */ +extern DECLSPEC Sint16 SDLCALL +SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); + +/** + * The list of buttons available from a controller + */ +typedef enum +{ + SDL_CONTROLLER_BUTTON_INVALID = -1, + SDL_CONTROLLER_BUTTON_A, + SDL_CONTROLLER_BUTTON_B, + SDL_CONTROLLER_BUTTON_X, + SDL_CONTROLLER_BUTTON_Y, + SDL_CONTROLLER_BUTTON_BACK, + SDL_CONTROLLER_BUTTON_GUIDE, + SDL_CONTROLLER_BUTTON_START, + SDL_CONTROLLER_BUTTON_LEFTSTICK, + SDL_CONTROLLER_BUTTON_RIGHTSTICK, + SDL_CONTROLLER_BUTTON_LEFTSHOULDER, + SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, + SDL_CONTROLLER_BUTTON_DPAD_UP, + SDL_CONTROLLER_BUTTON_DPAD_DOWN, + SDL_CONTROLLER_BUTTON_DPAD_LEFT, + SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */ + SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 (upper left, facing the back) */ + SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 (upper right, facing the back) */ + SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 (lower left, facing the back) */ + SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 (lower right, facing the back) */ + SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */ + SDL_CONTROLLER_BUTTON_MAX +} SDL_GameControllerButton; + +/** + * Convert a string into an SDL_GameControllerButton enum. + * + * This function is called internally to translate SDL_GameController mapping + * strings for the underlying joystick device into the consistent + * SDL_GameController mapping. You do not normally need to call this function + * unless you are parsing SDL_GameController mappings in your own code. + * + * \param str string representing a SDL_GameController axis + * \returns the SDL_GameControllerButton enum corresponding to the input + * string, or `SDL_CONTROLLER_AXIS_INVALID` if no match was found. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *str); + +/** + * Convert from an SDL_GameControllerButton enum to a string. + * + * The caller should not SDL_free() the returned string. + * + * \param button an enum value for a given SDL_GameControllerButton + * \returns a string for the given button, or NULL if an invalid button is + * specified. The string returned is of the format used by + * SDL_GameController mapping strings. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerGetButtonFromString + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button); + +/** + * Get the SDL joystick layer binding for a controller button mapping. + * + * \param gamecontroller a game controller + * \param button an button enum value (an SDL_GameControllerButton value) + * \returns a SDL_GameControllerButtonBind describing the bind. On failure + * (like the given Controller button doesn't exist on the device), + * its `.bindType` will be `SDL_CONTROLLER_BINDTYPE_NONE`. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerGetBindForAxis + */ +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL +SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + +/** + * Query whether a game controller has a given button. + * + * This merely reports whether the controller's mapping defined this button, + * as that is all the information SDL has about the physical device. + * + * \param gamecontroller a game controller + * \param button a button enum value (an SDL_GameControllerButton value) + * \returns SDL_TRUE if the controller has this button, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + +/** + * Get the current state of a button on a game controller. + * + * \param gamecontroller a game controller + * \param button a button index (one of the SDL_GameControllerButton values) + * \returns 1 for pressed state or 0 for not pressed state or error; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerGetAxis + */ +extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + +/** + * Get the number of touchpads on a game controller. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller); + +/** + * Get the number of supported simultaneous fingers on a touchpad on a game + * controller. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad); + +/** + * Get the current state of a finger on a touchpad on a game controller. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure); + +/** + * Return whether a game controller has a particular sensor. + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * \returns SDL_TRUE if the sensor exists, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type); + +/** + * Set whether data reporting for a game controller sensor is enabled. + * + * \param gamecontroller The controller to update + * \param type The type of sensor to enable/disable + * \param enabled Whether data reporting should be enabled + * \returns 0 or -1 if an error occurred. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled); + +/** + * Query whether sensor data reporting is enabled for a game controller. + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * \returns SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type); + +/** + * Get the data rate (number of events per second) of a game controller + * sensor. + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * \return the data rate, or 0.0f if the data rate is not available. + * + * \since This function is available since SDL 2.0.16. + */ +extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameController *gamecontroller, SDL_SensorType type); + +/** + * Get the current state of a game controller sensor. + * + * The number of values and interpretation of the data is sensor dependent. + * See SDL_sensor.h for the details for each type of sensor. + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * \param data A pointer filled with the current sensor state + * \param num_values The number of values to write to data + * \return 0 or -1 if an error occurred. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values); + +/** + * Get the current state of a game controller sensor with the timestamp of the + * last update. + * + * The number of values and interpretation of the data is sensor dependent. + * See SDL_sensor.h for the details for each type of sensor. + * + * \param gamecontroller The controller to query + * \param type The type of sensor to query + * \param timestamp A pointer filled with the timestamp in microseconds of the + * current sensor reading if available, or 0 if not + * \param data A pointer filled with the current sensor state + * \param num_values The number of values to write to data + * \return 0 or -1 if an error occurred. + * + * \since This function is available since SDL 2.26.0. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values); + +/** + * Start a rumble effect on a game controller. + * + * Each call to this function cancels any previous rumble effect, and calling + * it with 0 intensity stops any rumbling. + * + * \param gamecontroller The controller to vibrate + * \param low_frequency_rumble The intensity of the low frequency (left) + * rumble motor, from 0 to 0xFFFF + * \param high_frequency_rumble The intensity of the high frequency (right) + * rumble motor, from 0 to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * \returns 0, or -1 if rumble isn't supported on this controller + * + * \since This function is available since SDL 2.0.9. + * + * \sa SDL_GameControllerHasRumble + */ +extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); + +/** + * Start a rumble effect in the game controller's triggers. + * + * Each call to this function cancels any previous trigger rumble effect, and + * calling it with 0 intensity stops any rumbling. + * + * Note that this is rumbling of the _triggers_ and not the game controller as + * a whole. This is currently only supported on Xbox One controllers. If you + * want the (more common) whole-controller rumble, use + * SDL_GameControllerRumble() instead. + * + * \param gamecontroller The controller to vibrate + * \param left_rumble The intensity of the left trigger rumble motor, from 0 + * to 0xFFFF + * \param right_rumble The intensity of the right trigger rumble motor, from 0 + * to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * \returns 0, or -1 if trigger rumble isn't supported on this controller + * + * \since This function is available since SDL 2.0.14. + * + * \sa SDL_GameControllerHasRumbleTriggers + */ +extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); + +/** + * Query whether a game controller has an LED. + * + * \param gamecontroller The controller to query + * \returns SDL_TRUE, or SDL_FALSE if this controller does not have a + * modifiable LED + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller); + +/** + * Query whether a game controller has rumble support. + * + * \param gamecontroller The controller to query + * \returns SDL_TRUE, or SDL_FALSE if this controller does not have rumble + * support + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_GameControllerRumble + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumble(SDL_GameController *gamecontroller); + +/** + * Query whether a game controller has rumble support on triggers. + * + * \param gamecontroller The controller to query + * \returns SDL_TRUE, or SDL_FALSE if this controller does not have trigger + * rumble support + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_GameControllerRumbleTriggers + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasRumbleTriggers(SDL_GameController *gamecontroller); + +/** + * Update a game controller's LED color. + * + * \param gamecontroller The controller to update + * \param red The intensity of the red LED + * \param green The intensity of the green LED + * \param blue The intensity of the blue LED + * \returns 0, or -1 if this controller does not have a modifiable LED + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue); + +/** + * Send a controller specific effect packet + * + * \param gamecontroller The controller to affect + * \param data The data to send to the controller + * \param size The size of the data to send to the controller + * \returns 0, or -1 if this controller or driver doesn't support effect + * packets + * + * \since This function is available since SDL 2.0.16. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerSendEffect(SDL_GameController *gamecontroller, const void *data, int size); + +/** + * Close a game controller previously opened with SDL_GameControllerOpen(). + * + * \param gamecontroller a game controller identifier previously returned by + * SDL_GameControllerOpen() + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerOpen + */ +extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller); + +/** + * Return the sfSymbolsName for a given button on a game controller on Apple + * platforms. + * + * \param gamecontroller the controller to query + * \param button a button on the game controller + * \returns the sfSymbolsName or NULL if the name can't be found + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_GameControllerGetAppleSFSymbolsNameForAxis + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button); + +/** + * Return the sfSymbolsName for a given axis on a game controller on Apple + * platforms. + * + * \param gamecontroller the controller to query + * \param axis an axis on the game controller + * \returns the sfSymbolsName or NULL if the name can't be found + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_GameControllerGetAppleSFSymbolsNameForButton + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_gamecontroller_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_gesture.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_gesture.h new file mode 100644 index 00000000..eee38475 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_gesture.h @@ -0,0 +1,117 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_gesture.h + * + * Include file for SDL gesture event handling. + */ + +#ifndef SDL_gesture_h_ +#define SDL_gesture_h_ + +#include +#include +#include + +#include + + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef Sint64 SDL_GestureID; + +/* Function prototypes */ + +/** + * Begin recording a gesture on a specified touch device or all touch devices. + * + * If the parameter `touchId` is -1 (i.e., all devices), this function will + * always return 1, regardless of whether there actually are any devices. + * + * \param touchId the touch device id, or -1 for all touch devices + * \returns 1 on success or 0 if the specified device could not be found. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetTouchDevice + */ +extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); + + +/** + * Save all currently loaded Dollar Gesture templates. + * + * \param dst a SDL_RWops to save to + * \returns the number of saved templates on success or 0 on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LoadDollarTemplates + * \sa SDL_SaveDollarTemplate + */ +extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); + +/** + * Save a currently loaded Dollar Gesture template. + * + * \param gestureId a gesture id + * \param dst a SDL_RWops to save to + * \returns 1 on success or 0 on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LoadDollarTemplates + * \sa SDL_SaveAllDollarTemplates + */ +extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); + + +/** + * Load Dollar Gesture templates from a file. + * + * \param touchId a touch id + * \param src a SDL_RWops to load from + * \returns the number of loaded templates on success or a negative error code + * (or 0) on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SaveAllDollarTemplates + * \sa SDL_SaveDollarTemplate + */ +extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_gesture_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_guid.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_guid.h new file mode 100644 index 00000000..27c3dda7 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_guid.h @@ -0,0 +1,100 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_guid.h + * + * Include file for handling ::SDL_GUID values. + */ + +#ifndef SDL_guid_h_ +#define SDL_guid_h_ + +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * An SDL_GUID is a 128-bit identifier for an input device that + * identifies that device across runs of SDL programs on the same + * platform. If the device is detached and then re-attached to a + * different port, or if the base system is rebooted, the device + * should still report the same GUID. + * + * GUIDs are as precise as possible but are not guaranteed to + * distinguish physically distinct but equivalent devices. For + * example, two game controllers from the same vendor with the same + * product ID and revision may have the same GUID. + * + * GUIDs may be platform-dependent (i.e., the same device may report + * different GUIDs on different operating systems). + */ +typedef struct { + Uint8 data[16]; +} SDL_GUID; + +/* Function prototypes */ + +/** + * Get an ASCII string representation for a given ::SDL_GUID. + * + * You should supply at least 33 bytes for pszGUID. + * + * \param guid the ::SDL_GUID you wish to convert to string + * \param pszGUID buffer in which to write the ASCII string + * \param cbGUID the size of pszGUID + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_GUIDFromString + */ +extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID); + +/** + * Convert a GUID string into a ::SDL_GUID structure. + * + * Performs no error checking. If this function is given a string containing + * an invalid GUID, the function will silently succeed, but the GUID generated + * will not be useful. + * + * \param pchGUID string containing an ASCII representation of a GUID + * \returns a ::SDL_GUID structure. + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_GUIDToString + */ +extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_guid_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_haptic.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_haptic.h new file mode 100644 index 00000000..111d197a --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_haptic.h @@ -0,0 +1,1341 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_haptic.h + * + * \brief The SDL haptic subsystem allows you to control haptic (force feedback) + * devices. + * + * The basic usage is as follows: + * - Initialize the subsystem (::SDL_INIT_HAPTIC). + * - Open a haptic device. + * - SDL_HapticOpen() to open from index. + * - SDL_HapticOpenFromJoystick() to open from an existing joystick. + * - Create an effect (::SDL_HapticEffect). + * - Upload the effect with SDL_HapticNewEffect(). + * - Run the effect with SDL_HapticRunEffect(). + * - (optional) Free the effect with SDL_HapticDestroyEffect(). + * - Close the haptic device with SDL_HapticClose(). + * + * \par Simple rumble example: + * \code + * SDL_Haptic *haptic; + * + * // Open the device + * haptic = SDL_HapticOpen( 0 ); + * if (haptic == NULL) + * return -1; + * + * // Initialize simple rumble + * if (SDL_HapticRumbleInit( haptic ) != 0) + * return -1; + * + * // Play effect at 50% strength for 2 seconds + * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0) + * return -1; + * SDL_Delay( 2000 ); + * + * // Clean up + * SDL_HapticClose( haptic ); + * \endcode + * + * \par Complete example: + * \code + * int test_haptic( SDL_Joystick * joystick ) { + * SDL_Haptic *haptic; + * SDL_HapticEffect effect; + * int effect_id; + * + * // Open the device + * haptic = SDL_HapticOpenFromJoystick( joystick ); + * if (haptic == NULL) return -1; // Most likely joystick isn't haptic + * + * // See if it can do sine waves + * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) { + * SDL_HapticClose(haptic); // No sine effect + * return -1; + * } + * + * // Create the effect + * SDL_memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default + * effect.type = SDL_HAPTIC_SINE; + * effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates + * effect.periodic.direction.dir[0] = 18000; // Force comes from south + * effect.periodic.period = 1000; // 1000 ms + * effect.periodic.magnitude = 20000; // 20000/32767 strength + * effect.periodic.length = 5000; // 5 seconds long + * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength + * effect.periodic.fade_length = 1000; // Takes 1 second to fade away + * + * // Upload the effect + * effect_id = SDL_HapticNewEffect( haptic, &effect ); + * + * // Test the effect + * SDL_HapticRunEffect( haptic, effect_id, 1 ); + * SDL_Delay( 5000); // Wait for the effect to finish + * + * // We destroy the effect, although closing the device also does this + * SDL_HapticDestroyEffect( haptic, effect_id ); + * + * // Close the device + * SDL_HapticClose(haptic); + * + * return 0; // Success + * } + * \endcode + */ + +#ifndef SDL_haptic_h_ +#define SDL_haptic_h_ + +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* FIXME: For SDL 2.1, adjust all the magnitude variables to be Uint16 (0xFFFF). + * + * At the moment the magnitude variables are mixed between signed/unsigned, and + * it is also not made clear that ALL of those variables expect a max of 0x7FFF. + * + * Some platforms may have higher precision than that (Linux FF, Windows XInput) + * so we should fix the inconsistency in favor of higher possible precision, + * adjusting for platforms that use different scales. + * -flibit + */ + +/** + * \typedef SDL_Haptic + * + * \brief The haptic structure used to identify an SDL haptic. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + */ +struct _SDL_Haptic; +typedef struct _SDL_Haptic SDL_Haptic; + + +/** + * \name Haptic features + * + * Different haptic features a device can have. + */ +/* @{ */ + +/** + * \name Haptic effects + */ +/* @{ */ + +/** + * \brief Constant effect supported. + * + * Constant haptic effect. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_CONSTANT (1u<<0) + +/** + * \brief Sine wave effect supported. + * + * Periodic haptic effect that simulates sine waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SINE (1u<<1) + +/** + * \brief Left/Right effect supported. + * + * Haptic effect for direct control over high/low frequency motors. + * + * \sa SDL_HapticLeftRight + * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, + * we ran out of bits, and this is important for XInput devices. + */ +#define SDL_HAPTIC_LEFTRIGHT (1u<<2) + +/* !!! FIXME: put this back when we have more bits in 2.1 */ +/* #define SDL_HAPTIC_SQUARE (1<<2) */ + +/** + * \brief Triangle wave effect supported. + * + * Periodic haptic effect that simulates triangular waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_TRIANGLE (1u<<3) + +/** + * \brief Sawtoothup wave effect supported. + * + * Periodic haptic effect that simulates saw tooth up waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SAWTOOTHUP (1u<<4) + +/** + * \brief Sawtoothdown wave effect supported. + * + * Periodic haptic effect that simulates saw tooth down waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SAWTOOTHDOWN (1u<<5) + +/** + * \brief Ramp effect supported. + * + * Ramp haptic effect. + * + * \sa SDL_HapticRamp + */ +#define SDL_HAPTIC_RAMP (1u<<6) + +/** + * \brief Spring effect supported - uses axes position. + * + * Condition haptic effect that simulates a spring. Effect is based on the + * axes position. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_SPRING (1u<<7) + +/** + * \brief Damper effect supported - uses axes velocity. + * + * Condition haptic effect that simulates dampening. Effect is based on the + * axes velocity. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_DAMPER (1u<<8) + +/** + * \brief Inertia effect supported - uses axes acceleration. + * + * Condition haptic effect that simulates inertia. Effect is based on the axes + * acceleration. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_INERTIA (1u<<9) + +/** + * \brief Friction effect supported - uses axes movement. + * + * Condition haptic effect that simulates friction. Effect is based on the + * axes movement. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_FRICTION (1u<<10) + +/** + * \brief Custom effect is supported. + * + * User defined custom haptic effect. + */ +#define SDL_HAPTIC_CUSTOM (1u<<11) + +/* @} *//* Haptic effects */ + +/* These last few are features the device has, not effects */ + +/** + * \brief Device can set global gain. + * + * Device supports setting the global gain. + * + * \sa SDL_HapticSetGain + */ +#define SDL_HAPTIC_GAIN (1u<<12) + +/** + * \brief Device can set autocenter. + * + * Device supports setting autocenter. + * + * \sa SDL_HapticSetAutocenter + */ +#define SDL_HAPTIC_AUTOCENTER (1u<<13) + +/** + * \brief Device can be queried for effect status. + * + * Device supports querying effect status. + * + * \sa SDL_HapticGetEffectStatus + */ +#define SDL_HAPTIC_STATUS (1u<<14) + +/** + * \brief Device can be paused. + * + * Devices supports being paused. + * + * \sa SDL_HapticPause + * \sa SDL_HapticUnpause + */ +#define SDL_HAPTIC_PAUSE (1u<<15) + + +/** + * \name Direction encodings + */ +/* @{ */ + +/** + * \brief Uses polar coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_POLAR 0 + +/** + * \brief Uses cartesian coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_CARTESIAN 1 + +/** + * \brief Uses spherical coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_SPHERICAL 2 + +/** + * \brief Use this value to play an effect on the steering wheel axis. This + * provides better compatibility across platforms and devices as SDL will guess + * the correct axis. + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_STEERING_AXIS 3 + +/* @} *//* Direction encodings */ + +/* @} *//* Haptic features */ + +/* + * Misc defines. + */ + +/** + * \brief Used to play a device an infinite number of times. + * + * \sa SDL_HapticRunEffect + */ +#define SDL_HAPTIC_INFINITY 4294967295U + + +/** + * \brief Structure that represents a haptic direction. + * + * This is the direction where the force comes from, + * instead of the direction in which the force is exerted. + * + * Directions can be specified by: + * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. + * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. + * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. + * + * Cardinal directions of the haptic device are relative to the positioning + * of the device. North is considered to be away from the user. + * + * The following diagram represents the cardinal directions: + * \verbatim + .--. + |__| .-------. + |=.| |.-----.| + |--| || || + | | |'-----'| + |__|~')_____(' + [ COMPUTER ] + + + North (0,-1) + ^ + | + | + (-1,0) West <----[ HAPTIC ]----> East (1,0) + | + | + v + South (0,1) + + + [ USER ] + \|||/ + (o o) + ---ooO-(_)-Ooo--- + \endverbatim + * + * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a + * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses + * the first \c dir parameter. The cardinal directions would be: + * - North: 0 (0 degrees) + * - East: 9000 (90 degrees) + * - South: 18000 (180 degrees) + * - West: 27000 (270 degrees) + * + * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions + * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses + * the first three \c dir parameters. The cardinal directions would be: + * - North: 0,-1, 0 + * - East: 1, 0, 0 + * - South: 0, 1, 0 + * - West: -1, 0, 0 + * + * The Z axis represents the height of the effect if supported, otherwise + * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you + * can use any multiple you want, only the direction matters. + * + * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. + * The first two \c dir parameters are used. The \c dir parameters are as + * follows (all values are in hundredths of degrees): + * - Degrees from (1, 0) rotated towards (0, 1). + * - Degrees towards (0, 0, 1) (device needs at least 3 axes). + * + * + * Example of force coming from the south with all encodings (force coming + * from the south means the user will have to pull the stick to counteract): + * \code + * SDL_HapticDirection direction; + * + * // Cartesian directions + * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. + * direction.dir[0] = 0; // X position + * direction.dir[1] = 1; // Y position + * // Assuming the device has 2 axes, we don't need to specify third parameter. + * + * // Polar directions + * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. + * direction.dir[0] = 18000; // Polar only uses first parameter + * + * // Spherical coordinates + * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding + * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. + * \endcode + * + * \sa SDL_HAPTIC_POLAR + * \sa SDL_HAPTIC_CARTESIAN + * \sa SDL_HAPTIC_SPHERICAL + * \sa SDL_HAPTIC_STEERING_AXIS + * \sa SDL_HapticEffect + * \sa SDL_HapticNumAxes + */ +typedef struct SDL_HapticDirection +{ + Uint8 type; /**< The type of encoding. */ + Sint32 dir[3]; /**< The encoded direction. */ +} SDL_HapticDirection; + + +/** + * \brief A structure containing a template for a Constant effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect. + * + * A constant effect applies a constant force in the specified direction + * to the joystick. + * + * \sa SDL_HAPTIC_CONSTANT + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticConstant +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Constant */ + Sint16 level; /**< Strength of the constant effect. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticConstant; + +/** + * \brief A structure containing a template for a Periodic effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SINE + * - ::SDL_HAPTIC_LEFTRIGHT + * - ::SDL_HAPTIC_TRIANGLE + * - ::SDL_HAPTIC_SAWTOOTHUP + * - ::SDL_HAPTIC_SAWTOOTHDOWN + * + * A periodic effect consists in a wave-shaped effect that repeats itself + * over time. The type determines the shape of the wave and the parameters + * determine the dimensions of the wave. + * + * Phase is given by hundredth of a degree meaning that giving the phase a value + * of 9000 will displace it 25% of its period. Here are sample values: + * - 0: No phase displacement. + * - 9000: Displaced 25% of its period. + * - 18000: Displaced 50% of its period. + * - 27000: Displaced 75% of its period. + * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. + * + * Examples: + * \verbatim + SDL_HAPTIC_SINE + __ __ __ __ + / \ / \ / \ / + / \__/ \__/ \__/ + + SDL_HAPTIC_SQUARE + __ __ __ __ __ + | | | | | | | | | | + | |__| |__| |__| |__| | + + SDL_HAPTIC_TRIANGLE + /\ /\ /\ /\ /\ + / \ / \ / \ / \ / + / \/ \/ \/ \/ + + SDL_HAPTIC_SAWTOOTHUP + /| /| /| /| /| /| /| + / | / | / | / | / | / | / | + / |/ |/ |/ |/ |/ |/ | + + SDL_HAPTIC_SAWTOOTHDOWN + \ |\ |\ |\ |\ |\ |\ | + \ | \ | \ | \ | \ | \ | \ | + \| \| \| \| \| \| \| + \endverbatim + * + * \sa SDL_HAPTIC_SINE + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HAPTIC_TRIANGLE + * \sa SDL_HAPTIC_SAWTOOTHUP + * \sa SDL_HAPTIC_SAWTOOTHDOWN + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticPeriodic +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, + ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or + ::SDL_HAPTIC_SAWTOOTHDOWN */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Periodic */ + Uint16 period; /**< Period of the wave. */ + Sint16 magnitude; /**< Peak value; if negative, equivalent to 180 degrees extra phase shift. */ + Sint16 offset; /**< Mean value of the wave. */ + Uint16 phase; /**< Positive phase shift given by hundredth of a degree. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticPeriodic; + +/** + * \brief A structure containing a template for a Condition effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SPRING: Effect based on axes position. + * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. + * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. + * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. + * + * Direction is handled by condition internals instead of a direction member. + * The condition effect specific members have three parameters. The first + * refers to the X axis, the second refers to the Y axis and the third + * refers to the Z axis. The right terms refer to the positive side of the + * axis and the left terms refer to the negative side of the axis. Please + * refer to the ::SDL_HapticDirection diagram for which side is positive and + * which is negative. + * + * \sa SDL_HapticDirection + * \sa SDL_HAPTIC_SPRING + * \sa SDL_HAPTIC_DAMPER + * \sa SDL_HAPTIC_INERTIA + * \sa SDL_HAPTIC_FRICTION + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticCondition +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, + ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ + SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Condition */ + Uint16 right_sat[3]; /**< Level when joystick is to the positive side; max 0xFFFF. */ + Uint16 left_sat[3]; /**< Level when joystick is to the negative side; max 0xFFFF. */ + Sint16 right_coeff[3]; /**< How fast to increase the force towards the positive side. */ + Sint16 left_coeff[3]; /**< How fast to increase the force towards the negative side. */ + Uint16 deadband[3]; /**< Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered. */ + Sint16 center[3]; /**< Position of the dead zone. */ +} SDL_HapticCondition; + +/** + * \brief A structure containing a template for a Ramp effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. + * + * The ramp effect starts at start strength and ends at end strength. + * It augments in linear fashion. If you use attack and fade with a ramp + * the effects get added to the ramp effect making the effect become + * quadratic instead of linear. + * + * \sa SDL_HAPTIC_RAMP + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticRamp +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_RAMP */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Ramp */ + Sint16 start; /**< Beginning strength level. */ + Sint16 end; /**< Ending strength level. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticRamp; + +/** + * \brief A structure containing a template for a Left/Right effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. + * + * The Left/Right effect is used to explicitly control the large and small + * motors, commonly found in modern game controllers. The small (right) motor + * is high frequency, and the large (left) motor is low frequency. + * + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticLeftRight +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ + + /* Replay */ + Uint32 length; /**< Duration of the effect in milliseconds. */ + + /* Rumble */ + Uint16 large_magnitude; /**< Control of the large controller motor. */ + Uint16 small_magnitude; /**< Control of the small controller motor. */ +} SDL_HapticLeftRight; + +/** + * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect. + * + * A custom force feedback effect is much like a periodic effect, where the + * application can define its exact shape. You will have to allocate the + * data yourself. Data should consist of channels * samples Uint16 samples. + * + * If channels is one, the effect is rotated using the defined direction. + * Otherwise it uses the samples in data for the different axes. + * + * \sa SDL_HAPTIC_CUSTOM + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticCustom +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Custom */ + Uint8 channels; /**< Axes to use, minimum of one. */ + Uint16 period; /**< Sample periods. */ + Uint16 samples; /**< Amount of samples. */ + Uint16 *data; /**< Should contain channels*samples items. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticCustom; + +/** + * \brief The generic template for any haptic effect. + * + * All values max at 32767 (0x7FFF). Signed values also can be negative. + * Time values unless specified otherwise are in milliseconds. + * + * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 + * value. Neither delay, interval, attack_length nor fade_length support + * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. + * + * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of + * ::SDL_HAPTIC_INFINITY. + * + * Button triggers may not be supported on all devices, it is advised to not + * use them if possible. Buttons start at index 1 instead of index 0 like + * the joystick. + * + * If both attack_length and fade_level are 0, the envelope is not used, + * otherwise both values are used. + * + * Common parts: + * \code + * // Replay - All effects have this + * Uint32 length; // Duration of effect (ms). + * Uint16 delay; // Delay before starting effect. + * + * // Trigger - All effects have this + * Uint16 button; // Button that triggers effect. + * Uint16 interval; // How soon before effect can be triggered again. + * + * // Envelope - All effects except condition effects have this + * Uint16 attack_length; // Duration of the attack (ms). + * Uint16 attack_level; // Level at the start of the attack. + * Uint16 fade_length; // Duration of the fade out (ms). + * Uint16 fade_level; // Level at the end of the fade. + * \endcode + * + * + * Here we have an example of a constant effect evolution in time: + * \verbatim + Strength + ^ + | + | effect level --> _________________ + | / \ + | / \ + | / \ + | / \ + | attack_level --> | \ + | | | <--- fade_level + | + +--------------------------------------------------> Time + [--] [---] + attack_length fade_length + + [------------------][-----------------------] + delay length + \endverbatim + * + * Note either the attack_level or the fade_level may be above the actual + * effect level. + * + * \sa SDL_HapticConstant + * \sa SDL_HapticPeriodic + * \sa SDL_HapticCondition + * \sa SDL_HapticRamp + * \sa SDL_HapticLeftRight + * \sa SDL_HapticCustom + */ +typedef union SDL_HapticEffect +{ + /* Common for all force feedback effects */ + Uint16 type; /**< Effect type. */ + SDL_HapticConstant constant; /**< Constant effect. */ + SDL_HapticPeriodic periodic; /**< Periodic effect. */ + SDL_HapticCondition condition; /**< Condition effect. */ + SDL_HapticRamp ramp; /**< Ramp effect. */ + SDL_HapticLeftRight leftright; /**< Left/Right effect. */ + SDL_HapticCustom custom; /**< Custom effect. */ +} SDL_HapticEffect; + + +/* Function prototypes */ + +/** + * Count the number of haptic devices attached to the system. + * + * \returns the number of haptic devices detected on the system or a negative + * error code on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticName + */ +extern DECLSPEC int SDLCALL SDL_NumHaptics(void); + +/** + * Get the implementation dependent name of a haptic device. + * + * This can be called before any joysticks are opened. If no name can be + * found, this function returns NULL. + * + * \param device_index index of the device to query. + * \returns the name of the device or NULL on failure; call SDL_GetError() for + * more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_NumHaptics + */ +extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); + +/** + * Open a haptic device for use. + * + * The index passed as an argument refers to the N'th haptic device on this + * system. + * + * When opening a haptic device, its gain will be set to maximum and + * autocenter will be disabled. To modify these values use SDL_HapticSetGain() + * and SDL_HapticSetAutocenter(). + * + * \param device_index index of the device to open + * \returns the device identifier or NULL on failure; call SDL_GetError() for + * more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticClose + * \sa SDL_HapticIndex + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticOpenFromMouse + * \sa SDL_HapticPause + * \sa SDL_HapticSetAutocenter + * \sa SDL_HapticSetGain + * \sa SDL_HapticStopAll + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); + +/** + * Check if the haptic device at the designated index has been opened. + * + * \param device_index the index of the device to query + * \returns 1 if it has been opened, 0 if it hasn't or on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticIndex + * \sa SDL_HapticOpen + */ +extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); + +/** + * Get the index of a haptic device. + * + * \param haptic the SDL_Haptic device to query + * \returns the index of the specified haptic device or a negative error code + * on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpened + */ +extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); + +/** + * Query whether or not the current mouse has haptic capabilities. + * + * \returns SDL_TRUE if the mouse is haptic or SDL_FALSE if it isn't. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticOpenFromMouse + */ +extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); + +/** + * Try to open a haptic device from the current mouse. + * + * \returns the haptic device identifier or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticOpen + * \sa SDL_MouseIsHaptic + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); + +/** + * Query if a joystick has haptic features. + * + * \param joystick the SDL_Joystick to test for haptic capabilities + * \returns SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't, or a + * negative error code on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticOpenFromJoystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); + +/** + * Open a haptic device for use from a joystick device. + * + * You must still close the haptic device separately. It will not be closed + * with the joystick. + * + * When opened from a joystick you should first close the haptic device before + * closing the joystick device. If not, on some implementations the haptic + * device will also get unallocated and you'll be unable to use force feedback + * on that device. + * + * \param joystick the SDL_Joystick to create a haptic device from + * \returns a valid haptic device identifier on success or NULL on failure; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticClose + * \sa SDL_HapticOpen + * \sa SDL_JoystickIsHaptic + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * + joystick); + +/** + * Close a haptic device previously opened with SDL_HapticOpen(). + * + * \param haptic the SDL_Haptic device to close + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticOpen + */ +extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); + +/** + * Get the number of effects a haptic device can store. + * + * On some platforms this isn't fully supported, and therefore is an + * approximation. Always check to see if your created effect was actually + * created and do not rely solely on SDL_HapticNumEffects(). + * + * \param haptic the SDL_Haptic device to query + * \returns the number of effects the haptic device can store or a negative + * error code on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticNumEffectsPlaying + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); + +/** + * Get the number of effects a haptic device can play at the same time. + * + * This is not supported on all platforms, but will always return a value. + * + * \param haptic the SDL_Haptic device to query maximum playing effects + * \returns the number of effects the haptic device can play at the same time + * or a negative error code on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticNumEffects + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); + +/** + * Get the haptic device's supported features in bitwise manner. + * + * \param haptic the SDL_Haptic device to query + * \returns a list of supported haptic features in bitwise manner (OR'd), or 0 + * on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticEffectSupported + * \sa SDL_HapticNumEffects + */ +extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); + + +/** + * Get the number of haptic axes the device has. + * + * The number of haptic axes might be useful if working with the + * SDL_HapticDirection effect. + * + * \param haptic the SDL_Haptic device to query + * \returns the number of axes on success or a negative error code on failure; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); + +/** + * Check to see if an effect is supported by a haptic device. + * + * \param haptic the SDL_Haptic device to query + * \param effect the desired effect to query + * \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a + * negative error code on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticNewEffect + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, + SDL_HapticEffect * + effect); + +/** + * Create a new haptic effect on a specified device. + * + * \param haptic an SDL_Haptic device to create the effect on + * \param effect an SDL_HapticEffect structure containing the properties of + * the effect to create + * \returns the ID of the effect on success or a negative error code on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticDestroyEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticUpdateEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, + SDL_HapticEffect * effect); + +/** + * Update the properties of an effect. + * + * Can be used dynamically, although behavior when dynamically changing + * direction may be strange. Specifically the effect may re-upload itself and + * start playing from the start. You also cannot change the type either when + * running SDL_HapticUpdateEffect(). + * + * \param haptic the SDL_Haptic device that has the effect + * \param effect the identifier of the effect to update + * \param data an SDL_HapticEffect structure containing the new effect + * properties to use + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticDestroyEffect + * \sa SDL_HapticNewEffect + * \sa SDL_HapticRunEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, + int effect, + SDL_HapticEffect * data); + +/** + * Run the haptic effect on its associated haptic device. + * + * To repeat the effect over and over indefinitely, set `iterations` to + * `SDL_HAPTIC_INFINITY`. (Repeats the envelope - attack and fade.) To make + * one instance of the effect last indefinitely (so the effect does not fade), + * set the effect's `length` in its structure/union to `SDL_HAPTIC_INFINITY` + * instead. + * + * \param haptic the SDL_Haptic device to run the effect on + * \param effect the ID of the haptic effect to run + * \param iterations the number of iterations to run the effect; use + * `SDL_HAPTIC_INFINITY` to repeat forever + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticDestroyEffect + * \sa SDL_HapticGetEffectStatus + * \sa SDL_HapticStopEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, + int effect, + Uint32 iterations); + +/** + * Stop the haptic effect on its associated haptic device. + * + * * + * + * \param haptic the SDL_Haptic device to stop the effect on + * \param effect the ID of the haptic effect to stop + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticDestroyEffect + * \sa SDL_HapticRunEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, + int effect); + +/** + * Destroy a haptic effect on the device. + * + * This will stop the effect if it's running. Effects are automatically + * destroyed when the device is closed. + * + * \param haptic the SDL_Haptic device to destroy the effect on + * \param effect the ID of the haptic effect to destroy + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticNewEffect + */ +extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, + int effect); + +/** + * Get the status of the current effect on the specified haptic device. + * + * Device must support the SDL_HAPTIC_STATUS feature. + * + * \param haptic the SDL_Haptic device to query for the effect status on + * \param effect the ID of the haptic effect to query its status + * \returns 0 if it isn't playing, 1 if it is playing, or a negative error + * code on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticStopEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, + int effect); + +/** + * Set the global gain of the specified haptic device. + * + * Device must support the SDL_HAPTIC_GAIN feature. + * + * The user may specify the maximum gain by setting the environment variable + * `SDL_HAPTIC_GAIN_MAX` which should be between 0 and 100. All calls to + * SDL_HapticSetGain() will scale linearly using `SDL_HAPTIC_GAIN_MAX` as the + * maximum. + * + * \param haptic the SDL_Haptic device to set the gain on + * \param gain value to set the gain to, should be between 0 and 100 (0 - 100) + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); + +/** + * Set the global autocenter of the device. + * + * Autocenter should be between 0 and 100. Setting it to 0 will disable + * autocentering. + * + * Device must support the SDL_HAPTIC_AUTOCENTER feature. + * + * \param haptic the SDL_Haptic device to set autocentering on + * \param autocenter value to set autocenter to (0-100) + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, + int autocenter); + +/** + * Pause a haptic device. + * + * Device must support the `SDL_HAPTIC_PAUSE` feature. Call + * SDL_HapticUnpause() to resume playback. + * + * Do not modify the effects nor add new ones while the device is paused. That + * can cause all sorts of weird errors. + * + * \param haptic the SDL_Haptic device to pause + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticUnpause + */ +extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); + +/** + * Unpause a haptic device. + * + * Call to unpause after SDL_HapticPause(). + * + * \param haptic the SDL_Haptic device to unpause + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticPause + */ +extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); + +/** + * Stop all the currently playing effects on a haptic device. + * + * \param haptic the SDL_Haptic device to stop + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); + +/** + * Check whether rumble is supported on a haptic device. + * + * \param haptic haptic device to check for rumble support + * \returns SDL_TRUE if effect is supported, SDL_FALSE if it isn't, or a + * negative error code on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); + +/** + * Initialize a haptic device for simple rumble playback. + * + * \param haptic the haptic device to initialize for simple rumble playback + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop + * \sa SDL_HapticRumbleSupported + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); + +/** + * Run a simple rumble effect on a haptic device. + * + * \param haptic the haptic device to play the rumble effect on + * \param strength strength of the rumble to play as a 0-1 float value + * \param length length of the rumble to play in milliseconds + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumbleStop + * \sa SDL_HapticRumbleSupported + */ +extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); + +/** + * Stop the simple rumble on a haptic device. + * + * \param haptic the haptic device to stop the rumble effect on + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleSupported + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_haptic_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_hidapi.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_hidapi.h new file mode 100644 index 00000000..62cc3014 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_hidapi.h @@ -0,0 +1,451 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_hidapi.h + * + * Header file for SDL HIDAPI functions. + * + * This is an adaptation of the original HIDAPI interface by Alan Ott, + * and includes source code licensed under the following BSD license: + * + Copyright (c) 2010, Alan Ott, Signal 11 Software + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Signal 11 Software nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + * + * If you would like a version of SDL without this code, you can build SDL + * with SDL_HIDAPI_DISABLED defined to 1. You might want to do this for example + * on iOS or tvOS to avoid a dependency on the CoreBluetooth framework. + */ + +#ifndef SDL_hidapi_h_ +#define SDL_hidapi_h_ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief A handle representing an open HID device + */ +struct SDL_hid_device_; +typedef struct SDL_hid_device_ SDL_hid_device; /**< opaque hidapi structure */ + +/** hidapi info structure */ +/** + * \brief Information about a connected HID device + */ +typedef struct SDL_hid_device_info +{ + /** Platform-specific device path */ + char *path; + /** Device Vendor ID */ + unsigned short vendor_id; + /** Device Product ID */ + unsigned short product_id; + /** Serial Number */ + wchar_t *serial_number; + /** Device Release Number in binary-coded decimal, + also known as Device Version Number */ + unsigned short release_number; + /** Manufacturer String */ + wchar_t *manufacturer_string; + /** Product string */ + wchar_t *product_string; + /** Usage Page for this Device/Interface + (Windows/Mac only). */ + unsigned short usage_page; + /** Usage for this Device/Interface + (Windows/Mac only).*/ + unsigned short usage; + /** The USB interface which this logical device + represents. + + * Valid on both Linux implementations in all cases. + * Valid on the Windows implementation only if the device + contains more than one interface. */ + int interface_number; + + /** Additional information about the USB interface. + Valid on libusb and Android implementations. */ + int interface_class; + int interface_subclass; + int interface_protocol; + + /** Pointer to the next device */ + struct SDL_hid_device_info *next; +} SDL_hid_device_info; + + +/** + * Initialize the HIDAPI library. + * + * This function initializes the HIDAPI library. Calling it is not strictly + * necessary, as it will be called automatically by SDL_hid_enumerate() and + * any of the SDL_hid_open_*() functions if it is needed. This function should + * be called at the beginning of execution however, if there is a chance of + * HIDAPI handles being opened by different threads simultaneously. + * + * Each call to this function should have a matching call to SDL_hid_exit() + * + * \returns 0 on success and -1 on error. + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_hid_exit + */ +extern DECLSPEC int SDLCALL SDL_hid_init(void); + +/** + * Finalize the HIDAPI library. + * + * This function frees all of the static data associated with HIDAPI. It + * should be called at the end of execution to avoid memory leaks. + * + * \returns 0 on success and -1 on error. + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_hid_init + */ +extern DECLSPEC int SDLCALL SDL_hid_exit(void); + +/** + * Check to see if devices may have been added or removed. + * + * Enumerating the HID devices is an expensive operation, so you can call this + * to see if there have been any system device changes since the last call to + * this function. A change in the counter returned doesn't necessarily mean + * that anything has changed, but you can call SDL_hid_enumerate() to get an + * updated device list. + * + * Calling this function for the first time may cause a thread or other system + * resource to be allocated to track device change notifications. + * + * \returns a change counter that is incremented with each potential device + * change, or 0 if device change detection isn't available. + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_hid_enumerate + */ +extern DECLSPEC Uint32 SDLCALL SDL_hid_device_change_count(void); + +/** + * Enumerate the HID Devices. + * + * This function returns a linked list of all the HID devices attached to the + * system which match vendor_id and product_id. If `vendor_id` is set to 0 + * then any vendor matches. If `product_id` is set to 0 then any product + * matches. If `vendor_id` and `product_id` are both set to 0, then all HID + * devices will be returned. + * + * \param vendor_id The Vendor ID (VID) of the types of device to open. + * \param product_id The Product ID (PID) of the types of device to open. + * \returns a pointer to a linked list of type SDL_hid_device_info, containing + * information about the HID devices attached to the system, or NULL + * in the case of failure. Free this linked list by calling + * SDL_hid_free_enumeration(). + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_hid_device_change_count + */ +extern DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_enumerate(unsigned short vendor_id, unsigned short product_id); + +/** + * Free an enumeration Linked List + * + * This function frees a linked list created by SDL_hid_enumerate(). + * + * \param devs Pointer to a list of struct_device returned from + * SDL_hid_enumerate(). + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC void SDLCALL SDL_hid_free_enumeration(SDL_hid_device_info *devs); + +/** + * Open a HID device using a Vendor ID (VID), Product ID (PID) and optionally + * a serial number. + * + * If `serial_number` is NULL, the first device with the specified VID and PID + * is opened. + * + * \param vendor_id The Vendor ID (VID) of the device to open. + * \param product_id The Product ID (PID) of the device to open. + * \param serial_number The Serial Number of the device to open (Optionally + * NULL). + * \returns a pointer to a SDL_hid_device object on success or NULL on + * failure. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number); + +/** + * Open a HID device by its path name. + * + * The path name be determined by calling SDL_hid_enumerate(), or a + * platform-specific path name can be used (eg: /dev/hidraw0 on Linux). + * + * \param path The path name of the device to open + * \returns a pointer to a SDL_hid_device object on success or NULL on + * failure. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path, int bExclusive /* = false */); + +/** + * Write an Output report to a HID device. + * + * The first byte of `data` must contain the Report ID. For devices which only + * support a single report, this must be set to 0x0. The remaining bytes + * contain the report data. Since the Report ID is mandatory, calls to + * SDL_hid_write() will always contain one more byte than the report contains. + * For example, if a hid report is 16 bytes long, 17 bytes must be passed to + * SDL_hid_write(), the Report ID (or 0x0, for devices with a single report), + * followed by the report data (16 bytes). In this example, the length passed + * in would be 17. + * + * SDL_hid_write() will send the data on the first OUT endpoint, if one + * exists. If it does not, it will send the data through the Control Endpoint + * (Endpoint 0). + * + * \param dev A device handle returned from SDL_hid_open(). + * \param data The data to send, including the report number as the first + * byte. + * \param length The length in bytes of the data to send. + * \returns the actual number of bytes written and -1 on error. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_hid_write(SDL_hid_device *dev, const unsigned char *data, size_t length); + +/** + * Read an Input report from a HID device with timeout. + * + * Input reports are returned to the host through the INTERRUPT IN endpoint. + * The first byte will contain the Report number if the device uses numbered + * reports. + * + * \param dev A device handle returned from SDL_hid_open(). + * \param data A buffer to put the read data into. + * \param length The number of bytes to read. For devices with multiple + * reports, make sure to read an extra byte for the report + * number. + * \param milliseconds timeout in milliseconds or -1 for blocking wait. + * \returns the actual number of bytes read and -1 on error. If no packet was + * available to be read within the timeout period, this function + * returns 0. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_hid_read_timeout(SDL_hid_device *dev, unsigned char *data, size_t length, int milliseconds); + +/** + * Read an Input report from a HID device. + * + * Input reports are returned to the host through the INTERRUPT IN endpoint. + * The first byte will contain the Report number if the device uses numbered + * reports. + * + * \param dev A device handle returned from SDL_hid_open(). + * \param data A buffer to put the read data into. + * \param length The number of bytes to read. For devices with multiple + * reports, make sure to read an extra byte for the report + * number. + * \returns the actual number of bytes read and -1 on error. If no packet was + * available to be read and the handle is in non-blocking mode, this + * function returns 0. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_hid_read(SDL_hid_device *dev, unsigned char *data, size_t length); + +/** + * Set the device handle to be non-blocking. + * + * In non-blocking mode calls to SDL_hid_read() will return immediately with a + * value of 0 if there is no data to be read. In blocking mode, SDL_hid_read() + * will wait (block) until there is data to read before returning. + * + * Nonblocking can be turned on and off at any time. + * + * \param dev A device handle returned from SDL_hid_open(). + * \param nonblock enable or not the nonblocking reads - 1 to enable + * nonblocking - 0 to disable nonblocking. + * \returns 0 on success and -1 on error. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_hid_set_nonblocking(SDL_hid_device *dev, int nonblock); + +/** + * Send a Feature report to the device. + * + * Feature reports are sent over the Control endpoint as a Set_Report + * transfer. The first byte of `data` must contain the Report ID. For devices + * which only support a single report, this must be set to 0x0. The remaining + * bytes contain the report data. Since the Report ID is mandatory, calls to + * SDL_hid_send_feature_report() will always contain one more byte than the + * report contains. For example, if a hid report is 16 bytes long, 17 bytes + * must be passed to SDL_hid_send_feature_report(): the Report ID (or 0x0, for + * devices which do not use numbered reports), followed by the report data (16 + * bytes). In this example, the length passed in would be 17. + * + * \param dev A device handle returned from SDL_hid_open(). + * \param data The data to send, including the report number as the first + * byte. + * \param length The length in bytes of the data to send, including the report + * number. + * \returns the actual number of bytes written and -1 on error. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_hid_send_feature_report(SDL_hid_device *dev, const unsigned char *data, size_t length); + +/** + * Get a feature report from a HID device. + * + * Set the first byte of `data` to the Report ID of the report to be read. + * Make sure to allow space for this extra byte in `data`. Upon return, the + * first byte will still contain the Report ID, and the report data will start + * in data[1]. + * + * \param dev A device handle returned from SDL_hid_open(). + * \param data A buffer to put the read data into, including the Report ID. + * Set the first byte of `data` to the Report ID of the report to + * be read, or set it to zero if your device does not use numbered + * reports. + * \param length The number of bytes to read, including an extra byte for the + * report ID. The buffer can be longer than the actual report. + * \returns the number of bytes read plus one for the report ID (which is + * still in the first byte), or -1 on error. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, unsigned char *data, size_t length); + +/** + * Close a HID device. + * + * \param dev A device handle returned from SDL_hid_open(). + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC void SDLCALL SDL_hid_close(SDL_hid_device *dev); + +/** + * Get The Manufacturer String from a HID device. + * + * \param dev A device handle returned from SDL_hid_open(). + * \param string A wide string buffer to put the data into. + * \param maxlen The length of the buffer in multiples of wchar_t. + * \returns 0 on success and -1 on error. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_hid_get_manufacturer_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen); + +/** + * Get The Product String from a HID device. + * + * \param dev A device handle returned from SDL_hid_open(). + * \param string A wide string buffer to put the data into. + * \param maxlen The length of the buffer in multiples of wchar_t. + * \returns 0 on success and -1 on error. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_hid_get_product_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen); + +/** + * Get The Serial Number String from a HID device. + * + * \param dev A device handle returned from SDL_hid_open(). + * \param string A wide string buffer to put the data into. + * \param maxlen The length of the buffer in multiples of wchar_t. + * \returns 0 on success and -1 on error. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_hid_get_serial_number_string(SDL_hid_device *dev, wchar_t *string, size_t maxlen); + +/** + * Get a string from a HID device, based on its string index. + * + * \param dev A device handle returned from SDL_hid_open(). + * \param string_index The index of the string to get. + * \param string A wide string buffer to put the data into. + * \param maxlen The length of the buffer in multiples of wchar_t. + * \returns 0 on success and -1 on error. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, int string_index, wchar_t *string, size_t maxlen); + +/** + * Start or stop a BLE scan on iOS and tvOS to pair Steam Controllers + * + * \param active SDL_TRUE to start the scan, SDL_FALSE to stop the scan + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC void SDLCALL SDL_hid_ble_scan(SDL_bool active); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_hidapi_h_ */ + +/* vi: set sts=4 ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_hints.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_hints.h new file mode 100644 index 00000000..3faa7652 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_hints.h @@ -0,0 +1,2613 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_hints.h + * + * Official documentation for SDL configuration variables + * + * This file contains functions to set and get configuration hints, + * as well as listing each of them alphabetically. + * + * The convention for naming hints is SDL_HINT_X, where "SDL_X" is + * the environment variable that can be used to override the default. + * + * In general these hints are just that - they may or may not be + * supported or applicable on any given platform, but they provide + * a way for an application or user to give the library a hint as + * to how they would like the library to work. + */ + +#ifndef SDL_hints_h_ +#define SDL_hints_h_ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief A variable controlling whether the Android / iOS built-in + * accelerometer should be listed as a joystick device. + * + * This variable can be set to the following values: + * "0" - The accelerometer is not listed as a joystick + * "1" - The accelerometer is available as a 3 axis joystick (the default). + */ +#define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK" + +/** + * \brief Specify the behavior of Alt+Tab while the keyboard is grabbed. + * + * By default, SDL emulates Alt+Tab functionality while the keyboard is grabbed + * and your window is full-screen. This prevents the user from getting stuck in + * your application if you've enabled keyboard grab. + * + * The variable can be set to the following values: + * "0" - SDL will not handle Alt+Tab. Your application is responsible + for handling Alt+Tab while the keyboard is grabbed. + * "1" - SDL will minimize your window when Alt+Tab is pressed (default) +*/ +#define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED "SDL_ALLOW_ALT_TAB_WHILE_GRABBED" + +/** + * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it. + * This is a debugging aid for developers and not expected to be used by end users. The default is "1" + * + * This variable can be set to the following values: + * "0" - don't allow topmost + * "1" - allow topmost + */ +#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST" + +/** + * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc. + * + * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION. + * + * If both hints were set then SDL_RWFromFile() will look into expansion files + * after a given relative path was not found in the internal storage and assets. + * + * By default this hint is not set and the APK expansion files are not searched. + */ +#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION" + +/** + * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc. + * + * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION. + * + * If both hints were set then SDL_RWFromFile() will look into expansion files + * after a given relative path was not found in the internal storage and assets. + * + * By default this hint is not set and the APK expansion files are not searched. + */ +#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION" + +/** + * \brief A variable to control whether the event loop will block itself when the app is paused. + * + * The variable can be set to the following values: + * "0" - Non blocking. + * "1" - Blocking. (default) + * + * The value should be set before SDL is initialized. + */ +#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE" + +/** + * \brief A variable to control whether SDL will pause audio in background + * (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking") + * + * The variable can be set to the following values: + * "0" - Non paused. + * "1" - Paused. (default) + * + * The value should be set before SDL is initialized. + */ +#define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO" + +/** + * \brief A variable to control whether we trap the Android back button to handle it manually. + * This is necessary for the right mouse button to work on some Android devices, or + * to be able to trap the back button for use in your code reliably. If set to true, + * the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of + * SDL_SCANCODE_AC_BACK. + * + * The variable can be set to the following values: + * "0" - Back button will be handled as usual for system. (default) + * "1" - Back button will be trapped, allowing you to handle the key press + * manually. (This will also let right mouse click work on systems + * where the right mouse button functions as back.) + * + * The value of this hint is used at runtime, so it can be changed at any time. + */ +#define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON" + +/** + * \brief Specify an application name. + * + * This hint lets you specify the application name sent to the OS when + * required. For example, this will often appear in volume control applets for + * audio streams, and in lists of applications which are inhibiting the + * screensaver. You should use a string that describes your program ("My Game + * 2: The Revenge") + * + * Setting this to "" or leaving it unset will have SDL use a reasonable + * default: probably the application's name or "SDL Application" if SDL + * doesn't have any better information. + * + * Note that, for audio streams, this can be overridden with + * SDL_HINT_AUDIO_DEVICE_APP_NAME. + * + * On targets where this is not supported, this hint does nothing. + */ +#define SDL_HINT_APP_NAME "SDL_APP_NAME" + +/** + * \brief A variable controlling whether controllers used with the Apple TV + * generate UI events. + * + * When UI events are generated by controller input, the app will be + * backgrounded when the Apple TV remote's menu button is pressed, and when the + * pause or B buttons on gamepads are pressed. + * + * More information about properly making use of controllers for the Apple TV + * can be found here: + * https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/ + * + * This variable can be set to the following values: + * "0" - Controller input does not generate UI events (the default). + * "1" - Controller input generates UI events. + */ +#define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS" + +/** + * \brief A variable controlling whether the Apple TV remote's joystick axes + * will automatically match the rotation of the remote. + * + * This variable can be set to the following values: + * "0" - Remote orientation does not affect joystick axes (the default). + * "1" - Joystick axes are based on the orientation of the remote. + */ +#define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION" + +/** + * \brief A variable controlling the audio category on iOS and Mac OS X + * + * This variable can be set to the following values: + * + * "ambient" - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default) + * "playback" - Use the AVAudioSessionCategoryPlayback category + * + * For more information, see Apple's documentation: + * https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html + */ +#define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY" + +/** + * \brief Specify an application name for an audio device. + * + * Some audio backends (such as PulseAudio) allow you to describe your audio + * stream. Among other things, this description might show up in a system + * control panel that lets the user adjust the volume on specific audio + * streams instead of using one giant master volume slider. + * + * This hints lets you transmit that information to the OS. The contents of + * this hint are used while opening an audio device. You should use a string + * that describes your program ("My Game 2: The Revenge") + * + * Setting this to "" or leaving it unset will have SDL use a reasonable + * default: this will be the name set with SDL_HINT_APP_NAME, if that hint is + * set. Otherwise, it'll probably the application's name or "SDL Application" + * if SDL doesn't have any better information. + * + * On targets where this is not supported, this hint does nothing. + */ +#define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME" + +/** + * \brief Specify an application name for an audio device. + * + * Some audio backends (such as PulseAudio) allow you to describe your audio + * stream. Among other things, this description might show up in a system + * control panel that lets the user adjust the volume on specific audio + * streams instead of using one giant master volume slider. + * + * This hints lets you transmit that information to the OS. The contents of + * this hint are used while opening an audio device. You should use a string + * that describes your what your program is playing ("audio stream" is + * probably sufficient in many cases, but this could be useful for something + * like "team chat" if you have a headset playing VoIP audio separately). + * + * Setting this to "" or leaving it unset will have SDL use a reasonable + * default: "audio stream" or something similar. + * + * On targets where this is not supported, this hint does nothing. + */ +#define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME" + +/** + * \brief Specify an application role for an audio device. + * + * Some audio backends (such as Pipewire) allow you to describe the role of + * your audio stream. Among other things, this description might show up in + * a system control panel or software for displaying and manipulating media + * playback/capture graphs. + * + * This hints lets you transmit that information to the OS. The contents of + * this hint are used while opening an audio device. You should use a string + * that describes your what your program is playing (Game, Music, Movie, + * etc...). + * + * Setting this to "" or leaving it unset will have SDL use a reasonable + * default: "Game" or something similar. + * + * On targets where this is not supported, this hint does nothing. + */ +#define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "SDL_AUDIO_DEVICE_STREAM_ROLE" + +/** + * \brief A variable controlling speed/quality tradeoff of audio resampling. + * + * If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ ) + * to handle audio resampling. There are different resampling modes available + * that produce different levels of quality, using more CPU. + * + * If this hint isn't specified to a valid setting, or libsamplerate isn't + * available, SDL will use the default, internal resampling algorithm. + * + * As of SDL 2.26, SDL_ConvertAudio() respects this hint when libsamplerate is available. + * + * This hint is currently only checked at audio subsystem initialization. + * + * This variable can be set to the following values: + * + * "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast) + * "1" or "fast" - Use fast, slightly higher quality resampling, if available + * "2" or "medium" - Use medium quality resampling, if available + * "3" or "best" - Use high quality resampling, if available + */ +#define SDL_HINT_AUDIO_RESAMPLING_MODE "SDL_AUDIO_RESAMPLING_MODE" + +/** + * \brief A variable controlling whether SDL updates joystick state when getting input events + * + * This variable can be set to the following values: + * + * "0" - You'll call SDL_JoystickUpdate() manually + * "1" - SDL will automatically call SDL_JoystickUpdate() (default) + * + * This hint can be toggled on and off at runtime. + */ +#define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS" + +/** + * \brief A variable controlling whether SDL updates sensor state when getting input events + * + * This variable can be set to the following values: + * + * "0" - You'll call SDL_SensorUpdate() manually + * "1" - SDL will automatically call SDL_SensorUpdate() (default) + * + * This hint can be toggled on and off at runtime. + */ +#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS" + +/** + * \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs. + * + * The bitmap header version 4 is required for proper alpha channel support and + * SDL will use it when required. Should this not be desired, this hint can + * force the use of the 40 byte header version which is supported everywhere. + * + * The variable can be set to the following values: + * "0" - Surfaces with a colorkey or an alpha channel are saved to a + * 32-bit BMP file with an alpha mask. SDL will use the bitmap + * header version 4 and set the alpha mask accordingly. + * "1" - Surfaces with a colorkey or an alpha channel are saved to a + * 32-bit BMP file without an alpha mask. The alpha channel data + * will be in the file, but applications are going to ignore it. + * + * The default value is "0". + */ +#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT" + +/** + * \brief Override for SDL_GetDisplayUsableBounds() + * + * If set, this hint will override the expected results for + * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want + * to do this, but this allows an embedded system to request that some of the + * screen be reserved for other uses when paired with a well-behaved + * application. + * + * The contents of this hint must be 4 comma-separated integers, the first + * is the bounds x, then y, width and height, in that order. + */ +#define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS" + +/** + * \brief Disable giving back control to the browser automatically + * when running with asyncify + * + * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations + * such as refreshing the screen or polling events. + * + * This hint only applies to the emscripten platform + * + * The variable can be set to the following values: + * "0" - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes) + * "1" - Enable emscripten_sleep calls (the default) + */ +#define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY" + +/** + * \brief override the binding element for keyboard inputs for Emscripten builds + * + * This hint only applies to the emscripten platform + * + * The variable can be one of + * "#window" - The javascript window object (this is the default) + * "#document" - The javascript document object + * "#screen" - the javascript window.screen object + * "#canvas" - the WebGL canvas element + * any other string without a leading # sign applies to the element on the page with that ID. + */ +#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT" + +/** + * \brief A variable that controls whether the on-screen keyboard should be shown when text input is active + * + * The variable can be set to the following values: + * "0" - Do not show the on-screen keyboard + * "1" - Show the on-screen keyboard + * + * The default value is "1". This hint must be set before text input is activated. + */ +#define SDL_HINT_ENABLE_SCREEN_KEYBOARD "SDL_ENABLE_SCREEN_KEYBOARD" + +/** + * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs + * + * The variable can be set to the following values: + * "0" - Do not scan for Steam Controllers + * "1" - Scan for Steam Controllers (the default) + * + * The default value is "1". This hint must be set before initializing the joystick subsystem. + */ +#define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS" + +/** + * \brief A variable controlling verbosity of the logging of SDL events pushed onto the internal queue. + * + * This variable can be set to the following values, from least to most verbose: + * + * "0" - Don't log any events (default) + * "1" - Log most events (other than the really spammy ones). + * "2" - Include mouse and finger motion events. + * "3" - Include SDL_SysWMEvent events. + * + * This is generally meant to be used to debug SDL itself, but can be useful + * for application developers that need better visibility into what is going + * on in the event queue. Logged events are sent through SDL_Log(), which + * means by default they appear on stdout on most platforms or maybe + * OutputDebugString() on Windows, and can be funneled by the app with + * SDL_LogSetOutputFunction(), etc. + * + * This hint can be toggled on and off at runtime, if you only need to log + * events for a small subset of program execution. + */ +#define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING" + +/** + * \brief A variable controlling whether raising the window should be done more forcefully + * + * This variable can be set to the following values: + * "0" - No forcing (the default) + * "1" - Extra level of forcing + * + * At present, this is only an issue under MS Windows, which makes it nearly impossible to + * programmatically move a window to the foreground, for "security" reasons. See + * http://stackoverflow.com/a/34414846 for a discussion. + */ +#define SDL_HINT_FORCE_RAISEWINDOW "SDL_HINT_FORCE_RAISEWINDOW" + +/** + * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. + * + * SDL can try to accelerate the SDL screen surface by using streaming + * textures with a 3D rendering engine. This variable controls whether and + * how this is done. + * + * This variable can be set to the following values: + * "0" - Disable 3D acceleration + * "1" - Enable 3D acceleration, using the default renderer. + * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.) + * + * By default SDL tries to make a best guess for each platform whether + * to use acceleration or not. + */ +#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" + +/** + * \brief A variable that lets you manually hint extra gamecontroller db entries. + * + * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h + * + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() + */ +#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" + +/** + * \brief A variable that lets you provide a file with extra gamecontroller db entries. + * + * The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h + * + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() + */ +#define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE" + +/** + * \brief A variable that overrides the automatic controller type detection + * + * The variable should be comma separated entries, in the form: VID/PID=type + * + * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd + * + * The type should be one of: + * Xbox360 + * XboxOne + * PS3 + * PS4 + * PS5 + * SwitchPro + * + * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + */ +#define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE" + +/** + * \brief A variable containing a list of devices to skip when scanning for game controllers. + * + * The format of the string is a comma separated list of USB VID/PID pairs + * in hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named + * file will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES "SDL_GAMECONTROLLER_IGNORE_DEVICES" + +/** + * \brief If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable. + * + * The format of the string is a comma separated list of USB VID/PID pairs + * in hexadecimal form, e.g. + * + * 0xAAAA/0xBBBB,0xCCCC/0xDDDD + * + * The variable can also take the form of @file, in which case the named + * file will be loaded and interpreted as the value of the variable. + */ +#define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT" + +/** + * \brief If set, game controller face buttons report their values according to their labels instead of their positional layout. + * + * For example, on Nintendo Switch controllers, normally you'd get: + * + * (Y) + * (X) (B) + * (A) + * + * but if this hint is set, you'll get: + * + * (X) + * (Y) (A) + * (B) + * + * The variable can be set to the following values: + * "0" - Report the face buttons by position, as though they were on an Xbox controller. + * "1" - Report the face buttons by label instead of position + * + * The default value is "1". This hint may be set at any time. + */ +#define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS" + +/** + * \brief A variable controlling whether grabbing input grabs the keyboard + * + * This variable can be set to the following values: + * "0" - Grab will affect only the mouse + * "1" - Grab will affect mouse and keyboard + * + * By default SDL will not grab the keyboard so system shortcuts still work. + */ +#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" + +/** + * \brief A variable containing a list of devices to ignore in SDL_hid_enumerate() + * + * For example, to ignore the Shanwan DS3 controller and any Valve controller, you might + * have the string "0x2563/0x0523,0x28de/0x0000" + */ +#define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES" + +/** + * \brief A variable controlling whether the idle timer is disabled on iOS. + * + * When an iOS app does not receive touches for some time, the screen is + * dimmed automatically. For games where the accelerometer is the only input + * this is problematic. This functionality can be disabled by setting this + * hint. + * + * As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver() + * accomplish the same thing on iOS. They should be preferred over this hint. + * + * This variable can be set to the following values: + * "0" - Enable idle timer + * "1" - Disable idle timer + */ +#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" + +/** + * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events. + * + * The variable can be set to the following values: + * "0" - SDL_TEXTEDITING events are sent, and it is the application's + * responsibility to render the text from these events and + * differentiate it somehow from committed text. (default) + * "1" - If supported by the IME then SDL_TEXTEDITING events are not sent, + * and text that is being composed will be rendered in its own UI. + */ +#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING" + +/** + * \brief A variable to control whether certain IMEs should show native UI components (such as the Candidate List) instead of suppressing them. + * + * The variable can be set to the following values: + * "0" - Native UI components are not display. (default) + * "1" - Native UI components are displayed. + */ +#define SDL_HINT_IME_SHOW_UI "SDL_IME_SHOW_UI" + +/** + * \brief A variable to control if extended IME text support is enabled. + * If enabled then SDL_TextEditingExtEvent will be issued if the text would be truncated otherwise. + * Additionally SDL_TextInputEvent will be dispatched multiple times so that it is not truncated. + * + * The variable can be set to the following values: + * "0" - Legacy behavior. Text can be truncated, no heap allocations. (default) + * "1" - Modern behavior. + */ +#define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT "SDL_IME_SUPPORT_EXTENDED_TEXT" + +/** + * \brief A variable controlling whether the home indicator bar on iPhone X + * should be hidden. + * + * This variable can be set to the following values: + * "0" - The indicator bar is not hidden (default for windowed applications) + * "1" - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications) + * "2" - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications) + */ +#define SDL_HINT_IOS_HIDE_HOME_INDICATOR "SDL_IOS_HIDE_HOME_INDICATOR" + +/** + * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. + * + * The variable can be set to the following values: + * "0" - Disable joystick & gamecontroller input events when the + * application is in the background. + * "1" - Enable joystick & gamecontroller input events when the + * application is in the background. + * + * The default value is "0". This hint may be set at any time. + */ +#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" + +/** + * \brief A variable controlling whether the HIDAPI joystick drivers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI drivers are not used + * "1" - HIDAPI drivers are used (the default) + * + * This variable is the default for all drivers, but can be overridden by the hints for specific drivers below. + */ +#define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI" + +/** + * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE" + +/** + * \brief A variable controlling whether "low_frequency_rumble" and "high_frequency_rumble" is used to implement + * the GameCube controller's 3 rumble modes, Stop(0), Rumble(1), and StopHard(2) + * this is useful for applications that need full compatibility for things like ADSR envelopes. + * Stop is implemented by setting "low_frequency_rumble" to "0" and "high_frequency_rumble" ">0" + * Rumble is both at any arbitrary value, + * StopHard is implemented by setting both "low_frequency_rumble" and "high_frequency_rumble" to "0" + * + * This variable can be set to the following values: + * "0" - Normal rumble behavior is behavior is used (default) + * "1" - Proper GameCube controller rumble behavior is used + * + */ +#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE "SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE" + +/** + * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch Joy-Cons should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS "SDL_JOYSTICK_HIDAPI_JOY_CONS" + +/** + * \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be combined into a single Pro-like controller when using the HIDAPI driver + * + * This variable can be set to the following values: + * "0" - Left and right Joy-Con controllers will not be combined and each will be a mini-gamepad + * "1" - Left and right Joy-Con controllers will be combined into a single controller (the default) + */ +#define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS" + +/** + * \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver + * + * This variable can be set to the following values: + * "0" - Left and right Joy-Con controllers will not be in vertical mode (the default) + * "1" - Left and right Joy-Con controllers will be in vertical mode + * + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + */ +#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS" + +/** + * \brief A variable controlling whether the HIDAPI driver for Amazon Luna controllers connected via Bluetooth should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_LUNA "SDL_JOYSTICK_HIDAPI_LUNA" + +/** + * \brief A variable controlling whether the HIDAPI driver for Nintendo Online classic controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC "SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC" + +/** + * \brief A variable controlling whether the HIDAPI driver for NVIDIA SHIELD controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD "SDL_JOYSTICK_HIDAPI_SHIELD" + +/** + * \brief A variable controlling whether the HIDAPI driver for PS3 controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI on macOS, and "0" on other platforms. + * + * It is not possible to use this driver on Windows, due to limitations in the default drivers + * installed. See https://github.com/ViGEm/DsHidMini for an alternative driver on Windows. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS3 "SDL_JOYSTICK_HIDAPI_PS3" + +/** + * \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4" + +/** + * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver. + * + * This variable can be set to the following values: + * "0" - extended reports are not enabled (the default) + * "1" - extended reports + * + * Extended input reports allow rumble on Bluetooth PS4 controllers, but + * break DirectInput handling for applications that don't use SDL. + * + * Once extended reports are enabled, they can not be disabled without + * power cycling the controller. + * + * For compatibility with applications written for versions of SDL prior + * to the introduction of PS5 controller support, this value will also + * control the state of extended reports on PS5 controllers when the + * SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE hint is not explicitly set. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE" + +/** + * \brief A variable controlling whether the HIDAPI driver for PS5 controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5" + +/** + * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a PS5 controller. + * + * This variable can be set to the following values: + * "0" - player LEDs are not enabled + * "1" - player LEDs are enabled (the default) + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED" + +/** + * \brief A variable controlling whether extended input reports should be used for PS5 controllers when using the HIDAPI driver. + * + * This variable can be set to the following values: + * "0" - extended reports are not enabled (the default) + * "1" - extended reports + * + * Extended input reports allow rumble on Bluetooth PS5 controllers, but + * break DirectInput handling for applications that don't use SDL. + * + * Once extended reports are enabled, they can not be disabled without + * power cycling the controller. + * + * For compatibility with applications written for versions of SDL prior + * to the introduction of PS5 controller support, this value defaults to + * the value of SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE" + +/** + * \brief A variable controlling whether the HIDAPI driver for Google Stadia controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_STADIA "SDL_JOYSTICK_HIDAPI_STADIA" + +/** + * \brief A variable controlling whether the HIDAPI driver for Bluetooth Steam Controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used for Steam Controllers, which requires Bluetooth access + * and may prompt the user for permission on iOS and Android. + * + * The default is "0" + */ +#define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM" + +/** + * \brief A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH" + +/** + * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Pro controller is opened + * + * This variable can be set to the following values: + * "0" - home button LED is turned off + * "1" - home button LED is turned on + * + * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED" + +/** + * \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Joy-Con controller is opened + * + * This variable can be set to the following values: + * "0" - home button LED is turned off + * "1" - home button LED is turned on + * + * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED "SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED" + +/** + * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Nintendo Switch controller. + * + * This variable can be set to the following values: + * "0" - player LEDs are not enabled + * "1" - player LEDs are enabled (the default) + */ +#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED" + +/** + * \brief A variable controlling whether the HIDAPI driver for Nintendo Wii and Wii U controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * This driver doesn't work with the dolphinbar, so the default is SDL_FALSE for now. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_WII "SDL_JOYSTICK_HIDAPI_WII" + +/** + * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Wii controller. + * + * This variable can be set to the following values: + * "0" - player LEDs are not enabled + * "1" - player LEDs are enabled (the default) + */ +#define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED "SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED" + +/** + * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI + */ +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" + +/** + * \brief A variable controlling whether the HIDAPI driver for XBox 360 controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX + */ +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360" + +/** + * \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller. + * + * This variable can be set to the following values: + * "0" - player LEDs are not enabled + * "1" - player LEDs are enabled (the default) + */ +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED "SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED" + +/** + * \brief A variable controlling whether the HIDAPI driver for XBox 360 wireless controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 + */ +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS" + +/** + * \brief A variable controlling whether the HIDAPI driver for XBox One controllers should be used. + * + * This variable can be set to the following values: + * "0" - HIDAPI driver is not used + * "1" - HIDAPI driver is used + * + * The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX + */ +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE" + +/** + * \brief A variable controlling whether the Home button LED should be turned on when an Xbox One controller is opened + * + * This variable can be set to the following values: + * "0" - home button LED is turned off + * "1" - home button LED is turned on + * + * By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. The default brightness is 0.4. + */ +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED" + +/** + * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices. + * + * This variable can be set to the following values: + * "0" - RAWINPUT drivers are not used + * "1" - RAWINPUT drivers are used (the default) + */ +#define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT" + +/** + * \brief A variable controlling whether the RAWINPUT driver should pull correlated data from XInput. + * + * This variable can be set to the following values: + * "0" - RAWINPUT driver will only use data from raw input APIs + * "1" - RAWINPUT driver will also pull data from XInput, providing + * better trigger axes, guide button presses, and rumble support + * for Xbox controllers + * + * The default is "1". This hint applies to any joysticks opened after setting the hint. + */ +#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT" + +/** + * \brief A variable controlling whether the ROG Chakram mice should show up as joysticks + * + * This variable can be set to the following values: + * "0" - ROG Chakram mice do not show up as joysticks (the default) + * "1" - ROG Chakram mice show up as joysticks + */ +#define SDL_HINT_JOYSTICK_ROG_CHAKRAM "SDL_JOYSTICK_ROG_CHAKRAM" + +/** + * \brief A variable controlling whether a separate thread should be used + * for handling joystick detection and raw input messages on Windows + * + * This variable can be set to the following values: + * "0" - A separate thread is not used (the default) + * "1" - A separate thread is used for handling raw input messages + * + */ +#define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD" + +/** + * \brief A variable controlling whether Windows.Gaming.Input should be used for controller handling. + * + * This variable can be set to the following values: + * "0" - WGI is not used + * "1" - WGI is used (the default) + */ +#define SDL_HINT_JOYSTICK_WGI "SDL_JOYSTICK_WGI" + +/** + * \brief Determines whether SDL enforces that DRM master is required in order + * to initialize the KMSDRM video backend. + * + * The DRM subsystem has a concept of a "DRM master" which is a DRM client that + * has the ability to set planes, set cursor, etc. When SDL is DRM master, it + * can draw to the screen using the SDL rendering APIs. Without DRM master, SDL + * is still able to process input and query attributes of attached displays, + * but it cannot change display state or draw to the screen directly. + * + * In some cases, it can be useful to have the KMSDRM backend even if it cannot + * be used for rendering. An app may want to use SDL for input processing while + * using another rendering API (such as an MMAL overlay on Raspberry Pi) or + * using its own code to render to DRM overlays that SDL doesn't support. + * + * This hint must be set before initializing the video subsystem. + * + * This variable can be set to the following values: + * "0" - SDL will allow usage of the KMSDRM backend without DRM master + * "1" - SDL Will require DRM master to use the KMSDRM backend (default) + */ +#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER" + +/** + * \brief A comma separated list of devices to open as joysticks + * + * This variable is currently only used by the Linux joystick driver. + */ +#define SDL_HINT_JOYSTICK_DEVICE "SDL_JOYSTICK_DEVICE" + +/** + * \brief A variable controlling whether joysticks on Linux will always treat 'hat' axis inputs (ABS_HAT0X - ABS_HAT3Y) as 8-way digital hats without checking whether they may be analog. + * + * This variable can be set to the following values: + * "0" - Only map hat axis inputs to digital hat outputs if the input axes appear to actually be digital (the default) + * "1" - Always handle the input axes numbered ABS_HAT0X to ABS_HAT3Y as digital hats + */ +#define SDL_HINT_LINUX_DIGITAL_HATS "SDL_LINUX_DIGITAL_HATS" + +/** + * \brief A variable controlling whether digital hats on Linux will apply deadzones to their underlying input axes or use unfiltered values. + * + * This variable can be set to the following values: + * "0" - Return digital hat values based on unfiltered input axis values + * "1" - Return digital hat values with deadzones on the input axes taken into account (the default) + */ +#define SDL_HINT_LINUX_HAT_DEADZONES "SDL_LINUX_HAT_DEADZONES" + +/** + * \brief A variable controlling whether to use the classic /dev/input/js* joystick interface or the newer /dev/input/event* joystick interface on Linux + * + * This variable can be set to the following values: + * "0" - Use /dev/input/event* + * "1" - Use /dev/input/js* + * + * By default the /dev/input/event* interfaces are used + */ +#define SDL_HINT_LINUX_JOYSTICK_CLASSIC "SDL_LINUX_JOYSTICK_CLASSIC" + +/** + * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values. + * + * This variable can be set to the following values: + * "0" - Return unfiltered joystick axis values (the default) + * "1" - Return axis values with deadzones taken into account + */ +#define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES" + +/** +* \brief When set don't force the SDL app to become a foreground process +* +* This hint only applies to Mac OS X. +* +*/ +#define SDL_HINT_MAC_BACKGROUND_APP "SDL_MAC_BACKGROUND_APP" + +/** + * \brief A variable that determines whether ctrl+click should generate a right-click event on Mac + * + * If present, holding ctrl while left clicking will generate a right click + * event when on Mac. + */ +#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK" + +/** + * \brief A variable controlling whether dispatching OpenGL context updates should block the dispatching thread until the main thread finishes processing + * + * This variable can be set to the following values: + * "0" - Dispatching OpenGL context updates will block the dispatching thread until the main thread finishes processing (default). + * "1" - Dispatching OpenGL context updates will allow the dispatching thread to continue execution. + * + * Generally you want the default, but if you have OpenGL code in a background thread on a Mac, and the main thread + * hangs because it's waiting for that background thread, but that background thread is also hanging because it's + * waiting for the main thread to do an update, this might fix your issue. + * + * This hint only applies to macOS. + * + * This hint is available since SDL 2.24.0. + * + */ +#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH "SDL_MAC_OPENGL_ASYNC_DISPATCH" + +/** + * \brief A variable setting the double click radius, in pixels. + */ +#define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS "SDL_MOUSE_DOUBLE_CLICK_RADIUS" + +/** + * \brief A variable setting the double click time, in milliseconds. + */ +#define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME "SDL_MOUSE_DOUBLE_CLICK_TIME" + +/** + * \brief Allow mouse click events when clicking to focus an SDL window + * + * This variable can be set to the following values: + * "0" - Ignore mouse clicks that activate a window + * "1" - Generate events for mouse clicks that activate a window + * + * By default SDL will ignore mouse clicks that activate a window + */ +#define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH "SDL_MOUSE_FOCUS_CLICKTHROUGH" + +/** + * \brief A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode + */ +#define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE "SDL_MOUSE_NORMAL_SPEED_SCALE" + +/** + * \brief A variable controlling whether relative mouse mode constrains the mouse to the center of the window + * + * This variable can be set to the following values: + * "0" - Relative mouse mode constrains the mouse to the window + * "1" - Relative mouse mode constrains the mouse to the center of the window + * + * Constraining to the center of the window works better for FPS games and when the + * application is running over RDP. Constraining to the whole window works better + * for 2D games and increases the chance that the mouse will be in the correct + * position when using high DPI mice. + * + * By default SDL will constrain the mouse to the center of the window + */ +#define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER "SDL_MOUSE_RELATIVE_MODE_CENTER" + +/** + * \brief A variable controlling whether relative mouse mode is implemented using mouse warping + * + * This variable can be set to the following values: + * "0" - Relative mouse mode uses raw input + * "1" - Relative mouse mode uses mouse warping + * + * By default SDL will use raw input for relative mouse mode + */ +#define SDL_HINT_MOUSE_RELATIVE_MODE_WARP "SDL_MOUSE_RELATIVE_MODE_WARP" + +/** + * \brief A variable controlling whether relative mouse motion is affected by renderer scaling + * + * This variable can be set to the following values: + * "0" - Relative motion is unaffected by DPI or renderer's logical size + * "1" - Relative motion is scaled according to DPI scaling and logical size + * + * By default relative mouse deltas are affected by DPI and renderer scaling + */ +#define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING" + +/** + * \brief A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode + */ +#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE" + +/** + * \brief A variable controlling whether the system mouse acceleration curve is used for relative mouse motion. + * + * This variable can be set to the following values: + * "0" - Relative mouse motion will be unscaled (the default) + * "1" - Relative mouse motion will be scaled using the system mouse acceleration curve. + * + * If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will override the system speed scale. + */ +#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE" + +/** + * \brief A variable controlling whether a motion event should be generated for mouse warping in relative mode. + * + * This variable can be set to the following values: + * "0" - Warping the mouse will not generate a motion event in relative mode + * "1" - Warping the mouse will generate a motion event in relative mode + * + * By default warping the mouse will not generate motion events in relative mode. This avoids the application having to filter out large relative motion due to warping. + */ +#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION" + +/** + * \brief A variable controlling whether mouse events should generate synthetic touch events + * + * This variable can be set to the following values: + * "0" - Mouse events will not generate touch events (default for desktop platforms) + * "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS) + */ +#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS" + +/** + * \brief A variable controlling whether the mouse is captured while mouse buttons are pressed + * + * This variable can be set to the following values: + * "0" - The mouse is not captured while mouse buttons are pressed + * "1" - The mouse is captured while mouse buttons are pressed + * + * By default the mouse is captured while mouse buttons are pressed so if the mouse is dragged + * outside the window, the application continues to receive mouse events until the button is + * released. + */ +#define SDL_HINT_MOUSE_AUTO_CAPTURE "SDL_MOUSE_AUTO_CAPTURE" + +/** + * \brief Tell SDL not to catch the SIGINT or SIGTERM signals. + * + * This hint only applies to Unix-like platforms, and should set before + * any calls to SDL_Init() + * + * The variable can be set to the following values: + * "0" - SDL will install a SIGINT and SIGTERM handler, and when it + * catches a signal, convert it into an SDL_QUIT event. + * "1" - SDL will not install a signal handler at all. + */ +#define SDL_HINT_NO_SIGNAL_HANDLERS "SDL_NO_SIGNAL_HANDLERS" + +/** + * \brief A variable controlling what driver to use for OpenGL ES contexts. + * + * On some platforms, currently Windows and X11, OpenGL drivers may support + * creating contexts with an OpenGL ES profile. By default SDL uses these + * profiles, when available, otherwise it attempts to load an OpenGL ES + * library, e.g. that provided by the ANGLE project. This variable controls + * whether SDL follows this default behaviour or will always load an + * OpenGL ES library. + * + * Circumstances where this is useful include + * - Testing an app with a particular OpenGL ES implementation, e.g ANGLE, + * or emulator, e.g. those from ARM, Imagination or Qualcomm. + * - Resolving OpenGL ES function addresses at link time by linking with + * the OpenGL ES library instead of querying them at run time with + * SDL_GL_GetProcAddress(). + * + * Caution: for an application to work with the default behaviour across + * different OpenGL drivers it must query the OpenGL ES function + * addresses at run time using SDL_GL_GetProcAddress(). + * + * This variable is ignored on most platforms because OpenGL ES is native + * or not supported. + * + * This variable can be set to the following values: + * "0" - Use ES profile of OpenGL, if available. (Default when not set.) + * "1" - Load OpenGL ES library using the default library names. + * + */ +#define SDL_HINT_OPENGL_ES_DRIVER "SDL_OPENGL_ES_DRIVER" + +/** + * \brief A variable controlling which orientations are allowed on iOS/Android. + * + * In some circumstances it is necessary to be able to explicitly control + * which UI orientations are allowed. + * + * This variable is a space delimited list of the following values: + * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" + */ +#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" + +/** + * \brief A variable controlling the use of a sentinel event when polling the event queue + * + * This variable can be set to the following values: + * "0" - Disable poll sentinels + * "1" - Enable poll sentinels + * + * When polling for events, SDL_PumpEvents is used to gather new events from devices. + * If a device keeps producing new events between calls to SDL_PumpEvents, a poll loop will + * become stuck until the new events stop. + * This is most noticeable when moving a high frequency mouse. + * + * By default, poll sentinels are enabled. + */ +#define SDL_HINT_POLL_SENTINEL "SDL_POLL_SENTINEL" + +/** + * \brief Override for SDL_GetPreferredLocales() + * + * If set, this will be favored over anything the OS might report for the + * user's preferred locales. Changing this hint at runtime will not generate + * a SDL_LOCALECHANGED event (but if you can change the hint, you can push + * your own event, if you want). + * + * The format of this hint is a comma-separated list of language and locale, + * combined with an underscore, as is a common format: "en_GB". Locale is + * optional: "en". So you might have a list like this: "en_GB,jp,es_PT" + */ +#define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES" + +/** + * \brief A variable describing the content orientation on QtWayland-based platforms. + * + * On QtWayland platforms, windows are rotated client-side to allow for custom + * transitions. In order to correctly position overlays (e.g. volume bar) and + * gestures (e.g. events view, close/minimize gestures), the system needs to + * know in which orientation the application is currently drawing its contents. + * + * This does not cause the window to be rotated or resized, the application + * needs to take care of drawing the content in the right orientation (the + * framebuffer is always in portrait mode). + * + * This variable can be one of the following values: + * "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape" + * + * Since SDL 2.0.22 this variable accepts a comma-separated list of values above. + */ +#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION" + +/** + * \brief Flags to set on QtWayland windows to integrate with the native window manager. + * + * On QtWayland platforms, this hint controls the flags to set on the windows. + * For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures. + * + * This variable is a space-separated list of the following values (empty = no flags): + * "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager" + */ +#define SDL_HINT_QTWAYLAND_WINDOW_FLAGS "SDL_QTWAYLAND_WINDOW_FLAGS" + +/** + * \brief A variable controlling whether the 2D render API is compatible or efficient. + * + * This variable can be set to the following values: + * + * "0" - Don't use batching to make rendering more efficient. + * "1" - Use batching, but might cause problems if app makes its own direct OpenGL calls. + * + * Up to SDL 2.0.9, the render API would draw immediately when requested. Now + * it batches up draw requests and sends them all to the GPU only when forced + * to (during SDL_RenderPresent, when changing render targets, by updating a + * texture that the batch needs, etc). This is significantly more efficient, + * but it can cause problems for apps that expect to render on top of the + * render API's output. As such, SDL will disable batching if a specific + * render backend is requested (since this might indicate that the app is + * planning to use the underlying graphics API directly). This hint can + * be used to explicitly request batching in this instance. It is a contract + * that you will either never use the underlying graphics API directly, or + * if you do, you will call SDL_RenderFlush() before you do so any current + * batch goes to the GPU before your work begins. Not following this contract + * will result in undefined behavior. + */ +#define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING" + +/** + * \brief A variable controlling how the 2D render API renders lines + * + * This variable can be set to the following values: + * "0" - Use the default line drawing method (Bresenham's line algorithm as of SDL 2.0.20) + * "1" - Use the driver point API using Bresenham's line algorithm (correct, draws many points) + * "2" - Use the driver line API (occasionally misses line endpoints based on hardware driver quirks, was the default before 2.0.20) + * "3" - Use the driver geometry API (correct, draws thicker diagonal lines) + * + * This variable should be set when the renderer is created. + */ +#define SDL_HINT_RENDER_LINE_METHOD "SDL_RENDER_LINE_METHOD" + +/** + * \brief A variable controlling whether to enable Direct3D 11+'s Debug Layer. + * + * This variable does not have any effect on the Direct3D 9 based renderer. + * + * This variable can be set to the following values: + * "0" - Disable Debug Layer use + * "1" - Enable Debug Layer use + * + * By default, SDL does not use Direct3D Debug Layer. + */ +#define SDL_HINT_RENDER_DIRECT3D11_DEBUG "SDL_RENDER_DIRECT3D11_DEBUG" + +/** + * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations. + * + * This variable can be set to the following values: + * "0" - Thread-safety is not enabled (faster) + * "1" - Thread-safety is enabled + * + * By default the Direct3D device is created with thread-safety disabled. + */ +#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" + +/** + * \brief A variable specifying which render driver to use. + * + * If the application doesn't pick a specific renderer to use, this variable + * specifies the name of the preferred renderer. If the preferred renderer + * can't be initialized, the normal default renderer is used. + * + * This variable is case insensitive and can be set to the following values: + * "direct3d" + * "direct3d11" + * "direct3d12" + * "opengl" + * "opengles2" + * "opengles" + * "metal" + * "software" + * + * The default varies by platform, but it's the first one in the list that + * is available on the current platform. + */ +#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" + +/** + * \brief A variable controlling the scaling policy for SDL_RenderSetLogicalSize. + * + * This variable can be set to the following values: + * "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen + * "1" or "overscan" - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen + * + * By default letterbox is used + */ +#define SDL_HINT_RENDER_LOGICAL_SIZE_MODE "SDL_RENDER_LOGICAL_SIZE_MODE" + +/** + * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available. + * + * This variable can be set to the following values: + * "0" - Disable shaders + * "1" - Enable shaders + * + * By default shaders are used if OpenGL supports them. + */ +#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS" + +/** + * \brief A variable controlling the scaling quality + * + * This variable can be set to the following values: + * "0" or "nearest" - Nearest pixel sampling + * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) + * "2" or "best" - Currently this is the same as "linear" + * + * By default nearest pixel sampling is used + */ +#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY" + +/** + * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. + * + * This variable can be set to the following values: + * "0" - Disable vsync + * "1" - Enable vsync + * + * By default SDL does not sync screen surface updates with vertical refresh. + */ +#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" + +/** + * \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS + * + * This variable can be set to the following values: + * "0" - It will be using VSYNC as defined in the main flag. Default + * "1" - If VSYNC was previously enabled, then it will disable VSYNC if doesn't reach enough speed + * + * By default SDL does not enable the automatic VSYNC + */ +#define SDL_HINT_PS2_DYNAMIC_VSYNC "SDL_PS2_DYNAMIC_VSYNC" + +/** + * \brief A variable to control whether the return key on the soft keyboard + * should hide the soft keyboard on Android and iOS. + * + * The variable can be set to the following values: + * "0" - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default) + * "1" - The return key will hide the keyboard. + * + * The value of this hint is used at runtime, so it can be changed at any time. + */ +#define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME" + +/** + * \brief Tell SDL which Dispmanx layer to use on a Raspberry PI + * + * Also known as Z-order. The variable can take a negative or positive value. + * The default is 10000. + */ +#define SDL_HINT_RPI_VIDEO_LAYER "SDL_RPI_VIDEO_LAYER" + +/** + * \brief Specify an "activity name" for screensaver inhibition. + * + * Some platforms, notably Linux desktops, list the applications which are + * inhibiting the screensaver or other power-saving features. + * + * This hint lets you specify the "activity name" sent to the OS when + * SDL_DisableScreenSaver() is used (or the screensaver is automatically + * disabled). The contents of this hint are used when the screensaver is + * disabled. You should use a string that describes what your program is doing + * (and, therefore, why the screensaver is disabled). For example, "Playing a + * game" or "Watching a video". + * + * Setting this to "" or leaving it unset will have SDL use a reasonable + * default: "Playing a game" or something similar. + * + * On targets where this is not supported, this hint does nothing. + */ +#define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME" + +/** + * \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime. + * + * On some platforms, like Linux, a realtime priority thread may be subject to restrictions + * that require special handling by the application. This hint exists to let SDL know that + * the app is prepared to handle said restrictions. + * + * On Linux, SDL will apply the following configuration to any thread that becomes realtime: + * * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy, + * * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit. + * * Exceeding this limit will result in the kernel sending SIGKILL to the app, + * * Refer to the man pages for more information. + * + * This variable can be set to the following values: + * "0" - default platform specific behaviour + * "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy + */ +#define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL" + +/** +* \brief A string specifying additional information to use with SDL_SetThreadPriority. +* +* By default SDL_SetThreadPriority will make appropriate system changes in order to +* apply a thread priority. For example on systems using pthreads the scheduler policy +* is changed automatically to a policy that works well with a given priority. +* Code which has specific requirements can override SDL's default behavior with this hint. +* +* pthread hint values are "current", "other", "fifo" and "rr". +* Currently no other platform hint values are defined but may be in the future. +* +* \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro +* configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME +* after calling SDL_SetThreadPriority(). +*/ +#define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY" + +/** +* \brief A string specifying SDL's threads stack size in bytes or "0" for the backend's default size +* +* Use this hint in case you need to set SDL's threads stack size to other than the default. +* This is specially useful if you build SDL against a non glibc libc library (such as musl) which +* provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses). +* Support for this hint is currently available only in the pthread, Windows, and PSP backend. +* +* Instead of this hint, in 2.0.9 and later, you can use +* SDL_CreateThreadWithStackSize(). This hint only works with the classic +* SDL_CreateThread(). +*/ +#define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE" + +/** + * \brief A variable that controls the timer resolution, in milliseconds. + * + * The higher resolution the timer, the more frequently the CPU services + * timer interrupts, and the more precise delays are, but this takes up + * power and CPU time. This hint is only used on Windows. + * + * See this blog post for more information: + * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ + * + * If this variable is set to "0", the system timer resolution is not set. + * + * The default value is "1". This hint may be set at any time. + */ +#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" + +/** + * \brief A variable controlling whether touch events should generate synthetic mouse events + * + * This variable can be set to the following values: + * "0" - Touch events will not generate mouse events + * "1" - Touch events will generate mouse events + * + * By default SDL will generate mouse events for touch events + */ +#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS" + +/** + * \brief A variable controlling which touchpad should generate synthetic mouse events + * + * This variable can be set to the following values: + * "0" - Only front touchpad should generate mouse events. Default + * "1" - Only back touchpad should generate mouse events. + * "2" - Both touchpads should generate mouse events. + * + * By default SDL will generate mouse events for all touch devices + */ +#define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE "SDL_HINT_VITA_TOUCH_MOUSE_DEVICE" + +/** + * \brief A variable controlling whether the Android / tvOS remotes + * should be listed as joystick devices, instead of sending keyboard events. + * + * This variable can be set to the following values: + * "0" - Remotes send enter/escape/arrow key events + * "1" - Remotes are available as 2 axis, 2 button joysticks (the default). + */ +#define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK" + +/** + * \brief A variable controlling whether the screensaver is enabled. + * + * This variable can be set to the following values: + * "0" - Disable screensaver + * "1" - Enable screensaver + * + * By default SDL will disable the screensaver. + */ +#define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER" + +/** + * \brief Tell the video driver that we only want a double buffer. + * + * By default, most lowlevel 2D APIs will use a triple buffer scheme that + * wastes no CPU time on waiting for vsync after issuing a flip, but + * introduces a frame of latency. On the other hand, using a double buffer + * scheme instead is recommended for cases where low latency is an important + * factor because we save a whole frame of latency. + * We do so by waiting for vsync immediately after issuing a flip, usually just + * after eglSwapBuffers call in the backend's *_SwapWindow function. + * + * Since it's driver-specific, it's only supported where possible and + * implemented. Currently supported the following drivers: + * + * - KMSDRM (kmsdrm) + * - Raspberry Pi (raspberrypi) + */ +#define SDL_HINT_VIDEO_DOUBLE_BUFFER "SDL_VIDEO_DOUBLE_BUFFER" + +/** + * \brief A variable controlling whether the EGL window is allowed to be + * composited as transparent, rather than opaque. + * + * Most window systems will always render windows opaque, even if the surface + * format has an alpha channel. This is not always true, however, so by default + * SDL will try to enforce opaque composition. To override this behavior, you + * can set this hint to "1". + */ +#define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY "SDL_VIDEO_EGL_ALLOW_TRANSPARENCY" + +/** + * \brief A variable controlling whether the graphics context is externally managed. + * + * This variable can be set to the following values: + * "0" - SDL will manage graphics contexts that are attached to windows. + * "1" - Disable graphics context management on windows. + * + * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the + * context will be automatically saved and restored when pausing the application. Additionally, some + * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this + * behavior, which is desireable when the application manages the graphics context, such as + * an externally managed OpenGL context or attaching a Vulkan surface to the window. + */ +#define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT" + +/** + * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS) + */ +#define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED" + +/** + * \brief A variable that dictates policy for fullscreen Spaces on Mac OS X. + * + * This hint only applies to Mac OS X. + * + * The variable can be set to the following values: + * "0" - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and + * SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen" + * button on their titlebars). + * "1" - Enable Spaces support (FULLSCREEN_DESKTOP will use them and + * SDL_WINDOW_RESIZABLE windows will offer the "fullscreen" + * button on their titlebars). + * + * The default value is "1". This hint must be set before any windows are created. + */ +#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES" + +/** + * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false. + * \warning Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're + * seeing if "true" causes more problems than it solves in modern times. + * + */ +#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" + +/** + * \brief A variable controlling whether the libdecor Wayland backend is allowed to be used. + * + * This variable can be set to the following values: + * "0" - libdecor use is disabled. + * "1" - libdecor use is enabled (default). + * + * libdecor is used over xdg-shell when xdg-decoration protocol is unavailable. + */ +#define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR" + +/** + * \brief A variable controlling whether the libdecor Wayland backend is preferred over native decrations. + * + * When this hint is set, libdecor will be used to provide window decorations, even if xdg-decoration is + * available. (Note that, by default, libdecor will use xdg-decoration itself if available). + * + * This variable can be set to the following values: + * "0" - libdecor is enabled only if server-side decorations are unavailable. + * "1" - libdecor is always enabled if available. + * + * libdecor is used over xdg-shell when xdg-decoration protocol is unavailable. + */ +#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR" + +/** + * \brief A variable controlling whether video mode emulation is enabled under Wayland. + * + * When this hint is set, a standard set of emulated CVT video modes will be exposed for use by the application. + * If it is disabled, the only modes exposed will be the logical desktop size and, in the case of a scaled + * desktop, the native display resolution. + * + * This variable can be set to the following values: + * "0" - Video mode emulation is disabled. + * "1" - Video mode emulation is enabled. + * + * By default video mode emulation is enabled. + */ +#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION "SDL_VIDEO_WAYLAND_MODE_EMULATION" + +/** + * \brief Enable or disable mouse pointer warp emulation, needed by some older games. + * + * When this hint is set, any SDL will emulate mouse warps using relative mouse mode. + * This is required for some older games (such as Source engine games), which warp the + * mouse to the centre of the screen rather than using relative mouse motion. Note that + * relative mouse mode may have different mouse acceleration behaviour than pointer warps. + * + * This variable can be set to the following values: + * "0" - All mouse warps fail, as mouse warping is not available under wayland. + * "1" - Some mouse warps will be emulated by forcing relative mouse mode. + * + * If not set, this is automatically enabled unless an application uses relative mouse + * mode directly. + */ +#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP "SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP" + +/** +* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p"). +* +* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has +* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly +* created SDL_Window: +* +* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is +* needed for example when sharing an OpenGL context across multiple windows. +* +* 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for +* OpenGL rendering. +* +* This variable can be set to the following values: +* The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should +* share a pixel format with. +*/ +#define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT" + +/** + * \brief When calling SDL_CreateWindowFrom(), make the window compatible with OpenGL. + * + * This variable can be set to the following values: + * "0" - Don't add any graphics flags to the SDL_WindowFlags + * "1" - Add SDL_WINDOW_OPENGL to the SDL_WindowFlags + * + * By default SDL will not make the foreign window compatible with OpenGL. + */ +#define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL "SDL_VIDEO_FOREIGN_WINDOW_OPENGL" + +/** + * \brief When calling SDL_CreateWindowFrom(), make the window compatible with Vulkan. + * + * This variable can be set to the following values: + * "0" - Don't add any graphics flags to the SDL_WindowFlags + * "1" - Add SDL_WINDOW_VULKAN to the SDL_WindowFlags + * + * By default SDL will not make the foreign window compatible with Vulkan. + */ +#define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN "SDL_VIDEO_FOREIGN_WINDOW_VULKAN" + +/** +* \brief A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries +* +* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It +* can use two different sets of binaries, those compiled by the user from source +* or those provided by the Chrome browser. In the later case, these binaries require +* that SDL loads a DLL providing the shader compiler. +* +* This variable can be set to the following values: +* "d3dcompiler_46.dll" - default, best for Vista or later. +* "d3dcompiler_43.dll" - for XP support. +* "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries. +* +*/ +#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER" + +/** + * \brief A variable controlling whether X11 should use GLX or EGL by default + * + * This variable can be set to the following values: + * "0" - Use GLX + * "1" - Use EGL + * + * By default SDL will use GLX when both are present. + */ +#define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL" + +/** + * \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used. + * + * This variable can be set to the following values: + * "0" - Disable _NET_WM_BYPASS_COMPOSITOR + * "1" - Enable _NET_WM_BYPASS_COMPOSITOR + * + * By default SDL will use _NET_WM_BYPASS_COMPOSITOR + * + */ +#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR" + +/** + * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported. + * + * This variable can be set to the following values: + * "0" - Disable _NET_WM_PING + * "1" - Enable _NET_WM_PING + * + * By default SDL will use _NET_WM_PING, but for applications that know they + * will not always be able to respond to ping requests in a timely manner they can + * turn it off to avoid the window manager thinking the app is hung. + * The hint is checked in CreateWindow. + */ +#define SDL_HINT_VIDEO_X11_NET_WM_PING "SDL_VIDEO_X11_NET_WM_PING" + +/** + * \brief A variable forcing the visual ID chosen for new X11 windows + * + */ +#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID" + +/** + * \brief A no-longer-used variable controlling whether the X11 Xinerama extension should be used. + * + * Before SDL 2.0.24, this would let apps and users disable Xinerama support on X11. + * Now SDL never uses Xinerama, and does not check for this hint at all. + * The preprocessor define is left here for source compatibility. + */ +#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA" + +/** + * \brief A variable controlling whether the X11 XRandR extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable XRandR + * "1" - Enable XRandR + * + * By default SDL will use XRandR. + */ +#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" + +/** + * \brief A no-longer-used variable controlling whether the X11 VidMode extension should be used. + * + * Before SDL 2.0.24, this would let apps and users disable XVidMode support on X11. + * Now SDL never uses XVidMode, and does not check for this hint at all. + * The preprocessor define is left here for source compatibility. + */ +#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE" + +/** + * \brief Controls how the fact chunk affects the loading of a WAVE file. + * + * The fact chunk stores information about the number of samples of a WAVE + * file. The Standards Update from Microsoft notes that this value can be used + * to 'determine the length of the data in seconds'. This is especially useful + * for compressed formats (for which this is a mandatory chunk) if they produce + * multiple sample frames per block and truncating the block is not allowed. + * The fact chunk can exactly specify how many sample frames there should be + * in this case. + * + * Unfortunately, most application seem to ignore the fact chunk and so SDL + * ignores it by default as well. + * + * This variable can be set to the following values: + * + * "truncate" - Use the number of samples to truncate the wave data if + * the fact chunk is present and valid + * "strict" - Like "truncate", but raise an error if the fact chunk + * is invalid, not present for non-PCM formats, or if the + * data chunk doesn't have that many samples + * "ignorezero" - Like "truncate", but ignore fact chunk if the number of + * samples is zero + * "ignore" - Ignore fact chunk entirely (default) + */ +#define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK" + +/** + * \brief Controls how the size of the RIFF chunk affects the loading of a WAVE file. + * + * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE + * file) is not always reliable. In case the size is wrong, it's possible to + * just ignore it and step through the chunks until a fixed limit is reached. + * + * Note that files that have trailing data unrelated to the WAVE file or + * corrupt files may slow down the loading process without a reliable boundary. + * By default, SDL stops after 10000 chunks to prevent wasting time. Use the + * environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value. + * + * This variable can be set to the following values: + * + * "force" - Always use the RIFF chunk size as a boundary for the chunk search + * "ignorezero" - Like "force", but a zero size searches up to 4 GiB (default) + * "ignore" - Ignore the RIFF chunk size and always search up to 4 GiB + * "maximum" - Search for chunks until the end of file (not recommended) + */ +#define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE" + +/** + * \brief Controls how a truncated WAVE file is handled. + * + * A WAVE file is considered truncated if any of the chunks are incomplete or + * the data chunk size is not a multiple of the block size. By default, SDL + * decodes until the first incomplete block, as most applications seem to do. + * + * This variable can be set to the following values: + * + * "verystrict" - Raise an error if the file is truncated + * "strict" - Like "verystrict", but the size of the RIFF chunk is ignored + * "dropframe" - Decode until the first incomplete sample frame + * "dropblock" - Decode until the first incomplete block (default) + */ +#define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION" + +/** + * \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception. + * The 0x406D1388 Exception is a trick used to inform Visual Studio of a + * thread's name, but it tends to cause problems with other debuggers, + * and the .NET runtime. Note that SDL 2.0.6 and later will still use + * the (safer) SetThreadDescription API, introduced in the Windows 10 + * Creators Update, if available. + * + * The variable can be set to the following values: + * "0" - SDL will raise the 0x406D1388 Exception to name threads. + * This is the default behavior of SDL <= 2.0.4. + * "1" - SDL will not raise this exception, and threads will be unnamed. (default) + * This is necessary with .NET languages or debuggers that aren't Visual Studio. + */ +#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING" + +/** + * \brief Controls whether menus can be opened with their keyboard shortcut (Alt+mnemonic). + * + * If the mnemonics are enabled, then menus can be opened by pressing the Alt + * key and the corresponding mnemonic (for example, Alt+F opens the File menu). + * However, in case an invalid mnemonic is pressed, Windows makes an audible + * beep to convey that nothing happened. This is true even if the window has + * no menu at all! + * + * Because most SDL applications don't have menus, and some want to use the Alt + * key for other purposes, SDL disables mnemonics (and the beeping) by default. + * + * Note: This also affects keyboard events: with mnemonics enabled, when a + * menu is opened from the keyboard, you will not receive a KEYUP event for + * the mnemonic key, and *might* not receive one for Alt. + * + * This variable can be set to the following values: + * "0" - Alt+mnemonic does nothing, no beeping. (default) + * "1" - Alt+mnemonic opens menus, invalid mnemonics produce a beep. + */ +#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS "SDL_WINDOWS_ENABLE_MENU_MNEMONICS" + +/** + * \brief A variable controlling whether the windows message loop is processed by SDL + * + * This variable can be set to the following values: + * "0" - The window message loop is not run + * "1" - The window message loop is processed in SDL_PumpEvents() + * + * By default SDL will process the windows message loop + */ +#define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP" + +/** + * \brief Force SDL to use Critical Sections for mutexes on Windows. + * On Windows 7 and newer, Slim Reader/Writer Locks are available. + * They offer better performance, allocate no kernel ressources and + * use less memory. SDL will fall back to Critical Sections on older + * OS versions or if forced to by this hint. + * + * This variable can be set to the following values: + * "0" - Use SRW Locks when available. If not, fall back to Critical Sections. (default) + * "1" - Force the use of Critical Sections in all cases. + * + */ +#define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS" + +/** + * \brief Force SDL to use Kernel Semaphores on Windows. + * Kernel Semaphores are inter-process and require a context + * switch on every interaction. On Windows 8 and newer, the + * WaitOnAddress API is available. Using that and atomics to + * implement semaphores increases performance. + * SDL will fall back to Kernel Objects on older OS versions + * or if forced to by this hint. + * + * This variable can be set to the following values: + * "0" - Use Atomics and WaitOnAddress API when available. If not, fall back to Kernel Objects. (default) + * "1" - Force the use of Kernel Objects in all cases. + * + */ +#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL" + +/** + * \brief A variable to specify custom icon resource id from RC file on Windows platform + */ +#define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON" +#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL" + +/** + * \brief Tell SDL not to generate window-close events for Alt+F4 on Windows. + * + * The variable can be set to the following values: + * "0" - SDL will generate a window-close event when it sees Alt+F4. + * "1" - SDL will only do normal key handling for Alt+F4. + */ +#define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4" + +/** + * \brief Use the D3D9Ex API introduced in Windows Vista, instead of normal D3D9. + * Direct3D 9Ex contains changes to state management that can eliminate device + * loss errors during scenarios like Alt+Tab or UAC prompts. D3D9Ex may require + * some changes to your application to cope with the new behavior, so this + * is disabled by default. + * + * This hint must be set before initializing the video subsystem. + * + * For more information on Direct3D 9Ex, see: + * - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/graphics-apis-in-windows-vista#direct3d-9ex + * - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/direct3d-9ex-improvements + * + * This variable can be set to the following values: + * "0" - Use the original Direct3D 9 API (default) + * "1" - Use the Direct3D 9Ex API on Vista and later (and fall back if D3D9Ex is unavailable) + * + */ +#define SDL_HINT_WINDOWS_USE_D3D9EX "SDL_WINDOWS_USE_D3D9EX" + +/** + * \brief Controls whether SDL will declare the process to be DPI aware. + * + * This hint must be set before initializing the video subsystem. + * + * The main purpose of declaring DPI awareness is to disable OS bitmap scaling of SDL windows on monitors with + * a DPI scale factor. + * + * This hint is equivalent to requesting DPI awareness via external means (e.g. calling SetProcessDpiAwarenessContext) + * and does not cause SDL to use a virtualized coordinate system, so it will generally give you 1 SDL coordinate = 1 pixel + * even on high-DPI displays. + * + * For more information, see: + * https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows + * + * This variable can be set to the following values: + * "" - Do not change the DPI awareness (default). + * "unaware" - Declare the process as DPI unaware. (Windows 8.1 and later). + * "system" - Request system DPI awareness. (Vista and later). + * "permonitor" - Request per-monitor DPI awareness. (Windows 8.1 and later). + * "permonitorv2" - Request per-monitor V2 DPI awareness. (Windows 10, version 1607 and later). + * The most visible difference from "permonitor" is that window title bar will be scaled + * to the visually correct size when dragging between monitors with different scale factors. + * This is the preferred DPI awareness level. + * + * If the requested DPI awareness is not available on the currently running OS, SDL will try to request the best + * available match. + */ +#define SDL_HINT_WINDOWS_DPI_AWARENESS "SDL_WINDOWS_DPI_AWARENESS" + +/** + * \brief Uses DPI-scaled points as the SDL coordinate system on Windows. + * + * This changes the SDL coordinate system units to be DPI-scaled points, rather than pixels everywhere. + * This means windows will be appropriately sized, even when created on high-DPI displays with scaling. + * + * e.g. requesting a 640x480 window from SDL, on a display with 125% scaling in Windows display settings, + * will create a window with an 800x600 client area (in pixels). + * + * Setting this to "1" implicitly requests process DPI awareness (setting SDL_WINDOWS_DPI_AWARENESS is unnecessary), + * and forces SDL_WINDOW_ALLOW_HIGHDPI on all windows. + * + * This variable can be set to the following values: + * "0" - SDL coordinates equal Windows coordinates. No automatic window resizing when dragging + * between monitors with different scale factors (unless this is performed by + * Windows itself, which is the case when the process is DPI unaware). + * "1" - SDL coordinates are in DPI-scaled points. Automatically resize windows as needed on + * displays with non-100% scale factors. + */ +#define SDL_HINT_WINDOWS_DPI_SCALING "SDL_WINDOWS_DPI_SCALING" + +/** + * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden + * + * This variable can be set to the following values: + * "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc) + * "1" - The window frame is interactive when the cursor is hidden + * + * By default SDL will allow interaction with the window frame when the cursor is hidden + */ +#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN" + +/** +* \brief A variable controlling whether the window is activated when the SDL_ShowWindow function is called +* +* This variable can be set to the following values: +* "0" - The window is activated when the SDL_ShowWindow function is called +* "1" - The window is not activated when the SDL_ShowWindow function is called +* +* By default SDL will activate the window when the SDL_ShowWindow function is called +*/ +#define SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN "SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN" + +/** \brief Allows back-button-press events on Windows Phone to be marked as handled + * + * Windows Phone devices typically feature a Back button. When pressed, + * the OS will emit back-button-press events, which apps are expected to + * handle in an appropriate manner. If apps do not explicitly mark these + * events as 'Handled', then the OS will invoke its default behavior for + * unhandled back-button-press events, which on Windows Phone 8 and 8.1 is to + * terminate the app (and attempt to switch to the previous app, or to the + * device's home screen). + * + * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL + * to mark back-button-press events as Handled, if and when one is sent to + * the app. + * + * Internally, Windows Phone sends back button events as parameters to + * special back-button-press callback functions. Apps that need to respond + * to back-button-press events are expected to register one or more + * callback functions for such, shortly after being launched (during the + * app's initialization phase). After the back button is pressed, the OS + * will invoke these callbacks. If the app's callback(s) do not explicitly + * mark the event as handled by the time they return, or if the app never + * registers one of these callback, the OS will consider the event + * un-handled, and it will apply its default back button behavior (terminate + * the app). + * + * SDL registers its own back-button-press callback with the Windows Phone + * OS. This callback will emit a pair of SDL key-press events (SDL_KEYDOWN + * and SDL_KEYUP), each with a scancode of SDL_SCANCODE_AC_BACK, after which + * it will check the contents of the hint, SDL_HINT_WINRT_HANDLE_BACK_BUTTON. + * If the hint's value is set to "1", the back button event's Handled + * property will get set to 'true'. If the hint's value is set to something + * else, or if it is unset, SDL will leave the event's Handled property + * alone. (By default, the OS sets this property to 'false', to note.) + * + * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a + * back button is pressed, or can set it in direct-response to a back button + * being pressed. + * + * In order to get notified when a back button is pressed, SDL apps should + * register a callback function with SDL_AddEventWatch(), and have it listen + * for SDL_KEYDOWN events that have a scancode of SDL_SCANCODE_AC_BACK. + * (Alternatively, SDL_KEYUP events can be listened-for. Listening for + * either event type is suitable.) Any value of SDL_HINT_WINRT_HANDLE_BACK_BUTTON + * set by such a callback, will be applied to the OS' current + * back-button-press event. + * + * More details on back button behavior in Windows Phone apps can be found + * at the following page, on Microsoft's developer site: + * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx + */ +#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON" + +/** \brief Label text for a WinRT app's privacy policy link + * + * Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT, + * Microsoft mandates that this policy be available via the Windows Settings charm. + * SDL provides code to add a link there, with its label text being set via the + * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. + * + * Please note that a privacy policy's contents are not set via this hint. A separate + * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the + * policy. + * + * The contents of this hint should be encoded as a UTF8 string. + * + * The default value is "Privacy Policy". This hint should only be set during app + * initialization, preferably before any calls to SDL_Init(). + * + * For additional information on linking to a privacy policy, see the documentation for + * SDL_HINT_WINRT_PRIVACY_POLICY_URL. + */ +#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL" + +/** + * \brief A URL to a WinRT app's privacy policy + * + * All network-enabled WinRT apps must make a privacy policy available to its + * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be + * be available in the Windows Settings charm, as accessed from within the app. + * SDL provides code to add a URL-based link there, which can point to the app's + * privacy policy. + * + * To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL + * before calling any SDL_Init() functions. The contents of the hint should + * be a valid URL. For example, "http://www.example.com". + * + * The default value is "", which will prevent SDL from adding a privacy policy + * link to the Settings charm. This hint should only be set during app init. + * + * The label text of an app's "Privacy Policy" link may be customized via another + * hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. + * + * Please note that on Windows Phone, Microsoft does not provide standard UI + * for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL + * will not get used on that platform. Network-enabled phone apps should display + * their privacy policy through some other, in-app means. + */ +#define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL" + +/** + * \brief Mark X11 windows as override-redirect. + * + * If set, this _might_ increase framerate at the expense of the desktop + * not working as expected. Override-redirect windows aren't noticed by the + * window manager at all. + * + * You should probably only use this for fullscreen windows, and you probably + * shouldn't even use it for that. But it's here if you want to try! + */ +#define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT "SDL_X11_FORCE_OVERRIDE_REDIRECT" + +/** + * \brief A variable that lets you disable the detection and use of Xinput gamepad devices + * + * The variable can be set to the following values: + * "0" - Disable XInput detection (only uses direct input) + * "1" - Enable XInput detection (the default) + */ +#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" + + /** + * \brief A variable that lets you disable the detection and use of DirectInput gamepad devices + * + * The variable can be set to the following values: + * "0" - Disable DirectInput detection (only uses XInput) + * "1" - Enable DirectInput detection (the default) + */ +#define SDL_HINT_DIRECTINPUT_ENABLED "SDL_DIRECTINPUT_ENABLED" + +/** + * \brief A variable that causes SDL to use the old axis and button mapping for XInput devices. + * + * This hint is for backwards compatibility only and will be removed in SDL 2.1 + * + * The default value is "0". This hint must be set before SDL_Init() + */ +#define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING" + +/** + * \brief A variable that causes SDL to not ignore audio "monitors" + * + * This is currently only used for PulseAudio and ignored elsewhere. + * + * By default, SDL ignores audio devices that aren't associated with physical + * hardware. Changing this hint to "1" will expose anything SDL sees that + * appears to be an audio source or sink. This will add "devices" to the list + * that the user probably doesn't want or need, but it can be useful in + * scenarios where you want to hook up SDL to some sort of virtual device, + * etc. + * + * The default value is "0". This hint must be set before SDL_Init(). + * + * This hint is available since SDL 2.0.16. Before then, virtual devices are + * always ignored. + */ +#define SDL_HINT_AUDIO_INCLUDE_MONITORS "SDL_AUDIO_INCLUDE_MONITORS" + +/** + * \brief A variable that forces X11 windows to create as a custom type. + * + * This is currently only used for X11 and ignored elsewhere. + * + * During SDL_CreateWindow, SDL uses the _NET_WM_WINDOW_TYPE X11 property + * to report to the window manager the type of window it wants to create. + * This might be set to various things if SDL_WINDOW_TOOLTIP or + * SDL_WINDOW_POPUP_MENU, etc, were specified. For "normal" windows that + * haven't set a specific type, this hint can be used to specify a custom + * type. For example, a dock window might set this to + * "_NET_WM_WINDOW_TYPE_DOCK". + * + * If not set or set to "", this hint is ignored. This hint must be set + * before the SDL_CreateWindow() call that it is intended to affect. + * + * This hint is available since SDL 2.0.22. + */ +#define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE" + +/** + * \brief A variable that decides whether to send SDL_QUIT when closing the final window. + * + * By default, SDL sends an SDL_QUIT event when there is only one window + * and it receives an SDL_WINDOWEVENT_CLOSE event, under the assumption most + * apps would also take the loss of this window as a signal to terminate the + * program. + * + * However, it's not unreasonable in some cases to have the program continue + * to live on, perhaps to create new windows later. + * + * Changing this hint to "0" will cause SDL to not send an SDL_QUIT event + * when the final window is requesting to close. Note that in this case, + * there are still other legitimate reasons one might get an SDL_QUIT + * event: choosing "Quit" from the macOS menu bar, sending a SIGINT (ctrl-c) + * on Unix, etc. + * + * The default value is "1". This hint can be changed at any time. + * + * This hint is available since SDL 2.0.22. Before then, you always get + * an SDL_QUIT event when closing the final window. + */ +#define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE "SDL_QUIT_ON_LAST_WINDOW_CLOSE" + + +/** + * \brief A variable that decides what video backend to use. + * + * By default, SDL will try all available video backends in a reasonable + * order until it finds one that can work, but this hint allows the app + * or user to force a specific target, such as "x11" if, say, you are + * on Wayland but want to try talking to the X server instead. + * + * This functionality has existed since SDL 2.0.0 (indeed, before that) + * but before 2.0.22 this was an environment variable only. In 2.0.22, + * it was upgraded to a full SDL hint, so you can set the environment + * variable as usual or programatically set the hint with SDL_SetHint, + * which won't propagate to child processes. + * + * The default value is unset, in which case SDL will try to figure out + * the best video backend on your behalf. This hint needs to be set + * before SDL_Init() is called to be useful. + * + * This hint is available since SDL 2.0.22. Before then, you could set + * the environment variable to get the same effect. + */ +#define SDL_HINT_VIDEODRIVER "SDL_VIDEODRIVER" + +/** + * \brief A variable that decides what audio backend to use. + * + * By default, SDL will try all available audio backends in a reasonable + * order until it finds one that can work, but this hint allows the app + * or user to force a specific target, such as "alsa" if, say, you are + * on PulseAudio but want to try talking to the lower level instead. + * + * This functionality has existed since SDL 2.0.0 (indeed, before that) + * but before 2.0.22 this was an environment variable only. In 2.0.22, + * it was upgraded to a full SDL hint, so you can set the environment + * variable as usual or programatically set the hint with SDL_SetHint, + * which won't propagate to child processes. + * + * The default value is unset, in which case SDL will try to figure out + * the best audio backend on your behalf. This hint needs to be set + * before SDL_Init() is called to be useful. + * + * This hint is available since SDL 2.0.22. Before then, you could set + * the environment variable to get the same effect. + */ +#define SDL_HINT_AUDIODRIVER "SDL_AUDIODRIVER" + +/** + * \brief A variable that decides what KMSDRM device to use. + * + * Internally, SDL might open something like "/dev/dri/cardNN" to + * access KMSDRM functionality, where "NN" is a device index number. + * + * SDL makes a guess at the best index to use (usually zero), but the + * app or user can set this hint to a number between 0 and 99 to + * force selection. + * + * This hint is available since SDL 2.24.0. + */ +#define SDL_HINT_KMSDRM_DEVICE_INDEX "SDL_KMSDRM_DEVICE_INDEX" + + +/** + * \brief A variable that treats trackpads as touch devices. + * + * On macOS (and possibly other platforms in the future), SDL will report + * touches on a trackpad as mouse input, which is generally what users + * expect from this device; however, these are often actually full + * multitouch-capable touch devices, so it might be preferable to some apps + * to treat them as such. + * + * Setting this hint to true will make the trackpad input report as a + * multitouch device instead of a mouse. The default is false. + * + * Note that most platforms don't support this hint. As of 2.24.0, it + * only supports MacBooks' trackpads on macOS. Others may follow later. + * + * This hint is checked during SDL_Init and can not be changed after. + * + * This hint is available since SDL 2.24.0. + */ +#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY" + + +/** + * \brief An enumeration of hint priorities + */ +typedef enum +{ + SDL_HINT_DEFAULT, + SDL_HINT_NORMAL, + SDL_HINT_OVERRIDE +} SDL_HintPriority; + + +/** + * Set a hint with a specific priority. + * + * The priority controls the behavior when setting a hint that already has a + * value. Hints will replace existing hints of their priority and lower. + * Environment variables are considered to have override priority. + * + * \param name the hint to set + * \param value the value of the hint variable + * \param priority the SDL_HintPriority level for the hint + * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetHint + * \sa SDL_SetHint + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, + const char *value, + SDL_HintPriority priority); + +/** + * Set a hint with normal priority. + * + * Hints will not be set if there is an existing override hint or environment + * variable that takes precedence. You can use SDL_SetHintWithPriority() to + * set the hint with override priority instead. + * + * \param name the hint to set + * \param value the value of the hint variable + * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetHint + * \sa SDL_SetHintWithPriority + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, + const char *value); + +/** + * Reset a hint to the default value. + * + * This will reset a hint to the value of the environment variable, or NULL if + * the environment isn't set. Callbacks will be called normally with this + * change. + * + * \param name the hint to set + * \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_GetHint + * \sa SDL_SetHint + */ +extern DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name); + +/** + * Reset all hints to the default values. + * + * This will reset all hints to the value of the associated environment + * variable, or NULL if the environment isn't set. Callbacks will be called + * normally with this change. + * + * \since This function is available since SDL 2.26.0. + * + * \sa SDL_GetHint + * \sa SDL_SetHint + * \sa SDL_ResetHint + */ +extern DECLSPEC void SDLCALL SDL_ResetHints(void); + +/** + * Get the value of a hint. + * + * \param name the hint to query + * \returns the string value of a hint or NULL if the hint isn't set. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetHint + * \sa SDL_SetHintWithPriority + */ +extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); + +/** + * Get the boolean value of a hint variable. + * + * \param name the name of the hint to get the boolean value from + * \param default_value the value to return if the hint does not exist + * \returns the boolean value of a hint or the provided default value if the + * hint does not exist. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_GetHint + * \sa SDL_SetHint + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetHintBoolean(const char *name, SDL_bool default_value); + +/** + * Type definition of the hint callback function. + * + * \param userdata what was passed as `userdata` to SDL_AddHintCallback() + * \param name what was passed as `name` to SDL_AddHintCallback() + * \param oldValue the previous hint value + * \param newValue the new value hint is to be set to + */ +typedef void (SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); + +/** + * Add a function to watch a particular hint. + * + * \param name the hint to watch + * \param callback An SDL_HintCallback function that will be called when the + * hint value changes + * \param userdata a pointer to pass to the callback function + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_DelHintCallback + */ +extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); + +/** + * Remove a function watching a particular hint. + * + * \param name the hint being watched + * \param callback An SDL_HintCallback function that will be called when the + * hint value changes + * \param userdata a pointer being passed to the callback function + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AddHintCallback + */ +extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); + +/** + * Clear all hints. + * + * This function is automatically called during SDL_Quit(), and deletes all + * callbacks without calling them and frees all memory associated with hints. + * If you're calling this from application code you probably want to call + * SDL_ResetHints() instead. + * + * This function will be removed from the API the next time we rev the ABI. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ResetHints + */ +extern DECLSPEC void SDLCALL SDL_ClearHints(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_hints_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_joystick.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_joystick.h new file mode 100644 index 00000000..8c05fdb8 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_joystick.h @@ -0,0 +1,1069 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_joystick.h + * + * Include file for SDL joystick event handling + * + * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks(), with the exact joystick + * behind a device_index changing as joysticks are plugged and unplugged. + * + * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted + * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in. + * + * The term "player_index" is the number assigned to a player on a specific + * controller. For XInput controllers this returns the XInput user index. + * Many joysticks will not be able to supply this information. + * + * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of + * the device (a X360 wired controller for example). This identifier is platform dependent. + */ + +#ifndef SDL_joystick_h_ +#define SDL_joystick_h_ + +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_joystick.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for joysticks, and load appropriate drivers. + * + * If you would like to receive joystick updates while the application + * is in the background, you should set the following hint before calling + * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS + */ + +/** + * The joystick structure used to identify an SDL joystick + */ +#ifdef SDL_THREAD_SAFETY_ANALYSIS +extern SDL_mutex *SDL_joystick_lock; +#endif +struct _SDL_Joystick; +typedef struct _SDL_Joystick SDL_Joystick; + +/* A structure that encodes the stable unique id for a joystick device */ +typedef SDL_GUID SDL_JoystickGUID; + +/** + * This is a unique ID for a joystick for the time it is connected to the system, + * and is never reused for the lifetime of the application. If the joystick is + * disconnected and reconnected, it will get a new ID. + * + * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. + */ +typedef Sint32 SDL_JoystickID; + +typedef enum +{ + SDL_JOYSTICK_TYPE_UNKNOWN, + SDL_JOYSTICK_TYPE_GAMECONTROLLER, + SDL_JOYSTICK_TYPE_WHEEL, + SDL_JOYSTICK_TYPE_ARCADE_STICK, + SDL_JOYSTICK_TYPE_FLIGHT_STICK, + SDL_JOYSTICK_TYPE_DANCE_PAD, + SDL_JOYSTICK_TYPE_GUITAR, + SDL_JOYSTICK_TYPE_DRUM_KIT, + SDL_JOYSTICK_TYPE_ARCADE_PAD, + SDL_JOYSTICK_TYPE_THROTTLE +} SDL_JoystickType; + +typedef enum +{ + SDL_JOYSTICK_POWER_UNKNOWN = -1, + SDL_JOYSTICK_POWER_EMPTY, /* <= 5% */ + SDL_JOYSTICK_POWER_LOW, /* <= 20% */ + SDL_JOYSTICK_POWER_MEDIUM, /* <= 70% */ + SDL_JOYSTICK_POWER_FULL, /* <= 100% */ + SDL_JOYSTICK_POWER_WIRED, + SDL_JOYSTICK_POWER_MAX +} SDL_JoystickPowerLevel; + +/* Set max recognized G-force from accelerometer + See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed + */ +#define SDL_IPHONE_MAX_GFORCE 5.0 + + +/* Function prototypes */ + +/** + * Locking for multi-threaded access to the joystick API + * + * If you are using the joystick API or handling events from multiple threads + * you should use these locking functions to protect access to the joysticks. + * + * In particular, you are guaranteed that the joystick list won't change, so + * the API functions that take a joystick index will be valid, and joystick + * and game controller events will not be delivered. + * + * As of SDL 2.26.0, you can take the joystick lock around reinitializing the + * joystick subsystem, to prevent other threads from seeing joysticks in an + * uninitialized state. However, all open joysticks will be closed and SDL + * functions called with them will fail. + * + * \since This function is available since SDL 2.0.7. + */ +extern DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock); + + +/** + * Unlocking for multi-threaded access to the joystick API + * + * If you are using the joystick API or handling events from multiple threads + * you should use these locking functions to protect access to the joysticks. + * + * In particular, you are guaranteed that the joystick list won't change, so + * the API functions that take a joystick index will be valid, and joystick + * and game controller events will not be delivered. + * + * \since This function is available since SDL 2.0.7. + */ +extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock); + +/** + * Count the number of joysticks attached to the system. + * + * \returns the number of attached joysticks on success or a negative error + * code on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickName + * \sa SDL_JoystickPath + * \sa SDL_JoystickOpen + */ +extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); + +/** + * Get the implementation dependent name of a joystick. + * + * This can be called before any joysticks are opened. + * + * \param device_index the index of the joystick to query (the N'th joystick + * on the system) + * \returns the name of the selected joystick. If no name can be found, this + * function returns NULL; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickName + * \sa SDL_JoystickOpen + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); + +/** + * Get the implementation dependent path of a joystick. + * + * This can be called before any joysticks are opened. + * + * \param device_index the index of the joystick to query (the N'th joystick + * on the system) + * \returns the path of the selected joystick. If no path can be found, this + * function returns NULL; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_JoystickPath + * \sa SDL_JoystickOpen + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index); + +/** + * Get the player index of a joystick, or -1 if it's not available This can be + * called before any joysticks are opened. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetDevicePlayerIndex(int device_index); + +/** + * Get the implementation-dependent GUID for the joystick at a given device + * index. + * + * This function can be called before any joysticks are opened. + * + * \param device_index the index of the joystick to query (the N'th joystick + * on the system + * \returns the GUID of the selected joystick. If called on an invalid index, + * this function returns a zero GUID + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickGetGUID + * \sa SDL_JoystickGetGUIDString + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index); + +/** + * Get the USB vendor ID of a joystick, if available. + * + * This can be called before any joysticks are opened. If the vendor ID isn't + * available this function returns 0. + * + * \param device_index the index of the joystick to query (the N'th joystick + * on the system + * \returns the USB vendor ID of the selected joystick. If called on an + * invalid index, this function returns zero + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceVendor(int device_index); + +/** + * Get the USB product ID of a joystick, if available. + * + * This can be called before any joysticks are opened. If the product ID isn't + * available this function returns 0. + * + * \param device_index the index of the joystick to query (the N'th joystick + * on the system + * \returns the USB product ID of the selected joystick. If called on an + * invalid index, this function returns zero + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProduct(int device_index); + +/** + * Get the product version of a joystick, if available. + * + * This can be called before any joysticks are opened. If the product version + * isn't available this function returns 0. + * + * \param device_index the index of the joystick to query (the N'th joystick + * on the system + * \returns the product version of the selected joystick. If called on an + * invalid index, this function returns zero + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetDeviceProductVersion(int device_index); + +/** + * Get the type of a joystick, if available. + * + * This can be called before any joysticks are opened. + * + * \param device_index the index of the joystick to query (the N'th joystick + * on the system + * \returns the SDL_JoystickType of the selected joystick. If called on an + * invalid index, this function returns `SDL_JOYSTICK_TYPE_UNKNOWN` + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_index); + +/** + * Get the instance ID of a joystick. + * + * This can be called before any joysticks are opened. + * + * \param device_index the index of the joystick to query (the N'th joystick + * on the system + * \returns the instance id of the selected joystick. If called on an invalid + * index, this function returns -1. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickGetDeviceInstanceID(int device_index); + +/** + * Open a joystick for use. + * + * The `device_index` argument refers to the N'th joystick presently + * recognized by SDL on the system. It is **NOT** the same as the instance ID + * used to identify the joystick in future events. See + * SDL_JoystickInstanceID() for more details about instance IDs. + * + * The joystick subsystem must be initialized before a joystick can be opened + * for use. + * + * \param device_index the index of the joystick to query + * \returns a joystick identifier or NULL if an error occurred; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickClose + * \sa SDL_JoystickInstanceID + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); + +/** + * Get the SDL_Joystick associated with an instance id. + * + * \param instance_id the instance id to get the SDL_Joystick for + * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 2.0.4. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromInstanceID(SDL_JoystickID instance_id); + +/** + * Get the SDL_Joystick associated with a player index. + * + * \param player_index the player index to get the SDL_Joystick for + * \returns an SDL_Joystick on success or NULL on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 2.0.12. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickFromPlayerIndex(int player_index); + +/** + * Attach a new virtual joystick. + * + * \returns the joystick's device index, or -1 if an error occurred. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type, + int naxes, + int nbuttons, + int nhats); + +/** + * The structure that defines an extended virtual joystick description + * + * The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_JoystickAttachVirtualEx() + * All other elements of this structure are optional and can be left 0. + * + * \sa SDL_JoystickAttachVirtualEx + */ +typedef struct SDL_VirtualJoystickDesc +{ + Uint16 version; /**< `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` */ + Uint16 type; /**< `SDL_JoystickType` */ + Uint16 naxes; /**< the number of axes on this joystick */ + Uint16 nbuttons; /**< the number of buttons on this joystick */ + Uint16 nhats; /**< the number of hats on this joystick */ + Uint16 vendor_id; /**< the USB vendor ID of this joystick */ + Uint16 product_id; /**< the USB product ID of this joystick */ + Uint16 padding; /**< unused */ + Uint32 button_mask; /**< A mask of which buttons are valid for this controller + e.g. (1 << SDL_CONTROLLER_BUTTON_A) */ + Uint32 axis_mask; /**< A mask of which axes are valid for this controller + e.g. (1 << SDL_CONTROLLER_AXIS_LEFTX) */ + const char *name; /**< the name of the joystick */ + + void *userdata; /**< User data pointer passed to callbacks */ + void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */ + void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */ + int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_JoystickRumble() */ + int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_JoystickRumbleTriggers() */ + int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_JoystickSetLED() */ + int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_JoystickSendEffect() */ + +} SDL_VirtualJoystickDesc; + +/** + * \brief The current version of the SDL_VirtualJoystickDesc structure + */ +#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1 + +/** + * Attach a new virtual joystick with extended properties. + * + * \returns the joystick's device index, or -1 if an error occurred. + * + * \since This function is available since SDL 2.24.0. + */ +extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc); + +/** + * Detach a virtual joystick. + * + * \param device_index a value previously returned from + * SDL_JoystickAttachVirtual() + * \returns 0 on success, or -1 if an error occurred. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_JoystickDetachVirtual(int device_index); + +/** + * Query whether or not the joystick at a given device index is virtual. + * + * \param device_index a joystick device index. + * \returns SDL_TRUE if the joystick is virtual, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index); + +/** + * Set values on an opened, virtual-joystick's axis. + * + * Please note that values set here will not be applied until the next call to + * SDL_JoystickUpdate, which can either be called directly, or can be called + * indirectly through various other SDL APIs, including, but not limited to + * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout, + * SDL_WaitEvent. + * + * Note that when sending trigger axes, you should scale the value to the full + * range of Sint16. For example, a trigger at rest would have the value of + * `SDL_JOYSTICK_AXIS_MIN`. + * + * \param joystick the virtual joystick on which to set state. + * \param axis the specific axis on the virtual joystick to set. + * \param value the new value for the specified axis. + * \returns 0 on success, -1 on error. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value); + +/** + * Set values on an opened, virtual-joystick's button. + * + * Please note that values set here will not be applied until the next call to + * SDL_JoystickUpdate, which can either be called directly, or can be called + * indirectly through various other SDL APIs, including, but not limited to + * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout, + * SDL_WaitEvent. + * + * \param joystick the virtual joystick on which to set state. + * \param button the specific button on the virtual joystick to set. + * \param value the new value for the specified button. + * \returns 0 on success, -1 on error. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualButton(SDL_Joystick *joystick, int button, Uint8 value); + +/** + * Set values on an opened, virtual-joystick's hat. + * + * Please note that values set here will not be applied until the next call to + * SDL_JoystickUpdate, which can either be called directly, or can be called + * indirectly through various other SDL APIs, including, but not limited to + * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout, + * SDL_WaitEvent. + * + * \param joystick the virtual joystick on which to set state. + * \param hat the specific hat on the virtual joystick to set. + * \param value the new value for the specified hat. + * \returns 0 on success, -1 on error. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value); + +/** + * Get the implementation dependent name of a joystick. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \returns the name of the selected joystick. If no name can be found, this + * function returns NULL; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickNameForIndex + * \sa SDL_JoystickOpen + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick); + +/** + * Get the implementation dependent path of a joystick. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \returns the path of the selected joystick. If no path can be found, this + * function returns NULL; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_JoystickPathForIndex + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickPath(SDL_Joystick *joystick); + +/** + * Get the player index of an opened joystick. + * + * For XInput controllers this returns the XInput user index. Many joysticks + * will not be able to supply this information. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \returns the player index, or -1 if it's not available. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick); + +/** + * Set the player index of an opened joystick. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \param player_index Player index to assign to this joystick, or -1 to clear + * the player index and turn off player LEDs. + * + * \since This function is available since SDL 2.0.12. + */ +extern DECLSPEC void SDLCALL SDL_JoystickSetPlayerIndex(SDL_Joystick *joystick, int player_index); + +/** + * Get the implementation-dependent GUID for the joystick. + * + * This function requires an open joystick. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \returns the GUID of the given joystick. If called on an invalid index, + * this function returns a zero GUID; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickGetDeviceGUID + * \sa SDL_JoystickGetGUIDString + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick *joystick); + +/** + * Get the USB vendor ID of an opened joystick, if available. + * + * If the vendor ID isn't available this function returns 0. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \returns the USB vendor ID of the selected joystick, or 0 if unavailable. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetVendor(SDL_Joystick *joystick); + +/** + * Get the USB product ID of an opened joystick, if available. + * + * If the product ID isn't available this function returns 0. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \returns the USB product ID of the selected joystick, or 0 if unavailable. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick); + +/** + * Get the product version of an opened joystick, if available. + * + * If the product version isn't available this function returns 0. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \returns the product version of the selected joystick, or 0 if unavailable. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick); + +/** + * Get the firmware version of an opened joystick, if available. + * + * If the firmware version isn't available this function returns 0. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \returns the firmware version of the selected joystick, or 0 if + * unavailable. + * + * \since This function is available since SDL 2.24.0. + */ +extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick); + +/** + * Get the serial number of an opened joystick, if available. + * + * Returns the serial number of the joystick, or NULL if it is not available. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \returns the serial number of the selected joystick, or NULL if + * unavailable. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC const char * SDLCALL SDL_JoystickGetSerial(SDL_Joystick *joystick); + +/** + * Get the type of an opened joystick. + * + * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen() + * \returns the SDL_JoystickType of the selected joystick. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetType(SDL_Joystick *joystick); + +/** + * Get an ASCII string representation for a given SDL_JoystickGUID. + * + * You should supply at least 33 bytes for pszGUID. + * + * \param guid the SDL_JoystickGUID you wish to convert to string + * \param pszGUID buffer in which to write the ASCII string + * \param cbGUID the size of pszGUID + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickGetDeviceGUID + * \sa SDL_JoystickGetGUID + * \sa SDL_JoystickGetGUIDFromString + */ +extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); + +/** + * Convert a GUID string into a SDL_JoystickGUID structure. + * + * Performs no error checking. If this function is given a string containing + * an invalid GUID, the function will silently succeed, but the GUID generated + * will not be useful. + * + * \param pchGUID string containing an ASCII representation of a GUID + * \returns a SDL_JoystickGUID structure. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickGetGUIDString + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID); + +/** + * Get the device information encoded in a SDL_JoystickGUID structure + * + * \param guid the SDL_JoystickGUID you wish to get info about + * \param vendor A pointer filled in with the device VID, or 0 if not + * available + * \param product A pointer filled in with the device PID, or 0 if not + * available + * \param version A pointer filled in with the device version, or 0 if not + * available + * \param crc16 A pointer filled in with a CRC used to distinguish different + * products with the same VID/PID, or 0 if not available + * + * \since This function is available since SDL 2.26.0. + * + * \sa SDL_JoystickGetDeviceGUID + */ +extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16); + +/** + * Get the status of a specified joystick. + * + * \param joystick the joystick to query + * \returns SDL_TRUE if the joystick has been opened, SDL_FALSE if it has not; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickClose + * \sa SDL_JoystickOpen + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick *joystick); + +/** + * Get the instance ID of an opened joystick. + * + * \param joystick an SDL_Joystick structure containing joystick information + * \returns the instance ID of the specified joystick on success or a negative + * error code on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickOpen + */ +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick *joystick); + +/** + * Get the number of general axis controls on a joystick. + * + * Often, the directional pad on a game controller will either look like 4 + * separate buttons or a POV hat, and not axes, but all of this is up to the + * device and platform. + * + * \param joystick an SDL_Joystick structure containing joystick information + * \returns the number of axis controls/number of axes on success or a + * negative error code on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickGetAxis + * \sa SDL_JoystickOpen + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick *joystick); + +/** + * Get the number of trackballs on a joystick. + * + * Joystick trackballs have only relative motion events associated with them + * and their state cannot be polled. + * + * Most joysticks do not have trackballs. + * + * \param joystick an SDL_Joystick structure containing joystick information + * \returns the number of trackballs on success or a negative error code on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickGetBall + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick *joystick); + +/** + * Get the number of POV hats on a joystick. + * + * \param joystick an SDL_Joystick structure containing joystick information + * \returns the number of POV hats on success or a negative error code on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickGetHat + * \sa SDL_JoystickOpen + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick *joystick); + +/** + * Get the number of buttons on a joystick. + * + * \param joystick an SDL_Joystick structure containing joystick information + * \returns the number of buttons on success or a negative error code on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickGetButton + * \sa SDL_JoystickOpen + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick *joystick); + +/** + * Update the current state of the open joysticks. + * + * This is called automatically by the event loop if any joystick events are + * enabled. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickEventState + */ +extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); + +/** + * Enable/disable joystick event polling. + * + * If joystick events are disabled, you must call SDL_JoystickUpdate() + * yourself and manually check the state of the joystick when you want + * joystick information. + * + * It is recommended that you leave joystick event handling enabled. + * + * **WARNING**: Calling this function may delete all events currently in SDL's + * event queue. + * + * \param state can be one of `SDL_QUERY`, `SDL_IGNORE`, or `SDL_ENABLE` + * \returns 1 if enabled, 0 if disabled, or a negative error code on failure; + * call SDL_GetError() for more information. + * + * If `state` is `SDL_QUERY` then the current state is returned, + * otherwise the new processing state is returned. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GameControllerEventState + */ +extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); + +#define SDL_JOYSTICK_AXIS_MAX 32767 +#define SDL_JOYSTICK_AXIS_MIN -32768 + +/** + * Get the current state of an axis control on a joystick. + * + * SDL makes no promises about what part of the joystick any given axis refers + * to. Your game should have some sort of configuration UI to let users + * specify what each axis should be bound to. Alternately, SDL's higher-level + * Game Controller API makes a great effort to apply order to this lower-level + * interface, so you know that a specific axis is the "left thumb stick," etc. + * + * The value returned by SDL_JoystickGetAxis() is a signed integer (-32768 to + * 32767) representing the current position of the axis. It may be necessary + * to impose certain tolerances on these values to account for jitter. + * + * \param joystick an SDL_Joystick structure containing joystick information + * \param axis the axis to query; the axis indices start at index 0 + * \returns a 16-bit signed integer representing the current position of the + * axis or 0 on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickNumAxes + */ +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick *joystick, + int axis); + +/** + * Get the initial state of an axis control on a joystick. + * + * The state is a value ranging from -32768 to 32767. + * + * The axis indices start at index 0. + * + * \param joystick an SDL_Joystick structure containing joystick information + * \param axis the axis to query; the axis indices start at index 0 + * \param state Upon return, the initial value is supplied here. + * \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAxisInitialState(SDL_Joystick *joystick, + int axis, Sint16 *state); + +/** + * \name Hat positions + */ +/* @{ */ +#define SDL_HAT_CENTERED 0x00 +#define SDL_HAT_UP 0x01 +#define SDL_HAT_RIGHT 0x02 +#define SDL_HAT_DOWN 0x04 +#define SDL_HAT_LEFT 0x08 +#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) +#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) +#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) +#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) +/* @} */ + +/** + * Get the current state of a POV hat on a joystick. + * + * The returned value will be one of the following positions: + * + * - `SDL_HAT_CENTERED` + * - `SDL_HAT_UP` + * - `SDL_HAT_RIGHT` + * - `SDL_HAT_DOWN` + * - `SDL_HAT_LEFT` + * - `SDL_HAT_RIGHTUP` + * - `SDL_HAT_RIGHTDOWN` + * - `SDL_HAT_LEFTUP` + * - `SDL_HAT_LEFTDOWN` + * + * \param joystick an SDL_Joystick structure containing joystick information + * \param hat the hat index to get the state from; indices start at index 0 + * \returns the current hat position. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickNumHats + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick *joystick, + int hat); + +/** + * Get the ball axis change since the last poll. + * + * Trackballs can only return relative motion since the last call to + * SDL_JoystickGetBall(), these motion deltas are placed into `dx` and `dy`. + * + * Most joysticks do not have trackballs. + * + * \param joystick the SDL_Joystick to query + * \param ball the ball index to query; ball indices start at index 0 + * \param dx stores the difference in the x axis position since the last poll + * \param dy stores the difference in the y axis position since the last poll + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickNumBalls + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick *joystick, + int ball, int *dx, int *dy); + +/** + * Get the current state of a button on a joystick. + * + * \param joystick an SDL_Joystick structure containing joystick information + * \param button the button index to get the state from; indices start at + * index 0 + * \returns 1 if the specified button is pressed, 0 otherwise. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickNumButtons + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick *joystick, + int button); + +/** + * Start a rumble effect. + * + * Each call to this function cancels any previous rumble effect, and calling + * it with 0 intensity stops any rumbling. + * + * \param joystick The joystick to vibrate + * \param low_frequency_rumble The intensity of the low frequency (left) + * rumble motor, from 0 to 0xFFFF + * \param high_frequency_rumble The intensity of the high frequency (right) + * rumble motor, from 0 to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * \returns 0, or -1 if rumble isn't supported on this joystick + * + * \since This function is available since SDL 2.0.9. + * + * \sa SDL_JoystickHasRumble + */ +extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms); + +/** + * Start a rumble effect in the joystick's triggers + * + * Each call to this function cancels any previous trigger rumble effect, and + * calling it with 0 intensity stops any rumbling. + * + * Note that this is rumbling of the _triggers_ and not the game controller as + * a whole. This is currently only supported on Xbox One controllers. If you + * want the (more common) whole-controller rumble, use SDL_JoystickRumble() + * instead. + * + * \param joystick The joystick to vibrate + * \param left_rumble The intensity of the left trigger rumble motor, from 0 + * to 0xFFFF + * \param right_rumble The intensity of the right trigger rumble motor, from 0 + * to 0xFFFF + * \param duration_ms The duration of the rumble effect, in milliseconds + * \returns 0, or -1 if trigger rumble isn't supported on this joystick + * + * \since This function is available since SDL 2.0.14. + * + * \sa SDL_JoystickHasRumbleTriggers + */ +extern DECLSPEC int SDLCALL SDL_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms); + +/** + * Query whether a joystick has an LED. + * + * An example of a joystick LED is the light on the back of a PlayStation 4's + * DualShock 4 controller. + * + * \param joystick The joystick to query + * \return SDL_TRUE if the joystick has a modifiable LED, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasLED(SDL_Joystick *joystick); + +/** + * Query whether a joystick has rumble support. + * + * \param joystick The joystick to query + * \return SDL_TRUE if the joystick has rumble, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_JoystickRumble + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumble(SDL_Joystick *joystick); + +/** + * Query whether a joystick has rumble support on triggers. + * + * \param joystick The joystick to query + * \return SDL_TRUE if the joystick has trigger rumble, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_JoystickRumbleTriggers + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickHasRumbleTriggers(SDL_Joystick *joystick); + +/** + * Update a joystick's LED color. + * + * An example of a joystick LED is the light on the back of a PlayStation 4's + * DualShock 4 controller. + * + * \param joystick The joystick to update + * \param red The intensity of the red LED + * \param green The intensity of the green LED + * \param blue The intensity of the blue LED + * \returns 0 on success, -1 if this joystick does not have a modifiable LED + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue); + +/** + * Send a joystick specific effect packet + * + * \param joystick The joystick to affect + * \param data The data to send to the joystick + * \param size The size of the data to send to the joystick + * \returns 0, or -1 if this joystick or driver doesn't support effect packets + * + * \since This function is available since SDL 2.0.16. + */ +extern DECLSPEC int SDLCALL SDL_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size); + +/** + * Close a joystick previously opened with SDL_JoystickOpen(). + * + * \param joystick The joystick device to close + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_JoystickOpen + */ +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick *joystick); + +/** + * Get the battery level of a joystick as SDL_JoystickPowerLevel. + * + * \param joystick the SDL_Joystick to query + * \returns the current battery level as SDL_JoystickPowerLevel on success or + * `SDL_JOYSTICK_POWER_UNKNOWN` if it is unknown + * + * \since This function is available since SDL 2.0.4. + */ +extern DECLSPEC SDL_JoystickPowerLevel SDLCALL SDL_JoystickCurrentPowerLevel(SDL_Joystick *joystick); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_joystick_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_keyboard.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_keyboard.h new file mode 100644 index 00000000..039494ec --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_keyboard.h @@ -0,0 +1,353 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_keyboard.h + * + * Include file for SDL keyboard event handling + */ + +#ifndef SDL_keyboard_h_ +#define SDL_keyboard_h_ + +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The SDL keysym structure, used in key events. + * + * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. + */ +typedef struct SDL_Keysym +{ + SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ + SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */ + Uint16 mod; /**< current key modifiers */ + Uint32 unused; +} SDL_Keysym; + +/* Function prototypes */ + +/** + * Query the window which currently has keyboard focus. + * + * \returns the window with keyboard focus. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); + +/** + * Get a snapshot of the current state of the keyboard. + * + * The pointer returned is a pointer to an internal SDL array. It will be + * valid for the whole lifetime of the application and should not be freed by + * the caller. + * + * A array element with a value of 1 means that the key is pressed and a value + * of 0 means that it is not. Indexes into this array are obtained by using + * SDL_Scancode values. + * + * Use SDL_PumpEvents() to update the state array. + * + * This function gives you the current state after all events have been + * processed, so if a key or button has been pressed and released before you + * process events, then the pressed state will never show up in the + * SDL_GetKeyboardState() calls. + * + * Note: This function doesn't take into account whether shift has been + * pressed or not. + * + * \param numkeys if non-NULL, receives the length of the returned array + * \returns a pointer to an array of key states. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_PumpEvents + * \sa SDL_ResetKeyboard + */ +extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); + +/** + * Clear the state of the keyboard + * + * This function will generate key up events for all pressed keys. + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_GetKeyboardState + */ +extern DECLSPEC void SDLCALL SDL_ResetKeyboard(void); + +/** + * Get the current key modifier state for the keyboard. + * + * \returns an OR'd combination of the modifier keys for the keyboard. See + * SDL_Keymod for details. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetKeyboardState + * \sa SDL_SetModState + */ +extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); + +/** + * Set the current key modifier state for the keyboard. + * + * The inverse of SDL_GetModState(), SDL_SetModState() allows you to impose + * modifier key states on your application. Simply pass your desired modifier + * states into `modstate`. This value may be a bitwise, OR'd combination of + * SDL_Keymod values. + * + * This does not change the keyboard state, only the key modifier flags that + * SDL reports. + * + * \param modstate the desired SDL_Keymod for the keyboard + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetModState + */ +extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); + +/** + * Get the key code corresponding to the given scancode according to the + * current keyboard layout. + * + * See SDL_Keycode for details. + * + * \param scancode the desired SDL_Scancode to query + * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetKeyName + * \sa SDL_GetScancodeFromKey + */ +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); + +/** + * Get the scancode corresponding to the given key code according to the + * current keyboard layout. + * + * See SDL_Scancode for details. + * + * \param key the desired SDL_Keycode to query + * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetKeyFromScancode + * \sa SDL_GetScancodeName + */ +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); + +/** + * Get a human-readable name for a scancode. + * + * See SDL_Scancode for details. + * + * **Warning**: The returned name is by design not stable across platforms, + * e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left + * Windows" under Microsoft Windows, and some scancodes like + * `SDL_SCANCODE_NONUSBACKSLASH` don't have any name at all. There are even + * scancodes that share names, e.g. `SDL_SCANCODE_RETURN` and + * `SDL_SCANCODE_RETURN2` (both called "Return"). This function is therefore + * unsuitable for creating a stable cross-platform two-way mapping between + * strings and scancodes. + * + * \param scancode the desired SDL_Scancode to query + * \returns a pointer to the name for the scancode. If the scancode doesn't + * have a name this function returns an empty string (""). + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetScancodeFromKey + * \sa SDL_GetScancodeFromName + */ +extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); + +/** + * Get a scancode from a human-readable name. + * + * \param name the human-readable scancode name + * \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't + * recognized; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetKeyFromName + * \sa SDL_GetScancodeFromKey + * \sa SDL_GetScancodeName + */ +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); + +/** + * Get a human-readable name for a key. + * + * See SDL_Scancode and SDL_Keycode for details. + * + * \param key the desired SDL_Keycode to query + * \returns a pointer to a UTF-8 string that stays valid at least until the + * next call to this function. If you need it around any longer, you + * must copy it. If the key doesn't have a name, this function + * returns an empty string (""). + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetKeyFromName + * \sa SDL_GetKeyFromScancode + * \sa SDL_GetScancodeFromKey + */ +extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); + +/** + * Get a key code from a human-readable name. + * + * \param name the human-readable key name + * \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetKeyFromScancode + * \sa SDL_GetKeyName + * \sa SDL_GetScancodeFromName + */ +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); + +/** + * Start accepting Unicode text input events. + * + * This function will start accepting Unicode text input events in the focused + * SDL window, and start emitting SDL_TextInputEvent (SDL_TEXTINPUT) and + * SDL_TextEditingEvent (SDL_TEXTEDITING) events. Please use this function in + * pair with SDL_StopTextInput(). + * + * On some platforms using this function activates the screen keyboard. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetTextInputRect + * \sa SDL_StopTextInput + */ +extern DECLSPEC void SDLCALL SDL_StartTextInput(void); + +/** + * Check whether or not Unicode text input events are enabled. + * + * \returns SDL_TRUE if text input events are enabled else SDL_FALSE. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_StartTextInput + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); + +/** + * Stop receiving any text input events. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_StartTextInput + */ +extern DECLSPEC void SDLCALL SDL_StopTextInput(void); + +/** + * Dismiss the composition window/IME without disabling the subsystem. + * + * \since This function is available since SDL 2.0.22. + * + * \sa SDL_StartTextInput + * \sa SDL_StopTextInput + */ +extern DECLSPEC void SDLCALL SDL_ClearComposition(void); + +/** + * Returns if an IME Composite or Candidate window is currently shown. + * + * \since This function is available since SDL 2.0.22. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void); + +/** + * Set the rectangle used to type Unicode text inputs. + * + * To start text input in a given location, this function is intended to be + * called before SDL_StartTextInput, although some platforms support moving + * the rectangle even while text input (and a composition) is active. + * + * Note: If you want to use the system native IME window, try setting hint + * **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you + * any feedback. + * + * \param rect the SDL_Rect structure representing the rectangle to receive + * text (ignored if NULL) + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_StartTextInput + */ +extern DECLSPEC void SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect); + +/** + * Check whether the platform has screen keyboard support. + * + * \returns SDL_TRUE if the platform has some screen keyboard support or + * SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_StartTextInput + * \sa SDL_IsScreenKeyboardShown + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); + +/** + * Check whether the screen keyboard is shown for given window. + * + * \param window the window for which screen keyboard should be queried + * \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HasScreenKeyboardSupport + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_keyboard_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_keycode.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_keycode.h new file mode 100644 index 00000000..cc08478a --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_keycode.h @@ -0,0 +1,358 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_keycode.h + * + * Defines constants which identify keyboard keys and modifiers. + */ + +#ifndef SDL_keycode_h_ +#define SDL_keycode_h_ + +#include +#include + +/** + * \brief The SDL virtual key representation. + * + * Values of this type are used to represent keyboard keys using the current + * layout of the keyboard. These values include Unicode values representing + * the unmodified character that would be generated by pressing the key, or + * an SDLK_* constant for those keys that do not generate characters. + * + * A special exception is the number keys at the top of the keyboard which + * map to SDLK_0...SDLK_9 on AZERTY layouts. + */ +typedef Sint32 SDL_Keycode; + +#define SDLK_SCANCODE_MASK (1<<30) +#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) + +typedef enum +{ + SDLK_UNKNOWN = 0, + + SDLK_RETURN = '\r', + SDLK_ESCAPE = '\x1B', + SDLK_BACKSPACE = '\b', + SDLK_TAB = '\t', + SDLK_SPACE = ' ', + SDLK_EXCLAIM = '!', + SDLK_QUOTEDBL = '"', + SDLK_HASH = '#', + SDLK_PERCENT = '%', + SDLK_DOLLAR = '$', + SDLK_AMPERSAND = '&', + SDLK_QUOTE = '\'', + SDLK_LEFTPAREN = '(', + SDLK_RIGHTPAREN = ')', + SDLK_ASTERISK = '*', + SDLK_PLUS = '+', + SDLK_COMMA = ',', + SDLK_MINUS = '-', + SDLK_PERIOD = '.', + SDLK_SLASH = '/', + SDLK_0 = '0', + SDLK_1 = '1', + SDLK_2 = '2', + SDLK_3 = '3', + SDLK_4 = '4', + SDLK_5 = '5', + SDLK_6 = '6', + SDLK_7 = '7', + SDLK_8 = '8', + SDLK_9 = '9', + SDLK_COLON = ':', + SDLK_SEMICOLON = ';', + SDLK_LESS = '<', + SDLK_EQUALS = '=', + SDLK_GREATER = '>', + SDLK_QUESTION = '?', + SDLK_AT = '@', + + /* + Skip uppercase letters + */ + + SDLK_LEFTBRACKET = '[', + SDLK_BACKSLASH = '\\', + SDLK_RIGHTBRACKET = ']', + SDLK_CARET = '^', + SDLK_UNDERSCORE = '_', + SDLK_BACKQUOTE = '`', + SDLK_a = 'a', + SDLK_b = 'b', + SDLK_c = 'c', + SDLK_d = 'd', + SDLK_e = 'e', + SDLK_f = 'f', + SDLK_g = 'g', + SDLK_h = 'h', + SDLK_i = 'i', + SDLK_j = 'j', + SDLK_k = 'k', + SDLK_l = 'l', + SDLK_m = 'm', + SDLK_n = 'n', + SDLK_o = 'o', + SDLK_p = 'p', + SDLK_q = 'q', + SDLK_r = 'r', + SDLK_s = 's', + SDLK_t = 't', + SDLK_u = 'u', + SDLK_v = 'v', + SDLK_w = 'w', + SDLK_x = 'x', + SDLK_y = 'y', + SDLK_z = 'z', + + SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), + + SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), + SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), + SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), + SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), + SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), + SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), + SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), + SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), + SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), + SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), + SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), + SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), + + SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), + SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), + SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), + SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), + SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), + SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), + SDLK_DELETE = '\x7F', + SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), + SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), + SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), + SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), + SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), + SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), + + SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), + SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), + SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), + SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), + SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), + SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), + SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), + SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), + SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), + SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), + SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), + SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), + SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), + SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), + SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), + SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), + SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), + + SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), + SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), + SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), + SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), + SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), + SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), + SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), + SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), + SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), + SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), + SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), + SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), + SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), + SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), + SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), + SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), + SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), + SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), + SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), + SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), + SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), + SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), + SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), + SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), + SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), + SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), + SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), + SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), + SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), + SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), + SDLK_KP_EQUALSAS400 = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), + + SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), + SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), + SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), + SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), + SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), + SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), + SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), + SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), + SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), + SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), + SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), + SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), + + SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), + SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), + SDLK_THOUSANDSSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), + SDLK_DECIMALSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), + SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), + SDLK_CURRENCYSUBUNIT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), + SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), + SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), + SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), + SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), + SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), + SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), + SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), + SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), + SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), + SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), + SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), + SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), + SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), + SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), + SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), + SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), + SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), + SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), + SDLK_KP_DBLAMPERSAND = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), + SDLK_KP_VERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), + SDLK_KP_DBLVERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), + SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), + SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), + SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), + SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), + SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), + SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), + SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), + SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), + SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), + SDLK_KP_MEMSUBTRACT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), + SDLK_KP_MEMMULTIPLY = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), + SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), + SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), + SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), + SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), + SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), + SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), + SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), + SDLK_KP_HEXADECIMAL = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), + + SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), + SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), + SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), + SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), + SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), + SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), + SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), + SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), + + SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), + + SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), + SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), + SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), + SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), + SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), + SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), + SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), + SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), + SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), + SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), + SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), + SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), + SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), + SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), + SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), + SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), + SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), + + SDLK_BRIGHTNESSDOWN = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), + SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), + SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), + SDLK_KBDILLUMTOGGLE = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), + SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), + SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), + SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), + SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP), + SDLK_APP1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1), + SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2), + + SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND), + SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD), + + SDLK_SOFTLEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT), + SDLK_SOFTRIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT), + SDLK_CALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL), + SDLK_ENDCALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL) +} SDL_KeyCode; + +/** + * \brief Enumeration of valid key mods (possibly OR'd together). + */ +typedef enum +{ + KMOD_NONE = 0x0000, + KMOD_LSHIFT = 0x0001, + KMOD_RSHIFT = 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LGUI = 0x0400, + KMOD_RGUI = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_SCROLL = 0x8000, + + KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL, + KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT, + KMOD_ALT = KMOD_LALT | KMOD_RALT, + KMOD_GUI = KMOD_LGUI | KMOD_RGUI, + + KMOD_RESERVED = KMOD_SCROLL /* This is for source-level compatibility with SDL 2.0.0. */ +} SDL_Keymod; + +#endif /* SDL_keycode_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_loadso.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_loadso.h new file mode 100644 index 00000000..c2b4f0a2 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_loadso.h @@ -0,0 +1,115 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_loadso.h + * + * System dependent library loading routines + * + * Some things to keep in mind: + * \li These functions only work on C function names. Other languages may + * have name mangling and intrinsic language support that varies from + * compiler to compiler. + * \li Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * \li Avoid namespace collisions. If you load a symbol from the library, + * it is not defined whether or not it goes into the global symbol + * namespace for the application. If it does and it conflicts with + * symbols in your code or other shared libraries, you will not get + * the results you expect. :) + */ + +#ifndef SDL_loadso_h_ +#define SDL_loadso_h_ + +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Dynamically load a shared object. + * + * \param sofile a system-dependent name of the object file + * \returns an opaque pointer to the object handle or NULL if there was an + * error; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LoadFunction + * \sa SDL_UnloadObject + */ +extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); + +/** + * Look up the address of the named function in a shared object. + * + * This function pointer is no longer valid after calling SDL_UnloadObject(). + * + * This function can only look up C function names. Other languages may have + * name mangling and intrinsic language support that varies from compiler to + * compiler. + * + * Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * + * If the requested function doesn't exist, NULL is returned. + * + * \param handle a valid shared object handle returned by SDL_LoadObject() + * \param name the name of the function to look up + * \returns a pointer to the function or NULL if there was an error; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LoadObject + * \sa SDL_UnloadObject + */ +extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, + const char *name); + +/** + * Unload a shared object from memory. + * + * \param handle a valid shared object handle returned by SDL_LoadObject() + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LoadFunction + * \sa SDL_LoadObject + */ +extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_loadso_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_locale.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_locale.h new file mode 100644 index 00000000..a0e5923d --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_locale.h @@ -0,0 +1,103 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_locale.h + * + * Include file for SDL locale services + */ + +#ifndef _SDL_locale_h +#define _SDL_locale_h + +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + + +typedef struct SDL_Locale +{ + const char *language; /**< A language name, like "en" for English. */ + const char *country; /**< A country, like "US" for America. Can be NULL. */ +} SDL_Locale; + +/** + * Report the user's preferred locale. + * + * This returns an array of SDL_Locale structs, the final item zeroed out. + * When the caller is done with this array, it should call SDL_free() on the + * returned value; all the memory involved is allocated in a single block, so + * a single SDL_free() will suffice. + * + * Returned language strings are in the format xx, where 'xx' is an ISO-639 + * language specifier (such as "en" for English, "de" for German, etc). + * Country strings are in the format YY, where "YY" is an ISO-3166 country + * code (such as "US" for the United States, "CA" for Canada, etc). Country + * might be NULL if there's no specific guidance on them (so you might get { + * "en", "US" } for American English, but { "en", NULL } means "English + * language, generically"). Language strings are never NULL, except to + * terminate the array. + * + * Please note that not all of these strings are 2 characters; some are three + * or more. + * + * The returned list of locales are in the order of the user's preference. For + * example, a German citizen that is fluent in US English and knows enough + * Japanese to navigate around Tokyo might have a list like: { "de", "en_US", + * "jp", NULL }. Someone from England might prefer British English (where + * "color" is spelled "colour", etc), but will settle for anything like it: { + * "en_GB", "en", NULL }. + * + * This function returns NULL on error, including when the platform does not + * supply this information at all. + * + * This might be a "slow" call that has to query the operating system. It's + * best to ask for this once and save the results. However, this list can + * change, usually because the user has changed a system preference outside of + * your program; SDL will send an SDL_LOCALECHANGED event in this case, if + * possible, and you can call this function again to get an updated copy of + * preferred locales. + * + * \return array of locales, terminated with a locale with a NULL language + * field. Will return NULL on error. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include + +#endif /* _SDL_locale_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_log.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_log.h new file mode 100644 index 00000000..0afb9fe7 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_log.h @@ -0,0 +1,404 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_log.h + * + * Simple log messages with categories and priorities. + * + * By default logs are quiet, but if you're debugging SDL you might want: + * + * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); + * + * Here's where the messages go on different platforms: + * Windows: debug output stream + * Android: log output + * Others: standard error output (stderr) + */ + +#ifndef SDL_log_h_ +#define SDL_log_h_ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * \brief The maximum size of a log message prior to SDL 2.0.24 + * + * As of 2.0.24 there is no limit to the length of SDL log messages. + */ +#define SDL_MAX_LOG_MESSAGE 4096 + +/** + * \brief The predefined log categories + * + * By default the application category is enabled at the INFO level, + * the assert category is enabled at the WARN level, test is enabled + * at the VERBOSE level and all other categories are enabled at the + * CRITICAL level. + */ +typedef enum +{ + SDL_LOG_CATEGORY_APPLICATION, + SDL_LOG_CATEGORY_ERROR, + SDL_LOG_CATEGORY_ASSERT, + SDL_LOG_CATEGORY_SYSTEM, + SDL_LOG_CATEGORY_AUDIO, + SDL_LOG_CATEGORY_VIDEO, + SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_INPUT, + SDL_LOG_CATEGORY_TEST, + + /* Reserved for future SDL library use */ + SDL_LOG_CATEGORY_RESERVED1, + SDL_LOG_CATEGORY_RESERVED2, + SDL_LOG_CATEGORY_RESERVED3, + SDL_LOG_CATEGORY_RESERVED4, + SDL_LOG_CATEGORY_RESERVED5, + SDL_LOG_CATEGORY_RESERVED6, + SDL_LOG_CATEGORY_RESERVED7, + SDL_LOG_CATEGORY_RESERVED8, + SDL_LOG_CATEGORY_RESERVED9, + SDL_LOG_CATEGORY_RESERVED10, + + /* Beyond this point is reserved for application use, e.g. + enum { + MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, + MYAPP_CATEGORY_AWESOME2, + MYAPP_CATEGORY_AWESOME3, + ... + }; + */ + SDL_LOG_CATEGORY_CUSTOM +} SDL_LogCategory; + +/** + * \brief The predefined log priorities + */ +typedef enum +{ + SDL_LOG_PRIORITY_VERBOSE = 1, + SDL_LOG_PRIORITY_DEBUG, + SDL_LOG_PRIORITY_INFO, + SDL_LOG_PRIORITY_WARN, + SDL_LOG_PRIORITY_ERROR, + SDL_LOG_PRIORITY_CRITICAL, + SDL_NUM_LOG_PRIORITIES +} SDL_LogPriority; + + +/** + * Set the priority of all log categories. + * + * \param priority the SDL_LogPriority to assign + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LogSetPriority + */ +extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); + +/** + * Set the priority of a particular log category. + * + * \param category the category to assign a priority to + * \param priority the SDL_LogPriority to assign + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LogGetPriority + * \sa SDL_LogSetAllPriority + */ +extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, + SDL_LogPriority priority); + +/** + * Get the priority of a particular log category. + * + * \param category the category to query + * \returns the SDL_LogPriority for the requested category + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LogSetPriority + */ +extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category); + +/** + * Reset all priorities to default. + * + * This is called by SDL_Quit(). + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LogSetAllPriority + * \sa SDL_LogSetPriority + */ +extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); + +/** + * Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO. + * + * = * \param fmt a printf() style message format string + * + * \param ... additional parameters matching % tokens in the `fmt` string, if + * any + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LogCritical + * \sa SDL_LogDebug + * \sa SDL_LogError + * \sa SDL_LogInfo + * \sa SDL_LogMessage + * \sa SDL_LogMessageV + * \sa SDL_LogVerbose + * \sa SDL_LogWarn + */ +extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); + +/** + * Log a message with SDL_LOG_PRIORITY_VERBOSE. + * + * \param category the category of the message + * \param fmt a printf() style message format string + * \param ... additional parameters matching % tokens in the **fmt** string, + * if any + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Log + * \sa SDL_LogCritical + * \sa SDL_LogDebug + * \sa SDL_LogError + * \sa SDL_LogInfo + * \sa SDL_LogMessage + * \sa SDL_LogMessageV + * \sa SDL_LogWarn + */ +extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * Log a message with SDL_LOG_PRIORITY_DEBUG. + * + * \param category the category of the message + * \param fmt a printf() style message format string + * \param ... additional parameters matching % tokens in the **fmt** string, + * if any + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Log + * \sa SDL_LogCritical + * \sa SDL_LogError + * \sa SDL_LogInfo + * \sa SDL_LogMessage + * \sa SDL_LogMessageV + * \sa SDL_LogVerbose + * \sa SDL_LogWarn + */ +extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * Log a message with SDL_LOG_PRIORITY_INFO. + * + * \param category the category of the message + * \param fmt a printf() style message format string + * \param ... additional parameters matching % tokens in the **fmt** string, + * if any + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Log + * \sa SDL_LogCritical + * \sa SDL_LogDebug + * \sa SDL_LogError + * \sa SDL_LogMessage + * \sa SDL_LogMessageV + * \sa SDL_LogVerbose + * \sa SDL_LogWarn + */ +extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * Log a message with SDL_LOG_PRIORITY_WARN. + * + * \param category the category of the message + * \param fmt a printf() style message format string + * \param ... additional parameters matching % tokens in the **fmt** string, + * if any + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Log + * \sa SDL_LogCritical + * \sa SDL_LogDebug + * \sa SDL_LogError + * \sa SDL_LogInfo + * \sa SDL_LogMessage + * \sa SDL_LogMessageV + * \sa SDL_LogVerbose + */ +extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * Log a message with SDL_LOG_PRIORITY_ERROR. + * + * \param category the category of the message + * \param fmt a printf() style message format string + * \param ... additional parameters matching % tokens in the **fmt** string, + * if any + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Log + * \sa SDL_LogCritical + * \sa SDL_LogDebug + * \sa SDL_LogInfo + * \sa SDL_LogMessage + * \sa SDL_LogMessageV + * \sa SDL_LogVerbose + * \sa SDL_LogWarn + */ +extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * Log a message with SDL_LOG_PRIORITY_CRITICAL. + * + * \param category the category of the message + * \param fmt a printf() style message format string + * \param ... additional parameters matching % tokens in the **fmt** string, + * if any + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Log + * \sa SDL_LogDebug + * \sa SDL_LogError + * \sa SDL_LogInfo + * \sa SDL_LogMessage + * \sa SDL_LogMessageV + * \sa SDL_LogVerbose + * \sa SDL_LogWarn + */ +extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); + +/** + * Log a message with the specified category and priority. + * + * \param category the category of the message + * \param priority the priority of the message + * \param fmt a printf() style message format string + * \param ... additional parameters matching % tokens in the **fmt** string, + * if any + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Log + * \sa SDL_LogCritical + * \sa SDL_LogDebug + * \sa SDL_LogError + * \sa SDL_LogInfo + * \sa SDL_LogMessageV + * \sa SDL_LogVerbose + * \sa SDL_LogWarn + */ +extern DECLSPEC void SDLCALL SDL_LogMessage(int category, + SDL_LogPriority priority, + SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3); + +/** + * Log a message with the specified category and priority. + * + * \param category the category of the message + * \param priority the priority of the message + * \param fmt a printf() style message format string + * \param ap a variable argument list + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Log + * \sa SDL_LogCritical + * \sa SDL_LogDebug + * \sa SDL_LogError + * \sa SDL_LogInfo + * \sa SDL_LogMessage + * \sa SDL_LogVerbose + * \sa SDL_LogWarn + */ +extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, + SDL_LogPriority priority, + const char *fmt, va_list ap); + +/** + * The prototype for the log output callback function. + * + * This function is called by SDL when there is new text to be logged. + * + * \param userdata what was passed as `userdata` to SDL_LogSetOutputFunction() + * \param category the category of the message + * \param priority the priority of the message + * \param message the message being output + */ +typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); + +/** + * Get the current log output function. + * + * \param callback an SDL_LogOutputFunction filled in with the current log + * callback + * \param userdata a pointer filled in with the pointer that is passed to + * `callback` + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LogSetOutputFunction + */ +extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); + +/** + * Replace the default log output function with one of your own. + * + * \param callback an SDL_LogOutputFunction to call instead of the default + * \param userdata a pointer that is passed to `callback` + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LogGetOutputFunction + */ +extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_log_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_main.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_main.h new file mode 100644 index 00000000..8e938ca8 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_main.h @@ -0,0 +1,282 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDL_main_h_ +#define SDL_main_h_ + +#include + +/** + * \file SDL_main.h + * + * Redefine main() on some platforms so that it is called by SDL. + */ + +#ifndef SDL_MAIN_HANDLED +#if defined(__WIN32__) +/* On Windows SDL provides WinMain(), which parses the command line and passes + the arguments to your main function. + + If you provide your own WinMain(), you may define SDL_MAIN_HANDLED + */ +#define SDL_MAIN_AVAILABLE + +#elif defined(__WINRT__) +/* On WinRT, SDL provides a main function that initializes CoreApplication, + creating an instance of IFrameworkView in the process. + + Please note that #include'ing SDL_main.h is not enough to get a main() + function working. In non-XAML apps, the file, + src/main/winrt/SDL_WinRT_main_NonXAML.cpp, or a copy of it, must be compiled + into the app itself. In XAML apps, the function, SDL_WinRTRunApp must be + called, with a pointer to the Direct3D-hosted XAML control passed in. +*/ +#define SDL_MAIN_NEEDED + +#elif defined(__GDK__) +/* On GDK, SDL provides a main function that initializes the game runtime. + + Please note that #include'ing SDL_main.h is not enough to get a main() + function working. You must either link against SDL2main or, if not possible, + call the SDL_GDKRunApp function from your entry point. +*/ +#define SDL_MAIN_NEEDED + +#elif defined(__IPHONEOS__) +/* On iOS SDL provides a main function that creates an application delegate + and starts the iOS application run loop. + + If you link with SDL dynamically on iOS, the main function can't be in a + shared library, so you need to link with libSDLmain.a, which includes a + stub main function that calls into the shared library to start execution. + + See src/video/uikit/SDL_uikitappdelegate.m for more details. + */ +#define SDL_MAIN_NEEDED + +#elif defined(__ANDROID__) +/* On Android SDL provides a Java class in SDLActivity.java that is the + main activity entry point. + + See docs/README-android.md for more details on extending that class. + */ +#define SDL_MAIN_NEEDED + +/* We need to export SDL_main so it can be launched from Java */ +#define SDLMAIN_DECLSPEC DECLSPEC + +#elif defined(__NACL__) +/* On NACL we use ppapi_simple to set up the application helper code, + then wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before + starting the user main function. + All user code is run in a separate thread by ppapi_simple, thus + allowing for blocking io to take place via nacl_io +*/ +#define SDL_MAIN_NEEDED + +#elif defined(__PSP__) +/* On PSP SDL provides a main function that sets the module info, + activates the GPU and starts the thread required to be able to exit + the software. + + If you provide this yourself, you may define SDL_MAIN_HANDLED + */ +#define SDL_MAIN_AVAILABLE + +#elif defined(__PS2__) +#define SDL_MAIN_AVAILABLE + +#define SDL_PS2_SKIP_IOP_RESET() \ + void reset_IOP(); \ + void reset_IOP() {} + +#elif defined(__3DS__) +/* + On N3DS, SDL provides a main function that sets up the screens + and storage. + + If you provide this yourself, you may define SDL_MAIN_HANDLED +*/ +#define SDL_MAIN_AVAILABLE + +#endif +#endif /* SDL_MAIN_HANDLED */ + +#ifndef SDLMAIN_DECLSPEC +#define SDLMAIN_DECLSPEC +#endif + +/** + * \file SDL_main.h + * + * The application's main() function must be called with C linkage, + * and should be declared like this: + * \code + * #ifdef __cplusplus + * extern "C" + * #endif + * int main(int argc, char *argv[]) + * { + * } + * \endcode + */ + +#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) +#define main SDL_main +#endif + +#include +#ifdef __cplusplus +extern "C" { +#endif + +/** + * The prototype for the application's main() function + */ +typedef int (*SDL_main_func)(int argc, char *argv[]); +extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]); + + +/** + * Circumvent failure of SDL_Init() when not using SDL_main() as an entry + * point. + * + * This function is defined in SDL_main.h, along with the preprocessor rule to + * redefine main() as SDL_main(). Thus to ensure that your main() function + * will not be changed it is necessary to define SDL_MAIN_HANDLED before + * including SDL.h. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_Init + */ +extern DECLSPEC void SDLCALL SDL_SetMainReady(void); + +#if defined(__WIN32__) || defined(__GDK__) + +/** + * Register a win32 window class for SDL's use. + * + * This can be called to set the application window class at startup. It is + * safe to call this multiple times, as long as every call is eventually + * paired with a call to SDL_UnregisterApp, but a second registration attempt + * while a previous registration is still active will be ignored, other than + * to increment a counter. + * + * Most applications do not need to, and should not, call this directly; SDL + * will call it when initializing the video subsystem. + * + * \param name the window class name, in UTF-8 encoding. If NULL, SDL + * currently uses "SDL_app" but this isn't guaranteed. + * \param style the value to use in WNDCLASSEX::style. If `name` is NULL, SDL + * currently uses `(CS_BYTEALIGNCLIENT | CS_OWNDC)` regardless of + * what is specified here. + * \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL + * will use `GetModuleHandle(NULL)` instead. + * \returns 0 on success, -1 on error. SDL_GetError() may have details. + * + * \since This function is available since SDL 2.0.2. + */ +extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst); + +/** + * Deregister the win32 window class from an SDL_RegisterApp call. + * + * This can be called to undo the effects of SDL_RegisterApp. + * + * Most applications do not need to, and should not, call this directly; SDL + * will call it when deinitializing the video subsystem. + * + * It is safe to call this multiple times, as long as every call is eventually + * paired with a prior call to SDL_RegisterApp. The window class will only be + * deregistered when the registration counter in SDL_RegisterApp decrements to + * zero through calls to this function. + * + * \since This function is available since SDL 2.0.2. + */ +extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); + +#endif /* defined(__WIN32__) || defined(__GDK__) */ + + +#ifdef __WINRT__ + +/** + * Initialize and launch an SDL/WinRT application. + * + * \param mainFunction the SDL app's C-style main(), an SDL_main_func + * \param reserved reserved for future use; should be NULL + * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve + * more information on the failure. + * + * \since This function is available since SDL 2.0.3. + */ +extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved); + +#endif /* __WINRT__ */ + +#if defined(__IPHONEOS__) + +/** + * Initializes and launches an SDL application. + * + * \param argc The argc parameter from the application's main() function + * \param argv The argv parameter from the application's main() function + * \param mainFunction The SDL app's C-style main(), an SDL_main_func + * \return the return value from mainFunction + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction); + +#endif /* __IPHONEOS__ */ + +#ifdef __GDK__ + +/** + * Initialize and launch an SDL GDK application. + * + * \param mainFunction the SDL app's C-style main(), an SDL_main_func + * \param reserved reserved for future use; should be NULL + * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve + * more information on the failure. + * + * \since This function is available since SDL 2.24.0. + */ +extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved); + +/** + * Callback from the application to let the suspend continue. + * + * \since This function is available since SDL 2.28.0. + */ +extern DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); + +#endif /* __GDK__ */ + +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_main_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_messagebox.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_messagebox.h new file mode 100644 index 00000000..3edafdbc --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_messagebox.h @@ -0,0 +1,193 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDL_messagebox_h_ +#define SDL_messagebox_h_ + +#include +#include /* For SDL_Window */ + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * SDL_MessageBox flags. If supported will display warning icon, etc. + */ +typedef enum +{ + SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ + SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ + SDL_MESSAGEBOX_INFORMATION = 0x00000040, /**< informational dialog */ + SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080, /**< buttons placed left to right */ + SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100 /**< buttons placed right to left */ +} SDL_MessageBoxFlags; + +/** + * Flags for SDL_MessageBoxButtonData. + */ +typedef enum +{ + SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ + SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ +} SDL_MessageBoxButtonFlags; + +/** + * Individual button data. + */ +typedef struct +{ + Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ + int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ + const char * text; /**< The UTF-8 button text */ +} SDL_MessageBoxButtonData; + +/** + * RGB value used in a message box color scheme + */ +typedef struct +{ + Uint8 r, g, b; +} SDL_MessageBoxColor; + +typedef enum +{ + SDL_MESSAGEBOX_COLOR_BACKGROUND, + SDL_MESSAGEBOX_COLOR_TEXT, + SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, + SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, + SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, + SDL_MESSAGEBOX_COLOR_MAX +} SDL_MessageBoxColorType; + +/** + * A set of colors to use for message box dialogs + */ +typedef struct +{ + SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; +} SDL_MessageBoxColorScheme; + +/** + * MessageBox structure containing title, text, window, etc. + */ +typedef struct +{ + Uint32 flags; /**< ::SDL_MessageBoxFlags */ + SDL_Window *window; /**< Parent window, can be NULL */ + const char *title; /**< UTF-8 title */ + const char *message; /**< UTF-8 message text */ + + int numbuttons; + const SDL_MessageBoxButtonData *buttons; + + const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ +} SDL_MessageBoxData; + +/** + * Create a modal message box. + * + * If your needs aren't complex, it might be easier to use + * SDL_ShowSimpleMessageBox. + * + * This function should be called on the thread that created the parent + * window, or on the main thread if the messagebox has no parent. It will + * block execution of that thread until the user clicks a button or closes the + * messagebox. + * + * This function may be called at any time, even before SDL_Init(). This makes + * it useful for reporting errors like a failure to create a renderer or + * OpenGL context. + * + * On X11, SDL rolls its own dialog box with X11 primitives instead of a + * formal toolkit like GTK+ or Qt. + * + * Note that if SDL_Init() would fail because there isn't any available video + * target, this function is likely to fail for the same reasons. If this is a + * concern, check the return value from this function and fall back to writing + * to stderr if you can. + * + * \param messageboxdata the SDL_MessageBoxData structure with title, text and + * other options + * \param buttonid the pointer to which user id of hit button should be copied + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ShowSimpleMessageBox + */ +extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); + +/** + * Display a simple modal message box. + * + * If your needs aren't complex, this function is preferred over + * SDL_ShowMessageBox. + * + * `flags` may be any of the following: + * + * - `SDL_MESSAGEBOX_ERROR`: error dialog + * - `SDL_MESSAGEBOX_WARNING`: warning dialog + * - `SDL_MESSAGEBOX_INFORMATION`: informational dialog + * + * This function should be called on the thread that created the parent + * window, or on the main thread if the messagebox has no parent. It will + * block execution of that thread until the user clicks a button or closes the + * messagebox. + * + * This function may be called at any time, even before SDL_Init(). This makes + * it useful for reporting errors like a failure to create a renderer or + * OpenGL context. + * + * On X11, SDL rolls its own dialog box with X11 primitives instead of a + * formal toolkit like GTK+ or Qt. + * + * Note that if SDL_Init() would fail because there isn't any available video + * target, this function is likely to fail for the same reasons. If this is a + * concern, check the return value from this function and fall back to writing + * to stderr if you can. + * + * \param flags an SDL_MessageBoxFlags value + * \param title UTF-8 title text + * \param message UTF-8 message text + * \param window the parent window, or NULL for no parent + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ShowMessageBox + */ +extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_messagebox_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_metal.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_metal.h new file mode 100644 index 00000000..b4c0df81 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_metal.h @@ -0,0 +1,113 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_metal.h + * + * Header file for functions to creating Metal layers and views on SDL windows. + */ + +#ifndef SDL_metal_h_ +#define SDL_metal_h_ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). + * + * \note This can be cast directly to an NSView or UIView. + */ +typedef void *SDL_MetalView; + +/** + * \name Metal support functions + */ +/* @{ */ + +/** + * Create a CAMetalLayer-backed NSView/UIView and attach it to the specified + * window. + * + * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on + * its own. It is up to user code to do that. + * + * The returned handle can be casted directly to a NSView or UIView. To access + * the backing CAMetalLayer, call SDL_Metal_GetLayer(). + * + * \since This function is available since SDL 2.0.12. + * + * \sa SDL_Metal_DestroyView + * \sa SDL_Metal_GetLayer + */ +extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); + +/** + * Destroy an existing SDL_MetalView object. + * + * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was + * called after SDL_CreateWindow. + * + * \since This function is available since SDL 2.0.12. + * + * \sa SDL_Metal_CreateView + */ +extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); + +/** + * Get a pointer to the backing CAMetalLayer for the given view. + * + * \since This function is available since SDL 2.0.14. + * + * \sa SDL_Metal_CreateView + */ +extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); + +/** + * Get the size of a window's underlying drawable in pixels (for use with + * setting viewport, scissor & etc). + * + * \param window SDL_Window from which the drawable size should be queried + * \param w Pointer to variable for storing the width in pixels, may be NULL + * \param h Pointer to variable for storing the height in pixels, may be NULL + * + * \since This function is available since SDL 2.0.14. + * + * \sa SDL_GetWindowSize + * \sa SDL_CreateWindow + */ +extern DECLSPEC void SDLCALL SDL_Metal_GetDrawableSize(SDL_Window* window, int *w, + int *h); + +/* @} *//* Metal support functions */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_metal_h_ */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_misc.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_misc.h new file mode 100644 index 00000000..64e0f78a --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_misc.h @@ -0,0 +1,79 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_misc.h + * + * \brief Include file for SDL API functions that don't fit elsewhere. + */ + +#ifndef SDL_misc_h_ +#define SDL_misc_h_ + +#include + +#include + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Open a URL/URI in the browser or other appropriate external application. + * + * Open a URL in a separate, system-provided application. How this works will + * vary wildly depending on the platform. This will likely launch what makes + * sense to handle a specific URL's protocol (a web browser for `http://`, + * etc), but it might also be able to launch file managers for directories and + * other things. + * + * What happens when you open a URL varies wildly as well: your game window + * may lose focus (and may or may not lose focus if your game was fullscreen + * or grabbing input at the time). On mobile devices, your app will likely + * move to the background or your process might be paused. Any given platform + * may or may not handle a given URL. + * + * If this is unimplemented (or simply unavailable) for a platform, this will + * fail with an error. A successful result does not mean the URL loaded, just + * that we launched _something_ to handle it (or at least believe we did). + * + * All this to say: this function can be useful, but you should definitely + * test it on every platform you target. + * + * \param url A valid URL/URI to open. Use `file:///full/path/to/file` for + * local files, if supported. + * \returns 0 on success, or -1 on error; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_misc_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_mouse.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_mouse.h new file mode 100644 index 00000000..5b224ecd --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_mouse.h @@ -0,0 +1,464 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_mouse.h + * + * Include file for SDL mouse event handling. + */ + +#ifndef SDL_mouse_h_ +#define SDL_mouse_h_ + +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct SDL_Cursor SDL_Cursor; /**< Implementation dependent */ + +/** + * \brief Cursor types for SDL_CreateSystemCursor(). + */ +typedef enum +{ + SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */ + SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */ + SDL_SYSTEM_CURSOR_WAIT, /**< Wait */ + SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */ + SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */ + SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */ + SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */ + SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */ + SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */ + SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */ + SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */ + SDL_SYSTEM_CURSOR_HAND, /**< Hand */ + SDL_NUM_SYSTEM_CURSORS +} SDL_SystemCursor; + +/** + * \brief Scroll direction types for the Scroll event + */ +typedef enum +{ + SDL_MOUSEWHEEL_NORMAL, /**< The scroll direction is normal */ + SDL_MOUSEWHEEL_FLIPPED /**< The scroll direction is flipped / natural */ +} SDL_MouseWheelDirection; + +/* Function prototypes */ + +/** + * Get the window which currently has mouse focus. + * + * \returns the window with mouse focus. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); + +/** + * Retrieve the current state of the mouse. + * + * The current button state is returned as a button bitmask, which can be + * tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the + * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the + * mouse cursor position relative to the focus window. You can pass NULL for + * either `x` or `y`. + * + * \param x the x coordinate of the mouse cursor position relative to the + * focus window + * \param y the y coordinate of the mouse cursor position relative to the + * focus window + * \returns a 32-bit button bitmask of the current button state. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetGlobalMouseState + * \sa SDL_GetRelativeMouseState + * \sa SDL_PumpEvents + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); + +/** + * Get the current state of the mouse in relation to the desktop. + * + * This works similarly to SDL_GetMouseState(), but the coordinates will be + * reported relative to the top-left of the desktop. This can be useful if you + * need to track the mouse outside of a specific window and SDL_CaptureMouse() + * doesn't fit your needs. For example, it could be useful if you need to + * track the mouse while dragging a window, where coordinates relative to a + * window might not be in sync at all times. + * + * Note: SDL_GetMouseState() returns the mouse position as SDL understands it + * from the last pump of the event queue. This function, however, queries the + * OS for the current mouse position, and as such, might be a slightly less + * efficient function. Unless you know what you're doing and have a good + * reason to use this function, you probably want SDL_GetMouseState() instead. + * + * \param x filled in with the current X coord relative to the desktop; can be + * NULL + * \param y filled in with the current Y coord relative to the desktop; can be + * NULL + * \returns the current button state as a bitmask which can be tested using + * the SDL_BUTTON(X) macros. + * + * \since This function is available since SDL 2.0.4. + * + * \sa SDL_CaptureMouse + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetGlobalMouseState(int *x, int *y); + +/** + * Retrieve the relative state of the mouse. + * + * The current button state is returned as a button bitmask, which can be + * tested using the `SDL_BUTTON(X)` macros (where `X` is generally 1 for the + * left, 2 for middle, 3 for the right button), and `x` and `y` are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState() or since + * event initialization. You can pass NULL for either `x` or `y`. + * + * \param x a pointer filled with the last recorded x coordinate of the mouse + * \param y a pointer filled with the last recorded y coordinate of the mouse + * \returns a 32-bit button bitmask of the relative button state. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetMouseState + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); + +/** + * Move the mouse cursor to the given position within the window. + * + * This function generates a mouse motion event if relative mode is not + * enabled. If relative mode is enabled, you can force mouse events for the + * warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint. + * + * Note that this function will appear to succeed, but not actually move the + * mouse when used over Microsoft Remote Desktop. + * + * \param window the window to move the mouse into, or NULL for the current + * mouse focus + * \param x the x coordinate within the window + * \param y the y coordinate within the window + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_WarpMouseGlobal + */ +extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, + int x, int y); + +/** + * Move the mouse to the given position in global screen space. + * + * This function generates a mouse motion event. + * + * A failure of this function usually means that it is unsupported by a + * platform. + * + * Note that this function will appear to succeed, but not actually move the + * mouse when used over Microsoft Remote Desktop. + * + * \param x the x coordinate + * \param y the y coordinate + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.4. + * + * \sa SDL_WarpMouseInWindow + */ +extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y); + +/** + * Set relative mouse mode. + * + * While the mouse is in relative mode, the cursor is hidden, the mouse + * position is constrained to the window, and SDL will report continuous + * relative mouse motion even if the mouse is at the edge of the window. + * + * This function will flush any pending mouse motion. + * + * \param enabled SDL_TRUE to enable relative mode, SDL_FALSE to disable. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * If relative mode is not supported, this returns -1. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRelativeMouseMode + */ +extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); + +/** + * Capture the mouse and to track input outside an SDL window. + * + * Capturing enables your app to obtain mouse events globally, instead of just + * within your window. Not all video targets support this function. When + * capturing is enabled, the current window will get all mouse events, but + * unlike relative mode, no change is made to the cursor and it is not + * restrained to your window. + * + * This function may also deny mouse input to other windows--both those in + * your application and others on the system--so you should use this function + * sparingly, and in small bursts. For example, you might want to track the + * mouse while the user is dragging something, until the user releases a mouse + * button. It is not recommended that you capture the mouse for long periods + * of time, such as the entire time your app is running. For that, you should + * probably use SDL_SetRelativeMouseMode() or SDL_SetWindowGrab(), depending + * on your goals. + * + * While captured, mouse events still report coordinates relative to the + * current (foreground) window, but those coordinates may be outside the + * bounds of the window (including negative values). Capturing is only allowed + * for the foreground window. If the window loses focus while capturing, the + * capture will be disabled automatically. + * + * While capturing is enabled, the current window will have the + * `SDL_WINDOW_MOUSE_CAPTURE` flag set. + * + * Please note that as of SDL 2.0.22, SDL will attempt to "auto capture" the + * mouse while the user is pressing a button; this is to try and make mouse + * behavior more consistent between platforms, and deal with the common case + * of a user dragging the mouse outside of the window. This means that if you + * are calling SDL_CaptureMouse() only to deal with this situation, you no + * longer have to (although it is safe to do so). If this causes problems for + * your app, you can disable auto capture by setting the + * `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero. + * + * \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable. + * \returns 0 on success or -1 if not supported; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.4. + * + * \sa SDL_GetGlobalMouseState + */ +extern DECLSPEC int SDLCALL SDL_CaptureMouse(SDL_bool enabled); + +/** + * Query whether relative mouse mode is enabled. + * + * \returns SDL_TRUE if relative mode is enabled or SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetRelativeMouseMode + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); + +/** + * Create a cursor using the specified bitmap data and mask (in MSB format). + * + * `mask` has to be in MSB (Most Significant Bit) format. + * + * The cursor width (`w`) must be a multiple of 8 bits. + * + * The cursor is created in black and white according to the following: + * + * - data=0, mask=1: white + * - data=1, mask=1: black + * - data=0, mask=0: transparent + * - data=1, mask=0: inverted color if possible, black if not. + * + * Cursors created with this function must be freed with SDL_FreeCursor(). + * + * If you want to have a color cursor, or create your cursor from an + * SDL_Surface, you should use SDL_CreateColorCursor(). Alternately, you can + * hide the cursor and draw your own as part of your game's rendering, but it + * will be bound to the framerate. + * + * Also, since SDL 2.0.0, SDL_CreateSystemCursor() is available, which + * provides twelve readily available system cursors to pick from. + * + * \param data the color value for each pixel of the cursor + * \param mask the mask value for each pixel of the cursor + * \param w the width of the cursor + * \param h the height of the cursor + * \param hot_x the X-axis location of the upper left corner of the cursor + * relative to the actual mouse position + * \param hot_y the Y-axis location of the upper left corner of the cursor + * relative to the actual mouse position + * \returns a new cursor with the specified parameters on success or NULL on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FreeCursor + * \sa SDL_SetCursor + * \sa SDL_ShowCursor + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, + const Uint8 * mask, + int w, int h, int hot_x, + int hot_y); + +/** + * Create a color cursor. + * + * \param surface an SDL_Surface structure representing the cursor image + * \param hot_x the x position of the cursor hot spot + * \param hot_y the y position of the cursor hot spot + * \returns the new cursor on success or NULL on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateCursor + * \sa SDL_FreeCursor + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, + int hot_x, + int hot_y); + +/** + * Create a system cursor. + * + * \param id an SDL_SystemCursor enum value + * \returns a cursor on success or NULL on failure; call SDL_GetError() for + * more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FreeCursor + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); + +/** + * Set the active cursor. + * + * This function sets the currently active cursor to the specified one. If the + * cursor is currently visible, the change will be immediately represented on + * the display. SDL_SetCursor(NULL) can be used to force cursor redraw, if + * this is desired for any reason. + * + * \param cursor a cursor to make active + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateCursor + * \sa SDL_GetCursor + * \sa SDL_ShowCursor + */ +extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); + +/** + * Get the active cursor. + * + * This function returns a pointer to the current cursor which is owned by the + * library. It is not necessary to free the cursor with SDL_FreeCursor(). + * + * \returns the active cursor or NULL if there is no mouse. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetCursor + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); + +/** + * Get the default cursor. + * + * You do not have to call SDL_FreeCursor() on the return value, but it is + * safe to do so. + * + * \returns the default cursor on success or NULL on failure. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateSystemCursor + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); + +/** + * Free a previously-created cursor. + * + * Use this function to free cursor resources created with SDL_CreateCursor(), + * SDL_CreateColorCursor() or SDL_CreateSystemCursor(). + * + * \param cursor the cursor to free + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateColorCursor + * \sa SDL_CreateCursor + * \sa SDL_CreateSystemCursor + */ +extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); + +/** + * Toggle whether or not the cursor is shown. + * + * The cursor starts off displayed but can be turned off. Passing `SDL_ENABLE` + * displays the cursor and passing `SDL_DISABLE` hides it. + * + * The current state of the mouse cursor can be queried by passing + * `SDL_QUERY`; either `SDL_DISABLE` or `SDL_ENABLE` will be returned. + * + * \param toggle `SDL_ENABLE` to show the cursor, `SDL_DISABLE` to hide it, + * `SDL_QUERY` to query the current state without changing it. + * \returns `SDL_ENABLE` if the cursor is shown, or `SDL_DISABLE` if the + * cursor is hidden, or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateCursor + * \sa SDL_SetCursor + */ +extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); + +/** + * Used as a mask when testing buttons in buttonstate. + * + * - Button 1: Left mouse button + * - Button 2: Middle mouse button + * - Button 3: Right mouse button + */ +#define SDL_BUTTON(X) (1 << ((X)-1)) +#define SDL_BUTTON_LEFT 1 +#define SDL_BUTTON_MIDDLE 2 +#define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_X1 4 +#define SDL_BUTTON_X2 5 +#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) +#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) +#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_mouse_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_mutex.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_mutex.h new file mode 100644 index 00000000..d4afb6fb --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_mutex.h @@ -0,0 +1,545 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDL_mutex_h_ +#define SDL_mutex_h_ + +/** + * \file SDL_mutex.h + * + * Functions to provide thread synchronization primitives. + */ + +#include +#include + +/******************************************************************************/ +/* Enable thread safety attributes only with clang. + * The attributes can be safely erased when compiling with other compilers. + */ +#if defined(SDL_THREAD_SAFETY_ANALYSIS) && \ + defined(__clang__) && (!defined(SWIG)) +#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x)) +#else +#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) /* no-op */ +#endif + +#define SDL_CAPABILITY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(capability(x)) + +#define SDL_SCOPED_CAPABILITY \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable) + +#define SDL_GUARDED_BY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) + +#define SDL_PT_GUARDED_BY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x)) + +#define SDL_ACQUIRED_BEFORE(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(x)) + +#define SDL_ACQUIRED_AFTER(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(x)) + +#define SDL_REQUIRES(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(x)) + +#define SDL_REQUIRES_SHARED(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(x)) + +#define SDL_ACQUIRE(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(x)) + +#define SDL_ACQUIRE_SHARED(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(x)) + +#define SDL_RELEASE(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(x)) + +#define SDL_RELEASE_SHARED(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(x)) + +#define SDL_RELEASE_GENERIC(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_generic_capability(x)) + +#define SDL_TRY_ACQUIRE(x, y) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(x, y)) + +#define SDL_TRY_ACQUIRE_SHARED(x, y) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(x, y)) + +#define SDL_EXCLUDES(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(x)) + +#define SDL_ASSERT_CAPABILITY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x)) + +#define SDL_ASSERT_SHARED_CAPABILITY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x)) + +#define SDL_RETURN_CAPABILITY(x) \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x)) + +#define SDL_NO_THREAD_SAFETY_ANALYSIS \ + SDL_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis) + +/******************************************************************************/ + + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Synchronization functions which can time out return this value + * if they time out. + */ +#define SDL_MUTEX_TIMEDOUT 1 + +/** + * This is the timeout value which corresponds to never time out. + */ +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) + + +/** + * \name Mutex functions + */ +/* @{ */ + +/* The SDL mutex structure, defined in SDL_sysmutex.c */ +struct SDL_mutex; +typedef struct SDL_mutex SDL_mutex; + +/** + * Create a new mutex. + * + * All newly-created mutexes begin in the _unlocked_ state. + * + * Calls to SDL_LockMutex() will not return while the mutex is locked by + * another thread. See SDL_TryLockMutex() to attempt to lock without blocking. + * + * SDL mutexes are reentrant. + * + * \returns the initialized and unlocked mutex or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_DestroyMutex + * \sa SDL_LockMutex + * \sa SDL_TryLockMutex + * \sa SDL_UnlockMutex + */ +extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); + +/** + * Lock the mutex. + * + * This will block until the mutex is available, which is to say it is in the + * unlocked state and the OS has chosen the caller as the next thread to lock + * it. Of all threads waiting to lock the mutex, only one may do so at a time. + * + * It is legal for the owning thread to lock an already-locked mutex. It must + * unlock it the same number of times before it is actually made available for + * other threads in the system (this is known as a "recursive mutex"). + * + * \param mutex the mutex to lock + * \return 0, or -1 on error. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex) SDL_ACQUIRE(mutex); +#define SDL_mutexP(m) SDL_LockMutex(m) + +/** + * Try to lock a mutex without blocking. + * + * This works just like SDL_LockMutex(), but if the mutex is not available, + * this function returns `SDL_MUTEX_TIMEOUT` immediately. + * + * This technique is useful if you need exclusive access to a resource but + * don't want to wait for it, and will return to it to try again later. + * + * \param mutex the mutex to try to lock + * \returns 0, `SDL_MUTEX_TIMEDOUT`, or -1 on error; call SDL_GetError() for + * more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateMutex + * \sa SDL_DestroyMutex + * \sa SDL_LockMutex + * \sa SDL_UnlockMutex + */ +extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex) SDL_TRY_ACQUIRE(0, mutex); + +/** + * Unlock the mutex. + * + * It is legal for the owning thread to lock an already-locked mutex. It must + * unlock it the same number of times before it is actually made available for + * other threads in the system (this is known as a "recursive mutex"). + * + * It is an error to unlock a mutex that has not been locked by the current + * thread, and doing so results in undefined behavior. + * + * It is also an error to unlock a mutex that isn't locked at all. + * + * \param mutex the mutex to unlock. + * \returns 0, or -1 on error. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex) SDL_RELEASE(mutex); +#define SDL_mutexV(m) SDL_UnlockMutex(m) + +/** + * Destroy a mutex created with SDL_CreateMutex(). + * + * This function must be called on any mutex that is no longer needed. Failure + * to destroy a mutex will result in a system memory or resource leak. While + * it is safe to destroy a mutex that is _unlocked_, it is not safe to attempt + * to destroy a locked mutex, and may result in undefined behavior depending + * on the platform. + * + * \param mutex the mutex to destroy + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateMutex + * \sa SDL_LockMutex + * \sa SDL_TryLockMutex + * \sa SDL_UnlockMutex + */ +extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); + +/* @} *//* Mutex functions */ + + +/** + * \name Semaphore functions + */ +/* @{ */ + +/* The SDL semaphore structure, defined in SDL_syssem.c */ +struct SDL_semaphore; +typedef struct SDL_semaphore SDL_sem; + +/** + * Create a semaphore. + * + * This function creates a new semaphore and initializes it with the value + * `initial_value`. Each wait operation on the semaphore will atomically + * decrement the semaphore value and potentially block if the semaphore value + * is 0. Each post operation will atomically increment the semaphore value and + * wake waiting threads and allow them to retry the wait operation. + * + * \param initial_value the starting value of the semaphore + * \returns a new semaphore or NULL on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_DestroySemaphore + * \sa SDL_SemPost + * \sa SDL_SemTryWait + * \sa SDL_SemValue + * \sa SDL_SemWait + * \sa SDL_SemWaitTimeout + */ +extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); + +/** + * Destroy a semaphore. + * + * It is not safe to destroy a semaphore if there are threads currently + * waiting on it. + * + * \param sem the semaphore to destroy + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateSemaphore + * \sa SDL_SemPost + * \sa SDL_SemTryWait + * \sa SDL_SemValue + * \sa SDL_SemWait + * \sa SDL_SemWaitTimeout + */ +extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); + +/** + * Wait until a semaphore has a positive value and then decrements it. + * + * This function suspends the calling thread until either the semaphore + * pointed to by `sem` has a positive value or the call is interrupted by a + * signal or error. If the call is successful it will atomically decrement the + * semaphore value. + * + * This function is the equivalent of calling SDL_SemWaitTimeout() with a time + * length of `SDL_MUTEX_MAXWAIT`. + * + * \param sem the semaphore wait on + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateSemaphore + * \sa SDL_DestroySemaphore + * \sa SDL_SemPost + * \sa SDL_SemTryWait + * \sa SDL_SemValue + * \sa SDL_SemWait + * \sa SDL_SemWaitTimeout + */ +extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); + +/** + * See if a semaphore has a positive value and decrement it if it does. + * + * This function checks to see if the semaphore pointed to by `sem` has a + * positive value and atomically decrements the semaphore value if it does. If + * the semaphore doesn't have a positive value, the function immediately + * returns SDL_MUTEX_TIMEDOUT. + * + * \param sem the semaphore to wait on + * \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait would + * block, or a negative error code on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateSemaphore + * \sa SDL_DestroySemaphore + * \sa SDL_SemPost + * \sa SDL_SemValue + * \sa SDL_SemWait + * \sa SDL_SemWaitTimeout + */ +extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); + +/** + * Wait until a semaphore has a positive value and then decrements it. + * + * This function suspends the calling thread until either the semaphore + * pointed to by `sem` has a positive value, the call is interrupted by a + * signal or error, or the specified time has elapsed. If the call is + * successful it will atomically decrement the semaphore value. + * + * \param sem the semaphore to wait on + * \param timeout the length of the timeout, in milliseconds + * \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not + * succeed in the allotted time, or a negative error code on failure; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateSemaphore + * \sa SDL_DestroySemaphore + * \sa SDL_SemPost + * \sa SDL_SemTryWait + * \sa SDL_SemValue + * \sa SDL_SemWait + */ +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout); + +/** + * Atomically increment a semaphore's value and wake waiting threads. + * + * \param sem the semaphore to increment + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateSemaphore + * \sa SDL_DestroySemaphore + * \sa SDL_SemTryWait + * \sa SDL_SemValue + * \sa SDL_SemWait + * \sa SDL_SemWaitTimeout + */ +extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); + +/** + * Get the current value of a semaphore. + * + * \param sem the semaphore to query + * \returns the current value of the semaphore. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateSemaphore + */ +extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); + +/* @} *//* Semaphore functions */ + + +/** + * \name Condition variable functions + */ +/* @{ */ + +/* The SDL condition variable structure, defined in SDL_syscond.c */ +struct SDL_cond; +typedef struct SDL_cond SDL_cond; + +/** + * Create a condition variable. + * + * \returns a new condition variable or NULL on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CondBroadcast + * \sa SDL_CondSignal + * \sa SDL_CondWait + * \sa SDL_CondWaitTimeout + * \sa SDL_DestroyCond + */ +extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); + +/** + * Destroy a condition variable. + * + * \param cond the condition variable to destroy + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CondBroadcast + * \sa SDL_CondSignal + * \sa SDL_CondWait + * \sa SDL_CondWaitTimeout + * \sa SDL_CreateCond + */ +extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); + +/** + * Restart one of the threads that are waiting on the condition variable. + * + * \param cond the condition variable to signal + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CondBroadcast + * \sa SDL_CondWait + * \sa SDL_CondWaitTimeout + * \sa SDL_CreateCond + * \sa SDL_DestroyCond + */ +extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); + +/** + * Restart all threads that are waiting on the condition variable. + * + * \param cond the condition variable to signal + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CondSignal + * \sa SDL_CondWait + * \sa SDL_CondWaitTimeout + * \sa SDL_CreateCond + * \sa SDL_DestroyCond + */ +extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); + +/** + * Wait until a condition variable is signaled. + * + * This function unlocks the specified `mutex` and waits for another thread to + * call SDL_CondSignal() or SDL_CondBroadcast() on the condition variable + * `cond`. Once the condition variable is signaled, the mutex is re-locked and + * the function returns. + * + * The mutex must be locked before calling this function. + * + * This function is the equivalent of calling SDL_CondWaitTimeout() with a + * time length of `SDL_MUTEX_MAXWAIT`. + * + * \param cond the condition variable to wait on + * \param mutex the mutex used to coordinate thread access + * \returns 0 when it is signaled or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CondBroadcast + * \sa SDL_CondSignal + * \sa SDL_CondWaitTimeout + * \sa SDL_CreateCond + * \sa SDL_DestroyCond + */ +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); + +/** + * Wait until a condition variable is signaled or a certain time has passed. + * + * This function unlocks the specified `mutex` and waits for another thread to + * call SDL_CondSignal() or SDL_CondBroadcast() on the condition variable + * `cond`, or for the specified time to elapse. Once the condition variable is + * signaled or the time elapsed, the mutex is re-locked and the function + * returns. + * + * The mutex must be locked before calling this function. + * + * \param cond the condition variable to wait on + * \param mutex the mutex used to coordinate thread access + * \param ms the maximum time to wait, in milliseconds, or `SDL_MUTEX_MAXWAIT` + * to wait indefinitely + * \returns 0 if the condition variable is signaled, `SDL_MUTEX_TIMEDOUT` if + * the condition is not signaled in the allotted time, or a negative + * error code on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CondBroadcast + * \sa SDL_CondSignal + * \sa SDL_CondWait + * \sa SDL_CreateCond + * \sa SDL_DestroyCond + */ +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, + SDL_mutex * mutex, Uint32 ms); + +/* @} *//* Condition variable functions */ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_mutex_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_name.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_name.h new file mode 100644 index 00000000..5c3e07ab --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_name.h @@ -0,0 +1,33 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDLname_h_ +#define SDLname_h_ + +#if defined(__STDC__) || defined(__cplusplus) +#define NeedFunctionPrototypes 1 +#endif + +#define SDL_NAME(X) SDL_##X + +#endif /* SDLname_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengl.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengl.h new file mode 100644 index 00000000..e1bc5efe --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengl.h @@ -0,0 +1,2132 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_opengl.h + * + * This is a simple file to encapsulate the OpenGL API headers. + */ + +/** + * \def NO_SDL_GLEXT + * + * Define this if you have your own version of glext.h and want to disable the + * version included in SDL_opengl.h. + */ + +#ifndef SDL_opengl_h_ +#define SDL_opengl_h_ + +#include + +#ifndef __IPHONEOS__ /* No OpenGL on iOS. */ + +/* + * Mesa 3-D graphics library + * + * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "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 __gl_h_ +#define __gl_h_ + +#if defined(USE_MGL_NAMESPACE) +#include +#endif + + +/********************************************************************** + * Begin system-specific stuff. + */ + +#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) +#define __WIN32__ +#endif + +#if defined(__WIN32__) && !defined(__CYGWIN__) +# if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */ +# define GLAPI __declspec(dllexport) +# elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) /* tag specifying we're building for DLL runtime support */ +# define GLAPI __declspec(dllimport) +# else /* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +# endif /* _STATIC_MESA support */ +# if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE) /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */ +# define GLAPIENTRY +# else +# define GLAPIENTRY __stdcall +# endif +#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */ +# define GLAPI extern +# define GLAPIENTRY __stdcall +#elif defined(__OS2__) || defined(__EMX__) /* native os/2 opengl */ +# define GLAPI extern +# define GLAPIENTRY _System +# define APIENTRY _System +# if defined(__GNUC__) && !defined(_System) +# define _System +# endif +#elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# define GLAPI __attribute__((visibility("default"))) +# define GLAPIENTRY +#endif /* WIN32 && !CYGWIN */ + +/* + * WINDOWS: Include windows.h here to define APIENTRY. + * It is also useful when applications include this file by + * including only glut.h, since glut.h depends on windows.h. + * Applications needing to include windows.h with parms other + * than "WIN32_LEAN_AND_MEAN" may include windows.h before + * glut.h or gl.h. + */ +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#ifndef NOMINMAX /* don't define min() and max(). */ +#define NOMINMAX +#endif +#include +#endif + +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef APIENTRY +#define APIENTRY GLAPIENTRY +#endif + +/* "P" suffix to be used for a pointer to a function */ +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif + +#ifndef GLAPIENTRYP +#define GLAPIENTRYP GLAPIENTRY * +#endif + +#if defined(PRAGMA_EXPORT_SUPPORTED) +#pragma export on +#endif + +/* + * End system-specific stuff. + **********************************************************************/ + + + +#ifdef __cplusplus +extern "C" { +#endif + + + +#define GL_VERSION_1_1 1 +#define GL_VERSION_1_2 1 +#define GL_VERSION_1_3 1 +#define GL_ARB_imaging 1 + + +/* + * Datatypes + */ +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef signed char GLbyte; /* 1-byte signed */ +typedef short GLshort; /* 2-byte signed */ +typedef int GLint; /* 4-byte signed */ +typedef unsigned char GLubyte; /* 1-byte unsigned */ +typedef unsigned short GLushort; /* 2-byte unsigned */ +typedef unsigned int GLuint; /* 4-byte unsigned */ +typedef int GLsizei; /* 4-byte signed */ +typedef float GLfloat; /* single precision float */ +typedef float GLclampf; /* single precision float in [0,1] */ +typedef double GLdouble; /* double precision float */ +typedef double GLclampd; /* double precision float in [0,1] */ + + + +/* + * Constants + */ + +/* Boolean values */ +#define GL_FALSE 0 +#define GL_TRUE 1 + +/* Data types */ +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A + +/* Primitives */ +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON 0x0009 + +/* Vertex Arrays */ +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D + +/* Matrix Mode */ +#define GL_MATRIX_MODE 0x0BA0 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 + +/* Points */ +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_POINT_SIZE_RANGE 0x0B12 + +/* Lines */ +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_WIDTH_RANGE 0x0B22 + +/* Polygons */ +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 + +/* Display Lists */ +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_LIST_MODE 0x0B30 + +/* Depth buffer */ +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_BITS 0x0D56 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_COMPONENT 0x1902 + +/* Lighting */ +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_SHININESS 0x1601 +#define GL_EMISSION 0x1600 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_SHADE_MODEL 0x0B54 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_NORMALIZE 0x0BA1 + +/* User clipping planes */ +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 + +/* Accumulation buffer */ +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_ACCUM 0x0100 +#define GL_ADD 0x0104 +#define GL_LOAD 0x0101 +#define GL_MULT 0x0103 +#define GL_RETURN 0x0102 + +/* Alpha testing */ +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_ALPHA_TEST_FUNC 0x0BC1 + +/* Blending */ +#define GL_BLEND 0x0BE2 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND_DST 0x0BE0 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 + +/* Render Mode */ +#define GL_FEEDBACK 0x1C01 +#define GL_RENDER 0x1C00 +#define GL_SELECT 0x1C02 + +/* Feedback */ +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 + +/* Selection */ +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 + +/* Fog */ +#define GL_FOG 0x0B60 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_COLOR 0x0B66 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_LINEAR 0x2601 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 + +/* Logic Ops */ +#define GL_LOGIC_OP 0x0BF1 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_CLEAR 0x1500 +#define GL_SET 0x150F +#define GL_COPY 0x1503 +#define GL_COPY_INVERTED 0x150C +#define GL_NOOP 0x1505 +#define GL_INVERT 0x150A +#define GL_AND 0x1501 +#define GL_NAND 0x150E +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_XOR 0x1506 +#define GL_EQUIV 0x1509 +#define GL_AND_REVERSE 0x1502 +#define GL_AND_INVERTED 0x1504 +#define GL_OR_REVERSE 0x150B +#define GL_OR_INVERTED 0x150D + +/* Stencil */ +#define GL_STENCIL_BITS 0x0D57 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_INDEX 0x1901 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 + +/* Buffers, Pixel Drawing/Reading */ +#define GL_NONE 0 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +/*GL_FRONT 0x0404 */ +/*GL_BACK 0x0405 */ +/*GL_FRONT_AND_BACK 0x0408 */ +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_COLOR_INDEX 0x1900 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_ALPHA_BITS 0x0D55 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_INDEX_BITS 0x0D51 +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_READ_BUFFER 0x0C02 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_BITMAP 0x1A00 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_DITHER 0x0BD0 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 + +/* Implementation limits */ +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B + +/* Gets */ +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_MODE 0x0C30 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_RENDER_MODE 0x0C40 +#define GL_RGBA_MODE 0x0C31 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_VIEWPORT 0x0BA2 + +/* Evaluators */ +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 + +/* Hints */ +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 + +/* Scissor box */ +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 + +/* Pixel Mode / Transfer */ +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 + +/* Texture mapping */ +#define GL_TEXTURE_ENV 0x2300 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_LINEAR 0x2400 +#define GL_EYE_PLANE 0x2502 +#define GL_SPHERE_MAP 0x2402 +#define GL_DECAL 0x2101 +#define GL_MODULATE 0x2100 +#define GL_NEAREST 0x2600 +#define GL_REPEAT 0x2901 +#define GL_CLAMP 0x2900 +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 + +/* Utility */ +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 + +/* Errors */ +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 + +/* glPush/PopAttrib bits */ +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000FFFFF + + +/* OpenGL 1.1 */ +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_ALL_CLIENT_ATTRIB_BITS 0xFFFFFFFF +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF + + + +/* + * Miscellaneous + */ + +GLAPI void GLAPIENTRY glClearIndex( GLfloat c ); + +GLAPI void GLAPIENTRY glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ); + +GLAPI void GLAPIENTRY glClear( GLbitfield mask ); + +GLAPI void GLAPIENTRY glIndexMask( GLuint mask ); + +GLAPI void GLAPIENTRY glColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ); + +GLAPI void GLAPIENTRY glAlphaFunc( GLenum func, GLclampf ref ); + +GLAPI void GLAPIENTRY glBlendFunc( GLenum sfactor, GLenum dfactor ); + +GLAPI void GLAPIENTRY glLogicOp( GLenum opcode ); + +GLAPI void GLAPIENTRY glCullFace( GLenum mode ); + +GLAPI void GLAPIENTRY glFrontFace( GLenum mode ); + +GLAPI void GLAPIENTRY glPointSize( GLfloat size ); + +GLAPI void GLAPIENTRY glLineWidth( GLfloat width ); + +GLAPI void GLAPIENTRY glLineStipple( GLint factor, GLushort pattern ); + +GLAPI void GLAPIENTRY glPolygonMode( GLenum face, GLenum mode ); + +GLAPI void GLAPIENTRY glPolygonOffset( GLfloat factor, GLfloat units ); + +GLAPI void GLAPIENTRY glPolygonStipple( const GLubyte *mask ); + +GLAPI void GLAPIENTRY glGetPolygonStipple( GLubyte *mask ); + +GLAPI void GLAPIENTRY glEdgeFlag( GLboolean flag ); + +GLAPI void GLAPIENTRY glEdgeFlagv( const GLboolean *flag ); + +GLAPI void GLAPIENTRY glScissor( GLint x, GLint y, GLsizei width, GLsizei height); + +GLAPI void GLAPIENTRY glClipPlane( GLenum plane, const GLdouble *equation ); + +GLAPI void GLAPIENTRY glGetClipPlane( GLenum plane, GLdouble *equation ); + +GLAPI void GLAPIENTRY glDrawBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY glReadBuffer( GLenum mode ); + +GLAPI void GLAPIENTRY glEnable( GLenum cap ); + +GLAPI void GLAPIENTRY glDisable( GLenum cap ); + +GLAPI GLboolean GLAPIENTRY glIsEnabled( GLenum cap ); + + +GLAPI void GLAPIENTRY glEnableClientState( GLenum cap ); /* 1.1 */ + +GLAPI void GLAPIENTRY glDisableClientState( GLenum cap ); /* 1.1 */ + + +GLAPI void GLAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); + +GLAPI void GLAPIENTRY glGetDoublev( GLenum pname, GLdouble *params ); + +GLAPI void GLAPIENTRY glGetFloatv( GLenum pname, GLfloat *params ); + +GLAPI void GLAPIENTRY glGetIntegerv( GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glPushAttrib( GLbitfield mask ); + +GLAPI void GLAPIENTRY glPopAttrib( void ); + + +GLAPI void GLAPIENTRY glPushClientAttrib( GLbitfield mask ); /* 1.1 */ + +GLAPI void GLAPIENTRY glPopClientAttrib( void ); /* 1.1 */ + + +GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode ); + +GLAPI GLenum GLAPIENTRY glGetError( void ); + +GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name ); + +GLAPI void GLAPIENTRY glFinish( void ); + +GLAPI void GLAPIENTRY glFlush( void ); + +GLAPI void GLAPIENTRY glHint( GLenum target, GLenum mode ); + + +/* + * Depth Buffer + */ + +GLAPI void GLAPIENTRY glClearDepth( GLclampd depth ); + +GLAPI void GLAPIENTRY glDepthFunc( GLenum func ); + +GLAPI void GLAPIENTRY glDepthMask( GLboolean flag ); + +GLAPI void GLAPIENTRY glDepthRange( GLclampd near_val, GLclampd far_val ); + + +/* + * Accumulation Buffer + */ + +GLAPI void GLAPIENTRY glClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); + +GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value ); + + +/* + * Transformation + */ + +GLAPI void GLAPIENTRY glMatrixMode( GLenum mode ); + +GLAPI void GLAPIENTRY glOrtho( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY glFrustum( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble near_val, GLdouble far_val ); + +GLAPI void GLAPIENTRY glViewport( GLint x, GLint y, + GLsizei width, GLsizei height ); + +GLAPI void GLAPIENTRY glPushMatrix( void ); + +GLAPI void GLAPIENTRY glPopMatrix( void ); + +GLAPI void GLAPIENTRY glLoadIdentity( void ); + +GLAPI void GLAPIENTRY glLoadMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY glLoadMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY glMultMatrixd( const GLdouble *m ); +GLAPI void GLAPIENTRY glMultMatrixf( const GLfloat *m ); + +GLAPI void GLAPIENTRY glRotated( GLdouble angle, + GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glRotatef( GLfloat angle, + GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY glScaled( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glScalef( GLfloat x, GLfloat y, GLfloat z ); + +GLAPI void GLAPIENTRY glTranslated( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glTranslatef( GLfloat x, GLfloat y, GLfloat z ); + + +/* + * Display Lists + */ + +GLAPI GLboolean GLAPIENTRY glIsList( GLuint list ); + +GLAPI void GLAPIENTRY glDeleteLists( GLuint list, GLsizei range ); + +GLAPI GLuint GLAPIENTRY glGenLists( GLsizei range ); + +GLAPI void GLAPIENTRY glNewList( GLuint list, GLenum mode ); + +GLAPI void GLAPIENTRY glEndList( void ); + +GLAPI void GLAPIENTRY glCallList( GLuint list ); + +GLAPI void GLAPIENTRY glCallLists( GLsizei n, GLenum type, + const GLvoid *lists ); + +GLAPI void GLAPIENTRY glListBase( GLuint base ); + + +/* + * Drawing Functions + */ + +GLAPI void GLAPIENTRY glBegin( GLenum mode ); + +GLAPI void GLAPIENTRY glEnd( void ); + + +GLAPI void GLAPIENTRY glVertex2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glVertex2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glVertex2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY glVertex2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY glVertex3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glVertex3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glVertex3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glVertex3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY glVertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY glVertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glVertex4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glVertex4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY glVertex2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex2iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glVertex3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex3iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glVertex4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glVertex4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glVertex4iv( const GLint *v ); +GLAPI void GLAPIENTRY glVertex4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz ); +GLAPI void GLAPIENTRY glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz ); +GLAPI void GLAPIENTRY glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz ); +GLAPI void GLAPIENTRY glNormal3i( GLint nx, GLint ny, GLint nz ); +GLAPI void GLAPIENTRY glNormal3s( GLshort nx, GLshort ny, GLshort nz ); + +GLAPI void GLAPIENTRY glNormal3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glNormal3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glNormal3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glNormal3iv( const GLint *v ); +GLAPI void GLAPIENTRY glNormal3sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glIndexd( GLdouble c ); +GLAPI void GLAPIENTRY glIndexf( GLfloat c ); +GLAPI void GLAPIENTRY glIndexi( GLint c ); +GLAPI void GLAPIENTRY glIndexs( GLshort c ); +GLAPI void GLAPIENTRY glIndexub( GLubyte c ); /* 1.1 */ + +GLAPI void GLAPIENTRY glIndexdv( const GLdouble *c ); +GLAPI void GLAPIENTRY glIndexfv( const GLfloat *c ); +GLAPI void GLAPIENTRY glIndexiv( const GLint *c ); +GLAPI void GLAPIENTRY glIndexsv( const GLshort *c ); +GLAPI void GLAPIENTRY glIndexubv( const GLubyte *c ); /* 1.1 */ + +GLAPI void GLAPIENTRY glColor3b( GLbyte red, GLbyte green, GLbyte blue ); +GLAPI void GLAPIENTRY glColor3d( GLdouble red, GLdouble green, GLdouble blue ); +GLAPI void GLAPIENTRY glColor3f( GLfloat red, GLfloat green, GLfloat blue ); +GLAPI void GLAPIENTRY glColor3i( GLint red, GLint green, GLint blue ); +GLAPI void GLAPIENTRY glColor3s( GLshort red, GLshort green, GLshort blue ); +GLAPI void GLAPIENTRY glColor3ub( GLubyte red, GLubyte green, GLubyte blue ); +GLAPI void GLAPIENTRY glColor3ui( GLuint red, GLuint green, GLuint blue ); +GLAPI void GLAPIENTRY glColor3us( GLushort red, GLushort green, GLushort blue ); + +GLAPI void GLAPIENTRY glColor4b( GLbyte red, GLbyte green, + GLbyte blue, GLbyte alpha ); +GLAPI void GLAPIENTRY glColor4d( GLdouble red, GLdouble green, + GLdouble blue, GLdouble alpha ); +GLAPI void GLAPIENTRY glColor4f( GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ); +GLAPI void GLAPIENTRY glColor4i( GLint red, GLint green, + GLint blue, GLint alpha ); +GLAPI void GLAPIENTRY glColor4s( GLshort red, GLshort green, + GLshort blue, GLshort alpha ); +GLAPI void GLAPIENTRY glColor4ub( GLubyte red, GLubyte green, + GLubyte blue, GLubyte alpha ); +GLAPI void GLAPIENTRY glColor4ui( GLuint red, GLuint green, + GLuint blue, GLuint alpha ); +GLAPI void GLAPIENTRY glColor4us( GLushort red, GLushort green, + GLushort blue, GLushort alpha ); + + +GLAPI void GLAPIENTRY glColor3bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glColor3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glColor3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glColor3iv( const GLint *v ); +GLAPI void GLAPIENTRY glColor3sv( const GLshort *v ); +GLAPI void GLAPIENTRY glColor3ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY glColor3uiv( const GLuint *v ); +GLAPI void GLAPIENTRY glColor3usv( const GLushort *v ); + +GLAPI void GLAPIENTRY glColor4bv( const GLbyte *v ); +GLAPI void GLAPIENTRY glColor4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glColor4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glColor4iv( const GLint *v ); +GLAPI void GLAPIENTRY glColor4sv( const GLshort *v ); +GLAPI void GLAPIENTRY glColor4ubv( const GLubyte *v ); +GLAPI void GLAPIENTRY glColor4uiv( const GLuint *v ); +GLAPI void GLAPIENTRY glColor4usv( const GLushort *v ); + + +GLAPI void GLAPIENTRY glTexCoord1d( GLdouble s ); +GLAPI void GLAPIENTRY glTexCoord1f( GLfloat s ); +GLAPI void GLAPIENTRY glTexCoord1i( GLint s ); +GLAPI void GLAPIENTRY glTexCoord1s( GLshort s ); + +GLAPI void GLAPIENTRY glTexCoord2d( GLdouble s, GLdouble t ); +GLAPI void GLAPIENTRY glTexCoord2f( GLfloat s, GLfloat t ); +GLAPI void GLAPIENTRY glTexCoord2i( GLint s, GLint t ); +GLAPI void GLAPIENTRY glTexCoord2s( GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY glTexCoord3d( GLdouble s, GLdouble t, GLdouble r ); +GLAPI void GLAPIENTRY glTexCoord3f( GLfloat s, GLfloat t, GLfloat r ); +GLAPI void GLAPIENTRY glTexCoord3i( GLint s, GLint t, GLint r ); +GLAPI void GLAPIENTRY glTexCoord3s( GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY glTexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ); +GLAPI void GLAPIENTRY glTexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ); +GLAPI void GLAPIENTRY glTexCoord4i( GLint s, GLint t, GLint r, GLint q ); +GLAPI void GLAPIENTRY glTexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY glTexCoord1dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord1fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord1iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord1sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord2iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord3iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glTexCoord4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glTexCoord4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glTexCoord4iv( const GLint *v ); +GLAPI void GLAPIENTRY glTexCoord4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glRasterPos2d( GLdouble x, GLdouble y ); +GLAPI void GLAPIENTRY glRasterPos2f( GLfloat x, GLfloat y ); +GLAPI void GLAPIENTRY glRasterPos2i( GLint x, GLint y ); +GLAPI void GLAPIENTRY glRasterPos2s( GLshort x, GLshort y ); + +GLAPI void GLAPIENTRY glRasterPos3d( GLdouble x, GLdouble y, GLdouble z ); +GLAPI void GLAPIENTRY glRasterPos3f( GLfloat x, GLfloat y, GLfloat z ); +GLAPI void GLAPIENTRY glRasterPos3i( GLint x, GLint y, GLint z ); +GLAPI void GLAPIENTRY glRasterPos3s( GLshort x, GLshort y, GLshort z ); + +GLAPI void GLAPIENTRY glRasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ); +GLAPI void GLAPIENTRY glRasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); +GLAPI void GLAPIENTRY glRasterPos4i( GLint x, GLint y, GLint z, GLint w ); +GLAPI void GLAPIENTRY glRasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ); + +GLAPI void GLAPIENTRY glRasterPos2dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos2fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos2iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos2sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glRasterPos3dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos3fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos3iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos3sv( const GLshort *v ); + +GLAPI void GLAPIENTRY glRasterPos4dv( const GLdouble *v ); +GLAPI void GLAPIENTRY glRasterPos4fv( const GLfloat *v ); +GLAPI void GLAPIENTRY glRasterPos4iv( const GLint *v ); +GLAPI void GLAPIENTRY glRasterPos4sv( const GLshort *v ); + + +GLAPI void GLAPIENTRY glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ); +GLAPI void GLAPIENTRY glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); +GLAPI void GLAPIENTRY glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ); +GLAPI void GLAPIENTRY glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ); + + +GLAPI void GLAPIENTRY glRectdv( const GLdouble *v1, const GLdouble *v2 ); +GLAPI void GLAPIENTRY glRectfv( const GLfloat *v1, const GLfloat *v2 ); +GLAPI void GLAPIENTRY glRectiv( const GLint *v1, const GLint *v2 ); +GLAPI void GLAPIENTRY glRectsv( const GLshort *v1, const GLshort *v2 ); + + +/* + * Vertex Arrays (1.1) + */ + +GLAPI void GLAPIENTRY glVertexPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glNormalPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glColorPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glIndexPointer( GLenum type, GLsizei stride, + const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glTexCoordPointer( GLint size, GLenum type, + GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glEdgeFlagPointer( GLsizei stride, const GLvoid *ptr ); + +GLAPI void GLAPIENTRY glGetPointerv( GLenum pname, GLvoid **params ); + +GLAPI void GLAPIENTRY glArrayElement( GLint i ); + +GLAPI void GLAPIENTRY glDrawArrays( GLenum mode, GLint first, GLsizei count ); + +GLAPI void GLAPIENTRY glDrawElements( GLenum mode, GLsizei count, + GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glInterleavedArrays( GLenum format, GLsizei stride, + const GLvoid *pointer ); + +/* + * Lighting + */ + +GLAPI void GLAPIENTRY glShadeModel( GLenum mode ); + +GLAPI void GLAPIENTRY glLightf( GLenum light, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glLighti( GLenum light, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glLightfv( GLenum light, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY glLightiv( GLenum light, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glGetLightfv( GLenum light, GLenum pname, + GLfloat *params ); +GLAPI void GLAPIENTRY glGetLightiv( GLenum light, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glLightModelf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glLightModeli( GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glLightModelfv( GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glLightModeliv( GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glMaterialf( GLenum face, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glMateriali( GLenum face, GLenum pname, GLint param ); +GLAPI void GLAPIENTRY glMaterialfv( GLenum face, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glMaterialiv( GLenum face, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetMaterialiv( GLenum face, GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY glColorMaterial( GLenum face, GLenum mode ); + + +/* + * Raster functions + */ + +GLAPI void GLAPIENTRY glPixelZoom( GLfloat xfactor, GLfloat yfactor ); + +GLAPI void GLAPIENTRY glPixelStoref( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPixelStorei( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glPixelTransferf( GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glPixelTransferi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glPixelMapfv( GLenum map, GLsizei mapsize, + const GLfloat *values ); +GLAPI void GLAPIENTRY glPixelMapuiv( GLenum map, GLsizei mapsize, + const GLuint *values ); +GLAPI void GLAPIENTRY glPixelMapusv( GLenum map, GLsizei mapsize, + const GLushort *values ); + +GLAPI void GLAPIENTRY glGetPixelMapfv( GLenum map, GLfloat *values ); +GLAPI void GLAPIENTRY glGetPixelMapuiv( GLenum map, GLuint *values ); +GLAPI void GLAPIENTRY glGetPixelMapusv( GLenum map, GLushort *values ); + +GLAPI void GLAPIENTRY glBitmap( GLsizei width, GLsizei height, + GLfloat xorig, GLfloat yorig, + GLfloat xmove, GLfloat ymove, + const GLubyte *bitmap ); + +GLAPI void GLAPIENTRY glReadPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + GLvoid *pixels ); + +GLAPI void GLAPIENTRY glDrawPixels( GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glCopyPixels( GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum type ); + +/* + * Stenciling + */ + +GLAPI void GLAPIENTRY glStencilFunc( GLenum func, GLint ref, GLuint mask ); + +GLAPI void GLAPIENTRY glStencilMask( GLuint mask ); + +GLAPI void GLAPIENTRY glStencilOp( GLenum fail, GLenum zfail, GLenum zpass ); + +GLAPI void GLAPIENTRY glClearStencil( GLint s ); + + + +/* + * Texture mapping + */ + +GLAPI void GLAPIENTRY glTexGend( GLenum coord, GLenum pname, GLdouble param ); +GLAPI void GLAPIENTRY glTexGenf( GLenum coord, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexGeni( GLenum coord, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +GLAPI void GLAPIENTRY glTexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glTexGeniv( GLenum coord, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +GLAPI void GLAPIENTRY glGetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexGeniv( GLenum coord, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexEnvf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexEnvi( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexEnvfv( GLenum target, GLenum pname, const GLfloat *params ); +GLAPI void GLAPIENTRY glTexEnviv( GLenum target, GLenum pname, const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexEnviv( GLenum target, GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexParameterf( GLenum target, GLenum pname, GLfloat param ); +GLAPI void GLAPIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glTexParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); +GLAPI void GLAPIENTRY glTexParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glGetTexParameterfv( GLenum target, + GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv( GLenum target, + GLenum pname, GLint *params ); + +GLAPI void GLAPIENTRY glGetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv( GLenum target, GLint level, + GLenum pname, GLint *params ); + + +GLAPI void GLAPIENTRY glTexImage1D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexImage2D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLint border, GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glGetTexImage( GLenum target, GLint level, + GLenum format, GLenum type, + GLvoid *pixels ); + + +/* 1.1 functions */ + +GLAPI void GLAPIENTRY glGenTextures( GLsizei n, GLuint *textures ); + +GLAPI void GLAPIENTRY glDeleteTextures( GLsizei n, const GLuint *textures); + +GLAPI void GLAPIENTRY glBindTexture( GLenum target, GLuint texture ); + +GLAPI void GLAPIENTRY glPrioritizeTextures( GLsizei n, + const GLuint *textures, + const GLclampf *priorities ); + +GLAPI GLboolean GLAPIENTRY glAreTexturesResident( GLsizei n, + const GLuint *textures, + GLboolean *residences ); + +GLAPI GLboolean GLAPIENTRY glIsTexture( GLuint texture ); + + +GLAPI void GLAPIENTRY glTexSubImage1D( GLenum target, GLint level, + GLint xoffset, + GLsizei width, GLenum format, + GLenum type, const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY glTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ); + + +GLAPI void GLAPIENTRY glCopyTexImage1D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLint border ); + + +GLAPI void GLAPIENTRY glCopyTexImage2D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLsizei height, + GLint border ); + + +GLAPI void GLAPIENTRY glCopyTexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, + GLsizei width ); + + +GLAPI void GLAPIENTRY glCopyTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height ); + + +/* + * Evaluators + */ + +GLAPI void GLAPIENTRY glMap1d( GLenum target, GLdouble u1, GLdouble u2, + GLint stride, + GLint order, const GLdouble *points ); +GLAPI void GLAPIENTRY glMap1f( GLenum target, GLfloat u1, GLfloat u2, + GLint stride, + GLint order, const GLfloat *points ); + +GLAPI void GLAPIENTRY glMap2d( GLenum target, + GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, + GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, + const GLdouble *points ); +GLAPI void GLAPIENTRY glMap2f( GLenum target, + GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, + GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, + const GLfloat *points ); + +GLAPI void GLAPIENTRY glGetMapdv( GLenum target, GLenum query, GLdouble *v ); +GLAPI void GLAPIENTRY glGetMapfv( GLenum target, GLenum query, GLfloat *v ); +GLAPI void GLAPIENTRY glGetMapiv( GLenum target, GLenum query, GLint *v ); + +GLAPI void GLAPIENTRY glEvalCoord1d( GLdouble u ); +GLAPI void GLAPIENTRY glEvalCoord1f( GLfloat u ); + +GLAPI void GLAPIENTRY glEvalCoord1dv( const GLdouble *u ); +GLAPI void GLAPIENTRY glEvalCoord1fv( const GLfloat *u ); + +GLAPI void GLAPIENTRY glEvalCoord2d( GLdouble u, GLdouble v ); +GLAPI void GLAPIENTRY glEvalCoord2f( GLfloat u, GLfloat v ); + +GLAPI void GLAPIENTRY glEvalCoord2dv( const GLdouble *u ); +GLAPI void GLAPIENTRY glEvalCoord2fv( const GLfloat *u ); + +GLAPI void GLAPIENTRY glMapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); +GLAPI void GLAPIENTRY glMapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); + +GLAPI void GLAPIENTRY glMapGrid2d( GLint un, GLdouble u1, GLdouble u2, + GLint vn, GLdouble v1, GLdouble v2 ); +GLAPI void GLAPIENTRY glMapGrid2f( GLint un, GLfloat u1, GLfloat u2, + GLint vn, GLfloat v1, GLfloat v2 ); + +GLAPI void GLAPIENTRY glEvalPoint1( GLint i ); + +GLAPI void GLAPIENTRY glEvalPoint2( GLint i, GLint j ); + +GLAPI void GLAPIENTRY glEvalMesh1( GLenum mode, GLint i1, GLint i2 ); + +GLAPI void GLAPIENTRY glEvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); + + +/* + * Fog + */ + +GLAPI void GLAPIENTRY glFogf( GLenum pname, GLfloat param ); + +GLAPI void GLAPIENTRY glFogi( GLenum pname, GLint param ); + +GLAPI void GLAPIENTRY glFogfv( GLenum pname, const GLfloat *params ); + +GLAPI void GLAPIENTRY glFogiv( GLenum pname, const GLint *params ); + + +/* + * Selection and Feedback + */ + +GLAPI void GLAPIENTRY glFeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); + +GLAPI void GLAPIENTRY glPassThrough( GLfloat token ); + +GLAPI void GLAPIENTRY glSelectBuffer( GLsizei size, GLuint *buffer ); + +GLAPI void GLAPIENTRY glInitNames( void ); + +GLAPI void GLAPIENTRY glLoadName( GLuint name ); + +GLAPI void GLAPIENTRY glPushName( GLuint name ); + +GLAPI void GLAPIENTRY glPopName( void ); + + + +/* + * OpenGL 1.2 + */ + +#define GL_RESCALE_NORMAL 0x803A +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_TEXTURE_BINDING_3D 0x806A + +GLAPI void GLAPIENTRY glDrawRangeElements( GLenum mode, GLuint start, + GLuint end, GLsizei count, GLenum type, const GLvoid *indices ); + +GLAPI void GLAPIENTRY glTexImage3D( GLenum target, GLint level, + GLint internalFormat, + GLsizei width, GLsizei height, + GLsizei depth, GLint border, + GLenum format, GLenum type, + const GLvoid *pixels ); + +GLAPI void GLAPIENTRY glTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLsizei width, + GLsizei height, GLsizei depth, + GLenum format, + GLenum type, const GLvoid *pixels); + +GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint zoffset, GLint x, + GLint y, GLsizei width, + GLsizei height ); + +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + + +/* + * GL_ARB_imaging + */ + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_BLEND_EQUATION 0x8009 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_BLEND_COLOR 0x8005 + + +GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, + GLenum type, const GLvoid *table ); + +GLAPI void GLAPIENTRY glColorSubTable( GLenum target, + GLsizei start, GLsizei count, + GLenum format, GLenum type, + const GLvoid *data ); + +GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname, + const GLint *params); + +GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname, + const GLfloat *params); + +GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format, + GLenum type, GLvoid *table ); + +GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glBlendEquation( GLenum mode ); + +GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green, + GLclampf blue, GLclampf alpha ); + +GLAPI void GLAPIENTRY glHistogram( GLenum target, GLsizei width, + GLenum internalformat, GLboolean sink ); + +GLAPI void GLAPIENTRY glResetHistogram( GLenum target ); + +GLAPI void GLAPIENTRY glGetHistogram( GLenum target, GLboolean reset, + GLenum format, GLenum type, + GLvoid *values ); + +GLAPI void GLAPIENTRY glGetHistogramParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetHistogramParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat, + GLboolean sink ); + +GLAPI void GLAPIENTRY glResetMinmax( GLenum target ); + +GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset, + GLenum format, GLenum types, + GLvoid *values ); + +GLAPI void GLAPIENTRY glGetMinmaxParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetMinmaxParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glConvolutionFilter1D( GLenum target, + GLenum internalformat, GLsizei width, GLenum format, GLenum type, + const GLvoid *image ); + +GLAPI void GLAPIENTRY glConvolutionFilter2D( GLenum target, + GLenum internalformat, GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid *image ); + +GLAPI void GLAPIENTRY glConvolutionParameterf( GLenum target, GLenum pname, + GLfloat params ); + +GLAPI void GLAPIENTRY glConvolutionParameterfv( GLenum target, GLenum pname, + const GLfloat *params ); + +GLAPI void GLAPIENTRY glConvolutionParameteri( GLenum target, GLenum pname, + GLint params ); + +GLAPI void GLAPIENTRY glConvolutionParameteriv( GLenum target, GLenum pname, + const GLint *params ); + +GLAPI void GLAPIENTRY glCopyConvolutionFilter1D( GLenum target, + GLenum internalformat, GLint x, GLint y, GLsizei width ); + +GLAPI void GLAPIENTRY glCopyConvolutionFilter2D( GLenum target, + GLenum internalformat, GLint x, GLint y, GLsizei width, + GLsizei height); + +GLAPI void GLAPIENTRY glGetConvolutionFilter( GLenum target, GLenum format, + GLenum type, GLvoid *image ); + +GLAPI void GLAPIENTRY glGetConvolutionParameterfv( GLenum target, GLenum pname, + GLfloat *params ); + +GLAPI void GLAPIENTRY glGetConvolutionParameteriv( GLenum target, GLenum pname, + GLint *params ); + +GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target, + GLenum internalformat, GLsizei width, GLsizei height, GLenum format, + GLenum type, const GLvoid *row, const GLvoid *column ); + +GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format, + GLenum type, GLvoid *row, GLvoid *column, GLvoid *span ); + + + + +/* + * OpenGL 1.3 + */ + +/* multitexture */ +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +/* texture_cube_map */ +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +/* texture_compression */ +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +/* multisample */ +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_MULTISAMPLE_BIT 0x20000000 +/* transpose_matrix */ +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +/* texture_env_combine */ +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +/* texture_env_dot3 */ +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +/* texture_border_clamp */ +#define GL_CLAMP_TO_BORDER 0x812D + +GLAPI void GLAPIENTRY glActiveTexture( GLenum texture ); + +GLAPI void GLAPIENTRY glClientActiveTexture( GLenum texture ); + +GLAPI void GLAPIENTRY glCompressedTexImage1D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ); + +GLAPI void GLAPIENTRY glGetCompressedTexImage( GLenum target, GLint lod, GLvoid *img ); + +GLAPI void GLAPIENTRY glMultiTexCoord1d( GLenum target, GLdouble s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1f( GLenum target, GLfloat s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1i( GLenum target, GLint s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord1s( GLenum target, GLshort s ); + +GLAPI void GLAPIENTRY glMultiTexCoord1sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2d( GLenum target, GLdouble s, GLdouble t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2f( GLenum target, GLfloat s, GLfloat t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2i( GLenum target, GLint s, GLint t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord2s( GLenum target, GLshort s, GLshort t ); + +GLAPI void GLAPIENTRY glMultiTexCoord2sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3d( GLenum target, GLdouble s, GLdouble t, GLdouble r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3f( GLenum target, GLfloat s, GLfloat t, GLfloat r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3i( GLenum target, GLint s, GLint t, GLint r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord3s( GLenum target, GLshort s, GLshort t, GLshort r ); + +GLAPI void GLAPIENTRY glMultiTexCoord3sv( GLenum target, const GLshort *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4d( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4dv( GLenum target, const GLdouble *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4f( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4fv( GLenum target, const GLfloat *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4i( GLenum target, GLint s, GLint t, GLint r, GLint q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4iv( GLenum target, const GLint *v ); + +GLAPI void GLAPIENTRY glMultiTexCoord4s( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ); + +GLAPI void GLAPIENTRY glMultiTexCoord4sv( GLenum target, const GLshort *v ); + + +GLAPI void GLAPIENTRY glLoadTransposeMatrixd( const GLdouble m[16] ); + +GLAPI void GLAPIENTRY glLoadTransposeMatrixf( const GLfloat m[16] ); + +GLAPI void GLAPIENTRY glMultTransposeMatrixd( const GLdouble m[16] ); + +GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] ); + +GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert ); + + +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); + + + +/* + * GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1) + */ +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture); +GLAPI void GLAPIENTRY glMultiTexCoord1dARB(GLenum target, GLdouble s); +GLAPI void GLAPIENTRY glMultiTexCoord1dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s); +GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord1iARB(GLenum target, GLint s); +GLAPI void GLAPIENTRY glMultiTexCoord1ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord1sARB(GLenum target, GLshort s); +GLAPI void GLAPIENTRY glMultiTexCoord1svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glMultiTexCoord2dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord2iARB(GLenum target, GLint s, GLint t); +GLAPI void GLAPIENTRY glMultiTexCoord2ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); +GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glMultiTexCoord3dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glMultiTexCoord3ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glMultiTexCoord3svARB(GLenum target, const GLshort *v); +GLAPI void GLAPIENTRY glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glMultiTexCoord4dvARB(GLenum target, const GLdouble *v); +GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v); +GLAPI void GLAPIENTRY glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glMultiTexCoord4ivARB(GLenum target, const GLint *v); +GLAPI void GLAPIENTRY glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v); + +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#endif /* GL_ARB_multitexture */ + + + +/* + * Define this token if you want "old-style" header file behaviour (extensions + * defined in gl.h). Otherwise, extensions will be included from glext.h. + */ +#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) +#include +#endif /* GL_GLEXT_LEGACY */ + + + +/********************************************************************** + * Begin system-specific stuff + */ +#if defined(PRAGMA_EXPORT_SUPPORTED) +#pragma export off +#endif + +/* + * End system-specific stuff + **********************************************************************/ + + +#ifdef __cplusplus +} +#endif + +#endif /* __gl_h_ */ + +#endif /* !__IPHONEOS__ */ + +#endif /* SDL_opengl_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengl_glext.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengl_glext.h new file mode 100644 index 00000000..ff6ad12c --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengl_glext.h @@ -0,0 +1,13213 @@ +/* SDL modified the include guard to be compatible with Mesa and Apple include guards: + * - Mesa uses: __gl_glext_h_ + * - Apple uses: __glext_h_ */ +#if !defined(__glext_h_) && !defined(__gl_glext_h_) +#define __glext_h_ 1 +#define __gl_glext_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT +** +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** https://github.com/KhronosGroup/OpenGL-Registry +*/ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +#define GL_GLEXT_VERSION 20220530 + +/*#include */ +#ifndef __khrplatform_h_ +#define __khrplatform_h_ + +/* +** Copyright (c) 2008-2018 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Khronos platform-specific types and definitions. + * + * The master copy of khrplatform.h is maintained in the Khronos EGL + * Registry repository at https://github.com/KhronosGroup/EGL-Registry + * The last semantic modification to khrplatform.h was at commit ID: + * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 + * + * Adopters may modify this file to suit their platform. Adopters are + * encouraged to submit platform specific modifications to the Khronos + * group so that they can be included in future versions of this file. + * Please submit changes by filing pull requests or issues on + * the EGL Registry repository linked above. + * + * + * See the Implementer's Guidelines for information about where this file + * should be located on your system and for more details of its use: + * http://www.khronos.org/registry/implementers_guide.pdf + * + * This file should be included as + * #include + * by Khronos client API header files that use its types and defines. + * + * The types in khrplatform.h should only be used to define API-specific types. + * + * Types defined in khrplatform.h: + * khronos_int8_t signed 8 bit + * khronos_uint8_t unsigned 8 bit + * khronos_int16_t signed 16 bit + * khronos_uint16_t unsigned 16 bit + * khronos_int32_t signed 32 bit + * khronos_uint32_t unsigned 32 bit + * khronos_int64_t signed 64 bit + * khronos_uint64_t unsigned 64 bit + * khronos_intptr_t signed same number of bits as a pointer + * khronos_uintptr_t unsigned same number of bits as a pointer + * khronos_ssize_t signed size + * khronos_usize_t unsigned size + * khronos_float_t signed 32 bit floating point + * khronos_time_ns_t unsigned 64 bit time in nanoseconds + * khronos_utime_nanoseconds_t unsigned time interval or absolute time in + * nanoseconds + * khronos_stime_nanoseconds_t signed time interval in nanoseconds + * khronos_boolean_enum_t enumerated boolean type. This should + * only be used as a base type when a client API's boolean type is + * an enum. Client APIs which use an integer or other type for + * booleans cannot use this as the base type for their boolean. + * + * Tokens defined in khrplatform.h: + * + * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. + * + * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. + * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. + * + * Calling convention macros defined in this file: + * KHRONOS_APICALL + * KHRONOS_APIENTRY + * KHRONOS_APIATTRIBUTES + * + * These may be used in function prototypes as: + * + * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( + * int arg1, + * int arg2) KHRONOS_APIATTRIBUTES; + */ + +#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) +# define KHRONOS_STATIC 1 +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APICALL + *------------------------------------------------------------------------- + * This precedes the return type of the function in the function prototype. + */ +#if defined(KHRONOS_STATIC) + /* If the preprocessor constant KHRONOS_STATIC is defined, make the + * header compatible with static linking. */ +# define KHRONOS_APICALL +#elif defined(_WIN32) +# define KHRONOS_APICALL __declspec(dllimport) +#elif defined (__SYMBIAN32__) +# define KHRONOS_APICALL IMPORT_C +#elif defined(__ANDROID__) +# define KHRONOS_APICALL __attribute__((visibility("default"))) +#else +# define KHRONOS_APICALL +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIENTRY + *------------------------------------------------------------------------- + * This follows the return type of the function and precedes the function + * name in the function prototype. + */ +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) + /* Win32 but not WinCE */ +# define KHRONOS_APIENTRY __stdcall +#else +# define KHRONOS_APIENTRY +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIATTRIBUTES + *------------------------------------------------------------------------- + * This follows the closing parenthesis of the function prototype arguments. + */ +#if defined (__ARMCC_2__) +#define KHRONOS_APIATTRIBUTES __softfp +#else +#define KHRONOS_APIATTRIBUTES +#endif + +/*------------------------------------------------------------------------- + * basic type definitions + *-----------------------------------------------------------------------*/ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) + + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 +/* + * To support platform where unsigned long cannot be used interchangeably with + * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t. + * Ideally, we could just use (u)intptr_t everywhere, but this could result in + * ABI breakage if khronos_uintptr_t is changed from unsigned long to + * unsigned long long or similar (this results in different C++ name mangling). + * To avoid changes for existing platforms, we restrict usage of intptr_t to + * platforms where the size of a pointer is larger than the size of long. + */ +#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__) +#if __SIZEOF_POINTER__ > __SIZEOF_LONG__ +#define KHRONOS_USE_INTPTR_T +#endif +#endif + +#elif defined(__VMS ) || defined(__sgi) + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) + +/* + * Win32 + */ +typedef __int32 khronos_int32_t; +typedef unsigned __int32 khronos_uint32_t; +typedef __int64 khronos_int64_t; +typedef unsigned __int64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__sun__) || defined(__digital__) + +/* + * Sun or Digital + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#if defined(__arch64__) || defined(_LP64) +typedef long int khronos_int64_t; +typedef unsigned long int khronos_uint64_t; +#else +typedef long long int khronos_int64_t; +typedef unsigned long long int khronos_uint64_t; +#endif /* __arch64__ */ +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif 0 + +/* + * Hypothetical platform with no float or int64 support + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#define KHRONOS_SUPPORT_INT64 0 +#define KHRONOS_SUPPORT_FLOAT 0 + +#else + +/* + * Generic fallback + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#endif + + +/* + * Types that are (so far) the same on all platforms + */ +typedef signed char khronos_int8_t; +typedef unsigned char khronos_uint8_t; +typedef signed short int khronos_int16_t; +typedef unsigned short int khronos_uint16_t; + +/* + * Types that differ between LLP64 and LP64 architectures - in LLP64, + * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears + * to be the only LLP64 architecture in current use. + */ +#ifdef KHRONOS_USE_INTPTR_T +typedef intptr_t khronos_intptr_t; +typedef uintptr_t khronos_uintptr_t; +#elif defined(_WIN64) +typedef signed long long int khronos_intptr_t; +typedef unsigned long long int khronos_uintptr_t; +#else +typedef signed long int khronos_intptr_t; +typedef unsigned long int khronos_uintptr_t; +#endif + +#if defined(_WIN64) +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else +typedef signed long int khronos_ssize_t; +typedef unsigned long int khronos_usize_t; +#endif + +#if KHRONOS_SUPPORT_FLOAT +/* + * Float type + */ +typedef float khronos_float_t; +#endif + +#if KHRONOS_SUPPORT_INT64 +/* Time types + * + * These types can be used to represent a time interval in nanoseconds or + * an absolute Unadjusted System Time. Unadjusted System Time is the number + * of nanoseconds since some arbitrary system event (e.g. since the last + * time the system booted). The Unadjusted System Time is an unsigned + * 64 bit value that wraps back to 0 every 584 years. Time intervals + * may be either signed or unsigned. + */ +typedef khronos_uint64_t khronos_utime_nanoseconds_t; +typedef khronos_int64_t khronos_stime_nanoseconds_t; +#endif + +/* + * Dummy value used to pad enum types to 32 bits. + */ +#ifndef KHRONOS_MAX_ENUM +#define KHRONOS_MAX_ENUM 0x7FFFFFFF +#endif + +/* + * Enumerated boolean type + * + * Values other than zero should be considered to be true. Therefore + * comparisons should not be made against KHRONOS_TRUE. + */ +typedef enum { + KHRONOS_FALSE = 0, + KHRONOS_TRUE = 1, + KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM +} khronos_boolean_enum_t; + +#endif /* __khrplatform_h_ */ + +/* Generated C header for: + * API: gl + * Profile: compatibility + * Versions considered: .* + * Versions emitted: 1\.[2-9]|[234]\.[0-9] + * Default extensions included: gl + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_RESCALE_NORMAL 0x803A +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif +#endif /* GL_VERSION_1_2 */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum texture); +GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, void *img); +GLAPI void APIENTRY glClientActiveTexture (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); +#endif +#endif /* GL_VERSION_1_3 */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#define GL_BLEND_COLOR 0x8005 +#define GL_BLEND_EQUATION 0x8009 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_FUNC_SUBTRACT 0x800A +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); +GLAPI void APIENTRY glFogCoordf (GLfloat coord); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); +GLAPI void APIENTRY glFogCoordd (GLdouble coord); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2iv (const GLint *v); +GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); +GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3iv (const GLint *v); +GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); +GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void APIENTRY glBlendEquation (GLenum mode); +#endif +#endif /* GL_VERSION_1_4 */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +typedef khronos_ssize_t GLsizeiptr; +typedef khronos_intptr_t GLintptr; +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_SRC1_ALPHA 0x8589 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_FOG_COORD_SRC 0x8450 +#define GL_FOG_COORD 0x8451 +#define GL_CURRENT_FOG_COORD 0x8453 +#define GL_FOG_COORD_ARRAY_TYPE 0x8454 +#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORD_ARRAY_POINTER 0x8456 +#define GL_FOG_COORD_ARRAY 0x8457 +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC2_ALPHA 0x858A +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data); +typedef void *(APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQuery (GLuint id); +GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQuery (GLenum target); +GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); +GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); +GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void *data); +GLAPI void *APIENTRY glMapBuffer (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params); +#endif +#endif /* GL_VERSION_1_5 */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +typedef char GLchar; +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_TEXTURE_COORDS 0x8871 +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); +GLAPI void APIENTRY glCompileShader (GLuint shader); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum type); +GLAPI void APIENTRY glDeleteProgram (GLuint program); +GLAPI void APIENTRY glDeleteShader (GLuint shader); +GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); +GLAPI GLboolean APIENTRY glIsProgram (GLuint program); +GLAPI GLboolean APIENTRY glIsShader (GLuint shader); +GLAPI void APIENTRY glLinkProgram (GLuint program); +GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +GLAPI void APIENTRY glUseProgram (GLuint program); +GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glValidateProgram (GLuint program); +GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +#endif +#endif /* GL_VERSION_2_0 */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif +#endif /* GL_VERSION_2_1 */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +typedef khronos_uint16_t GLhalf; +#define GL_COMPARE_REF_TO_TEXTURE 0x884E +#define GL_CLIP_DISTANCE0 0x3000 +#define GL_CLIP_DISTANCE1 0x3001 +#define GL_CLIP_DISTANCE2 0x3002 +#define GL_CLIP_DISTANCE3 0x3003 +#define GL_CLIP_DISTANCE4 0x3004 +#define GL_CLIP_DISTANCE5 0x3005 +#define GL_CLIP_DISTANCE6 0x3006 +#define GL_CLIP_DISTANCE7 0x3007 +#define GL_MAX_CLIP_DISTANCES 0x0D32 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS 0x8B4B +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_COLOR_ATTACHMENT16 0x8CF0 +#define GL_COLOR_ATTACHMENT17 0x8CF1 +#define GL_COLOR_ATTACHMENT18 0x8CF2 +#define GL_COLOR_ATTACHMENT19 0x8CF3 +#define GL_COLOR_ATTACHMENT20 0x8CF4 +#define GL_COLOR_ATTACHMENT21 0x8CF5 +#define GL_COLOR_ATTACHMENT22 0x8CF6 +#define GL_COLOR_ATTACHMENT23 0x8CF7 +#define GL_COLOR_ATTACHMENT24 0x8CF8 +#define GL_COLOR_ATTACHMENT25 0x8CF9 +#define GL_COLOR_ATTACHMENT26 0x8CFA +#define GL_COLOR_ATTACHMENT27 0x8CFB +#define GL_COLOR_ATTACHMENT28 0x8CFC +#define GL_COLOR_ATTACHMENT29 0x8CFD +#define GL_COLOR_ATTACHMENT30 0x8CFE +#define GL_COLOR_ATTACHMENT31 0x8CFF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#define GL_INDEX 0x8222 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#define GL_HALF_FLOAT 0x140B +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_ALPHA_INTEGER 0x8D97 +typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef const GLubyte *(APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void *(APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); +GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); +GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedback (void); +GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); +GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRender (void); +GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); +GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); +GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); +GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); +GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI const GLubyte *APIENTRY glGetStringi (GLenum name, GLuint index); +GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmap (GLenum target); +GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void *APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glBindVertexArray (GLuint array); +GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); +#endif +#endif /* GL_VERSION_3_0 */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFFu +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); +typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); +typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); +GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); +GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); +GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); +GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#endif +#endif /* GL_VERSION_3_1 */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 +typedef struct __GLsync *GLsync; +typedef khronos_uint64_t GLuint64; +typedef khronos_int64_t GLint64; +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 +#define GL_DEPTH_CLAMP 0x864F +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 +typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); +typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); +typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); +typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); +typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +GLAPI void APIENTRY glProvokingVertex (GLenum mode); +GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); +GLAPI GLboolean APIENTRY glIsSync (GLsync sync); +GLAPI void APIENTRY glDeleteSync (GLsync sync); +GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); +GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); +GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); +GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask); +#endif +#endif /* GL_VERSION_3_2 */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC +#define GL_ANY_SAMPLES_PASSED 0x8C2F +#define GL_SAMPLER_BINDING 0x8919 +#define GL_RGB10_A2UI 0x906F +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 +#define GL_INT_2_10_10_10_REV 0x8D9F +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); +typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); +typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); +GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); +GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); +GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); +GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); +GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); +GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); +GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); +GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); +GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); +GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); +GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); +#endif +#endif /* GL_VERSION_3_3 */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B +#define GL_PATCHES 0x000E +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLfloat value); +typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); +typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); +typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); +typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShading (GLfloat value); +GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect); +GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect); +GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); +GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); +GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); +GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); +GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); +GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); +GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedback (void); +GLAPI void APIENTRY glResumeTransformFeedback (void); +GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); +GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); +GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); +GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); +GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); +#endif +#endif /* GL_VERSION_4_0 */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_RGB565 0x8D62 +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_ALL_SHADER_BITS 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); +typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); +typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar *const*strings); +typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); +typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f); +typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReleaseShaderCompiler (void); +GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); +GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); +GLAPI void APIENTRY glClearDepthf (GLfloat d); +GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); +GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); +GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar *const*strings); +GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); +GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); +GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); +GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); +GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); +GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); +GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); +GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLdouble n, GLdouble f); +GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); +#endif +#endif /* GL_VERSION_4_1 */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 +#define GL_COPY_READ_BUFFER_BINDING 0x8F36 +#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 +#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E +#define GL_NUM_SAMPLE_COUNTS 0x9380 +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); +typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint *params); +GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); +GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei instancecount); +GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei instancecount); +#endif +#endif /* GL_VERSION_4_2 */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_DEBUG_OUTPUT 0x92E0 +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_MAX_UNIFORM_LOCATIONS 0x826E +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F +#define GL_IS_PER_PATCH 0x92E7 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF +#define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA +#define GL_VERTEX_BINDING_BUFFER 0x8F4F +#define GL_DISPLAY_LIST 0x82E7 +typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params); +typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +typedef void (APIENTRYP PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint *params); +typedef GLuint (APIENTRYP PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params); +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef void (APIENTRYP PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +typedef void (APIENTRYP PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); +typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClearBufferData (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glDispatchCompute (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); +GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei count, GLint64 *params); +GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); +GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glInvalidateBufferData (GLuint buffer); +GLAPI void APIENTRY glInvalidateFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments); +GLAPI void APIENTRY glInvalidateSubFramebuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glMultiDrawArraysIndirect (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +GLAPI void APIENTRY glGetProgramInterfaceiv (GLuint program, GLenum programInterface, GLenum pname, GLint *params); +GLAPI GLuint APIENTRY glGetProgramResourceIndex (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI void APIENTRY glGetProgramResourceName (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetProgramResourceiv (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLint *params); +GLAPI GLint APIENTRY glGetProgramResourceLocation (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI GLint APIENTRY glGetProgramResourceLocationIndex (GLuint program, GLenum programInterface, const GLchar *name); +GLAPI void APIENTRY glShaderStorageBlockBinding (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); +GLAPI void APIENTRY glTexBufferRange (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexStorage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureView (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +GLAPI void APIENTRY glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribLFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexAttribBinding (GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor); +GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); +GLAPI void APIENTRY glPopDebugGroup (void); +GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +GLAPI void APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif +#endif /* GL_VERSION_4_3 */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 +#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 +#define GL_TEXTURE_BUFFER_BINDING 0x8C2A +#define GL_MAP_PERSISTENT_BIT 0x0040 +#define GL_MAP_COHERENT_BIT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 +#define GL_CLEAR_TEXTURE 0x9365 +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 +typedef void (APIENTRYP PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (APIENTRYP PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); +typedef void (APIENTRYP PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (APIENTRYP PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); +typedef void (APIENTRYP PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint *samplers); +typedef void (APIENTRYP PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint *textures); +typedef void (APIENTRYP PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferStorage (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +GLAPI void APIENTRY glClearTexImage (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glBindBuffersBase (GLenum target, GLuint first, GLsizei count, const GLuint *buffers); +GLAPI void APIENTRY glBindBuffersRange (GLenum target, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +GLAPI void APIENTRY glBindTextures (GLuint first, GLsizei count, const GLuint *textures); +GLAPI void APIENTRY glBindSamplers (GLuint first, GLsizei count, const GLuint *samplers); +GLAPI void APIENTRY glBindImageTextures (GLuint first, GLsizei count, const GLuint *textures); +GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); +#endif +#endif /* GL_VERSION_4_4 */ + +#ifndef GL_VERSION_4_5 +#define GL_VERSION_4_5 1 +#define GL_CONTEXT_LOST 0x0507 +#define GL_NEGATIVE_ONE_TO_ONE 0x935E +#define GL_ZERO_TO_ONE 0x935F +#define GL_CLIP_ORIGIN 0x935C +#define GL_CLIP_DEPTH_MODE 0x935D +#define GL_QUERY_WAIT_INVERTED 0x8E17 +#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 +#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 +#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A +#define GL_MAX_CULL_DISTANCES 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA +#define GL_TEXTURE_TARGET 0x1006 +#define GL_QUERY_TARGET 0x82EA +#define GL_GUILTY_CONTEXT_RESET 0x8253 +#define GL_INNOCENT_CONTEXT_RESET 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 +#define GL_LOSE_CONTEXT_ON_RESET 0x8252 +#define GL_NO_RESET_NOTIFICATION 0x8261 +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_MINMAX 0x802E +#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB +#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC +typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); +typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint *param); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64 *param); +typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); +typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void **params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum buf); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum src); +typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments); +typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value); +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value); +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value); +typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint *textures); +typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); +typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param); +typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint *samplers); +typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); +typedef void (APIENTRYP PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUI64VPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (APIENTRYP PFNGLGETQUERYBUFFEROBJECTUIVPROC) (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +typedef void (APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); +typedef void (APIENTRYP PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC) (void); +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, void *pixels); +typedef void (APIENTRYP PFNGLGETNTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +typedef void (APIENTRYP PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +typedef void (APIENTRYP PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +typedef void (APIENTRYP PFNGLGETNMAPDVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +typedef void (APIENTRYP PFNGLGETNMAPFVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETNMAPIVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +typedef void (APIENTRYP PFNGLGETNPIXELMAPFVPROC) (GLenum map, GLsizei bufSize, GLfloat *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVPROC) (GLenum map, GLsizei bufSize, GLuint *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVPROC) (GLenum map, GLsizei bufSize, GLushort *values); +typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEPROC) (GLsizei bufSize, GLubyte *pattern); +typedef void (APIENTRYP PFNGLGETNCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); +typedef void (APIENTRYP PFNGLGETNHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +typedef void (APIENTRYP PFNGLGETNMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClipControl (GLenum origin, GLenum depth); +GLAPI void APIENTRY glCreateTransformFeedbacks (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glTransformFeedbackBufferBase (GLuint xfb, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackBufferRange (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glGetTransformFeedbackiv (GLuint xfb, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetTransformFeedbacki_v (GLuint xfb, GLenum pname, GLuint index, GLint *param); +GLAPI void APIENTRY glGetTransformFeedbacki64_v (GLuint xfb, GLenum pname, GLuint index, GLint64 *param); +GLAPI void APIENTRY glCreateBuffers (GLsizei n, GLuint *buffers); +GLAPI void APIENTRY glNamedBufferStorage (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +GLAPI void APIENTRY glNamedBufferData (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +GLAPI void APIENTRY glNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glCopyNamedBufferSubData (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glClearNamedBufferData (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearNamedBufferSubData (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void *APIENTRY glMapNamedBuffer (GLuint buffer, GLenum access); +GLAPI void *APIENTRY glMapNamedBufferRange (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI GLboolean APIENTRY glUnmapNamedBuffer (GLuint buffer); +GLAPI void APIENTRY glFlushMappedNamedBufferRange (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glGetNamedBufferParameteriv (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedBufferParameteri64v (GLuint buffer, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetNamedBufferPointerv (GLuint buffer, GLenum pname, void **params); +GLAPI void APIENTRY glGetNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +GLAPI void APIENTRY glCreateFramebuffers (GLsizei n, GLuint *framebuffers); +GLAPI void APIENTRY glNamedFramebufferRenderbuffer (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glNamedFramebufferParameteri (GLuint framebuffer, GLenum pname, GLint param); +GLAPI void APIENTRY glNamedFramebufferTexture (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTextureLayer (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glNamedFramebufferDrawBuffer (GLuint framebuffer, GLenum buf); +GLAPI void APIENTRY glNamedFramebufferDrawBuffers (GLuint framebuffer, GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glNamedFramebufferReadBuffer (GLuint framebuffer, GLenum src); +GLAPI void APIENTRY glInvalidateNamedFramebufferData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments); +GLAPI void APIENTRY glInvalidateNamedFramebufferSubData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glClearNamedFramebufferiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value); +GLAPI void APIENTRY glClearNamedFramebufferuiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value); +GLAPI void APIENTRY glClearNamedFramebufferfv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value); +GLAPI void APIENTRY glClearNamedFramebufferfi (GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI void APIENTRY glBlitNamedFramebuffer (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatus (GLuint framebuffer, GLenum target); +GLAPI void APIENTRY glGetNamedFramebufferParameteriv (GLuint framebuffer, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameteriv (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glCreateRenderbuffers (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glNamedRenderbufferStorage (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisample (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetNamedRenderbufferParameteriv (GLuint renderbuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glCreateTextures (GLenum target, GLsizei n, GLuint *textures); +GLAPI void APIENTRY glTextureBuffer (GLuint texture, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glTextureBufferRange (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glTextureStorage1D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTextureStorage2D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTextureStorage3D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glTextureStorage2DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureStorage3DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCompressedTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCopyTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glCopyTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTextureParameterf (GLuint texture, GLenum pname, GLfloat param); +GLAPI void APIENTRY glTextureParameterfv (GLuint texture, GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glTextureParameteri (GLuint texture, GLenum pname, GLint param); +GLAPI void APIENTRY glTextureParameterIiv (GLuint texture, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureParameterIuiv (GLuint texture, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glTextureParameteriv (GLuint texture, GLenum pname, const GLint *param); +GLAPI void APIENTRY glGenerateTextureMipmap (GLuint texture); +GLAPI void APIENTRY glBindTextureUnit (GLuint unit, GLuint texture); +GLAPI void APIENTRY glGetTextureImage (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +GLAPI void APIENTRY glGetCompressedTextureImage (GLuint texture, GLint level, GLsizei bufSize, void *pixels); +GLAPI void APIENTRY glGetTextureLevelParameterfv (GLuint texture, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureLevelParameteriv (GLuint texture, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterfv (GLuint texture, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureParameterIiv (GLuint texture, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterIuiv (GLuint texture, GLenum pname, GLuint *params); +GLAPI void APIENTRY glGetTextureParameteriv (GLuint texture, GLenum pname, GLint *params); +GLAPI void APIENTRY glCreateVertexArrays (GLsizei n, GLuint *arrays); +GLAPI void APIENTRY glDisableVertexArrayAttrib (GLuint vaobj, GLuint index); +GLAPI void APIENTRY glEnableVertexArrayAttrib (GLuint vaobj, GLuint index); +GLAPI void APIENTRY glVertexArrayElementBuffer (GLuint vaobj, GLuint buffer); +GLAPI void APIENTRY glVertexArrayVertexBuffer (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexArrayVertexBuffers (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); +GLAPI void APIENTRY glVertexArrayAttribBinding (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexArrayAttribFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayAttribIFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayAttribLFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayBindingDivisor (GLuint vaobj, GLuint bindingindex, GLuint divisor); +GLAPI void APIENTRY glGetVertexArrayiv (GLuint vaobj, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetVertexArrayIndexediv (GLuint vaobj, GLuint index, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetVertexArrayIndexed64iv (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param); +GLAPI void APIENTRY glCreateSamplers (GLsizei n, GLuint *samplers); +GLAPI void APIENTRY glCreateProgramPipelines (GLsizei n, GLuint *pipelines); +GLAPI void APIENTRY glCreateQueries (GLenum target, GLsizei n, GLuint *ids); +GLAPI void APIENTRY glGetQueryBufferObjecti64v (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI void APIENTRY glGetQueryBufferObjectiv (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI void APIENTRY glGetQueryBufferObjectui64v (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI void APIENTRY glGetQueryBufferObjectuiv (GLuint id, GLuint buffer, GLenum pname, GLintptr offset); +GLAPI void APIENTRY glMemoryBarrierByRegion (GLbitfield barriers); +GLAPI void APIENTRY glGetTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +GLAPI void APIENTRY glGetCompressedTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); +GLAPI GLenum APIENTRY glGetGraphicsResetStatus (void); +GLAPI void APIENTRY glGetnCompressedTexImage (GLenum target, GLint lod, GLsizei bufSize, void *pixels); +GLAPI void APIENTRY glGetnTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); +GLAPI void APIENTRY glGetnUniformdv (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +GLAPI void APIENTRY glGetnUniformfv (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GLAPI void APIENTRY glGetnUniformiv (GLuint program, GLint location, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetnUniformuiv (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +GLAPI void APIENTRY glReadnPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +GLAPI void APIENTRY glGetnMapdv (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +GLAPI void APIENTRY glGetnMapfv (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +GLAPI void APIENTRY glGetnMapiv (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +GLAPI void APIENTRY glGetnPixelMapfv (GLenum map, GLsizei bufSize, GLfloat *values); +GLAPI void APIENTRY glGetnPixelMapuiv (GLenum map, GLsizei bufSize, GLuint *values); +GLAPI void APIENTRY glGetnPixelMapusv (GLenum map, GLsizei bufSize, GLushort *values); +GLAPI void APIENTRY glGetnPolygonStipple (GLsizei bufSize, GLubyte *pattern); +GLAPI void APIENTRY glGetnColorTable (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); +GLAPI void APIENTRY glGetnConvolutionFilter (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); +GLAPI void APIENTRY glGetnSeparableFilter (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); +GLAPI void APIENTRY glGetnHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +GLAPI void APIENTRY glGetnMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +GLAPI void APIENTRY glTextureBarrier (void); +#endif +#endif /* GL_VERSION_4_5 */ + +#ifndef GL_VERSION_4_6 +#define GL_VERSION_4_6 1 +#define GL_SHADER_BINARY_FORMAT_SPIR_V 0x9551 +#define GL_SPIR_V_BINARY 0x9552 +#define GL_PARAMETER_BUFFER 0x80EE +#define GL_PARAMETER_BUFFER_BINDING 0x80EF +#define GL_CONTEXT_FLAG_NO_ERROR_BIT 0x00000008 +#define GL_VERTICES_SUBMITTED 0x82EE +#define GL_PRIMITIVES_SUBMITTED 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS 0x82F2 +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES 0x82F7 +#define GL_POLYGON_OFFSET_CLAMP 0x8E1B +#define GL_SPIR_V_EXTENSIONS 0x9553 +#define GL_NUM_SPIR_V_EXTENSIONS 0x9554 +#define GL_TEXTURE_MAX_ANISOTROPY 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY 0x84FF +#define GL_TRANSFORM_FEEDBACK_OVERFLOW 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW 0x82ED +typedef void (APIENTRYP PFNGLSPECIALIZESHADERPROC) (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLPOLYGONOFFSETCLAMPPROC) (GLfloat factor, GLfloat units, GLfloat clamp); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpecializeShader (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); +GLAPI void APIENTRY glMultiDrawArraysIndirectCount (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirectCount (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +GLAPI void APIENTRY glPolygonOffsetClamp (GLfloat factor, GLfloat units, GLfloat clamp); +#endif +#endif /* GL_VERSION_4_6 */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 +#endif /* GL_ARB_ES2_compatibility */ + +#ifndef GL_ARB_ES3_1_compatibility +#define GL_ARB_ES3_1_compatibility 1 +#endif /* GL_ARB_ES3_1_compatibility */ + +#ifndef GL_ARB_ES3_2_compatibility +#define GL_ARB_ES3_2_compatibility 1 +#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE +#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 +#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 +typedef void (APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXARBPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveBoundingBoxARB (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); +#endif +#endif /* GL_ARB_ES3_2_compatibility */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 +#endif /* GL_ARB_ES3_compatibility */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 +#endif /* GL_ARB_arrays_of_arrays */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 +#endif /* GL_ARB_base_instance */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 +typedef khronos_uint64_t GLuint64EXT; +#define GL_UNSIGNED_INT64_ARB 0x140F +typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint64 APIENTRY glGetTextureHandleARB (GLuint texture); +GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleARB (GLuint texture, GLuint sampler); +GLAPI void APIENTRY glMakeTextureHandleResidentARB (GLuint64 handle); +GLAPI void APIENTRY glMakeTextureHandleNonResidentARB (GLuint64 handle); +GLAPI GLuint64 APIENTRY glGetImageHandleARB (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +GLAPI void APIENTRY glMakeImageHandleResidentARB (GLuint64 handle, GLenum access); +GLAPI void APIENTRY glMakeImageHandleNonResidentARB (GLuint64 handle); +GLAPI void APIENTRY glUniformHandleui64ARB (GLint location, GLuint64 value); +GLAPI void APIENTRY glUniformHandleui64vARB (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glProgramUniformHandleui64ARB (GLuint program, GLint location, GLuint64 value); +GLAPI void APIENTRY glProgramUniformHandleui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +GLAPI GLboolean APIENTRY glIsTextureHandleResidentARB (GLuint64 handle); +GLAPI GLboolean APIENTRY glIsImageHandleResidentARB (GLuint64 handle); +GLAPI void APIENTRY glVertexAttribL1ui64ARB (GLuint index, GLuint64EXT x); +GLAPI void APIENTRY glVertexAttribL1ui64vARB (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glGetVertexAttribLui64vARB (GLuint index, GLenum pname, GLuint64EXT *params); +#endif +#endif /* GL_ARB_bindless_texture */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 +#endif /* GL_ARB_blend_func_extended */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 +#endif /* GL_ARB_buffer_storage */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 +struct _cl_context; +struct _cl_event; +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 +typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context *context, struct _cl_event *event, GLbitfield flags); +#endif +#endif /* GL_ARB_cl_event */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 +#endif /* GL_ARB_clear_buffer_object */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 +#endif /* GL_ARB_clear_texture */ + +#ifndef GL_ARB_clip_control +#define GL_ARB_clip_control 1 +#endif /* GL_ARB_clip_control */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); +#endif +#endif /* GL_ARB_color_buffer_float */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 +#endif /* GL_ARB_compatibility */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 +#endif /* GL_ARB_compute_shader */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); +#endif +#endif /* GL_ARB_compute_variable_group_size */ + +#ifndef GL_ARB_conditional_render_inverted +#define GL_ARB_conditional_render_inverted 1 +#endif /* GL_ARB_conditional_render_inverted */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 +#endif /* GL_ARB_conservative_depth */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 +#endif /* GL_ARB_copy_buffer */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 +#endif /* GL_ARB_copy_image */ + +#ifndef GL_ARB_cull_distance +#define GL_ARB_cull_distance 1 +#endif /* GL_ARB_cull_distance */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif +#endif /* GL_ARB_debug_output */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +#endif /* GL_ARB_depth_buffer_float */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 +#endif /* GL_ARB_depth_clamp */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif /* GL_ARB_depth_texture */ + +#ifndef GL_ARB_derivative_control +#define GL_ARB_derivative_control 1 +#endif /* GL_ARB_derivative_control */ + +#ifndef GL_ARB_direct_state_access +#define GL_ARB_direct_state_access 1 +#endif /* GL_ARB_direct_state_access */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); +#endif +#endif /* GL_ARB_draw_buffers */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 +typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif +#endif /* GL_ARB_draw_buffers_blend */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 +#endif /* GL_ARB_draw_elements_base_vertex */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 +#endif /* GL_ARB_draw_indirect */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#endif +#endif /* GL_ARB_draw_instanced */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 +#endif /* GL_ARB_enhanced_layouts */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 +#endif /* GL_ARB_explicit_attrib_location */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 +#endif /* GL_ARB_explicit_uniform_location */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 +#endif /* GL_ARB_fragment_coord_conventions */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 +#endif /* GL_ARB_fragment_layer_viewport */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void *string); +GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, void *string); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); +#endif +#endif /* GL_ARB_fragment_program */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif /* GL_ARB_fragment_program_shadow */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif /* GL_ARB_fragment_shader */ + +#ifndef GL_ARB_fragment_shader_interlock +#define GL_ARB_fragment_shader_interlock 1 +#endif /* GL_ARB_fragment_shader_interlock */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 +#endif /* GL_ARB_framebuffer_no_attachments */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +#endif /* GL_ARB_framebuffer_object */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +#endif /* GL_ARB_framebuffer_sRGB */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); +GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif +#endif /* GL_ARB_geometry_shader4 */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 +#endif /* GL_ARB_get_program_binary */ + +#ifndef GL_ARB_get_texture_sub_image +#define GL_ARB_get_texture_sub_image 1 +#endif /* GL_ARB_get_texture_sub_image */ + +#ifndef GL_ARB_gl_spirv +#define GL_ARB_gl_spirv 1 +#define GL_SHADER_BINARY_FORMAT_SPIR_V_ARB 0x9551 +#define GL_SPIR_V_BINARY_ARB 0x9552 +typedef void (APIENTRYP PFNGLSPECIALIZESHADERARBPROC) (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpecializeShaderARB (GLuint shader, const GLchar *pEntryPoint, GLuint numSpecializationConstants, const GLuint *pConstantIndex, const GLuint *pConstantValue); +#endif +#endif /* GL_ARB_gl_spirv */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 +#endif /* GL_ARB_gpu_shader5 */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 +#endif /* GL_ARB_gpu_shader_fp64 */ + +#ifndef GL_ARB_gpu_shader_int64 +#define GL_ARB_gpu_shader_int64 1 +#define GL_INT64_ARB 0x140E +#define GL_INT64_VEC2_ARB 0x8FE9 +#define GL_INT64_VEC3_ARB 0x8FEA +#define GL_INT64_VEC4_ARB 0x8FEB +#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 +typedef void (APIENTRYP PFNGLUNIFORM1I64ARBPROC) (GLint location, GLint64 x); +typedef void (APIENTRYP PFNGLUNIFORM2I64ARBPROC) (GLint location, GLint64 x, GLint64 y); +typedef void (APIENTRYP PFNGLUNIFORM3I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z); +typedef void (APIENTRYP PFNGLUNIFORM4I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +typedef void (APIENTRYP PFNGLUNIFORM1I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value); +typedef void (APIENTRYP PFNGLUNIFORM2I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value); +typedef void (APIENTRYP PFNGLUNIFORM3I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value); +typedef void (APIENTRYP PFNGLUNIFORM4I64VARBPROC) (GLint location, GLsizei count, const GLint64 *value); +typedef void (APIENTRYP PFNGLUNIFORM1UI64ARBPROC) (GLint location, GLuint64 x); +typedef void (APIENTRYP PFNGLUNIFORM2UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y); +typedef void (APIENTRYP PFNGLUNIFORM3UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +typedef void (APIENTRYP PFNGLUNIFORM4UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +typedef void (APIENTRYP PFNGLUNIFORM1UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLUNIFORM2UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLUNIFORM3UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLUNIFORM4UI64VARBPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLGETUNIFORMI64VARBPROC) (GLuint program, GLint location, GLint64 *params); +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLuint64 *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint64 *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint64 *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64ARBPROC) (GLuint program, GLint location, GLint64 x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64ARBPROC) (GLuint program, GLint location, GLuint64 x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1i64ARB (GLint location, GLint64 x); +GLAPI void APIENTRY glUniform2i64ARB (GLint location, GLint64 x, GLint64 y); +GLAPI void APIENTRY glUniform3i64ARB (GLint location, GLint64 x, GLint64 y, GLint64 z); +GLAPI void APIENTRY glUniform4i64ARB (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +GLAPI void APIENTRY glUniform1i64vARB (GLint location, GLsizei count, const GLint64 *value); +GLAPI void APIENTRY glUniform2i64vARB (GLint location, GLsizei count, const GLint64 *value); +GLAPI void APIENTRY glUniform3i64vARB (GLint location, GLsizei count, const GLint64 *value); +GLAPI void APIENTRY glUniform4i64vARB (GLint location, GLsizei count, const GLint64 *value); +GLAPI void APIENTRY glUniform1ui64ARB (GLint location, GLuint64 x); +GLAPI void APIENTRY glUniform2ui64ARB (GLint location, GLuint64 x, GLuint64 y); +GLAPI void APIENTRY glUniform3ui64ARB (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +GLAPI void APIENTRY glUniform4ui64ARB (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +GLAPI void APIENTRY glUniform1ui64vARB (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glUniform2ui64vARB (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glUniform3ui64vARB (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glUniform4ui64vARB (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glGetUniformi64vARB (GLuint program, GLint location, GLint64 *params); +GLAPI void APIENTRY glGetUniformui64vARB (GLuint program, GLint location, GLuint64 *params); +GLAPI void APIENTRY glGetnUniformi64vARB (GLuint program, GLint location, GLsizei bufSize, GLint64 *params); +GLAPI void APIENTRY glGetnUniformui64vARB (GLuint program, GLint location, GLsizei bufSize, GLuint64 *params); +GLAPI void APIENTRY glProgramUniform1i64ARB (GLuint program, GLint location, GLint64 x); +GLAPI void APIENTRY glProgramUniform2i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y); +GLAPI void APIENTRY glProgramUniform3i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); +GLAPI void APIENTRY glProgramUniform4i64ARB (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); +GLAPI void APIENTRY glProgramUniform1i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value); +GLAPI void APIENTRY glProgramUniform2i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value); +GLAPI void APIENTRY glProgramUniform3i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value); +GLAPI void APIENTRY glProgramUniform4i64vARB (GLuint program, GLint location, GLsizei count, const GLint64 *value); +GLAPI void APIENTRY glProgramUniform1ui64ARB (GLuint program, GLint location, GLuint64 x); +GLAPI void APIENTRY glProgramUniform2ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y); +GLAPI void APIENTRY glProgramUniform3ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); +GLAPI void APIENTRY glProgramUniform4ui64ARB (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); +GLAPI void APIENTRY glProgramUniform1ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glProgramUniform2ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glProgramUniform3ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glProgramUniform4ui64vARB (GLuint program, GLint location, GLsizei count, const GLuint64 *value); +#endif +#endif /* GL_ARB_gpu_shader_int64 */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +typedef khronos_uint16_t GLhalfARB; +#define GL_HALF_FLOAT_ARB 0x140B +#endif /* GL_ARB_half_float_pixel */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 +#endif /* GL_ARB_half_float_vertex */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, void *table); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogram (GLenum target); +GLAPI void APIENTRY glResetMinmax (GLenum target); +#endif +#endif /* GL_ARB_imaging */ + +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectCountARB (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirectCountARB (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#endif +#endif /* GL_ARB_indirect_parameters */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); +#endif +#endif /* GL_ARB_instanced_arrays */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 +#endif /* GL_ARB_internalformat_query */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_VIEW_CLASS_EAC_R11 0x9383 +#define GL_VIEW_CLASS_EAC_RG11 0x9384 +#define GL_VIEW_CLASS_ETC2_RGB 0x9385 +#define GL_VIEW_CLASS_ETC2_RGBA 0x9386 +#define GL_VIEW_CLASS_ETC2_EAC_RGBA 0x9387 +#define GL_VIEW_CLASS_ASTC_4x4_RGBA 0x9388 +#define GL_VIEW_CLASS_ASTC_5x4_RGBA 0x9389 +#define GL_VIEW_CLASS_ASTC_5x5_RGBA 0x938A +#define GL_VIEW_CLASS_ASTC_6x5_RGBA 0x938B +#define GL_VIEW_CLASS_ASTC_6x6_RGBA 0x938C +#define GL_VIEW_CLASS_ASTC_8x5_RGBA 0x938D +#define GL_VIEW_CLASS_ASTC_8x6_RGBA 0x938E +#define GL_VIEW_CLASS_ASTC_8x8_RGBA 0x938F +#define GL_VIEW_CLASS_ASTC_10x5_RGBA 0x9390 +#define GL_VIEW_CLASS_ASTC_10x6_RGBA 0x9391 +#define GL_VIEW_CLASS_ASTC_10x8_RGBA 0x9392 +#define GL_VIEW_CLASS_ASTC_10x10_RGBA 0x9393 +#define GL_VIEW_CLASS_ASTC_12x10_RGBA 0x9394 +#define GL_VIEW_CLASS_ASTC_12x12_RGBA 0x9395 +#endif /* GL_ARB_internalformat_query2 */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 +#endif /* GL_ARB_invalidate_subdata */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 +#endif /* GL_ARB_map_buffer_alignment */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +#endif /* GL_ARB_map_buffer_range */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_ARB_matrix_palette */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 +#endif /* GL_ARB_multi_bind */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 +#endif /* GL_ARB_multi_draw_indirect */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLfloat value, GLboolean invert); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLfloat value, GLboolean invert); +#endif +#endif /* GL_ARB_multisample */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); +#endif +#endif /* GL_ARB_multitexture */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); +GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQueryARB (GLenum target); +GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); +#endif +#endif /* GL_ARB_occlusion_query */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 +#endif /* GL_ARB_occlusion_query2 */ + +#ifndef GL_ARB_parallel_shader_compile +#define GL_ARB_parallel_shader_compile 1 +#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 +#define GL_COMPLETION_STATUS_ARB 0x91B1 +typedef void (APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSARBPROC) (GLuint count); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMaxShaderCompilerThreadsARB (GLuint count); +#endif +#endif /* GL_ARB_parallel_shader_compile */ + +#ifndef GL_ARB_pipeline_statistics_query +#define GL_ARB_pipeline_statistics_query 1 +#define GL_VERTICES_SUBMITTED_ARB 0x82EE +#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF +#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 +#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 +#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 +#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 +#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 +#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 +#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 +#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 +#endif /* GL_ARB_pipeline_statistics_query */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif /* GL_ARB_pixel_buffer_object */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); +#endif +#endif /* GL_ARB_point_parameters */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif /* GL_ARB_point_sprite */ + +#ifndef GL_ARB_polygon_offset_clamp +#define GL_ARB_polygon_offset_clamp 1 +#endif /* GL_ARB_polygon_offset_clamp */ + +#ifndef GL_ARB_post_depth_coverage +#define GL_ARB_post_depth_coverage 1 +#endif /* GL_ARB_post_depth_coverage */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 +#endif /* GL_ARB_program_interface_query */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 +#endif /* GL_ARB_provoking_vertex */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 +#endif /* GL_ARB_query_buffer_object */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 +#endif /* GL_ARB_robust_buffer_access_behavior */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); +typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void *img); +typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); +typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); +typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); +typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); +GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); +GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void *img); +GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); +GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); +GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); +GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); +GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); +GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); +GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); +GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +#endif +#endif /* GL_ARB_robustness */ + +#ifndef GL_ARB_robustness_isolation +#define GL_ARB_robustness_isolation 1 +#endif /* GL_ARB_robustness_isolation */ + +#ifndef GL_ARB_sample_locations +#define GL_ARB_sample_locations 1 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 +#define GL_SAMPLE_LOCATION_ARB 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 +typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLEVALUATEDEPTHVALUESARBPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferSampleLocationsfvARB (GLenum target, GLuint start, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glNamedFramebufferSampleLocationsfvARB (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glEvaluateDepthValuesARB (void); +#endif +#endif /* GL_ARB_sample_locations */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLfloat value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShadingARB (GLfloat value); +#endif +#endif /* GL_ARB_sample_shading */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 +#endif /* GL_ARB_sampler_objects */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 +#endif /* GL_ARB_seamless_cube_map */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 +#endif /* GL_ARB_separate_shader_objects */ + +#ifndef GL_ARB_shader_atomic_counter_ops +#define GL_ARB_shader_atomic_counter_ops 1 +#endif /* GL_ARB_shader_atomic_counter_ops */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 +#endif /* GL_ARB_shader_atomic_counters */ + +#ifndef GL_ARB_shader_ballot +#define GL_ARB_shader_ballot 1 +#endif /* GL_ARB_shader_ballot */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 +#endif /* GL_ARB_shader_bit_encoding */ + +#ifndef GL_ARB_shader_clock +#define GL_ARB_shader_clock 1 +#endif /* GL_ARB_shader_clock */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 +#endif /* GL_ARB_shader_draw_parameters */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 +#endif /* GL_ARB_shader_group_vote */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 +#endif /* GL_ARB_shader_image_load_store */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 +#endif /* GL_ARB_shader_image_size */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef __APPLE__ +typedef void *GLhandleARB; +#else +typedef unsigned int GLhandleARB; +#endif +typedef char GLcharARB; +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB **string, const GLint *length); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif +#endif /* GL_ARB_shader_objects */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 +#endif /* GL_ARB_shader_precision */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 +#endif /* GL_ARB_shader_stencil_export */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 +#endif /* GL_ARB_shader_storage_buffer_object */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 +#endif /* GL_ARB_shader_subroutine */ + +#ifndef GL_ARB_shader_texture_image_samples +#define GL_ARB_shader_texture_image_samples 1 +#endif /* GL_ARB_shader_texture_image_samples */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 +#endif /* GL_ARB_shader_texture_lod */ + +#ifndef GL_ARB_shader_viewport_layer_array +#define GL_ARB_shader_viewport_layer_array 1 +#endif /* GL_ARB_shader_viewport_layer_array */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif /* GL_ARB_shading_language_100 */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 +#endif /* GL_ARB_shading_language_420pack */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA +typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); +typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar *const*path, const GLint *length); +GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif +#endif /* GL_ARB_shading_language_include */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 +#endif /* GL_ARB_shading_language_packing */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif /* GL_ARB_shadow */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif /* GL_ARB_shadow_ambient */ + +#ifndef GL_ARB_sparse_buffer +#define GL_ARB_sparse_buffer 1 +#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 +#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 +typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); +typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); +typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferPageCommitmentARB (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); +GLAPI void APIENTRY glNamedBufferPageCommitmentEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); +GLAPI void APIENTRY glNamedBufferPageCommitmentARB (GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit); +#endif +#endif /* GL_ARB_sparse_buffer */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +#endif +#endif /* GL_ARB_sparse_texture */ + +#ifndef GL_ARB_sparse_texture2 +#define GL_ARB_sparse_texture2 1 +#endif /* GL_ARB_sparse_texture2 */ + +#ifndef GL_ARB_sparse_texture_clamp +#define GL_ARB_sparse_texture_clamp 1 +#endif /* GL_ARB_sparse_texture_clamp */ + +#ifndef GL_ARB_spirv_extensions +#define GL_ARB_spirv_extensions 1 +#endif /* GL_ARB_spirv_extensions */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 +#endif /* GL_ARB_stencil_texturing */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 +#endif /* GL_ARB_sync */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 +#endif /* GL_ARB_tessellation_shader */ + +#ifndef GL_ARB_texture_barrier +#define GL_ARB_texture_barrier 1 +#endif /* GL_ARB_texture_barrier */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif /* GL_ARB_texture_border_clamp */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); +#endif +#endif /* GL_ARB_texture_buffer_object */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 +#endif /* GL_ARB_texture_buffer_range */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void *img); +#endif +#endif /* GL_ARB_texture_compression */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F +#endif /* GL_ARB_texture_compression_bptc */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +#endif /* GL_ARB_texture_compression_rgtc */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif /* GL_ARB_texture_cube_map */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F +#endif /* GL_ARB_texture_cube_map_array */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif /* GL_ARB_texture_env_add */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif /* GL_ARB_texture_env_combine */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif /* GL_ARB_texture_env_crossbar */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif /* GL_ARB_texture_env_dot3 */ + +#ifndef GL_ARB_texture_filter_anisotropic +#define GL_ARB_texture_filter_anisotropic 1 +#endif /* GL_ARB_texture_filter_anisotropic */ + +#ifndef GL_ARB_texture_filter_minmax +#define GL_ARB_texture_filter_minmax 1 +#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 +#define GL_WEIGHTED_AVERAGE_ARB 0x9367 +#endif /* GL_ARB_texture_filter_minmax */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif /* GL_ARB_texture_float */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F +#endif /* GL_ARB_texture_gather */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif /* GL_ARB_texture_mirrored_repeat */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 +#endif /* GL_ARB_texture_multisample */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif /* GL_ARB_texture_non_power_of_two */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 +#endif /* GL_ARB_texture_query_levels */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 +#endif /* GL_ARB_texture_query_lod */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif /* GL_ARB_texture_rectangle */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +#endif /* GL_ARB_texture_rg */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 +#endif /* GL_ARB_texture_rgb10_a2ui */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 +#endif /* GL_ARB_texture_stencil8 */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 +#endif /* GL_ARB_texture_storage */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 +#endif /* GL_ARB_texture_storage_multisample */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 +#endif /* GL_ARB_texture_swizzle */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 +#endif /* GL_ARB_texture_view */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 +#endif /* GL_ARB_timer_query */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 +#endif /* GL_ARB_transform_feedback2 */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 +#endif /* GL_ARB_transform_feedback3 */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 +#endif /* GL_ARB_transform_feedback_instanced */ + +#ifndef GL_ARB_transform_feedback_overflow_query +#define GL_ARB_transform_feedback_overflow_query 1 +#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC +#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED +#endif /* GL_ARB_transform_feedback_overflow_query */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); +#endif +#endif /* GL_ARB_transpose_matrix */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 +#endif /* GL_ARB_uniform_buffer_object */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 +#endif /* GL_ARB_vertex_array_bgra */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +#endif /* GL_ARB_vertex_array_object */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 +#endif /* GL_ARB_vertex_attrib_64bit */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 +#endif /* GL_ARB_vertex_attrib_binding */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); +GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); +GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); +GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); +GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); +GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); +GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); +GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); +GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexBlendARB (GLint count); +#endif +#endif /* GL_ARB_vertex_blend */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +typedef khronos_ssize_t GLsizeiptrARB; +typedef khronos_intptr_t GLintptrARB; +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +typedef void *(APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +GLAPI void *APIENTRY glMapBufferARB (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, void **params); +#endif +#endif /* GL_ARB_vertex_buffer_object */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void **pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, void **pointer); +#endif +#endif /* GL_ARB_vertex_program */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); +#endif +#endif /* GL_ARB_vertex_shader */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYDVNVPROC) (GLuint first, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDDNVPROC) (GLuint index, GLdouble n, GLdouble f); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangeArraydvNV (GLuint first, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glDepthRangeIndexeddNV (GLuint index, GLdouble n, GLdouble f); +#endif +#endif /* GL_ARB_viewport_array */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); +#endif +#endif /* GL_ARB_window_pos */ + +#ifndef GL_KHR_blend_equation_advanced +#define GL_KHR_blend_equation_advanced 1 +#define GL_MULTIPLY_KHR 0x9294 +#define GL_SCREEN_KHR 0x9295 +#define GL_OVERLAY_KHR 0x9296 +#define GL_DARKEN_KHR 0x9297 +#define GL_LIGHTEN_KHR 0x9298 +#define GL_COLORDODGE_KHR 0x9299 +#define GL_COLORBURN_KHR 0x929A +#define GL_HARDLIGHT_KHR 0x929B +#define GL_SOFTLIGHT_KHR 0x929C +#define GL_DIFFERENCE_KHR 0x929E +#define GL_EXCLUSION_KHR 0x92A0 +#define GL_HSL_HUE_KHR 0x92AD +#define GL_HSL_SATURATION_KHR 0x92AE +#define GL_HSL_COLOR_KHR 0x92AF +#define GL_HSL_LUMINOSITY_KHR 0x92B0 +typedef void (APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendBarrierKHR (void); +#endif +#endif /* GL_KHR_blend_equation_advanced */ + +#ifndef GL_KHR_blend_equation_advanced_coherent +#define GL_KHR_blend_equation_advanced_coherent 1 +#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 +#endif /* GL_KHR_blend_equation_advanced_coherent */ + +#ifndef GL_KHR_context_flush_control +#define GL_KHR_context_flush_control 1 +#endif /* GL_KHR_context_flush_control */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 +#endif /* GL_KHR_debug */ + +#ifndef GL_KHR_no_error +#define GL_KHR_no_error 1 +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 +#endif /* GL_KHR_no_error */ + +#ifndef GL_KHR_parallel_shader_compile +#define GL_KHR_parallel_shader_compile 1 +#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 +#define GL_COMPLETION_STATUS_KHR 0x91B1 +typedef void (APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count); +#endif +#endif /* GL_KHR_parallel_shader_compile */ + +#ifndef GL_KHR_robust_buffer_access_behavior +#define GL_KHR_robust_buffer_access_behavior 1 +#endif /* GL_KHR_robust_buffer_access_behavior */ + +#ifndef GL_KHR_robustness +#define GL_KHR_robustness 1 +#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 +#endif /* GL_KHR_robustness */ + +#ifndef GL_KHR_shader_subgroup +#define GL_KHR_shader_subgroup 1 +#define GL_SUBGROUP_SIZE_KHR 0x9532 +#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533 +#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534 +#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535 +#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001 +#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002 +#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004 +#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008 +#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010 +#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020 +#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040 +#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080 +#endif /* GL_KHR_shader_subgroup */ + +#ifndef GL_KHR_texture_compression_astc_hdr +#define GL_KHR_texture_compression_astc_hdr 1 +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD +#endif /* GL_KHR_texture_compression_astc_hdr */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 +#endif /* GL_KHR_texture_compression_astc_ldr */ + +#ifndef GL_KHR_texture_compression_astc_sliced_3d +#define GL_KHR_texture_compression_astc_sliced_3d 1 +#endif /* GL_KHR_texture_compression_astc_sliced_3d */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 +typedef void (APIENTRYP PFNGLMULTITEXCOORD1BOESPROC) (GLenum texture, GLbyte s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2BOESPROC) (GLenum texture, GLbyte s, GLbyte t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4BOESPROC) (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4BVOESPROC) (GLenum texture, const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD1BOESPROC) (GLbyte s); +typedef void (APIENTRYP PFNGLTEXCOORD1BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD2BOESPROC) (GLbyte s, GLbyte t); +typedef void (APIENTRYP PFNGLTEXCOORD2BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC) (GLbyte s, GLbyte t, GLbyte r); +typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC) (GLbyte s, GLbyte t, GLbyte r, GLbyte q); +typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x, GLbyte y); +typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y, GLbyte z); +typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC) (const GLbyte *coords); +typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z, GLbyte w); +typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC) (const GLbyte *coords); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiTexCoord1bOES (GLenum texture, GLbyte s); +GLAPI void APIENTRY glMultiTexCoord1bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glMultiTexCoord2bOES (GLenum texture, GLbyte s, GLbyte t); +GLAPI void APIENTRY glMultiTexCoord2bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glMultiTexCoord3bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r); +GLAPI void APIENTRY glMultiTexCoord3bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glMultiTexCoord4bOES (GLenum texture, GLbyte s, GLbyte t, GLbyte r, GLbyte q); +GLAPI void APIENTRY glMultiTexCoord4bvOES (GLenum texture, const GLbyte *coords); +GLAPI void APIENTRY glTexCoord1bOES (GLbyte s); +GLAPI void APIENTRY glTexCoord1bvOES (const GLbyte *coords); +GLAPI void APIENTRY glTexCoord2bOES (GLbyte s, GLbyte t); +GLAPI void APIENTRY glTexCoord2bvOES (const GLbyte *coords); +GLAPI void APIENTRY glTexCoord3bOES (GLbyte s, GLbyte t, GLbyte r); +GLAPI void APIENTRY glTexCoord3bvOES (const GLbyte *coords); +GLAPI void APIENTRY glTexCoord4bOES (GLbyte s, GLbyte t, GLbyte r, GLbyte q); +GLAPI void APIENTRY glTexCoord4bvOES (const GLbyte *coords); +GLAPI void APIENTRY glVertex2bOES (GLbyte x, GLbyte y); +GLAPI void APIENTRY glVertex2bvOES (const GLbyte *coords); +GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y, GLbyte z); +GLAPI void APIENTRY glVertex3bvOES (const GLbyte *coords); +GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z, GLbyte w); +GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords); +#endif +#endif /* GL_OES_byte_coordinates */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif /* GL_OES_compressed_paletted_texture */ + +#ifndef GL_OES_fixed_point +#define GL_OES_fixed_point 1 +typedef khronos_int32_t GLfixed; +#define GL_FIXED_OES 0x140C +typedef void (APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref); +typedef void (APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLfixed depth); +typedef void (APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation); +typedef void (APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLfixed n, GLfixed f); +typedef void (APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *param); +typedef void (APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +typedef void (APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum plane, GLfixed *equation); +typedef void (APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *param); +typedef void (APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width); +typedef void (APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *param); +typedef void (APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (APIENTRYP PFNGLORTHOXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +typedef void (APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size); +typedef void (APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units); +typedef void (APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLACCUMXOESPROC) (GLenum op, GLfixed value); +typedef void (APIENTRYP PFNGLBITMAPXOESPROC) (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); +typedef void (APIENTRYP PFNGLBLENDCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLCLEARACCUMXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (APIENTRYP PFNGLCOLOR3XOESPROC) (GLfixed red, GLfixed green, GLfixed blue); +typedef void (APIENTRYP PFNGLCOLOR3XVOESPROC) (const GLfixed *components); +typedef void (APIENTRYP PFNGLCOLOR4XVOESPROC) (const GLfixed *components); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLEVALCOORD1XOESPROC) (GLfixed u); +typedef void (APIENTRYP PFNGLEVALCOORD1XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLEVALCOORD2XOESPROC) (GLfixed u, GLfixed v); +typedef void (APIENTRYP PFNGLEVALCOORD2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLFEEDBACKBUFFERXOESPROC) (GLsizei n, GLenum type, const GLfixed *buffer); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETMAPXVOESPROC) (GLenum target, GLenum query, GLfixed *v); +typedef void (APIENTRYP PFNGLGETMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLGETPIXELMAPXVPROC) (GLenum map, GLint size, GLfixed *values); +typedef void (APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERXVOESPROC) (GLenum target, GLint level, GLenum pname, GLfixed *params); +typedef void (APIENTRYP PFNGLINDEXXOESPROC) (GLfixed component); +typedef void (APIENTRYP PFNGLINDEXXVOESPROC) (const GLfixed *component); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMAP1XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); +typedef void (APIENTRYP PFNGLMAP2XOESPROC) (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); +typedef void (APIENTRYP PFNGLMAPGRID1XOESPROC) (GLint n, GLfixed u1, GLfixed u2); +typedef void (APIENTRYP PFNGLMAPGRID2XOESPROC) (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXXOESPROC) (const GLfixed *m); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1XOESPROC) (GLenum texture, GLfixed s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2XOESPROC) (GLenum texture, GLfixed s, GLfixed t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4XVOESPROC) (GLenum texture, const GLfixed *coords); +typedef void (APIENTRYP PFNGLNORMAL3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLPASSTHROUGHXOESPROC) (GLfixed token); +typedef void (APIENTRYP PFNGLPIXELMAPXPROC) (GLenum map, GLint size, const GLfixed *values); +typedef void (APIENTRYP PFNGLPIXELSTOREXPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLPIXELTRANSFERXOESPROC) (GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLPIXELZOOMXOESPROC) (GLfixed xfactor, GLfixed yfactor); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESXOESPROC) (GLsizei n, const GLuint *textures, const GLfixed *priorities); +typedef void (APIENTRYP PFNGLRASTERPOS2XOESPROC) (GLfixed x, GLfixed y); +typedef void (APIENTRYP PFNGLRASTERPOS2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLRASTERPOS3XOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLRASTERPOS3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLRASTERPOS4XOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed w); +typedef void (APIENTRYP PFNGLRASTERPOS4XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLRECTXOESPROC) (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); +typedef void (APIENTRYP PFNGLRECTXVOESPROC) (const GLfixed *v1, const GLfixed *v2); +typedef void (APIENTRYP PFNGLTEXCOORD1XOESPROC) (GLfixed s); +typedef void (APIENTRYP PFNGLTEXCOORD1XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXCOORD2XOESPROC) (GLfixed s, GLfixed t); +typedef void (APIENTRYP PFNGLTEXCOORD2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXCOORD3XOESPROC) (GLfixed s, GLfixed t, GLfixed r); +typedef void (APIENTRYP PFNGLTEXCOORD3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXCOORD4XOESPROC) (GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (APIENTRYP PFNGLTEXCOORD4XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param); +typedef void (APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params); +typedef void (APIENTRYP PFNGLVERTEX2XOESPROC) (GLfixed x); +typedef void (APIENTRYP PFNGLVERTEX2XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLVERTEX3XOESPROC) (GLfixed x, GLfixed y); +typedef void (APIENTRYP PFNGLVERTEX3XVOESPROC) (const GLfixed *coords); +typedef void (APIENTRYP PFNGLVERTEX4XOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (APIENTRYP PFNGLVERTEX4XVOESPROC) (const GLfixed *coords); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAlphaFuncxOES (GLenum func, GLfixed ref); +GLAPI void APIENTRY glClearColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glClearDepthxOES (GLfixed depth); +GLAPI void APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation); +GLAPI void APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glDepthRangexOES (GLfixed n, GLfixed f); +GLAPI void APIENTRY glFogxOES (GLenum pname, GLfixed param); +GLAPI void APIENTRY glFogxvOES (GLenum pname, const GLfixed *param); +GLAPI void APIENTRY glFrustumxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI void APIENTRY glGetClipPlanexOES (GLenum plane, GLfixed *equation); +GLAPI void APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetTexEnvxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glLightModelxOES (GLenum pname, GLfixed param); +GLAPI void APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *param); +GLAPI void APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param); +GLAPI void APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glLineWidthxOES (GLfixed width); +GLAPI void APIENTRY glLoadMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); +GLAPI void APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *param); +GLAPI void APIENTRY glMultMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMultiTexCoord4xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GLAPI void APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); +GLAPI void APIENTRY glOrthoxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f); +GLAPI void APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glPointSizexOES (GLfixed size); +GLAPI void APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units); +GLAPI void APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param); +GLAPI void APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param); +GLAPI void APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glAccumxOES (GLenum op, GLfixed value); +GLAPI void APIENTRY glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig, GLfixed xmove, GLfixed ymove, const GLubyte *bitmap); +GLAPI void APIENTRY glBlendColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +GLAPI void APIENTRY glColor3xOES (GLfixed red, GLfixed green, GLfixed blue); +GLAPI void APIENTRY glColor3xvOES (const GLfixed *components); +GLAPI void APIENTRY glColor4xvOES (const GLfixed *components); +GLAPI void APIENTRY glConvolutionParameterxOES (GLenum target, GLenum pname, GLfixed param); +GLAPI void APIENTRY glConvolutionParameterxvOES (GLenum target, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glEvalCoord1xOES (GLfixed u); +GLAPI void APIENTRY glEvalCoord1xvOES (const GLfixed *coords); +GLAPI void APIENTRY glEvalCoord2xOES (GLfixed u, GLfixed v); +GLAPI void APIENTRY glEvalCoord2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glFeedbackBufferxOES (GLsizei n, GLenum type, const GLfixed *buffer); +GLAPI void APIENTRY glGetConvolutionParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetHistogramParameterxvOES (GLenum target, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetLightxOES (GLenum light, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetMapxvOES (GLenum target, GLenum query, GLfixed *v); +GLAPI void APIENTRY glGetMaterialxOES (GLenum face, GLenum pname, GLfixed param); +GLAPI void APIENTRY glGetPixelMapxv (GLenum map, GLint size, GLfixed *values); +GLAPI void APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glGetTexLevelParameterxvOES (GLenum target, GLint level, GLenum pname, GLfixed *params); +GLAPI void APIENTRY glIndexxOES (GLfixed component); +GLAPI void APIENTRY glIndexxvOES (const GLfixed *component); +GLAPI void APIENTRY glLoadTransposeMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMap1xOES (GLenum target, GLfixed u1, GLfixed u2, GLint stride, GLint order, GLfixed points); +GLAPI void APIENTRY glMap2xOES (GLenum target, GLfixed u1, GLfixed u2, GLint ustride, GLint uorder, GLfixed v1, GLfixed v2, GLint vstride, GLint vorder, GLfixed points); +GLAPI void APIENTRY glMapGrid1xOES (GLint n, GLfixed u1, GLfixed u2); +GLAPI void APIENTRY glMapGrid2xOES (GLint n, GLfixed u1, GLfixed u2, GLfixed v1, GLfixed v2); +GLAPI void APIENTRY glMultTransposeMatrixxOES (const GLfixed *m); +GLAPI void APIENTRY glMultiTexCoord1xOES (GLenum texture, GLfixed s); +GLAPI void APIENTRY glMultiTexCoord1xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glMultiTexCoord2xOES (GLenum texture, GLfixed s, GLfixed t); +GLAPI void APIENTRY glMultiTexCoord2xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glMultiTexCoord3xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r); +GLAPI void APIENTRY glMultiTexCoord3xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glMultiTexCoord4xvOES (GLenum texture, const GLfixed *coords); +GLAPI void APIENTRY glNormal3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glPassThroughxOES (GLfixed token); +GLAPI void APIENTRY glPixelMapx (GLenum map, GLint size, const GLfixed *values); +GLAPI void APIENTRY glPixelStorex (GLenum pname, GLfixed param); +GLAPI void APIENTRY glPixelTransferxOES (GLenum pname, GLfixed param); +GLAPI void APIENTRY glPixelZoomxOES (GLfixed xfactor, GLfixed yfactor); +GLAPI void APIENTRY glPrioritizeTexturesxOES (GLsizei n, const GLuint *textures, const GLfixed *priorities); +GLAPI void APIENTRY glRasterPos2xOES (GLfixed x, GLfixed y); +GLAPI void APIENTRY glRasterPos2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glRasterPos3xOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glRasterPos3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glRasterPos4xOES (GLfixed x, GLfixed y, GLfixed z, GLfixed w); +GLAPI void APIENTRY glRasterPos4xvOES (const GLfixed *coords); +GLAPI void APIENTRY glRectxOES (GLfixed x1, GLfixed y1, GLfixed x2, GLfixed y2); +GLAPI void APIENTRY glRectxvOES (const GLfixed *v1, const GLfixed *v2); +GLAPI void APIENTRY glTexCoord1xOES (GLfixed s); +GLAPI void APIENTRY glTexCoord1xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexCoord2xOES (GLfixed s, GLfixed t); +GLAPI void APIENTRY glTexCoord2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexCoord3xOES (GLfixed s, GLfixed t, GLfixed r); +GLAPI void APIENTRY glTexCoord3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexCoord4xOES (GLfixed s, GLfixed t, GLfixed r, GLfixed q); +GLAPI void APIENTRY glTexCoord4xvOES (const GLfixed *coords); +GLAPI void APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param); +GLAPI void APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params); +GLAPI void APIENTRY glVertex2xOES (GLfixed x); +GLAPI void APIENTRY glVertex2xvOES (const GLfixed *coords); +GLAPI void APIENTRY glVertex3xOES (GLfixed x, GLfixed y); +GLAPI void APIENTRY glVertex3xvOES (const GLfixed *coords); +GLAPI void APIENTRY glVertex4xOES (GLfixed x, GLfixed y, GLfixed z); +GLAPI void APIENTRY glVertex4xvOES (const GLfixed *coords); +#endif +#endif /* GL_OES_fixed_point */ + +#ifndef GL_OES_query_matrix +#define GL_OES_query_matrix 1 +typedef GLbitfield (APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed *mantissa, GLint *exponent); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLbitfield APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent); +#endif +#endif /* GL_OES_query_matrix */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif /* GL_OES_read_format */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 +typedef void (APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); +typedef void (APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation); +typedef void (APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef void (APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef void (APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat *equation); +typedef void (APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClearDepthfOES (GLclampf depth); +GLAPI void APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation); +GLAPI void APIENTRY glDepthRangefOES (GLclampf n, GLclampf f); +GLAPI void APIENTRY glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +GLAPI void APIENTRY glGetClipPlanefOES (GLenum plane, GLfloat *equation); +GLAPI void APIENTRY glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +#endif +#endif /* GL_OES_single_precision */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif /* GL_3DFX_multisample */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); +#endif +#endif /* GL_3DFX_tbuffer */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif /* GL_3DFX_texture_compression_FXT1 */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D +#endif /* GL_AMD_blend_minmax_factor */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 +#endif /* GL_AMD_conservative_depth */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 +typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufSize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, void *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufSize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#endif +#endif /* GL_AMD_debug_output */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F +#endif /* GL_AMD_depth_clamp_separate */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 +typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#endif +#endif /* GL_AMD_draw_buffers_blend */ + +#ifndef GL_AMD_framebuffer_multisample_advanced +#define GL_AMD_framebuffer_multisample_advanced 1 +#define GL_RENDERBUFFER_STORAGE_SAMPLES_AMD 0x91B2 +#define GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD 0x91B3 +#define GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD 0x91B4 +#define GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD 0x91B5 +#define GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B6 +#define GL_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B7 +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleAdvancedAMD (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleAdvancedAMD (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +#endif /* GL_AMD_framebuffer_multisample_advanced */ + +#ifndef GL_AMD_framebuffer_sample_positions +#define GL_AMD_framebuffer_sample_positions 1 +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F +#define GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD 0x91AE +#define GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD 0x91AF +#define GL_ALL_PIXELS_AMD 0xFFFFFFFF +typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat *values); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLEPOSITIONSFVAMDPROC) (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat *values); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERFVAMDPROC) (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERFVAMDPROC) (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferSamplePositionsfvAMD (GLenum target, GLuint numsamples, GLuint pixelindex, const GLfloat *values); +GLAPI void APIENTRY glNamedFramebufferSamplePositionsfvAMD (GLuint framebuffer, GLuint numsamples, GLuint pixelindex, const GLfloat *values); +GLAPI void APIENTRY glGetFramebufferParameterfvAMD (GLenum target, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values); +GLAPI void APIENTRY glGetNamedFramebufferParameterfvAMD (GLuint framebuffer, GLenum pname, GLuint numsamples, GLuint pixelindex, GLsizei size, GLfloat *values); +#endif +#endif /* GL_AMD_framebuffer_sample_positions */ + +#ifndef GL_AMD_gcn_shader +#define GL_AMD_gcn_shader 1 +#endif /* GL_AMD_gcn_shader */ + +#ifndef GL_AMD_gpu_shader_half_float +#define GL_AMD_gpu_shader_half_float 1 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +#define GL_FLOAT16_MAT2_AMD 0x91C5 +#define GL_FLOAT16_MAT3_AMD 0x91C6 +#define GL_FLOAT16_MAT4_AMD 0x91C7 +#define GL_FLOAT16_MAT2x3_AMD 0x91C8 +#define GL_FLOAT16_MAT2x4_AMD 0x91C9 +#define GL_FLOAT16_MAT3x2_AMD 0x91CA +#define GL_FLOAT16_MAT3x4_AMD 0x91CB +#define GL_FLOAT16_MAT4x2_AMD 0x91CC +#define GL_FLOAT16_MAT4x3_AMD 0x91CD +#endif /* GL_AMD_gpu_shader_half_float */ + +#ifndef GL_AMD_gpu_shader_int16 +#define GL_AMD_gpu_shader_int16 1 +#endif /* GL_AMD_gpu_shader_int16 */ + +#ifndef GL_AMD_gpu_shader_int64 +#define GL_AMD_gpu_shader_int64 1 +typedef khronos_int64_t GLint64EXT; +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); +GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); +GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); +GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); +GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); +GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); +GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif +#endif /* GL_AMD_gpu_shader_int64 */ + +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 +typedef void (APIENTRYP PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribParameteriAMD (GLuint index, GLenum pname, GLint param); +#endif +#endif /* GL_AMD_interleaved_elements */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); +#endif +#endif /* GL_AMD_multi_draw_indirect */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 +typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); +typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); +typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); +GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); +GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); +#endif +#endif /* GL_AMD_name_gen_delete */ + +#ifndef GL_AMD_occlusion_query_event +#define GL_AMD_occlusion_query_event 1 +#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F +#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 +#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 +#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 +#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 +#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF +typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param); +#endif +#endif /* GL_AMD_occlusion_query_event */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); +GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif +#endif /* GL_AMD_performance_monitor */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 +#endif /* GL_AMD_pinned_memory */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 +#endif /* GL_AMD_query_buffer_object */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 +typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val); +#endif +#endif /* GL_AMD_sample_positions */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +#ifndef GL_AMD_shader_atomic_counter_ops +#define GL_AMD_shader_atomic_counter_ops 1 +#endif /* GL_AMD_shader_atomic_counter_ops */ + +#ifndef GL_AMD_shader_ballot +#define GL_AMD_shader_ballot 1 +#endif /* GL_AMD_shader_ballot */ + +#ifndef GL_AMD_shader_explicit_vertex_parameter +#define GL_AMD_shader_explicit_vertex_parameter 1 +#endif /* GL_AMD_shader_explicit_vertex_parameter */ + +#ifndef GL_AMD_shader_gpu_shader_half_float_fetch +#define GL_AMD_shader_gpu_shader_half_float_fetch 1 +#endif /* GL_AMD_shader_gpu_shader_half_float_fetch */ + +#ifndef GL_AMD_shader_image_load_store_lod +#define GL_AMD_shader_image_load_store_lod 1 +#endif /* GL_AMD_shader_image_load_store_lod */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 +#endif /* GL_AMD_shader_stencil_export */ + +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 +#endif /* GL_AMD_shader_trinary_minmax */ + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +typedef void (APIENTRYP PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (APIENTRYP PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorageSparseAMD (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +GLAPI void APIENTRY glTextureStorageSparseAMD (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +#endif +#endif /* GL_AMD_sparse_texture */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D +typedef void (APIENTRYP PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value); +#endif +#endif /* GL_AMD_stencil_operation_extended */ + +#ifndef GL_AMD_texture_gather_bias_lod +#define GL_AMD_texture_gather_bias_lod 1 +#endif /* GL_AMD_texture_gather_bias_lod */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 +#endif /* GL_AMD_texture_texture4 */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +#ifndef GL_AMD_transform_feedback4 +#define GL_AMD_transform_feedback4 1 +#define GL_STREAM_RASTERIZATION_AMD 0x91A0 +#endif /* GL_AMD_transform_feedback4 */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 +#endif /* GL_AMD_vertex_shader_layer */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 +typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); +GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); +#endif +#endif /* GL_AMD_vertex_shader_tessellator */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 +#endif /* GL_AMD_vertex_shader_viewport_index */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 +#endif /* GL_APPLE_aux_depth_stencil */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif /* GL_APPLE_client_storage */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const void *pointer); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif +#endif /* GL_APPLE_element_array */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); +#endif +#endif /* GL_APPLE_fence */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F +#endif /* GL_APPLE_float_pixels */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); +#endif +#endif /* GL_APPLE_flush_buffer_range */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D +typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#endif +#endif /* GL_APPLE_object_purgeable */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 +#define GL_RGB_422_APPLE 0x8A1F +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_RAW_422_APPLE 0x8A51 +#endif /* GL_APPLE_rgb_422 */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 +#endif /* GL_APPLE_row_bytes */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif /* GL_APPLE_specular_vector */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const void *pointer); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const void *pointer); +GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params); +#endif +#endif /* GL_APPLE_texture_range */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif /* GL_APPLE_transform_hint */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); +#endif +#endif /* GL_APPLE_vertex_array_object */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, void *pointer); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, void *pointer); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); +#endif +#endif /* GL_APPLE_vertex_array_range */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#endif +#endif /* GL_APPLE_vertex_program_evaluators */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#define GL_YCBCR_422_APPLE 0x85B9 +#endif /* GL_APPLE_ycbcr_422 */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); +#endif +#endif /* GL_ATI_draw_buffers */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum type, const void *pointer); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif +#endif /* GL_ATI_element_array */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); +#endif +#endif /* GL_ATI_envmap_bumpmap */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); +GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); +#endif +#endif /* GL_ATI_fragment_shader */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +typedef void *(APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void *APIENTRY glMapObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); +#endif +#endif /* GL_ATI_map_object_buffer */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#endif /* GL_ATI_meminfo */ + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif /* GL_ATI_pixel_format_float */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); +#endif +#endif /* GL_ATI_pn_triangles */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif +#endif /* GL_ATI_separate_stencil */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif /* GL_ATI_text_fragment_shader */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif /* GL_ATI_texture_env_combine3 */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif /* GL_ATI_texture_float */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif /* GL_ATI_texture_mirror_once */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const void *pointer, GLenum usage); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); +#endif +#endif /* GL_ATI_vertex_array_object */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); +#endif +#endif /* GL_ATI_vertex_attrib_array_object */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); +GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); +GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); +#endif +#endif /* GL_ATI_vertex_streams */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif /* GL_EXT_422_pixels */ + +#ifndef GL_EXT_EGL_image_storage +#define GL_EXT_EGL_image_storage 1 +typedef void *GLeglImageOES; +typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list); +typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list); +GLAPI void APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list); +#endif +#endif /* GL_EXT_EGL_image_storage */ + +#ifndef GL_EXT_EGL_sync +#define GL_EXT_EGL_sync 1 +#endif /* GL_EXT_EGL_sync */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#define GL_ABGR_EXT 0x8000 +#endif /* GL_EXT_abgr */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif /* GL_EXT_bgra */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); +#endif +#endif /* GL_EXT_bindable_uniform */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +#endif +#endif /* GL_EXT_blend_color */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); +#endif +#endif /* GL_EXT_blend_equation_separate */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif +#endif /* GL_EXT_blend_func_separate */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif /* GL_EXT_blend_logic_op */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_BLEND_EQUATION_EXT 0x8009 +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); +#endif +#endif /* GL_EXT_blend_minmax */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif /* GL_EXT_blend_subtract */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif /* GL_EXT_clip_volume_hint */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif /* GL_EXT_cmyka */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif +#endif /* GL_EXT_color_subtable */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif +#endif /* GL_EXT_compiled_vertex_array */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void *image); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +#endif +#endif /* GL_EXT_convolution */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); +GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); +GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); +GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_coordinate_frame */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif +#endif /* GL_EXT_copy_texture */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); +#endif +#endif /* GL_EXT_cull_vertex */ + +#ifndef GL_EXT_debug_label +#define GL_EXT_debug_label 1 +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 +typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); +typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); +GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif +#endif /* GL_EXT_debug_label */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 +typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); +GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); +GLAPI void APIENTRY glPopGroupMarkerEXT (void); +#endif +#endif /* GL_EXT_debug_marker */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); +#endif +#endif /* GL_EXT_depth_bounds_test */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F +typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void **data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, void *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, void *img); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void **params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void **params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void **param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void **param); +typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); +GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); +GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); +GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); +GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); +GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, void **data); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, void *img); +GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); +GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, void *img); +GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); +GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void *APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); +GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); +GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, void **params); +GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glEnableClientStateiEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glDisableClientStateiEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glGetFloati_vEXT (GLenum pname, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetDoublei_vEXT (GLenum pname, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetPointeri_vEXT (GLenum pname, GLuint index, void **params); +GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); +GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, void *string); +GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); +GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); +GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); +GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glVertexArrayVertexOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayEdgeFlagOffsetEXT (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayIndexOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayNormalOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayMultiTexCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayFogCoordOffsetEXT (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArraySecondaryColorOffsetEXT (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayVertexAttribOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glVertexArrayVertexAttribIOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glEnableVertexArrayEXT (GLuint vaobj, GLenum array); +GLAPI void APIENTRY glDisableVertexArrayEXT (GLuint vaobj, GLenum array); +GLAPI void APIENTRY glEnableVertexArrayAttribEXT (GLuint vaobj, GLuint index); +GLAPI void APIENTRY glDisableVertexArrayAttribEXT (GLuint vaobj, GLuint index); +GLAPI void APIENTRY glGetVertexArrayIntegervEXT (GLuint vaobj, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, void **param); +GLAPI void APIENTRY glGetVertexArrayIntegeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLint *param); +GLAPI void APIENTRY glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, void **param); +GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); +GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); +GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); +GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glTextureBufferRangeEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glTextureStorage2DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTextureStorage3DMultisampleEXT (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glVertexArrayBindVertexBufferEXT (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +GLAPI void APIENTRY glVertexArrayVertexAttribFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribIFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex); +GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor); +GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +GLAPI void APIENTRY glTexturePageCommitmentEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +GLAPI void APIENTRY glVertexArrayVertexAttribDivisorEXT (GLuint vaobj, GLuint index, GLuint divisor); +#endif +#endif /* GL_EXT_direct_state_access */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +#endif +#endif /* GL_EXT_draw_buffers2 */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#endif +#endif /* GL_EXT_draw_instanced */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +#endif +#endif /* GL_EXT_draw_range_elements */ + +#ifndef GL_EXT_external_buffer +#define GL_EXT_external_buffer 1 +typedef void *GLeglClientBufferEXT; +typedef void (APIENTRYP PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +GLAPI void APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +#endif +#endif /* GL_EXT_external_buffer */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_fog_coord */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif +#endif /* GL_EXT_framebuffer_blit */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +#endif /* GL_EXT_framebuffer_multisample */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); +#endif +#endif /* GL_EXT_framebuffer_object */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif /* GL_EXT_framebuffer_sRGB */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); +#endif +#endif /* GL_EXT_geometry_shader4 */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif +#endif /* GL_EXT_gpu_program_parameters */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_EXT 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_EXT 0x8905 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); +#endif +#endif /* GL_EXT_gpu_shader4 */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogramEXT (GLenum target); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); +#endif +#endif /* GL_EXT_histogram */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif /* GL_EXT_index_array_formats */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); +#endif +#endif /* GL_EXT_index_func */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); +#endif +#endif /* GL_EXT_index_material */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif /* GL_EXT_index_texture */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); +GLAPI void APIENTRY glTextureLightEXT (GLenum pname); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); +#endif +#endif /* GL_EXT_light_texture */ + +#ifndef GL_EXT_memory_object +#define GL_EXT_memory_object 1 +#define GL_TEXTURE_TILING_EXT 0x9580 +#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 +#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B +#define GL_NUM_TILING_TYPES_EXT 0x9582 +#define GL_TILING_TYPES_EXT 0x9583 +#define GL_OPTIMAL_TILING_EXT 0x9584 +#define GL_LINEAR_TILING_EXT 0x9585 +#define GL_NUM_DEVICE_UUIDS_EXT 0x9596 +#define GL_DEVICE_UUID_EXT 0x9597 +#define GL_DRIVER_UUID_EXT 0x9598 +#define GL_UUID_SIZE_EXT 16 +typedef void (APIENTRYP PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte *data); +typedef void (APIENTRYP PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte *data); +typedef void (APIENTRYP PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint *memoryObjects); +typedef GLboolean (APIENTRYP PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject); +typedef void (APIENTRYP PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint *memoryObjects); +typedef void (APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLTEXSTORAGEMEM1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLTEXTURESTORAGEMEM1DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUnsignedBytevEXT (GLenum pname, GLubyte *data); +GLAPI void APIENTRY glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte *data); +GLAPI void APIENTRY glDeleteMemoryObjectsEXT (GLsizei n, const GLuint *memoryObjects); +GLAPI GLboolean APIENTRY glIsMemoryObjectEXT (GLuint memoryObject); +GLAPI void APIENTRY glCreateMemoryObjectsEXT (GLsizei n, GLuint *memoryObjects); +GLAPI void APIENTRY glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint *params); +GLAPI void APIENTRY glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glTexStorageMem1DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glTextureStorageMem1DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset); +#endif +#endif /* GL_EXT_memory_object */ + +#ifndef GL_EXT_memory_object_fd +#define GL_EXT_memory_object_fd 1 +#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 +typedef void (APIENTRYP PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); +#endif +#endif /* GL_EXT_memory_object_fd */ + +#ifndef GL_EXT_memory_object_win32 +#define GL_EXT_memory_object_win32 1 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 +#define GL_DEVICE_LUID_EXT 0x9599 +#define GL_DEVICE_NODE_MASK_EXT 0x959A +#define GL_LUID_SIZE_EXT 8 +#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 +#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A +#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B +#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C +typedef void (APIENTRYP PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle); +typedef void (APIENTRYP PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle); +GLAPI void APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name); +#endif +#endif /* GL_EXT_memory_object_win32 */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif /* GL_EXT_misc_attribute */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +#endif +#endif /* GL_EXT_multi_draw_arrays */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); +#endif +#endif /* GL_EXT_multisample */ + +#ifndef GL_EXT_multiview_tessellation_geometry_shader +#define GL_EXT_multiview_tessellation_geometry_shader 1 +#endif /* GL_EXT_multiview_tessellation_geometry_shader */ + +#ifndef GL_EXT_multiview_texture_multisample +#define GL_EXT_multiview_texture_multisample 1 +#endif /* GL_EXT_multiview_texture_multisample */ + +#ifndef GL_EXT_multiview_timer_query +#define GL_EXT_multiview_timer_query 1 +#endif /* GL_EXT_multiview_timer_query */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif /* GL_EXT_packed_depth_stencil */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif /* GL_EXT_packed_float */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif /* GL_EXT_packed_pixels */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void *data); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +#endif +#endif /* GL_EXT_paletted_texture */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif /* GL_EXT_pixel_buffer_object */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTransformParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTransformParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +#endif +#endif /* GL_EXT_pixel_transform */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif /* GL_EXT_pixel_transform_color_table */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); +#endif +#endif /* GL_EXT_point_parameters */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); +#endif +#endif /* GL_EXT_polygon_offset */ + +#ifndef GL_EXT_polygon_offset_clamp +#define GL_EXT_polygon_offset_clamp 1 +#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B +typedef void (APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetClampEXT (GLfloat factor, GLfloat units, GLfloat clamp); +#endif +#endif /* GL_EXT_polygon_offset_clamp */ + +#ifndef GL_EXT_post_depth_coverage +#define GL_EXT_post_depth_coverage 1 +#endif /* GL_EXT_post_depth_coverage */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); +#endif +#endif /* GL_EXT_provoking_vertex */ + +#ifndef GL_EXT_raster_multisample +#define GL_EXT_raster_multisample 1 +#define GL_RASTER_MULTISAMPLE_EXT 0x9327 +#define GL_RASTER_SAMPLES_EXT 0x9328 +#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 +#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A +#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B +#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C +typedef void (APIENTRYP PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations); +#endif +#endif /* GL_EXT_raster_multisample */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif /* GL_EXT_rescale_normal */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_secondary_color */ + +#ifndef GL_EXT_semaphore +#define GL_EXT_semaphore 1 +#define GL_LAYOUT_GENERAL_EXT 0x958D +#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E +#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F +#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 +#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 +#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 +#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593 +#define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530 +#define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531 +typedef void (APIENTRYP PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores); +typedef void (APIENTRYP PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores); +typedef GLboolean (APIENTRYP PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore); +typedef void (APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params); +typedef void (APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params); +typedef void (APIENTRYP PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); +typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenSemaphoresEXT (GLsizei n, GLuint *semaphores); +GLAPI void APIENTRY glDeleteSemaphoresEXT (GLsizei n, const GLuint *semaphores); +GLAPI GLboolean APIENTRY glIsSemaphoreEXT (GLuint semaphore); +GLAPI void APIENTRY glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64 *params); +GLAPI void APIENTRY glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64 *params); +GLAPI void APIENTRY glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); +GLAPI void APIENTRY glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); +#endif +#endif /* GL_EXT_semaphore */ + +#ifndef GL_EXT_semaphore_fd +#define GL_EXT_semaphore_fd 1 +typedef void (APIENTRYP PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd); +#endif +#endif /* GL_EXT_semaphore_fd */ + +#ifndef GL_EXT_semaphore_win32 +#define GL_EXT_semaphore_win32 1 +#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 +#define GL_D3D12_FENCE_VALUE_EXT 0x9595 +typedef void (APIENTRYP PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle); +typedef void (APIENTRYP PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle); +GLAPI void APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name); +#endif +#endif /* GL_EXT_semaphore_win32 */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D +typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); +typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); +GLAPI void APIENTRY glActiveProgramEXT (GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); +#endif +#endif /* GL_EXT_separate_shader_objects */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif /* GL_EXT_separate_specular_color */ + +#ifndef GL_EXT_shader_framebuffer_fetch +#define GL_EXT_shader_framebuffer_fetch 1 +#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 +#endif /* GL_EXT_shader_framebuffer_fetch */ + +#ifndef GL_EXT_shader_framebuffer_fetch_non_coherent +#define GL_EXT_shader_framebuffer_fetch_non_coherent 1 +typedef void (APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferFetchBarrierEXT (void); +#endif +#endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */ + +#ifndef GL_EXT_shader_image_load_formatted +#define GL_EXT_shader_image_load_formatted 1 +#endif /* GL_EXT_shader_image_load_formatted */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); +#endif +#endif /* GL_EXT_shader_image_load_store */ + +#ifndef GL_EXT_shader_integer_mix +#define GL_EXT_shader_integer_mix 1 +#endif /* GL_EXT_shader_integer_mix */ + +#ifndef GL_EXT_shader_samples_identical +#define GL_EXT_shader_samples_identical 1 +#endif /* GL_EXT_shader_samples_identical */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif /* GL_EXT_shadow_funcs */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif /* GL_EXT_shared_texture_palette */ + +#ifndef GL_EXT_sparse_texture2 +#define GL_EXT_sparse_texture2 1 +#endif /* GL_EXT_sparse_texture2 */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif +#endif /* GL_EXT_stencil_clear_tag */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); +#endif +#endif /* GL_EXT_stencil_two_side */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif /* GL_EXT_stencil_wrap */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +#endif +#endif /* GL_EXT_subtexture */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif /* GL_EXT_texture */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +#endif +#endif /* GL_EXT_texture3D */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif +#endif /* GL_EXT_texture_array */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); +#endif +#endif /* GL_EXT_texture_buffer_object */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif /* GL_EXT_texture_compression_latc */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif /* GL_EXT_texture_compression_rgtc */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif /* GL_EXT_texture_compression_s3tc */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif /* GL_EXT_texture_cube_map */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif /* GL_EXT_texture_env_add */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif /* GL_EXT_texture_env_combine */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif /* GL_EXT_texture_env_dot3 */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif /* GL_EXT_texture_filter_anisotropic */ + +#ifndef GL_EXT_texture_filter_minmax +#define GL_EXT_texture_filter_minmax 1 +#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 +#define GL_WEIGHTED_AVERAGE_EXT 0x9367 +#endif /* GL_EXT_texture_filter_minmax */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif +#endif /* GL_EXT_texture_integer */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif /* GL_EXT_texture_lod_bias */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif /* GL_EXT_texture_mirror_clamp */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif +#endif /* GL_EXT_texture_object */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); +#endif +#endif /* GL_EXT_texture_perturb_normal */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif /* GL_EXT_texture_sRGB */ + +#ifndef GL_EXT_texture_sRGB_R8 +#define GL_EXT_texture_sRGB_R8 1 +#define GL_SR8_EXT 0x8FBD +#endif /* GL_EXT_texture_sRGB_R8 */ + +#ifndef GL_EXT_texture_sRGB_RG8 +#define GL_EXT_texture_sRGB_RG8 1 +#define GL_SRG8_EXT 0x8FBE +#endif /* GL_EXT_texture_sRGB_RG8 */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A +#endif /* GL_EXT_texture_sRGB_decode */ + +#ifndef GL_EXT_texture_shadow_lod +#define GL_EXT_texture_shadow_lod 1 +#endif /* GL_EXT_texture_shadow_lod */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif /* GL_EXT_texture_shared_exponent */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#endif /* GL_EXT_texture_snorm */ + +#ifndef GL_EXT_texture_storage +#define GL_EXT_texture_storage 1 +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_BGRA8_EXT 0x93A1 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#define GL_R32F_EXT 0x822E +#define GL_RG32F_EXT 0x8230 +#define GL_R16F_EXT 0x822D +#define GL_RG16F_EXT 0x822F +typedef void (APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GLAPI void APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#endif +#endif /* GL_EXT_texture_storage */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#endif /* GL_EXT_texture_swizzle */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#define GL_TIME_ELAPSED_EXT 0x88BF +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); +#endif +#endif /* GL_EXT_timer_query */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackEXT (void); +GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif +#endif /* GL_EXT_transform_feedback */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, void **params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint i); +GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); +GLAPI void APIENTRY glGetPointervEXT (GLenum pname, void **params); +GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +#endif +#endif /* GL_EXT_vertex_array */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 +#endif /* GL_EXT_vertex_array_bgra */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); +#endif +#endif /* GL_EXT_vertex_attrib_64bit */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); +GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); +GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const void *addr); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const void *addr); +GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); +GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); +GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); +GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); +GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); +GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); +GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); +GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); +GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const void *addr); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, void **data); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +#endif +#endif /* GL_EXT_vertex_shader */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); +#endif +#endif /* GL_EXT_vertex_weighting */ + +#ifndef GL_EXT_win32_keyed_mutex +#define GL_EXT_win32_keyed_mutex 1 +typedef GLboolean (APIENTRYP PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout); +typedef GLboolean (APIENTRYP PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAcquireKeyedMutexWin32EXT (GLuint memory, GLuint64 key, GLuint timeout); +GLAPI GLboolean APIENTRY glReleaseKeyedMutexWin32EXT (GLuint memory, GLuint64 key); +#endif +#endif /* GL_EXT_win32_keyed_mutex */ + +#ifndef GL_EXT_window_rectangles +#define GL_EXT_window_rectangles 1 +#define GL_INCLUSIVE_EXT 0x8F10 +#define GL_EXCLUSIVE_EXT 0x8F11 +#define GL_WINDOW_RECTANGLE_EXT 0x8F12 +#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 +#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 +#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 +typedef void (APIENTRYP PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint *box); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowRectanglesEXT (GLenum mode, GLsizei count, const GLint *box); +#endif +#endif /* GL_EXT_window_rectangles */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 +#define GL_SYNC_X11_FENCE_EXT 0x90E1 +typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); +#endif +#endif /* GL_EXT_x11_sync_object */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); +#endif +#endif /* GL_GREMEDY_frame_terminator */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const void *string); +#endif +#endif /* GL_GREMEDY_string_marker */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif /* GL_HP_convolution_border_modes */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); +#endif +#endif /* GL_HP_image_transform */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif /* GL_HP_occlusion_test */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif /* GL_HP_texture_lighting */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#define GL_CULL_VERTEX_IBM 103050 +#endif /* GL_IBM_cull_vertex */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); +#endif +#endif /* GL_IBM_multimode_draw_arrays */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif /* GL_IBM_rasterpos_clip */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 +typedef void (APIENTRYP PFNGLFLUSHSTATICDATAIBMPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushStaticDataIBM (GLenum target); +#endif +#endif /* GL_IBM_static_data */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif /* GL_IBM_texture_mirrored_repeat */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean **pointer, GLint ptrstride); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +#endif +#endif /* GL_IBM_vertex_array_lists */ + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif +#endif /* GL_INGR_blend_func_separate */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif /* GL_INGR_color_clamp */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#define GL_INTERLACE_READ_INGR 0x8568 +#endif /* GL_INGR_interlace_read */ + +#ifndef GL_INTEL_blackhole_render +#define GL_INTEL_blackhole_render 1 +#define GL_BLACKHOLE_RENDER_INTEL 0x83FC +#endif /* GL_INTEL_blackhole_render */ + +#ifndef GL_INTEL_conservative_rasterization +#define GL_INTEL_conservative_rasterization 1 +#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE +#endif /* GL_INTEL_conservative_rasterization */ + +#ifndef GL_INTEL_fragment_shader_ordering +#define GL_INTEL_fragment_shader_ordering 1 +#endif /* GL_INTEL_fragment_shader_ordering */ + +#ifndef GL_INTEL_framebuffer_CMAA +#define GL_INTEL_framebuffer_CMAA 1 +typedef void (APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyFramebufferAttachmentCMAAINTEL (void); +#endif +#endif /* GL_INTEL_framebuffer_CMAA */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); +typedef void *(APIENTRYP PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSyncTextureINTEL (GLuint texture); +GLAPI void APIENTRY glUnmapTexture2DINTEL (GLuint texture, GLint level); +GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); +#endif +#endif /* GL_INTEL_map_texture */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void **pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const void **pointer); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const void **pointer); +GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const void **pointer); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void **pointer); +#endif +#endif /* GL_INTEL_parallel_arrays */ + +#ifndef GL_INTEL_performance_query +#define GL_INTEL_performance_query 1 +#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 +#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 +#define GL_PERFQUERY_WAIT_INTEL 0x83FB +#define GL_PERFQUERY_FLUSH_INTEL 0x83FA +#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 +#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 +#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 +#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 +#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 +#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 +#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 +#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 +#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 +#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA +#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB +#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC +#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD +#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE +#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF +#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 +typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); +typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); +typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); +typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); +typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); +typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); +GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); +GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); +GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); +GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); +GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); +GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); +#endif +#endif /* GL_INTEL_performance_query */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif /* GL_MESAX_texture_stack */ + +#ifndef GL_MESA_framebuffer_flip_x +#define GL_MESA_framebuffer_flip_x 1 +#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC +#endif /* GL_MESA_framebuffer_flip_x */ + +#ifndef GL_MESA_framebuffer_flip_y +#define GL_MESA_framebuffer_flip_y 1 +#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB +typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params); +#endif +#endif /* GL_MESA_framebuffer_flip_y */ + +#ifndef GL_MESA_framebuffer_swap_xy +#define GL_MESA_framebuffer_swap_xy 1 +#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD +#endif /* GL_MESA_framebuffer_swap_xy */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#define GL_PACK_INVERT_MESA 0x8758 +#endif /* GL_MESA_pack_invert */ + +#ifndef GL_MESA_program_binary_formats +#define GL_MESA_program_binary_formats 1 +#define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F +#endif /* GL_MESA_program_binary_formats */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif +#endif /* GL_MESA_resize_buffers */ + +#ifndef GL_MESA_shader_integer_functions +#define GL_MESA_shader_integer_functions 1 +#endif /* GL_MESA_shader_integer_functions */ + +#ifndef GL_MESA_tile_raster_order +#define GL_MESA_tile_raster_order 1 +#define GL_TILE_RASTER_ORDER_FIXED_MESA 0x8BB8 +#define GL_TILE_RASTER_ORDER_INCREASING_X_MESA 0x8BB9 +#define GL_TILE_RASTER_ORDER_INCREASING_Y_MESA 0x8BBA +#endif /* GL_MESA_tile_raster_order */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); +#endif +#endif /* GL_MESA_window_pos */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif /* GL_MESA_ycbcr_texture */ + +#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers +#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1 +#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVXPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNVX (GLuint id); +GLAPI void APIENTRY glEndConditionalRenderNVX (void); +#endif +#endif /* GL_NVX_conditional_render */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B +#endif /* GL_NVX_gpu_memory_info */ + +#ifndef GL_NVX_gpu_multicast2 +#define GL_NVX_gpu_multicast2 1 +#define GL_UPLOAD_GPU_MASK_NVX 0x954A +typedef void (APIENTRYP PFNGLUPLOADGPUMASKNVXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTICASTVIEWPORTPOSITIONWSCALENVXPROC) (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); +typedef void (APIENTRYP PFNGLMULTICASTSCISSORARRAYVNVXPROC) (GLuint gpu, GLuint first, GLsizei count, const GLint *v); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYBUFFERSUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +typedef GLuint (APIENTRYP PFNGLASYNCCOPYIMAGESUBDATANVXPROC) (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUploadGpuMaskNVX (GLbitfield mask); +GLAPI void APIENTRY glMulticastViewportArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glMulticastViewportPositionWScaleNVX (GLuint gpu, GLuint index, GLfloat xcoeff, GLfloat ycoeff); +GLAPI void APIENTRY glMulticastScissorArrayvNVX (GLuint gpu, GLuint first, GLsizei count, const GLint *v); +GLAPI GLuint APIENTRY glAsyncCopyBufferSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *fenceValueArray, GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +GLAPI GLuint APIENTRY glAsyncCopyImageSubDataNVX (GLsizei waitSemaphoreCount, const GLuint *waitSemaphoreArray, const GLuint64 *waitValueArray, GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth, GLsizei signalSemaphoreCount, const GLuint *signalSemaphoreArray, const GLuint64 *signalValueArray); +#endif +#endif /* GL_NVX_gpu_multicast2 */ + +#ifndef GL_NVX_linked_gpu_multicast +#define GL_NVX_linked_gpu_multicast 1 +#define GL_LGPU_SEPARATE_STORAGE_BIT_NVX 0x0800 +#define GL_MAX_LGPU_GPUS_NVX 0x92BA +typedef void (APIENTRYP PFNGLLGPUNAMEDBUFFERSUBDATANVXPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLLGPUCOPYIMAGESUBDATANVXPROC) (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +typedef void (APIENTRYP PFNGLLGPUINTERLOCKNVXPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLGPUNamedBufferSubDataNVX (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glLGPUCopyImageSubDataNVX (GLuint sourceGpu, GLbitfield destinationGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srxY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +GLAPI void APIENTRY glLGPUInterlockNVX (void); +#endif +#endif /* GL_NVX_linked_gpu_multicast */ + +#ifndef GL_NVX_progress_fence +#define GL_NVX_progress_fence 1 +typedef GLuint (APIENTRYP PFNGLCREATEPROGRESSFENCENVXPROC) (void); +typedef void (APIENTRYP PFNGLSIGNALSEMAPHOREUI64NVXPROC) (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLWAITSEMAPHOREUI64NVXPROC) (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +typedef void (APIENTRYP PFNGLCLIENTWAITSEMAPHOREUI64NVXPROC) (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glCreateProgressFenceNVX (void); +GLAPI void APIENTRY glSignalSemaphoreui64NVX (GLuint signalGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glWaitSemaphoreui64NVX (GLuint waitGpu, GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +GLAPI void APIENTRY glClientWaitSemaphoreui64NVX (GLsizei fenceObjectCount, const GLuint *semaphoreArray, const GLuint64 *fenceValueArray); +#endif +#endif /* GL_NVX_progress_fence */ + +#ifndef GL_NV_alpha_to_coverage_dither_control +#define GL_NV_alpha_to_coverage_dither_control 1 +#define GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV 0x934D +#define GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV 0x934E +#define GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV 0x934F +#define GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV 0x92BF +typedef void (APIENTRYP PFNGLALPHATOCOVERAGEDITHERCONTROLNVPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAlphaToCoverageDitherControlNV (GLenum mode); +#endif +#endif /* GL_NV_alpha_to_coverage_dither_control */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +#endif +#endif /* GL_NV_bindless_multi_draw_indirect */ + +#ifndef GL_NV_bindless_multi_draw_indirect_count +#define GL_NV_bindless_multi_draw_indirect_count 1 +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessCountNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessCountNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); +#endif +#endif /* GL_NV_bindless_multi_draw_indirect_count */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 +typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef GLuint64 (APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture); +GLAPI GLuint64 APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); +GLAPI void APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); +GLAPI void APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); +GLAPI GLuint64 APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +GLAPI void APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); +GLAPI void APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); +GLAPI void APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); +GLAPI void APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); +GLAPI void APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); +GLAPI void APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +GLAPI GLboolean APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); +GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); +#endif +#endif /* GL_NV_bindless_texture */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLUE_NV 0x1905 +#define GL_COLORBURN_NV 0x929A +#define GL_COLORDODGE_NV 0x9299 +#define GL_CONJOINT_NV 0x9284 +#define GL_CONTRAST_NV 0x92A1 +#define GL_DARKEN_NV 0x9297 +#define GL_DIFFERENCE_NV 0x929E +#define GL_DISJOINT_NV 0x9283 +#define GL_DST_ATOP_NV 0x928F +#define GL_DST_IN_NV 0x928B +#define GL_DST_NV 0x9287 +#define GL_DST_OUT_NV 0x928D +#define GL_DST_OVER_NV 0x9289 +#define GL_EXCLUSION_NV 0x92A0 +#define GL_GREEN_NV 0x1904 +#define GL_HARDLIGHT_NV 0x929B +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_INVERT_OVG_NV 0x92B4 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LIGHTEN_NV 0x9298 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_MINUS_NV 0x929F +#define GL_MULTIPLY_NV 0x9294 +#define GL_OVERLAY_NV 0x9296 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_PLUS_NV 0x9291 +#define GL_RED_NV 0x1903 +#define GL_SCREEN_NV 0x9295 +#define GL_SOFTLIGHT_NV 0x929C +#define GL_SRC_ATOP_NV 0x928E +#define GL_SRC_IN_NV 0x928A +#define GL_SRC_NV 0x9286 +#define GL_SRC_OUT_NV 0x928C +#define GL_SRC_OVER_NV 0x9288 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_XOR_NV 0x1506 +typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendParameteriNV (GLenum pname, GLint value); +GLAPI void APIENTRY glBlendBarrierNV (void); +#endif +#endif /* GL_NV_blend_equation_advanced */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#endif /* GL_NV_blend_equation_advanced_coherent */ + +#ifndef GL_NV_blend_minmax_factor +#define GL_NV_blend_minmax_factor 1 +#endif /* GL_NV_blend_minmax_factor */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif /* GL_NV_blend_square */ + +#ifndef GL_NV_clip_space_w_scaling +#define GL_NV_clip_space_w_scaling 1 +#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C +#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D +#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E +typedef void (APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff); +#endif +#endif /* GL_NV_clip_space_w_scaling */ + +#ifndef GL_NV_command_list +#define GL_NV_command_list 1 +#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000 +#define GL_NOP_COMMAND_NV 0x0001 +#define GL_DRAW_ELEMENTS_COMMAND_NV 0x0002 +#define GL_DRAW_ARRAYS_COMMAND_NV 0x0003 +#define GL_DRAW_ELEMENTS_STRIP_COMMAND_NV 0x0004 +#define GL_DRAW_ARRAYS_STRIP_COMMAND_NV 0x0005 +#define GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV 0x0006 +#define GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV 0x0007 +#define GL_ELEMENT_ADDRESS_COMMAND_NV 0x0008 +#define GL_ATTRIBUTE_ADDRESS_COMMAND_NV 0x0009 +#define GL_UNIFORM_ADDRESS_COMMAND_NV 0x000A +#define GL_BLEND_COLOR_COMMAND_NV 0x000B +#define GL_STENCIL_REF_COMMAND_NV 0x000C +#define GL_LINE_WIDTH_COMMAND_NV 0x000D +#define GL_POLYGON_OFFSET_COMMAND_NV 0x000E +#define GL_ALPHA_REF_COMMAND_NV 0x000F +#define GL_VIEWPORT_COMMAND_NV 0x0010 +#define GL_SCISSOR_COMMAND_NV 0x0011 +#define GL_FRONT_FACE_COMMAND_NV 0x0012 +typedef void (APIENTRYP PFNGLCREATESTATESNVPROC) (GLsizei n, GLuint *states); +typedef void (APIENTRYP PFNGLDELETESTATESNVPROC) (GLsizei n, const GLuint *states); +typedef GLboolean (APIENTRYP PFNGLISSTATENVPROC) (GLuint state); +typedef void (APIENTRYP PFNGLSTATECAPTURENVPROC) (GLuint state, GLenum mode); +typedef GLuint (APIENTRYP PFNGLGETCOMMANDHEADERNVPROC) (GLenum tokenID, GLuint size); +typedef GLushort (APIENTRYP PFNGLGETSTAGEINDEXNVPROC) (GLenum shadertype); +typedef void (APIENTRYP PFNGLDRAWCOMMANDSNVPROC) (GLenum primitiveMode, GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, GLuint count); +typedef void (APIENTRYP PFNGLDRAWCOMMANDSADDRESSNVPROC) (GLenum primitiveMode, const GLuint64 *indirects, const GLsizei *sizes, GLuint count); +typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESNVPROC) (GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +typedef void (APIENTRYP PFNGLDRAWCOMMANDSSTATESADDRESSNVPROC) (const GLuint64 *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +typedef void (APIENTRYP PFNGLCREATECOMMANDLISTSNVPROC) (GLsizei n, GLuint *lists); +typedef void (APIENTRYP PFNGLDELETECOMMANDLISTSNVPROC) (GLsizei n, const GLuint *lists); +typedef GLboolean (APIENTRYP PFNGLISCOMMANDLISTNVPROC) (GLuint list); +typedef void (APIENTRYP PFNGLLISTDRAWCOMMANDSSTATESCLIENTNVPROC) (GLuint list, GLuint segment, const void **indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +typedef void (APIENTRYP PFNGLCOMMANDLISTSEGMENTSNVPROC) (GLuint list, GLuint segments); +typedef void (APIENTRYP PFNGLCOMPILECOMMANDLISTNVPROC) (GLuint list); +typedef void (APIENTRYP PFNGLCALLCOMMANDLISTNVPROC) (GLuint list); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCreateStatesNV (GLsizei n, GLuint *states); +GLAPI void APIENTRY glDeleteStatesNV (GLsizei n, const GLuint *states); +GLAPI GLboolean APIENTRY glIsStateNV (GLuint state); +GLAPI void APIENTRY glStateCaptureNV (GLuint state, GLenum mode); +GLAPI GLuint APIENTRY glGetCommandHeaderNV (GLenum tokenID, GLuint size); +GLAPI GLushort APIENTRY glGetStageIndexNV (GLenum shadertype); +GLAPI void APIENTRY glDrawCommandsNV (GLenum primitiveMode, GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, GLuint count); +GLAPI void APIENTRY glDrawCommandsAddressNV (GLenum primitiveMode, const GLuint64 *indirects, const GLsizei *sizes, GLuint count); +GLAPI void APIENTRY glDrawCommandsStatesNV (GLuint buffer, const GLintptr *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +GLAPI void APIENTRY glDrawCommandsStatesAddressNV (const GLuint64 *indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +GLAPI void APIENTRY glCreateCommandListsNV (GLsizei n, GLuint *lists); +GLAPI void APIENTRY glDeleteCommandListsNV (GLsizei n, const GLuint *lists); +GLAPI GLboolean APIENTRY glIsCommandListNV (GLuint list); +GLAPI void APIENTRY glListDrawCommandsStatesClientNV (GLuint list, GLuint segment, const void **indirects, const GLsizei *sizes, const GLuint *states, const GLuint *fbos, GLuint count); +GLAPI void APIENTRY glCommandListSegmentsNV (GLuint list, GLuint segments); +GLAPI void APIENTRY glCompileCommandListNV (GLuint list); +GLAPI void APIENTRY glCallCommandListNV (GLuint list); +#endif +#endif /* GL_NV_command_list */ + +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC +#endif /* GL_NV_compute_program5 */ + +#ifndef GL_NV_compute_shader_derivatives +#define GL_NV_compute_shader_derivatives 1 +#endif /* GL_NV_compute_shader_derivatives */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRenderNV (void); +#endif +#endif /* GL_NV_conditional_render */ + +#ifndef GL_NV_conservative_raster +#define GL_NV_conservative_raster 1 +#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 +#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 +#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 +#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 +typedef void (APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits); +#endif +#endif /* GL_NV_conservative_raster */ + +#ifndef GL_NV_conservative_raster_dilate +#define GL_NV_conservative_raster_dilate 1 +#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 +#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A +#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B +typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConservativeRasterParameterfNV (GLenum pname, GLfloat value); +#endif +#endif /* GL_NV_conservative_raster_dilate */ + +#ifndef GL_NV_conservative_raster_pre_snap +#define GL_NV_conservative_raster_pre_snap 1 +#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV 0x9550 +#endif /* GL_NV_conservative_raster_pre_snap */ + +#ifndef GL_NV_conservative_raster_pre_snap_triangles +#define GL_NV_conservative_raster_pre_snap_triangles 1 +#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D +#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E +#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F +typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param); +#endif +#endif /* GL_NV_conservative_raster_pre_snap_triangles */ + +#ifndef GL_NV_conservative_raster_underestimation +#define GL_NV_conservative_raster_underestimation 1 +#endif /* GL_NV_conservative_raster_underestimation */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif /* GL_NV_copy_depth_to_color */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif +#endif /* GL_NV_copy_image */ + +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 +#endif /* GL_NV_deep_texture3D */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); +#endif +#endif /* GL_NV_depth_buffer_float */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#define GL_DEPTH_CLAMP_NV 0x864F +#endif /* GL_NV_depth_clamp */ + +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 +typedef void (APIENTRYP PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +#endif +#endif /* GL_NV_draw_texture */ + +#ifndef GL_NV_draw_vulkan_image +#define GL_NV_draw_vulkan_image 1 +typedef void (APIENTRY *GLVULKANPROCNV)(void); +typedef void (APIENTRYP PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +typedef GLVULKANPROCNV (APIENTRYP PFNGLGETVKPROCADDRNVPROC) (const GLchar *name); +typedef void (APIENTRYP PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); +typedef void (APIENTRYP PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); +typedef void (APIENTRYP PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawVkImageNV (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +GLAPI GLVULKANPROCNV APIENTRY glGetVkProcAddrNV (const GLchar *name); +GLAPI void APIENTRY glWaitVkSemaphoreNV (GLuint64 vkSemaphore); +GLAPI void APIENTRY glSignalVkSemaphoreNV (GLuint64 vkSemaphore); +GLAPI void APIENTRY glSignalVkFenceNV (GLuint64 vkFence); +#endif +#endif /* GL_NV_draw_vulkan_image */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); +GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); +#endif +#endif /* GL_NV_evaluators */ + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); +GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); +#endif +#endif /* GL_NV_explicit_multisample */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); +GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GLAPI void APIENTRY glFinishFenceNV (GLuint fence); +GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); +#endif +#endif /* GL_NV_fence */ + +#ifndef GL_NV_fill_rectangle +#define GL_NV_fill_rectangle 1 +#define GL_FILL_RECTANGLE_NV 0x933C +#endif /* GL_NV_fill_rectangle */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif /* GL_NV_float_buffer */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +#endif /* GL_NV_fog_distance */ + +#ifndef GL_NV_fragment_coverage_to_color +#define GL_NV_fragment_coverage_to_color 1 +#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD +#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE +typedef void (APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentCoverageColorNV (GLuint color); +#endif +#endif /* GL_NV_fragment_coverage_to_color */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif +#endif /* GL_NV_fragment_program */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif /* GL_NV_fragment_program2 */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#endif /* GL_NV_fragment_program4 */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif /* GL_NV_fragment_program_option */ + +#ifndef GL_NV_fragment_shader_barycentric +#define GL_NV_fragment_shader_barycentric 1 +#endif /* GL_NV_fragment_shader_barycentric */ + +#ifndef GL_NV_fragment_shader_interlock +#define GL_NV_fragment_shader_interlock 1 +#endif /* GL_NV_fragment_shader_interlock */ + +#ifndef GL_NV_framebuffer_mixed_samples +#define GL_NV_framebuffer_mixed_samples 1 +#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 +#define GL_COLOR_SAMPLES_NV 0x8E20 +#define GL_DEPTH_SAMPLES_NV 0x932D +#define GL_STENCIL_SAMPLES_NV 0x932E +#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F +#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 +typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v); +typedef void (APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v); +typedef void (APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v); +GLAPI void APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v); +GLAPI void APIENTRY glCoverageModulationNV (GLenum components); +#endif +#endif /* GL_NV_framebuffer_mixed_samples */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +#endif /* GL_NV_framebuffer_multisample_coverage */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif +#endif /* GL_NV_geometry_program4 */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#endif /* GL_NV_geometry_shader4 */ + +#ifndef GL_NV_geometry_shader_passthrough +#define GL_NV_geometry_shader_passthrough 1 +#endif /* GL_NV_geometry_shader_passthrough */ + +#ifndef GL_NV_gpu_multicast +#define GL_NV_gpu_multicast 1 +#define GL_PER_GPU_STORAGE_BIT_NV 0x0800 +#define GL_MULTICAST_GPUS_NV 0x92BA +#define GL_RENDER_GPU_MASK_NV 0x9558 +#define GL_PER_GPU_STORAGE_NV 0x9548 +#define GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9549 +typedef void (APIENTRYP PFNGLRENDERGPUMASKNVPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLMULTICASTBUFFERSUBDATANVPROC) (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLMULTICASTCOPYBUFFERSUBDATANVPROC) (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLMULTICASTCOPYIMAGESUBDATANVPROC) (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (APIENTRYP PFNGLMULTICASTBLITFRAMEBUFFERNVPROC) (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLMULTICASTFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTICASTBARRIERNVPROC) (void); +typedef void (APIENTRYP PFNGLMULTICASTWAITSYNCNVPROC) (GLuint signalGpu, GLbitfield waitGpuMask); +typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUIVNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLMULTICASTGETQUERYOBJECTUI64VNVPROC) (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderGpuMaskNV (GLbitfield mask); +GLAPI void APIENTRY glMulticastBufferSubDataNV (GLbitfield gpuMask, GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glMulticastCopyBufferSubDataNV (GLuint readGpu, GLbitfield writeGpuMask, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glMulticastCopyImageSubDataNV (GLuint srcGpu, GLbitfield dstGpuMask, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +GLAPI void APIENTRY glMulticastBlitFramebufferNV (GLuint srcGpu, GLuint dstGpu, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glMulticastFramebufferSampleLocationsfvNV (GLuint gpu, GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glMulticastBarrierNV (void); +GLAPI void APIENTRY glMulticastWaitSyncNV (GLuint signalGpu, GLbitfield waitGpuMask); +GLAPI void APIENTRY glMulticastGetQueryObjectivNV (GLuint gpu, GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glMulticastGetQueryObjectuivNV (GLuint gpu, GLuint id, GLenum pname, GLuint *params); +GLAPI void APIENTRY glMulticastGetQueryObjecti64vNV (GLuint gpu, GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glMulticastGetQueryObjectui64vNV (GLuint gpu, GLuint id, GLenum pname, GLuint64 *params); +#endif +#endif /* GL_NV_gpu_multicast */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); +#endif +#endif /* GL_NV_gpu_program4 */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F +#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 +#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 +typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); +#endif +#endif /* GL_NV_gpu_program5 */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 +#endif /* GL_NV_gpu_program5_mem_extended */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 +#endif /* GL_NV_gpu_shader5 */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +typedef unsigned short GLhalfNV; +#define GL_HALF_FLOAT_NV 0x140B +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +#endif +#endif /* GL_NV_half_float */ + +#ifndef GL_NV_internalformat_sample_query +#define GL_NV_internalformat_sample_query 1 +#define GL_MULTISAMPLES_NV 0x9371 +#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 +#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 +#define GL_CONFORMANT_NV 0x9374 +typedef void (APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); +#endif +#endif /* GL_NV_internalformat_sample_query */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif /* GL_NV_light_max_exponent */ + +#ifndef GL_NV_memory_attachment +#define GL_NV_memory_attachment 1 +#define GL_ATTACHED_MEMORY_OBJECT_NV 0x95A4 +#define GL_ATTACHED_MEMORY_OFFSET_NV 0x95A5 +#define GL_MEMORY_ATTACHABLE_ALIGNMENT_NV 0x95A6 +#define GL_MEMORY_ATTACHABLE_SIZE_NV 0x95A7 +#define GL_MEMORY_ATTACHABLE_NV 0x95A8 +#define GL_DETACHED_MEMORY_INCARNATION_NV 0x95A9 +#define GL_DETACHED_TEXTURES_NV 0x95AA +#define GL_DETACHED_BUFFERS_NV 0x95AB +#define GL_MAX_DETACHED_TEXTURES_NV 0x95AC +#define GL_MAX_DETACHED_BUFFERS_NV 0x95AD +typedef void (APIENTRYP PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC) (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); +typedef void (APIENTRYP PFNGLRESETMEMORYOBJECTPARAMETERNVPROC) (GLuint memory, GLenum pname); +typedef void (APIENTRYP PFNGLTEXATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLBUFFERATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLTEXTUREATTACHMEMORYNVPROC) (GLuint texture, GLuint memory, GLuint64 offset); +typedef void (APIENTRYP PFNGLNAMEDBUFFERATTACHMEMORYNVPROC) (GLuint buffer, GLuint memory, GLuint64 offset); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetMemoryObjectDetachedResourcesuivNV (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); +GLAPI void APIENTRY glResetMemoryObjectParameterNV (GLuint memory, GLenum pname); +GLAPI void APIENTRY glTexAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glBufferAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glTextureAttachMemoryNV (GLuint texture, GLuint memory, GLuint64 offset); +GLAPI void APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, GLuint64 offset); +#endif +#endif /* GL_NV_memory_attachment */ + +#ifndef GL_NV_memory_object_sparse +#define GL_NV_memory_object_sparse 1 +typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +typedef void (APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +GLAPI void APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +GLAPI void APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +GLAPI void APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +#endif +#endif /* GL_NV_memory_object_sparse */ + +#ifndef GL_NV_mesh_shader +#define GL_NV_mesh_shader 1 +#define GL_MESH_SHADER_NV 0x9559 +#define GL_TASK_SHADER_NV 0x955A +#define GL_MAX_MESH_UNIFORM_BLOCKS_NV 0x8E60 +#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61 +#define GL_MAX_MESH_IMAGE_UNIFORMS_NV 0x8E62 +#define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63 +#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64 +#define GL_MAX_MESH_ATOMIC_COUNTERS_NV 0x8E65 +#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66 +#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67 +#define GL_MAX_TASK_UNIFORM_BLOCKS_NV 0x8E68 +#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69 +#define GL_MAX_TASK_IMAGE_UNIFORMS_NV 0x8E6A +#define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B +#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C +#define GL_MAX_TASK_ATOMIC_COUNTERS_NV 0x8E6D +#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E +#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F +#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2 +#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3 +#define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV 0x9536 +#define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV 0x9537 +#define GL_MAX_MESH_OUTPUT_VERTICES_NV 0x9538 +#define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV 0x9539 +#define GL_MAX_TASK_OUTPUT_COUNT_NV 0x953A +#define GL_MAX_DRAW_MESH_TASKS_COUNT_NV 0x953D +#define GL_MAX_MESH_VIEWS_NV 0x9557 +#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF +#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543 +#define GL_MAX_MESH_WORK_GROUP_SIZE_NV 0x953B +#define GL_MAX_TASK_WORK_GROUP_SIZE_NV 0x953C +#define GL_MESH_WORK_GROUP_SIZE_NV 0x953E +#define GL_TASK_WORK_GROUP_SIZE_NV 0x953F +#define GL_MESH_VERTICES_OUT_NV 0x9579 +#define GL_MESH_PRIMITIVES_OUT_NV 0x957A +#define GL_MESH_OUTPUT_TYPE_NV 0x957B +#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D +#define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0 +#define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1 +#define GL_MESH_SHADER_BIT_NV 0x00000040 +#define GL_TASK_SHADER_BIT_NV 0x00000080 +#define GL_MESH_SUBROUTINE_NV 0x957C +#define GL_TASK_SUBROUTINE_NV 0x957D +#define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E +#define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F +typedef void (APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count); +typedef void (APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect); +typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count); +GLAPI void APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect); +GLAPI void APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#endif +#endif /* GL_NV_mesh_shader */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 +#endif /* GL_NV_multisample_coverage */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif /* GL_NV_multisample_filter_hint */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); +#endif +#endif /* GL_NV_occlusion_query */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif /* GL_NV_packed_depth_stencil */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint bindingIndex, GLuint wordIndex, GLsizei count, const GLuint *params); +#endif +#endif /* GL_NV_parameter_buffer_object */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 +#endif /* GL_NV_parameter_buffer_object2 */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_CLOSE_PATH_NV 0x00 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_BOLD_BIT_NV 0x01 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 +#define GL_ROUNDED_RECT_NV 0xE8 +#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 +#define GL_ROUNDED_RECT2_NV 0xEA +#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB +#define GL_ROUNDED_RECT4_NV 0xEC +#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED +#define GL_ROUNDED_RECT8_NV 0xEE +#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF +#define GL_RELATIVE_RECT_NV 0xF7 +#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 +#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 +#define GL_FONT_UNAVAILABLE_NV 0x936A +#define GL_FONT_UNINTELLIGIBLE_NV 0x936B +#define GL_CONIC_CURVE_TO_NV 0x1A +#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B +#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 +#define GL_STANDARD_FONT_FORMAT_NV 0x936C +#define GL_2_BYTES_NV 0x1407 +#define GL_3_BYTES_NV 0x1408 +#define GL_4_BYTES_NV 0x1409 +#define GL_EYE_LINEAR_NV 0x2400 +#define GL_OBJECT_LINEAR_NV 0x2401 +#define GL_CONSTANT_NV 0x8576 +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_PROJECTION_NV 0x1701 +#define GL_PATH_MODELVIEW_NV 0x1700 +#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 +#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 +#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 +#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 +#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 +#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 +#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 +#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 +#define GL_FRAGMENT_INPUT_NV 0x936D +typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path); +typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); +typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); +typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef void (APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); +typedef void (APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); +typedef void (APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); +typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); +typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); +typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); +typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); +typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); +typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); +typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); +typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); +typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); +typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); +typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); +typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value); +typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value); +typedef void (APIENTRYP PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range); +GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range); +GLAPI GLboolean APIENTRY glIsPathNV (GLuint path); +GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); +GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); +GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); +GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +GLAPI void APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); +GLAPI void APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); +GLAPI void APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); +GLAPI void APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); +GLAPI void APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); +GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); +GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); +GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); +GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func); +GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); +GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); +GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); +GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); +GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); +GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); +GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); +GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); +GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); +GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); +GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +GLAPI void APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); +GLAPI void APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +GLAPI void APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); +GLAPI void APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); +GLAPI GLenum APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI GLenum APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); +GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); +GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); +GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); +GLAPI void APIENTRY glPathFogGenNV (GLenum genMode); +GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value); +GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value); +GLAPI void APIENTRY glGetPathTexGenfvNV (GLenum texCoordSet, GLenum pname, GLfloat *value); +#endif +#endif /* GL_NV_path_rendering */ + +#ifndef GL_NV_path_rendering_shared_edge +#define GL_NV_path_rendering_shared_edge 1 +#define GL_SHARED_EDGE_NV 0xC0 +#endif /* GL_NV_path_rendering_shared_edge */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const void *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const void *pointer); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); +#endif +#endif /* GL_NV_pixel_data_range */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); +#endif +#endif /* GL_NV_point_sprite */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); +GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#endif +#endif /* GL_NV_present_video */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); +#endif +#endif /* GL_NV_primitive_restart */ + +#ifndef GL_NV_primitive_shading_rate +#define GL_NV_primitive_shading_rate 1 +#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1 +#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2 +#endif /* GL_NV_primitive_shading_rate */ + +#ifndef GL_NV_query_resource +#define GL_NV_query_resource 1 +#define GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV 0x9540 +#define GL_QUERY_RESOURCE_MEMTYPE_VIDMEM_NV 0x9542 +#define GL_QUERY_RESOURCE_SYS_RESERVED_NV 0x9544 +#define GL_QUERY_RESOURCE_TEXTURE_NV 0x9545 +#define GL_QUERY_RESOURCE_RENDERBUFFER_NV 0x9546 +#define GL_QUERY_RESOURCE_BUFFEROBJECT_NV 0x9547 +typedef GLint (APIENTRYP PFNGLQUERYRESOURCENVPROC) (GLenum queryType, GLint tagId, GLuint count, GLint *buffer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glQueryResourceNV (GLenum queryType, GLint tagId, GLuint count, GLint *buffer); +#endif +#endif /* GL_NV_query_resource */ + +#ifndef GL_NV_query_resource_tag +#define GL_NV_query_resource_tag 1 +typedef void (APIENTRYP PFNGLGENQUERYRESOURCETAGNVPROC) (GLsizei n, GLint *tagIds); +typedef void (APIENTRYP PFNGLDELETEQUERYRESOURCETAGNVPROC) (GLsizei n, const GLint *tagIds); +typedef void (APIENTRYP PFNGLQUERYRESOURCETAGNVPROC) (GLint tagId, const GLchar *tagString); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueryResourceTagNV (GLsizei n, GLint *tagIds); +GLAPI void APIENTRY glDeleteQueryResourceTagNV (GLsizei n, const GLint *tagIds); +GLAPI void APIENTRY glQueryResourceTagNV (GLint tagId, const GLchar *tagString); +#endif +#endif /* GL_NV_query_resource_tag */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); +#endif +#endif /* GL_NV_register_combiners */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); +#endif +#endif /* GL_NV_register_combiners2 */ + +#ifndef GL_NV_representative_fragment_test +#define GL_NV_representative_fragment_test 1 +#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F +#endif /* GL_NV_representative_fragment_test */ + +#ifndef GL_NV_robustness_video_memory_purge +#define GL_NV_robustness_video_memory_purge 1 +#define GL_PURGED_CONTEXT_RESET_NV 0x92BB +#endif /* GL_NV_robustness_video_memory_purge */ + +#ifndef GL_NV_sample_locations +#define GL_NV_sample_locations 1 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 +typedef void (APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glResolveDepthValuesNV (void); +#endif +#endif /* GL_NV_sample_locations */ + +#ifndef GL_NV_sample_mask_override_coverage +#define GL_NV_sample_mask_override_coverage 1 +#endif /* GL_NV_sample_mask_override_coverage */ + +#ifndef GL_NV_scissor_exclusive +#define GL_NV_scissor_exclusive 1 +#define GL_SCISSOR_TEST_EXCLUSIVE_NV 0x9555 +#define GL_SCISSOR_BOX_EXCLUSIVE_NV 0x9556 +typedef void (APIENTRYP PFNGLSCISSOREXCLUSIVENVPROC) (GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLSCISSOREXCLUSIVEARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glScissorExclusiveNV (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei count, const GLint *v); +#endif +#endif /* GL_NV_scissor_exclusive */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 +#endif /* GL_NV_shader_atomic_counters */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 +#endif /* GL_NV_shader_atomic_float */ + +#ifndef GL_NV_shader_atomic_float64 +#define GL_NV_shader_atomic_float64 1 +#endif /* GL_NV_shader_atomic_float64 */ + +#ifndef GL_NV_shader_atomic_fp16_vector +#define GL_NV_shader_atomic_fp16_vector 1 +#endif /* GL_NV_shader_atomic_fp16_vector */ + +#ifndef GL_NV_shader_atomic_int64 +#define GL_NV_shader_atomic_int64 1 +#endif /* GL_NV_shader_atomic_int64 */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 +typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); +typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); +GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); +GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); +GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); +GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); +GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); +GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); +GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); +GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); +GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif +#endif /* GL_NV_shader_buffer_load */ + +#ifndef GL_NV_shader_buffer_store +#define GL_NV_shader_buffer_store 1 +#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 +#endif /* GL_NV_shader_buffer_store */ + +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 +#endif /* GL_NV_shader_storage_buffer_object */ + +#ifndef GL_NV_shader_subgroup_partitioned +#define GL_NV_shader_subgroup_partitioned 1 +#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100 +#endif /* GL_NV_shader_subgroup_partitioned */ + +#ifndef GL_NV_shader_texture_footprint +#define GL_NV_shader_texture_footprint 1 +#endif /* GL_NV_shader_texture_footprint */ + +#ifndef GL_NV_shader_thread_group +#define GL_NV_shader_thread_group 1 +#define GL_WARP_SIZE_NV 0x9339 +#define GL_WARPS_PER_SM_NV 0x933A +#define GL_SM_COUNT_NV 0x933B +#endif /* GL_NV_shader_thread_group */ + +#ifndef GL_NV_shader_thread_shuffle +#define GL_NV_shader_thread_shuffle 1 +#endif /* GL_NV_shader_thread_shuffle */ + +#ifndef GL_NV_shading_rate_image +#define GL_NV_shading_rate_image 1 +#define GL_SHADING_RATE_IMAGE_NV 0x9563 +#define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564 +#define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565 +#define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566 +#define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567 +#define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568 +#define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569 +#define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A +#define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B +#define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C +#define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D +#define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E +#define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F +#define GL_SHADING_RATE_IMAGE_BINDING_NV 0x955B +#define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C +#define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D +#define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E +#define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F +#define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE +#define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF +#define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0 +typedef void (APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate); +typedef void (APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location); +typedef void (APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize); +typedef void (APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); +typedef void (APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order); +typedef void (APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindShadingRateImageNV (GLuint texture); +GLAPI void APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate); +GLAPI void APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location); +GLAPI void APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize); +GLAPI void APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); +GLAPI void APIENTRY glShadingRateSampleOrderNV (GLenum order); +GLAPI void APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations); +#endif +#endif /* GL_NV_shading_rate_image */ + +#ifndef GL_NV_stereo_view_rendering +#define GL_NV_stereo_view_rendering 1 +#endif /* GL_NV_stereo_view_rendering */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 +#endif /* GL_NV_tessellation_program5 */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif /* GL_NV_texgen_emboss */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif /* GL_NV_texgen_reflection */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 +typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureBarrierNV (void); +#endif +#endif /* GL_NV_texture_barrier */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif /* GL_NV_texture_compression_vtc */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif /* GL_NV_texture_env_combine4 */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif /* GL_NV_texture_expand_normal */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage2DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage3DMultisampleNV (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage2DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +#endif +#endif /* GL_NV_texture_multisample */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif /* GL_NV_texture_rectangle */ + +#ifndef GL_NV_texture_rectangle_compressed +#define GL_NV_texture_rectangle_compressed 1 +#endif /* GL_NV_texture_rectangle_compressed */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif /* GL_NV_texture_shader */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif /* GL_NV_texture_shader2 */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif /* GL_NV_texture_shader3 */ + +#ifndef GL_NV_timeline_semaphore +#define GL_NV_timeline_semaphore 1 +#define GL_TIMELINE_SEMAPHORE_VALUE_NV 0x9595 +#define GL_SEMAPHORE_TYPE_NV 0x95B3 +#define GL_SEMAPHORE_TYPE_BINARY_NV 0x95B4 +#define GL_SEMAPHORE_TYPE_TIMELINE_NV 0x95B5 +#define GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV 0x95B6 +typedef void (APIENTRYP PFNGLCREATESEMAPHORESNVPROC) (GLsizei n, GLuint *semaphores); +typedef void (APIENTRYP PFNGLSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCreateSemaphoresNV (GLsizei n, GLuint *semaphores); +GLAPI void APIENTRY glSemaphoreParameterivNV (GLuint semaphore, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetSemaphoreParameterivNV (GLuint semaphore, GLenum pname, GLint *params); +#endif +#endif /* GL_NV_timeline_semaphore */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#define GL_LAYER_NV 0x8DAA +#define GL_NEXT_BUFFER_NV -2 +#define GL_SKIP_COMPONENTS4_NV -3 +#define GL_SKIP_COMPONENTS3_NV -4 +#define GL_SKIP_COMPONENTS2_NV -5 +#define GL_SKIP_COMPONENTS1_NV -6 +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackNV (void); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLsizei count, const GLint *attribs, GLenum bufferMode); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); +GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#endif +#endif /* GL_NV_transform_feedback */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedbackNV (void); +GLAPI void APIENTRY glResumeTransformFeedbackNV (void); +GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); +#endif +#endif /* GL_NV_transform_feedback2 */ + +#ifndef GL_NV_uniform_buffer_unified_memory +#define GL_NV_uniform_buffer_unified_memory 1 +#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E +#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F +#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 +#endif /* GL_NV_uniform_buffer_unified_memory */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 +typedef GLintptr GLvdpauSurfaceNV; +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE +typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void *getProcAddress); +typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei count, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAddress); +GLAPI void APIENTRY glVDPAUFiniNV (void); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei count, GLsizei *length, GLint *values); +GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); +GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif +#endif /* GL_NV_vdpau_interop */ + +#ifndef GL_NV_vdpau_interop2 +#define GL_NV_vdpau_interop2 1 +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACEWITHPICTURESTRUCTURENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames, GLboolean isFrameStructure); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceWithPictureStructureNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames, GLboolean isFrameStructure); +#endif +#endif /* GL_NV_vdpau_interop2 */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const void *pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const void *pointer); +#endif +#endif /* GL_NV_vertex_array_range */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif /* GL_NV_vertex_array_range2 */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); +GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); +GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 +typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); +GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); +#endif +#endif /* GL_NV_vertex_buffer_unified_memory */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void **pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); +GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); +GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, void **pointer); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); +GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); +#endif +#endif /* GL_NV_vertex_program */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif /* GL_NV_vertex_program1_1 */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif /* GL_NV_vertex_program2 */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif /* GL_NV_vertex_program2_option */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif /* GL_NV_vertex_program3 */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +#endif /* GL_NV_vertex_program4 */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C +typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif +#endif /* GL_NV_video_capture */ + +#ifndef GL_NV_viewport_array2 +#define GL_NV_viewport_array2 1 +#endif /* GL_NV_viewport_array2 */ + +#ifndef GL_NV_viewport_swizzle +#define GL_NV_viewport_swizzle 1 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 +#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358 +#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 +#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A +#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B +typedef void (APIENTRYP PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); +#endif +#endif /* GL_NV_viewport_swizzle */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif /* GL_OML_interlace */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif /* GL_OML_resample */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif /* GL_OML_subsample */ + +#ifndef GL_OVR_multiview +#define GL_OVR_multiview 1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 +#define GL_MAX_VIEWS_OVR 0x9631 +#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); +#endif +#endif /* GL_OVR_multiview */ + +#ifndef GL_OVR_multiview2 +#define GL_OVR_multiview2 1 +#endif /* GL_OVR_multiview2 */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); +#endif +#endif /* GL_PGI_misc_hints */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif /* GL_PGI_vertex_hints */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif /* GL_REND_screen_coordinates */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 +#endif /* GL_S3_s3tc */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); +#endif +#endif /* GL_SGIS_detail_texture */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); +#endif +#endif /* GL_SGIS_fog_function */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif /* GL_SGIS_generate_mipmap */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); +#endif +#endif /* GL_SGIS_multisample */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params); +#endif +#endif /* GL_SGIS_pixel_texture */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif /* GL_SGIS_point_line_texgen */ + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params); +#endif +#endif /* GL_SGIS_point_parameters */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); +#endif +#endif /* GL_SGIS_sharpen_texture */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); +#endif +#endif /* GL_SGIS_texture4D */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif /* GL_SGIS_texture_border_clamp */ + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif +#endif /* GL_SGIS_texture_color_mask */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif /* GL_SGIS_texture_edge_clamp */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif +#endif /* GL_SGIS_texture_filter4 */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif /* GL_SGIS_texture_lod */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif /* GL_SGIS_texture_select */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#define GL_ASYNC_MARKER_SGIX 0x8329 +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); +#endif +#endif /* GL_SGIX_async */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif /* GL_SGIX_async_histogram */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif /* GL_SGIX_async_pixel */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif /* GL_SGIX_blend_alpha_minmax */ + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif /* GL_SGIX_calligraphic_fragment */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif /* GL_SGIX_clipmap */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif /* GL_SGIX_convolution_accuracy */ + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif /* GL_SGIX_depth_pass_instrument */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif /* GL_SGIX_depth_texture */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif +#endif /* GL_SGIX_flush_raster */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif /* GL_SGIX_fog_offset */ + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params); +GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param); +#endif +#endif /* GL_SGIX_fragment_lighting */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); +#endif +#endif /* GL_SGIX_framezoom */ + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const void *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const void *params); +#endif +#endif /* GL_SGIX_igloo_interface */ + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); +#endif +#endif /* GL_SGIX_instruments */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#define GL_INTERLACE_SGIX 0x8094 +#endif /* GL_SGIX_interlace */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif /* GL_SGIX_ir_instrument1 */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#define GL_LIST_PRIORITY_SGIX 0x8182 +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); +GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); +GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); +#endif +#endif /* GL_SGIX_list_priority */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); +#endif +#endif /* GL_SGIX_pixel_texture */ + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif /* GL_SGIX_pixel_tiles */ + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); +#endif +#endif /* GL_SGIX_polynomial_ffd */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); +#endif +#endif /* GL_SGIX_reference_plane */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif /* GL_SGIX_resample */ + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif /* GL_SGIX_scalebias_hint */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif /* GL_SGIX_shadow */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif /* GL_SGIX_shadow_ambient */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); +#endif +#endif /* GL_SGIX_sprite */ + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif /* GL_SGIX_subsample */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif +#endif /* GL_SGIX_tag_sample_buffer */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif /* GL_SGIX_texture_add_env */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif /* GL_SGIX_texture_coordinate_clamp */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif /* GL_SGIX_texture_lod_bias */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif /* GL_SGIX_texture_multi_buffer */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif /* GL_SGIX_texture_scale_bias */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif /* GL_SGIX_vertex_preclip */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif /* GL_SGIX_ycrcb */ + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif /* GL_SGIX_ycrcb_subsample */ + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif /* GL_SGIX_ycrcba */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif /* GL_SGI_color_matrix */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void *table); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); +#endif +#endif /* GL_SGI_color_table */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif /* GL_SGI_texture_color_table */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif +#endif /* GL_SUNX_constant_data */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif /* GL_SUN_convolution_border_modes */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor); +#endif +#endif /* GL_SUN_global_alpha */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif +#endif /* GL_SUN_mesh_array */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif /* GL_SUN_slice_accum */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void **pointer); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void **pointer); +#endif +#endif /* GL_SUN_triangle_list */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif +#endif /* GL_SUN_vertex */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif /* GL_WIN_phong_shading */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif /* GL_WIN_specular_fog */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles.h new file mode 100644 index 00000000..b5643516 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles.h @@ -0,0 +1,39 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_opengles.h + * + * This is a simple file to encapsulate the OpenGL ES 1.X API headers. + */ +#include + +#ifdef __IPHONEOS__ +#include +#include +#else +#include +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2.h new file mode 100644 index 00000000..e385448d --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2.h @@ -0,0 +1,52 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_opengles2.h + * + * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. + */ +#include + +#if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS) + +#ifdef __IPHONEOS__ +#include +#include +#else +#include +#include +#include +#endif + +#else /* _MSC_VER */ + +/* OpenGL ES2 headers for Visual Studio */ +#include +#include +#include +#include + +#endif /* _MSC_VER */ + +#ifndef APIENTRY +#define APIENTRY GL_APIENTRY +#endif diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_gl2.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_gl2.h new file mode 100644 index 00000000..d13622aa --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_gl2.h @@ -0,0 +1,656 @@ +#ifndef __gles2_gl2_h_ +#define __gles2_gl2_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT +** +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** https://github.com/KhronosGroup/OpenGL-Registry +*/ + +/*#include */ + +#ifndef GL_APIENTRYP +#define GL_APIENTRYP GL_APIENTRY* +#endif + +#ifndef GL_GLES_PROTOTYPES +#define GL_GLES_PROTOTYPES 1 +#endif + +/* Generated on date 20220530 */ + +/* Generated C header for: + * API: gles2 + * Profile: common + * Versions considered: 2\.[0-9] + * Versions emitted: .* + * Default extensions included: None + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef GL_ES_VERSION_2_0 +#define GL_ES_VERSION_2_0 1 +/*#include */ +typedef khronos_int8_t GLbyte; +typedef khronos_float_t GLclampf; +typedef khronos_int32_t GLfixed; +typedef khronos_int16_t GLshort; +typedef khronos_uint16_t GLushort; +typedef void GLvoid; +typedef struct __GLsync *GLsync; +typedef khronos_int64_t GLint64; +typedef khronos_uint64_t GLuint64; +typedef unsigned int GLenum; +typedef unsigned int GLuint; +typedef char GLchar; +typedef khronos_float_t GLfloat; +typedef khronos_ssize_t GLsizeiptr; +typedef khronos_intptr_t GLintptr; +typedef unsigned int GLbitfield; +typedef int GLint; +typedef unsigned char GLboolean; +typedef int GLsizei; +typedef khronos_uint8_t GLubyte; +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_FALSE 0 +#define GL_TRUE 1 +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_FUNC_ADD 0x8006 +#define GL_BLEND_EQUATION 0x8009 +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_STREAM_DRAW 0x88E0 +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_CULL_FACE 0x0B44 +#define GL_BLEND 0x0BE2 +#define GL_DITHER 0x0BD0 +#define GL_STENCIL_TEST 0x0B90 +#define GL_DEPTH_TEST 0x0B71 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_LINE_WIDTH 0x0B21 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_FIXED 0x140C +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#define GL_SHADER_TYPE 0x8B4F +#define GL_DELETE_STATUS 0x8B80 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_INVERT 0x150A +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#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_TEXTURE 0x1702 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_REPEAT 0x2901 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_COMPILE_STATUS 0x8B81 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGB565 0x8D62 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_NONE 0 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture); +typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor); +typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask); +typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); +typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s); +typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode); +typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures); +typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func); +typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag); +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); +typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap); +typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices); +typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap); +typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void); +typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode); +typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures); +typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void); +typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data); +typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name); +typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); +typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode); +typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap); +typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture); +typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width); +typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units); +typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); +typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); +typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); +typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask); +typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass); +typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height); +#if GL_GLES_PROTOTYPES +GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); +GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); +GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); +GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode); +GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); +GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); +GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d); +GL_APICALL void GL_APIENTRY glClearStencil (GLint s); +GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); +GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); +GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); +GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); +GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); +GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); +GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); +GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); +GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); +GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); +GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f); +GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); +GL_APICALL void GL_APIENTRY glDisable (GLenum cap); +GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); +GL_APICALL void GL_APIENTRY glEnable (GLenum cap); +GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); +GL_APICALL void GL_APIENTRY glFinish (void); +GL_APICALL void GL_APIENTRY glFlush (void); +GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); +GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); +GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); +GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); +GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures); +GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); +GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data); +GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GL_APICALL GLenum GL_APIENTRY glGetError (void); +GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data); +GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data); +GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name); +GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); +GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); +GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); +GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); +GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); +GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); +GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); +GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); +GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); +GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); +GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); +GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); +GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); +GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); +GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length); +GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); +GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0); +GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0); +GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); +GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); +GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); +GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); +GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); +GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); +GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); +GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); +#endif +#endif /* GL_ES_VERSION_2_0 */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_gl2ext.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_gl2ext.h new file mode 100644 index 00000000..9448ce09 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_gl2ext.h @@ -0,0 +1,4033 @@ +#ifndef __gles2_gl2ext_h_ +#define __gles2_gl2ext_h_ 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright 2013-2020 The Khronos Group Inc. +** SPDX-License-Identifier: MIT +** +** This header is generated from the Khronos OpenGL / OpenGL ES XML +** API Registry. The current version of the Registry, generator scripts +** used to make the header, and the header can be found at +** https://github.com/KhronosGroup/OpenGL-Registry +*/ + +#ifndef GL_APIENTRYP +#define GL_APIENTRYP GL_APIENTRY* +#endif + +/* Generated on date 20220530 */ + +/* Generated C header for: + * API: gles2 + * Profile: common + * Versions considered: 2\.[0-9] + * Versions emitted: _nomatch_^ + * Default extensions included: gles2 + * Additional extensions included: _nomatch_^ + * Extensions removed: _nomatch_^ + */ + +#ifndef GL_KHR_blend_equation_advanced +#define GL_KHR_blend_equation_advanced 1 +#define GL_MULTIPLY_KHR 0x9294 +#define GL_SCREEN_KHR 0x9295 +#define GL_OVERLAY_KHR 0x9296 +#define GL_DARKEN_KHR 0x9297 +#define GL_LIGHTEN_KHR 0x9298 +#define GL_COLORDODGE_KHR 0x9299 +#define GL_COLORBURN_KHR 0x929A +#define GL_HARDLIGHT_KHR 0x929B +#define GL_SOFTLIGHT_KHR 0x929C +#define GL_DIFFERENCE_KHR 0x929E +#define GL_EXCLUSION_KHR 0x92A0 +#define GL_HSL_HUE_KHR 0x92AD +#define GL_HSL_SATURATION_KHR 0x92AE +#define GL_HSL_COLOR_KHR 0x92AF +#define GL_HSL_LUMINOSITY_KHR 0x92B0 +typedef void (GL_APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBlendBarrierKHR (void); +#endif +#endif /* GL_KHR_blend_equation_advanced */ + +#ifndef GL_KHR_blend_equation_advanced_coherent +#define GL_KHR_blend_equation_advanced_coherent 1 +#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 +#endif /* GL_KHR_blend_equation_advanced_coherent */ + +#ifndef GL_KHR_context_flush_control +#define GL_KHR_context_flush_control 1 +#define GL_CONTEXT_RELEASE_BEHAVIOR_KHR 0x82FB +#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_KHR 0x82FC +#endif /* GL_KHR_context_flush_control */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 +typedef void (GL_APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#define GL_SAMPLER 0x82E6 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_KHR 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_KHR 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_KHR 0x8245 +#define GL_DEBUG_SOURCE_API_KHR 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_KHR 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_KHR 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_KHR 0x824A +#define GL_DEBUG_SOURCE_OTHER_KHR 0x824B +#define GL_DEBUG_TYPE_ERROR_KHR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_KHR 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_KHR 0x8250 +#define GL_DEBUG_TYPE_OTHER_KHR 0x8251 +#define GL_DEBUG_TYPE_MARKER_KHR 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP_KHR 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP_KHR 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION_KHR 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH_KHR 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH_KHR 0x826D +#define GL_BUFFER_KHR 0x82E0 +#define GL_SHADER_KHR 0x82E1 +#define GL_PROGRAM_KHR 0x82E2 +#define GL_VERTEX_ARRAY_KHR 0x8074 +#define GL_QUERY_KHR 0x82E3 +#define GL_PROGRAM_PIPELINE_KHR 0x82E4 +#define GL_SAMPLER_KHR 0x82E6 +#define GL_MAX_LABEL_LENGTH_KHR 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_KHR 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_KHR 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_KHR 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_KHR 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_KHR 0x9147 +#define GL_DEBUG_SEVERITY_LOW_KHR 0x9148 +#define GL_DEBUG_OUTPUT_KHR 0x92E0 +#define GL_CONTEXT_FLAG_DEBUG_BIT_KHR 0x00000002 +#define GL_STACK_OVERFLOW_KHR 0x0503 +#define GL_STACK_UNDERFLOW_KHR 0x0504 +typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (GL_APIENTRYP PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam); +typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); +typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRPROC) (void); +typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam); +GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHR (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GL_APICALL void GL_APIENTRY glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message); +GL_APICALL void GL_APIENTRY glPopDebugGroupKHR (void); +GL_APICALL void GL_APIENTRY glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label); +GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params); +#endif +#endif /* GL_KHR_debug */ + +#ifndef GL_KHR_no_error +#define GL_KHR_no_error 1 +#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 +#endif /* GL_KHR_no_error */ + +#ifndef GL_KHR_parallel_shader_compile +#define GL_KHR_parallel_shader_compile 1 +#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0 +#define GL_COMPLETION_STATUS_KHR 0x91B1 +typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count); +#endif +#endif /* GL_KHR_parallel_shader_compile */ + +#ifndef GL_KHR_robust_buffer_access_behavior +#define GL_KHR_robust_buffer_access_behavior 1 +#endif /* GL_KHR_robust_buffer_access_behavior */ + +#ifndef GL_KHR_robustness +#define GL_KHR_robustness 1 +#define GL_CONTEXT_ROBUST_ACCESS_KHR 0x90F3 +#define GL_LOSE_CONTEXT_ON_RESET_KHR 0x8252 +#define GL_GUILTY_CONTEXT_RESET_KHR 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_KHR 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_KHR 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_KHR 0x8256 +#define GL_NO_RESET_NOTIFICATION_KHR 0x8261 +#define GL_CONTEXT_LOST_KHR 0x0507 +typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC) (void); +typedef void (GL_APIENTRYP PFNGLREADNPIXELSKHRPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVKHRPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusKHR (void); +GL_APICALL void GL_APIENTRY glReadnPixelsKHR (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +GL_APICALL void GL_APIENTRY glGetnUniformfvKHR (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetnUniformivKHR (GLuint program, GLint location, GLsizei bufSize, GLint *params); +GL_APICALL void GL_APIENTRY glGetnUniformuivKHR (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +#endif +#endif /* GL_KHR_robustness */ + +#ifndef GL_KHR_shader_subgroup +#define GL_KHR_shader_subgroup 1 +#define GL_SUBGROUP_SIZE_KHR 0x9532 +#define GL_SUBGROUP_SUPPORTED_STAGES_KHR 0x9533 +#define GL_SUBGROUP_SUPPORTED_FEATURES_KHR 0x9534 +#define GL_SUBGROUP_QUAD_ALL_STAGES_KHR 0x9535 +#define GL_SUBGROUP_FEATURE_BASIC_BIT_KHR 0x00000001 +#define GL_SUBGROUP_FEATURE_VOTE_BIT_KHR 0x00000002 +#define GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR 0x00000004 +#define GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR 0x00000008 +#define GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR 0x00000010 +#define GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR 0x00000020 +#define GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR 0x00000040 +#define GL_SUBGROUP_FEATURE_QUAD_BIT_KHR 0x00000080 +#endif /* GL_KHR_shader_subgroup */ + +#ifndef GL_KHR_texture_compression_astc_hdr +#define GL_KHR_texture_compression_astc_hdr 1 +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD +#endif /* GL_KHR_texture_compression_astc_hdr */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 +#endif /* GL_KHR_texture_compression_astc_ldr */ + +#ifndef GL_KHR_texture_compression_astc_sliced_3d +#define GL_KHR_texture_compression_astc_sliced_3d 1 +#endif /* GL_KHR_texture_compression_astc_sliced_3d */ + +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +typedef void *GLeglImageOES; +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); +#endif +#endif /* GL_OES_EGL_image */ + +#ifndef GL_OES_EGL_image_external +#define GL_OES_EGL_image_external 1 +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 +#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 +#define GL_SAMPLER_EXTERNAL_OES 0x8D66 +#endif /* GL_OES_EGL_image_external */ + +#ifndef GL_OES_EGL_image_external_essl3 +#define GL_OES_EGL_image_external_essl3 1 +#endif /* GL_OES_EGL_image_external_essl3 */ + +#ifndef GL_OES_compressed_ETC1_RGB8_sub_texture +#define GL_OES_compressed_ETC1_RGB8_sub_texture 1 +#endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */ + +#ifndef GL_OES_compressed_ETC1_RGB8_texture +#define GL_OES_compressed_ETC1_RGB8_texture 1 +#define GL_ETC1_RGB8_OES 0x8D64 +#endif /* GL_OES_compressed_ETC1_RGB8_texture */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 +#endif /* GL_OES_compressed_paletted_texture */ + +#ifndef GL_OES_copy_image +#define GL_OES_copy_image 1 +typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAOESPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCopyImageSubDataOES (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +#endif +#endif /* GL_OES_copy_image */ + +#ifndef GL_OES_depth24 +#define GL_OES_depth24 1 +#define GL_DEPTH_COMPONENT24_OES 0x81A6 +#endif /* GL_OES_depth24 */ + +#ifndef GL_OES_depth32 +#define GL_OES_depth32 1 +#define GL_DEPTH_COMPONENT32_OES 0x81A7 +#endif /* GL_OES_depth32 */ + +#ifndef GL_OES_depth_texture +#define GL_OES_depth_texture 1 +#endif /* GL_OES_depth_texture */ + +#ifndef GL_OES_draw_buffers_indexed +#define GL_OES_draw_buffers_indexed 1 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +typedef void (GL_APIENTRYP PFNGLENABLEIOESPROC) (GLenum target, GLuint index); +typedef void (GL_APIENTRYP PFNGLDISABLEIOESPROC) (GLenum target, GLuint index); +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIOESPROC) (GLuint buf, GLenum mode); +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIOESPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GL_APIENTRYP PFNGLBLENDFUNCIOESPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIOESPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GL_APIENTRYP PFNGLCOLORMASKIOESPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIOESPROC) (GLenum target, GLuint index); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glEnableiOES (GLenum target, GLuint index); +GL_APICALL void GL_APIENTRY glDisableiOES (GLenum target, GLuint index); +GL_APICALL void GL_APIENTRY glBlendEquationiOES (GLuint buf, GLenum mode); +GL_APICALL void GL_APIENTRY glBlendEquationSeparateiOES (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GL_APICALL void GL_APIENTRY glBlendFunciOES (GLuint buf, GLenum src, GLenum dst); +GL_APICALL void GL_APIENTRY glBlendFuncSeparateiOES (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GL_APICALL void GL_APIENTRY glColorMaskiOES (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GL_APICALL GLboolean GL_APIENTRY glIsEnablediOES (GLenum target, GLuint index); +#endif +#endif /* GL_OES_draw_buffers_indexed */ + +#ifndef GL_OES_draw_elements_base_vertex +#define GL_OES_draw_elements_base_vertex 1 +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +#endif +#endif /* GL_OES_draw_elements_base_vertex */ + +#ifndef GL_OES_element_index_uint +#define GL_OES_element_index_uint 1 +#endif /* GL_OES_element_index_uint */ + +#ifndef GL_OES_fbo_render_mipmap +#define GL_OES_fbo_render_mipmap 1 +#endif /* GL_OES_fbo_render_mipmap */ + +#ifndef GL_OES_fragment_precision_high +#define GL_OES_fragment_precision_high 1 +#endif /* GL_OES_fragment_precision_high */ + +#ifndef GL_OES_geometry_point_size +#define GL_OES_geometry_point_size 1 +#endif /* GL_OES_geometry_point_size */ + +#ifndef GL_OES_geometry_shader +#define GL_OES_geometry_shader 1 +#define GL_GEOMETRY_SHADER_OES 0x8DD9 +#define GL_GEOMETRY_SHADER_BIT_OES 0x00000004 +#define GL_GEOMETRY_LINKED_VERTICES_OUT_OES 0x8916 +#define GL_GEOMETRY_LINKED_INPUT_TYPE_OES 0x8917 +#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_OES 0x8918 +#define GL_GEOMETRY_SHADER_INVOCATIONS_OES 0x887F +#define GL_LAYER_PROVOKING_VERTEX_OES 0x825E +#define GL_LINES_ADJACENCY_OES 0x000A +#define GL_LINE_STRIP_ADJACENCY_OES 0x000B +#define GL_TRIANGLES_ADJACENCY_OES 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_OES 0x000D +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8DDF +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_OES 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_OES 0x8A32 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_OES 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_OES 0x9124 +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_OES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_OES 0x8DE1 +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_OES 0x8E5A +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_OES 0x8C29 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_OES 0x92CF +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_OES 0x92D5 +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_OES 0x90CD +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_OES 0x90D7 +#define GL_FIRST_VERTEX_CONVENTION_OES 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_OES 0x8E4E +#define GL_UNDEFINED_VERTEX_OES 0x8260 +#define GL_PRIMITIVES_GENERATED_OES 0x8C87 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS_OES 0x9312 +#define GL_MAX_FRAMEBUFFER_LAYERS_OES 0x9317 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_OES 0x8DA8 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_OES 0x8DA7 +#define GL_REFERENCED_BY_GEOMETRY_SHADER_OES 0x9309 +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREOESPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferTextureOES (GLenum target, GLenum attachment, GLuint texture, GLint level); +#endif +#endif /* GL_OES_geometry_shader */ + +#ifndef GL_OES_get_program_binary +#define GL_OES_get_program_binary 1 +#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE +#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF +typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); +GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length); +#endif +#endif /* GL_OES_get_program_binary */ + +#ifndef GL_OES_gpu_shader5 +#define GL_OES_gpu_shader5 1 +#endif /* GL_OES_gpu_shader5 */ + +#ifndef GL_OES_mapbuffer +#define GL_OES_mapbuffer 1 +#define GL_WRITE_ONLY_OES 0x88B9 +#define GL_BUFFER_ACCESS_OES 0x88BB +#define GL_BUFFER_MAPPED_OES 0x88BC +#define GL_BUFFER_MAP_POINTER_OES 0x88BD +typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void *GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); +GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); +GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void **params); +#endif +#endif /* GL_OES_mapbuffer */ + +#ifndef GL_OES_packed_depth_stencil +#define GL_OES_packed_depth_stencil 1 +#define GL_DEPTH_STENCIL_OES 0x84F9 +#define GL_UNSIGNED_INT_24_8_OES 0x84FA +#define GL_DEPTH24_STENCIL8_OES 0x88F0 +#endif /* GL_OES_packed_depth_stencil */ + +#ifndef GL_OES_primitive_bounding_box +#define GL_OES_primitive_bounding_box 1 +#define GL_PRIMITIVE_BOUNDING_BOX_OES 0x92BE +typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXOESPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxOES (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); +#endif +#endif /* GL_OES_primitive_bounding_box */ + +#ifndef GL_OES_required_internalformat +#define GL_OES_required_internalformat 1 +#define GL_ALPHA8_OES 0x803C +#define GL_DEPTH_COMPONENT16_OES 0x81A5 +#define GL_LUMINANCE4_ALPHA4_OES 0x8043 +#define GL_LUMINANCE8_ALPHA8_OES 0x8045 +#define GL_LUMINANCE8_OES 0x8040 +#define GL_RGBA4_OES 0x8056 +#define GL_RGB5_A1_OES 0x8057 +#define GL_RGB565_OES 0x8D62 +#define GL_RGB8_OES 0x8051 +#define GL_RGBA8_OES 0x8058 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB10_A2_EXT 0x8059 +#endif /* GL_OES_required_internalformat */ + +#ifndef GL_OES_rgb8_rgba8 +#define GL_OES_rgb8_rgba8 1 +#endif /* GL_OES_rgb8_rgba8 */ + +#ifndef GL_OES_sample_shading +#define GL_OES_sample_shading 1 +#define GL_SAMPLE_SHADING_OES 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_OES 0x8C37 +typedef void (GL_APIENTRYP PFNGLMINSAMPLESHADINGOESPROC) (GLfloat value); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glMinSampleShadingOES (GLfloat value); +#endif +#endif /* GL_OES_sample_shading */ + +#ifndef GL_OES_sample_variables +#define GL_OES_sample_variables 1 +#endif /* GL_OES_sample_variables */ + +#ifndef GL_OES_shader_image_atomic +#define GL_OES_shader_image_atomic 1 +#endif /* GL_OES_shader_image_atomic */ + +#ifndef GL_OES_shader_io_blocks +#define GL_OES_shader_io_blocks 1 +#endif /* GL_OES_shader_io_blocks */ + +#ifndef GL_OES_shader_multisample_interpolation +#define GL_OES_shader_multisample_interpolation 1 +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_OES 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS_OES 0x8E5D +#endif /* GL_OES_shader_multisample_interpolation */ + +#ifndef GL_OES_standard_derivatives +#define GL_OES_standard_derivatives 1 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B +#endif /* GL_OES_standard_derivatives */ + +#ifndef GL_OES_stencil1 +#define GL_OES_stencil1 1 +#define GL_STENCIL_INDEX1_OES 0x8D46 +#endif /* GL_OES_stencil1 */ + +#ifndef GL_OES_stencil4 +#define GL_OES_stencil4 1 +#define GL_STENCIL_INDEX4_OES 0x8D47 +#endif /* GL_OES_stencil4 */ + +#ifndef GL_OES_surfaceless_context +#define GL_OES_surfaceless_context 1 +#define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219 +#endif /* GL_OES_surfaceless_context */ + +#ifndef GL_OES_tessellation_point_size +#define GL_OES_tessellation_point_size 1 +#endif /* GL_OES_tessellation_point_size */ + +#ifndef GL_OES_tessellation_shader +#define GL_OES_tessellation_shader 1 +#define GL_PATCHES_OES 0x000E +#define GL_PATCH_VERTICES_OES 0x8E72 +#define GL_TESS_CONTROL_OUTPUT_VERTICES_OES 0x8E75 +#define GL_TESS_GEN_MODE_OES 0x8E76 +#define GL_TESS_GEN_SPACING_OES 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER_OES 0x8E78 +#define GL_TESS_GEN_POINT_MODE_OES 0x8E79 +#define GL_ISOLINES_OES 0x8E7A +#define GL_QUADS_OES 0x0007 +#define GL_FRACTIONAL_ODD_OES 0x8E7B +#define GL_FRACTIONAL_EVEN_OES 0x8E7C +#define GL_MAX_PATCH_VERTICES_OES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL_OES 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_OES 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_OES 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_OES 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS_OES 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_OES 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_OES 0x8E86 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_OES 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_OES 0x8E8A +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_OES 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_OES 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_OES 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_OES 0x8E1F +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_OES 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_OES 0x92CE +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_OES 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_OES 0x92D4 +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_OES 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_OES 0x90CC +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_OES 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_OES 0x90D9 +#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED_OES 0x8221 +#define GL_IS_PER_PATCH_OES 0x92E7 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_OES 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_OES 0x9308 +#define GL_TESS_CONTROL_SHADER_OES 0x8E88 +#define GL_TESS_EVALUATION_SHADER_OES 0x8E87 +#define GL_TESS_CONTROL_SHADER_BIT_OES 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT_OES 0x00000010 +typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIOESPROC) (GLenum pname, GLint value); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glPatchParameteriOES (GLenum pname, GLint value); +#endif +#endif /* GL_OES_tessellation_shader */ + +#ifndef GL_OES_texture_3D +#define GL_OES_texture_3D 1 +#define GL_TEXTURE_WRAP_R_OES 0x8072 +#define GL_TEXTURE_3D_OES 0x806F +#define GL_TEXTURE_BINDING_3D_OES 0x806A +#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 +#define GL_SAMPLER_3D_OES 0x8B5F +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 +typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +#endif +#endif /* GL_OES_texture_3D */ + +#ifndef GL_OES_texture_border_clamp +#define GL_OES_texture_border_clamp 1 +#define GL_TEXTURE_BORDER_COLOR_OES 0x1004 +#define GL_CLAMP_TO_BORDER_OES 0x812D +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVOESPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVOESPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, const GLuint *param); +typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVOESPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVOESPROC) (GLuint sampler, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexParameterIivOES (GLenum target, GLenum pname, const GLint *params); +GL_APICALL void GL_APIENTRY glTexParameterIuivOES (GLenum target, GLenum pname, const GLuint *params); +GL_APICALL void GL_APIENTRY glGetTexParameterIivOES (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetTexParameterIuivOES (GLenum target, GLenum pname, GLuint *params); +GL_APICALL void GL_APIENTRY glSamplerParameterIivOES (GLuint sampler, GLenum pname, const GLint *param); +GL_APICALL void GL_APIENTRY glSamplerParameterIuivOES (GLuint sampler, GLenum pname, const GLuint *param); +GL_APICALL void GL_APIENTRY glGetSamplerParameterIivOES (GLuint sampler, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivOES (GLuint sampler, GLenum pname, GLuint *params); +#endif +#endif /* GL_OES_texture_border_clamp */ + +#ifndef GL_OES_texture_buffer +#define GL_OES_texture_buffer 1 +#define GL_TEXTURE_BUFFER_OES 0x8C2A +#define GL_TEXTURE_BUFFER_BINDING_OES 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_OES 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_OES 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_OES 0x8C2D +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_OES 0x919F +#define GL_SAMPLER_BUFFER_OES 0x8DC2 +#define GL_INT_SAMPLER_BUFFER_OES 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_OES 0x8DD8 +#define GL_IMAGE_BUFFER_OES 0x9051 +#define GL_INT_IMAGE_BUFFER_OES 0x905C +#define GL_UNSIGNED_INT_IMAGE_BUFFER_OES 0x9067 +#define GL_TEXTURE_BUFFER_OFFSET_OES 0x919D +#define GL_TEXTURE_BUFFER_SIZE_OES 0x919E +typedef void (GL_APIENTRYP PFNGLTEXBUFFEROESPROC) (GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEOESPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexBufferOES (GLenum target, GLenum internalformat, GLuint buffer); +GL_APICALL void GL_APIENTRY glTexBufferRangeOES (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +#endif +#endif /* GL_OES_texture_buffer */ + +#ifndef GL_OES_texture_compression_astc +#define GL_OES_texture_compression_astc 1 +#define GL_COMPRESSED_RGBA_ASTC_3x3x3_OES 0x93C0 +#define GL_COMPRESSED_RGBA_ASTC_4x3x3_OES 0x93C1 +#define GL_COMPRESSED_RGBA_ASTC_4x4x3_OES 0x93C2 +#define GL_COMPRESSED_RGBA_ASTC_4x4x4_OES 0x93C3 +#define GL_COMPRESSED_RGBA_ASTC_5x4x4_OES 0x93C4 +#define GL_COMPRESSED_RGBA_ASTC_5x5x4_OES 0x93C5 +#define GL_COMPRESSED_RGBA_ASTC_5x5x5_OES 0x93C6 +#define GL_COMPRESSED_RGBA_ASTC_6x5x5_OES 0x93C7 +#define GL_COMPRESSED_RGBA_ASTC_6x6x5_OES 0x93C8 +#define GL_COMPRESSED_RGBA_ASTC_6x6x6_OES 0x93C9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_3x3x3_OES 0x93E0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x3x3_OES 0x93E1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x3_OES 0x93E2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4x4_OES 0x93E3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4x4_OES 0x93E4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x4_OES 0x93E5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5x5_OES 0x93E6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5x5_OES 0x93E7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x5_OES 0x93E8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6x6_OES 0x93E9 +#endif /* GL_OES_texture_compression_astc */ + +#ifndef GL_OES_texture_cube_map_array +#define GL_OES_texture_cube_map_array 1 +#define GL_TEXTURE_CUBE_MAP_ARRAY_OES 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_OES 0x900A +#define GL_SAMPLER_CUBE_MAP_ARRAY_OES 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_OES 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_OES 0x900F +#define GL_IMAGE_CUBE_MAP_ARRAY_OES 0x9054 +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x905F +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_OES 0x906A +#endif /* GL_OES_texture_cube_map_array */ + +#ifndef GL_OES_texture_float +#define GL_OES_texture_float 1 +#endif /* GL_OES_texture_float */ + +#ifndef GL_OES_texture_float_linear +#define GL_OES_texture_float_linear 1 +#endif /* GL_OES_texture_float_linear */ + +#ifndef GL_OES_texture_half_float +#define GL_OES_texture_half_float 1 +#define GL_HALF_FLOAT_OES 0x8D61 +#endif /* GL_OES_texture_half_float */ + +#ifndef GL_OES_texture_half_float_linear +#define GL_OES_texture_half_float_linear 1 +#endif /* GL_OES_texture_half_float_linear */ + +#ifndef GL_OES_texture_npot +#define GL_OES_texture_npot 1 +#endif /* GL_OES_texture_npot */ + +#ifndef GL_OES_texture_stencil8 +#define GL_OES_texture_stencil8 1 +#define GL_STENCIL_INDEX_OES 0x1901 +#define GL_STENCIL_INDEX8_OES 0x8D48 +#endif /* GL_OES_texture_stencil8 */ + +#ifndef GL_OES_texture_storage_multisample_2d_array +#define GL_OES_texture_storage_multisample_2d_array 1 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY_OES 0x9102 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_OES 0x9105 +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_OES 0x910D +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEOESPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleOES (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +#endif +#endif /* GL_OES_texture_storage_multisample_2d_array */ + +#ifndef GL_OES_texture_view +#define GL_OES_texture_view 1 +#define GL_TEXTURE_VIEW_MIN_LEVEL_OES 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS_OES 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER_OES 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS_OES 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWOESPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTextureViewOES (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +#endif +#endif /* GL_OES_texture_view */ + +#ifndef GL_OES_vertex_array_object +#define GL_OES_vertex_array_object 1 +#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 +typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); +typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); +typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); +GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); +GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); +GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); +#endif +#endif /* GL_OES_vertex_array_object */ + +#ifndef GL_OES_vertex_half_float +#define GL_OES_vertex_half_float 1 +#endif /* GL_OES_vertex_half_float */ + +#ifndef GL_OES_vertex_type_10_10_10_2 +#define GL_OES_vertex_type_10_10_10_2 1 +#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 +#define GL_INT_10_10_10_2_OES 0x8DF7 +#endif /* GL_OES_vertex_type_10_10_10_2 */ + +#ifndef GL_OES_viewport_array +#define GL_OES_viewport_array 1 +#define GL_MAX_VIEWPORTS_OES 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS_OES 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE_OES 0x825D +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_OES 0x825F +typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVOESPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFOESPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVOESPROC) (GLuint index, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVOESPROC) (GLuint first, GLsizei count, const GLint *v); +typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDOESPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVOESPROC) (GLuint index, const GLint *v); +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVOESPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFOESPROC) (GLuint index, GLfloat n, GLfloat f); +typedef void (GL_APIENTRYP PFNGLGETFLOATI_VOESPROC) (GLenum target, GLuint index, GLfloat *data); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glViewportArrayvOES (GLuint first, GLsizei count, const GLfloat *v); +GL_APICALL void GL_APIENTRY glViewportIndexedfOES (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +GL_APICALL void GL_APIENTRY glViewportIndexedfvOES (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glScissorArrayvOES (GLuint first, GLsizei count, const GLint *v); +GL_APICALL void GL_APIENTRY glScissorIndexedOES (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glScissorIndexedvOES (GLuint index, const GLint *v); +GL_APICALL void GL_APIENTRY glDepthRangeArrayfvOES (GLuint first, GLsizei count, const GLfloat *v); +GL_APICALL void GL_APIENTRY glDepthRangeIndexedfOES (GLuint index, GLfloat n, GLfloat f); +GL_APICALL void GL_APIENTRY glGetFloati_vOES (GLenum target, GLuint index, GLfloat *data); +#endif +#endif /* GL_OES_viewport_array */ + +#ifndef GL_AMD_compressed_3DC_texture +#define GL_AMD_compressed_3DC_texture 1 +#define GL_3DC_X_AMD 0x87F9 +#define GL_3DC_XY_AMD 0x87FA +#endif /* GL_AMD_compressed_3DC_texture */ + +#ifndef GL_AMD_compressed_ATC_texture +#define GL_AMD_compressed_ATC_texture 1 +#define GL_ATC_RGB_AMD 0x8C92 +#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 +#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE +#endif /* GL_AMD_compressed_ATC_texture */ + +#ifndef GL_AMD_framebuffer_multisample_advanced +#define GL_AMD_framebuffer_multisample_advanced 1 +#define GL_RENDERBUFFER_STORAGE_SAMPLES_AMD 0x91B2 +#define GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD 0x91B3 +#define GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD 0x91B4 +#define GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD 0x91B5 +#define GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B6 +#define GL_SUPPORTED_MULTISAMPLE_MODES_AMD 0x91B7 +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEADVANCEDAMDPROC) (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAdvancedAMD (GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glNamedRenderbufferStorageMultisampleAdvancedAMD (GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +#endif /* GL_AMD_framebuffer_multisample_advanced */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); +GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); +GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); +GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); +GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif +#endif /* GL_AMD_performance_monitor */ + +#ifndef GL_AMD_program_binary_Z400 +#define GL_AMD_program_binary_Z400 1 +#define GL_Z400_BINARY_AMD 0x8740 +#endif /* GL_AMD_program_binary_Z400 */ + +#ifndef GL_ANDROID_extension_pack_es31a +#define GL_ANDROID_extension_pack_es31a 1 +#endif /* GL_ANDROID_extension_pack_es31a */ + +#ifndef GL_ANGLE_depth_texture +#define GL_ANGLE_depth_texture 1 +#endif /* GL_ANGLE_depth_texture */ + +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA +typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif +#endif /* GL_ANGLE_framebuffer_blit */ + +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +#endif /* GL_ANGLE_framebuffer_multisample */ + +#ifndef GL_ANGLE_instanced_arrays +#define GL_ANGLE_instanced_arrays 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE +typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +GL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE (GLuint index, GLuint divisor); +#endif +#endif /* GL_ANGLE_instanced_arrays */ + +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_ANGLE_pack_reverse_row_order 1 +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 +#endif /* GL_ANGLE_pack_reverse_row_order */ + +#ifndef GL_ANGLE_program_binary +#define GL_ANGLE_program_binary 1 +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 +#endif /* GL_ANGLE_program_binary */ + +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_ANGLE_texture_compression_dxt3 1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#endif /* GL_ANGLE_texture_compression_dxt3 */ + +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_ANGLE_texture_compression_dxt5 1 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 +#endif /* GL_ANGLE_texture_compression_dxt5 */ + +#ifndef GL_ANGLE_texture_usage +#define GL_ANGLE_texture_usage 1 +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 +#endif /* GL_ANGLE_texture_usage */ + +#ifndef GL_ANGLE_translated_shader_source +#define GL_ANGLE_translated_shader_source 1 +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 +typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +#endif +#endif /* GL_ANGLE_translated_shader_source */ + +#ifndef GL_APPLE_clip_distance +#define GL_APPLE_clip_distance 1 +#define GL_MAX_CLIP_DISTANCES_APPLE 0x0D32 +#define GL_CLIP_DISTANCE0_APPLE 0x3000 +#define GL_CLIP_DISTANCE1_APPLE 0x3001 +#define GL_CLIP_DISTANCE2_APPLE 0x3002 +#define GL_CLIP_DISTANCE3_APPLE 0x3003 +#define GL_CLIP_DISTANCE4_APPLE 0x3004 +#define GL_CLIP_DISTANCE5_APPLE 0x3005 +#define GL_CLIP_DISTANCE6_APPLE 0x3006 +#define GL_CLIP_DISTANCE7_APPLE 0x3007 +#endif /* GL_APPLE_clip_distance */ + +#ifndef GL_APPLE_color_buffer_packed_float +#define GL_APPLE_color_buffer_packed_float 1 +#endif /* GL_APPLE_color_buffer_packed_float */ + +#ifndef GL_APPLE_copy_texture_levels +#define GL_APPLE_copy_texture_levels 1 +typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); +#endif +#endif /* GL_APPLE_copy_texture_levels */ + +#ifndef GL_APPLE_framebuffer_multisample +#define GL_APPLE_framebuffer_multisample 1 +#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 +#define GL_MAX_SAMPLES_APPLE 0x8D57 +#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); +#endif +#endif /* GL_APPLE_framebuffer_multisample */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 +#define GL_RGB_422_APPLE 0x8A1F +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_RAW_422_APPLE 0x8A51 +#endif /* GL_APPLE_rgb_422 */ + +#ifndef GL_APPLE_sync +#define GL_APPLE_sync 1 +#define GL_SYNC_OBJECT_APPLE 0x8A53 +#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111 +#define GL_OBJECT_TYPE_APPLE 0x9112 +#define GL_SYNC_CONDITION_APPLE 0x9113 +#define GL_SYNC_STATUS_APPLE 0x9114 +#define GL_SYNC_FLAGS_APPLE 0x9115 +#define GL_SYNC_FENCE_APPLE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117 +#define GL_UNSIGNALED_APPLE 0x9118 +#define GL_SIGNALED_APPLE 0x9119 +#define GL_ALREADY_SIGNALED_APPLE 0x911A +#define GL_TIMEOUT_EXPIRED_APPLE 0x911B +#define GL_CONDITION_SATISFIED_APPLE 0x911C +#define GL_WAIT_FAILED_APPLE 0x911D +#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001 +#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull +typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync); +typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync); +typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); +typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags); +GL_APICALL GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync); +GL_APICALL void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync); +GL_APICALL GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); +GL_APICALL void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout); +GL_APICALL void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params); +GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values); +#endif +#endif /* GL_APPLE_sync */ + +#ifndef GL_APPLE_texture_format_BGRA8888 +#define GL_APPLE_texture_format_BGRA8888 1 +#define GL_BGRA_EXT 0x80E1 +#define GL_BGRA8_EXT 0x93A1 +#endif /* GL_APPLE_texture_format_BGRA8888 */ + +#ifndef GL_APPLE_texture_max_level +#define GL_APPLE_texture_max_level 1 +#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D +#endif /* GL_APPLE_texture_max_level */ + +#ifndef GL_APPLE_texture_packed_float +#define GL_APPLE_texture_packed_float 1 +#define GL_UNSIGNED_INT_10F_11F_11F_REV_APPLE 0x8C3B +#define GL_UNSIGNED_INT_5_9_9_9_REV_APPLE 0x8C3E +#define GL_R11F_G11F_B10F_APPLE 0x8C3A +#define GL_RGB9_E5_APPLE 0x8C3D +#endif /* GL_APPLE_texture_packed_float */ + +#ifndef GL_ARM_mali_program_binary +#define GL_ARM_mali_program_binary 1 +#define GL_MALI_PROGRAM_BINARY_ARM 0x8F61 +#endif /* GL_ARM_mali_program_binary */ + +#ifndef GL_ARM_mali_shader_binary +#define GL_ARM_mali_shader_binary 1 +#define GL_MALI_SHADER_BINARY_ARM 0x8F60 +#endif /* GL_ARM_mali_shader_binary */ + +#ifndef GL_ARM_rgba8 +#define GL_ARM_rgba8 1 +#endif /* GL_ARM_rgba8 */ + +#ifndef GL_ARM_shader_framebuffer_fetch +#define GL_ARM_shader_framebuffer_fetch 1 +#define GL_FETCH_PER_SAMPLE_ARM 0x8F65 +#define GL_FRAGMENT_SHADER_FRAMEBUFFER_FETCH_MRT_ARM 0x8F66 +#endif /* GL_ARM_shader_framebuffer_fetch */ + +#ifndef GL_ARM_shader_framebuffer_fetch_depth_stencil +#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1 +#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */ + +#ifndef GL_ARM_texture_unnormalized_coordinates +#define GL_ARM_texture_unnormalized_coordinates 1 +#define GL_TEXTURE_UNNORMALIZED_COORDINATES_ARM 0x8F6A +#endif /* GL_ARM_texture_unnormalized_coordinates */ + +#ifndef GL_DMP_program_binary +#define GL_DMP_program_binary 1 +#define GL_SMAPHS30_PROGRAM_BINARY_DMP 0x9251 +#define GL_SMAPHS_PROGRAM_BINARY_DMP 0x9252 +#define GL_DMP_PROGRAM_BINARY_DMP 0x9253 +#endif /* GL_DMP_program_binary */ + +#ifndef GL_DMP_shader_binary +#define GL_DMP_shader_binary 1 +#define GL_SHADER_BINARY_DMP 0x9250 +#endif /* GL_DMP_shader_binary */ + +#ifndef GL_EXT_EGL_image_array +#define GL_EXT_EGL_image_array 1 +#endif /* GL_EXT_EGL_image_array */ + +#ifndef GL_EXT_EGL_image_storage +#define GL_EXT_EGL_image_storage 1 +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list); +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list); +GL_APICALL void GL_APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list); +#endif +#endif /* GL_EXT_EGL_image_storage */ + +#ifndef GL_EXT_EGL_image_storage_compression +#define GL_EXT_EGL_image_storage_compression 1 +#define GL_SURFACE_COMPRESSION_EXT 0x96C0 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x96C1 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x96C2 +#endif /* GL_EXT_EGL_image_storage_compression */ + +#ifndef GL_EXT_YUV_target +#define GL_EXT_YUV_target 1 +#define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT 0x8BE7 +#endif /* GL_EXT_YUV_target */ + +#ifndef GL_EXT_base_instance +#define GL_EXT_base_instance 1 +typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawArraysInstancedBaseInstanceEXT (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexBaseInstanceEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); +#endif +#endif /* GL_EXT_base_instance */ + +#ifndef GL_EXT_blend_func_extended +#define GL_EXT_blend_func_extended 1 +#define GL_SRC1_COLOR_EXT 0x88F9 +#define GL_SRC1_ALPHA_EXT 0x8589 +#define GL_ONE_MINUS_SRC1_COLOR_EXT 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA_EXT 0x88FB +#define GL_SRC_ALPHA_SATURATE_EXT 0x0308 +#define GL_LOCATION_INDEX_EXT 0x930F +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS_EXT 0x88FC +typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDEXTPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +typedef void (GL_APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (GL_APIENTRYP PFNGLGETPROGRAMRESOURCELOCATIONINDEXEXTPROC) (GLuint program, GLenum programInterface, const GLchar *name); +typedef GLint (GL_APIENTRYP PFNGLGETFRAGDATAINDEXEXTPROC) (GLuint program, const GLchar *name); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBindFragDataLocationIndexedEXT (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +GL_APICALL void GL_APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); +GL_APICALL GLint GL_APIENTRY glGetProgramResourceLocationIndexEXT (GLuint program, GLenum programInterface, const GLchar *name); +GL_APICALL GLint GL_APIENTRY glGetFragDataIndexEXT (GLuint program, const GLchar *name); +#endif +#endif /* GL_EXT_blend_func_extended */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#endif /* GL_EXT_blend_minmax */ + +#ifndef GL_EXT_buffer_storage +#define GL_EXT_buffer_storage 1 +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT_EXT 0x0040 +#define GL_MAP_COHERENT_BIT_EXT 0x0080 +#define GL_DYNAMIC_STORAGE_BIT_EXT 0x0100 +#define GL_CLIENT_STORAGE_BIT_EXT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE_EXT 0x821F +#define GL_BUFFER_STORAGE_FLAGS_EXT 0x8220 +typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBufferStorageEXT (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); +#endif +#endif /* GL_EXT_buffer_storage */ + +#ifndef GL_EXT_clear_texture +#define GL_EXT_clear_texture 1 +typedef void (GL_APIENTRYP PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +typedef void (GL_APIENTRYP PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glClearTexImageEXT (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); +GL_APICALL void GL_APIENTRY glClearTexSubImageEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +#endif +#endif /* GL_EXT_clear_texture */ + +#ifndef GL_EXT_clip_control +#define GL_EXT_clip_control 1 +#define GL_LOWER_LEFT_EXT 0x8CA1 +#define GL_UPPER_LEFT_EXT 0x8CA2 +#define GL_NEGATIVE_ONE_TO_ONE_EXT 0x935E +#define GL_ZERO_TO_ONE_EXT 0x935F +#define GL_CLIP_ORIGIN_EXT 0x935C +#define GL_CLIP_DEPTH_MODE_EXT 0x935D +typedef void (GL_APIENTRYP PFNGLCLIPCONTROLEXTPROC) (GLenum origin, GLenum depth); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glClipControlEXT (GLenum origin, GLenum depth); +#endif +#endif /* GL_EXT_clip_control */ + +#ifndef GL_EXT_clip_cull_distance +#define GL_EXT_clip_cull_distance 1 +#define GL_MAX_CLIP_DISTANCES_EXT 0x0D32 +#define GL_MAX_CULL_DISTANCES_EXT 0x82F9 +#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA +#define GL_CLIP_DISTANCE0_EXT 0x3000 +#define GL_CLIP_DISTANCE1_EXT 0x3001 +#define GL_CLIP_DISTANCE2_EXT 0x3002 +#define GL_CLIP_DISTANCE3_EXT 0x3003 +#define GL_CLIP_DISTANCE4_EXT 0x3004 +#define GL_CLIP_DISTANCE5_EXT 0x3005 +#define GL_CLIP_DISTANCE6_EXT 0x3006 +#define GL_CLIP_DISTANCE7_EXT 0x3007 +#endif /* GL_EXT_clip_cull_distance */ + +#ifndef GL_EXT_color_buffer_float +#define GL_EXT_color_buffer_float 1 +#endif /* GL_EXT_color_buffer_float */ + +#ifndef GL_EXT_color_buffer_half_float +#define GL_EXT_color_buffer_half_float 1 +#define GL_RGBA16F_EXT 0x881A +#define GL_RGB16F_EXT 0x881B +#define GL_RG16F_EXT 0x822F +#define GL_R16F_EXT 0x822D +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211 +#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17 +#endif /* GL_EXT_color_buffer_half_float */ + +#ifndef GL_EXT_conservative_depth +#define GL_EXT_conservative_depth 1 +#endif /* GL_EXT_conservative_depth */ + +#ifndef GL_EXT_copy_image +#define GL_EXT_copy_image 1 +typedef void (GL_APIENTRYP PFNGLCOPYIMAGESUBDATAEXTPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCopyImageSubDataEXT (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +#endif +#endif /* GL_EXT_copy_image */ + +#ifndef GL_EXT_debug_label +#define GL_EXT_debug_label 1 +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 +#define GL_TRANSFORM_FEEDBACK 0x8E22 +typedef void (GL_APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); +GL_APICALL void GL_APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +#endif +#endif /* GL_EXT_debug_label */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 +typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); +GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); +GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void); +#endif +#endif /* GL_EXT_debug_marker */ + +#ifndef GL_EXT_depth_clamp +#define GL_EXT_depth_clamp 1 +#define GL_DEPTH_CLAMP_EXT 0x864F +#endif /* GL_EXT_depth_clamp */ + +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 +typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif +#endif /* GL_EXT_discard_framebuffer */ + +#ifndef GL_EXT_disjoint_timer_query +#define GL_EXT_disjoint_timer_query 1 +#define GL_QUERY_COUNTER_BITS_EXT 0x8864 +#define GL_CURRENT_QUERY_EXT 0x8865 +#define GL_QUERY_RESULT_EXT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867 +#define GL_TIME_ELAPSED_EXT 0x88BF +#define GL_TIMESTAMP_EXT 0x8E28 +#define GL_GPU_DISJOINT_EXT 0x8FBB +typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); +typedef void (GL_APIENTRYP PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTPROC) (GLuint id); +typedef void (GL_APIENTRYP PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); +typedef void (GL_APIENTRYP PFNGLENDQUERYEXTPROC) (GLenum target); +typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target); +typedef void (GL_APIENTRYP PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64 *params); +typedef void (GL_APIENTRYP PFNGLGETINTEGER64VEXTPROC) (GLenum pname, GLint64 *data); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGenQueriesEXT (GLsizei n, GLuint *ids); +GL_APICALL void GL_APIENTRY glDeleteQueriesEXT (GLsizei n, const GLuint *ids); +GL_APICALL GLboolean GL_APIENTRY glIsQueryEXT (GLuint id); +GL_APICALL void GL_APIENTRY glBeginQueryEXT (GLenum target, GLuint id); +GL_APICALL void GL_APIENTRY glEndQueryEXT (GLenum target); +GL_APICALL void GL_APIENTRY glQueryCounterEXT (GLuint id, GLenum target); +GL_APICALL void GL_APIENTRY glGetQueryivEXT (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetQueryObjectivEXT (GLuint id, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT (GLuint id, GLenum pname, GLuint *params); +GL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64 *params); +GL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64 *params); +GL_APICALL void GL_APIENTRY glGetInteger64vEXT (GLenum pname, GLint64 *data); +#endif +#endif /* GL_EXT_disjoint_timer_query */ + +#ifndef GL_EXT_draw_buffers +#define GL_EXT_draw_buffers 1 +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_MAX_DRAW_BUFFERS_EXT 0x8824 +#define GL_DRAW_BUFFER0_EXT 0x8825 +#define GL_DRAW_BUFFER1_EXT 0x8826 +#define GL_DRAW_BUFFER2_EXT 0x8827 +#define GL_DRAW_BUFFER3_EXT 0x8828 +#define GL_DRAW_BUFFER4_EXT 0x8829 +#define GL_DRAW_BUFFER5_EXT 0x882A +#define GL_DRAW_BUFFER6_EXT 0x882B +#define GL_DRAW_BUFFER7_EXT 0x882C +#define GL_DRAW_BUFFER8_EXT 0x882D +#define GL_DRAW_BUFFER9_EXT 0x882E +#define GL_DRAW_BUFFER10_EXT 0x882F +#define GL_DRAW_BUFFER11_EXT 0x8830 +#define GL_DRAW_BUFFER12_EXT 0x8831 +#define GL_DRAW_BUFFER13_EXT 0x8832 +#define GL_DRAW_BUFFER14_EXT 0x8833 +#define GL_DRAW_BUFFER15_EXT 0x8834 +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTPROC) (GLsizei n, const GLenum *bufs); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawBuffersEXT (GLsizei n, const GLenum *bufs); +#endif +#endif /* GL_EXT_draw_buffers */ + +#ifndef GL_EXT_draw_buffers_indexed +#define GL_EXT_draw_buffers_indexed 1 +typedef void (GL_APIENTRYP PFNGLENABLEIEXTPROC) (GLenum target, GLuint index); +typedef void (GL_APIENTRYP PFNGLDISABLEIEXTPROC) (GLenum target, GLuint index); +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONIEXTPROC) (GLuint buf, GLenum mode); +typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEIEXTPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GL_APIENTRYP PFNGLBLENDFUNCIEXTPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEIEXTPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GL_APIENTRYP PFNGLCOLORMASKIEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDIEXTPROC) (GLenum target, GLuint index); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glEnableiEXT (GLenum target, GLuint index); +GL_APICALL void GL_APIENTRY glDisableiEXT (GLenum target, GLuint index); +GL_APICALL void GL_APIENTRY glBlendEquationiEXT (GLuint buf, GLenum mode); +GL_APICALL void GL_APIENTRY glBlendEquationSeparateiEXT (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GL_APICALL void GL_APIENTRY glBlendFunciEXT (GLuint buf, GLenum src, GLenum dst); +GL_APICALL void GL_APIENTRY glBlendFuncSeparateiEXT (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GL_APICALL void GL_APIENTRY glColorMaskiEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GL_APICALL GLboolean GL_APIENTRY glIsEnablediEXT (GLenum target, GLuint index); +#endif +#endif /* GL_EXT_draw_buffers_indexed */ + +#ifndef GL_EXT_draw_elements_base_vertex +#define GL_EXT_draw_elements_base_vertex 1 +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +#endif +#endif /* GL_EXT_draw_elements_base_vertex */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#endif +#endif /* GL_EXT_draw_instanced */ + +#ifndef GL_EXT_draw_transform_feedback +#define GL_EXT_draw_transform_feedback 1 +typedef void (GL_APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKEXTPROC) (GLenum mode, GLuint id); +typedef void (GL_APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDEXTPROC) (GLenum mode, GLuint id, GLsizei instancecount); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawTransformFeedbackEXT (GLenum mode, GLuint id); +GL_APICALL void GL_APIENTRY glDrawTransformFeedbackInstancedEXT (GLenum mode, GLuint id, GLsizei instancecount); +#endif +#endif /* GL_EXT_draw_transform_feedback */ + +#ifndef GL_EXT_external_buffer +#define GL_EXT_external_buffer 1 +typedef void *GLeglClientBufferEXT; +typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEEXTERNALEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTERNALEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBufferStorageExternalEXT (GLenum target, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +GL_APICALL void GL_APIENTRY glNamedBufferStorageExternalEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLeglClientBufferEXT clientBuffer, GLbitfield flags); +#endif +#endif /* GL_EXT_external_buffer */ + +#ifndef GL_EXT_float_blend +#define GL_EXT_float_blend 1 +#endif /* GL_EXT_float_blend */ + +#ifndef GL_EXT_fragment_shading_rate +#define GL_EXT_fragment_shading_rate 1 +#define GL_SHADING_RATE_1X1_PIXELS_EXT 0x96A6 +#define GL_SHADING_RATE_1X2_PIXELS_EXT 0x96A7 +#define GL_SHADING_RATE_2X1_PIXELS_EXT 0x96A8 +#define GL_SHADING_RATE_2X2_PIXELS_EXT 0x96A9 +#define GL_SHADING_RATE_1X4_PIXELS_EXT 0x96AA +#define GL_SHADING_RATE_4X1_PIXELS_EXT 0x96AB +#define GL_SHADING_RATE_4X2_PIXELS_EXT 0x96AC +#define GL_SHADING_RATE_2X4_PIXELS_EXT 0x96AD +#define GL_SHADING_RATE_4X4_PIXELS_EXT 0x96AE +#define GL_SHADING_RATE_EXT 0x96D0 +#define GL_SHADING_RATE_ATTACHMENT_EXT 0x96D1 +#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_EXT 0x96D2 +#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_EXT 0x96D3 +#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_EXT 0x96D4 +#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_EXT 0x96D5 +#define GL_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_EXT 0x96D6 +#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D7 +#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_WIDTH_EXT 0x96D8 +#define GL_MIN_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96D9 +#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_HEIGHT_EXT 0x96DA +#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_TEXEL_ASPECT_RATIO_EXT 0x96DB +#define GL_MAX_FRAGMENT_SHADING_RATE_ATTACHMENT_LAYERS_EXT 0x96DC +#define GL_FRAGMENT_SHADING_RATE_WITH_SHADER_DEPTH_STENCIL_WRITES_SUPPORTED_EXT 0x96DD +#define GL_FRAGMENT_SHADING_RATE_WITH_SAMPLE_MASK_SUPPORTED_EXT 0x96DE +#define GL_FRAGMENT_SHADING_RATE_ATTACHMENT_WITH_DEFAULT_FRAMEBUFFER_SUPPORTED_EXT 0x96DF +#define GL_FRAGMENT_SHADING_RATE_NON_TRIVIAL_COMBINERS_SUPPORTED_EXT 0x8F6F +typedef void (GL_APIENTRYP PFNGLGETFRAGMENTSHADINGRATESEXTPROC) (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates); +typedef void (GL_APIENTRYP PFNGLSHADINGRATEEXTPROC) (GLenum rate); +typedef void (GL_APIENTRYP PFNGLSHADINGRATECOMBINEROPSEXTPROC) (GLenum combinerOp0, GLenum combinerOp1); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERSHADINGRATEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetFragmentShadingRatesEXT (GLsizei samples, GLsizei maxCount, GLsizei *count, GLenum *shadingRates); +GL_APICALL void GL_APIENTRY glShadingRateEXT (GLenum rate); +GL_APICALL void GL_APIENTRY glShadingRateCombinerOpsEXT (GLenum combinerOp0, GLenum combinerOp1); +GL_APICALL void GL_APIENTRY glFramebufferShadingRateEXT (GLenum target, GLenum attachment, GLuint texture, GLint baseLayer, GLsizei numLayers, GLsizei texelWidth, GLsizei texelHeight); +#endif +#endif /* GL_EXT_fragment_shading_rate */ + +#ifndef GL_EXT_geometry_point_size +#define GL_EXT_geometry_point_size 1 +#endif /* GL_EXT_geometry_point_size */ + +#ifndef GL_EXT_geometry_shader +#define GL_EXT_geometry_shader 1 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_SHADER_BIT_EXT 0x00000004 +#define GL_GEOMETRY_LINKED_VERTICES_OUT_EXT 0x8916 +#define GL_GEOMETRY_LINKED_INPUT_TYPE_EXT 0x8917 +#define GL_GEOMETRY_LINKED_OUTPUT_TYPE_EXT 0x8918 +#define GL_GEOMETRY_SHADER_INVOCATIONS_EXT 0x887F +#define GL_LAYER_PROVOKING_VERTEX_EXT 0x825E +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS_EXT 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8A32 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS_EXT 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS_EXT 0x9124 +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS_EXT 0x8E5A +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS_EXT 0x92CF +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS_EXT 0x92D5 +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS_EXT 0x90CD +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS_EXT 0x90D7 +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_UNDEFINED_VERTEX_EXT 0x8260 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS_EXT 0x9312 +#define GL_MAX_FRAMEBUFFER_LAYERS_EXT 0x9317 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_REFERENCED_BY_GEOMETRY_SHADER_EXT 0x9309 +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); +#endif +#endif /* GL_EXT_geometry_shader */ + +#ifndef GL_EXT_gpu_shader5 +#define GL_EXT_gpu_shader5 1 +#endif /* GL_EXT_gpu_shader5 */ + +#ifndef GL_EXT_instanced_arrays +#define GL_EXT_instanced_arrays 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_EXT 0x88FE +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glVertexAttribDivisorEXT (GLuint index, GLuint divisor); +#endif +#endif /* GL_EXT_instanced_arrays */ + +#ifndef GL_EXT_map_buffer_range +#define GL_EXT_map_buffer_range 1 +#define GL_MAP_READ_BIT_EXT 0x0001 +#define GL_MAP_WRITE_BIT_EXT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020 +typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void *GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length); +#endif +#endif /* GL_EXT_map_buffer_range */ + +#ifndef GL_EXT_memory_object +#define GL_EXT_memory_object 1 +#define GL_TEXTURE_TILING_EXT 0x9580 +#define GL_DEDICATED_MEMORY_OBJECT_EXT 0x9581 +#define GL_PROTECTED_MEMORY_OBJECT_EXT 0x959B +#define GL_NUM_TILING_TYPES_EXT 0x9582 +#define GL_TILING_TYPES_EXT 0x9583 +#define GL_OPTIMAL_TILING_EXT 0x9584 +#define GL_LINEAR_TILING_EXT 0x9585 +#define GL_NUM_DEVICE_UUIDS_EXT 0x9596 +#define GL_DEVICE_UUID_EXT 0x9597 +#define GL_DRIVER_UUID_EXT 0x9598 +#define GL_UUID_SIZE_EXT 16 +typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEVEXTPROC) (GLenum pname, GLubyte *data); +typedef void (GL_APIENTRYP PFNGLGETUNSIGNEDBYTEI_VEXTPROC) (GLenum target, GLuint index, GLubyte *data); +typedef void (GL_APIENTRYP PFNGLDELETEMEMORYOBJECTSEXTPROC) (GLsizei n, const GLuint *memoryObjects); +typedef GLboolean (GL_APIENTRYP PFNGLISMEMORYOBJECTEXTPROC) (GLuint memoryObject); +typedef void (GL_APIENTRYP PFNGLCREATEMEMORYOBJECTSEXTPROC) (GLsizei n, GLuint *memoryObjects); +typedef void (GL_APIENTRYP PFNGLMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, const GLint *params); +typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTPARAMETERIVEXTPROC) (GLuint memoryObject, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM2DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEMEM3DMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLBUFFERSTORAGEMEMEXTPROC) (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM2DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DEXTPROC) (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGEMEM3DMULTISAMPLEEXTPROC) (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERSTORAGEMEMEXTPROC) (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetUnsignedBytevEXT (GLenum pname, GLubyte *data); +GL_APICALL void GL_APIENTRY glGetUnsignedBytei_vEXT (GLenum target, GLuint index, GLubyte *data); +GL_APICALL void GL_APIENTRY glDeleteMemoryObjectsEXT (GLsizei n, const GLuint *memoryObjects); +GL_APICALL GLboolean GL_APIENTRY glIsMemoryObjectEXT (GLuint memoryObject); +GL_APICALL void GL_APIENTRY glCreateMemoryObjectsEXT (GLsizei n, GLuint *memoryObjects); +GL_APICALL void GL_APIENTRY glMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, const GLint *params); +GL_APICALL void GL_APIENTRY glGetMemoryObjectParameterivEXT (GLuint memoryObject, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glTexStorageMem2DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glTexStorageMem2DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glTexStorageMem3DEXT (GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glTexStorageMem3DMultisampleEXT (GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glBufferStorageMemEXT (GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glTextureStorageMem2DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glTextureStorageMem2DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glTextureStorageMem3DEXT (GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glTextureStorageMem3DMultisampleEXT (GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glNamedBufferStorageMemEXT (GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset); +#endif +#endif /* GL_EXT_memory_object */ + +#ifndef GL_EXT_memory_object_fd +#define GL_EXT_memory_object_fd 1 +#define GL_HANDLE_TYPE_OPAQUE_FD_EXT 0x9586 +typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYFDEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glImportMemoryFdEXT (GLuint memory, GLuint64 size, GLenum handleType, GLint fd); +#endif +#endif /* GL_EXT_memory_object_fd */ + +#ifndef GL_EXT_memory_object_win32 +#define GL_EXT_memory_object_win32 1 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_EXT 0x9587 +#define GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT 0x9588 +#define GL_DEVICE_LUID_EXT 0x9599 +#define GL_DEVICE_NODE_MASK_EXT 0x959A +#define GL_LUID_SIZE_EXT 8 +#define GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT 0x9589 +#define GL_HANDLE_TYPE_D3D12_RESOURCE_EXT 0x958A +#define GL_HANDLE_TYPE_D3D11_IMAGE_EXT 0x958B +#define GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT 0x958C +typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32HANDLEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, void *handle); +typedef void (GL_APIENTRYP PFNGLIMPORTMEMORYWIN32NAMEEXTPROC) (GLuint memory, GLuint64 size, GLenum handleType, const void *name); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glImportMemoryWin32HandleEXT (GLuint memory, GLuint64 size, GLenum handleType, void *handle); +GL_APICALL void GL_APIENTRY glImportMemoryWin32NameEXT (GLuint memory, GLuint64 size, GLenum handleType, const void *name); +#endif +#endif /* GL_EXT_memory_object_win32 */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +#endif +#endif /* GL_EXT_multi_draw_arrays */ + +#ifndef GL_EXT_multi_draw_indirect +#define GL_EXT_multi_draw_indirect 1 +typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTEXTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTEXTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glMultiDrawArraysIndirectEXT (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride); +GL_APICALL void GL_APIENTRY glMultiDrawElementsIndirectEXT (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride); +#endif +#endif /* GL_EXT_multi_draw_indirect */ + +#ifndef GL_EXT_multisampled_compatibility +#define GL_EXT_multisampled_compatibility 1 +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#endif /* GL_EXT_multisampled_compatibility */ + +#ifndef GL_EXT_multisampled_render_to_texture +#define GL_EXT_multisampled_render_to_texture 1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif +#endif /* GL_EXT_multisampled_render_to_texture */ + +#ifndef GL_EXT_multisampled_render_to_texture2 +#define GL_EXT_multisampled_render_to_texture2 1 +#endif /* GL_EXT_multisampled_render_to_texture2 */ + +#ifndef GL_EXT_multiview_draw_buffers +#define GL_EXT_multiview_draw_buffers 1 +#define GL_COLOR_ATTACHMENT_EXT 0x90F0 +#define GL_MULTIVIEW_EXT 0x90F1 +#define GL_DRAW_BUFFER_EXT 0x0C01 +#define GL_READ_BUFFER_EXT 0x0C02 +#define GL_MAX_MULTIVIEW_BUFFERS_EXT 0x90F2 +typedef void (GL_APIENTRYP PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); +typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices); +typedef void (GL_APIENTRYP PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glReadBufferIndexedEXT (GLenum src, GLint index); +GL_APICALL void GL_APIENTRY glDrawBuffersIndexedEXT (GLint n, const GLenum *location, const GLint *indices); +GL_APICALL void GL_APIENTRY glGetIntegeri_vEXT (GLenum target, GLuint index, GLint *data); +#endif +#endif /* GL_EXT_multiview_draw_buffers */ + +#ifndef GL_EXT_multiview_tessellation_geometry_shader +#define GL_EXT_multiview_tessellation_geometry_shader 1 +#endif /* GL_EXT_multiview_tessellation_geometry_shader */ + +#ifndef GL_EXT_multiview_texture_multisample +#define GL_EXT_multiview_texture_multisample 1 +#endif /* GL_EXT_multiview_texture_multisample */ + +#ifndef GL_EXT_multiview_timer_query +#define GL_EXT_multiview_timer_query 1 +#endif /* GL_EXT_multiview_timer_query */ + +#ifndef GL_EXT_occlusion_query_boolean +#define GL_EXT_occlusion_query_boolean 1 +#define GL_ANY_SAMPLES_PASSED_EXT 0x8C2F +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE_EXT 0x8D6A +#endif /* GL_EXT_occlusion_query_boolean */ + +#ifndef GL_EXT_polygon_offset_clamp +#define GL_EXT_polygon_offset_clamp 1 +#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B +typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glPolygonOffsetClampEXT (GLfloat factor, GLfloat units, GLfloat clamp); +#endif +#endif /* GL_EXT_polygon_offset_clamp */ + +#ifndef GL_EXT_post_depth_coverage +#define GL_EXT_post_depth_coverage 1 +#endif /* GL_EXT_post_depth_coverage */ + +#ifndef GL_EXT_primitive_bounding_box +#define GL_EXT_primitive_bounding_box 1 +#define GL_PRIMITIVE_BOUNDING_BOX_EXT 0x92BE +typedef void (GL_APIENTRYP PFNGLPRIMITIVEBOUNDINGBOXEXTPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glPrimitiveBoundingBoxEXT (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); +#endif +#endif /* GL_EXT_primitive_bounding_box */ + +#ifndef GL_EXT_protected_textures +#define GL_EXT_protected_textures 1 +#define GL_CONTEXT_FLAG_PROTECTED_CONTENT_BIT_EXT 0x00000010 +#define GL_TEXTURE_PROTECTED_EXT 0x8BFA +#endif /* GL_EXT_protected_textures */ + +#ifndef GL_EXT_pvrtc_sRGB +#define GL_EXT_pvrtc_sRGB 1 +#define GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 +#define GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG 0x93F0 +#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1 +#endif /* GL_EXT_pvrtc_sRGB */ + +#ifndef GL_EXT_raster_multisample +#define GL_EXT_raster_multisample 1 +#define GL_RASTER_MULTISAMPLE_EXT 0x9327 +#define GL_RASTER_SAMPLES_EXT 0x9328 +#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 +#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A +#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B +#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C +typedef void (GL_APIENTRYP PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations); +#endif +#endif /* GL_EXT_raster_multisample */ + +#ifndef GL_EXT_read_format_bgra +#define GL_EXT_read_format_bgra 1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 +#endif /* GL_EXT_read_format_bgra */ + +#ifndef GL_EXT_render_snorm +#define GL_EXT_render_snorm 1 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM_EXT 0x8F98 +#define GL_RG16_SNORM_EXT 0x8F99 +#define GL_RGBA16_SNORM_EXT 0x8F9B +#endif /* GL_EXT_render_snorm */ + +#ifndef GL_EXT_robustness +#define GL_EXT_robustness 1 +#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255 +#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3 +#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256 +#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252 +#define GL_NO_RESET_NOTIFICATION_EXT 0x8261 +typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); +typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void); +GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params); +#endif +#endif /* GL_EXT_robustness */ + +#ifndef GL_EXT_sRGB +#define GL_EXT_sRGB 1 +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210 +#endif /* GL_EXT_sRGB */ + +#ifndef GL_EXT_sRGB_write_control +#define GL_EXT_sRGB_write_control 1 +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#endif /* GL_EXT_sRGB_write_control */ + +#ifndef GL_EXT_semaphore +#define GL_EXT_semaphore 1 +#define GL_LAYOUT_GENERAL_EXT 0x958D +#define GL_LAYOUT_COLOR_ATTACHMENT_EXT 0x958E +#define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F +#define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590 +#define GL_LAYOUT_SHADER_READ_ONLY_EXT 0x9591 +#define GL_LAYOUT_TRANSFER_SRC_EXT 0x9592 +#define GL_LAYOUT_TRANSFER_DST_EXT 0x9593 +#define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530 +#define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531 +typedef void (GL_APIENTRYP PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores); +typedef void (GL_APIENTRYP PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores); +typedef GLboolean (GL_APIENTRYP PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore); +typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params); +typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params); +typedef void (GL_APIENTRYP PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); +typedef void (GL_APIENTRYP PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGenSemaphoresEXT (GLsizei n, GLuint *semaphores); +GL_APICALL void GL_APIENTRY glDeleteSemaphoresEXT (GLsizei n, const GLuint *semaphores); +GL_APICALL GLboolean GL_APIENTRY glIsSemaphoreEXT (GLuint semaphore); +GL_APICALL void GL_APIENTRY glSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, const GLuint64 *params); +GL_APICALL void GL_APIENTRY glGetSemaphoreParameterui64vEXT (GLuint semaphore, GLenum pname, GLuint64 *params); +GL_APICALL void GL_APIENTRY glWaitSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts); +GL_APICALL void GL_APIENTRY glSignalSemaphoreEXT (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts); +#endif +#endif /* GL_EXT_semaphore */ + +#ifndef GL_EXT_semaphore_fd +#define GL_EXT_semaphore_fd 1 +typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREFDEXTPROC) (GLuint semaphore, GLenum handleType, GLint fd); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glImportSemaphoreFdEXT (GLuint semaphore, GLenum handleType, GLint fd); +#endif +#endif /* GL_EXT_semaphore_fd */ + +#ifndef GL_EXT_semaphore_win32 +#define GL_EXT_semaphore_win32 1 +#define GL_HANDLE_TYPE_D3D12_FENCE_EXT 0x9594 +#define GL_D3D12_FENCE_VALUE_EXT 0x9595 +typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32HANDLEEXTPROC) (GLuint semaphore, GLenum handleType, void *handle); +typedef void (GL_APIENTRYP PFNGLIMPORTSEMAPHOREWIN32NAMEEXTPROC) (GLuint semaphore, GLenum handleType, const void *name); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glImportSemaphoreWin32HandleEXT (GLuint semaphore, GLenum handleType, void *handle); +GL_APICALL void GL_APIENTRY glImportSemaphoreWin32NameEXT (GLuint semaphore, GLenum handleType, const void *name); +#endif +#endif /* GL_EXT_semaphore_win32 */ + +#ifndef GL_EXT_separate_depth_stencil +#define GL_EXT_separate_depth_stencil 1 +#endif /* GL_EXT_separate_depth_stencil */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 +#define GL_ACTIVE_PROGRAM_EXT 0x8259 +#define GL_VERTEX_SHADER_BIT_EXT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT_EXT 0x00000002 +#define GL_ALL_SHADER_BITS_EXT 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE_EXT 0x8258 +#define GL_PROGRAM_PIPELINE_BINDING_EXT 0x825A +typedef void (GL_APIENTRYP PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); +typedef void (GL_APIENTRYP PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); +typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); +typedef void (GL_APIENTRYP PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glActiveShaderProgramEXT (GLuint pipeline, GLuint program); +GL_APICALL void GL_APIENTRY glBindProgramPipelineEXT (GLuint pipeline); +GL_APICALL GLuint GL_APIENTRY glCreateShaderProgramvEXT (GLenum type, GLsizei count, const GLchar **strings); +GL_APICALL void GL_APIENTRY glDeleteProgramPipelinesEXT (GLsizei n, const GLuint *pipelines); +GL_APICALL void GL_APIENTRY glGenProgramPipelinesEXT (GLsizei n, GLuint *pipelines); +GL_APICALL void GL_APIENTRY glGetProgramPipelineInfoLogEXT (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GL_APICALL void GL_APIENTRY glGetProgramPipelineivEXT (GLuint pipeline, GLenum pname, GLint *params); +GL_APICALL GLboolean GL_APIENTRY glIsProgramPipelineEXT (GLuint pipeline); +GL_APICALL void GL_APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); +GL_APICALL void GL_APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); +GL_APICALL void GL_APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); +GL_APICALL void GL_APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GL_APICALL void GL_APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); +GL_APICALL void GL_APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GL_APICALL void GL_APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GL_APICALL void GL_APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GL_APICALL void GL_APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GL_APICALL void GL_APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUseProgramStagesEXT (GLuint pipeline, GLbitfield stages, GLuint program); +GL_APICALL void GL_APIENTRY glValidateProgramPipelineEXT (GLuint pipeline); +GL_APICALL void GL_APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); +GL_APICALL void GL_APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); +GL_APICALL void GL_APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GL_APICALL void GL_APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GL_APICALL void GL_APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif +#endif /* GL_EXT_separate_shader_objects */ + +#ifndef GL_EXT_shader_framebuffer_fetch +#define GL_EXT_shader_framebuffer_fetch 1 +#define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52 +#endif /* GL_EXT_shader_framebuffer_fetch */ + +#ifndef GL_EXT_shader_framebuffer_fetch_non_coherent +#define GL_EXT_shader_framebuffer_fetch_non_coherent 1 +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierEXT (void); +#endif +#endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */ + +#ifndef GL_EXT_shader_group_vote +#define GL_EXT_shader_group_vote 1 +#endif /* GL_EXT_shader_group_vote */ + +#ifndef GL_EXT_shader_implicit_conversions +#define GL_EXT_shader_implicit_conversions 1 +#endif /* GL_EXT_shader_implicit_conversions */ + +#ifndef GL_EXT_shader_integer_mix +#define GL_EXT_shader_integer_mix 1 +#endif /* GL_EXT_shader_integer_mix */ + +#ifndef GL_EXT_shader_io_blocks +#define GL_EXT_shader_io_blocks 1 +#endif /* GL_EXT_shader_io_blocks */ + +#ifndef GL_EXT_shader_non_constant_global_initializers +#define GL_EXT_shader_non_constant_global_initializers 1 +#endif /* GL_EXT_shader_non_constant_global_initializers */ + +#ifndef GL_EXT_shader_pixel_local_storage +#define GL_EXT_shader_pixel_local_storage 1 +#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_FAST_SIZE_EXT 0x8F63 +#define GL_MAX_SHADER_PIXEL_LOCAL_STORAGE_SIZE_EXT 0x8F67 +#define GL_SHADER_PIXEL_LOCAL_STORAGE_EXT 0x8F64 +#endif /* GL_EXT_shader_pixel_local_storage */ + +#ifndef GL_EXT_shader_pixel_local_storage2 +#define GL_EXT_shader_pixel_local_storage2 1 +#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_FAST_SIZE_EXT 0x9650 +#define GL_MAX_SHADER_COMBINED_LOCAL_STORAGE_SIZE_EXT 0x9651 +#define GL_FRAMEBUFFER_INCOMPLETE_INSUFFICIENT_SHADER_COMBINED_LOCAL_STORAGE_EXT 0x9652 +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target, GLsizei size); +typedef GLsizei (GL_APIENTRYP PFNGLGETFRAMEBUFFERPIXELLOCALSTORAGESIZEEXTPROC) (GLuint target); +typedef void (GL_APIENTRYP PFNGLCLEARPIXELLOCALSTORAGEUIEXTPROC) (GLsizei offset, GLsizei n, const GLuint *values); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferPixelLocalStorageSizeEXT (GLuint target, GLsizei size); +GL_APICALL GLsizei GL_APIENTRY glGetFramebufferPixelLocalStorageSizeEXT (GLuint target); +GL_APICALL void GL_APIENTRY glClearPixelLocalStorageuiEXT (GLsizei offset, GLsizei n, const GLuint *values); +#endif +#endif /* GL_EXT_shader_pixel_local_storage2 */ + +#ifndef GL_EXT_shader_samples_identical +#define GL_EXT_shader_samples_identical 1 +#endif /* GL_EXT_shader_samples_identical */ + +#ifndef GL_EXT_shader_texture_lod +#define GL_EXT_shader_texture_lod 1 +#endif /* GL_EXT_shader_texture_lod */ + +#ifndef GL_EXT_shadow_samplers +#define GL_EXT_shadow_samplers 1 +#define GL_TEXTURE_COMPARE_MODE_EXT 0x884C +#define GL_TEXTURE_COMPARE_FUNC_EXT 0x884D +#define GL_COMPARE_REF_TO_TEXTURE_EXT 0x884E +#define GL_SAMPLER_2D_SHADOW_EXT 0x8B62 +#endif /* GL_EXT_shadow_samplers */ + +#ifndef GL_EXT_sparse_texture +#define GL_EXT_sparse_texture 1 +#define GL_TEXTURE_SPARSE_EXT 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_EXT 0x91A7 +#define GL_NUM_SPARSE_LEVELS_EXT 0x91AA +#define GL_NUM_VIRTUAL_PAGE_SIZES_EXT 0x91A8 +#define GL_VIRTUAL_PAGE_SIZE_X_EXT 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_EXT 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_EXT 0x9197 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_TEXTURE_3D 0x806F +#define GL_MAX_SPARSE_TEXTURE_SIZE_EXT 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_EXT 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_EXT 0x919A +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_EXT 0x91A9 +typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexPageCommitmentEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +#endif +#endif /* GL_EXT_sparse_texture */ + +#ifndef GL_EXT_sparse_texture2 +#define GL_EXT_sparse_texture2 1 +#endif /* GL_EXT_sparse_texture2 */ + +#ifndef GL_EXT_tessellation_point_size +#define GL_EXT_tessellation_point_size 1 +#endif /* GL_EXT_tessellation_point_size */ + +#ifndef GL_EXT_tessellation_shader +#define GL_EXT_tessellation_shader 1 +#define GL_PATCHES_EXT 0x000E +#define GL_PATCH_VERTICES_EXT 0x8E72 +#define GL_TESS_CONTROL_OUTPUT_VERTICES_EXT 0x8E75 +#define GL_TESS_GEN_MODE_EXT 0x8E76 +#define GL_TESS_GEN_SPACING_EXT 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER_EXT 0x8E78 +#define GL_TESS_GEN_POINT_MODE_EXT 0x8E79 +#define GL_ISOLINES_EXT 0x8E7A +#define GL_QUADS_EXT 0x0007 +#define GL_FRACTIONAL_ODD_EXT 0x8E7B +#define GL_FRACTIONAL_EVEN_EXT 0x8E7C +#define GL_MAX_PATCH_VERTICES_EXT 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL_EXT 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS_EXT 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS_EXT 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS_EXT 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS_EXT 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS_EXT 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS_EXT 0x8E86 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS_EXT 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS_EXT 0x8E8A +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS_EXT 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS_EXT 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS_EXT 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS_EXT 0x8E1F +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS_EXT 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS_EXT 0x92CE +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS_EXT 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS_EXT 0x92D4 +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS_EXT 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS_EXT 0x90CC +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS_EXT 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS_EXT 0x90D9 +#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 +#define GL_IS_PER_PATCH_EXT 0x92E7 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER_EXT 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER_EXT 0x9308 +#define GL_TESS_CONTROL_SHADER_EXT 0x8E88 +#define GL_TESS_EVALUATION_SHADER_EXT 0x8E87 +#define GL_TESS_CONTROL_SHADER_BIT_EXT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT_EXT 0x00000010 +typedef void (GL_APIENTRYP PFNGLPATCHPARAMETERIEXTPROC) (GLenum pname, GLint value); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glPatchParameteriEXT (GLenum pname, GLint value); +#endif +#endif /* GL_EXT_tessellation_shader */ + +#ifndef GL_EXT_texture_border_clamp +#define GL_EXT_texture_border_clamp 1 +#define GL_TEXTURE_BORDER_COLOR_EXT 0x1004 +#define GL_CLAMP_TO_BORDER_EXT 0x812D +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, const GLuint *param); +typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVEXTPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVEXTPROC) (GLuint sampler, GLenum pname, GLuint *params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); +GL_APICALL void GL_APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); +GL_APICALL void GL_APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); +GL_APICALL void GL_APIENTRY glSamplerParameterIivEXT (GLuint sampler, GLenum pname, const GLint *param); +GL_APICALL void GL_APIENTRY glSamplerParameterIuivEXT (GLuint sampler, GLenum pname, const GLuint *param); +GL_APICALL void GL_APIENTRY glGetSamplerParameterIivEXT (GLuint sampler, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivEXT (GLuint sampler, GLenum pname, GLuint *params); +#endif +#endif /* GL_EXT_texture_border_clamp */ + +#ifndef GL_EXT_texture_buffer +#define GL_EXT_texture_buffer 1 +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_TEXTURE_BUFFER_BINDING_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT_EXT 0x919F +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_TEXTURE_BUFFER_OFFSET_EXT 0x919D +#define GL_TEXTURE_BUFFER_SIZE_EXT 0x919E +typedef void (GL_APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GL_APIENTRYP PFNGLTEXBUFFERRANGEEXTPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); +GL_APICALL void GL_APIENTRY glTexBufferRangeEXT (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +#endif +#endif /* GL_EXT_texture_buffer */ + +#ifndef GL_EXT_texture_compression_astc_decode_mode +#define GL_EXT_texture_compression_astc_decode_mode 1 +#define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69 +#endif /* GL_EXT_texture_compression_astc_decode_mode */ + +#ifndef GL_EXT_texture_compression_bptc +#define GL_EXT_texture_compression_bptc 1 +#define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F +#endif /* GL_EXT_texture_compression_bptc */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#endif /* GL_EXT_texture_compression_dxt1 */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif /* GL_EXT_texture_compression_rgtc */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif /* GL_EXT_texture_compression_s3tc */ + +#ifndef GL_EXT_texture_compression_s3tc_srgb +#define GL_EXT_texture_compression_s3tc_srgb 1 +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif /* GL_EXT_texture_compression_s3tc_srgb */ + +#ifndef GL_EXT_texture_cube_map_array +#define GL_EXT_texture_cube_map_array 1 +#define GL_TEXTURE_CUBE_MAP_ARRAY_EXT 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A +#define GL_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#endif /* GL_EXT_texture_cube_map_array */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif /* GL_EXT_texture_filter_anisotropic */ + +#ifndef GL_EXT_texture_filter_minmax +#define GL_EXT_texture_filter_minmax 1 +#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 +#define GL_WEIGHTED_AVERAGE_EXT 0x9367 +#endif /* GL_EXT_texture_filter_minmax */ + +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 +#endif /* GL_EXT_texture_format_BGRA8888 */ + +#ifndef GL_EXT_texture_format_sRGB_override +#define GL_EXT_texture_format_sRGB_override 1 +#define GL_TEXTURE_FORMAT_SRGB_OVERRIDE_EXT 0x8FBF +#endif /* GL_EXT_texture_format_sRGB_override */ + +#ifndef GL_EXT_texture_mirror_clamp_to_edge +#define GL_EXT_texture_mirror_clamp_to_edge 1 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#endif /* GL_EXT_texture_mirror_clamp_to_edge */ + +#ifndef GL_EXT_texture_norm16 +#define GL_EXT_texture_norm16 1 +#define GL_R16_EXT 0x822A +#define GL_RG16_EXT 0x822C +#define GL_RGBA16_EXT 0x805B +#define GL_RGB16_EXT 0x8054 +#define GL_RGB16_SNORM_EXT 0x8F9A +#endif /* GL_EXT_texture_norm16 */ + +#ifndef GL_EXT_texture_query_lod +#define GL_EXT_texture_query_lod 1 +#endif /* GL_EXT_texture_query_lod */ + +#ifndef GL_EXT_texture_rg +#define GL_EXT_texture_rg 1 +#define GL_RED_EXT 0x1903 +#define GL_RG_EXT 0x8227 +#define GL_R8_EXT 0x8229 +#define GL_RG8_EXT 0x822B +#endif /* GL_EXT_texture_rg */ + +#ifndef GL_EXT_texture_sRGB_R8 +#define GL_EXT_texture_sRGB_R8 1 +#define GL_SR8_EXT 0x8FBD +#endif /* GL_EXT_texture_sRGB_R8 */ + +#ifndef GL_EXT_texture_sRGB_RG8 +#define GL_EXT_texture_sRGB_RG8 1 +#define GL_SRG8_EXT 0x8FBE +#endif /* GL_EXT_texture_sRGB_RG8 */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A +#endif /* GL_EXT_texture_sRGB_decode */ + +#ifndef GL_EXT_texture_shadow_lod +#define GL_EXT_texture_shadow_lod 1 +#endif /* GL_EXT_texture_shadow_lod */ + +#ifndef GL_EXT_texture_storage +#define GL_EXT_texture_storage 1 +#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F +#define GL_ALPHA8_EXT 0x803C +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_RGBA32F_EXT 0x8814 +#define GL_RGB32F_EXT 0x8815 +#define GL_ALPHA32F_EXT 0x8816 +#define GL_LUMINANCE32F_EXT 0x8818 +#define GL_LUMINANCE_ALPHA32F_EXT 0x8819 +#define GL_ALPHA16F_EXT 0x881C +#define GL_LUMINANCE16F_EXT 0x881E +#define GL_LUMINANCE_ALPHA16F_EXT 0x881F +#define GL_R32F_EXT 0x822E +#define GL_RG32F_EXT 0x8230 +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GL_APICALL void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +GL_APICALL void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +GL_APICALL void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +#endif +#endif /* GL_EXT_texture_storage */ + +#ifndef GL_EXT_texture_storage_compression +#define GL_EXT_texture_storage_compression 1 +#define GL_NUM_SURFACE_COMPRESSION_FIXED_RATES_EXT 0x8F6E +#define GL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x96C4 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x96C5 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x96C6 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x96C7 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x96C8 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x96C9 +#define GL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x96CA +#define GL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x96CB +#define GL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x96CC +#define GL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x96CD +#define GL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x96CE +#define GL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x96CF +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEATTRIBS2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, const GLint* attrib_list); +typedef void (GL_APIENTRYP PFNGLTEXSTORAGEATTRIBS3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, const GLint* attrib_list); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexStorageAttribs2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, const GLint* attrib_list); +GL_APICALL void GL_APIENTRY glTexStorageAttribs3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, const GLint* attrib_list); +#endif +#endif /* GL_EXT_texture_storage_compression */ + +#ifndef GL_EXT_texture_type_2_10_10_10_REV +#define GL_EXT_texture_type_2_10_10_10_REV 1 +#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 +#endif /* GL_EXT_texture_type_2_10_10_10_REV */ + +#ifndef GL_EXT_texture_view +#define GL_EXT_texture_view 1 +#define GL_TEXTURE_VIEW_MIN_LEVEL_EXT 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS_EXT 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER_EXT 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS_EXT 0x82DE +typedef void (GL_APIENTRYP PFNGLTEXTUREVIEWEXTPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTextureViewEXT (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); +#endif +#endif /* GL_EXT_texture_view */ + +#ifndef GL_EXT_unpack_subimage +#define GL_EXT_unpack_subimage 1 +#define GL_UNPACK_ROW_LENGTH_EXT 0x0CF2 +#define GL_UNPACK_SKIP_ROWS_EXT 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS_EXT 0x0CF4 +#endif /* GL_EXT_unpack_subimage */ + +#ifndef GL_EXT_win32_keyed_mutex +#define GL_EXT_win32_keyed_mutex 1 +typedef GLboolean (GL_APIENTRYP PFNGLACQUIREKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key, GLuint timeout); +typedef GLboolean (GL_APIENTRYP PFNGLRELEASEKEYEDMUTEXWIN32EXTPROC) (GLuint memory, GLuint64 key); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLboolean GL_APIENTRY glAcquireKeyedMutexWin32EXT (GLuint memory, GLuint64 key, GLuint timeout); +GL_APICALL GLboolean GL_APIENTRY glReleaseKeyedMutexWin32EXT (GLuint memory, GLuint64 key); +#endif +#endif /* GL_EXT_win32_keyed_mutex */ + +#ifndef GL_EXT_window_rectangles +#define GL_EXT_window_rectangles 1 +#define GL_INCLUSIVE_EXT 0x8F10 +#define GL_EXCLUSIVE_EXT 0x8F11 +#define GL_WINDOW_RECTANGLE_EXT 0x8F12 +#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13 +#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14 +#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15 +typedef void (GL_APIENTRYP PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint *box); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glWindowRectanglesEXT (GLenum mode, GLsizei count, const GLint *box); +#endif +#endif /* GL_EXT_window_rectangles */ + +#ifndef GL_FJ_shader_binary_GCCSO +#define GL_FJ_shader_binary_GCCSO 1 +#define GL_GCCSO_SHADER_BINARY_FJ 0x9260 +#endif /* GL_FJ_shader_binary_GCCSO */ + +#ifndef GL_IMG_bindless_texture +#define GL_IMG_bindless_texture 1 +typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLEIMGPROC) (GLuint texture); +typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLEIMGPROC) (GLuint texture, GLuint sampler); +typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64IMGPROC) (GLint location, GLuint64 value); +typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VIMGPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64IMGPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VIMGPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleIMG (GLuint texture); +GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleIMG (GLuint texture, GLuint sampler); +GL_APICALL void GL_APIENTRY glUniformHandleui64IMG (GLint location, GLuint64 value); +GL_APICALL void GL_APIENTRY glUniformHandleui64vIMG (GLint location, GLsizei count, const GLuint64 *value); +GL_APICALL void GL_APIENTRY glProgramUniformHandleui64IMG (GLuint program, GLint location, GLuint64 value); +GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vIMG (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +#endif +#endif /* GL_IMG_bindless_texture */ + +#ifndef GL_IMG_framebuffer_downsample +#define GL_IMG_framebuffer_downsample 1 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_AND_DOWNSAMPLE_IMG 0x913C +#define GL_NUM_DOWNSAMPLE_SCALES_IMG 0x913D +#define GL_DOWNSAMPLE_SCALES_IMG 0x913E +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SCALE_IMG 0x913F +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DDOWNSAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint xscale, GLint yscale); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERDOWNSAMPLEIMGPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer, GLint xscale, GLint yscale); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferTexture2DDownsampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint xscale, GLint yscale); +GL_APICALL void GL_APIENTRY glFramebufferTextureLayerDownsampleIMG (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer, GLint xscale, GLint yscale); +#endif +#endif /* GL_IMG_framebuffer_downsample */ + +#ifndef GL_IMG_multisampled_render_to_texture +#define GL_IMG_multisampled_render_to_texture 1 +#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 +#define GL_MAX_SAMPLES_IMG 0x9135 +#define GL_TEXTURE_SAMPLES_IMG 0x9136 +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif +#endif /* GL_IMG_multisampled_render_to_texture */ + +#ifndef GL_IMG_program_binary +#define GL_IMG_program_binary 1 +#define GL_SGX_PROGRAM_BINARY_IMG 0x9130 +#endif /* GL_IMG_program_binary */ + +#ifndef GL_IMG_read_format +#define GL_IMG_read_format 1 +#define GL_BGRA_IMG 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 +#endif /* GL_IMG_read_format */ + +#ifndef GL_IMG_shader_binary +#define GL_IMG_shader_binary 1 +#define GL_SGX_BINARY_IMG 0x8C0A +#endif /* GL_IMG_shader_binary */ + +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_IMG_texture_compression_pvrtc 1 +#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 +#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 +#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 +#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 +#endif /* GL_IMG_texture_compression_pvrtc */ + +#ifndef GL_IMG_texture_compression_pvrtc2 +#define GL_IMG_texture_compression_pvrtc2 1 +#define GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG 0x9137 +#define GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG 0x9138 +#endif /* GL_IMG_texture_compression_pvrtc2 */ + +#ifndef GL_IMG_texture_filter_cubic +#define GL_IMG_texture_filter_cubic 1 +#define GL_CUBIC_IMG 0x9139 +#define GL_CUBIC_MIPMAP_NEAREST_IMG 0x913A +#define GL_CUBIC_MIPMAP_LINEAR_IMG 0x913B +#endif /* GL_IMG_texture_filter_cubic */ + +#ifndef GL_INTEL_blackhole_render +#define GL_INTEL_blackhole_render 1 +#define GL_BLACKHOLE_RENDER_INTEL 0x83FC +#endif /* GL_INTEL_blackhole_render */ + +#ifndef GL_INTEL_conservative_rasterization +#define GL_INTEL_conservative_rasterization 1 +#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE +#endif /* GL_INTEL_conservative_rasterization */ + +#ifndef GL_INTEL_framebuffer_CMAA +#define GL_INTEL_framebuffer_CMAA 1 +typedef void (GL_APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glApplyFramebufferAttachmentCMAAINTEL (void); +#endif +#endif /* GL_INTEL_framebuffer_CMAA */ + +#ifndef GL_INTEL_performance_query +#define GL_INTEL_performance_query 1 +#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 +#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 +#define GL_PERFQUERY_WAIT_INTEL 0x83FB +#define GL_PERFQUERY_FLUSH_INTEL 0x83FA +#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 +#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 +#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 +#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 +#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 +#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 +#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 +#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 +#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 +#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA +#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB +#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC +#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD +#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE +#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF +#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 +typedef void (GL_APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GL_APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); +typedef void (GL_APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GL_APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); +typedef void (GL_APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); +typedef void (GL_APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); +typedef void (GL_APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); +typedef void (GL_APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); +typedef void (GL_APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); +GL_APICALL void GL_APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); +GL_APICALL void GL_APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); +GL_APICALL void GL_APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); +GL_APICALL void GL_APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); +GL_APICALL void GL_APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); +GL_APICALL void GL_APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); +GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); +GL_APICALL void GL_APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); +GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); +#endif +#endif /* GL_INTEL_performance_query */ + +#ifndef GL_MESA_bgra +#define GL_MESA_bgra 1 +#define GL_BGR_EXT 0x80E0 +#endif /* GL_MESA_bgra */ + +#ifndef GL_MESA_framebuffer_flip_x +#define GL_MESA_framebuffer_flip_x 1 +#define GL_FRAMEBUFFER_FLIP_X_MESA 0x8BBC +#endif /* GL_MESA_framebuffer_flip_x */ + +#ifndef GL_MESA_framebuffer_flip_y +#define GL_MESA_framebuffer_flip_y 1 +#define GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERPARAMETERIMESAPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVMESAPROC) (GLenum target, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferParameteriMESA (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glGetFramebufferParameterivMESA (GLenum target, GLenum pname, GLint *params); +#endif +#endif /* GL_MESA_framebuffer_flip_y */ + +#ifndef GL_MESA_framebuffer_swap_xy +#define GL_MESA_framebuffer_swap_xy 1 +#define GL_FRAMEBUFFER_SWAP_XY_MESA 0x8BBD +#endif /* GL_MESA_framebuffer_swap_xy */ + +#ifndef GL_MESA_program_binary_formats +#define GL_MESA_program_binary_formats 1 +#define GL_PROGRAM_BINARY_FORMAT_MESA 0x875F +#endif /* GL_MESA_program_binary_formats */ + +#ifndef GL_MESA_shader_integer_functions +#define GL_MESA_shader_integer_functions 1 +#endif /* GL_MESA_shader_integer_functions */ + +#ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers +#define GL_NVX_blend_equation_advanced_multi_draw_buffers 1 +#endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 +typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GL_APIENTRYP PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GL_APIENTRYP PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef GLuint64 (GL_APIENTRYP PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GL_APIENTRYP PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GL_APIENTRYP PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64 *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GL_APIENTRYP PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleNV (GLuint texture); +GL_APICALL GLuint64 GL_APIENTRY glGetTextureSamplerHandleNV (GLuint texture, GLuint sampler); +GL_APICALL void GL_APIENTRY glMakeTextureHandleResidentNV (GLuint64 handle); +GL_APICALL void GL_APIENTRY glMakeTextureHandleNonResidentNV (GLuint64 handle); +GL_APICALL GLuint64 GL_APIENTRY glGetImageHandleNV (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +GL_APICALL void GL_APIENTRY glMakeImageHandleResidentNV (GLuint64 handle, GLenum access); +GL_APICALL void GL_APIENTRY glMakeImageHandleNonResidentNV (GLuint64 handle); +GL_APICALL void GL_APIENTRY glUniformHandleui64NV (GLint location, GLuint64 value); +GL_APICALL void GL_APIENTRY glUniformHandleui64vNV (GLint location, GLsizei count, const GLuint64 *value); +GL_APICALL void GL_APIENTRY glProgramUniformHandleui64NV (GLuint program, GLint location, GLuint64 value); +GL_APICALL void GL_APIENTRY glProgramUniformHandleui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64 *values); +GL_APICALL GLboolean GL_APIENTRY glIsTextureHandleResidentNV (GLuint64 handle); +GL_APICALL GLboolean GL_APIENTRY glIsImageHandleResidentNV (GLuint64 handle); +#endif +#endif /* GL_NV_bindless_texture */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLUE_NV 0x1905 +#define GL_COLORBURN_NV 0x929A +#define GL_COLORDODGE_NV 0x9299 +#define GL_CONJOINT_NV 0x9284 +#define GL_CONTRAST_NV 0x92A1 +#define GL_DARKEN_NV 0x9297 +#define GL_DIFFERENCE_NV 0x929E +#define GL_DISJOINT_NV 0x9283 +#define GL_DST_ATOP_NV 0x928F +#define GL_DST_IN_NV 0x928B +#define GL_DST_NV 0x9287 +#define GL_DST_OUT_NV 0x928D +#define GL_DST_OVER_NV 0x9289 +#define GL_EXCLUSION_NV 0x92A0 +#define GL_GREEN_NV 0x1904 +#define GL_HARDLIGHT_NV 0x929B +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_INVERT_OVG_NV 0x92B4 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LIGHTEN_NV 0x9298 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_MINUS_NV 0x929F +#define GL_MULTIPLY_NV 0x9294 +#define GL_OVERLAY_NV 0x9296 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_PLUS_NV 0x9291 +#define GL_RED_NV 0x1903 +#define GL_SCREEN_NV 0x9295 +#define GL_SOFTLIGHT_NV 0x929C +#define GL_SRC_ATOP_NV 0x928E +#define GL_SRC_IN_NV 0x928A +#define GL_SRC_NV 0x9286 +#define GL_SRC_OUT_NV 0x928C +#define GL_SRC_OVER_NV 0x9288 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_XOR_NV 0x1506 +typedef void (GL_APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); +typedef void (GL_APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBlendParameteriNV (GLenum pname, GLint value); +GL_APICALL void GL_APIENTRY glBlendBarrierNV (void); +#endif +#endif /* GL_NV_blend_equation_advanced */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#endif /* GL_NV_blend_equation_advanced_coherent */ + +#ifndef GL_NV_blend_minmax_factor +#define GL_NV_blend_minmax_factor 1 +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D +#endif /* GL_NV_blend_minmax_factor */ + +#ifndef GL_NV_clip_space_w_scaling +#define GL_NV_clip_space_w_scaling 1 +#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C +#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D +#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E +typedef void (GL_APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff); +#endif +#endif /* GL_NV_clip_space_w_scaling */ + +#ifndef GL_NV_compute_shader_derivatives +#define GL_NV_compute_shader_derivatives 1 +#endif /* GL_NV_compute_shader_derivatives */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +typedef void (GL_APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (GL_APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); +GL_APICALL void GL_APIENTRY glEndConditionalRenderNV (void); +#endif +#endif /* GL_NV_conditional_render */ + +#ifndef GL_NV_conservative_raster +#define GL_NV_conservative_raster 1 +#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 +#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 +#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 +#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 +typedef void (GL_APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits); +#endif +#endif /* GL_NV_conservative_raster */ + +#ifndef GL_NV_conservative_raster_pre_snap +#define GL_NV_conservative_raster_pre_snap 1 +#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV 0x9550 +#endif /* GL_NV_conservative_raster_pre_snap */ + +#ifndef GL_NV_conservative_raster_pre_snap_triangles +#define GL_NV_conservative_raster_pre_snap_triangles 1 +#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D +#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E +#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F +typedef void (GL_APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param); +#endif +#endif /* GL_NV_conservative_raster_pre_snap_triangles */ + +#ifndef GL_NV_copy_buffer +#define GL_NV_copy_buffer 1 +#define GL_COPY_READ_BUFFER_NV 0x8F36 +#define GL_COPY_WRITE_BUFFER_NV 0x8F37 +typedef void (GL_APIENTRYP PFNGLCOPYBUFFERSUBDATANVPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCopyBufferSubDataNV (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#endif +#endif /* GL_NV_copy_buffer */ + +#ifndef GL_NV_coverage_sample +#define GL_NV_coverage_sample 1 +#define GL_COVERAGE_COMPONENT_NV 0x8ED0 +#define GL_COVERAGE_COMPONENT4_NV 0x8ED1 +#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 +#define GL_COVERAGE_BUFFERS_NV 0x8ED3 +#define GL_COVERAGE_SAMPLES_NV 0x8ED4 +#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 +#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 +#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 +#define GL_COVERAGE_BUFFER_BIT_NV 0x00008000 +typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); +typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); +GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); +#endif +#endif /* GL_NV_coverage_sample */ + +#ifndef GL_NV_depth_nonlinear +#define GL_NV_depth_nonlinear 1 +#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C +#endif /* GL_NV_depth_nonlinear */ + +#ifndef GL_NV_draw_buffers +#define GL_NV_draw_buffers 1 +#define GL_MAX_DRAW_BUFFERS_NV 0x8824 +#define GL_DRAW_BUFFER0_NV 0x8825 +#define GL_DRAW_BUFFER1_NV 0x8826 +#define GL_DRAW_BUFFER2_NV 0x8827 +#define GL_DRAW_BUFFER3_NV 0x8828 +#define GL_DRAW_BUFFER4_NV 0x8829 +#define GL_DRAW_BUFFER5_NV 0x882A +#define GL_DRAW_BUFFER6_NV 0x882B +#define GL_DRAW_BUFFER7_NV 0x882C +#define GL_DRAW_BUFFER8_NV 0x882D +#define GL_DRAW_BUFFER9_NV 0x882E +#define GL_DRAW_BUFFER10_NV 0x882F +#define GL_DRAW_BUFFER11_NV 0x8830 +#define GL_DRAW_BUFFER12_NV 0x8831 +#define GL_DRAW_BUFFER13_NV 0x8832 +#define GL_DRAW_BUFFER14_NV 0x8833 +#define GL_DRAW_BUFFER15_NV 0x8834 +#define GL_COLOR_ATTACHMENT0_NV 0x8CE0 +#define GL_COLOR_ATTACHMENT1_NV 0x8CE1 +#define GL_COLOR_ATTACHMENT2_NV 0x8CE2 +#define GL_COLOR_ATTACHMENT3_NV 0x8CE3 +#define GL_COLOR_ATTACHMENT4_NV 0x8CE4 +#define GL_COLOR_ATTACHMENT5_NV 0x8CE5 +#define GL_COLOR_ATTACHMENT6_NV 0x8CE6 +#define GL_COLOR_ATTACHMENT7_NV 0x8CE7 +#define GL_COLOR_ATTACHMENT8_NV 0x8CE8 +#define GL_COLOR_ATTACHMENT9_NV 0x8CE9 +#define GL_COLOR_ATTACHMENT10_NV 0x8CEA +#define GL_COLOR_ATTACHMENT11_NV 0x8CEB +#define GL_COLOR_ATTACHMENT12_NV 0x8CEC +#define GL_COLOR_ATTACHMENT13_NV 0x8CED +#define GL_COLOR_ATTACHMENT14_NV 0x8CEE +#define GL_COLOR_ATTACHMENT15_NV 0x8CEF +typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs); +#endif +#endif /* GL_NV_draw_buffers */ + +#ifndef GL_NV_draw_instanced +#define GL_NV_draw_instanced 1 +typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawArraysInstancedNV (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GL_APICALL void GL_APIENTRY glDrawElementsInstancedNV (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +#endif +#endif /* GL_NV_draw_instanced */ + +#ifndef GL_NV_draw_vulkan_image +#define GL_NV_draw_vulkan_image 1 +typedef void (GL_APIENTRY *GLVULKANPROCNV)(void); +typedef void (GL_APIENTRYP PFNGLDRAWVKIMAGENVPROC) (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +typedef GLVULKANPROCNV (GL_APIENTRYP PFNGLGETVKPROCADDRNVPROC) (const GLchar *name); +typedef void (GL_APIENTRYP PFNGLWAITVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); +typedef void (GL_APIENTRYP PFNGLSIGNALVKSEMAPHORENVPROC) (GLuint64 vkSemaphore); +typedef void (GL_APIENTRYP PFNGLSIGNALVKFENCENVPROC) (GLuint64 vkFence); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawVkImageNV (GLuint64 vkImage, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); +GL_APICALL GLVULKANPROCNV GL_APIENTRY glGetVkProcAddrNV (const GLchar *name); +GL_APICALL void GL_APIENTRY glWaitVkSemaphoreNV (GLuint64 vkSemaphore); +GL_APICALL void GL_APIENTRY glSignalVkSemaphoreNV (GLuint64 vkSemaphore); +GL_APICALL void GL_APIENTRY glSignalVkFenceNV (GLuint64 vkFence); +#endif +#endif /* GL_NV_draw_vulkan_image */ + +#ifndef GL_NV_explicit_attrib_location +#define GL_NV_explicit_attrib_location 1 +#endif /* GL_NV_explicit_attrib_location */ + +#ifndef GL_NV_fbo_color_attachments +#define GL_NV_fbo_color_attachments 1 +#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF +#endif /* GL_NV_fbo_color_attachments */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence); +GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence); +GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence); +GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition); +#endif +#endif /* GL_NV_fence */ + +#ifndef GL_NV_fill_rectangle +#define GL_NV_fill_rectangle 1 +#define GL_FILL_RECTANGLE_NV 0x933C +#endif /* GL_NV_fill_rectangle */ + +#ifndef GL_NV_fragment_coverage_to_color +#define GL_NV_fragment_coverage_to_color 1 +#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD +#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE +typedef void (GL_APIENTRYP PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFragmentCoverageColorNV (GLuint color); +#endif +#endif /* GL_NV_fragment_coverage_to_color */ + +#ifndef GL_NV_fragment_shader_barycentric +#define GL_NV_fragment_shader_barycentric 1 +#endif /* GL_NV_fragment_shader_barycentric */ + +#ifndef GL_NV_fragment_shader_interlock +#define GL_NV_fragment_shader_interlock 1 +#endif /* GL_NV_fragment_shader_interlock */ + +#ifndef GL_NV_framebuffer_blit +#define GL_NV_framebuffer_blit 1 +#define GL_READ_FRAMEBUFFER_NV 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_NV 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_NV 0x8CA6 +#define GL_READ_FRAMEBUFFER_BINDING_NV 0x8CAA +typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERNVPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBlitFramebufferNV (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif +#endif /* GL_NV_framebuffer_blit */ + +#ifndef GL_NV_framebuffer_mixed_samples +#define GL_NV_framebuffer_mixed_samples 1 +#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 +#define GL_COLOR_SAMPLES_NV 0x8E20 +#define GL_DEPTH_SAMPLES_NV 0x932D +#define GL_STENCIL_SAMPLES_NV 0x932E +#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F +#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 +#define GL_COVERAGE_MODULATION_NV 0x9332 +#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 +typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufSize, GLfloat *v); +typedef void (GL_APIENTRYP PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCoverageModulationTableNV (GLsizei n, const GLfloat *v); +GL_APICALL void GL_APIENTRY glGetCoverageModulationTableNV (GLsizei bufSize, GLfloat *v); +GL_APICALL void GL_APIENTRY glCoverageModulationNV (GLenum components); +#endif +#endif /* GL_NV_framebuffer_mixed_samples */ + +#ifndef GL_NV_framebuffer_multisample +#define GL_NV_framebuffer_multisample 1 +#define GL_RENDERBUFFER_SAMPLES_NV 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_NV 0x8D56 +#define GL_MAX_SAMPLES_NV 0x8D57 +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleNV (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif +#endif /* GL_NV_framebuffer_multisample */ + +#ifndef GL_NV_generate_mipmap_sRGB +#define GL_NV_generate_mipmap_sRGB 1 +#endif /* GL_NV_generate_mipmap_sRGB */ + +#ifndef GL_NV_geometry_shader_passthrough +#define GL_NV_geometry_shader_passthrough 1 +#endif /* GL_NV_geometry_shader_passthrough */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 +typedef khronos_int64_t GLint64EXT; +typedef khronos_uint64_t GLuint64EXT; +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +#define GL_PATCHES 0x000E +typedef void (GL_APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GL_APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GL_APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GL_APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GL_APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GL_APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GL_APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GL_APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GL_APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (GL_APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (GL_APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (GL_APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); +GL_APICALL void GL_APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); +GL_APICALL void GL_APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GL_APICALL void GL_APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GL_APICALL void GL_APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GL_APICALL void GL_APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GL_APICALL void GL_APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GL_APICALL void GL_APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GL_APICALL void GL_APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); +GL_APICALL void GL_APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); +GL_APICALL void GL_APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GL_APICALL void GL_APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GL_APICALL void GL_APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GL_APICALL void GL_APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GL_APICALL void GL_APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GL_APICALL void GL_APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GL_APICALL void GL_APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); +GL_APICALL void GL_APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); +GL_APICALL void GL_APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +GL_APICALL void GL_APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GL_APICALL void GL_APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GL_APICALL void GL_APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GL_APICALL void GL_APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GL_APICALL void GL_APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GL_APICALL void GL_APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GL_APICALL void GL_APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); +GL_APICALL void GL_APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +GL_APICALL void GL_APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GL_APICALL void GL_APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GL_APICALL void GL_APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GL_APICALL void GL_APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GL_APICALL void GL_APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GL_APICALL void GL_APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif +#endif /* GL_NV_gpu_shader5 */ + +#ifndef GL_NV_image_formats +#define GL_NV_image_formats 1 +#endif /* GL_NV_image_formats */ + +#ifndef GL_NV_instanced_arrays +#define GL_NV_instanced_arrays 1 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_NV 0x88FE +typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glVertexAttribDivisorNV (GLuint index, GLuint divisor); +#endif +#endif /* GL_NV_instanced_arrays */ + +#ifndef GL_NV_internalformat_sample_query +#define GL_NV_internalformat_sample_query 1 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_MULTISAMPLES_NV 0x9371 +#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 +#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 +#define GL_CONFORMANT_NV 0x9374 +typedef void (GL_APIENTRYP PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetInternalformatSampleivNV (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei count, GLint *params); +#endif +#endif /* GL_NV_internalformat_sample_query */ + +#ifndef GL_NV_memory_attachment +#define GL_NV_memory_attachment 1 +#define GL_ATTACHED_MEMORY_OBJECT_NV 0x95A4 +#define GL_ATTACHED_MEMORY_OFFSET_NV 0x95A5 +#define GL_MEMORY_ATTACHABLE_ALIGNMENT_NV 0x95A6 +#define GL_MEMORY_ATTACHABLE_SIZE_NV 0x95A7 +#define GL_MEMORY_ATTACHABLE_NV 0x95A8 +#define GL_DETACHED_MEMORY_INCARNATION_NV 0x95A9 +#define GL_DETACHED_TEXTURES_NV 0x95AA +#define GL_DETACHED_BUFFERS_NV 0x95AB +#define GL_MAX_DETACHED_TEXTURES_NV 0x95AC +#define GL_MAX_DETACHED_BUFFERS_NV 0x95AD +typedef void (GL_APIENTRYP PFNGLGETMEMORYOBJECTDETACHEDRESOURCESUIVNVPROC) (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); +typedef void (GL_APIENTRYP PFNGLRESETMEMORYOBJECTPARAMETERNVPROC) (GLuint memory, GLenum pname); +typedef void (GL_APIENTRYP PFNGLTEXATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLBUFFERATTACHMEMORYNVPROC) (GLenum target, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLTEXTUREATTACHMEMORYNVPROC) (GLuint texture, GLuint memory, GLuint64 offset); +typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERATTACHMEMORYNVPROC) (GLuint buffer, GLuint memory, GLuint64 offset); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetMemoryObjectDetachedResourcesuivNV (GLuint memory, GLenum pname, GLint first, GLsizei count, GLuint *params); +GL_APICALL void GL_APIENTRY glResetMemoryObjectParameterNV (GLuint memory, GLenum pname); +GL_APICALL void GL_APIENTRY glTexAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glBufferAttachMemoryNV (GLenum target, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glTextureAttachMemoryNV (GLuint texture, GLuint memory, GLuint64 offset); +GL_APICALL void GL_APIENTRY glNamedBufferAttachMemoryNV (GLuint buffer, GLuint memory, GLuint64 offset); +#endif +#endif /* GL_NV_memory_attachment */ + +#ifndef GL_NV_memory_object_sparse +#define GL_NV_memory_object_sparse 1 +typedef void (GL_APIENTRYP PFNGLBUFFERPAGECOMMITMENTMEMNVPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +typedef void (GL_APIENTRYP PFNGLTEXPAGECOMMITMENTMEMNVPROC) (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +typedef void (GL_APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTMEMNVPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +typedef void (GL_APIENTRYP PFNGLTEXTUREPAGECOMMITMENTMEMNVPROC) (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBufferPageCommitmentMemNV (GLenum target, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +GL_APICALL void GL_APIENTRY glTexPageCommitmentMemNV (GLenum target, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +GL_APICALL void GL_APIENTRY glNamedBufferPageCommitmentMemNV (GLuint buffer, GLintptr offset, GLsizeiptr size, GLuint memory, GLuint64 memOffset, GLboolean commit); +GL_APICALL void GL_APIENTRY glTexturePageCommitmentMemNV (GLuint texture, GLint layer, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset, GLboolean commit); +#endif +#endif /* GL_NV_memory_object_sparse */ + +#ifndef GL_NV_mesh_shader +#define GL_NV_mesh_shader 1 +#define GL_MESH_SHADER_NV 0x9559 +#define GL_TASK_SHADER_NV 0x955A +#define GL_MAX_MESH_UNIFORM_BLOCKS_NV 0x8E60 +#define GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV 0x8E61 +#define GL_MAX_MESH_IMAGE_UNIFORMS_NV 0x8E62 +#define GL_MAX_MESH_UNIFORM_COMPONENTS_NV 0x8E63 +#define GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV 0x8E64 +#define GL_MAX_MESH_ATOMIC_COUNTERS_NV 0x8E65 +#define GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV 0x8E66 +#define GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV 0x8E67 +#define GL_MAX_TASK_UNIFORM_BLOCKS_NV 0x8E68 +#define GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV 0x8E69 +#define GL_MAX_TASK_IMAGE_UNIFORMS_NV 0x8E6A +#define GL_MAX_TASK_UNIFORM_COMPONENTS_NV 0x8E6B +#define GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV 0x8E6C +#define GL_MAX_TASK_ATOMIC_COUNTERS_NV 0x8E6D +#define GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV 0x8E6E +#define GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV 0x8E6F +#define GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV 0x95A2 +#define GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV 0x95A3 +#define GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV 0x9536 +#define GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV 0x9537 +#define GL_MAX_MESH_OUTPUT_VERTICES_NV 0x9538 +#define GL_MAX_MESH_OUTPUT_PRIMITIVES_NV 0x9539 +#define GL_MAX_TASK_OUTPUT_COUNT_NV 0x953A +#define GL_MAX_DRAW_MESH_TASKS_COUNT_NV 0x953D +#define GL_MAX_MESH_VIEWS_NV 0x9557 +#define GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV 0x92DF +#define GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV 0x9543 +#define GL_MAX_MESH_WORK_GROUP_SIZE_NV 0x953B +#define GL_MAX_TASK_WORK_GROUP_SIZE_NV 0x953C +#define GL_MESH_WORK_GROUP_SIZE_NV 0x953E +#define GL_TASK_WORK_GROUP_SIZE_NV 0x953F +#define GL_MESH_VERTICES_OUT_NV 0x9579 +#define GL_MESH_PRIMITIVES_OUT_NV 0x957A +#define GL_MESH_OUTPUT_TYPE_NV 0x957B +#define GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV 0x959C +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV 0x959D +#define GL_REFERENCED_BY_MESH_SHADER_NV 0x95A0 +#define GL_REFERENCED_BY_TASK_SHADER_NV 0x95A1 +#define GL_MESH_SHADER_BIT_NV 0x00000040 +#define GL_TASK_SHADER_BIT_NV 0x00000080 +#define GL_MESH_SUBROUTINE_NV 0x957C +#define GL_TASK_SUBROUTINE_NV 0x957D +#define GL_MESH_SUBROUTINE_UNIFORM_NV 0x957E +#define GL_TASK_SUBROUTINE_UNIFORM_NV 0x957F +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV 0x959E +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV 0x959F +typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSNVPROC) (GLuint first, GLuint count); +typedef void (GL_APIENTRYP PFNGLDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTNVPROC) (GLintptr indirect, GLsizei drawcount, GLsizei stride); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWMESHTASKSINDIRECTCOUNTNVPROC) (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDrawMeshTasksNV (GLuint first, GLuint count); +GL_APICALL void GL_APIENTRY glDrawMeshTasksIndirectNV (GLintptr indirect); +GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectNV (GLintptr indirect, GLsizei drawcount, GLsizei stride); +GL_APICALL void GL_APIENTRY glMultiDrawMeshTasksIndirectCountNV (GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +#endif +#endif /* GL_NV_mesh_shader */ + +#ifndef GL_NV_non_square_matrices +#define GL_NV_non_square_matrices 1 +#define GL_FLOAT_MAT2x3_NV 0x8B65 +#define GL_FLOAT_MAT2x4_NV 0x8B66 +#define GL_FLOAT_MAT3x2_NV 0x8B67 +#define GL_FLOAT_MAT3x4_NV 0x8B68 +#define GL_FLOAT_MAT4x2_NV 0x8B69 +#define GL_FLOAT_MAT4x3_NV 0x8B6A +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X2FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3X4FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4X3FVNVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glUniformMatrix2x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix3x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix2x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix4x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix3x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif +#endif /* GL_NV_non_square_matrices */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 +typedef double GLdouble; +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_CLOSE_PATH_NV 0x00 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_BOLD_BIT_NV 0x01 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 +#define GL_ROUNDED_RECT_NV 0xE8 +#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 +#define GL_ROUNDED_RECT2_NV 0xEA +#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB +#define GL_ROUNDED_RECT4_NV 0xEC +#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED +#define GL_ROUNDED_RECT8_NV 0xEE +#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF +#define GL_RELATIVE_RECT_NV 0xF7 +#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 +#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 +#define GL_FONT_UNAVAILABLE_NV 0x936A +#define GL_FONT_UNINTELLIGIBLE_NV 0x936B +#define GL_CONIC_CURVE_TO_NV 0x1A +#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B +#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 +#define GL_STANDARD_FONT_FORMAT_NV 0x936C +#define GL_PATH_PROJECTION_NV 0x1701 +#define GL_PATH_MODELVIEW_NV 0x1700 +#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 +#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 +#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 +#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 +#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 +#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 +#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 +#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 +#define GL_FRAGMENT_INPUT_NV 0x936D +typedef GLuint (GL_APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GL_APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLboolean (GL_APIENTRYP PFNGLISPATHNVPROC) (GLuint path); +typedef void (GL_APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GL_APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GL_APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GL_APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +typedef void (GL_APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); +typedef void (GL_APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GL_APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GL_APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); +typedef void (GL_APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GL_APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef void (GL_APIENTRYP PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); +typedef void (GL_APIENTRYP PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint *value); +typedef void (GL_APIENTRYP PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat *value); +typedef void (GL_APIENTRYP PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GL_APIENTRYP PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat *dashArray); +typedef void (GL_APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GL_APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GL_APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GL_APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GL_APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); +typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GL_APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GL_APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); +typedef void (GL_APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); +typedef void (GL_APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); +typedef void (GL_APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); +typedef void (GL_APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); +typedef void (GL_APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GL_APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); +typedef void (GL_APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GL_APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef GLfloat (GL_APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef GLboolean (GL_APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (GL_APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (GL_APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); +typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); +typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); +typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef GLenum (GL_APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GL_APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); +typedef void (GL_APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (GL_APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); +typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (GL_APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (GL_APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (GL_APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (GL_APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (GL_APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (GL_APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); +typedef void (GL_APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); +typedef void (GL_APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (GL_APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL GLuint GL_APIENTRY glGenPathsNV (GLsizei range); +GL_APICALL void GL_APIENTRY glDeletePathsNV (GLuint path, GLsizei range); +GL_APICALL GLboolean GL_APIENTRY glIsPathNV (GLuint path); +GL_APICALL void GL_APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +GL_APICALL void GL_APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); +GL_APICALL void GL_APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); +GL_APICALL void GL_APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); +GL_APICALL void GL_APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); +GL_APICALL void GL_APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GL_APICALL void GL_APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GL_APICALL void GL_APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); +GL_APICALL void GL_APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); +GL_APICALL void GL_APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +GL_APICALL void GL_APIENTRY glTransformPathNV (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat *transformValues); +GL_APICALL void GL_APIENTRY glPathParameterivNV (GLuint path, GLenum pname, const GLint *value); +GL_APICALL void GL_APIENTRY glPathParameteriNV (GLuint path, GLenum pname, GLint value); +GL_APICALL void GL_APIENTRY glPathParameterfvNV (GLuint path, GLenum pname, const GLfloat *value); +GL_APICALL void GL_APIENTRY glPathParameterfNV (GLuint path, GLenum pname, GLfloat value); +GL_APICALL void GL_APIENTRY glPathDashArrayNV (GLuint path, GLsizei dashCount, const GLfloat *dashArray); +GL_APICALL void GL_APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); +GL_APICALL void GL_APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); +GL_APICALL void GL_APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); +GL_APICALL void GL_APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GL_APICALL void GL_APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GL_APICALL void GL_APIENTRY glPathCoverDepthFuncNV (GLenum func); +GL_APICALL void GL_APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); +GL_APICALL void GL_APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); +GL_APICALL void GL_APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GL_APICALL void GL_APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GL_APICALL void GL_APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); +GL_APICALL void GL_APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); +GL_APICALL void GL_APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); +GL_APICALL void GL_APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); +GL_APICALL void GL_APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); +GL_APICALL void GL_APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +GL_APICALL void GL_APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); +GL_APICALL void GL_APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +GL_APICALL GLboolean GL_APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloat x, GLfloat y); +GL_APICALL GLboolean GL_APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); +GL_APICALL GLfloat GL_APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); +GL_APICALL GLboolean GL_APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +GL_APICALL void GL_APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m); +GL_APICALL void GL_APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m); +GL_APICALL void GL_APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); +GL_APICALL void GL_APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m); +GL_APICALL void GL_APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m); +GL_APICALL void GL_APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); +GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); +GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); +GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint *baseAndCount); +GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); +GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei count, GLsizei *length, GLfloat *params); +GL_APICALL void GL_APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GL_APICALL void GL_APIENTRY glMatrixLoadIdentityEXT (GLenum mode); +GL_APICALL void GL_APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); +GL_APICALL void GL_APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); +GL_APICALL void GL_APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); +GL_APICALL void GL_APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); +GL_APICALL void GL_APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); +GL_APICALL void GL_APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); +GL_APICALL void GL_APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); +GL_APICALL void GL_APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); +GL_APICALL void GL_APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GL_APICALL void GL_APIENTRY glMatrixPopEXT (GLenum mode); +GL_APICALL void GL_APIENTRY glMatrixPushEXT (GLenum mode); +GL_APICALL void GL_APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GL_APICALL void GL_APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GL_APICALL void GL_APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GL_APICALL void GL_APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +#endif +#endif /* GL_NV_path_rendering */ + +#ifndef GL_NV_path_rendering_shared_edge +#define GL_NV_path_rendering_shared_edge 1 +#define GL_SHARED_EDGE_NV 0xC0 +#endif /* GL_NV_path_rendering_shared_edge */ + +#ifndef GL_NV_pixel_buffer_object +#define GL_NV_pixel_buffer_object 1 +#define GL_PIXEL_PACK_BUFFER_NV 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_NV 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_NV 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF +#endif /* GL_NV_pixel_buffer_object */ + +#ifndef GL_NV_polygon_mode +#define GL_NV_polygon_mode 1 +#define GL_POLYGON_MODE_NV 0x0B40 +#define GL_POLYGON_OFFSET_POINT_NV 0x2A01 +#define GL_POLYGON_OFFSET_LINE_NV 0x2A02 +#define GL_POINT_NV 0x1B00 +#define GL_LINE_NV 0x1B01 +#define GL_FILL_NV 0x1B02 +typedef void (GL_APIENTRYP PFNGLPOLYGONMODENVPROC) (GLenum face, GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glPolygonModeNV (GLenum face, GLenum mode); +#endif +#endif /* GL_NV_polygon_mode */ + +#ifndef GL_NV_primitive_shading_rate +#define GL_NV_primitive_shading_rate 1 +#define GL_SHADING_RATE_IMAGE_PER_PRIMITIVE_NV 0x95B1 +#define GL_SHADING_RATE_IMAGE_PALETTE_COUNT_NV 0x95B2 +#endif /* GL_NV_primitive_shading_rate */ + +#ifndef GL_NV_read_buffer +#define GL_NV_read_buffer 1 +#define GL_READ_BUFFER_NV 0x0C02 +typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); +#endif +#endif /* GL_NV_read_buffer */ + +#ifndef GL_NV_read_buffer_front +#define GL_NV_read_buffer_front 1 +#endif /* GL_NV_read_buffer_front */ + +#ifndef GL_NV_read_depth +#define GL_NV_read_depth 1 +#endif /* GL_NV_read_depth */ + +#ifndef GL_NV_read_depth_stencil +#define GL_NV_read_depth_stencil 1 +#endif /* GL_NV_read_depth_stencil */ + +#ifndef GL_NV_read_stencil +#define GL_NV_read_stencil 1 +#endif /* GL_NV_read_stencil */ + +#ifndef GL_NV_representative_fragment_test +#define GL_NV_representative_fragment_test 1 +#define GL_REPRESENTATIVE_FRAGMENT_TEST_NV 0x937F +#endif /* GL_NV_representative_fragment_test */ + +#ifndef GL_NV_sRGB_formats +#define GL_NV_sRGB_formats 1 +#define GL_SLUMINANCE_NV 0x8C46 +#define GL_SLUMINANCE_ALPHA_NV 0x8C44 +#define GL_SRGB8_NV 0x8C41 +#define GL_SLUMINANCE8_NV 0x8C47 +#define GL_SLUMINANCE8_ALPHA8_NV 0x8C45 +#define GL_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F +#define GL_ETC1_SRGB8_NV 0x88EE +#endif /* GL_NV_sRGB_formats */ + +#ifndef GL_NV_sample_locations +#define GL_NV_sample_locations 1 +#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D +#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E +#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 +#define GL_SAMPLE_LOCATION_NV 0x8E50 +#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 +#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 +#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLRESOLVEDEPTHVALUESNVPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferSampleLocationsfvNV (GLenum target, GLuint start, GLsizei count, const GLfloat *v); +GL_APICALL void GL_APIENTRY glNamedFramebufferSampleLocationsfvNV (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat *v); +GL_APICALL void GL_APIENTRY glResolveDepthValuesNV (void); +#endif +#endif /* GL_NV_sample_locations */ + +#ifndef GL_NV_sample_mask_override_coverage +#define GL_NV_sample_mask_override_coverage 1 +#endif /* GL_NV_sample_mask_override_coverage */ + +#ifndef GL_NV_scissor_exclusive +#define GL_NV_scissor_exclusive 1 +#define GL_SCISSOR_TEST_EXCLUSIVE_NV 0x9555 +#define GL_SCISSOR_BOX_EXCLUSIVE_NV 0x9556 +typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVENVPROC) (GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLSCISSOREXCLUSIVEARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glScissorExclusiveNV (GLint x, GLint y, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glScissorExclusiveArrayvNV (GLuint first, GLsizei count, const GLint *v); +#endif +#endif /* GL_NV_scissor_exclusive */ + +#ifndef GL_NV_shader_atomic_fp16_vector +#define GL_NV_shader_atomic_fp16_vector 1 +#endif /* GL_NV_shader_atomic_fp16_vector */ + +#ifndef GL_NV_shader_noperspective_interpolation +#define GL_NV_shader_noperspective_interpolation 1 +#endif /* GL_NV_shader_noperspective_interpolation */ + +#ifndef GL_NV_shader_subgroup_partitioned +#define GL_NV_shader_subgroup_partitioned 1 +#define GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV 0x00000100 +#endif /* GL_NV_shader_subgroup_partitioned */ + +#ifndef GL_NV_shader_texture_footprint +#define GL_NV_shader_texture_footprint 1 +#endif /* GL_NV_shader_texture_footprint */ + +#ifndef GL_NV_shading_rate_image +#define GL_NV_shading_rate_image 1 +#define GL_SHADING_RATE_IMAGE_NV 0x9563 +#define GL_SHADING_RATE_NO_INVOCATIONS_NV 0x9564 +#define GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV 0x9565 +#define GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV 0x9566 +#define GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV 0x9567 +#define GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV 0x9568 +#define GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV 0x9569 +#define GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV 0x956A +#define GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV 0x956B +#define GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV 0x956C +#define GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV 0x956D +#define GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV 0x956E +#define GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV 0x956F +#define GL_SHADING_RATE_IMAGE_BINDING_NV 0x955B +#define GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV 0x955C +#define GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV 0x955D +#define GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV 0x955E +#define GL_MAX_COARSE_FRAGMENT_SAMPLES_NV 0x955F +#define GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV 0x95AE +#define GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV 0x95AF +#define GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV 0x95B0 +typedef void (GL_APIENTRYP PFNGLBINDSHADINGRATEIMAGENVPROC) (GLuint texture); +typedef void (GL_APIENTRYP PFNGLGETSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint entry, GLenum *rate); +typedef void (GL_APIENTRYP PFNGLGETSHADINGRATESAMPLELOCATIONIVNVPROC) (GLenum rate, GLuint samples, GLuint index, GLint *location); +typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEBARRIERNVPROC) (GLboolean synchronize); +typedef void (GL_APIENTRYP PFNGLSHADINGRATEIMAGEPALETTENVPROC) (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); +typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERNVPROC) (GLenum order); +typedef void (GL_APIENTRYP PFNGLSHADINGRATESAMPLEORDERCUSTOMNVPROC) (GLenum rate, GLuint samples, const GLint *locations); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBindShadingRateImageNV (GLuint texture); +GL_APICALL void GL_APIENTRY glGetShadingRateImagePaletteNV (GLuint viewport, GLuint entry, GLenum *rate); +GL_APICALL void GL_APIENTRY glGetShadingRateSampleLocationivNV (GLenum rate, GLuint samples, GLuint index, GLint *location); +GL_APICALL void GL_APIENTRY glShadingRateImageBarrierNV (GLboolean synchronize); +GL_APICALL void GL_APIENTRY glShadingRateImagePaletteNV (GLuint viewport, GLuint first, GLsizei count, const GLenum *rates); +GL_APICALL void GL_APIENTRY glShadingRateSampleOrderNV (GLenum order); +GL_APICALL void GL_APIENTRY glShadingRateSampleOrderCustomNV (GLenum rate, GLuint samples, const GLint *locations); +#endif +#endif /* GL_NV_shading_rate_image */ + +#ifndef GL_NV_shadow_samplers_array +#define GL_NV_shadow_samplers_array 1 +#define GL_SAMPLER_2D_ARRAY_SHADOW_NV 0x8DC4 +#endif /* GL_NV_shadow_samplers_array */ + +#ifndef GL_NV_shadow_samplers_cube +#define GL_NV_shadow_samplers_cube 1 +#define GL_SAMPLER_CUBE_SHADOW_NV 0x8DC5 +#endif /* GL_NV_shadow_samplers_cube */ + +#ifndef GL_NV_stereo_view_rendering +#define GL_NV_stereo_view_rendering 1 +#endif /* GL_NV_stereo_view_rendering */ + +#ifndef GL_NV_texture_border_clamp +#define GL_NV_texture_border_clamp 1 +#define GL_TEXTURE_BORDER_COLOR_NV 0x1004 +#define GL_CLAMP_TO_BORDER_NV 0x812D +#endif /* GL_NV_texture_border_clamp */ + +#ifndef GL_NV_texture_compression_s3tc_update +#define GL_NV_texture_compression_s3tc_update 1 +#endif /* GL_NV_texture_compression_s3tc_update */ + +#ifndef GL_NV_texture_npot_2D_mipmap +#define GL_NV_texture_npot_2D_mipmap 1 +#endif /* GL_NV_texture_npot_2D_mipmap */ + +#ifndef GL_NV_timeline_semaphore +#define GL_NV_timeline_semaphore 1 +#define GL_TIMELINE_SEMAPHORE_VALUE_NV 0x9595 +#define GL_SEMAPHORE_TYPE_NV 0x95B3 +#define GL_SEMAPHORE_TYPE_BINARY_NV 0x95B4 +#define GL_SEMAPHORE_TYPE_TIMELINE_NV 0x95B5 +#define GL_MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV 0x95B6 +typedef void (GL_APIENTRYP PFNGLCREATESEMAPHORESNVPROC) (GLsizei n, GLuint *semaphores); +typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, const GLint *params); +typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERIVNVPROC) (GLuint semaphore, GLenum pname, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCreateSemaphoresNV (GLsizei n, GLuint *semaphores); +GL_APICALL void GL_APIENTRY glSemaphoreParameterivNV (GLuint semaphore, GLenum pname, const GLint *params); +GL_APICALL void GL_APIENTRY glGetSemaphoreParameterivNV (GLuint semaphore, GLenum pname, GLint *params); +#endif +#endif /* GL_NV_timeline_semaphore */ + +#ifndef GL_NV_viewport_array +#define GL_NV_viewport_array 1 +#define GL_MAX_VIEWPORTS_NV 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS_NV 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE_NV 0x825D +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX_NV 0x825F +typedef void (GL_APIENTRYP PFNGLVIEWPORTARRAYVNVPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GL_APIENTRYP PFNGLVIEWPORTINDEXEDFVNVPROC) (GLuint index, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLSCISSORARRAYVNVPROC) (GLuint first, GLsizei count, const GLint *v); +typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDNVPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLSCISSORINDEXEDVNVPROC) (GLuint index, const GLint *v); +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEARRAYFVNVPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (GL_APIENTRYP PFNGLDEPTHRANGEINDEXEDFNVPROC) (GLuint index, GLfloat n, GLfloat f); +typedef void (GL_APIENTRYP PFNGLGETFLOATI_VNVPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (GL_APIENTRYP PFNGLENABLEINVPROC) (GLenum target, GLuint index); +typedef void (GL_APIENTRYP PFNGLDISABLEINVPROC) (GLenum target, GLuint index); +typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDINVPROC) (GLenum target, GLuint index); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glViewportArrayvNV (GLuint first, GLsizei count, const GLfloat *v); +GL_APICALL void GL_APIENTRY glViewportIndexedfNV (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +GL_APICALL void GL_APIENTRY glViewportIndexedfvNV (GLuint index, const GLfloat *v); +GL_APICALL void GL_APIENTRY glScissorArrayvNV (GLuint first, GLsizei count, const GLint *v); +GL_APICALL void GL_APIENTRY glScissorIndexedNV (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glScissorIndexedvNV (GLuint index, const GLint *v); +GL_APICALL void GL_APIENTRY glDepthRangeArrayfvNV (GLuint first, GLsizei count, const GLfloat *v); +GL_APICALL void GL_APIENTRY glDepthRangeIndexedfNV (GLuint index, GLfloat n, GLfloat f); +GL_APICALL void GL_APIENTRY glGetFloati_vNV (GLenum target, GLuint index, GLfloat *data); +GL_APICALL void GL_APIENTRY glEnableiNV (GLenum target, GLuint index); +GL_APICALL void GL_APIENTRY glDisableiNV (GLenum target, GLuint index); +GL_APICALL GLboolean GL_APIENTRY glIsEnablediNV (GLenum target, GLuint index); +#endif +#endif /* GL_NV_viewport_array */ + +#ifndef GL_NV_viewport_array2 +#define GL_NV_viewport_array2 1 +#endif /* GL_NV_viewport_array2 */ + +#ifndef GL_NV_viewport_swizzle +#define GL_NV_viewport_swizzle 1 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355 +#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356 +#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357 +#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358 +#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359 +#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A +#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B +typedef void (GL_APIENTRYP PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew); +#endif +#endif /* GL_NV_viewport_swizzle */ + +#ifndef GL_OVR_multiview +#define GL_OVR_multiview 1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 +#define GL_MAX_VIEWS_OVR 0x9631 +#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); +#endif +#endif /* GL_OVR_multiview */ + +#ifndef GL_OVR_multiview2 +#define GL_OVR_multiview2 1 +#endif /* GL_OVR_multiview2 */ + +#ifndef GL_OVR_multiview_multisampled_render_to_texture +#define GL_OVR_multiview_multisampled_render_to_texture 1 +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferTextureMultisampleMultiviewOVR (GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); +#endif +#endif /* GL_OVR_multiview_multisampled_render_to_texture */ + +#ifndef GL_QCOM_YUV_texture_gather +#define GL_QCOM_YUV_texture_gather 1 +#endif /* GL_QCOM_YUV_texture_gather */ + +#ifndef GL_QCOM_alpha_test +#define GL_QCOM_alpha_test 1 +#define GL_ALPHA_TEST_QCOM 0x0BC0 +#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 +#define GL_ALPHA_TEST_REF_QCOM 0x0BC2 +typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref); +#endif +#endif /* GL_QCOM_alpha_test */ + +#ifndef GL_QCOM_binning_control +#define GL_QCOM_binning_control 1 +#define GL_BINNING_CONTROL_HINT_QCOM 0x8FB0 +#define GL_CPU_OPTIMIZED_QCOM 0x8FB1 +#define GL_GPU_OPTIMIZED_QCOM 0x8FB2 +#define GL_RENDER_DIRECT_TO_FRAMEBUFFER_QCOM 0x8FB3 +#endif /* GL_QCOM_binning_control */ + +#ifndef GL_QCOM_driver_control +#define GL_QCOM_driver_control 1 +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); +typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); +GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); +GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); +GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); +#endif +#endif /* GL_QCOM_driver_control */ + +#ifndef GL_QCOM_extended_get +#define GL_QCOM_extended_get 1 +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC +typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); +GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels); +GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params); +#endif +#endif /* GL_QCOM_extended_get */ + +#ifndef GL_QCOM_extended_get2 +#define GL_QCOM_extended_get2 1 +typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); +GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); +GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +#endif +#endif /* GL_QCOM_extended_get2 */ + +#ifndef GL_QCOM_frame_extrapolation +#define GL_QCOM_frame_extrapolation 1 +typedef void (GL_APIENTRYP PFNGLEXTRAPOLATETEX2DQCOMPROC) (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glExtrapolateTex2DQCOM (GLuint src1, GLuint src2, GLuint output, GLfloat scaleFactor); +#endif +#endif /* GL_QCOM_frame_extrapolation */ + +#ifndef GL_QCOM_framebuffer_foveated +#define GL_QCOM_framebuffer_foveated 1 +#define GL_FOVEATION_ENABLE_BIT_QCOM 0x00000001 +#define GL_FOVEATION_SCALED_BIN_METHOD_BIT_QCOM 0x00000002 +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFOVEATIONCONFIGQCOMPROC) (GLuint framebuffer, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint *providedFeatures); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFOVEATIONPARAMETERSQCOMPROC) (GLuint framebuffer, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferFoveationConfigQCOM (GLuint framebuffer, GLuint numLayers, GLuint focalPointsPerLayer, GLuint requestedFeatures, GLuint *providedFeatures); +GL_APICALL void GL_APIENTRY glFramebufferFoveationParametersQCOM (GLuint framebuffer, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); +#endif +#endif /* GL_QCOM_framebuffer_foveated */ + +#ifndef GL_QCOM_motion_estimation +#define GL_QCOM_motion_estimation 1 +#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_X_QCOM 0x8C90 +#define GL_MOTION_ESTIMATION_SEARCH_BLOCK_Y_QCOM 0x8C91 +typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONQCOMPROC) (GLuint ref, GLuint target, GLuint output); +typedef void (GL_APIENTRYP PFNGLTEXESTIMATEMOTIONREGIONSQCOMPROC) (GLuint ref, GLuint target, GLuint output, GLuint mask); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTexEstimateMotionQCOM (GLuint ref, GLuint target, GLuint output); +GL_APICALL void GL_APIENTRY glTexEstimateMotionRegionsQCOM (GLuint ref, GLuint target, GLuint output, GLuint mask); +#endif +#endif /* GL_QCOM_motion_estimation */ + +#ifndef GL_QCOM_perfmon_global_mode +#define GL_QCOM_perfmon_global_mode 1 +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 +#endif /* GL_QCOM_perfmon_global_mode */ + +#ifndef GL_QCOM_render_shared_exponent +#define GL_QCOM_render_shared_exponent 1 +#endif /* GL_QCOM_render_shared_exponent */ + +#ifndef GL_QCOM_shader_framebuffer_fetch_noncoherent +#define GL_QCOM_shader_framebuffer_fetch_noncoherent 1 +#define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2 +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierQCOM (void); +#endif +#endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */ + +#ifndef GL_QCOM_shader_framebuffer_fetch_rate +#define GL_QCOM_shader_framebuffer_fetch_rate 1 +#endif /* GL_QCOM_shader_framebuffer_fetch_rate */ + +#ifndef GL_QCOM_shading_rate +#define GL_QCOM_shading_rate 1 +#define GL_SHADING_RATE_QCOM 0x96A4 +#define GL_SHADING_RATE_PRESERVE_ASPECT_RATIO_QCOM 0x96A5 +#define GL_SHADING_RATE_1X1_PIXELS_QCOM 0x96A6 +#define GL_SHADING_RATE_1X2_PIXELS_QCOM 0x96A7 +#define GL_SHADING_RATE_2X1_PIXELS_QCOM 0x96A8 +#define GL_SHADING_RATE_2X2_PIXELS_QCOM 0x96A9 +#define GL_SHADING_RATE_4X2_PIXELS_QCOM 0x96AC +#define GL_SHADING_RATE_4X4_PIXELS_QCOM 0x96AE +typedef void (GL_APIENTRYP PFNGLSHADINGRATEQCOMPROC) (GLenum rate); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glShadingRateQCOM (GLenum rate); +#endif +#endif /* GL_QCOM_shading_rate */ + +#ifndef GL_QCOM_texture_foveated +#define GL_QCOM_texture_foveated 1 +#define GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM 0x8BFB +#define GL_TEXTURE_FOVEATED_MIN_PIXEL_DENSITY_QCOM 0x8BFC +#define GL_TEXTURE_FOVEATED_FEATURE_QUERY_QCOM 0x8BFD +#define GL_TEXTURE_FOVEATED_NUM_FOCAL_POINTS_QUERY_QCOM 0x8BFE +#define GL_FRAMEBUFFER_INCOMPLETE_FOVEATION_QCOM 0x8BFF +typedef void (GL_APIENTRYP PFNGLTEXTUREFOVEATIONPARAMETERSQCOMPROC) (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea); +#endif +#endif /* GL_QCOM_texture_foveated */ + +#ifndef GL_QCOM_texture_foveated2 +#define GL_QCOM_texture_foveated2 1 +#define GL_TEXTURE_FOVEATED_CUTOFF_DENSITY_QCOM 0x96A0 +#endif /* GL_QCOM_texture_foveated2 */ + +#ifndef GL_QCOM_texture_foveated_subsampled_layout +#define GL_QCOM_texture_foveated_subsampled_layout 1 +#define GL_FOVEATION_SUBSAMPLED_LAYOUT_METHOD_BIT_QCOM 0x00000004 +#define GL_MAX_SHADER_SUBSAMPLED_IMAGE_UNITS_QCOM 0x8FA1 +#endif /* GL_QCOM_texture_foveated_subsampled_layout */ + +#ifndef GL_QCOM_tiled_rendering +#define GL_QCOM_tiled_rendering 1 +#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 +#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 +#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 +#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 +#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 +#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 +#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 +#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 +#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 +#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 +#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 +#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 +#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 +#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 +#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 +#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 +#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 +#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 +#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 +#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 +#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 +#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 +#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 +#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 +#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 +#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 +#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 +#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 +#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 +#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 +#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 +#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 +typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); +#endif +#endif /* GL_QCOM_tiled_rendering */ + +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 +#define GL_WRITEONLY_RENDERING_QCOM 0x8823 +#endif /* GL_QCOM_writeonly_rendering */ + +#ifndef GL_VIV_shader_binary +#define GL_VIV_shader_binary 1 +#define GL_SHADER_BINARY_VIV 0x8FC4 +#endif /* GL_VIV_shader_binary */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_gl2platform.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_gl2platform.h new file mode 100644 index 00000000..426796ef --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_gl2platform.h @@ -0,0 +1,27 @@ +#ifndef __gl2platform_h_ +#define __gl2platform_h_ + +/* +** Copyright 2017-2020 The Khronos Group Inc. +** SPDX-License-Identifier: Apache-2.0 +*/ + +/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h + * + * Adopters may modify khrplatform.h and this file to suit their platform. + * Please contribute modifications back to Khronos as pull requests on the + * public github repository: + * https://github.com/KhronosGroup/OpenGL-Registry + */ + +/*#include */ + +#ifndef GL_APICALL +#define GL_APICALL KHRONOS_APICALL +#endif + +#ifndef GL_APIENTRY +#define GL_APIENTRY KHRONOS_APIENTRY +#endif + +#endif /* __gl2platform_h_ */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_khrplatform.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_khrplatform.h new file mode 100644 index 00000000..01646449 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_opengles2_khrplatform.h @@ -0,0 +1,311 @@ +#ifndef __khrplatform_h_ +#define __khrplatform_h_ + +/* +** Copyright (c) 2008-2018 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Khronos platform-specific types and definitions. + * + * The master copy of khrplatform.h is maintained in the Khronos EGL + * Registry repository at https://github.com/KhronosGroup/EGL-Registry + * The last semantic modification to khrplatform.h was at commit ID: + * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 + * + * Adopters may modify this file to suit their platform. Adopters are + * encouraged to submit platform specific modifications to the Khronos + * group so that they can be included in future versions of this file. + * Please submit changes by filing pull requests or issues on + * the EGL Registry repository linked above. + * + * + * See the Implementer's Guidelines for information about where this file + * should be located on your system and for more details of its use: + * http://www.khronos.org/registry/implementers_guide.pdf + * + * This file should be included as + * #include + * by Khronos client API header files that use its types and defines. + * + * The types in khrplatform.h should only be used to define API-specific types. + * + * Types defined in khrplatform.h: + * khronos_int8_t signed 8 bit + * khronos_uint8_t unsigned 8 bit + * khronos_int16_t signed 16 bit + * khronos_uint16_t unsigned 16 bit + * khronos_int32_t signed 32 bit + * khronos_uint32_t unsigned 32 bit + * khronos_int64_t signed 64 bit + * khronos_uint64_t unsigned 64 bit + * khronos_intptr_t signed same number of bits as a pointer + * khronos_uintptr_t unsigned same number of bits as a pointer + * khronos_ssize_t signed size + * khronos_usize_t unsigned size + * khronos_float_t signed 32 bit floating point + * khronos_time_ns_t unsigned 64 bit time in nanoseconds + * khronos_utime_nanoseconds_t unsigned time interval or absolute time in + * nanoseconds + * khronos_stime_nanoseconds_t signed time interval in nanoseconds + * khronos_boolean_enum_t enumerated boolean type. This should + * only be used as a base type when a client API's boolean type is + * an enum. Client APIs which use an integer or other type for + * booleans cannot use this as the base type for their boolean. + * + * Tokens defined in khrplatform.h: + * + * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. + * + * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. + * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. + * + * Calling convention macros defined in this file: + * KHRONOS_APICALL + * KHRONOS_APIENTRY + * KHRONOS_APIATTRIBUTES + * + * These may be used in function prototypes as: + * + * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( + * int arg1, + * int arg2) KHRONOS_APIATTRIBUTES; + */ + +#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) +# define KHRONOS_STATIC 1 +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APICALL + *------------------------------------------------------------------------- + * This precedes the return type of the function in the function prototype. + */ +#if defined(KHRONOS_STATIC) + /* If the preprocessor constant KHRONOS_STATIC is defined, make the + * header compatible with static linking. */ +# define KHRONOS_APICALL +#elif defined(_WIN32) +# define KHRONOS_APICALL __declspec(dllimport) +#elif defined (__SYMBIAN32__) +# define KHRONOS_APICALL IMPORT_C +#elif defined(__ANDROID__) +# define KHRONOS_APICALL __attribute__((visibility("default"))) +#else +# define KHRONOS_APICALL +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIENTRY + *------------------------------------------------------------------------- + * This follows the return type of the function and precedes the function + * name in the function prototype. + */ +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) + /* Win32 but not WinCE */ +# define KHRONOS_APIENTRY __stdcall +#else +# define KHRONOS_APIENTRY +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIATTRIBUTES + *------------------------------------------------------------------------- + * This follows the closing parenthesis of the function prototype arguments. + */ +#if defined (__ARMCC_2__) +#define KHRONOS_APIATTRIBUTES __softfp +#else +#define KHRONOS_APIATTRIBUTES +#endif + +/*------------------------------------------------------------------------- + * basic type definitions + *-----------------------------------------------------------------------*/ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) + + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 +/* + * To support platform where unsigned long cannot be used interchangeably with + * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t. + * Ideally, we could just use (u)intptr_t everywhere, but this could result in + * ABI breakage if khronos_uintptr_t is changed from unsigned long to + * unsigned long long or similar (this results in different C++ name mangling). + * To avoid changes for existing platforms, we restrict usage of intptr_t to + * platforms where the size of a pointer is larger than the size of long. + */ +#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__) +#if __SIZEOF_POINTER__ > __SIZEOF_LONG__ +#define KHRONOS_USE_INTPTR_T +#endif +#endif + +#elif defined(__VMS ) || defined(__sgi) + +/* + * Using + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) + +/* + * Win32 + */ +typedef __int32 khronos_int32_t; +typedef unsigned __int32 khronos_uint32_t; +typedef __int64 khronos_int64_t; +typedef unsigned __int64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__sun__) || defined(__digital__) + +/* + * Sun or Digital + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#if defined(__arch64__) || defined(_LP64) +typedef long int khronos_int64_t; +typedef unsigned long int khronos_uint64_t; +#else +typedef long long int khronos_int64_t; +typedef unsigned long long int khronos_uint64_t; +#endif /* __arch64__ */ +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif 0 + +/* + * Hypothetical platform with no float or int64 support + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#define KHRONOS_SUPPORT_INT64 0 +#define KHRONOS_SUPPORT_FLOAT 0 + +#else + +/* + * Generic fallback + */ +#include +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#endif + + +/* + * Types that are (so far) the same on all platforms + */ +typedef signed char khronos_int8_t; +typedef unsigned char khronos_uint8_t; +typedef signed short int khronos_int16_t; +typedef unsigned short int khronos_uint16_t; + +/* + * Types that differ between LLP64 and LP64 architectures - in LLP64, + * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears + * to be the only LLP64 architecture in current use. + */ +#ifdef KHRONOS_USE_INTPTR_T +typedef intptr_t khronos_intptr_t; +typedef uintptr_t khronos_uintptr_t; +#elif defined(_WIN64) +typedef signed long long int khronos_intptr_t; +typedef unsigned long long int khronos_uintptr_t; +#else +typedef signed long int khronos_intptr_t; +typedef unsigned long int khronos_uintptr_t; +#endif + +#if defined(_WIN64) +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else +typedef signed long int khronos_ssize_t; +typedef unsigned long int khronos_usize_t; +#endif + +#if KHRONOS_SUPPORT_FLOAT +/* + * Float type + */ +typedef float khronos_float_t; +#endif + +#if KHRONOS_SUPPORT_INT64 +/* Time types + * + * These types can be used to represent a time interval in nanoseconds or + * an absolute Unadjusted System Time. Unadjusted System Time is the number + * of nanoseconds since some arbitrary system event (e.g. since the last + * time the system booted). The Unadjusted System Time is an unsigned + * 64 bit value that wraps back to 0 every 584 years. Time intervals + * may be either signed or unsigned. + */ +typedef khronos_uint64_t khronos_utime_nanoseconds_t; +typedef khronos_int64_t khronos_stime_nanoseconds_t; +#endif + +/* + * Dummy value used to pad enum types to 32 bits. + */ +#ifndef KHRONOS_MAX_ENUM +#define KHRONOS_MAX_ENUM 0x7FFFFFFF +#endif + +/* + * Enumerated boolean type + * + * Values other than zero should be considered to be true. Therefore + * comparisons should not be made against KHRONOS_TRUE. + */ +typedef enum { + KHRONOS_FALSE = 0, + KHRONOS_TRUE = 1, + KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM +} khronos_boolean_enum_t; + +#endif /* __khrplatform_h_ */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_pixels.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_pixels.h new file mode 100644 index 00000000..35b45236 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_pixels.h @@ -0,0 +1,644 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_pixels.h + * + * Header for the enumerated pixel format definitions. + */ + +#ifndef SDL_pixels_h_ +#define SDL_pixels_h_ + +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name Transparency definitions + * + * These define alpha as the opacity of a surface. + */ +/* @{ */ +#define SDL_ALPHA_OPAQUE 255 +#define SDL_ALPHA_TRANSPARENT 0 +/* @} */ + +/** Pixel type. */ +typedef enum +{ + SDL_PIXELTYPE_UNKNOWN, + SDL_PIXELTYPE_INDEX1, + SDL_PIXELTYPE_INDEX4, + SDL_PIXELTYPE_INDEX8, + SDL_PIXELTYPE_PACKED8, + SDL_PIXELTYPE_PACKED16, + SDL_PIXELTYPE_PACKED32, + SDL_PIXELTYPE_ARRAYU8, + SDL_PIXELTYPE_ARRAYU16, + SDL_PIXELTYPE_ARRAYU32, + SDL_PIXELTYPE_ARRAYF16, + SDL_PIXELTYPE_ARRAYF32 +} SDL_PixelType; + +/** Bitmap pixel order, high bit -> low bit. */ +typedef enum +{ + SDL_BITMAPORDER_NONE, + SDL_BITMAPORDER_4321, + SDL_BITMAPORDER_1234 +} SDL_BitmapOrder; + +/** Packed component order, high bit -> low bit. */ +typedef enum +{ + SDL_PACKEDORDER_NONE, + SDL_PACKEDORDER_XRGB, + SDL_PACKEDORDER_RGBX, + SDL_PACKEDORDER_ARGB, + SDL_PACKEDORDER_RGBA, + SDL_PACKEDORDER_XBGR, + SDL_PACKEDORDER_BGRX, + SDL_PACKEDORDER_ABGR, + SDL_PACKEDORDER_BGRA +} SDL_PackedOrder; + +/** Array component order, low byte -> high byte. */ +/* !!! FIXME: in 2.1, make these not overlap differently with + !!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */ +typedef enum +{ + SDL_ARRAYORDER_NONE, + SDL_ARRAYORDER_RGB, + SDL_ARRAYORDER_RGBA, + SDL_ARRAYORDER_ARGB, + SDL_ARRAYORDER_BGR, + SDL_ARRAYORDER_BGRA, + SDL_ARRAYORDER_ABGR +} SDL_ArrayOrder; + +/** Packed component layout. */ +typedef enum +{ + SDL_PACKEDLAYOUT_NONE, + SDL_PACKEDLAYOUT_332, + SDL_PACKEDLAYOUT_4444, + SDL_PACKEDLAYOUT_1555, + SDL_PACKEDLAYOUT_5551, + SDL_PACKEDLAYOUT_565, + SDL_PACKEDLAYOUT_8888, + SDL_PACKEDLAYOUT_2101010, + SDL_PACKEDLAYOUT_1010102 +} SDL_PackedLayout; + +#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D) + +#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \ + ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \ + ((bits) << 8) | ((bytes) << 0)) + +#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F) +#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F) +#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F) +#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F) +#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF) +#define SDL_BYTESPERPIXEL(X) \ + (SDL_ISPIXELFORMAT_FOURCC(X) ? \ + ((((X) == SDL_PIXELFORMAT_YUY2) || \ + ((X) == SDL_PIXELFORMAT_UYVY) || \ + ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF)) + +#define SDL_ISPIXELFORMAT_INDEXED(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) + +#define SDL_ISPIXELFORMAT_PACKED(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32))) + +#define SDL_ISPIXELFORMAT_ARRAY(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32))) + +#define SDL_ISPIXELFORMAT_ALPHA(format) \ + ((SDL_ISPIXELFORMAT_PACKED(format) && \ + ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \ + (SDL_ISPIXELFORMAT_ARRAY(format) && \ + ((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \ + (SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA)))) + +/* The flag is set to 1 because 0x1? is not in the printable ASCII range */ +#define SDL_ISPIXELFORMAT_FOURCC(format) \ + ((format) && (SDL_PIXELFLAG(format) != 1)) + +/* Note: If you modify this list, update SDL_GetPixelFormatName() */ +typedef enum +{ + SDL_PIXELFORMAT_UNKNOWN, + SDL_PIXELFORMAT_INDEX1LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, + 1, 0), + SDL_PIXELFORMAT_INDEX1MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, + 1, 0), + SDL_PIXELFORMAT_INDEX4LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, + 4, 0), + SDL_PIXELFORMAT_INDEX4MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, + 4, 0), + SDL_PIXELFORMAT_INDEX8 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), + SDL_PIXELFORMAT_RGB332 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_332, 8, 1), + SDL_PIXELFORMAT_XRGB4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_4444, 12, 2), + SDL_PIXELFORMAT_RGB444 = SDL_PIXELFORMAT_XRGB4444, + SDL_PIXELFORMAT_XBGR4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_4444, 12, 2), + SDL_PIXELFORMAT_BGR444 = SDL_PIXELFORMAT_XBGR4444, + SDL_PIXELFORMAT_XRGB1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_RGB555 = SDL_PIXELFORMAT_XRGB1555, + SDL_PIXELFORMAT_XBGR1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_BGR555 = SDL_PIXELFORMAT_XBGR1555, + SDL_PIXELFORMAT_ARGB4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_RGBA4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ABGR4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_BGRA4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ARGB1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_1555, 16, 2), + SDL_PIXELFORMAT_RGBA5551 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_5551, 16, 2), + SDL_PIXELFORMAT_ABGR1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_1555, 16, 2), + SDL_PIXELFORMAT_BGRA5551 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_5551, 16, 2), + SDL_PIXELFORMAT_RGB565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_BGR565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_RGB24 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, + 24, 3), + SDL_PIXELFORMAT_BGR24 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, + 24, 3), + SDL_PIXELFORMAT_XRGB8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_RGB888 = SDL_PIXELFORMAT_XRGB8888, + SDL_PIXELFORMAT_RGBX8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_XBGR8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGR888 = SDL_PIXELFORMAT_XBGR8888, + SDL_PIXELFORMAT_BGRX8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_ARGB8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_RGBA8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_ABGR8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_BGRA8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_ARGB2101010 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_2101010, 32, 4), + + /* Aliases for RGBA byte arrays of color data, for the current platform */ +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888, + SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888, +#else + SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, + SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, + SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, + SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, +#endif + + SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ + SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), + SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ + SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), + SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), + SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), + SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'), + SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */ + SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'), + SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */ + SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'), + SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */ + SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') +} SDL_PixelFormatEnum; + +/** + * The bits of this structure can be directly reinterpreted as an integer-packed + * color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888 + * on little-endian systems and SDL_PIXELFORMAT_RGBA8888 on big-endian systems). + */ +typedef struct SDL_Color +{ + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 a; +} SDL_Color; +#define SDL_Colour SDL_Color + +typedef struct SDL_Palette +{ + int ncolors; + SDL_Color *colors; + Uint32 version; + int refcount; +} SDL_Palette; + +/** + * \note Everything in the pixel format structure is read-only. + */ +typedef struct SDL_PixelFormat +{ + Uint32 format; + SDL_Palette *palette; + Uint8 BitsPerPixel; + Uint8 BytesPerPixel; + Uint8 padding[2]; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; + Uint8 Rshift; + Uint8 Gshift; + Uint8 Bshift; + Uint8 Ashift; + int refcount; + struct SDL_PixelFormat *next; +} SDL_PixelFormat; + +/** + * Get the human readable name of a pixel format. + * + * \param format the pixel format to query + * \returns the human readable name of the specified pixel format or + * `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); + +/** + * Convert one of the enumerated pixel formats to a bpp value and RGBA masks. + * + * \param format one of the SDL_PixelFormatEnum values + * \param bpp a bits per pixel value; usually 15, 16, or 32 + * \param Rmask a pointer filled in with the red mask for the format + * \param Gmask a pointer filled in with the green mask for the format + * \param Bmask a pointer filled in with the blue mask for the format + * \param Amask a pointer filled in with the alpha mask for the format + * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't + * possible; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_MasksToPixelFormatEnum + */ +extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, + int *bpp, + Uint32 * Rmask, + Uint32 * Gmask, + Uint32 * Bmask, + Uint32 * Amask); + +/** + * Convert a bpp value and RGBA masks to an enumerated pixel format. + * + * This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't + * possible. + * + * \param bpp a bits per pixel value; usually 15, 16, or 32 + * \param Rmask the red mask for the format + * \param Gmask the green mask for the format + * \param Bmask the blue mask for the format + * \param Amask the alpha mask for the format + * \returns one of the SDL_PixelFormatEnum values + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_PixelFormatEnumToMasks + */ +extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, + Uint32 Rmask, + Uint32 Gmask, + Uint32 Bmask, + Uint32 Amask); + +/** + * Create an SDL_PixelFormat structure corresponding to a pixel format. + * + * Returned structure may come from a shared global cache (i.e. not newly + * allocated), and hence should not be modified, especially the palette. Weird + * errors such as `Blit combination not supported` may occur. + * + * \param pixel_format one of the SDL_PixelFormatEnum values + * \returns the new SDL_PixelFormat structure or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FreeFormat + */ +extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); + +/** + * Free an SDL_PixelFormat structure allocated by SDL_AllocFormat(). + * + * \param format the SDL_PixelFormat structure to free + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AllocFormat + */ +extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); + +/** + * Create a palette structure with the specified number of color entries. + * + * The palette entries are initialized to white. + * + * \param ncolors represents the number of color entries in the color palette + * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if + * there wasn't enough memory); call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FreePalette + */ +extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); + +/** + * Set the palette for a pixel format structure. + * + * \param format the SDL_PixelFormat structure that will use the palette + * \param palette the SDL_Palette structure that will be used + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AllocPalette + * \sa SDL_FreePalette + */ +extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, + SDL_Palette *palette); + +/** + * Set a range of colors in a palette. + * + * \param palette the SDL_Palette structure to modify + * \param colors an array of SDL_Color structures to copy into the palette + * \param firstcolor the index of the first palette entry to modify + * \param ncolors the number of entries to modify + * \returns 0 on success or a negative error code if not all of the colors + * could be set; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AllocPalette + * \sa SDL_CreateRGBSurface + */ +extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, + const SDL_Color * colors, + int firstcolor, int ncolors); + +/** + * Free a palette created with SDL_AllocPalette(). + * + * \param palette the SDL_Palette structure to be freed + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AllocPalette + */ +extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); + +/** + * Map an RGB triple to an opaque pixel value for a given pixel format. + * + * This function maps the RGB color value to the specified pixel format and + * returns the pixel value best approximating the given RGB color value for + * the given pixel format. + * + * If the format has a palette (8-bit) the index of the closest matching color + * in the palette will be returned. + * + * If the specified pixel format has an alpha component it will be returned as + * all 1 bits (fully opaque). + * + * If the pixel format bpp (color depth) is less than 32-bpp then the unused + * upper bits of the return value can safely be ignored (e.g., with a 16-bpp + * format the return value can be assigned to a Uint16, and similarly a Uint8 + * for an 8-bpp format). + * + * \param format an SDL_PixelFormat structure describing the pixel format + * \param r the red component of the pixel in the range 0-255 + * \param g the green component of the pixel in the range 0-255 + * \param b the blue component of the pixel in the range 0-255 + * \returns a pixel value + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRGB + * \sa SDL_GetRGBA + * \sa SDL_MapRGBA + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, + Uint8 r, Uint8 g, Uint8 b); + +/** + * Map an RGBA quadruple to a pixel value for a given pixel format. + * + * This function maps the RGBA color value to the specified pixel format and + * returns the pixel value best approximating the given RGBA color value for + * the given pixel format. + * + * If the specified pixel format has no alpha component the alpha value will + * be ignored (as it will be in formats with a palette). + * + * If the format has a palette (8-bit) the index of the closest matching color + * in the palette will be returned. + * + * If the pixel format bpp (color depth) is less than 32-bpp then the unused + * upper bits of the return value can safely be ignored (e.g., with a 16-bpp + * format the return value can be assigned to a Uint16, and similarly a Uint8 + * for an 8-bpp format). + * + * \param format an SDL_PixelFormat structure describing the format of the + * pixel + * \param r the red component of the pixel in the range 0-255 + * \param g the green component of the pixel in the range 0-255 + * \param b the blue component of the pixel in the range 0-255 + * \param a the alpha component of the pixel in the range 0-255 + * \returns a pixel value + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRGB + * \sa SDL_GetRGBA + * \sa SDL_MapRGB + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, + Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * Get RGB values from a pixel in the specified format. + * + * This function uses the entire 8-bit [0..255] range when converting color + * components from pixel formats with less than 8-bits per RGB component + * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, + * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). + * + * \param pixel a pixel value + * \param format an SDL_PixelFormat structure describing the format of the + * pixel + * \param r a pointer filled in with the red component + * \param g a pointer filled in with the green component + * \param b a pointer filled in with the blue component + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRGBA + * \sa SDL_MapRGB + * \sa SDL_MapRGBA + */ +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, + const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b); + +/** + * Get RGBA values from a pixel in the specified format. + * + * This function uses the entire 8-bit [0..255] range when converting color + * components from pixel formats with less than 8-bits per RGB component + * (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff, + * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). + * + * If the surface has no alpha component, the alpha will be returned as 0xff + * (100% opaque). + * + * \param pixel a pixel value + * \param format an SDL_PixelFormat structure describing the format of the + * pixel + * \param r a pointer filled in with the red component + * \param g a pointer filled in with the green component + * \param b a pointer filled in with the blue component + * \param a a pointer filled in with the alpha component + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRGB + * \sa SDL_MapRGB + * \sa SDL_MapRGBA + */ +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, + const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * Calculate a 256 entry gamma ramp for a gamma value. + * + * \param gamma a gamma value where 0.0 is black and 1.0 is identity + * \param ramp an array of 256 values filled in with the gamma ramp + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetWindowGammaRamp + */ +extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_pixels_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_platform.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_platform.h new file mode 100644 index 00000000..77f35ec6 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_platform.h @@ -0,0 +1,261 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_platform.h + * + * Try to get a standard set of platform defines. + */ + +#ifndef SDL_platform_h_ +#define SDL_platform_h_ + +#if defined(_AIX) +#undef __AIX__ +#define __AIX__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) +#undef __BSDI__ +#define __BSDI__ 1 +#endif +#if defined(_arch_dreamcast) +#undef __DREAMCAST__ +#define __DREAMCAST__ 1 +#endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +#undef __FREEBSD__ +#define __FREEBSD__ 1 +#endif +#if defined(hpux) || defined(__hpux) || defined(__hpux__) +#undef __HPUX__ +#define __HPUX__ 1 +#endif +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) +#undef __IRIX__ +#define __IRIX__ 1 +#endif +#if (defined(linux) || defined(__linux) || defined(__linux__)) +#undef __LINUX__ +#define __LINUX__ 1 +#endif +#if defined(ANDROID) || defined(__ANDROID__) +#undef __ANDROID__ +#undef __LINUX__ /* do we need to do this? */ +#define __ANDROID__ 1 +#endif +#if defined(__NGAGE__) +#undef __NGAGE__ +#define __NGAGE__ 1 +#endif + +#if defined(__APPLE__) +/* lets us know what version of Mac OS X we're compiling on */ +#include +#include + +/* Fix building with older SDKs that don't define these + See this for more information: + https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets +*/ +#ifndef TARGET_OS_MACCATALYST +#define TARGET_OS_MACCATALYST 0 +#endif +#ifndef TARGET_OS_IOS +#define TARGET_OS_IOS 0 +#endif +#ifndef TARGET_OS_IPHONE +#define TARGET_OS_IPHONE 0 +#endif +#ifndef TARGET_OS_TV +#define TARGET_OS_TV 0 +#endif +#ifndef TARGET_OS_SIMULATOR +#define TARGET_OS_SIMULATOR 0 +#endif + +#if TARGET_OS_TV +#undef __TVOS__ +#define __TVOS__ 1 +#endif +#if TARGET_OS_IPHONE +/* if compiling for iOS */ +#undef __IPHONEOS__ +#define __IPHONEOS__ 1 +#undef __MACOSX__ +#else +/* if not compiling for iOS */ +#undef __MACOSX__ +#define __MACOSX__ 1 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +# error SDL for Mac OS X only supports deploying on 10.7 and above. +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1070 */ +#endif /* TARGET_OS_IPHONE */ +#endif /* defined(__APPLE__) */ + +#if defined(__NetBSD__) +#undef __NETBSD__ +#define __NETBSD__ 1 +#endif +#if defined(__OpenBSD__) +#undef __OPENBSD__ +#define __OPENBSD__ 1 +#endif +#if defined(__OS2__) || defined(__EMX__) +#undef __OS2__ +#define __OS2__ 1 +#endif +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) +#undef __OSF__ +#define __OSF__ 1 +#endif +#if defined(__QNXNTO__) +#undef __QNXNTO__ +#define __QNXNTO__ 1 +#endif +#if defined(riscos) || defined(__riscos) || defined(__riscos__) +#undef __RISCOS__ +#define __RISCOS__ 1 +#endif +#if defined(__sun) && defined(__SVR4) +#undef __SOLARIS__ +#define __SOLARIS__ 1 +#endif + +#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) +/* Try to find out if we're compiling for WinRT, GDK or non-WinRT/GDK */ +#if defined(_MSC_VER) && defined(__has_include) +#if __has_include() +#define HAVE_WINAPIFAMILY_H 1 +#else +#define HAVE_WINAPIFAMILY_H 0 +#endif + +/* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */ +#elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_) /* _MSC_VER == 1700 for Visual Studio 2012 */ +#define HAVE_WINAPIFAMILY_H 1 +#else +#define HAVE_WINAPIFAMILY_H 0 +#endif + +#if HAVE_WINAPIFAMILY_H +#include +#define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)) +#else +#define WINAPI_FAMILY_WINRT 0 +#endif /* HAVE_WINAPIFAMILY_H */ + +#if WINAPI_FAMILY_WINRT +#undef __WINRT__ +#define __WINRT__ 1 +#elif defined(_GAMING_DESKTOP) /* GDK project configuration always defines _GAMING_XXX */ +#undef __WINGDK__ +#define __WINGDK__ 1 +#elif defined(_GAMING_XBOX_XBOXONE) +#undef __XBOXONE__ +#define __XBOXONE__ 1 +#elif defined(_GAMING_XBOX_SCARLETT) +#undef __XBOXSERIES__ +#define __XBOXSERIES__ 1 +#else +#undef __WINDOWS__ +#define __WINDOWS__ 1 +#endif +#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */ + +#if defined(__WINDOWS__) +#undef __WIN32__ +#define __WIN32__ 1 +#endif +/* This is to support generic "any GDK" separate from a platform-specific GDK */ +#if defined(__WINGDK__) || defined(__XBOXONE__) || defined(__XBOXSERIES__) +#undef __GDK__ +#define __GDK__ 1 +#endif +#if defined(__PSP__) +#undef __PSP__ +#define __PSP__ 1 +#endif +#if defined(PS2) +#define __PS2__ 1 +#endif + +/* The NACL compiler defines __native_client__ and __pnacl__ + * Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi + */ +#if defined(__native_client__) +#undef __LINUX__ +#undef __NACL__ +#define __NACL__ 1 +#endif +#if defined(__pnacl__) +#undef __LINUX__ +#undef __PNACL__ +#define __PNACL__ 1 +/* PNACL with newlib supports static linking only */ +#define __SDL_NOGETPROCADDR__ +#endif + +#if defined(__vita__) +#define __VITA__ 1 +#endif + +#if defined(__3DS__) +#undef __3DS__ +#define __3DS__ 1 +#endif + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Get the name of the platform. + * + * Here are the names returned for some (but not all) supported platforms: + * + * - "Windows" + * - "Mac OS X" + * - "Linux" + * - "iOS" + * - "Android" + * + * \returns the name of the platform. If the correct platform name is not + * available, returns a string beginning with the text "Unknown". + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_platform_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_power.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_power.h new file mode 100644 index 00000000..0d5bb9c6 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_power.h @@ -0,0 +1,87 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDL_power_h_ +#define SDL_power_h_ + +/** + * \file SDL_power.h + * + * Header for the SDL power management routines. + */ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * The basic state for the system's power supply. + */ +typedef enum +{ + SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ + SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ + SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ + SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ + SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ +} SDL_PowerState; + +/** + * Get the current power supply details. + * + * You should never take a battery status as absolute truth. Batteries + * (especially failing batteries) are delicate hardware, and the values + * reported here are best estimates based on what that hardware reports. It's + * not uncommon for older batteries to lose stored power much faster than it + * reports, or completely drain when reporting it has 20 percent left, etc. + * + * Battery status can change at any time; if you are concerned with power + * state, you should call this function frequently, and perhaps ignore changes + * until they seem to be stable for a few seconds. + * + * It's possible a platform can only report battery percentage or time left + * but not both. + * + * \param seconds seconds of battery life left, you can pass a NULL here if + * you don't care, will return -1 if we can't determine a + * value, or we're not running on a battery + * \param percent percentage of battery life left, between 0 and 100, you can + * pass a NULL here if you don't care, will return -1 if we + * can't determine a value, or we're not running on a battery + * \returns an SDL_PowerState enum representing the current battery state. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_power_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_quit.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_quit.h new file mode 100644 index 00000000..253fc984 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_quit.h @@ -0,0 +1,58 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_quit.h + * + * Include file for SDL quit event handling. + */ + +#ifndef SDL_quit_h_ +#define SDL_quit_h_ + +#include +#include + +/** + * \file SDL_quit.h + * + * An ::SDL_QUIT event is generated when the user tries to close the application + * window. If it is ignored or filtered out, the window will remain open. + * If it is not ignored or filtered, it is queued normally and the window + * is allowed to close. When the window is closed, screen updates will + * complete, but have no effect. + * + * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) + * and SIGTERM (system termination request), if handlers do not already + * exist, that generate ::SDL_QUIT events as well. There is no way + * to determine the cause of an ::SDL_QUIT event, but setting a signal + * handler in your application will override the default generation of + * quit events for that signal. + * + * \sa SDL_Quit() + */ + +/* There are no functions directly affecting the quit event */ + +#define SDL_QuitRequested() \ + (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) + +#endif /* SDL_quit_h_ */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_rect.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_rect.h new file mode 100644 index 00000000..fcce5aee --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_rect.h @@ -0,0 +1,376 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_rect.h + * + * Header file for SDL_rect definition and management functions. + */ + +#ifndef SDL_rect_h_ +#define SDL_rect_h_ + +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * The structure that defines a point (integer) + * + * \sa SDL_EnclosePoints + * \sa SDL_PointInRect + */ +typedef struct SDL_Point +{ + int x; + int y; +} SDL_Point; + +/** + * The structure that defines a point (floating point) + * + * \sa SDL_EncloseFPoints + * \sa SDL_PointInFRect + */ +typedef struct SDL_FPoint +{ + float x; + float y; +} SDL_FPoint; + + +/** + * A rectangle, with the origin at the upper left (integer). + * + * \sa SDL_RectEmpty + * \sa SDL_RectEquals + * \sa SDL_HasIntersection + * \sa SDL_IntersectRect + * \sa SDL_IntersectRectAndLine + * \sa SDL_UnionRect + * \sa SDL_EnclosePoints + */ +typedef struct SDL_Rect +{ + int x, y; + int w, h; +} SDL_Rect; + + +/** + * A rectangle, with the origin at the upper left (floating point). + * + * \sa SDL_FRectEmpty + * \sa SDL_FRectEquals + * \sa SDL_FRectEqualsEpsilon + * \sa SDL_HasIntersectionF + * \sa SDL_IntersectFRect + * \sa SDL_IntersectFRectAndLine + * \sa SDL_UnionFRect + * \sa SDL_EncloseFPoints + * \sa SDL_PointInFRect + */ +typedef struct SDL_FRect +{ + float x; + float y; + float w; + float h; +} SDL_FRect; + + +/** + * Returns true if point resides inside a rectangle. + */ +SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) +{ + return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && + (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; +} + +/** + * Returns true if the rectangle has no area. + */ +SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) +{ + return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * Returns true if the two rectangles are equal. + */ +SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) +{ + return (a && b && (a->x == b->x) && (a->y == b->y) && + (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * Determine whether two rectangles intersect. + * + * If either pointer is NULL the function will return SDL_FALSE. + * + * \param A an SDL_Rect structure representing the first rectangle + * \param B an SDL_Rect structure representing the second rectangle + * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_IntersectRect + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, + const SDL_Rect * B); + +/** + * Calculate the intersection of two rectangles. + * + * If `result` is NULL then this function will return SDL_FALSE. + * + * \param A an SDL_Rect structure representing the first rectangle + * \param B an SDL_Rect structure representing the second rectangle + * \param result an SDL_Rect structure filled in with the intersection of + * rectangles `A` and `B` + * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HasIntersection + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, + const SDL_Rect * B, + SDL_Rect * result); + +/** + * Calculate the union of two rectangles. + * + * \param A an SDL_Rect structure representing the first rectangle + * \param B an SDL_Rect structure representing the second rectangle + * \param result an SDL_Rect structure filled in with the union of rectangles + * `A` and `B` + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, + const SDL_Rect * B, + SDL_Rect * result); + +/** + * Calculate a minimal rectangle enclosing a set of points. + * + * If `clip` is not NULL then only points inside of the clipping rectangle are + * considered. + * + * \param points an array of SDL_Point structures representing points to be + * enclosed + * \param count the number of structures in the `points` array + * \param clip an SDL_Rect used for clipping or NULL to enclose all points + * \param result an SDL_Rect structure filled in with the minimal enclosing + * rectangle + * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the + * points were outside of the clipping rectangle. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, + int count, + const SDL_Rect * clip, + SDL_Rect * result); + +/** + * Calculate the intersection of a rectangle and line segment. + * + * This function is used to clip a line segment to a rectangle. A line segment + * contained entirely within the rectangle or that does not intersect will + * remain unchanged. A line segment that crosses the rectangle at either or + * both ends will be clipped to the boundary of the rectangle and the new + * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary. + * + * \param rect an SDL_Rect structure representing the rectangle to intersect + * \param X1 a pointer to the starting X-coordinate of the line + * \param Y1 a pointer to the starting Y-coordinate of the line + * \param X2 a pointer to the ending X-coordinate of the line + * \param Y2 a pointer to the ending Y-coordinate of the line + * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * + rect, int *X1, + int *Y1, int *X2, + int *Y2); + + +/* SDL_FRect versions... */ + +/** + * Returns true if point resides inside a rectangle. + */ +SDL_FORCE_INLINE SDL_bool SDL_PointInFRect(const SDL_FPoint *p, const SDL_FRect *r) +{ + return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && + (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; +} + +/** + * Returns true if the rectangle has no area. + */ +SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r) +{ + return ((!r) || (r->w <= 0.0f) || (r->h <= 0.0f)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * Returns true if the two rectangles are equal, within some given epsilon. + * + * \since This function is available since SDL 2.0.22. + */ +SDL_FORCE_INLINE SDL_bool SDL_FRectEqualsEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon) +{ + return (a && b && ((a == b) || + ((SDL_fabsf(a->x - b->x) <= epsilon) && + (SDL_fabsf(a->y - b->y) <= epsilon) && + (SDL_fabsf(a->w - b->w) <= epsilon) && + (SDL_fabsf(a->h - b->h) <= epsilon)))) + ? SDL_TRUE : SDL_FALSE; +} + +/** + * Returns true if the two rectangles are equal, using a default epsilon. + * + * \since This function is available since SDL 2.0.22. + */ +SDL_FORCE_INLINE SDL_bool SDL_FRectEquals(const SDL_FRect *a, const SDL_FRect *b) +{ + return SDL_FRectEqualsEpsilon(a, b, SDL_FLT_EPSILON); +} + +/** + * Determine whether two rectangles intersect with float precision. + * + * If either pointer is NULL the function will return SDL_FALSE. + * + * \param A an SDL_FRect structure representing the first rectangle + * \param B an SDL_FRect structure representing the second rectangle + * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.22. + * + * \sa SDL_IntersectRect + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersectionF(const SDL_FRect * A, + const SDL_FRect * B); + +/** + * Calculate the intersection of two rectangles with float precision. + * + * If `result` is NULL then this function will return SDL_FALSE. + * + * \param A an SDL_FRect structure representing the first rectangle + * \param B an SDL_FRect structure representing the second rectangle + * \param result an SDL_FRect structure filled in with the intersection of + * rectangles `A` and `B` + * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.22. + * + * \sa SDL_HasIntersectionF + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRect(const SDL_FRect * A, + const SDL_FRect * B, + SDL_FRect * result); + +/** + * Calculate the union of two rectangles with float precision. + * + * \param A an SDL_FRect structure representing the first rectangle + * \param B an SDL_FRect structure representing the second rectangle + * \param result an SDL_FRect structure filled in with the union of rectangles + * `A` and `B` + * + * \since This function is available since SDL 2.0.22. + */ +extern DECLSPEC void SDLCALL SDL_UnionFRect(const SDL_FRect * A, + const SDL_FRect * B, + SDL_FRect * result); + +/** + * Calculate a minimal rectangle enclosing a set of points with float + * precision. + * + * If `clip` is not NULL then only points inside of the clipping rectangle are + * considered. + * + * \param points an array of SDL_FPoint structures representing points to be + * enclosed + * \param count the number of structures in the `points` array + * \param clip an SDL_FRect used for clipping or NULL to enclose all points + * \param result an SDL_FRect structure filled in with the minimal enclosing + * rectangle + * \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the + * points were outside of the clipping rectangle. + * + * \since This function is available since SDL 2.0.22. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_EncloseFPoints(const SDL_FPoint * points, + int count, + const SDL_FRect * clip, + SDL_FRect * result); + +/** + * Calculate the intersection of a rectangle and line segment with float + * precision. + * + * This function is used to clip a line segment to a rectangle. A line segment + * contained entirely within the rectangle or that does not intersect will + * remain unchanged. A line segment that crosses the rectangle at either or + * both ends will be clipped to the boundary of the rectangle and the new + * coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary. + * + * \param rect an SDL_FRect structure representing the rectangle to intersect + * \param X1 a pointer to the starting X-coordinate of the line + * \param Y1 a pointer to the starting Y-coordinate of the line + * \param X2 a pointer to the ending X-coordinate of the line + * \param Y2 a pointer to the ending Y-coordinate of the line + * \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.22. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRectAndLine(const SDL_FRect * + rect, float *X1, + float *Y1, float *X2, + float *Y2); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_rect_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_render.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_render.h new file mode 100644 index 00000000..1a9166a2 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_render.h @@ -0,0 +1,1924 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_render.h + * + * Header file for SDL 2D rendering functions. + * + * This API supports the following features: + * * single pixel points + * * single pixel lines + * * filled rectangles + * * texture images + * + * The primitives may be drawn in opaque, blended, or additive modes. + * + * The texture images may be drawn in opaque, blended, or additive modes. + * They can have an additional color tint or alpha modulation applied to + * them, and may also be stretched with linear interpolation. + * + * This API is designed to accelerate simple 2D operations. You may + * want more functionality such as polygons and particle effects and + * in that case you should use SDL's OpenGL/Direct3D support or one + * of the many good 3D engines. + * + * These functions must be called from the main thread. + * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 + */ + +#ifndef SDL_render_h_ +#define SDL_render_h_ + +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Flags used when creating a rendering context + */ +typedef enum +{ + SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ + SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware + acceleration */ + SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized + with the refresh rate */ + SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports + rendering to texture */ +} SDL_RendererFlags; + +/** + * Information on the capabilities of a render driver or context. + */ +typedef struct SDL_RendererInfo +{ + const char *name; /**< The name of the renderer */ + Uint32 flags; /**< Supported ::SDL_RendererFlags */ + Uint32 num_texture_formats; /**< The number of available texture formats */ + Uint32 texture_formats[16]; /**< The available texture formats */ + int max_texture_width; /**< The maximum texture width */ + int max_texture_height; /**< The maximum texture height */ +} SDL_RendererInfo; + +/** + * Vertex structure + */ +typedef struct SDL_Vertex +{ + SDL_FPoint position; /**< Vertex position, in SDL_Renderer coordinates */ + SDL_Color color; /**< Vertex color */ + SDL_FPoint tex_coord; /**< Normalized texture coordinates, if needed */ +} SDL_Vertex; + +/** + * The scaling mode for a texture. + */ +typedef enum +{ + SDL_ScaleModeNearest, /**< nearest pixel sampling */ + SDL_ScaleModeLinear, /**< linear filtering */ + SDL_ScaleModeBest /**< anisotropic filtering */ +} SDL_ScaleMode; + +/** + * The access pattern allowed for a texture. + */ +typedef enum +{ + SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ + SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ + SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */ +} SDL_TextureAccess; + +/** + * The texture channel modulation used in SDL_RenderCopy(). + */ +typedef enum +{ + SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ + SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ + SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ +} SDL_TextureModulate; + +/** + * Flip constants for SDL_RenderCopyEx + */ +typedef enum +{ + SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ + SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ + SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */ +} SDL_RendererFlip; + +/** + * A structure representing rendering state + */ +struct SDL_Renderer; +typedef struct SDL_Renderer SDL_Renderer; + +/** + * An efficient driver-specific representation of pixel data + */ +struct SDL_Texture; +typedef struct SDL_Texture SDL_Texture; + +/* Function prototypes */ + +/** + * Get the number of 2D rendering drivers available for the current display. + * + * A render driver is a set of code that handles rendering and texture + * management on a particular display. Normally there is only one, but some + * drivers may have several available with different capabilities. + * + * There may be none if SDL was compiled without render support. + * + * \returns a number >= 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateRenderer + * \sa SDL_GetRenderDriverInfo + */ +extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); + +/** + * Get info about a specific 2D rendering driver for the current display. + * + * \param index the index of the driver to query information about + * \param info an SDL_RendererInfo structure to be filled with information on + * the rendering driver + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateRenderer + * \sa SDL_GetNumRenderDrivers + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, + SDL_RendererInfo * info); + +/** + * Create a window and default renderer. + * + * \param width the width of the window + * \param height the height of the window + * \param window_flags the flags used to create the window (see + * SDL_CreateWindow()) + * \param window a pointer filled with the window, or NULL on error + * \param renderer a pointer filled with the renderer, or NULL on error + * \returns 0 on success, or -1 on error; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateRenderer + * \sa SDL_CreateWindow + */ +extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( + int width, int height, Uint32 window_flags, + SDL_Window **window, SDL_Renderer **renderer); + + +/** + * Create a 2D rendering context for a window. + * + * \param window the window where rendering is displayed + * \param index the index of the rendering driver to initialize, or -1 to + * initialize the first one supporting the requested flags + * \param flags 0, or one or more SDL_RendererFlags OR'd together + * \returns a valid rendering context or NULL if there was an error; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateSoftwareRenderer + * \sa SDL_DestroyRenderer + * \sa SDL_GetNumRenderDrivers + * \sa SDL_GetRendererInfo + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, + int index, Uint32 flags); + +/** + * Create a 2D software rendering context for a surface. + * + * Two other API which can be used to create SDL_Renderer: + * SDL_CreateRenderer() and SDL_CreateWindowAndRenderer(). These can _also_ + * create a software renderer, but they are intended to be used with an + * SDL_Window as the final destination and not an SDL_Surface. + * + * \param surface the SDL_Surface structure representing the surface where + * rendering is done + * \returns a valid rendering context or NULL if there was an error; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateRenderer + * \sa SDL_CreateWindowRenderer + * \sa SDL_DestroyRenderer + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); + +/** + * Get the renderer associated with a window. + * + * \param window the window to query + * \returns the rendering context on success or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateRenderer + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); + +/** + * Get the window associated with a renderer. + * + * \param renderer the renderer to query + * \returns the window on success or NULL on failure; call SDL_GetError() for + * more information. + * + * \since This function is available since SDL 2.0.22. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_RenderGetWindow(SDL_Renderer *renderer); + +/** + * Get information about a rendering context. + * + * \param renderer the rendering context + * \param info an SDL_RendererInfo structure filled with information about the + * current renderer + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateRenderer + */ +extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, + SDL_RendererInfo * info); + +/** + * Get the output size in pixels of a rendering context. + * + * Due to high-dpi displays, you might end up with a rendering context that + * has more pixels than the window that contains it, so use this instead of + * SDL_GetWindowSize() to decide how much drawing area you have. + * + * \param renderer the rendering context + * \param w an int filled with the width + * \param h an int filled with the height + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRenderer + */ +extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, + int *w, int *h); + +/** + * Create a texture for a rendering context. + * + * You can set the texture scaling method by setting + * `SDL_HINT_RENDER_SCALE_QUALITY` before creating the texture. + * + * \param renderer the rendering context + * \param format one of the enumerated values in SDL_PixelFormatEnum + * \param access one of the enumerated values in SDL_TextureAccess + * \param w the width of the texture in pixels + * \param h the height of the texture in pixels + * \returns a pointer to the created texture or NULL if no rendering context + * was active, the format was unsupported, or the width or height + * were out of range; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateTextureFromSurface + * \sa SDL_DestroyTexture + * \sa SDL_QueryTexture + * \sa SDL_UpdateTexture + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, + Uint32 format, + int access, int w, + int h); + +/** + * Create a texture from an existing surface. + * + * The surface is not modified or freed by this function. + * + * The SDL_TextureAccess hint for the created texture is + * `SDL_TEXTUREACCESS_STATIC`. + * + * The pixel format of the created texture may be different from the pixel + * format of the surface. Use SDL_QueryTexture() to query the pixel format of + * the texture. + * + * \param renderer the rendering context + * \param surface the SDL_Surface structure containing pixel data used to fill + * the texture + * \returns the created texture or NULL on failure; call SDL_GetError() for + * more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateTexture + * \sa SDL_DestroyTexture + * \sa SDL_QueryTexture + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface); + +/** + * Query the attributes of a texture. + * + * \param texture the texture to query + * \param format a pointer filled in with the raw format of the texture; the + * actual format may differ, but pixel transfers will use this + * format (one of the SDL_PixelFormatEnum values). This argument + * can be NULL if you don't need this information. + * \param access a pointer filled in with the actual access to the texture + * (one of the SDL_TextureAccess values). This argument can be + * NULL if you don't need this information. + * \param w a pointer filled in with the width of the texture in pixels. This + * argument can be NULL if you don't need this information. + * \param h a pointer filled in with the height of the texture in pixels. This + * argument can be NULL if you don't need this information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateTexture + */ +extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, + Uint32 * format, int *access, + int *w, int *h); + +/** + * Set an additional color value multiplied into render copy operations. + * + * When this texture is rendered, during the copy operation each source color + * channel is modulated by the appropriate color value according to the + * following formula: + * + * `srcC = srcC * (color / 255)` + * + * Color modulation is not always supported by the renderer; it will return -1 + * if color modulation is not supported. + * + * \param texture the texture to update + * \param r the red color value multiplied into copy operations + * \param g the green color value multiplied into copy operations + * \param b the blue color value multiplied into copy operations + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetTextureColorMod + * \sa SDL_SetTextureAlphaMod + */ +extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * Get the additional color value multiplied into render copy operations. + * + * \param texture the texture to query + * \param r a pointer filled in with the current red color value + * \param g a pointer filled in with the current green color value + * \param b a pointer filled in with the current blue color value + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetTextureAlphaMod + * \sa SDL_SetTextureColorMod + */ +extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * Set an additional alpha value multiplied into render copy operations. + * + * When this texture is rendered, during the copy operation the source alpha + * value is modulated by this alpha value according to the following formula: + * + * `srcA = srcA * (alpha / 255)` + * + * Alpha modulation is not always supported by the renderer; it will return -1 + * if alpha modulation is not supported. + * + * \param texture the texture to update + * \param alpha the source alpha value multiplied into copy operations + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetTextureAlphaMod + * \sa SDL_SetTextureColorMod + */ +extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, + Uint8 alpha); + +/** + * Get the additional alpha value multiplied into render copy operations. + * + * \param texture the texture to query + * \param alpha a pointer filled in with the current alpha value + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetTextureColorMod + * \sa SDL_SetTextureAlphaMod + */ +extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, + Uint8 * alpha); + +/** + * Set the blend mode for a texture, used by SDL_RenderCopy(). + * + * If the blend mode is not supported, the closest supported mode is chosen + * and this function returns -1. + * + * \param texture the texture to update + * \param blendMode the SDL_BlendMode to use for texture blending + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetTextureBlendMode + * \sa SDL_RenderCopy + */ +extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, + SDL_BlendMode blendMode); + +/** + * Get the blend mode used for texture copy operations. + * + * \param texture the texture to query + * \param blendMode a pointer filled in with the current SDL_BlendMode + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetTextureBlendMode + */ +extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, + SDL_BlendMode *blendMode); + +/** + * Set the scale mode used for texture scale operations. + * + * If the scale mode is not supported, the closest supported mode is chosen. + * + * \param texture The texture to update. + * \param scaleMode the SDL_ScaleMode to use for texture scaling. + * \returns 0 on success, or -1 if the texture is not valid. + * + * \since This function is available since SDL 2.0.12. + * + * \sa SDL_GetTextureScaleMode + */ +extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture, + SDL_ScaleMode scaleMode); + +/** + * Get the scale mode used for texture scale operations. + * + * \param texture the texture to query. + * \param scaleMode a pointer filled in with the current scale mode. + * \return 0 on success, or -1 if the texture is not valid. + * + * \since This function is available since SDL 2.0.12. + * + * \sa SDL_SetTextureScaleMode + */ +extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, + SDL_ScaleMode *scaleMode); + +/** + * Associate a user-specified pointer with a texture. + * + * \param texture the texture to update. + * \param userdata the pointer to associate with the texture. + * \returns 0 on success, or -1 if the texture is not valid. + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_GetTextureUserData + */ +extern DECLSPEC int SDLCALL SDL_SetTextureUserData(SDL_Texture * texture, + void *userdata); + +/** + * Get the user-specified pointer associated with a texture + * + * \param texture the texture to query. + * \return the pointer associated with the texture, or NULL if the texture is + * not valid. + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_SetTextureUserData + */ +extern DECLSPEC void * SDLCALL SDL_GetTextureUserData(SDL_Texture * texture); + +/** + * Update the given texture rectangle with new pixel data. + * + * The pixel data must be in the pixel format of the texture. Use + * SDL_QueryTexture() to query the pixel format of the texture. + * + * This is a fairly slow function, intended for use with static textures that + * do not change often. + * + * If the texture is intended to be updated often, it is preferred to create + * the texture as streaming and use the locking functions referenced below. + * While this function will work with streaming textures, for optimization + * reasons you may not get the pixels back if you lock the texture afterward. + * + * \param texture the texture to update + * \param rect an SDL_Rect structure representing the area to update, or NULL + * to update the entire texture + * \param pixels the raw pixel data in the format of the texture + * \param pitch the number of bytes in a row of pixel data, including padding + * between lines + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateTexture + * \sa SDL_LockTexture + * \sa SDL_UnlockTexture + */ +extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const void *pixels, int pitch); + +/** + * Update a rectangle within a planar YV12 or IYUV texture with new pixel + * data. + * + * You can use SDL_UpdateTexture() as long as your pixel data is a contiguous + * block of Y and U/V planes in the proper order, but this function is + * available if your pixel data is not contiguous. + * + * \param texture the texture to update + * \param rect a pointer to the rectangle of pixels to update, or NULL to + * update the entire texture + * \param Yplane the raw pixel data for the Y plane + * \param Ypitch the number of bytes between rows of pixel data for the Y + * plane + * \param Uplane the raw pixel data for the U plane + * \param Upitch the number of bytes between rows of pixel data for the U + * plane + * \param Vplane the raw pixel data for the V plane + * \param Vpitch the number of bytes between rows of pixel data for the V + * plane + * \returns 0 on success or -1 if the texture is not valid; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.1. + * + * \sa SDL_UpdateTexture + */ +extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch); + +/** + * Update a rectangle within a planar NV12 or NV21 texture with new pixels. + * + * You can use SDL_UpdateTexture() as long as your pixel data is a contiguous + * block of NV12/21 planes in the proper order, but this function is available + * if your pixel data is not contiguous. + * + * \param texture the texture to update + * \param rect a pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param Yplane the raw pixel data for the Y plane. + * \param Ypitch the number of bytes between rows of pixel data for the Y + * plane. + * \param UVplane the raw pixel data for the UV plane. + * \param UVpitch the number of bytes between rows of pixel data for the UV + * plane. + * \return 0 on success, or -1 if the texture is not valid. + * + * \since This function is available since SDL 2.0.16. + */ +extern DECLSPEC int SDLCALL SDL_UpdateNVTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *UVplane, int UVpitch); + +/** + * Lock a portion of the texture for **write-only** pixel access. + * + * As an optimization, the pixels made available for editing don't necessarily + * contain the old texture data. This is a write-only operation, and if you + * need to keep a copy of the texture data you should do that at the + * application level. + * + * You must use SDL_UnlockTexture() to unlock the pixels and apply any + * changes. + * + * \param texture the texture to lock for access, which was created with + * `SDL_TEXTUREACCESS_STREAMING` + * \param rect an SDL_Rect structure representing the area to lock for access; + * NULL to lock the entire texture + * \param pixels this is filled in with a pointer to the locked pixels, + * appropriately offset by the locked area + * \param pitch this is filled in with the pitch of the locked pixels; the + * pitch is the length of one row in bytes + * \returns 0 on success or a negative error code if the texture is not valid + * or was not created with `SDL_TEXTUREACCESS_STREAMING`; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_UnlockTexture + */ +extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, + const SDL_Rect * rect, + void **pixels, int *pitch); + +/** + * Lock a portion of the texture for **write-only** pixel access, and expose + * it as a SDL surface. + * + * Besides providing an SDL_Surface instead of raw pixel data, this function + * operates like SDL_LockTexture. + * + * As an optimization, the pixels made available for editing don't necessarily + * contain the old texture data. This is a write-only operation, and if you + * need to keep a copy of the texture data you should do that at the + * application level. + * + * You must use SDL_UnlockTexture() to unlock the pixels and apply any + * changes. + * + * The returned surface is freed internally after calling SDL_UnlockTexture() + * or SDL_DestroyTexture(). The caller should not free it. + * + * \param texture the texture to lock for access, which was created with + * `SDL_TEXTUREACCESS_STREAMING` + * \param rect a pointer to the rectangle to lock for access. If the rect is + * NULL, the entire texture will be locked + * \param surface this is filled in with an SDL surface representing the + * locked area + * \returns 0 on success, or -1 if the texture is not valid or was not created + * with `SDL_TEXTUREACCESS_STREAMING` + * + * \since This function is available since SDL 2.0.12. + * + * \sa SDL_LockTexture + * \sa SDL_UnlockTexture + */ +extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture, + const SDL_Rect *rect, + SDL_Surface **surface); + +/** + * Unlock a texture, uploading the changes to video memory, if needed. + * + * **Warning**: Please note that SDL_LockTexture() is intended to be + * write-only; it will not guarantee the previous contents of the texture will + * be provided. You must fully initialize any area of a texture that you lock + * before unlocking it, as the pixels might otherwise be uninitialized memory. + * + * Which is to say: locking and immediately unlocking a texture can result in + * corrupted textures, depending on the renderer in use. + * + * \param texture a texture locked by SDL_LockTexture() + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LockTexture + */ +extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); + +/** + * Determine whether a renderer supports the use of render targets. + * + * \param renderer the renderer that will be checked + * \returns SDL_TRUE if supported or SDL_FALSE if not. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetRenderTarget + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer); + +/** + * Set a texture as the current rendering target. + * + * Before using this function, you should check the + * `SDL_RENDERER_TARGETTEXTURE` bit in the flags of SDL_RendererInfo to see if + * render targets are supported. + * + * The default render target is the window for which the renderer was created. + * To stop rendering to a texture and render to the window again, call this + * function with a NULL `texture`. + * + * \param renderer the rendering context + * \param texture the targeted texture, which must be created with the + * `SDL_TEXTUREACCESS_TARGET` flag, or NULL to render to the + * window instead of a texture. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRenderTarget + */ +extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, + SDL_Texture *texture); + +/** + * Get the current render target. + * + * The default render target is the window for which the renderer was created, + * and is reported a NULL here. + * + * \param renderer the rendering context + * \returns the current render target or NULL for the default render target. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetRenderTarget + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); + +/** + * Set a device independent resolution for rendering. + * + * This function uses the viewport and scaling functionality to allow a fixed + * logical resolution for rendering, regardless of the actual output + * resolution. If the actual output resolution doesn't have the same aspect + * ratio the output rendering will be centered within the output display. + * + * If the output display is a window, mouse and touch events in the window + * will be filtered and scaled so they seem to arrive within the logical + * resolution. The SDL_HINT_MOUSE_RELATIVE_SCALING hint controls whether + * relative motion events are also scaled. + * + * If this function results in scaling or subpixel drawing by the rendering + * backend, it will be handled using the appropriate quality hints. + * + * \param renderer the renderer for which resolution should be set + * \param w the width of the logical resolution + * \param h the height of the logical resolution + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderGetLogicalSize + */ +extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h); + +/** + * Get device independent resolution for rendering. + * + * When using the main rendering target (eg no target texture is set): this + * may return 0 for `w` and `h` if the SDL_Renderer has never had its logical + * size set by SDL_RenderSetLogicalSize(). Otherwise it returns the logical + * width and height. + * + * When using a target texture: Never return 0 for `w` and `h` at first. Then + * it returns the logical width and height that are set. + * + * \param renderer a rendering context + * \param w an int to be filled with the width + * \param h an int to be filled with the height + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderSetLogicalSize + */ +extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h); + +/** + * Set whether to force integer scales for resolution-independent rendering. + * + * This function restricts the logical viewport to integer values - that is, + * when a resolution is between two multiples of a logical size, the viewport + * size is rounded down to the lower multiple. + * + * \param renderer the renderer for which integer scaling should be set + * \param enable enable or disable the integer scaling for rendering + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_RenderGetIntegerScale + * \sa SDL_RenderSetLogicalSize + */ +extern DECLSPEC int SDLCALL SDL_RenderSetIntegerScale(SDL_Renderer * renderer, + SDL_bool enable); + +/** + * Get whether integer scales are forced for resolution-independent rendering. + * + * \param renderer the renderer from which integer scaling should be queried + * \returns SDL_TRUE if integer scales are forced or SDL_FALSE if not and on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_RenderSetIntegerScale + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RenderGetIntegerScale(SDL_Renderer * renderer); + +/** + * Set the drawing area for rendering on the current target. + * + * When the window is resized, the viewport is reset to fill the entire new + * window size. + * + * \param renderer the rendering context + * \param rect the SDL_Rect structure representing the drawing area, or NULL + * to set the viewport to the entire target + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderGetViewport + */ +extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * Get the drawing area for the current target. + * + * \param renderer the rendering context + * \param rect an SDL_Rect structure filled in with the current drawing area + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderSetViewport + */ +extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, + SDL_Rect * rect); + +/** + * Set the clip rectangle for rendering on the specified target. + * + * \param renderer the rendering context for which clip rectangle should be + * set + * \param rect an SDL_Rect structure representing the clip area, relative to + * the viewport, or NULL to disable clipping + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderGetClipRect + * \sa SDL_RenderIsClipEnabled + */ +extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * Get the clip rectangle for the current target. + * + * \param renderer the rendering context from which clip rectangle should be + * queried + * \param rect an SDL_Rect structure filled in with the current clipping area + * or an empty rectangle if clipping is disabled + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderIsClipEnabled + * \sa SDL_RenderSetClipRect + */ +extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, + SDL_Rect * rect); + +/** + * Get whether clipping is enabled on the given renderer. + * + * \param renderer the renderer from which clip state should be queried + * \returns SDL_TRUE if clipping is enabled or SDL_FALSE if not; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.4. + * + * \sa SDL_RenderGetClipRect + * \sa SDL_RenderSetClipRect + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer); + + +/** + * Set the drawing scale for rendering on the current target. + * + * The drawing coordinates are scaled by the x/y scaling factors before they + * are used by the renderer. This allows resolution independent drawing with a + * single coordinate system. + * + * If this results in scaling or subpixel drawing by the rendering backend, it + * will be handled using the appropriate quality hints. For best results use + * integer scaling factors. + * + * \param renderer a rendering context + * \param scaleX the horizontal scaling factor + * \param scaleY the vertical scaling factor + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderGetScale + * \sa SDL_RenderSetLogicalSize + */ +extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, + float scaleX, float scaleY); + +/** + * Get the drawing scale for the current target. + * + * \param renderer the renderer from which drawing scale should be queried + * \param scaleX a pointer filled in with the horizontal scaling factor + * \param scaleY a pointer filled in with the vertical scaling factor + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderSetScale + */ +extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, + float *scaleX, float *scaleY); + +/** + * Get logical coordinates of point in renderer when given real coordinates of + * point in window. + * + * Logical coordinates will differ from real coordinates when render is scaled + * and logical renderer size set + * + * \param renderer the renderer from which the logical coordinates should be + * calculated + * \param windowX the real X coordinate in the window + * \param windowY the real Y coordinate in the window + * \param logicalX the pointer filled with the logical x coordinate + * \param logicalY the pointer filled with the logical y coordinate + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_RenderGetScale + * \sa SDL_RenderSetScale + * \sa SDL_RenderGetLogicalSize + * \sa SDL_RenderSetLogicalSize + */ +extern DECLSPEC void SDLCALL SDL_RenderWindowToLogical(SDL_Renderer * renderer, + int windowX, int windowY, + float *logicalX, float *logicalY); + + +/** + * Get real coordinates of point in window when given logical coordinates of + * point in renderer. + * + * Logical coordinates will differ from real coordinates when render is scaled + * and logical renderer size set + * + * \param renderer the renderer from which the window coordinates should be + * calculated + * \param logicalX the logical x coordinate + * \param logicalY the logical y coordinate + * \param windowX the pointer filled with the real X coordinate in the window + * \param windowY the pointer filled with the real Y coordinate in the window + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_RenderGetScale + * \sa SDL_RenderSetScale + * \sa SDL_RenderGetLogicalSize + * \sa SDL_RenderSetLogicalSize + */ +extern DECLSPEC void SDLCALL SDL_RenderLogicalToWindow(SDL_Renderer * renderer, + float logicalX, float logicalY, + int *windowX, int *windowY); + +/** + * Set the color used for drawing operations (Rect, Line and Clear). + * + * Set the color for drawing or filling rectangles, lines, and points, and for + * SDL_RenderClear(). + * + * \param renderer the rendering context + * \param r the red value used to draw on the rendering target + * \param g the green value used to draw on the rendering target + * \param b the blue value used to draw on the rendering target + * \param a the alpha value used to draw on the rendering target; usually + * `SDL_ALPHA_OPAQUE` (255). Use SDL_SetRenderDrawBlendMode to + * specify how the alpha channel is used + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRenderDrawColor + * \sa SDL_RenderClear + * \sa SDL_RenderDrawLine + * \sa SDL_RenderDrawLines + * \sa SDL_RenderDrawPoint + * \sa SDL_RenderDrawPoints + * \sa SDL_RenderDrawRect + * \sa SDL_RenderDrawRects + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects + */ +extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer, + Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * Get the color used for drawing operations (Rect, Line and Clear). + * + * \param renderer the rendering context + * \param r a pointer filled in with the red value used to draw on the + * rendering target + * \param g a pointer filled in with the green value used to draw on the + * rendering target + * \param b a pointer filled in with the blue value used to draw on the + * rendering target + * \param a a pointer filled in with the alpha value used to draw on the + * rendering target; usually `SDL_ALPHA_OPAQUE` (255) + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetRenderDrawColor + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer, + Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * Set the blend mode used for drawing operations (Fill and Line). + * + * If the blend mode is not supported, the closest supported mode is chosen. + * + * \param renderer the rendering context + * \param blendMode the SDL_BlendMode to use for blending + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRenderDrawBlendMode + * \sa SDL_RenderDrawLine + * \sa SDL_RenderDrawLines + * \sa SDL_RenderDrawPoint + * \sa SDL_RenderDrawPoints + * \sa SDL_RenderDrawRect + * \sa SDL_RenderDrawRects + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects + */ +extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, + SDL_BlendMode blendMode); + +/** + * Get the blend mode used for drawing operations. + * + * \param renderer the rendering context + * \param blendMode a pointer filled in with the current SDL_BlendMode + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetRenderDrawBlendMode + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, + SDL_BlendMode *blendMode); + +/** + * Clear the current rendering target with the drawing color. + * + * This function clears the entire rendering target, ignoring the viewport and + * the clip rectangle. + * + * \param renderer the rendering context + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetRenderDrawColor + */ +extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); + +/** + * Draw a point on the current rendering target. + * + * SDL_RenderDrawPoint() draws a single point. If you want to draw multiple, + * use SDL_RenderDrawPoints() instead. + * + * \param renderer the rendering context + * \param x the x coordinate of the point + * \param y the y coordinate of the point + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderDrawLine + * \sa SDL_RenderDrawLines + * \sa SDL_RenderDrawPoints + * \sa SDL_RenderDrawRect + * \sa SDL_RenderDrawRects + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects + * \sa SDL_RenderPresent + * \sa SDL_SetRenderDrawBlendMode + * \sa SDL_SetRenderDrawColor + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, + int x, int y); + +/** + * Draw multiple points on the current rendering target. + * + * \param renderer the rendering context + * \param points an array of SDL_Point structures that represent the points to + * draw + * \param count the number of points to draw + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderDrawLine + * \sa SDL_RenderDrawLines + * \sa SDL_RenderDrawPoint + * \sa SDL_RenderDrawRect + * \sa SDL_RenderDrawRects + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects + * \sa SDL_RenderPresent + * \sa SDL_SetRenderDrawBlendMode + * \sa SDL_SetRenderDrawColor + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_Point * points, + int count); + +/** + * Draw a line on the current rendering target. + * + * SDL_RenderDrawLine() draws the line to include both end points. If you want + * to draw multiple, connecting lines use SDL_RenderDrawLines() instead. + * + * \param renderer the rendering context + * \param x1 the x coordinate of the start point + * \param y1 the y coordinate of the start point + * \param x2 the x coordinate of the end point + * \param y2 the y coordinate of the end point + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderDrawLines + * \sa SDL_RenderDrawPoint + * \sa SDL_RenderDrawPoints + * \sa SDL_RenderDrawRect + * \sa SDL_RenderDrawRects + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects + * \sa SDL_RenderPresent + * \sa SDL_SetRenderDrawBlendMode + * \sa SDL_SetRenderDrawColor + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, + int x1, int y1, int x2, int y2); + +/** + * Draw a series of connected lines on the current rendering target. + * + * \param renderer the rendering context + * \param points an array of SDL_Point structures representing points along + * the lines + * \param count the number of points, drawing count-1 lines + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderDrawLine + * \sa SDL_RenderDrawPoint + * \sa SDL_RenderDrawPoints + * \sa SDL_RenderDrawRect + * \sa SDL_RenderDrawRects + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects + * \sa SDL_RenderPresent + * \sa SDL_SetRenderDrawBlendMode + * \sa SDL_SetRenderDrawColor + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, + const SDL_Point * points, + int count); + +/** + * Draw a rectangle on the current rendering target. + * + * \param renderer the rendering context + * \param rect an SDL_Rect structure representing the rectangle to draw, or + * NULL to outline the entire rendering target + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderDrawLine + * \sa SDL_RenderDrawLines + * \sa SDL_RenderDrawPoint + * \sa SDL_RenderDrawPoints + * \sa SDL_RenderDrawRects + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects + * \sa SDL_RenderPresent + * \sa SDL_SetRenderDrawBlendMode + * \sa SDL_SetRenderDrawColor + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * Draw some number of rectangles on the current rendering target. + * + * \param renderer the rendering context + * \param rects an array of SDL_Rect structures representing the rectangles to + * be drawn + * \param count the number of rectangles + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderDrawLine + * \sa SDL_RenderDrawLines + * \sa SDL_RenderDrawPoint + * \sa SDL_RenderDrawPoints + * \sa SDL_RenderDrawRect + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects + * \sa SDL_RenderPresent + * \sa SDL_SetRenderDrawBlendMode + * \sa SDL_SetRenderDrawColor + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, + const SDL_Rect * rects, + int count); + +/** + * Fill a rectangle on the current rendering target with the drawing color. + * + * The current drawing color is set by SDL_SetRenderDrawColor(), and the + * color's alpha value is ignored unless blending is enabled with the + * appropriate call to SDL_SetRenderDrawBlendMode(). + * + * \param renderer the rendering context + * \param rect the SDL_Rect structure representing the rectangle to fill, or + * NULL for the entire rendering target + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderDrawLine + * \sa SDL_RenderDrawLines + * \sa SDL_RenderDrawPoint + * \sa SDL_RenderDrawPoints + * \sa SDL_RenderDrawRect + * \sa SDL_RenderDrawRects + * \sa SDL_RenderFillRects + * \sa SDL_RenderPresent + * \sa SDL_SetRenderDrawBlendMode + * \sa SDL_SetRenderDrawColor + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * Fill some number of rectangles on the current rendering target with the + * drawing color. + * + * \param renderer the rendering context + * \param rects an array of SDL_Rect structures representing the rectangles to + * be filled + * \param count the number of rectangles + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderDrawLine + * \sa SDL_RenderDrawLines + * \sa SDL_RenderDrawPoint + * \sa SDL_RenderDrawPoints + * \sa SDL_RenderDrawRect + * \sa SDL_RenderDrawRects + * \sa SDL_RenderFillRect + * \sa SDL_RenderPresent + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, + const SDL_Rect * rects, + int count); + +/** + * Copy a portion of the texture to the current rendering target. + * + * The texture is blended with the destination based on its blend mode set + * with SDL_SetTextureBlendMode(). + * + * The texture color is affected based on its color modulation set by + * SDL_SetTextureColorMod(). + * + * The texture alpha is affected based on its alpha modulation set by + * SDL_SetTextureAlphaMod(). + * + * \param renderer the rendering context + * \param texture the source texture + * \param srcrect the source SDL_Rect structure or NULL for the entire texture + * \param dstrect the destination SDL_Rect structure or NULL for the entire + * rendering target; the texture will be stretched to fill the + * given rectangle + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderCopyEx + * \sa SDL_SetTextureAlphaMod + * \sa SDL_SetTextureBlendMode + * \sa SDL_SetTextureColorMod + */ +extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect); + +/** + * Copy a portion of the texture to the current rendering, with optional + * rotation and flipping. + * + * Copy a portion of the texture to the current rendering target, optionally + * rotating it by angle around the given center and also flipping it + * top-bottom and/or left-right. + * + * The texture is blended with the destination based on its blend mode set + * with SDL_SetTextureBlendMode(). + * + * The texture color is affected based on its color modulation set by + * SDL_SetTextureColorMod(). + * + * The texture alpha is affected based on its alpha modulation set by + * SDL_SetTextureAlphaMod(). + * + * \param renderer the rendering context + * \param texture the source texture + * \param srcrect the source SDL_Rect structure or NULL for the entire texture + * \param dstrect the destination SDL_Rect structure or NULL for the entire + * rendering target + * \param angle an angle in degrees that indicates the rotation that will be + * applied to dstrect, rotating it in a clockwise direction + * \param center a pointer to a point indicating the point around which + * dstrect will be rotated (if NULL, rotation will be done + * around `dstrect.w / 2`, `dstrect.h / 2`) + * \param flip a SDL_RendererFlip value stating which flipping actions should + * be performed on the texture + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderCopy + * \sa SDL_SetTextureAlphaMod + * \sa SDL_SetTextureBlendMode + * \sa SDL_SetTextureColorMod + */ +extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect, + const double angle, + const SDL_Point *center, + const SDL_RendererFlip flip); + + +/** + * Draw a point on the current rendering target at subpixel precision. + * + * \param renderer The renderer which should draw a point. + * \param x The x coordinate of the point. + * \param y The y coordinate of the point. + * \return 0 on success, or -1 on error + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPointF(SDL_Renderer * renderer, + float x, float y); + +/** + * Draw multiple points on the current rendering target at subpixel precision. + * + * \param renderer The renderer which should draw multiple points. + * \param points The points to draw + * \param count The number of points to draw + * \return 0 on success, or -1 on error + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPointsF(SDL_Renderer * renderer, + const SDL_FPoint * points, + int count); + +/** + * Draw a line on the current rendering target at subpixel precision. + * + * \param renderer The renderer which should draw a line. + * \param x1 The x coordinate of the start point. + * \param y1 The y coordinate of the start point. + * \param x2 The x coordinate of the end point. + * \param y2 The y coordinate of the end point. + * \return 0 on success, or -1 on error + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLineF(SDL_Renderer * renderer, + float x1, float y1, float x2, float y2); + +/** + * Draw a series of connected lines on the current rendering target at + * subpixel precision. + * + * \param renderer The renderer which should draw multiple lines. + * \param points The points along the lines + * \param count The number of points, drawing count-1 lines + * \return 0 on success, or -1 on error + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLinesF(SDL_Renderer * renderer, + const SDL_FPoint * points, + int count); + +/** + * Draw a rectangle on the current rendering target at subpixel precision. + * + * \param renderer The renderer which should draw a rectangle. + * \param rect A pointer to the destination rectangle, or NULL to outline the + * entire rendering target. + * \return 0 on success, or -1 on error + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRectF(SDL_Renderer * renderer, + const SDL_FRect * rect); + +/** + * Draw some number of rectangles on the current rendering target at subpixel + * precision. + * + * \param renderer The renderer which should draw multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * \return 0 on success, or -1 on error + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRectsF(SDL_Renderer * renderer, + const SDL_FRect * rects, + int count); + +/** + * Fill a rectangle on the current rendering target with the drawing color at + * subpixel precision. + * + * \param renderer The renderer which should fill a rectangle. + * \param rect A pointer to the destination rectangle, or NULL for the entire + * rendering target. + * \return 0 on success, or -1 on error + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRectF(SDL_Renderer * renderer, + const SDL_FRect * rect); + +/** + * Fill some number of rectangles on the current rendering target with the + * drawing color at subpixel precision. + * + * \param renderer The renderer which should fill multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * \return 0 on success, or -1 on error + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRectsF(SDL_Renderer * renderer, + const SDL_FRect * rects, + int count); + +/** + * Copy a portion of the texture to the current rendering target at subpixel + * precision. + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * \return 0 on success, or -1 on error + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderCopyF(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_FRect * dstrect); + +/** + * Copy a portion of the source texture to the current rendering target, with + * rotation and flipping, at subpixel precision. + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * \param angle An angle in degrees that indicates the rotation that will be + * applied to dstrect, rotating it in a clockwise direction + * \param center A pointer to a point indicating the point around which + * dstrect will be rotated (if NULL, rotation will be done + * around dstrect.w/2, dstrect.h/2). + * \param flip An SDL_RendererFlip value stating which flipping actions should + * be performed on the texture + * \return 0 on success, or -1 on error + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_FRect * dstrect, + const double angle, + const SDL_FPoint *center, + const SDL_RendererFlip flip); + +/** + * Render a list of triangles, optionally using a texture and indices into the + * vertex array Color and alpha modulation is done per vertex + * (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored). + * + * \param renderer The rendering context. + * \param texture (optional) The SDL texture to use. + * \param vertices Vertices. + * \param num_vertices Number of vertices. + * \param indices (optional) An array of integer indices into the 'vertices' + * array, if NULL all vertices will be rendered in sequential + * order. + * \param num_indices Number of indices. + * \return 0 on success, or -1 if the operation is not supported + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_RenderGeometryRaw + * \sa SDL_Vertex + */ +extern DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, + SDL_Texture *texture, + const SDL_Vertex *vertices, int num_vertices, + const int *indices, int num_indices); + +/** + * Render a list of triangles, optionally using a texture and indices into the + * vertex arrays Color and alpha modulation is done per vertex + * (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored). + * + * \param renderer The rendering context. + * \param texture (optional) The SDL texture to use. + * \param xy Vertex positions + * \param xy_stride Byte size to move from one element to the next element + * \param color Vertex colors (as SDL_Color) + * \param color_stride Byte size to move from one element to the next element + * \param uv Vertex normalized texture coordinates + * \param uv_stride Byte size to move from one element to the next element + * \param num_vertices Number of vertices. + * \param indices (optional) An array of indices into the 'vertices' arrays, + * if NULL all vertices will be rendered in sequential order. + * \param num_indices Number of indices. + * \param size_indices Index size: 1 (byte), 2 (short), 4 (int) + * \return 0 on success, or -1 if the operation is not supported + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_RenderGeometry + * \sa SDL_Vertex + */ +extern DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, + SDL_Texture *texture, + const float *xy, int xy_stride, + const SDL_Color *color, int color_stride, + const float *uv, int uv_stride, + int num_vertices, + const void *indices, int num_indices, int size_indices); + +/** + * Read pixels from the current rendering target to an array of pixels. + * + * **WARNING**: This is a very slow operation, and should not be used + * frequently. If you're using this on the main rendering target, it should be + * called after rendering and before SDL_RenderPresent(). + * + * `pitch` specifies the number of bytes between rows in the destination + * `pixels` data. This allows you to write to a subrectangle or have padded + * rows in the destination. Generally, `pitch` should equal the number of + * pixels per row in the `pixels` data times the number of bytes per pixel, + * but it might contain additional padding (for example, 24bit RGB Windows + * Bitmap data pads all rows to multiples of 4 bytes). + * + * \param renderer the rendering context + * \param rect an SDL_Rect structure representing the area to read, or NULL + * for the entire render target + * \param format an SDL_PixelFormatEnum value of the desired format of the + * pixel data, or 0 to use the format of the rendering target + * \param pixels a pointer to the pixel data to copy into + * \param pitch the pitch of the `pixels` parameter + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, + const SDL_Rect * rect, + Uint32 format, + void *pixels, int pitch); + +/** + * Update the screen with any rendering performed since the previous call. + * + * SDL's rendering functions operate on a backbuffer; that is, calling a + * rendering function such as SDL_RenderDrawLine() does not directly put a + * line on the screen, but rather updates the backbuffer. As such, you compose + * your entire scene and *present* the composed backbuffer to the screen as a + * complete picture. + * + * Therefore, when using SDL's rendering API, one does all drawing intended + * for the frame, and then calls this function once per frame to present the + * final drawing to the user. + * + * The backbuffer should be considered invalidated after each present; do not + * assume that previous contents will exist between frames. You are strongly + * encouraged to call SDL_RenderClear() to initialize the backbuffer before + * starting each new frame's drawing, even if you plan to overwrite every + * pixel. + * + * \param renderer the rendering context + * + * \threadsafety You may only call this function on the main thread. If this + * happens to work on a background thread on any given platform + * or backend, it's purely by luck and you should not rely on it + * to work next time. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RenderClear + * \sa SDL_RenderDrawLine + * \sa SDL_RenderDrawLines + * \sa SDL_RenderDrawPoint + * \sa SDL_RenderDrawPoints + * \sa SDL_RenderDrawRect + * \sa SDL_RenderDrawRects + * \sa SDL_RenderFillRect + * \sa SDL_RenderFillRects + * \sa SDL_SetRenderDrawBlendMode + * \sa SDL_SetRenderDrawColor + */ +extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); + +/** + * Destroy the specified texture. + * + * Passing NULL or an otherwise invalid texture will set the SDL error message + * to "Invalid texture". + * + * \param texture the texture to destroy + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateTexture + * \sa SDL_CreateTextureFromSurface + */ +extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); + +/** + * Destroy the rendering context for a window and free associated textures. + * + * If `renderer` is NULL, this function will return immediately after setting + * the SDL error message to "Invalid renderer". See SDL_GetError(). + * + * \param renderer the rendering context + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateRenderer + */ +extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); + +/** + * Force the rendering context to flush any pending commands to the underlying + * rendering API. + * + * You do not need to (and in fact, shouldn't) call this function unless you + * are planning to call into OpenGL/Direct3D/Metal/whatever directly in + * addition to using an SDL_Renderer. + * + * This is for a very-specific case: if you are using SDL's render API, you + * asked for a specific renderer backend (OpenGL, Direct3D, etc), you set + * SDL_HINT_RENDER_BATCHING to "1", and you plan to make OpenGL/D3D/whatever + * calls in addition to SDL render API calls. If all of this applies, you + * should call SDL_RenderFlush() between calls to SDL's render API and the + * low-level API you're using in cooperation. + * + * In all other cases, you can ignore this function. This is only here to get + * maximum performance out of a specific situation. In all other cases, SDL + * will do the right thing, perhaps at a performance loss. + * + * This function is first available in SDL 2.0.10, and is not needed in 2.0.9 + * and earlier, as earlier versions did not queue rendering commands at all, + * instead flushing them to the OS immediately. + * + * \param renderer the rendering context + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC int SDLCALL SDL_RenderFlush(SDL_Renderer * renderer); + + +/** + * Bind an OpenGL/ES/ES2 texture to the current context. + * + * This is for use with OpenGL instructions when rendering OpenGL primitives + * directly. + * + * If not NULL, `texw` and `texh` will be filled with the width and height + * values suitable for the provided texture. In most cases, both will be 1.0, + * however, on systems that support the GL_ARB_texture_rectangle extension, + * these values will actually be the pixel width and height used to create the + * texture, so this factor needs to be taken into account when providing + * texture coordinates to OpenGL. + * + * You need a renderer to create an SDL_Texture, therefore you can only use + * this function with an implicit OpenGL context from SDL_CreateRenderer(), + * not with your own OpenGL context. If you need control over your OpenGL + * context, you need to write your own texture-loading methods. + * + * Also note that SDL may upload RGB textures as BGR (or vice-versa), and + * re-order the color channels in the shaders phase, so the uploaded texture + * may have swapped color channels. + * + * \param texture the texture to bind to the current OpenGL/ES/ES2 context + * \param texw a pointer to a float value which will be filled with the + * texture width or NULL if you don't need that value + * \param texh a pointer to a float value which will be filled with the + * texture height or NULL if you don't need that value + * \returns 0 on success, or -1 if the operation is not supported; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_MakeCurrent + * \sa SDL_GL_UnbindTexture + */ +extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh); + +/** + * Unbind an OpenGL/ES/ES2 texture from the current context. + * + * See SDL_GL_BindTexture() for examples on how to use these functions + * + * \param texture the texture to unbind from the current OpenGL/ES/ES2 context + * \returns 0 on success, or -1 if the operation is not supported + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_BindTexture + * \sa SDL_GL_MakeCurrent + */ +extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); + +/** + * Get the CAMetalLayer associated with the given Metal renderer. + * + * This function returns `void *`, so SDL doesn't have to include Metal's + * headers, but it can be safely cast to a `CAMetalLayer *`. + * + * \param renderer The renderer to query + * \returns a `CAMetalLayer *` on success, or NULL if the renderer isn't a + * Metal renderer + * + * \since This function is available since SDL 2.0.8. + * + * \sa SDL_RenderGetMetalCommandEncoder + */ +extern DECLSPEC void *SDLCALL SDL_RenderGetMetalLayer(SDL_Renderer * renderer); + +/** + * Get the Metal command encoder for the current frame + * + * This function returns `void *`, so SDL doesn't have to include Metal's + * headers, but it can be safely cast to an `id`. + * + * Note that as of SDL 2.0.18, this will return NULL if Metal refuses to give + * SDL a drawable to render to, which might happen if the window is + * hidden/minimized/offscreen. This doesn't apply to command encoders for + * render targets, just the window's backbacker. Check your return values! + * + * \param renderer The renderer to query + * \returns an `id` on success, or NULL if the + * renderer isn't a Metal renderer or there was an error. + * + * \since This function is available since SDL 2.0.8. + * + * \sa SDL_RenderGetMetalLayer + */ +extern DECLSPEC void *SDLCALL SDL_RenderGetMetalCommandEncoder(SDL_Renderer * renderer); + +/** + * Toggle VSync of the given renderer. + * + * \param renderer The renderer to toggle + * \param vsync 1 for on, 0 for off. All other values are reserved + * \returns a 0 int on success, or non-zero on failure + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_RenderSetVSync(SDL_Renderer* renderer, int vsync); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_render_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_revision.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_revision.h new file mode 100644 index 00000000..84d60034 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_revision.h @@ -0,0 +1,7 @@ +/* Generated by updaterev.sh, do not edit */ +#ifdef SDL_VENDOR_INFO +#define SDL_REVISION "SDL-release-2.28.2-0-g031912c4b (" SDL_VENDOR_INFO ")" +#else +#define SDL_REVISION "SDL-release-2.28.2-0-g031912c4b" +#endif +#define SDL_REVISION_NUMBER 0 diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_rwops.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_rwops.h new file mode 100644 index 00000000..eabbbf23 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_rwops.h @@ -0,0 +1,841 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_rwops.h + * + * This file provides a general interface for SDL to read and write + * data streams. It can easily be extended to files, memory, etc. + */ + +#ifndef SDL_rwops_h_ +#define SDL_rwops_h_ + +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* RWops Types */ +#define SDL_RWOPS_UNKNOWN 0U /**< Unknown stream type */ +#define SDL_RWOPS_WINFILE 1U /**< Win32 file */ +#define SDL_RWOPS_STDFILE 2U /**< Stdio file */ +#define SDL_RWOPS_JNIFILE 3U /**< Android asset */ +#define SDL_RWOPS_MEMORY 4U /**< Memory stream */ +#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */ + +/** + * This is the read/write operation structure -- very basic. + */ +typedef struct SDL_RWops +{ + /** + * Return the size of the file in this rwops, or -1 if unknown + */ + Sint64 (SDLCALL * size) (struct SDL_RWops * context); + + /** + * Seek to \c offset relative to \c whence, one of stdio's whence values: + * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END + * + * \return the final offset in the data stream, or -1 on error. + */ + Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset, + int whence); + + /** + * Read up to \c maxnum objects each of size \c size from the data + * stream to the area pointed at by \c ptr. + * + * \return the number of objects read, or 0 at error or end of file. + */ + size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr, + size_t size, size_t maxnum); + + /** + * Write exactly \c num objects each of size \c size from the area + * pointed at by \c ptr to data stream. + * + * \return the number of objects written, or 0 at error or end of file. + */ + size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr, + size_t size, size_t num); + + /** + * Close and free an allocated SDL_RWops structure. + * + * \return 0 if successful or -1 on write error when flushing data. + */ + int (SDLCALL * close) (struct SDL_RWops * context); + + Uint32 type; + union + { +#if defined(__ANDROID__) + struct + { + void *asset; + } androidio; +#elif defined(__WIN32__) || defined(__GDK__) + struct + { + SDL_bool append; + void *h; + struct + { + void *data; + size_t size; + size_t left; + } buffer; + } windowsio; +#endif + +#ifdef HAVE_STDIO_H + struct + { + SDL_bool autoclose; + FILE *fp; + } stdio; +#endif + struct + { + Uint8 *base; + Uint8 *here; + Uint8 *stop; + } mem; + struct + { + void *data1; + void *data2; + } unknown; + } hidden; + +} SDL_RWops; + + +/** + * \name RWFrom functions + * + * Functions to create SDL_RWops structures from various data streams. + */ +/* @{ */ + +/** + * Use this function to create a new SDL_RWops structure for reading from + * and/or writing to a named file. + * + * The `mode` string is treated roughly the same as in a call to the C + * library's fopen(), even if SDL doesn't happen to use fopen() behind the + * scenes. + * + * Available `mode` strings: + * + * - "r": Open a file for reading. The file must exist. + * - "w": Create an empty file for writing. If a file with the same name + * already exists its content is erased and the file is treated as a new + * empty file. + * - "a": Append to a file. Writing operations append data at the end of the + * file. The file is created if it does not exist. + * - "r+": Open a file for update both reading and writing. The file must + * exist. + * - "w+": Create an empty file for both reading and writing. If a file with + * the same name already exists its content is erased and the file is + * treated as a new empty file. + * - "a+": Open a file for reading and appending. All writing operations are + * performed at the end of the file, protecting the previous content to be + * overwritten. You can reposition (fseek, rewind) the internal pointer to + * anywhere in the file for reading, but writing operations will move it + * back to the end of file. The file is created if it does not exist. + * + * **NOTE**: In order to open a file as a binary file, a "b" character has to + * be included in the `mode` string. This additional "b" character can either + * be appended at the end of the string (thus making the following compound + * modes: "rb", "wb", "ab", "r+b", "w+b", "a+b") or be inserted between the + * letter and the "+" sign for the mixed modes ("rb+", "wb+", "ab+"). + * Additional characters may follow the sequence, although they should have no + * effect. For example, "t" is sometimes appended to make explicit the file is + * a text file. + * + * This function supports Unicode filenames, but they must be encoded in UTF-8 + * format, regardless of the underlying operating system. + * + * As a fallback, SDL_RWFromFile() will transparently open a matching filename + * in an Android app's `assets`. + * + * Closing the SDL_RWops will close the file handle SDL is holding internally. + * + * \param file a UTF-8 string representing the filename to open + * \param mode an ASCII string representing the mode to be used for opening + * the file. + * \returns a pointer to the SDL_RWops structure that is created, or NULL on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RWclose + * \sa SDL_RWFromConstMem + * \sa SDL_RWFromFP + * \sa SDL_RWFromMem + * \sa SDL_RWread + * \sa SDL_RWseek + * \sa SDL_RWtell + * \sa SDL_RWwrite + */ +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, + const char *mode); + +#ifdef HAVE_STDIO_H + +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, SDL_bool autoclose); + +#else + +/** + * Use this function to create an SDL_RWops structure from a standard I/O file + * pointer (stdio.h's `FILE*`). + * + * This function is not available on Windows, since files opened in an + * application on that platform cannot be used by a dynamically linked + * library. + * + * On some platforms, the first parameter is a `void*`, on others, it's a + * `FILE*`, depending on what system headers are available to SDL. It is + * always intended to be the `FILE*` type from the C runtime's stdio.h. + * + * \param fp the `FILE*` that feeds the SDL_RWops stream + * \param autoclose SDL_TRUE to close the `FILE*` when closing the SDL_RWops, + * SDL_FALSE to leave the `FILE*` open when the RWops is + * closed + * \returns a pointer to the SDL_RWops structure that is created, or NULL on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RWclose + * \sa SDL_RWFromConstMem + * \sa SDL_RWFromFile + * \sa SDL_RWFromMem + * \sa SDL_RWread + * \sa SDL_RWseek + * \sa SDL_RWtell + * \sa SDL_RWwrite + */ +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp, + SDL_bool autoclose); +#endif + +/** + * Use this function to prepare a read-write memory buffer for use with + * SDL_RWops. + * + * This function sets up an SDL_RWops struct based on a memory area of a + * certain size, for both read and write access. + * + * This memory buffer is not copied by the RWops; the pointer you provide must + * remain valid until you close the stream. Closing the stream will not free + * the original buffer. + * + * If you need to make sure the RWops never writes to the memory buffer, you + * should use SDL_RWFromConstMem() with a read-only buffer of memory instead. + * + * \param mem a pointer to a buffer to feed an SDL_RWops stream + * \param size the buffer size, in bytes + * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RWclose + * \sa SDL_RWFromConstMem + * \sa SDL_RWFromFile + * \sa SDL_RWFromFP + * \sa SDL_RWFromMem + * \sa SDL_RWread + * \sa SDL_RWseek + * \sa SDL_RWtell + * \sa SDL_RWwrite + */ +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); + +/** + * Use this function to prepare a read-only memory buffer for use with RWops. + * + * This function sets up an SDL_RWops struct based on a memory area of a + * certain size. It assumes the memory area is not writable. + * + * Attempting to write to this RWops stream will report an error without + * writing to the memory buffer. + * + * This memory buffer is not copied by the RWops; the pointer you provide must + * remain valid until you close the stream. Closing the stream will not free + * the original buffer. + * + * If you need to write to a memory buffer, you should use SDL_RWFromMem() + * with a writable buffer of memory instead. + * + * \param mem a pointer to a read-only buffer to feed an SDL_RWops stream + * \param size the buffer size, in bytes + * \returns a pointer to a new SDL_RWops structure, or NULL if it fails; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RWclose + * \sa SDL_RWFromConstMem + * \sa SDL_RWFromFile + * \sa SDL_RWFromFP + * \sa SDL_RWFromMem + * \sa SDL_RWread + * \sa SDL_RWseek + * \sa SDL_RWtell + */ +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, + int size); + +/* @} *//* RWFrom functions */ + + +/** + * Use this function to allocate an empty, unpopulated SDL_RWops structure. + * + * Applications do not need to use this function unless they are providing + * their own SDL_RWops implementation. If you just need a SDL_RWops to + * read/write a common data source, you should use the built-in + * implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc. + * + * You must free the returned pointer with SDL_FreeRW(). Depending on your + * operating system and compiler, there may be a difference between the + * malloc() and free() your program uses and the versions SDL calls + * internally. Trying to mix the two can cause crashing such as segmentation + * faults. Since all SDL_RWops must free themselves when their **close** + * method is called, all SDL_RWops must be allocated through this function, so + * they can all be freed correctly with SDL_FreeRW(). + * + * \returns a pointer to the allocated memory on success, or NULL on failure; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FreeRW + */ +extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); + +/** + * Use this function to free an SDL_RWops structure allocated by + * SDL_AllocRW(). + * + * Applications do not need to use this function unless they are providing + * their own SDL_RWops implementation. If you just need a SDL_RWops to + * read/write a common data source, you should use the built-in + * implementations in SDL, like SDL_RWFromFile() or SDL_RWFromMem(), etc, and + * call the **close** method on those SDL_RWops pointers when you are done + * with them. + * + * Only use SDL_FreeRW() on pointers returned by SDL_AllocRW(). The pointer is + * invalid as soon as this function returns. Any extra memory allocated during + * creation of the SDL_RWops is not freed by SDL_FreeRW(); the programmer must + * be responsible for managing that memory in their **close** method. + * + * \param area the SDL_RWops structure to be freed + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AllocRW + */ +extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); + +#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ +#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ +#define RW_SEEK_END 2 /**< Seek relative to the end of data */ + +/** + * Use this function to get the size of the data stream in an SDL_RWops. + * + * Prior to SDL 2.0.10, this function was a macro. + * + * \param context the SDL_RWops to get the size of the data stream from + * \returns the size of the data stream in the SDL_RWops on success, -1 if + * unknown or a negative error code on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC Sint64 SDLCALL SDL_RWsize(SDL_RWops *context); + +/** + * Seek within an SDL_RWops data stream. + * + * This function seeks to byte `offset`, relative to `whence`. + * + * `whence` may be any of the following values: + * + * - `RW_SEEK_SET`: seek from the beginning of data + * - `RW_SEEK_CUR`: seek relative to current read point + * - `RW_SEEK_END`: seek relative to the end of data + * + * If this stream can not seek, it will return -1. + * + * SDL_RWseek() is actually a wrapper function that calls the SDL_RWops's + * `seek` method appropriately, to simplify application development. + * + * Prior to SDL 2.0.10, this function was a macro. + * + * \param context a pointer to an SDL_RWops structure + * \param offset an offset in bytes, relative to **whence** location; can be + * negative + * \param whence any of `RW_SEEK_SET`, `RW_SEEK_CUR`, `RW_SEEK_END` + * \returns the final offset in the data stream after the seek or -1 on error. + * + * \since This function is available since SDL 2.0.10. + * + * \sa SDL_RWclose + * \sa SDL_RWFromConstMem + * \sa SDL_RWFromFile + * \sa SDL_RWFromFP + * \sa SDL_RWFromMem + * \sa SDL_RWread + * \sa SDL_RWtell + * \sa SDL_RWwrite + */ +extern DECLSPEC Sint64 SDLCALL SDL_RWseek(SDL_RWops *context, + Sint64 offset, int whence); + +/** + * Determine the current read/write offset in an SDL_RWops data stream. + * + * SDL_RWtell is actually a wrapper function that calls the SDL_RWops's `seek` + * method, with an offset of 0 bytes from `RW_SEEK_CUR`, to simplify + * application development. + * + * Prior to SDL 2.0.10, this function was a macro. + * + * \param context a SDL_RWops data stream object from which to get the current + * offset + * \returns the current offset in the stream, or -1 if the information can not + * be determined. + * + * \since This function is available since SDL 2.0.10. + * + * \sa SDL_RWclose + * \sa SDL_RWFromConstMem + * \sa SDL_RWFromFile + * \sa SDL_RWFromFP + * \sa SDL_RWFromMem + * \sa SDL_RWread + * \sa SDL_RWseek + * \sa SDL_RWwrite + */ +extern DECLSPEC Sint64 SDLCALL SDL_RWtell(SDL_RWops *context); + +/** + * Read from a data source. + * + * This function reads up to `maxnum` objects each of size `size` from the + * data source to the area pointed at by `ptr`. This function may read less + * objects than requested. It will return zero when there has been an error or + * the data stream is completely read. + * + * SDL_RWread() is actually a function wrapper that calls the SDL_RWops's + * `read` method appropriately, to simplify application development. + * + * Prior to SDL 2.0.10, this function was a macro. + * + * \param context a pointer to an SDL_RWops structure + * \param ptr a pointer to a buffer to read data into + * \param size the size of each object to read, in bytes + * \param maxnum the maximum number of objects to be read + * \returns the number of objects read, or 0 at error or end of file; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.10. + * + * \sa SDL_RWclose + * \sa SDL_RWFromConstMem + * \sa SDL_RWFromFile + * \sa SDL_RWFromFP + * \sa SDL_RWFromMem + * \sa SDL_RWseek + * \sa SDL_RWwrite + */ +extern DECLSPEC size_t SDLCALL SDL_RWread(SDL_RWops *context, + void *ptr, size_t size, + size_t maxnum); + +/** + * Write to an SDL_RWops data stream. + * + * This function writes exactly `num` objects each of size `size` from the + * area pointed at by `ptr` to the stream. If this fails for any reason, it'll + * return less than `num` to demonstrate how far the write progressed. On + * success, it returns `num`. + * + * SDL_RWwrite is actually a function wrapper that calls the SDL_RWops's + * `write` method appropriately, to simplify application development. + * + * Prior to SDL 2.0.10, this function was a macro. + * + * \param context a pointer to an SDL_RWops structure + * \param ptr a pointer to a buffer containing data to write + * \param size the size of an object to write, in bytes + * \param num the number of objects to write + * \returns the number of objects written, which will be less than **num** on + * error; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.10. + * + * \sa SDL_RWclose + * \sa SDL_RWFromConstMem + * \sa SDL_RWFromFile + * \sa SDL_RWFromFP + * \sa SDL_RWFromMem + * \sa SDL_RWread + * \sa SDL_RWseek + */ +extern DECLSPEC size_t SDLCALL SDL_RWwrite(SDL_RWops *context, + const void *ptr, size_t size, + size_t num); + +/** + * Close and free an allocated SDL_RWops structure. + * + * SDL_RWclose() closes and cleans up the SDL_RWops stream. It releases any + * resources used by the stream and frees the SDL_RWops itself with + * SDL_FreeRW(). This returns 0 on success, or -1 if the stream failed to + * flush to its output (e.g. to disk). + * + * Note that if this fails to flush the stream to disk, this function reports + * an error, but the SDL_RWops is still invalid once this function returns. + * + * Prior to SDL 2.0.10, this function was a macro. + * + * \param context SDL_RWops structure to close + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.10. + * + * \sa SDL_RWFromConstMem + * \sa SDL_RWFromFile + * \sa SDL_RWFromFP + * \sa SDL_RWFromMem + * \sa SDL_RWread + * \sa SDL_RWseek + * \sa SDL_RWwrite + */ +extern DECLSPEC int SDLCALL SDL_RWclose(SDL_RWops *context); + +/** + * Load all the data from an SDL data stream. + * + * The data is allocated with a zero byte at the end (null terminated) for + * convenience. This extra byte is not included in the value reported via + * `datasize`. + * + * The data should be freed with SDL_free(). + * + * \param src the SDL_RWops to read all available data from + * \param datasize if not NULL, will store the number of bytes read + * \param freesrc if non-zero, calls SDL_RWclose() on `src` before returning + * \returns the data, or NULL if there was an error. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC void *SDLCALL SDL_LoadFile_RW(SDL_RWops *src, + size_t *datasize, + int freesrc); + +/** + * Load all the data from a file path. + * + * The data is allocated with a zero byte at the end (null terminated) for + * convenience. This extra byte is not included in the value reported via + * `datasize`. + * + * The data should be freed with SDL_free(). + * + * Prior to SDL 2.0.10, this function was a macro wrapping around + * SDL_LoadFile_RW. + * + * \param file the path to read all available data from + * \param datasize if not NULL, will store the number of bytes read + * \returns the data, or NULL if there was an error. + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize); + +/** + * \name Read endian functions + * + * Read an item of the specified endianness and return in native format. + */ +/* @{ */ + +/** + * Use this function to read a byte from an SDL_RWops. + * + * \param src the SDL_RWops to read from + * \returns the read byte on success or 0 on failure; call SDL_GetError() for + * more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_WriteU8 + */ +extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); + +/** + * Use this function to read 16 bits of little-endian data from an SDL_RWops + * and return in native format. + * + * SDL byteswaps the data only if necessary, so the data returned will be in + * the native byte order. + * + * \param src the stream from which to read data + * \returns 16 bits of data in the native byte order of the platform. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ReadBE16 + */ +extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); + +/** + * Use this function to read 16 bits of big-endian data from an SDL_RWops and + * return in native format. + * + * SDL byteswaps the data only if necessary, so the data returned will be in + * the native byte order. + * + * \param src the stream from which to read data + * \returns 16 bits of data in the native byte order of the platform. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ReadLE16 + */ +extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); + +/** + * Use this function to read 32 bits of little-endian data from an SDL_RWops + * and return in native format. + * + * SDL byteswaps the data only if necessary, so the data returned will be in + * the native byte order. + * + * \param src the stream from which to read data + * \returns 32 bits of data in the native byte order of the platform. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ReadBE32 + */ +extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); + +/** + * Use this function to read 32 bits of big-endian data from an SDL_RWops and + * return in native format. + * + * SDL byteswaps the data only if necessary, so the data returned will be in + * the native byte order. + * + * \param src the stream from which to read data + * \returns 32 bits of data in the native byte order of the platform. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ReadLE32 + */ +extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); + +/** + * Use this function to read 64 bits of little-endian data from an SDL_RWops + * and return in native format. + * + * SDL byteswaps the data only if necessary, so the data returned will be in + * the native byte order. + * + * \param src the stream from which to read data + * \returns 64 bits of data in the native byte order of the platform. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ReadBE64 + */ +extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); + +/** + * Use this function to read 64 bits of big-endian data from an SDL_RWops and + * return in native format. + * + * SDL byteswaps the data only if necessary, so the data returned will be in + * the native byte order. + * + * \param src the stream from which to read data + * \returns 64 bits of data in the native byte order of the platform. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ReadLE64 + */ +extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); +/* @} *//* Read endian functions */ + +/** + * \name Write endian functions + * + * Write an item of native format to the specified endianness. + */ +/* @{ */ + +/** + * Use this function to write a byte to an SDL_RWops. + * + * \param dst the SDL_RWops to write to + * \param value the byte value to write + * \returns 1 on success or 0 on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ReadU8 + */ +extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); + +/** + * Use this function to write 16 bits in native format to a SDL_RWops as + * little-endian data. + * + * SDL byteswaps the data only if necessary, so the application always + * specifies native format, and the data written will be in little-endian + * format. + * + * \param dst the stream to which data will be written + * \param value the data to be written, in native format + * \returns 1 on successful write, 0 on error. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_WriteBE16 + */ +extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); + +/** + * Use this function to write 16 bits in native format to a SDL_RWops as + * big-endian data. + * + * SDL byteswaps the data only if necessary, so the application always + * specifies native format, and the data written will be in big-endian format. + * + * \param dst the stream to which data will be written + * \param value the data to be written, in native format + * \returns 1 on successful write, 0 on error. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_WriteLE16 + */ +extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); + +/** + * Use this function to write 32 bits in native format to a SDL_RWops as + * little-endian data. + * + * SDL byteswaps the data only if necessary, so the application always + * specifies native format, and the data written will be in little-endian + * format. + * + * \param dst the stream to which data will be written + * \param value the data to be written, in native format + * \returns 1 on successful write, 0 on error. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_WriteBE32 + */ +extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); + +/** + * Use this function to write 32 bits in native format to a SDL_RWops as + * big-endian data. + * + * SDL byteswaps the data only if necessary, so the application always + * specifies native format, and the data written will be in big-endian format. + * + * \param dst the stream to which data will be written + * \param value the data to be written, in native format + * \returns 1 on successful write, 0 on error. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_WriteLE32 + */ +extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); + +/** + * Use this function to write 64 bits in native format to a SDL_RWops as + * little-endian data. + * + * SDL byteswaps the data only if necessary, so the application always + * specifies native format, and the data written will be in little-endian + * format. + * + * \param dst the stream to which data will be written + * \param value the data to be written, in native format + * \returns 1 on successful write, 0 on error. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_WriteBE64 + */ +extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); + +/** + * Use this function to write 64 bits in native format to a SDL_RWops as + * big-endian data. + * + * SDL byteswaps the data only if necessary, so the application always + * specifies native format, and the data written will be in big-endian format. + * + * \param dst the stream to which data will be written + * \param value the data to be written, in native format + * \returns 1 on successful write, 0 on error. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_WriteLE64 + */ +extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); +/* @} *//* Write endian functions */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_rwops_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_scancode.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_scancode.h new file mode 100644 index 00000000..7fd4234a --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_scancode.h @@ -0,0 +1,438 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_scancode.h + * + * Defines keyboard scancodes. + */ + +#ifndef SDL_scancode_h_ +#define SDL_scancode_h_ + +#include + +/** + * \brief The SDL keyboard scancode representation. + * + * Values of this type are used to represent keyboard keys, among other places + * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the + * SDL_Event structure. + * + * The values in this enumeration are based on the USB usage page standard: + * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf + */ +typedef enum +{ + SDL_SCANCODE_UNKNOWN = 0, + + /** + * \name Usage page 0x07 + * + * These values are from usage page 0x07 (USB keyboard page). + */ + /* @{ */ + + SDL_SCANCODE_A = 4, + SDL_SCANCODE_B = 5, + SDL_SCANCODE_C = 6, + SDL_SCANCODE_D = 7, + SDL_SCANCODE_E = 8, + SDL_SCANCODE_F = 9, + SDL_SCANCODE_G = 10, + SDL_SCANCODE_H = 11, + SDL_SCANCODE_I = 12, + SDL_SCANCODE_J = 13, + SDL_SCANCODE_K = 14, + SDL_SCANCODE_L = 15, + SDL_SCANCODE_M = 16, + SDL_SCANCODE_N = 17, + SDL_SCANCODE_O = 18, + SDL_SCANCODE_P = 19, + SDL_SCANCODE_Q = 20, + SDL_SCANCODE_R = 21, + SDL_SCANCODE_S = 22, + SDL_SCANCODE_T = 23, + SDL_SCANCODE_U = 24, + SDL_SCANCODE_V = 25, + SDL_SCANCODE_W = 26, + SDL_SCANCODE_X = 27, + SDL_SCANCODE_Y = 28, + SDL_SCANCODE_Z = 29, + + SDL_SCANCODE_1 = 30, + SDL_SCANCODE_2 = 31, + SDL_SCANCODE_3 = 32, + SDL_SCANCODE_4 = 33, + SDL_SCANCODE_5 = 34, + SDL_SCANCODE_6 = 35, + SDL_SCANCODE_7 = 36, + SDL_SCANCODE_8 = 37, + SDL_SCANCODE_9 = 38, + SDL_SCANCODE_0 = 39, + + SDL_SCANCODE_RETURN = 40, + SDL_SCANCODE_ESCAPE = 41, + SDL_SCANCODE_BACKSPACE = 42, + SDL_SCANCODE_TAB = 43, + SDL_SCANCODE_SPACE = 44, + + SDL_SCANCODE_MINUS = 45, + SDL_SCANCODE_EQUALS = 46, + SDL_SCANCODE_LEFTBRACKET = 47, + SDL_SCANCODE_RIGHTBRACKET = 48, + SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return + * key on ISO keyboards and at the right end + * of the QWERTY row on ANSI keyboards. + * Produces REVERSE SOLIDUS (backslash) and + * VERTICAL LINE in a US layout, REVERSE + * SOLIDUS and VERTICAL LINE in a UK Mac + * layout, NUMBER SIGN and TILDE in a UK + * Windows layout, DOLLAR SIGN and POUND SIGN + * in a Swiss German layout, NUMBER SIGN and + * APOSTROPHE in a German layout, GRAVE + * ACCENT and POUND SIGN in a French Mac + * layout, and ASTERISK and MICRO SIGN in a + * French Windows layout. + */ + SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code + * instead of 49 for the same key, but all + * OSes I've seen treat the two codes + * identically. So, as an implementor, unless + * your keyboard generates both of those + * codes and your OS treats them differently, + * you should generate SDL_SCANCODE_BACKSLASH + * instead of this code. As a user, you + * should not rely on this code because SDL + * will never generate it with most (all?) + * keyboards. + */ + SDL_SCANCODE_SEMICOLON = 51, + SDL_SCANCODE_APOSTROPHE = 52, + SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI + * and ISO keyboards). Produces GRAVE ACCENT and + * TILDE in a US Windows layout and in US and UK + * Mac layouts on ANSI keyboards, GRAVE ACCENT + * and NOT SIGN in a UK Windows layout, SECTION + * SIGN and PLUS-MINUS SIGN in US and UK Mac + * layouts on ISO keyboards, SECTION SIGN and + * DEGREE SIGN in a Swiss German layout (Mac: + * only on ISO keyboards), CIRCUMFLEX ACCENT and + * DEGREE SIGN in a German layout (Mac: only on + * ISO keyboards), SUPERSCRIPT TWO and TILDE in a + * French Windows layout, COMMERCIAL AT and + * NUMBER SIGN in a French Mac layout on ISO + * keyboards, and LESS-THAN SIGN and GREATER-THAN + * SIGN in a Swiss German, German, or French Mac + * layout on ANSI keyboards. + */ + SDL_SCANCODE_COMMA = 54, + SDL_SCANCODE_PERIOD = 55, + SDL_SCANCODE_SLASH = 56, + + SDL_SCANCODE_CAPSLOCK = 57, + + SDL_SCANCODE_F1 = 58, + SDL_SCANCODE_F2 = 59, + SDL_SCANCODE_F3 = 60, + SDL_SCANCODE_F4 = 61, + SDL_SCANCODE_F5 = 62, + SDL_SCANCODE_F6 = 63, + SDL_SCANCODE_F7 = 64, + SDL_SCANCODE_F8 = 65, + SDL_SCANCODE_F9 = 66, + SDL_SCANCODE_F10 = 67, + SDL_SCANCODE_F11 = 68, + SDL_SCANCODE_F12 = 69, + + SDL_SCANCODE_PRINTSCREEN = 70, + SDL_SCANCODE_SCROLLLOCK = 71, + SDL_SCANCODE_PAUSE = 72, + SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but + does send code 73, not 117) */ + SDL_SCANCODE_HOME = 74, + SDL_SCANCODE_PAGEUP = 75, + SDL_SCANCODE_DELETE = 76, + SDL_SCANCODE_END = 77, + SDL_SCANCODE_PAGEDOWN = 78, + SDL_SCANCODE_RIGHT = 79, + SDL_SCANCODE_LEFT = 80, + SDL_SCANCODE_DOWN = 81, + SDL_SCANCODE_UP = 82, + + SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards + */ + SDL_SCANCODE_KP_DIVIDE = 84, + SDL_SCANCODE_KP_MULTIPLY = 85, + SDL_SCANCODE_KP_MINUS = 86, + SDL_SCANCODE_KP_PLUS = 87, + SDL_SCANCODE_KP_ENTER = 88, + SDL_SCANCODE_KP_1 = 89, + SDL_SCANCODE_KP_2 = 90, + SDL_SCANCODE_KP_3 = 91, + SDL_SCANCODE_KP_4 = 92, + SDL_SCANCODE_KP_5 = 93, + SDL_SCANCODE_KP_6 = 94, + SDL_SCANCODE_KP_7 = 95, + SDL_SCANCODE_KP_8 = 96, + SDL_SCANCODE_KP_9 = 97, + SDL_SCANCODE_KP_0 = 98, + SDL_SCANCODE_KP_PERIOD = 99, + + SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO + * keyboards have over ANSI ones, + * located between left shift and Y. + * Produces GRAVE ACCENT and TILDE in a + * US or UK Mac layout, REVERSE SOLIDUS + * (backslash) and VERTICAL LINE in a + * US or UK Windows layout, and + * LESS-THAN SIGN and GREATER-THAN SIGN + * in a Swiss German, German, or French + * layout. */ + SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ + SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, + * not a physical key - but some Mac keyboards + * do have a power key. */ + SDL_SCANCODE_KP_EQUALS = 103, + SDL_SCANCODE_F13 = 104, + SDL_SCANCODE_F14 = 105, + SDL_SCANCODE_F15 = 106, + SDL_SCANCODE_F16 = 107, + SDL_SCANCODE_F17 = 108, + SDL_SCANCODE_F18 = 109, + SDL_SCANCODE_F19 = 110, + SDL_SCANCODE_F20 = 111, + SDL_SCANCODE_F21 = 112, + SDL_SCANCODE_F22 = 113, + SDL_SCANCODE_F23 = 114, + SDL_SCANCODE_F24 = 115, + SDL_SCANCODE_EXECUTE = 116, + SDL_SCANCODE_HELP = 117, /**< AL Integrated Help Center */ + SDL_SCANCODE_MENU = 118, /**< Menu (show menu) */ + SDL_SCANCODE_SELECT = 119, + SDL_SCANCODE_STOP = 120, /**< AC Stop */ + SDL_SCANCODE_AGAIN = 121, /**< AC Redo/Repeat */ + SDL_SCANCODE_UNDO = 122, /**< AC Undo */ + SDL_SCANCODE_CUT = 123, /**< AC Cut */ + SDL_SCANCODE_COPY = 124, /**< AC Copy */ + SDL_SCANCODE_PASTE = 125, /**< AC Paste */ + SDL_SCANCODE_FIND = 126, /**< AC Find */ + SDL_SCANCODE_MUTE = 127, + SDL_SCANCODE_VOLUMEUP = 128, + SDL_SCANCODE_VOLUMEDOWN = 129, +/* not sure whether there's a reason to enable these */ +/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */ +/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */ +/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */ + SDL_SCANCODE_KP_COMMA = 133, + SDL_SCANCODE_KP_EQUALSAS400 = 134, + + SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see + footnotes in USB doc */ + SDL_SCANCODE_INTERNATIONAL2 = 136, + SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ + SDL_SCANCODE_INTERNATIONAL4 = 138, + SDL_SCANCODE_INTERNATIONAL5 = 139, + SDL_SCANCODE_INTERNATIONAL6 = 140, + SDL_SCANCODE_INTERNATIONAL7 = 141, + SDL_SCANCODE_INTERNATIONAL8 = 142, + SDL_SCANCODE_INTERNATIONAL9 = 143, + SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */ + SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */ + SDL_SCANCODE_LANG3 = 146, /**< Katakana */ + SDL_SCANCODE_LANG4 = 147, /**< Hiragana */ + SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */ + SDL_SCANCODE_LANG6 = 149, /**< reserved */ + SDL_SCANCODE_LANG7 = 150, /**< reserved */ + SDL_SCANCODE_LANG8 = 151, /**< reserved */ + SDL_SCANCODE_LANG9 = 152, /**< reserved */ + + SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */ + SDL_SCANCODE_SYSREQ = 154, + SDL_SCANCODE_CANCEL = 155, /**< AC Cancel */ + SDL_SCANCODE_CLEAR = 156, + SDL_SCANCODE_PRIOR = 157, + SDL_SCANCODE_RETURN2 = 158, + SDL_SCANCODE_SEPARATOR = 159, + SDL_SCANCODE_OUT = 160, + SDL_SCANCODE_OPER = 161, + SDL_SCANCODE_CLEARAGAIN = 162, + SDL_SCANCODE_CRSEL = 163, + SDL_SCANCODE_EXSEL = 164, + + SDL_SCANCODE_KP_00 = 176, + SDL_SCANCODE_KP_000 = 177, + SDL_SCANCODE_THOUSANDSSEPARATOR = 178, + SDL_SCANCODE_DECIMALSEPARATOR = 179, + SDL_SCANCODE_CURRENCYUNIT = 180, + SDL_SCANCODE_CURRENCYSUBUNIT = 181, + SDL_SCANCODE_KP_LEFTPAREN = 182, + SDL_SCANCODE_KP_RIGHTPAREN = 183, + SDL_SCANCODE_KP_LEFTBRACE = 184, + SDL_SCANCODE_KP_RIGHTBRACE = 185, + SDL_SCANCODE_KP_TAB = 186, + SDL_SCANCODE_KP_BACKSPACE = 187, + SDL_SCANCODE_KP_A = 188, + SDL_SCANCODE_KP_B = 189, + SDL_SCANCODE_KP_C = 190, + SDL_SCANCODE_KP_D = 191, + SDL_SCANCODE_KP_E = 192, + SDL_SCANCODE_KP_F = 193, + SDL_SCANCODE_KP_XOR = 194, + SDL_SCANCODE_KP_POWER = 195, + SDL_SCANCODE_KP_PERCENT = 196, + SDL_SCANCODE_KP_LESS = 197, + SDL_SCANCODE_KP_GREATER = 198, + SDL_SCANCODE_KP_AMPERSAND = 199, + SDL_SCANCODE_KP_DBLAMPERSAND = 200, + SDL_SCANCODE_KP_VERTICALBAR = 201, + SDL_SCANCODE_KP_DBLVERTICALBAR = 202, + SDL_SCANCODE_KP_COLON = 203, + SDL_SCANCODE_KP_HASH = 204, + SDL_SCANCODE_KP_SPACE = 205, + SDL_SCANCODE_KP_AT = 206, + SDL_SCANCODE_KP_EXCLAM = 207, + SDL_SCANCODE_KP_MEMSTORE = 208, + SDL_SCANCODE_KP_MEMRECALL = 209, + SDL_SCANCODE_KP_MEMCLEAR = 210, + SDL_SCANCODE_KP_MEMADD = 211, + SDL_SCANCODE_KP_MEMSUBTRACT = 212, + SDL_SCANCODE_KP_MEMMULTIPLY = 213, + SDL_SCANCODE_KP_MEMDIVIDE = 214, + SDL_SCANCODE_KP_PLUSMINUS = 215, + SDL_SCANCODE_KP_CLEAR = 216, + SDL_SCANCODE_KP_CLEARENTRY = 217, + SDL_SCANCODE_KP_BINARY = 218, + SDL_SCANCODE_KP_OCTAL = 219, + SDL_SCANCODE_KP_DECIMAL = 220, + SDL_SCANCODE_KP_HEXADECIMAL = 221, + + SDL_SCANCODE_LCTRL = 224, + SDL_SCANCODE_LSHIFT = 225, + SDL_SCANCODE_LALT = 226, /**< alt, option */ + SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */ + SDL_SCANCODE_RCTRL = 228, + SDL_SCANCODE_RSHIFT = 229, + SDL_SCANCODE_RALT = 230, /**< alt gr, option */ + SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ + + SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered + * by any of the above, but since there's a + * special KMOD_MODE for it I'm adding it here + */ + + /* @} *//* Usage page 0x07 */ + + /** + * \name Usage page 0x0C + * + * These values are mapped from usage page 0x0C (USB consumer page). + * See https://usb.org/sites/default/files/hut1_2.pdf + * + * There are way more keys in the spec than we can represent in the + * current scancode range, so pick the ones that commonly come up in + * real world usage. + */ + /* @{ */ + + SDL_SCANCODE_AUDIONEXT = 258, + SDL_SCANCODE_AUDIOPREV = 259, + SDL_SCANCODE_AUDIOSTOP = 260, + SDL_SCANCODE_AUDIOPLAY = 261, + SDL_SCANCODE_AUDIOMUTE = 262, + SDL_SCANCODE_MEDIASELECT = 263, + SDL_SCANCODE_WWW = 264, /**< AL Internet Browser */ + SDL_SCANCODE_MAIL = 265, + SDL_SCANCODE_CALCULATOR = 266, /**< AL Calculator */ + SDL_SCANCODE_COMPUTER = 267, + SDL_SCANCODE_AC_SEARCH = 268, /**< AC Search */ + SDL_SCANCODE_AC_HOME = 269, /**< AC Home */ + SDL_SCANCODE_AC_BACK = 270, /**< AC Back */ + SDL_SCANCODE_AC_FORWARD = 271, /**< AC Forward */ + SDL_SCANCODE_AC_STOP = 272, /**< AC Stop */ + SDL_SCANCODE_AC_REFRESH = 273, /**< AC Refresh */ + SDL_SCANCODE_AC_BOOKMARKS = 274, /**< AC Bookmarks */ + + /* @} *//* Usage page 0x0C */ + + /** + * \name Walther keys + * + * These are values that Christian Walther added (for mac keyboard?). + */ + /* @{ */ + + SDL_SCANCODE_BRIGHTNESSDOWN = 275, + SDL_SCANCODE_BRIGHTNESSUP = 276, + SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display + switch, video mode switch */ + SDL_SCANCODE_KBDILLUMTOGGLE = 278, + SDL_SCANCODE_KBDILLUMDOWN = 279, + SDL_SCANCODE_KBDILLUMUP = 280, + SDL_SCANCODE_EJECT = 281, + SDL_SCANCODE_SLEEP = 282, /**< SC System Sleep */ + + SDL_SCANCODE_APP1 = 283, + SDL_SCANCODE_APP2 = 284, + + /* @} *//* Walther keys */ + + /** + * \name Usage page 0x0C (additional media keys) + * + * These values are mapped from usage page 0x0C (USB consumer page). + */ + /* @{ */ + + SDL_SCANCODE_AUDIOREWIND = 285, + SDL_SCANCODE_AUDIOFASTFORWARD = 286, + + /* @} *//* Usage page 0x0C (additional media keys) */ + + /** + * \name Mobile keys + * + * These are values that are often used on mobile phones. + */ + /* @{ */ + + SDL_SCANCODE_SOFTLEFT = 287, /**< Usually situated below the display on phones and + used as a multi-function feature key for selecting + a software defined function shown on the bottom left + of the display. */ + SDL_SCANCODE_SOFTRIGHT = 288, /**< Usually situated below the display on phones and + used as a multi-function feature key for selecting + a software defined function shown on the bottom right + of the display. */ + SDL_SCANCODE_CALL = 289, /**< Used for accepting phone calls. */ + SDL_SCANCODE_ENDCALL = 290, /**< Used for rejecting phone calls. */ + + /* @} *//* Mobile keys */ + + /* Add any other keys here. */ + + SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes + for array bounds */ +} SDL_Scancode; + +#endif /* SDL_scancode_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_sensor.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_sensor.h new file mode 100644 index 00000000..85129ba2 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_sensor.h @@ -0,0 +1,322 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_sensor.h + * + * Include file for SDL sensor event handling + * + */ + +#ifndef SDL_sensor_h_ +#define SDL_sensor_h_ + +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \brief SDL_sensor.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_SENSOR flag. This causes SDL to scan the system + * for sensors, and load appropriate drivers. + */ + +struct _SDL_Sensor; +typedef struct _SDL_Sensor SDL_Sensor; + +/** + * This is a unique ID for a sensor for the time it is connected to the system, + * and is never reused for the lifetime of the application. + * + * The ID value starts at 0 and increments from there. The value -1 is an invalid ID. + */ +typedef Sint32 SDL_SensorID; + +/* The different sensors defined by SDL + * + * Additional sensors may be available, using platform dependent semantics. + * + * Hare are the additional Android sensors: + * https://developer.android.com/reference/android/hardware/SensorEvent.html#values + */ +typedef enum +{ + SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */ + SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */ + SDL_SENSOR_ACCEL, /**< Accelerometer */ + SDL_SENSOR_GYRO, /**< Gyroscope */ + SDL_SENSOR_ACCEL_L, /**< Accelerometer for left Joy-Con controller and Wii nunchuk */ + SDL_SENSOR_GYRO_L, /**< Gyroscope for left Joy-Con controller */ + SDL_SENSOR_ACCEL_R, /**< Accelerometer for right Joy-Con controller */ + SDL_SENSOR_GYRO_R /**< Gyroscope for right Joy-Con controller */ +} SDL_SensorType; + +/** + * Accelerometer sensor + * + * The accelerometer returns the current acceleration in SI meters per + * second squared. This measurement includes the force of gravity, so + * a device at rest will have an value of SDL_STANDARD_GRAVITY away + * from the center of the earth, which is a positive Y value. + * + * values[0]: Acceleration on the x axis + * values[1]: Acceleration on the y axis + * values[2]: Acceleration on the z axis + * + * For phones held in portrait mode and game controllers held in front of you, + * the axes are defined as follows: + * -X ... +X : left ... right + * -Y ... +Y : bottom ... top + * -Z ... +Z : farther ... closer + * + * The axis data is not changed when the phone is rotated. + * + * \sa SDL_GetDisplayOrientation() + */ +#define SDL_STANDARD_GRAVITY 9.80665f + +/** + * Gyroscope sensor + * + * The gyroscope returns the current rate of rotation in radians per second. + * The rotation is positive in the counter-clockwise direction. That is, + * an observer looking from a positive location on one of the axes would + * see positive rotation on that axis when it appeared to be rotating + * counter-clockwise. + * + * values[0]: Angular speed around the x axis (pitch) + * values[1]: Angular speed around the y axis (yaw) + * values[2]: Angular speed around the z axis (roll) + * + * For phones held in portrait mode and game controllers held in front of you, + * the axes are defined as follows: + * -X ... +X : left ... right + * -Y ... +Y : bottom ... top + * -Z ... +Z : farther ... closer + * + * The axis data is not changed when the phone or controller is rotated. + * + * \sa SDL_GetDisplayOrientation() + */ + +/* Function prototypes */ + +/** + * Locking for multi-threaded access to the sensor API + * + * If you are using the sensor API or handling events from multiple threads + * you should use these locking functions to protect access to the sensors. + * + * In particular, you are guaranteed that the sensor list won't change, so the + * API functions that take a sensor index will be valid, and sensor events + * will not be delivered. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC void SDLCALL SDL_LockSensors(void); +extern DECLSPEC void SDLCALL SDL_UnlockSensors(void); + +/** + * Count the number of sensors attached to the system right now. + * + * \returns the number of sensors detected. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC int SDLCALL SDL_NumSensors(void); + +/** + * Get the implementation dependent name of a sensor. + * + * \param device_index The sensor to obtain name from + * \returns the sensor name, or NULL if `device_index` is out of range. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC const char *SDLCALL SDL_SensorGetDeviceName(int device_index); + +/** + * Get the type of a sensor. + * + * \param device_index The sensor to get the type from + * \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `device_index` is + * out of range. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetDeviceType(int device_index); + +/** + * Get the platform dependent type of a sensor. + * + * \param device_index The sensor to check + * \returns the sensor platform dependent type, or -1 if `device_index` is out + * of range. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC int SDLCALL SDL_SensorGetDeviceNonPortableType(int device_index); + +/** + * Get the instance ID of a sensor. + * + * \param device_index The sensor to get instance id from + * \returns the sensor instance ID, or -1 if `device_index` is out of range. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetDeviceInstanceID(int device_index); + +/** + * Open a sensor for use. + * + * \param device_index The sensor to open + * \returns an SDL_Sensor sensor object, or NULL if an error occurred. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorOpen(int device_index); + +/** + * Return the SDL_Sensor associated with an instance id. + * + * \param instance_id The sensor from instance id + * \returns an SDL_Sensor object. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC SDL_Sensor *SDLCALL SDL_SensorFromInstanceID(SDL_SensorID instance_id); + +/** + * Get the implementation dependent name of a sensor + * + * \param sensor The SDL_Sensor object + * \returns the sensor name, or NULL if `sensor` is NULL. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC const char *SDLCALL SDL_SensorGetName(SDL_Sensor *sensor); + +/** + * Get the type of a sensor. + * + * \param sensor The SDL_Sensor object to inspect + * \returns the SDL_SensorType type, or `SDL_SENSOR_INVALID` if `sensor` is + * NULL. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC SDL_SensorType SDLCALL SDL_SensorGetType(SDL_Sensor *sensor); + +/** + * Get the platform dependent type of a sensor. + * + * \param sensor The SDL_Sensor object to inspect + * \returns the sensor platform dependent type, or -1 if `sensor` is NULL. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC int SDLCALL SDL_SensorGetNonPortableType(SDL_Sensor *sensor); + +/** + * Get the instance ID of a sensor. + * + * \param sensor The SDL_Sensor object to inspect + * \returns the sensor instance ID, or -1 if `sensor` is NULL. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor); + +/** + * Get the current state of an opened sensor. + * + * The number of values and interpretation of the data is sensor dependent. + * + * \param sensor The SDL_Sensor object to query + * \param data A pointer filled with the current sensor state + * \param num_values The number of values to write to data + * \returns 0 or -1 if an error occurred. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values); + +/** + * Get the current state of an opened sensor with the timestamp of the last + * update. + * + * The number of values and interpretation of the data is sensor dependent. + * + * \param sensor The SDL_Sensor object to query + * \param timestamp A pointer filled with the timestamp in microseconds of the + * current sensor reading if available, or 0 if not + * \param data A pointer filled with the current sensor state + * \param num_values The number of values to write to data + * \returns 0 or -1 if an error occurred. + * + * \since This function is available since SDL 2.26.0. + */ +extern DECLSPEC int SDLCALL SDL_SensorGetDataWithTimestamp(SDL_Sensor *sensor, Uint64 *timestamp, float *data, int num_values); + +/** + * Close a sensor previously opened with SDL_SensorOpen(). + * + * \param sensor The SDL_Sensor object to close + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor *sensor); + +/** + * Update the current state of the open sensors. + * + * This is called automatically by the event loop if sensor events are + * enabled. + * + * This needs to be called from the thread that initialized the sensor + * subsystem. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC void SDLCALL SDL_SensorUpdate(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include + +#endif /* SDL_sensor_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_shape.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_shape.h new file mode 100644 index 00000000..d23a82a6 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_shape.h @@ -0,0 +1,155 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDL_shape_h_ +#define SDL_shape_h_ + +#include +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** \file SDL_shape.h + * + * Header file for the shaped window API. + */ + +#define SDL_NONSHAPEABLE_WINDOW -1 +#define SDL_INVALID_SHAPE_ARGUMENT -2 +#define SDL_WINDOW_LACKS_SHAPE -3 + +/** + * Create a window that can be shaped with the specified position, dimensions, + * and flags. + * + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window. + * \param h The height of the window. + * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with + * any of the following: ::SDL_WINDOW_OPENGL, + * ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN, + * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, + * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set, + * and ::SDL_WINDOW_FULLSCREEN is always unset. + * \return the window created, or NULL if window creation failed. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_DestroyWindow + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); + +/** + * Return whether the given window is a shaped window. + * + * \param window The window to query for being shaped. + * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if + * the window is unshaped or NULL. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateShapedWindow + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window); + +/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ +typedef enum { + /** \brief The default mode, a binarized alpha cutoff of 1. */ + ShapeModeDefault, + /** \brief A binarized alpha cutoff with a given integer value. */ + ShapeModeBinarizeAlpha, + /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */ + ShapeModeReverseBinarizeAlpha, + /** \brief A color key is applied. */ + ShapeModeColorKey +} WindowShapeMode; + +#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha) + +/** \brief A union containing parameters for shaped windows. */ +typedef union { + /** \brief A cutoff alpha value for binarization of the window shape's alpha channel. */ + Uint8 binarizationCutoff; + SDL_Color colorKey; +} SDL_WindowShapeParams; + +/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ +typedef struct SDL_WindowShapeMode { + /** \brief The mode of these window-shape parameters. */ + WindowShapeMode mode; + /** \brief Window-shape parameters. */ + SDL_WindowShapeParams parameters; +} SDL_WindowShapeMode; + +/** + * Set the shape and parameters of a shaped window. + * + * \param window The shaped window whose parameters should be set. + * \param shape A surface encoding the desired shape for the window. + * \param shape_mode The parameters to set for the shaped window. + * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape + * argument, or SDL_NONSHAPEABLE_WINDOW if the SDL_Window given does + * not reference a valid shaped window. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_WindowShapeMode + * \sa SDL_GetShapedWindowMode + */ +extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); + +/** + * Get the shape parameters of a shaped window. + * + * \param window The shaped window whose parameters should be retrieved. + * \param shape_mode An empty shape-mode structure to fill, or NULL to check + * whether the window has a shape. + * \return 0 if the window has a shape and, provided shape_mode was not NULL, + * shape_mode has been filled with the mode data, + * SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped + * window, or SDL_WINDOW_LACKS_SHAPE if the SDL_Window given is a + * shapeable window currently lacking a shape. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_WindowShapeMode + * \sa SDL_SetWindowShape + */ +extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_shape_h_ */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_stdinc.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_stdinc.h new file mode 100644 index 00000000..f4f7fccd --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_stdinc.h @@ -0,0 +1,838 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_stdinc.h + * + * This is a general header that includes C language support. + */ + +#ifndef SDL_stdinc_h_ +#define SDL_stdinc_h_ + +#include + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDIO_H +#include +#endif +#if defined(STDC_HEADERS) +# include +# include +# include +#else +# if defined(HAVE_STDLIB_H) +# include +# elif defined(HAVE_MALLOC_H) +# include +# endif +# if defined(HAVE_STDDEF_H) +# include +# endif +# if defined(HAVE_STDARG_H) +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_WCHAR_H +# include +#endif +#if defined(HAVE_INTTYPES_H) +# include +#elif defined(HAVE_STDINT_H) +# include +#endif +#ifdef HAVE_CTYPE_H +# include +#endif +#ifdef HAVE_MATH_H +# if defined(_MSC_VER) +/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on + Visual Studio. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx + for more information. +*/ +# ifndef _USE_MATH_DEFINES +# define _USE_MATH_DEFINES +# endif +# endif +# include +#endif +#ifdef HAVE_FLOAT_H +# include +#endif +#if defined(HAVE_ALLOCA) && !defined(alloca) +# if defined(HAVE_ALLOCA_H) +# include +# elif defined(__GNUC__) +# define alloca __builtin_alloca +# elif defined(_MSC_VER) +# include +# define alloca _alloca +# elif defined(__WATCOMC__) +# include +# elif defined(__BORLANDC__) +# include +# elif defined(__DMC__) +# include +# elif defined(__AIX__) +#pragma alloca +# elif defined(__MRC__) +void *alloca(unsigned); +# else +char *alloca(); +# endif +#endif + +#ifdef SIZE_MAX +# define SDL_SIZE_MAX SIZE_MAX +#else +# define SDL_SIZE_MAX ((size_t) -1) +#endif + +/** + * Check if the compiler supports a given builtin. + * Supported by virtually all clang versions and recent gcc. Use this + * instead of checking the clang version if possible. + */ +#ifdef __has_builtin +#define _SDL_HAS_BUILTIN(x) __has_builtin(x) +#else +#define _SDL_HAS_BUILTIN(x) 0 +#endif + +/** + * The number of elements in an array. + */ +#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) +#define SDL_TABLESIZE(table) SDL_arraysize(table) + +/** + * Macro useful for building other macros with strings in them + * + * e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n") + */ +#define SDL_STRINGIFY_ARG(arg) #arg + +/** + * \name Cast operators + * + * Use proper C++ casts when compiled as C++ to be compatible with the option + * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above). + */ +/* @{ */ +#ifdef __cplusplus +#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) +#define SDL_static_cast(type, expression) static_cast(expression) +#define SDL_const_cast(type, expression) const_cast(expression) +#else +#define SDL_reinterpret_cast(type, expression) ((type)(expression)) +#define SDL_static_cast(type, expression) ((type)(expression)) +#define SDL_const_cast(type, expression) ((type)(expression)) +#endif +/* @} *//* Cast operators */ + +/* Define a four character code as a Uint32 */ +#define SDL_FOURCC(A, B, C, D) \ + ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) + +/** + * \name Basic data types + */ +/* @{ */ + +#ifdef __CC_ARM +/* ARM's compiler throws warnings if we use an enum: like "SDL_bool x = a < b;" */ +#define SDL_FALSE 0 +#define SDL_TRUE 1 +typedef int SDL_bool; +#else +typedef enum +{ + SDL_FALSE = 0, + SDL_TRUE = 1 +} SDL_bool; +#endif + +/** + * \brief A signed 8-bit integer type. + */ +#define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */ +#define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */ +typedef int8_t Sint8; +/** + * \brief An unsigned 8-bit integer type. + */ +#define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */ +#define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */ +typedef uint8_t Uint8; +/** + * \brief A signed 16-bit integer type. + */ +#define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */ +#define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */ +typedef int16_t Sint16; +/** + * \brief An unsigned 16-bit integer type. + */ +#define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */ +#define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */ +typedef uint16_t Uint16; +/** + * \brief A signed 32-bit integer type. + */ +#define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */ +#define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */ +typedef int32_t Sint32; +/** + * \brief An unsigned 32-bit integer type. + */ +#define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */ +#define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */ +typedef uint32_t Uint32; + +/** + * \brief A signed 64-bit integer type. + */ +#define SDL_MAX_SINT64 ((Sint64)0x7FFFFFFFFFFFFFFFll) /* 9223372036854775807 */ +#define SDL_MIN_SINT64 ((Sint64)(~0x7FFFFFFFFFFFFFFFll)) /* -9223372036854775808 */ +typedef int64_t Sint64; +/** + * \brief An unsigned 64-bit integer type. + */ +#define SDL_MAX_UINT64 ((Uint64)0xFFFFFFFFFFFFFFFFull) /* 18446744073709551615 */ +#define SDL_MIN_UINT64 ((Uint64)(0x0000000000000000ull)) /* 0 */ +typedef uint64_t Uint64; + +/* @} *//* Basic data types */ + +/** + * \name Floating-point constants + */ +/* @{ */ + +#ifdef FLT_EPSILON +#define SDL_FLT_EPSILON FLT_EPSILON +#else +#define SDL_FLT_EPSILON 1.1920928955078125e-07F /* 0x0.000002p0 */ +#endif + +/* @} *//* Floating-point constants */ + +/* Make sure we have macros for printing width-based integers. + * should define these but this is not true all platforms. + * (for example win32) */ +#ifndef SDL_PRIs64 +#ifdef PRIs64 +#define SDL_PRIs64 PRIs64 +#elif defined(__WIN32__) || defined(__GDK__) +#define SDL_PRIs64 "I64d" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIs64 "ld" +#else +#define SDL_PRIs64 "lld" +#endif +#endif +#ifndef SDL_PRIu64 +#ifdef PRIu64 +#define SDL_PRIu64 PRIu64 +#elif defined(__WIN32__) || defined(__GDK__) +#define SDL_PRIu64 "I64u" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIu64 "lu" +#else +#define SDL_PRIu64 "llu" +#endif +#endif +#ifndef SDL_PRIx64 +#ifdef PRIx64 +#define SDL_PRIx64 PRIx64 +#elif defined(__WIN32__) || defined(__GDK__) +#define SDL_PRIx64 "I64x" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIx64 "lx" +#else +#define SDL_PRIx64 "llx" +#endif +#endif +#ifndef SDL_PRIX64 +#ifdef PRIX64 +#define SDL_PRIX64 PRIX64 +#elif defined(__WIN32__) || defined(__GDK__) +#define SDL_PRIX64 "I64X" +#elif defined(__LINUX__) && defined(__LP64__) +#define SDL_PRIX64 "lX" +#else +#define SDL_PRIX64 "llX" +#endif +#endif +#ifndef SDL_PRIs32 +#ifdef PRId32 +#define SDL_PRIs32 PRId32 +#else +#define SDL_PRIs32 "d" +#endif +#endif +#ifndef SDL_PRIu32 +#ifdef PRIu32 +#define SDL_PRIu32 PRIu32 +#else +#define SDL_PRIu32 "u" +#endif +#endif +#ifndef SDL_PRIx32 +#ifdef PRIx32 +#define SDL_PRIx32 PRIx32 +#else +#define SDL_PRIx32 "x" +#endif +#endif +#ifndef SDL_PRIX32 +#ifdef PRIX32 +#define SDL_PRIX32 PRIX32 +#else +#define SDL_PRIX32 "X" +#endif +#endif + +/* Annotations to help code analysis tools */ +#ifdef SDL_DISABLE_ANALYZE_MACROS +#define SDL_IN_BYTECAP(x) +#define SDL_INOUT_Z_CAP(x) +#define SDL_OUT_Z_CAP(x) +#define SDL_OUT_CAP(x) +#define SDL_OUT_BYTECAP(x) +#define SDL_OUT_Z_BYTECAP(x) +#define SDL_PRINTF_FORMAT_STRING +#define SDL_SCANF_FORMAT_STRING +#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) +#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) +#else +#if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ +#include + +#define SDL_IN_BYTECAP(x) _In_bytecount_(x) +#define SDL_INOUT_Z_CAP(x) _Inout_z_cap_(x) +#define SDL_OUT_Z_CAP(x) _Out_z_cap_(x) +#define SDL_OUT_CAP(x) _Out_cap_(x) +#define SDL_OUT_BYTECAP(x) _Out_bytecap_(x) +#define SDL_OUT_Z_BYTECAP(x) _Out_z_bytecap_(x) + +#define SDL_PRINTF_FORMAT_STRING _Printf_format_string_ +#define SDL_SCANF_FORMAT_STRING _Scanf_format_string_impl_ +#else +#define SDL_IN_BYTECAP(x) +#define SDL_INOUT_Z_CAP(x) +#define SDL_OUT_Z_CAP(x) +#define SDL_OUT_CAP(x) +#define SDL_OUT_BYTECAP(x) +#define SDL_OUT_Z_BYTECAP(x) +#define SDL_PRINTF_FORMAT_STRING +#define SDL_SCANF_FORMAT_STRING +#endif +#if defined(__GNUC__) +#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 ))) +#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 ))) +#else +#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) +#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) +#endif +#endif /* SDL_DISABLE_ANALYZE_MACROS */ + +#ifndef SDL_COMPILE_TIME_ASSERT +#if defined(__cplusplus) +#if (__cplusplus >= 201103L) +#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x) +#endif +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) +#define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x) +#endif +#endif /* !SDL_COMPILE_TIME_ASSERT */ + +#ifndef SDL_COMPILE_TIME_ASSERT +/* universal, but may trigger -Wunused-local-typedefs */ +#define SDL_COMPILE_TIME_ASSERT(name, x) \ + typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1] +#endif + +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); +SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); +SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); +SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); +SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); +SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); +SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); +SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ + +/* Check to make sure enums are the size of ints, for structure packing. + For both Watcom C/C++ and Borland C/C++ the compiler option that makes + enums having the size of an int must be enabled. + This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). +*/ + +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +#if !defined(__ANDROID__) && !defined(__VITA__) && !defined(__3DS__) + /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ +typedef enum +{ + DUMMY_ENUM_VALUE +} SDL_DUMMY_ENUM; + +SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); +#endif +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef HAVE_ALLOCA +#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) +#define SDL_stack_free(data) +#else +#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) +#define SDL_stack_free(data) SDL_free(data) +#endif + +extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); +extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); +extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); +extern DECLSPEC void SDLCALL SDL_free(void *mem); + +typedef void *(SDLCALL *SDL_malloc_func)(size_t size); +typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size); +typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size); +typedef void (SDLCALL *SDL_free_func)(void *mem); + +/** + * Get the original set of SDL memory functions + * + * \since This function is available since SDL 2.24.0. + */ +extern DECLSPEC void SDLCALL SDL_GetOriginalMemoryFunctions(SDL_malloc_func *malloc_func, + SDL_calloc_func *calloc_func, + SDL_realloc_func *realloc_func, + SDL_free_func *free_func); + +/** + * Get the current set of SDL memory functions + * + * \since This function is available since SDL 2.0.7. + */ +extern DECLSPEC void SDLCALL SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func, + SDL_calloc_func *calloc_func, + SDL_realloc_func *realloc_func, + SDL_free_func *free_func); + +/** + * Replace SDL's memory allocation functions with a custom set + * + * \since This function is available since SDL 2.0.7. + */ +extern DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_func, + SDL_calloc_func calloc_func, + SDL_realloc_func realloc_func, + SDL_free_func free_func); + +/** + * Get the number of outstanding (unfreed) allocations + * + * \since This function is available since SDL 2.0.7. + */ +extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void); + +extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); +extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); + +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *)); +extern DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *)); + +extern DECLSPEC int SDLCALL SDL_abs(int x); + +/* NOTE: these double-evaluate their arguments, so you should never have side effects in the parameters */ +#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) +#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) +#define SDL_clamp(x, a, b) (((x) < (a)) ? (a) : (((x) > (b)) ? (b) : (x))) + +extern DECLSPEC int SDLCALL SDL_isalpha(int x); +extern DECLSPEC int SDLCALL SDL_isalnum(int x); +extern DECLSPEC int SDLCALL SDL_isblank(int x); +extern DECLSPEC int SDLCALL SDL_iscntrl(int x); +extern DECLSPEC int SDLCALL SDL_isdigit(int x); +extern DECLSPEC int SDLCALL SDL_isxdigit(int x); +extern DECLSPEC int SDLCALL SDL_ispunct(int x); +extern DECLSPEC int SDLCALL SDL_isspace(int x); +extern DECLSPEC int SDLCALL SDL_isupper(int x); +extern DECLSPEC int SDLCALL SDL_islower(int x); +extern DECLSPEC int SDLCALL SDL_isprint(int x); +extern DECLSPEC int SDLCALL SDL_isgraph(int x); +extern DECLSPEC int SDLCALL SDL_toupper(int x); +extern DECLSPEC int SDLCALL SDL_tolower(int x); + +extern DECLSPEC Uint16 SDLCALL SDL_crc16(Uint16 crc, const void *data, size_t len); +extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len); + +extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); + +#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) +#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) +#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x))) + +#define SDL_copyp(dst, src) \ + { SDL_COMPILE_TIME_ASSERT(SDL_copyp, sizeof (*(dst)) == sizeof (*(src))); } \ + SDL_memcpy((dst), (src), sizeof (*(src))) + + +/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ +SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords) +{ +#if defined(__GNUC__) && defined(__i386__) + int u0, u1, u2; + __asm__ __volatile__ ( + "cld \n\t" + "rep ; stosl \n\t" + : "=&D" (u0), "=&a" (u1), "=&c" (u2) + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords)) + : "memory" + ); +#else + size_t _n = (dwords + 3) / 4; + Uint32 *_p = SDL_static_cast(Uint32 *, dst); + Uint32 _val = (val); + if (dwords == 0) { + return; + } + switch (dwords % 4) { + case 0: do { *_p++ = _val; SDL_FALLTHROUGH; + case 3: *_p++ = _val; SDL_FALLTHROUGH; + case 2: *_p++ = _val; SDL_FALLTHROUGH; + case 1: *_p++ = _val; + } while ( --_n ); + } +#endif +} + +extern DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); + +extern DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); +extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); + +extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); +extern DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); +extern DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); +extern DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr); +extern DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle); + +extern DECLSPEC int SDLCALL SDL_wcscmp(const wchar_t *str1, const wchar_t *str2); +extern DECLSPEC int SDLCALL SDL_wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen); +extern DECLSPEC int SDLCALL SDL_wcscasecmp(const wchar_t *str1, const wchar_t *str2); +extern DECLSPEC int SDLCALL SDL_wcsncasecmp(const wchar_t *str1, const wchar_t *str2, size_t len); + +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); +extern DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); +extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes); +extern DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); +extern DECLSPEC char *SDLCALL SDL_strdup(const char *str); +extern DECLSPEC char *SDLCALL SDL_strrev(char *str); +extern DECLSPEC char *SDLCALL SDL_strupr(char *str); +extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); +extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); +extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); +extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); +extern DECLSPEC char *SDLCALL SDL_strcasestr(const char *haystack, const char *needle); +extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr); +extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str); +extern DECLSPEC size_t SDLCALL SDL_utf8strnlen(const char *str, size_t bytes); + +extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); + +extern DECLSPEC int SDLCALL SDL_atoi(const char *str); +extern DECLSPEC double SDLCALL SDL_atof(const char *str); +extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base); +extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base); +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base); +extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base); +extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp); + +extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); +extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); +extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); +extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); + +extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); +extern DECLSPEC int SDLCALL SDL_vsscanf(const char *text, const char *fmt, va_list ap); +extern DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); +extern DECLSPEC int SDLCALL SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, va_list ap); +extern DECLSPEC int SDLCALL SDL_asprintf(char **strp, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2); +extern DECLSPEC int SDLCALL SDL_vasprintf(char **strp, const char *fmt, va_list ap); + +#ifndef HAVE_M_PI +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950288 /**< pi */ +#endif +#endif + +/** + * Use this function to compute arc cosine of `x`. + * + * The definition of `y = acos(x)` is `x = cos(y)`. + * + * Domain: `-1 <= x <= 1` + * + * Range: `0 <= y <= Pi` + * + * \param x floating point value, in radians. + * \returns arc cosine of `x`. + * + * \since This function is available since SDL 2.0.2. + */ +extern DECLSPEC double SDLCALL SDL_acos(double x); +extern DECLSPEC float SDLCALL SDL_acosf(float x); +extern DECLSPEC double SDLCALL SDL_asin(double x); +extern DECLSPEC float SDLCALL SDL_asinf(float x); +extern DECLSPEC double SDLCALL SDL_atan(double x); +extern DECLSPEC float SDLCALL SDL_atanf(float x); +extern DECLSPEC double SDLCALL SDL_atan2(double y, double x); +extern DECLSPEC float SDLCALL SDL_atan2f(float y, float x); +extern DECLSPEC double SDLCALL SDL_ceil(double x); +extern DECLSPEC float SDLCALL SDL_ceilf(float x); +extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); +extern DECLSPEC float SDLCALL SDL_copysignf(float x, float y); +extern DECLSPEC double SDLCALL SDL_cos(double x); +extern DECLSPEC float SDLCALL SDL_cosf(float x); +extern DECLSPEC double SDLCALL SDL_exp(double x); +extern DECLSPEC float SDLCALL SDL_expf(float x); +extern DECLSPEC double SDLCALL SDL_fabs(double x); +extern DECLSPEC float SDLCALL SDL_fabsf(float x); +extern DECLSPEC double SDLCALL SDL_floor(double x); +extern DECLSPEC float SDLCALL SDL_floorf(float x); +extern DECLSPEC double SDLCALL SDL_trunc(double x); +extern DECLSPEC float SDLCALL SDL_truncf(float x); +extern DECLSPEC double SDLCALL SDL_fmod(double x, double y); +extern DECLSPEC float SDLCALL SDL_fmodf(float x, float y); +extern DECLSPEC double SDLCALL SDL_log(double x); +extern DECLSPEC float SDLCALL SDL_logf(float x); +extern DECLSPEC double SDLCALL SDL_log10(double x); +extern DECLSPEC float SDLCALL SDL_log10f(float x); +extern DECLSPEC double SDLCALL SDL_pow(double x, double y); +extern DECLSPEC float SDLCALL SDL_powf(float x, float y); +extern DECLSPEC double SDLCALL SDL_round(double x); +extern DECLSPEC float SDLCALL SDL_roundf(float x); +extern DECLSPEC long SDLCALL SDL_lround(double x); +extern DECLSPEC long SDLCALL SDL_lroundf(float x); +extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); +extern DECLSPEC float SDLCALL SDL_scalbnf(float x, int n); +extern DECLSPEC double SDLCALL SDL_sin(double x); +extern DECLSPEC float SDLCALL SDL_sinf(float x); +extern DECLSPEC double SDLCALL SDL_sqrt(double x); +extern DECLSPEC float SDLCALL SDL_sqrtf(float x); +extern DECLSPEC double SDLCALL SDL_tan(double x); +extern DECLSPEC float SDLCALL SDL_tanf(float x); + +/* The SDL implementation of iconv() returns these error codes */ +#define SDL_ICONV_ERROR (size_t)-1 +#define SDL_ICONV_E2BIG (size_t)-2 +#define SDL_ICONV_EILSEQ (size_t)-3 +#define SDL_ICONV_EINVAL (size_t)-4 + +/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ +typedef struct _SDL_iconv_t *SDL_iconv_t; +extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, + const char *fromcode); +extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); +extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, + size_t * inbytesleft, char **outbuf, + size_t * outbytesleft); + +/** + * This function converts a buffer or string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, + const char *fromcode, + const char *inbuf, + size_t inbytesleft); +#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_wchar_utf8(S) SDL_iconv_string("UTF-8", "WCHAR_T", (char *)S, (SDL_wcslen(S)+1)*sizeof(wchar_t)) + +/* force builds using Clang's static analysis tools to use literal C runtime + here, since there are possibly tests that are ineffective otherwise. */ +#if defined(__clang_analyzer__) && !defined(SDL_DISABLE_ANALYZE_MACROS) + +/* The analyzer knows about strlcpy even when the system doesn't provide it */ +#ifndef HAVE_STRLCPY +size_t strlcpy(char* dst, const char* src, size_t size); +#endif + +/* The analyzer knows about strlcat even when the system doesn't provide it */ +#ifndef HAVE_STRLCAT +size_t strlcat(char* dst, const char* src, size_t size); +#endif + +#ifndef HAVE_WCSLCPY +size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size); +#endif + +#ifndef HAVE_WCSLCAT +size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size); +#endif + +/* Starting LLVM 16, the analyser errors out if these functions do not have + their prototype defined (clang-diagnostic-implicit-function-declaration) */ +#include +#include +#include + +#define SDL_malloc malloc +#define SDL_calloc calloc +#define SDL_realloc realloc +#define SDL_free free +#define SDL_memset memset +#define SDL_memcpy memcpy +#define SDL_memmove memmove +#define SDL_memcmp memcmp +#define SDL_strlcpy strlcpy +#define SDL_strlcat strlcat +#define SDL_strlen strlen +#define SDL_wcslen wcslen +#define SDL_wcslcpy wcslcpy +#define SDL_wcslcat wcslcat +#define SDL_strdup strdup +#define SDL_wcsdup wcsdup +#define SDL_strchr strchr +#define SDL_strrchr strrchr +#define SDL_strstr strstr +#define SDL_wcsstr wcsstr +#define SDL_strtokr strtok_r +#define SDL_strcmp strcmp +#define SDL_wcscmp wcscmp +#define SDL_strncmp strncmp +#define SDL_wcsncmp wcsncmp +#define SDL_strcasecmp strcasecmp +#define SDL_strncasecmp strncasecmp +#define SDL_sscanf sscanf +#define SDL_vsscanf vsscanf +#define SDL_snprintf snprintf +#define SDL_vsnprintf vsnprintf +#endif + +SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_BYTECAP(dwords*4) const void *src, size_t dwords) +{ + return SDL_memcpy(dst, src, dwords * 4); +} + +/** + * If a * b would overflow, return -1. Otherwise store a * b via ret + * and return 0. + * + * \since This function is available since SDL 2.24.0. + */ +SDL_FORCE_INLINE int SDL_size_mul_overflow (size_t a, + size_t b, + size_t *ret) +{ + if (a != 0 && b > SDL_SIZE_MAX / a) { + return -1; + } + *ret = a * b; + return 0; +} + +#if _SDL_HAS_BUILTIN(__builtin_mul_overflow) +/* This needs to be wrapped in an inline rather than being a direct #define, + * because __builtin_mul_overflow() is type-generic, but we want to be + * consistent about interpreting a and b as size_t. */ +SDL_FORCE_INLINE int _SDL_size_mul_overflow_builtin (size_t a, + size_t b, + size_t *ret) +{ + return __builtin_mul_overflow(a, b, ret) == 0 ? 0 : -1; +} +#define SDL_size_mul_overflow(a, b, ret) (_SDL_size_mul_overflow_builtin(a, b, ret)) +#endif + +/** + * If a + b would overflow, return -1. Otherwise store a + b via ret + * and return 0. + * + * \since This function is available since SDL 2.24.0. + */ +SDL_FORCE_INLINE int SDL_size_add_overflow (size_t a, + size_t b, + size_t *ret) +{ + if (b > SDL_SIZE_MAX - a) { + return -1; + } + *ret = a + b; + return 0; +} + +#if _SDL_HAS_BUILTIN(__builtin_add_overflow) +/* This needs to be wrapped in an inline rather than being a direct #define, + * the same as the call to __builtin_mul_overflow() above. */ +SDL_FORCE_INLINE int _SDL_size_add_overflow_builtin (size_t a, + size_t b, + size_t *ret) +{ + return __builtin_add_overflow(a, b, ret) == 0 ? 0 : -1; +} +#define SDL_size_add_overflow(a, b, ret) (_SDL_size_add_overflow_builtin(a, b, ret)) +#endif + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_stdinc_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_surface.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_surface.h new file mode 100644 index 00000000..5af10528 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_surface.h @@ -0,0 +1,997 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_surface.h + * + * Header file for ::SDL_Surface definition and management functions. + */ + +#ifndef SDL_surface_h_ +#define SDL_surface_h_ + +#include +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name Surface flags + * + * These are the currently supported flags for the ::SDL_Surface. + * + * \internal + * Used internally (read-only). + */ +/* @{ */ +#define SDL_SWSURFACE 0 /**< Just here for compatibility */ +#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ +#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ +#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */ +#define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */ +/* @} *//* Surface flags */ + +/** + * Evaluates to true if the surface needs to be locked before access. + */ +#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) + +typedef struct SDL_BlitMap SDL_BlitMap; /* this is an opaque type. */ + +/** + * \brief A collection of pixels used in software blitting. + * + * \note This structure should be treated as read-only, except for \c pixels, + * which, if not NULL, contains the raw pixel data for the surface. + */ +typedef struct SDL_Surface +{ + Uint32 flags; /**< Read-only */ + SDL_PixelFormat *format; /**< Read-only */ + int w, h; /**< Read-only */ + int pitch; /**< Read-only */ + void *pixels; /**< Read-write */ + + /** Application data associated with the surface */ + void *userdata; /**< Read-write */ + + /** information needed for surfaces requiring locks */ + int locked; /**< Read-only */ + + /** list of BlitMap that hold a reference to this surface */ + void *list_blitmap; /**< Private */ + + /** clipping information */ + SDL_Rect clip_rect; /**< Read-only */ + + /** info for fast blit mapping to other surfaces */ + SDL_BlitMap *map; /**< Private */ + + /** Reference count -- used when freeing surface */ + int refcount; /**< Read-mostly */ +} SDL_Surface; + +/** + * \brief The type of function used for surface blitting functions. + */ +typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, + struct SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * \brief The formula used for converting between YUV and RGB + */ +typedef enum +{ + SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */ + SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */ + SDL_YUV_CONVERSION_BT709, /**< BT.709 */ + SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */ +} SDL_YUV_CONVERSION_MODE; + +/** + * Allocate a new RGB surface. + * + * If `depth` is 4 or 8 bits, an empty palette is allocated for the surface. + * If `depth` is greater than 8 bits, the pixel format is set using the + * [RGBA]mask parameters. + * + * The [RGBA]mask parameters are the bitmasks used to extract that color from + * a pixel. For instance, `Rmask` being 0xFF000000 means the red data is + * stored in the most significant byte. Using zeros for the RGB masks sets a + * default value, based on the depth. For example: + * + * ```c++ + * SDL_CreateRGBSurface(0,w,h,32,0,0,0,0); + * ``` + * + * However, using zero for the Amask results in an Amask of 0. + * + * By default surfaces with an alpha mask are set up for blending as with: + * + * ```c++ + * SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND) + * ``` + * + * You can change this by calling SDL_SetSurfaceBlendMode() and selecting a + * different `blendMode`. + * + * \param flags the flags are unused and should be set to 0 + * \param width the width of the surface + * \param height the height of the surface + * \param depth the depth of the surface in bits + * \param Rmask the red mask for the pixels + * \param Gmask the green mask for the pixels + * \param Bmask the blue mask for the pixels + * \param Amask the alpha mask for the pixels + * \returns the new SDL_Surface structure that is created or NULL if it fails; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateRGBSurfaceFrom + * \sa SDL_CreateRGBSurfaceWithFormat + * \sa SDL_FreeSurface + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface + (Uint32 flags, int width, int height, int depth, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); + + +/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */ + +/** + * Allocate a new RGB surface with a specific pixel format. + * + * This function operates mostly like SDL_CreateRGBSurface(), except instead + * of providing pixel color masks, you provide it with a predefined format + * from SDL_PixelFormatEnum. + * + * \param flags the flags are unused and should be set to 0 + * \param width the width of the surface + * \param height the height of the surface + * \param depth the depth of the surface in bits + * \param format the SDL_PixelFormatEnum for the new surface's pixel format. + * \returns the new SDL_Surface structure that is created or NULL if it fails; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_CreateRGBSurface + * \sa SDL_CreateRGBSurfaceFrom + * \sa SDL_FreeSurface + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat + (Uint32 flags, int width, int height, int depth, Uint32 format); + +/** + * Allocate a new RGB surface with existing pixel data. + * + * This function operates mostly like SDL_CreateRGBSurface(), except it does + * not allocate memory for the pixel data, instead the caller provides an + * existing buffer of data for the surface to use. + * + * No copy is made of the pixel data. Pixel data is not managed automatically; + * you must free the surface before you free the pixel data. + * + * \param pixels a pointer to existing pixel data + * \param width the width of the surface + * \param height the height of the surface + * \param depth the depth of the surface in bits + * \param pitch the pitch of the surface in bytes + * \param Rmask the red mask for the pixels + * \param Gmask the green mask for the pixels + * \param Bmask the blue mask for the pixels + * \param Amask the alpha mask for the pixels + * \returns the new SDL_Surface structure that is created or NULL if it fails; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateRGBSurface + * \sa SDL_CreateRGBSurfaceWithFormat + * \sa SDL_FreeSurface + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, + int width, + int height, + int depth, + int pitch, + Uint32 Rmask, + Uint32 Gmask, + Uint32 Bmask, + Uint32 Amask); + +/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */ + +/** + * Allocate a new RGB surface with with a specific pixel format and existing + * pixel data. + * + * This function operates mostly like SDL_CreateRGBSurfaceFrom(), except + * instead of providing pixel color masks, you provide it with a predefined + * format from SDL_PixelFormatEnum. + * + * No copy is made of the pixel data. Pixel data is not managed automatically; + * you must free the surface before you free the pixel data. + * + * \param pixels a pointer to existing pixel data + * \param width the width of the surface + * \param height the height of the surface + * \param depth the depth of the surface in bits + * \param pitch the pitch of the surface in bytes + * \param format the SDL_PixelFormatEnum for the new surface's pixel format. + * \returns the new SDL_Surface structure that is created or NULL if it fails; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_CreateRGBSurfaceFrom + * \sa SDL_CreateRGBSurfaceWithFormat + * \sa SDL_FreeSurface + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom + (void *pixels, int width, int height, int depth, int pitch, Uint32 format); + +/** + * Free an RGB surface. + * + * It is safe to pass NULL to this function. + * + * \param surface the SDL_Surface to free. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateRGBSurface + * \sa SDL_CreateRGBSurfaceFrom + * \sa SDL_LoadBMP + * \sa SDL_LoadBMP_RW + */ +extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); + +/** + * Set the palette used by a surface. + * + * A single palette can be shared with many surfaces. + * + * \param surface the SDL_Surface structure to update + * \param palette the SDL_Palette structure to use + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, + SDL_Palette * palette); + +/** + * Set up a surface for directly accessing the pixels. + * + * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write to + * and read from `surface->pixels`, using the pixel format stored in + * `surface->format`. Once you are done accessing the surface, you should use + * SDL_UnlockSurface() to release it. + * + * Not all surfaces require locking. If `SDL_MUSTLOCK(surface)` evaluates to + * 0, then you can read and write to the surface at any time, and the pixel + * format of the surface will not change. + * + * \param surface the SDL_Surface structure to be locked + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_MUSTLOCK + * \sa SDL_UnlockSurface + */ +extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); + +/** + * Release a surface after directly accessing the pixels. + * + * \param surface the SDL_Surface structure to be unlocked + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LockSurface + */ +extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); + +/** + * Load a BMP image from a seekable SDL data stream. + * + * The new surface should be freed with SDL_FreeSurface(). Not doing so will + * result in a memory leak. + * + * src is an open SDL_RWops buffer, typically loaded with SDL_RWFromFile. + * Alternitavely, you might also use the macro SDL_LoadBMP to load a bitmap + * from a file, convert it to an SDL_Surface and then close the file. + * + * \param src the data stream for the surface + * \param freesrc non-zero to close the stream after being read + * \returns a pointer to a new SDL_Surface structure or NULL if there was an + * error; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FreeSurface + * \sa SDL_RWFromFile + * \sa SDL_LoadBMP + * \sa SDL_SaveBMP_RW + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, + int freesrc); + +/** + * Load a surface from a file. + * + * Convenience macro. + */ +#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Save a surface to a seekable SDL data stream in BMP format. + * + * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the + * BMP directly. Other RGB formats with 8-bit or higher get converted to a + * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit + * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are + * not supported. + * + * \param surface the SDL_Surface structure containing the image to be saved + * \param dst a data stream to save to + * \param freedst non-zero to close the stream after being written + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_LoadBMP_RW + * \sa SDL_SaveBMP + */ +extern DECLSPEC int SDLCALL SDL_SaveBMP_RW + (SDL_Surface * surface, SDL_RWops * dst, int freedst); + +/** + * Save a surface to a file. + * + * Convenience macro. + */ +#define SDL_SaveBMP(surface, file) \ + SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) + +/** + * Set the RLE acceleration hint for a surface. + * + * If RLE is enabled, color key and alpha blending blits are much faster, but + * the surface must be locked before directly accessing the pixels. + * + * \param surface the SDL_Surface structure to optimize + * \param flag 0 to disable, non-zero to enable RLE acceleration + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_BlitSurface + * \sa SDL_LockSurface + * \sa SDL_UnlockSurface + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, + int flag); + +/** + * Returns whether the surface is RLE enabled + * + * It is safe to pass a NULL `surface` here; it will return SDL_FALSE. + * + * \param surface the SDL_Surface structure to query + * \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.14. + * + * \sa SDL_SetSurfaceRLE + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSurfaceRLE(SDL_Surface * surface); + +/** + * Set the color key (transparent pixel) in a surface. + * + * The color key defines a pixel value that will be treated as transparent in + * a blit. For example, one can use this to specify that cyan pixels should be + * considered transparent, and therefore not rendered. + * + * It is a pixel of the format used by the surface, as generated by + * SDL_MapRGB(). + * + * RLE acceleration can substantially speed up blitting of images with large + * horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details. + * + * \param surface the SDL_Surface structure to update + * \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key + * \param key the transparent pixel + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_BlitSurface + * \sa SDL_GetColorKey + */ +extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, + int flag, Uint32 key); + +/** + * Returns whether the surface has a color key + * + * It is safe to pass a NULL `surface` here; it will return SDL_FALSE. + * + * \param surface the SDL_Surface structure to query + * \return SDL_TRUE if the surface has a color key, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.9. + * + * \sa SDL_SetColorKey + * \sa SDL_GetColorKey + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface); + +/** + * Get the color key (transparent pixel) for a surface. + * + * The color key is a pixel of the format used by the surface, as generated by + * SDL_MapRGB(). + * + * If the surface doesn't have color key enabled this function returns -1. + * + * \param surface the SDL_Surface structure to query + * \param key a pointer filled in with the transparent pixel + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_BlitSurface + * \sa SDL_SetColorKey + */ +extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, + Uint32 * key); + +/** + * Set an additional color value multiplied into blit operations. + * + * When this surface is blitted, during the blit operation each source color + * channel is modulated by the appropriate color value according to the + * following formula: + * + * `srcC = srcC * (color / 255)` + * + * \param surface the SDL_Surface structure to update + * \param r the red color value multiplied into blit operations + * \param g the green color value multiplied into blit operations + * \param b the blue color value multiplied into blit operations + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetSurfaceColorMod + * \sa SDL_SetSurfaceAlphaMod + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * Get the additional color value multiplied into blit operations. + * + * \param surface the SDL_Surface structure to query + * \param r a pointer filled in with the current red color value + * \param g a pointer filled in with the current green color value + * \param b a pointer filled in with the current blue color value + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetSurfaceAlphaMod + * \sa SDL_SetSurfaceColorMod + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * Set an additional alpha value used in blit operations. + * + * When this surface is blitted, during the blit operation the source alpha + * value is modulated by this alpha value according to the following formula: + * + * `srcA = srcA * (alpha / 255)` + * + * \param surface the SDL_Surface structure to update + * \param alpha the alpha value multiplied into blit operations + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetSurfaceAlphaMod + * \sa SDL_SetSurfaceColorMod + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, + Uint8 alpha); + +/** + * Get the additional alpha value used in blit operations. + * + * \param surface the SDL_Surface structure to query + * \param alpha a pointer filled in with the current alpha value + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetSurfaceColorMod + * \sa SDL_SetSurfaceAlphaMod + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, + Uint8 * alpha); + +/** + * Set the blend mode used for blit operations. + * + * To copy a surface to another surface (or texture) without blending with the + * existing data, the blendmode of the SOURCE surface should be set to + * `SDL_BLENDMODE_NONE`. + * + * \param surface the SDL_Surface structure to update + * \param blendMode the SDL_BlendMode to use for blit blending + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetSurfaceBlendMode + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, + SDL_BlendMode blendMode); + +/** + * Get the blend mode used for blit operations. + * + * \param surface the SDL_Surface structure to query + * \param blendMode a pointer filled in with the current SDL_BlendMode + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetSurfaceBlendMode + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, + SDL_BlendMode *blendMode); + +/** + * Set the clipping rectangle for a surface. + * + * When `surface` is the destination of a blit, only the area within the clip + * rectangle is drawn into. + * + * Note that blits are automatically clipped to the edges of the source and + * destination surfaces. + * + * \param surface the SDL_Surface structure to be clipped + * \param rect the SDL_Rect structure representing the clipping rectangle, or + * NULL to disable clipping + * \returns SDL_TRUE if the rectangle intersects the surface, otherwise + * SDL_FALSE and blits will be completely clipped. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_BlitSurface + * \sa SDL_GetClipRect + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, + const SDL_Rect * rect); + +/** + * Get the clipping rectangle for a surface. + * + * When `surface` is the destination of a blit, only the area within the clip + * rectangle is drawn into. + * + * \param surface the SDL_Surface structure representing the surface to be + * clipped + * \param rect an SDL_Rect structure filled in with the clipping rectangle for + * the surface + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_BlitSurface + * \sa SDL_SetClipRect + */ +extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface, + SDL_Rect * rect); + +/* + * Creates a new surface identical to the existing surface. + * + * The returned surface should be freed with SDL_FreeSurface(). + * + * \param surface the surface to duplicate. + * \returns a copy of the surface, or NULL on failure; call SDL_GetError() for + * more information. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface); + +/** + * Copy an existing surface to a new surface of the specified format. + * + * This function is used to optimize images for faster *repeat* blitting. This + * is accomplished by converting the original and storing the result as a new + * surface. The new, optimized surface can then be used as the source for + * future blits, making them faster. + * + * \param src the existing SDL_Surface structure to convert + * \param fmt the SDL_PixelFormat structure that the new surface is optimized + * for + * \param flags the flags are unused and should be set to 0; this is a + * leftover from SDL 1.2's API + * \returns the new SDL_Surface structure that is created or NULL if it fails; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AllocFormat + * \sa SDL_ConvertSurfaceFormat + * \sa SDL_CreateRGBSurface + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface + (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags); + +/** + * Copy an existing surface to a new surface of the specified format enum. + * + * This function operates just like SDL_ConvertSurface(), but accepts an + * SDL_PixelFormatEnum value instead of an SDL_PixelFormat structure. As such, + * it might be easier to call but it doesn't have access to palette + * information for the destination surface, in case that would be important. + * + * \param src the existing SDL_Surface structure to convert + * \param pixel_format the SDL_PixelFormatEnum that the new surface is + * optimized for + * \param flags the flags are unused and should be set to 0; this is a + * leftover from SDL 1.2's API + * \returns the new SDL_Surface structure that is created or NULL if it fails; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AllocFormat + * \sa SDL_ConvertSurface + * \sa SDL_CreateRGBSurface + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat + (SDL_Surface * src, Uint32 pixel_format, Uint32 flags); + +/** + * Copy a block of pixels of one format to another format. + * + * \param width the width of the block to copy, in pixels + * \param height the height of the block to copy, in pixels + * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format + * \param src a pointer to the source pixels + * \param src_pitch the pitch of the source pixels, in bytes + * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format + * \param dst a pointer to be filled in with new pixel data + * \param dst_pitch the pitch of the destination pixels, in bytes + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, + Uint32 src_format, + const void * src, int src_pitch, + Uint32 dst_format, + void * dst, int dst_pitch); + +/** + * Premultiply the alpha on a block of pixels. + * + * This is safe to use with src == dst, but not for other overlapping areas. + * + * This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888. + * + * \param width the width of the block to convert, in pixels + * \param height the height of the block to convert, in pixels + * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format + * \param src a pointer to the source pixels + * \param src_pitch the pitch of the source pixels, in bytes + * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format + * \param dst a pointer to be filled in with premultiplied pixel data + * \param dst_pitch the pitch of the destination pixels, in bytes + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, + Uint32 src_format, + const void * src, int src_pitch, + Uint32 dst_format, + void * dst, int dst_pitch); + +/** + * Perform a fast fill of a rectangle with a specific color. + * + * `color` should be a pixel of the format used by the surface, and can be + * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an + * alpha component then the destination is simply filled with that alpha + * information, no blending takes place. + * + * If there is a clip rectangle set on the destination (set via + * SDL_SetClipRect()), then this function will fill based on the intersection + * of the clip rectangle and `rect`. + * + * \param dst the SDL_Surface structure that is the drawing target + * \param rect the SDL_Rect structure representing the rectangle to fill, or + * NULL to fill the entire surface + * \param color the color to fill with + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FillRects + */ +extern DECLSPEC int SDLCALL SDL_FillRect + (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color); + +/** + * Perform a fast fill of a set of rectangles with a specific color. + * + * `color` should be a pixel of the format used by the surface, and can be + * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an + * alpha component then the destination is simply filled with that alpha + * information, no blending takes place. + * + * If there is a clip rectangle set on the destination (set via + * SDL_SetClipRect()), then this function will fill based on the intersection + * of the clip rectangle and `rect`. + * + * \param dst the SDL_Surface structure that is the drawing target + * \param rects an array of SDL_Rects representing the rectangles to fill. + * \param count the number of rectangles in the array + * \param color the color to fill with + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_FillRect + */ +extern DECLSPEC int SDLCALL SDL_FillRects + (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color); + +/* !!! FIXME: merge this documentation with the wiki */ +/** + * Performs a fast blit from the source surface to the destination surface. + * + * This assumes that the source and destination rectangles are + * the same size. If either \c srcrect or \c dstrect are NULL, the entire + * surface (\c src or \c dst) is copied. The final blit rectangles are saved + * in \c srcrect and \c dstrect after all clipping is performed. + * + * \returns 0 if the blit is successful, otherwise it returns -1. + * + * The blit function should not be called on a locked surface. + * + * The blit semantics for surfaces with and without blending and colorkey + * are defined as follows: + * \verbatim + RGBA->RGB: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) + SDL_SRCCOLORKEY ignored. + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source color key, ignoring alpha in the + comparison. + + RGB->RGBA: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source per-surface alpha) + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB, set destination alpha to source per-surface alpha value. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source color key. + + RGBA->RGBA: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) + SDL_SRCCOLORKEY ignored. + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy all of RGBA to the destination. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source color key, ignoring alpha in the + comparison. + + RGB->RGB: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source per-surface alpha) + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source color key. + \endverbatim + * + * You should call SDL_BlitSurface() unless you know exactly how SDL + * blitting works internally and how to use the other blit functions. + */ +#define SDL_BlitSurface SDL_UpperBlit + +/** + * Perform a fast blit from the source surface to the destination surface. + * + * SDL_UpperBlit() has been replaced by SDL_BlitSurface(), which is merely a + * macro for this function with a less confusing name. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_BlitSurface + */ +extern DECLSPEC int SDLCALL SDL_UpperBlit + (SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * Perform low-level surface blitting only. + * + * This is a semi-private blit function and it performs low-level surface + * blitting, assuming the input rectangles have already been clipped. + * + * Unless you know what you're doing, you should be using SDL_BlitSurface() + * instead. + * + * \param src the SDL_Surface structure to be copied from + * \param srcrect the SDL_Rect structure representing the rectangle to be + * copied, or NULL to copy the entire surface + * \param dst the SDL_Surface structure that is the blit target + * \param dstrect the SDL_Rect structure representing the rectangle that is + * copied into + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_BlitSurface + */ +extern DECLSPEC int SDLCALL SDL_LowerBlit + (SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + + +/** + * Perform a fast, low quality, stretch blit between two surfaces of the same + * format. + * + * Please use SDL_BlitScaled() instead. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, + const SDL_Rect * srcrect, + SDL_Surface * dst, + const SDL_Rect * dstrect); + +/** + * Perform bilinear scaling between two surfaces of the same format, 32BPP. + * + * \since This function is available since SDL 2.0.16. + */ +extern DECLSPEC int SDLCALL SDL_SoftStretchLinear(SDL_Surface * src, + const SDL_Rect * srcrect, + SDL_Surface * dst, + const SDL_Rect * dstrect); + + +#define SDL_BlitScaled SDL_UpperBlitScaled + +/** + * Perform a scaled surface copy to a destination surface. + * + * SDL_UpperBlitScaled() has been replaced by SDL_BlitScaled(), which is + * merely a macro for this function with a less confusing name. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_BlitScaled + */ +extern DECLSPEC int SDLCALL SDL_UpperBlitScaled + (SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * Perform low-level surface scaled blitting only. + * + * This is a semi-private function and it performs low-level surface blitting, + * assuming the input rectangles have already been clipped. + * + * \param src the SDL_Surface structure to be copied from + * \param srcrect the SDL_Rect structure representing the rectangle to be + * copied + * \param dst the SDL_Surface structure that is the blit target + * \param dstrect the SDL_Rect structure representing the rectangle that is + * copied into + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_BlitScaled + */ +extern DECLSPEC int SDLCALL SDL_LowerBlitScaled + (SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * Set the YUV conversion mode + * + * \since This function is available since SDL 2.0.8. + */ +extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); + +/** + * Get the YUV conversion mode + * + * \since This function is available since SDL 2.0.8. + */ +extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void); + +/** + * Get the YUV conversion mode, returning the correct mode for the resolution + * when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC + * + * \since This function is available since SDL 2.0.8. + */ +extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_surface_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_system.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_system.h new file mode 100644 index 00000000..1a443baa --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_system.h @@ -0,0 +1,623 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_system.h + * + * Include file for platform specific SDL API functions + */ + +#ifndef SDL_system_h_ +#define SDL_system_h_ + +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* Platform specific functions for Windows */ +#if defined(__WIN32__) || defined(__GDK__) + +typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam); + +/** + * Set a callback for every Windows message, run before TranslateMessage(). + * + * \param callback The SDL_WindowsMessageHook function to call. + * \param userdata a pointer to pass to every iteration of `callback` + * + * \since This function is available since SDL 2.0.4. + */ +extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata); + +#endif /* defined(__WIN32__) || defined(__GDK__) */ + +#if defined(__WIN32__) || defined(__WINGDK__) + +/** + * Get the D3D9 adapter index that matches the specified display index. + * + * The returned adapter index can be passed to `IDirect3D9::CreateDevice` and + * controls on which monitor a full screen application will appear. + * + * \param displayIndex the display index for which to get the D3D9 adapter + * index + * \returns the D3D9 adapter index on success or a negative error code on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.1. + */ +extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); + +typedef struct IDirect3DDevice9 IDirect3DDevice9; + +/** + * Get the D3D9 device associated with a renderer. + * + * Once you are done using the device, you should release it to avoid a + * resource leak. + * + * \param renderer the renderer from which to get the associated D3D device + * \returns the D3D9 device associated with given renderer or NULL if it is + * not a D3D9 renderer; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.1. + */ +extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); + +typedef struct ID3D11Device ID3D11Device; + +/** + * Get the D3D11 device associated with a renderer. + * + * Once you are done using the device, you should release it to avoid a + * resource leak. + * + * \param renderer the renderer from which to get the associated D3D11 device + * \returns the D3D11 device associated with given renderer or NULL if it is + * not a D3D11 renderer; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.16. + */ +extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer); + +#endif /* defined(__WIN32__) || defined(__WINGDK__) */ + +#if defined(__WIN32__) || defined(__GDK__) + +typedef struct ID3D12Device ID3D12Device; + +/** + * Get the D3D12 device associated with a renderer. + * + * Once you are done using the device, you should release it to avoid a + * resource leak. + * + * \param renderer the renderer from which to get the associated D3D12 device + * \returns the D3D12 device associated with given renderer or NULL if it is + * not a D3D12 renderer; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.24.0. + */ +extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* renderer); + +#endif /* defined(__WIN32__) || defined(__GDK__) */ + +#if defined(__WIN32__) || defined(__WINGDK__) + +/** + * Get the DXGI Adapter and Output indices for the specified display index. + * + * The DXGI Adapter and Output indices can be passed to `EnumAdapters` and + * `EnumOutputs` respectively to get the objects required to create a DX10 or + * DX11 device and swap chain. + * + * Before SDL 2.0.4 this function did not return a value. Since SDL 2.0.4 it + * returns an SDL_bool. + * + * \param displayIndex the display index for which to get both indices + * \param adapterIndex a pointer to be filled in with the adapter index + * \param outputIndex a pointer to be filled in with the output index + * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 2.0.2. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); + +#endif /* defined(__WIN32__) || defined(__WINGDK__) */ + +/* Platform specific functions for Linux */ +#ifdef __LINUX__ + +/** + * Sets the UNIX nice value for a thread. + * + * This uses setpriority() if possible, and RealtimeKit if available. + * + * \param threadID the Unix thread ID to change priority of. + * \param priority The new, Unix-specific, priority value. + * \returns 0 on success, or -1 on error. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority); + +/** + * Sets the priority (not nice level) and scheduling policy for a thread. + * + * This uses setpriority() if possible, and RealtimeKit if available. + * + * \param threadID The Unix thread ID to change priority of. + * \param sdlPriority The new SDL_ThreadPriority value. + * \param schedPolicy The new scheduling policy (SCHED_FIFO, SCHED_RR, + * SCHED_OTHER, etc...) + * \returns 0 on success, or -1 on error. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); + +#endif /* __LINUX__ */ + +/* Platform specific functions for iOS */ +#ifdef __IPHONEOS__ + +#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam) + +/** + * Use this function to set the animation callback on Apple iOS. + * + * The function prototype for `callback` is: + * + * ```c + * void callback(void* callbackParam); + * ``` + * + * Where its parameter, `callbackParam`, is what was passed as `callbackParam` + * to SDL_iPhoneSetAnimationCallback(). + * + * This function is only available on Apple iOS. + * + * For more information see: + * https://github.com/libsdl-org/SDL/blob/main/docs/README-ios.md + * + * This functions is also accessible using the macro + * SDL_iOSSetAnimationCallback() since SDL 2.0.4. + * + * \param window the window for which the animation callback should be set + * \param interval the number of frames after which **callback** will be + * called + * \param callback the function to call for every frame. + * \param callbackParam a pointer that is passed to `callback`. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_iPhoneSetEventPump + */ +extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam); + +#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled) + +/** + * Use this function to enable or disable the SDL event pump on Apple iOS. + * + * This function is only available on Apple iOS. + * + * This functions is also accessible using the macro SDL_iOSSetEventPump() + * since SDL 2.0.4. + * + * \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_iPhoneSetAnimationCallback + */ +extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); + +#endif /* __IPHONEOS__ */ + + +/* Platform specific functions for Android */ +#ifdef __ANDROID__ + +/** + * Get the Android Java Native Interface Environment of the current thread. + * + * This is the JNIEnv one needs to access the Java virtual machine from native + * code, and is needed for many Android APIs to be usable from C. + * + * The prototype of the function in SDL's code actually declare a void* return + * type, even if the implementation returns a pointer to a JNIEnv. The + * rationale being that the SDL headers can avoid including jni.h. + * + * \returns a pointer to Java native interface object (JNIEnv) to which the + * current thread is attached, or 0 on error. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AndroidGetActivity + */ +extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); + +/** + * Retrieve the Java instance of the Android activity class. + * + * The prototype of the function in SDL's code actually declares a void* + * return type, even if the implementation returns a jobject. The rationale + * being that the SDL headers can avoid including jni.h. + * + * The jobject returned by the function is a local reference and must be + * released by the caller. See the PushLocalFrame() and PopLocalFrame() or + * DeleteLocalRef() functions of the Java native interface: + * + * https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html + * + * \returns the jobject representing the instance of the Activity class of the + * Android application, or NULL on error. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AndroidGetJNIEnv + */ +extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); + +/** + * Query Android API level of the current device. + * + * - API level 31: Android 12 + * - API level 30: Android 11 + * - API level 29: Android 10 + * - API level 28: Android 9 + * - API level 27: Android 8.1 + * - API level 26: Android 8.0 + * - API level 25: Android 7.1 + * - API level 24: Android 7.0 + * - API level 23: Android 6.0 + * - API level 22: Android 5.1 + * - API level 21: Android 5.0 + * - API level 20: Android 4.4W + * - API level 19: Android 4.4 + * - API level 18: Android 4.3 + * - API level 17: Android 4.2 + * - API level 16: Android 4.1 + * - API level 15: Android 4.0.3 + * - API level 14: Android 4.0 + * - API level 13: Android 3.2 + * - API level 12: Android 3.1 + * - API level 11: Android 3.0 + * - API level 10: Android 2.3.3 + * + * \returns the Android API level. + * + * \since This function is available since SDL 2.0.12. + */ +extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void); + +/** + * Query if the application is running on Android TV. + * + * \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.8. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void); + +/** + * Query if the application is running on a Chromebook. + * + * \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void); + +/** + * Query if the application is running on a Samsung DeX docking station. + * + * \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void); + +/** + * Trigger the Android system back button behavior. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void); + +/** + See the official Android developer guide for more information: + http://developer.android.com/guide/topics/data/data-storage.html +*/ +#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 +#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 + +/** + * Get the path used for internal storage for this application. + * + * This path is unique to your application and cannot be written to by other + * applications. + * + * Your internal storage path is typically: + * `/data/data/your.app.package/files`. + * + * \returns the path used for internal storage or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AndroidGetExternalStorageState + */ +extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void); + +/** + * Get the current state of external storage. + * + * The current state of external storage, a bitmask of these values: + * `SDL_ANDROID_EXTERNAL_STORAGE_READ`, `SDL_ANDROID_EXTERNAL_STORAGE_WRITE`. + * + * If external storage is currently unavailable, this will return 0. + * + * \returns the current state of external storage on success or 0 on failure; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AndroidGetExternalStoragePath + */ +extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void); + +/** + * Get the path used for external storage for this application. + * + * This path is unique to your application, but is public and can be written + * to by other applications. + * + * Your external storage path is typically: + * `/storage/sdcard0/Android/data/your.app.package/files`. + * + * \returns the path used for external storage for this application on success + * or NULL on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AndroidGetExternalStorageState + */ +extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); + +/** + * Request permissions at runtime. + * + * This blocks the calling thread until the permission is granted or denied. + * + * \param permission The permission to request. + * \returns SDL_TRUE if the permission was granted, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.14. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission); + +/** + * Shows an Android toast notification. + * + * Toasts are a sort of lightweight notification that are unique to Android. + * + * https://developer.android.com/guide/topics/ui/notifiers/toasts + * + * Shows toast in UI thread. + * + * For the `gravity` parameter, choose a value from here, or -1 if you don't + * have a preference: + * + * https://developer.android.com/reference/android/view/Gravity + * + * \param message text message to be shown + * \param duration 0=short, 1=long + * \param gravity where the notification should appear on the screen. + * \param xoffset set this parameter only when gravity >=0 + * \param yoffset set this parameter only when gravity >=0 + * \returns 0 if success, -1 if any error occurs. + * + * \since This function is available since SDL 2.0.16. + */ +extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset); + +/** + * Send a user command to SDLActivity. + * + * Override "boolean onUnhandledMessage(Message msg)" to handle the message. + * + * \param command user command that must be greater or equal to 0x8000 + * \param param user parameter + * + * \since This function is available since SDL 2.0.22. + */ +extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param); + +#endif /* __ANDROID__ */ + +/* Platform specific functions for WinRT */ +#ifdef __WINRT__ + +/** + * \brief WinRT / Windows Phone path types + */ +typedef enum +{ + /** \brief The installed app's root directory. + Files here are likely to be read-only. */ + SDL_WINRT_PATH_INSTALLED_LOCATION, + + /** \brief The app's local data store. Files may be written here */ + SDL_WINRT_PATH_LOCAL_FOLDER, + + /** \brief The app's roaming data store. Unsupported on Windows Phone. + Files written here may be copied to other machines via a network + connection. + */ + SDL_WINRT_PATH_ROAMING_FOLDER, + + /** \brief The app's temporary data store. Unsupported on Windows Phone. + Files written here may be deleted at any time. */ + SDL_WINRT_PATH_TEMP_FOLDER +} SDL_WinRT_Path; + + +/** + * \brief WinRT Device Family + */ +typedef enum +{ + /** \brief Unknown family */ + SDL_WINRT_DEVICEFAMILY_UNKNOWN, + + /** \brief Desktop family*/ + SDL_WINRT_DEVICEFAMILY_DESKTOP, + + /** \brief Mobile family (for example smartphone) */ + SDL_WINRT_DEVICEFAMILY_MOBILE, + + /** \brief XBox family */ + SDL_WINRT_DEVICEFAMILY_XBOX, +} SDL_WinRT_DeviceFamily; + + +/** + * Retrieve a WinRT defined path on the local file system. + * + * Not all paths are available on all versions of Windows. This is especially + * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path + * for more information on which path types are supported where. + * + * Documentation on most app-specific path types on WinRT can be found on + * MSDN, at the URL: + * + * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx + * + * \param pathType the type of path to retrieve, one of SDL_WinRT_Path + * \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if + * the path is not available for any reason; call SDL_GetError() for + * more information. + * + * \since This function is available since SDL 2.0.3. + * + * \sa SDL_WinRTGetFSPathUTF8 + */ +extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType); + +/** + * Retrieve a WinRT defined path on the local file system. + * + * Not all paths are available on all versions of Windows. This is especially + * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path + * for more information on which path types are supported where. + * + * Documentation on most app-specific path types on WinRT can be found on + * MSDN, at the URL: + * + * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx + * + * \param pathType the type of path to retrieve, one of SDL_WinRT_Path + * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if + * the path is not available for any reason; call SDL_GetError() for + * more information. + * + * \since This function is available since SDL 2.0.3. + * + * \sa SDL_WinRTGetFSPathUNICODE + */ +extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType); + +/** + * Detects the device family of WinRT platform at runtime. + * + * \returns a value from the SDL_WinRT_DeviceFamily enum. + * + * \since This function is available since SDL 2.0.8. + */ +extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily(); + +#endif /* __WINRT__ */ + +/** + * Query if the current device is a tablet. + * + * If SDL can't determine this, it will return SDL_FALSE. + * + * \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.9. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void); + +/* Functions used by iOS application delegates to notify SDL about state changes */ +extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void); +extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void); +#ifdef __IPHONEOS__ +extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void); +#endif + +/* Functions used only by GDK */ +#if defined(__GDK__) +typedef struct XTaskQueueObject * XTaskQueueHandle; + +/** + * Gets a reference to the global async task queue handle for GDK, + * initializing if needed. + * + * Once you are done with the task queue, you should call + * XTaskQueueCloseHandle to reduce the reference count to avoid a resource + * leak. + * + * \param outTaskQueue a pointer to be filled in with task queue handle. + * \returns 0 if success, -1 if any error occurs. + * + * \since This function is available since SDL 2.24.0. + */ +extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue); + +#endif + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_system_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_syswm.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_syswm.h new file mode 100644 index 00000000..bdc38d31 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_syswm.h @@ -0,0 +1,386 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_syswm.h + * + * Include file for SDL custom system window manager hooks. + */ + +#ifndef SDL_syswm_h_ +#define SDL_syswm_h_ + +#include +#include +#include +#include + +/** + * \brief SDL_syswm.h + * + * Your application has access to a special type of event ::SDL_SYSWMEVENT, + * which contains window-manager specific information and arrives whenever + * an unhandled window event occurs. This event is ignored by default, but + * you can enable it with SDL_EventState(). + */ +struct SDL_SysWMinfo; + +#if !defined(SDL_PROTOTYPES_ONLY) + +#if defined(SDL_VIDEO_DRIVER_WINDOWS) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifndef NOMINMAX /* don't define min() and max(). */ +#define NOMINMAX +#endif +#include +#endif + +#if defined(SDL_VIDEO_DRIVER_WINRT) +#include +#endif + +/* This is the structure for custom window manager events */ +#if defined(SDL_VIDEO_DRIVER_X11) +#if defined(__APPLE__) && defined(__MACH__) +/* conflicts with Quickdraw.h */ +#define Cursor X11Cursor +#endif + +#include +#include + +#if defined(__APPLE__) && defined(__MACH__) +/* matches the re-define above */ +#undef Cursor +#endif + +#endif /* defined(SDL_VIDEO_DRIVER_X11) */ + +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) +#include +#endif + +#if defined(SDL_VIDEO_DRIVER_COCOA) +#ifdef __OBJC__ +@class NSWindow; +#else +typedef struct _NSWindow NSWindow; +#endif +#endif + +#if defined(SDL_VIDEO_DRIVER_UIKIT) +#ifdef __OBJC__ +#include +#else +typedef struct _UIWindow UIWindow; +typedef struct _UIViewController UIViewController; +#endif +typedef Uint32 GLuint; +#endif + +#if defined(SDL_VIDEO_VULKAN) || defined(SDL_VIDEO_METAL) +#define SDL_METALVIEW_TAG 255 +#endif + +#if defined(SDL_VIDEO_DRIVER_ANDROID) +typedef struct ANativeWindow ANativeWindow; +typedef void *EGLSurface; +#endif + +#if defined(SDL_VIDEO_DRIVER_VIVANTE) +#include +#endif + +#if defined(SDL_VIDEO_DRIVER_OS2) +#define INCL_WIN +#include +#endif +#endif /* SDL_PROTOTYPES_ONLY */ + +#if defined(SDL_VIDEO_DRIVER_KMSDRM) +struct gbm_device; +#endif + + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(SDL_PROTOTYPES_ONLY) +/** + * These are the various supported windowing subsystems + */ +typedef enum +{ + SDL_SYSWM_UNKNOWN, + SDL_SYSWM_WINDOWS, + SDL_SYSWM_X11, + SDL_SYSWM_DIRECTFB, + SDL_SYSWM_COCOA, + SDL_SYSWM_UIKIT, + SDL_SYSWM_WAYLAND, + SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */ + SDL_SYSWM_WINRT, + SDL_SYSWM_ANDROID, + SDL_SYSWM_VIVANTE, + SDL_SYSWM_OS2, + SDL_SYSWM_HAIKU, + SDL_SYSWM_KMSDRM, + SDL_SYSWM_RISCOS +} SDL_SYSWM_TYPE; + +/** + * The custom event structure. + */ +struct SDL_SysWMmsg +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { +#if defined(SDL_VIDEO_DRIVER_WINDOWS) + struct { + HWND hwnd; /**< The window for the message */ + UINT msg; /**< The type of message */ + WPARAM wParam; /**< WORD message parameter */ + LPARAM lParam; /**< LONG message parameter */ + } win; +#endif +#if defined(SDL_VIDEO_DRIVER_X11) + struct { + XEvent event; + } x11; +#endif +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) + struct { + DFBEvent event; + } dfb; +#endif +#if defined(SDL_VIDEO_DRIVER_COCOA) + struct + { + /* Latest version of Xcode clang complains about empty structs in C v. C++: + error: empty struct has size 0 in C, size 1 in C++ + */ + int dummy; + /* No Cocoa window events yet */ + } cocoa; +#endif +#if defined(SDL_VIDEO_DRIVER_UIKIT) + struct + { + int dummy; + /* No UIKit window events yet */ + } uikit; +#endif +#if defined(SDL_VIDEO_DRIVER_VIVANTE) + struct + { + int dummy; + /* No Vivante window events yet */ + } vivante; +#endif +#if defined(SDL_VIDEO_DRIVER_OS2) + struct + { + BOOL fFrame; /**< TRUE if hwnd is a frame window */ + HWND hwnd; /**< The window receiving the message */ + ULONG msg; /**< The message identifier */ + MPARAM mp1; /**< The first first message parameter */ + MPARAM mp2; /**< The second first message parameter */ + } os2; +#endif + /* Can't have an empty union */ + int dummy; + } msg; +}; + +/** + * The custom window manager information structure. + * + * When this structure is returned, it holds information about which + * low level system it is using, and will be one of SDL_SYSWM_TYPE. + */ +struct SDL_SysWMinfo +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { +#if defined(SDL_VIDEO_DRIVER_WINDOWS) + struct + { + HWND window; /**< The window handle */ + HDC hdc; /**< The window device context */ + HINSTANCE hinstance; /**< The instance handle */ + } win; +#endif +#if defined(SDL_VIDEO_DRIVER_WINRT) + struct + { + IInspectable * window; /**< The WinRT CoreWindow */ + } winrt; +#endif +#if defined(SDL_VIDEO_DRIVER_X11) + struct + { + Display *display; /**< The X11 display */ + Window window; /**< The X11 window */ + } x11; +#endif +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) + struct + { + IDirectFB *dfb; /**< The directfb main interface */ + IDirectFBWindow *window; /**< The directfb window handle */ + IDirectFBSurface *surface; /**< The directfb client surface */ + } dfb; +#endif +#if defined(SDL_VIDEO_DRIVER_COCOA) + struct + { +#if defined(__OBJC__) && defined(__has_feature) + #if __has_feature(objc_arc) + NSWindow __unsafe_unretained *window; /**< The Cocoa window */ + #else + NSWindow *window; /**< The Cocoa window */ + #endif +#else + NSWindow *window; /**< The Cocoa window */ +#endif + } cocoa; +#endif +#if defined(SDL_VIDEO_DRIVER_UIKIT) + struct + { +#if defined(__OBJC__) && defined(__has_feature) + #if __has_feature(objc_arc) + UIWindow __unsafe_unretained *window; /**< The UIKit window */ + #else + UIWindow *window; /**< The UIKit window */ + #endif +#else + UIWindow *window; /**< The UIKit window */ +#endif + GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */ + GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */ + GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */ + } uikit; +#endif +#if defined(SDL_VIDEO_DRIVER_WAYLAND) + struct + { + struct wl_display *display; /**< Wayland display */ + struct wl_surface *surface; /**< Wayland surface */ + void *shell_surface; /**< DEPRECATED Wayland shell_surface (window manager handle) */ + struct wl_egl_window *egl_window; /**< Wayland EGL window (native window) */ + struct xdg_surface *xdg_surface; /**< Wayland xdg surface (window manager handle) */ + struct xdg_toplevel *xdg_toplevel; /**< Wayland xdg toplevel role */ + struct xdg_popup *xdg_popup; /**< Wayland xdg popup role */ + struct xdg_positioner *xdg_positioner; /**< Wayland xdg positioner, for popup */ + } wl; +#endif +#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */ + struct + { + void *connection; /**< Mir display server connection */ + void *surface; /**< Mir surface */ + } mir; +#endif + +#if defined(SDL_VIDEO_DRIVER_ANDROID) + struct + { + ANativeWindow *window; + EGLSurface surface; + } android; +#endif + +#if defined(SDL_VIDEO_DRIVER_OS2) + struct + { + HWND hwnd; /**< The window handle */ + HWND hwndFrame; /**< The frame window handle */ + } os2; +#endif + +#if defined(SDL_VIDEO_DRIVER_VIVANTE) + struct + { + EGLNativeDisplayType display; + EGLNativeWindowType window; + } vivante; +#endif + +#if defined(SDL_VIDEO_DRIVER_KMSDRM) + struct + { + int dev_index; /**< Device index (ex: the X in /dev/dri/cardX) */ + int drm_fd; /**< DRM FD (unavailable on Vulkan windows) */ + struct gbm_device *gbm_dev; /**< GBM device (unavailable on Vulkan windows) */ + } kmsdrm; +#endif + + /* Make sure this union is always 64 bytes (8 64-bit pointers). */ + /* Be careful not to overflow this if you add a new target! */ + Uint8 dummy[64]; + } info; +}; + +#endif /* SDL_PROTOTYPES_ONLY */ + +typedef struct SDL_SysWMinfo SDL_SysWMinfo; + + +/** + * Get driver-specific information about a window. + * + * You must include SDL_syswm.h for the declaration of SDL_SysWMinfo. + * + * The caller must initialize the `info` structure's version by using + * `SDL_VERSION(&info.version)`, and then this function will fill in the rest + * of the structure with information about the given window. + * + * \param window the window about which information is being requested + * \param info an SDL_SysWMinfo structure filled in with window information + * \returns SDL_TRUE if the function is implemented and the `version` member + * of the `info` struct is valid, or SDL_FALSE if the information + * could not be retrieved; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, + SDL_SysWMinfo * info); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_syswm_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_thread.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_thread.h new file mode 100644 index 00000000..fad1afbb --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_thread.h @@ -0,0 +1,464 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDL_thread_h_ +#define SDL_thread_h_ + +/** + * \file SDL_thread.h + * + * Header for the SDL thread management routines. + */ + +#include +#include + +/* Thread synchronization primitives */ +#include +#include + +#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__) +#include /* _beginthreadex() and _endthreadex() */ +#endif +#if defined(__OS2__) /* for _beginthread() and _endthread() */ +#ifndef __EMX__ +#include +#else +#include +#endif +#endif + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* The SDL thread structure, defined in SDL_thread.c */ +struct SDL_Thread; +typedef struct SDL_Thread SDL_Thread; + +/* The SDL thread ID */ +typedef unsigned long SDL_threadID; + +/* Thread local storage ID, 0 is the invalid ID */ +typedef unsigned int SDL_TLSID; + +/** + * The SDL thread priority. + * + * SDL will make system changes as necessary in order to apply the thread priority. + * Code which attempts to control thread state related to priority should be aware + * that calling SDL_SetThreadPriority may alter such state. + * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior. + * + * \note On many systems you require special privileges to set high or time critical priority. + */ +typedef enum { + SDL_THREAD_PRIORITY_LOW, + SDL_THREAD_PRIORITY_NORMAL, + SDL_THREAD_PRIORITY_HIGH, + SDL_THREAD_PRIORITY_TIME_CRITICAL +} SDL_ThreadPriority; + +/** + * The function passed to SDL_CreateThread(). + * + * \param data what was passed as `data` to SDL_CreateThread() + * \returns a value that can be reported through SDL_WaitThread(). + */ +typedef int (SDLCALL * SDL_ThreadFunction) (void *data); + + +#if (defined(__WIN32__) || defined(__GDK__)) && !defined(__WINRT__) +/** + * \file SDL_thread.h + * + * We compile SDL into a DLL. This means, that it's the DLL which + * creates a new thread for the calling process with the SDL_CreateThread() + * API. There is a problem with this, that only the RTL of the SDL2.DLL will + * be initialized for those threads, and not the RTL of the calling + * application! + * + * To solve this, we make a little hack here. + * + * We'll always use the caller's _beginthread() and _endthread() APIs to + * start a new thread. This way, if it's the SDL2.DLL which uses this API, + * then the RTL of SDL2.DLL will be used to create the new thread, and if it's + * the application, then the RTL of the application will be used. + * + * So, in short: + * Always use the _beginthread() and _endthread() of the calling runtime + * library! + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD + +typedef uintptr_t (__cdecl * pfnSDL_CurrentBeginThread) + (void *, unsigned, unsigned (__stdcall *func)(void *), + void * /*arg*/, unsigned, unsigned * /* threadID */); +typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); + +#ifndef SDL_beginthread +#define SDL_beginthread _beginthreadex +#endif +#ifndef SDL_endthread +#define SDL_endthread _endthreadex +#endif + +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); + +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, + const char *name, const size_t stacksize, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); + + +#if defined(SDL_CreateThread) && SDL_DYNAMIC_API +#undef SDL_CreateThread +#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#undef SDL_CreateThreadWithStackSize +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#else +#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#endif + +#elif defined(__OS2__) +/* + * just like the windows case above: We compile SDL2 + * into a dll with Watcom's runtime statically linked. + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD + +typedef int (*pfnSDL_CurrentBeginThread)(void (*func)(void *), void *, unsigned, void * /*arg*/); +typedef void (*pfnSDL_CurrentEndThread)(void); + +#ifndef SDL_beginthread +#define SDL_beginthread _beginthread +#endif +#ifndef SDL_endthread +#define SDL_endthread _endthread +#endif + +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); + +#if defined(SDL_CreateThread) && SDL_DYNAMIC_API +#undef SDL_CreateThread +#define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#undef SDL_CreateThreadWithStackSize +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#else +#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread) +#endif + +#else + +/** + * Create a new thread with a default stack size. + * + * This is equivalent to calling: + * + * ```c + * SDL_CreateThreadWithStackSize(fn, name, 0, data); + * ``` + * + * \param fn the SDL_ThreadFunction function to call in the new thread + * \param name the name of the thread + * \param data a pointer that is passed to `fn` + * \returns an opaque pointer to the new thread object on success, NULL if the + * new thread could not be created; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateThreadWithStackSize + * \sa SDL_WaitThread + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data); + +/** + * Create a new thread with a specific stack size. + * + * SDL makes an attempt to report `name` to the system, so that debuggers can + * display it. Not all platforms support this. + * + * Thread naming is a little complicated: Most systems have very small limits + * for the string length (Haiku has 32 bytes, Linux currently has 16, Visual + * C++ 6.0 has _nine_!), and possibly other arbitrary rules. You'll have to + * see what happens with your system's debugger. The name should be UTF-8 (but + * using the naming limits of C identifiers is a better bet). There are no + * requirements for thread naming conventions, so long as the string is + * null-terminated UTF-8, but these guidelines are helpful in choosing a name: + * + * https://stackoverflow.com/questions/149932/naming-conventions-for-threads + * + * If a system imposes requirements, SDL will try to munge the string for it + * (truncate, etc), but the original string contents will be available from + * SDL_GetThreadName(). + * + * The size (in bytes) of the new stack can be specified. Zero means "use the + * system default" which might be wildly different between platforms. x86 + * Linux generally defaults to eight megabytes, an embedded device might be a + * few kilobytes instead. You generally need to specify a stack that is a + * multiple of the system's page size (in many cases, this is 4 kilobytes, but + * check your system documentation). + * + * In SDL 2.1, stack size will be folded into the original SDL_CreateThread + * function, but for backwards compatibility, this is currently a separate + * function. + * + * \param fn the SDL_ThreadFunction function to call in the new thread + * \param name the name of the thread + * \param stacksize the size, in bytes, to allocate for the new thread stack. + * \param data a pointer that is passed to `fn` + * \returns an opaque pointer to the new thread object on success, NULL if the + * new thread could not be created; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.9. + * + * \sa SDL_WaitThread + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data); + +#endif + +/** + * Get the thread name as it was specified in SDL_CreateThread(). + * + * This is internal memory, not to be freed by the caller, and remains valid + * until the specified thread is cleaned up by SDL_WaitThread(). + * + * \param thread the thread to query + * \returns a pointer to a UTF-8 string that names the specified thread, or + * NULL if it doesn't have a name. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateThread + */ +extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread); + +/** + * Get the thread identifier for the current thread. + * + * This thread identifier is as reported by the underlying operating system. + * If SDL is running on a platform that does not support threads the return + * value will always be zero. + * + * This function also returns a valid thread ID when called from the main + * thread. + * + * \returns the ID of the current thread. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetThreadID + */ +extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void); + +/** + * Get the thread identifier for the specified thread. + * + * This thread identifier is as reported by the underlying operating system. + * If SDL is running on a platform that does not support threads the return + * value will always be zero. + * + * \param thread the thread to query + * \returns the ID of the specified thread, or the ID of the current thread if + * `thread` is NULL. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ThreadID + */ +extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); + +/** + * Set the priority for the current thread. + * + * Note that some platforms will not let you alter the priority (or at least, + * promote the thread to a higher priority) at all, and some require you to be + * an administrator account. Be prepared for this to fail. + * + * \param priority the SDL_ThreadPriority to set + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); + +/** + * Wait for a thread to finish. + * + * Threads that haven't been detached will remain (as a "zombie") until this + * function cleans them up. Not doing so is a resource leak. + * + * Once a thread has been cleaned up through this function, the SDL_Thread + * that references it becomes invalid and should not be referenced again. As + * such, only one thread may call SDL_WaitThread() on another. + * + * The return code for the thread function is placed in the area pointed to by + * `status`, if `status` is not NULL. + * + * You may not wait on a thread that has been used in a call to + * SDL_DetachThread(). Use either that function or this one, but not both, or + * behavior is undefined. + * + * It is safe to pass a NULL thread to this function; it is a no-op. + * + * Note that the thread pointer is freed by this function and is not valid + * afterward. + * + * \param thread the SDL_Thread pointer that was returned from the + * SDL_CreateThread() call that started this thread + * \param status pointer to an integer that will receive the value returned + * from the thread function by its 'return', or NULL to not + * receive such value back. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateThread + * \sa SDL_DetachThread + */ +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); + +/** + * Let a thread clean up on exit without intervention. + * + * A thread may be "detached" to signify that it should not remain until + * another thread has called SDL_WaitThread() on it. Detaching a thread is + * useful for long-running threads that nothing needs to synchronize with or + * further manage. When a detached thread is done, it simply goes away. + * + * There is no way to recover the return code of a detached thread. If you + * need this, don't detach the thread and instead use SDL_WaitThread(). + * + * Once a thread is detached, you should usually assume the SDL_Thread isn't + * safe to reference again, as it will become invalid immediately upon the + * detached thread's exit, instead of remaining until someone has called + * SDL_WaitThread() to finally clean it up. As such, don't detach the same + * thread more than once. + * + * If a thread has already exited when passed to SDL_DetachThread(), it will + * stop waiting for a call to SDL_WaitThread() and clean up immediately. It is + * not safe to detach a thread that might be used with SDL_WaitThread(). + * + * You may not call SDL_WaitThread() on a thread that has been detached. Use + * either that function or this one, but not both, or behavior is undefined. + * + * It is safe to pass NULL to this function; it is a no-op. + * + * \param thread the SDL_Thread pointer that was returned from the + * SDL_CreateThread() call that started this thread + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_CreateThread + * \sa SDL_WaitThread + */ +extern DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread); + +/** + * Create a piece of thread-local storage. + * + * This creates an identifier that is globally visible to all threads but + * refers to data that is thread-specific. + * + * \returns the newly created thread local storage identifier or 0 on error. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_TLSGet + * \sa SDL_TLSSet + */ +extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); + +/** + * Get the current thread's value associated with a thread local storage ID. + * + * \param id the thread local storage ID + * \returns the value associated with the ID for the current thread or NULL if + * no value has been set; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_TLSCreate + * \sa SDL_TLSSet + */ +extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); + +/** + * Set the current thread's value associated with a thread local storage ID. + * + * The function prototype for `destructor` is: + * + * ```c + * void destructor(void *value) + * ``` + * + * where its parameter `value` is what was passed as `value` to SDL_TLSSet(). + * + * \param id the thread local storage ID + * \param value the value to associate with the ID for the current thread + * \param destructor a function called when the thread exits, to free the + * value + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_TLSCreate + * \sa SDL_TLSGet + */ +extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (SDLCALL *destructor)(void*)); + +/** + * Cleanup all TLS data for this thread. + * + * \since This function is available since SDL 2.0.16. + */ +extern DECLSPEC void SDLCALL SDL_TLSCleanup(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_thread_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_timer.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_timer.h new file mode 100644 index 00000000..02ef910a --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_timer.h @@ -0,0 +1,222 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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 SDL_timer_h_ +#define SDL_timer_h_ + +/** + * \file SDL_timer.h + * + * Header for the SDL time management routines. + */ + +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Get the number of milliseconds since SDL library initialization. + * + * This value wraps if the program runs for more than ~49 days. + * + * This function is not recommended as of SDL 2.0.18; use SDL_GetTicks64() + * instead, where the value doesn't wrap every ~49 days. There are places in + * SDL where we provide a 32-bit timestamp that can not change without + * breaking binary compatibility, though, so this function isn't officially + * deprecated. + * + * \returns an unsigned 32-bit value representing the number of milliseconds + * since the SDL library initialized. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_TICKS_PASSED + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); + +/** + * Get the number of milliseconds since SDL library initialization. + * + * Note that you should not use the SDL_TICKS_PASSED macro with values + * returned by this function, as that macro does clever math to compensate for + * the 32-bit overflow every ~49 days that SDL_GetTicks() suffers from. 64-bit + * values from this function can be safely compared directly. + * + * For example, if you want to wait 100 ms, you could do this: + * + * ```c + * const Uint64 timeout = SDL_GetTicks64() + 100; + * while (SDL_GetTicks64() < timeout) { + * // ... do work until timeout has elapsed + * } + * ``` + * + * \returns an unsigned 64-bit value representing the number of milliseconds + * since the SDL library initialized. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void); + +/** + * Compare 32-bit SDL ticks values, and return true if `A` has passed `B`. + * + * This should be used with results from SDL_GetTicks(), as this macro + * attempts to deal with the 32-bit counter wrapping back to zero every ~49 + * days, but should _not_ be used with SDL_GetTicks64(), which does not have + * that problem. + * + * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could + * do this: + * + * ```c + * const Uint32 timeout = SDL_GetTicks() + 100; + * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { + * // ... do work until timeout has elapsed + * } + * ``` + * + * Note that this does not handle tick differences greater + * than 2^31 so take care when using the above kind of code + * with large timeout delays (tens of days). + */ +#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) + +/** + * Get the current value of the high resolution counter. + * + * This function is typically used for profiling. + * + * The counter values are only meaningful relative to each other. Differences + * between values can be converted to times by using + * SDL_GetPerformanceFrequency(). + * + * \returns the current counter value. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetPerformanceFrequency + */ +extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); + +/** + * Get the count per second of the high resolution counter. + * + * \returns a platform-specific count per second. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetPerformanceCounter + */ +extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); + +/** + * Wait a specified number of milliseconds before returning. + * + * This function waits a specified number of milliseconds before returning. It + * waits at least the specified time, but possibly longer due to OS + * scheduling. + * + * \param ms the number of milliseconds to delay + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); + +/** + * Function prototype for the timer callback function. + * + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. + */ +typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); + +/** + * Definition of the timer ID type. + */ +typedef int SDL_TimerID; + +/** + * Call a callback function at a future time. + * + * If you use this function, you must pass `SDL_INIT_TIMER` to SDL_Init(). + * + * The callback function is passed the current timer interval and the user + * supplied parameter from the SDL_AddTimer() call and should return the next + * timer interval. If the value returned from the callback is 0, the timer is + * canceled. + * + * The callback is run on a separate thread. + * + * Timers take into account the amount of time it took to execute the + * callback. For example, if the callback took 250 ms to execute and returned + * 1000 (ms), the timer would only wait another 750 ms before its next + * iteration. + * + * Timing may be inexact due to OS scheduling. Be sure to note the current + * time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your + * callback needs to adjust for variances. + * + * \param interval the timer delay, in milliseconds, passed to `callback` + * \param callback the SDL_TimerCallback function to call when the specified + * `interval` elapses + * \param param a pointer that is passed to `callback` + * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RemoveTimer + */ +extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, + SDL_TimerCallback callback, + void *param); + +/** + * Remove a timer created with SDL_AddTimer(). + * + * \param id the ID of the timer to remove + * \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't + * found. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_AddTimer + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_timer_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_touch.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_touch.h new file mode 100644 index 00000000..06490050 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_touch.h @@ -0,0 +1,150 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_touch.h + * + * Include file for SDL touch event handling. + */ + +#ifndef SDL_touch_h_ +#define SDL_touch_h_ + +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef Sint64 SDL_TouchID; +typedef Sint64 SDL_FingerID; + +typedef enum +{ + SDL_TOUCH_DEVICE_INVALID = -1, + SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */ + SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */ + SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */ +} SDL_TouchDeviceType; + +typedef struct SDL_Finger +{ + SDL_FingerID id; + float x; + float y; + float pressure; +} SDL_Finger; + +/* Used as the device ID for mouse events simulated with touch input */ +#define SDL_TOUCH_MOUSEID ((Uint32)-1) + +/* Used as the SDL_TouchID for touch events simulated with mouse input */ +#define SDL_MOUSE_TOUCHID ((Sint64)-1) + + +/** + * Get the number of registered touch devices. + * + * On some platforms SDL first sees the touch device if it was actually used. + * Therefore SDL_GetNumTouchDevices() may return 0 although devices are + * available. After using all devices at least once the number will be + * correct. + * + * This was fixed for Android in SDL 2.0.1. + * + * \returns the number of registered touch devices. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetTouchDevice + */ +extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); + +/** + * Get the touch ID with the given index. + * + * \param index the touch device index + * \returns the touch ID with the given index on success or 0 if the index is + * invalid; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetNumTouchDevices + */ +extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); + +/** + * Get the touch device name as reported from the driver or NULL if the index + * is invalid. + * + * \since This function is available since SDL 2.0.22. + */ +extern DECLSPEC const char* SDLCALL SDL_GetTouchName(int index); + +/** + * Get the type of the given touch device. + * + * \since This function is available since SDL 2.0.10. + */ +extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); + +/** + * Get the number of active fingers for a given touch device. + * + * \param touchID the ID of a touch device + * \returns the number of active fingers for a given touch device on success + * or 0 on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetTouchFinger + */ +extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); + +/** + * Get the finger object for specified touch device ID and finger index. + * + * The returned resource is owned by SDL and should not be deallocated. + * + * \param touchID the ID of the requested touch device + * \param index the index of the requested finger + * \returns a pointer to the SDL_Finger object or NULL if no object at the + * given ID and index could be found. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_RecordGesture + */ +extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_touch_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_types.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_types.h new file mode 100644 index 00000000..e9f77a1c --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_types.h @@ -0,0 +1,29 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_types.h + * + * \deprecated + */ + +/* DEPRECATED */ +#include diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_version.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_version.h new file mode 100644 index 00000000..d12e59e6 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_version.h @@ -0,0 +1,204 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_version.h + * + * This header defines the current SDL version. + */ + +#ifndef SDL_version_h_ +#define SDL_version_h_ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Information about the version of SDL in use. + * + * Represents the library's version as three levels: major revision + * (increments with massive changes, additions, and enhancements), + * minor revision (increments with backwards-compatible changes to the + * major revision), and patchlevel (increments with fixes to the minor + * revision). + * + * \sa SDL_VERSION + * \sa SDL_GetVersion + */ +typedef struct SDL_version +{ + Uint8 major; /**< major version */ + Uint8 minor; /**< minor version */ + Uint8 patch; /**< update version */ +} SDL_version; + +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +#define SDL_MAJOR_VERSION 2 +#define SDL_MINOR_VERSION 28 +#define SDL_PATCHLEVEL 2 + +/** + * Macro to determine SDL version program was compiled against. + * + * This macro fills in a SDL_version structure with the version of the + * library you compiled against. This is determined by what header the + * compiler uses. Note that if you dynamically linked the library, you might + * have a slightly newer or older version at runtime. That version can be + * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), + * is not a macro. + * + * \param x A pointer to a SDL_version struct to initialize. + * + * \sa SDL_version + * \sa SDL_GetVersion + */ +#define SDL_VERSION(x) \ +{ \ + (x)->major = SDL_MAJOR_VERSION; \ + (x)->minor = SDL_MINOR_VERSION; \ + (x)->patch = SDL_PATCHLEVEL; \ +} + +/* TODO: Remove this whole block in SDL 3 */ +#if SDL_MAJOR_VERSION < 3 +/** + * This macro turns the version numbers into a numeric value: + * \verbatim + (1,2,3) -> (1203) + \endverbatim + * + * This assumes that there will never be more than 100 patchlevels. + * + * In versions higher than 2.9.0, the minor version overflows into + * the thousands digit: for example, 2.23.0 is encoded as 4300, + * and 2.255.99 would be encoded as 25799. + * This macro will not be available in SDL 3.x. + */ +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) + +/** + * This is the version number macro for the current SDL version. + * + * In versions higher than 2.9.0, the minor version overflows into + * the thousands digit: for example, 2.23.0 is encoded as 4300. + * This macro will not be available in SDL 3.x. + * + * Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead. + */ +#define SDL_COMPILEDVERSION \ + SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) +#endif /* SDL_MAJOR_VERSION < 3 */ + +/** + * This macro will evaluate to true if compiled with SDL at least X.Y.Z. + */ +#define SDL_VERSION_ATLEAST(X, Y, Z) \ + ((SDL_MAJOR_VERSION >= X) && \ + (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION >= Y) && \ + (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION > Y || SDL_PATCHLEVEL >= Z)) + +/** + * Get the version of SDL that is linked against your program. + * + * If you are linking to SDL dynamically, then it is possible that the current + * version will be different than the version you compiled against. This + * function returns the current version, while SDL_VERSION() is a macro that + * tells you what version you compiled with. + * + * This function may be called safely at any time, even before SDL_Init(). + * + * \param ver the SDL_version structure that contains the version information + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRevision + */ +extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); + +/** + * Get the code revision of SDL that is linked against your program. + * + * This value is the revision of the code you are linked with and may be + * different from the code you are compiling with, which is found in the + * constant SDL_REVISION. + * + * The revision is arbitrary string (a hash value) uniquely identifying the + * exact revision of the SDL library in use, and is only useful in comparing + * against other revisions. It is NOT an incrementing number. + * + * If SDL wasn't built from a git repository with the appropriate tools, this + * will return an empty string. + * + * Prior to SDL 2.0.16, before development moved to GitHub, this returned a + * hash for a Mercurial repository. + * + * You shouldn't use this function for anything but logging it for debugging + * purposes. The string is not intended to be reliable in any way. + * + * \returns an arbitrary string, uniquely identifying the exact revision of + * the SDL library in use. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetVersion + */ +extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); + +/** + * Obsolete function, do not use. + * + * When SDL was hosted in a Mercurial repository, and was built carefully, + * this would return the revision number that the build was created from. This + * number was not reliable for several reasons, but more importantly, SDL is + * now hosted in a git repository, which does not offer numbers at all, only + * hashes. This function only ever returns zero now. Don't use it. + * + * Before SDL 2.0.16, this might have returned an unreliable, but non-zero + * number. + * + * \deprecated Use SDL_GetRevision() instead; if SDL was carefully built, it + * will return a git hash. + * + * \returns zero, always, in modern SDL releases. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetRevision + */ +extern SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_version_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_video.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_video.h new file mode 100644 index 00000000..d1da8139 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_video.h @@ -0,0 +1,2178 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file SDL_video.h + * + * Header file for SDL video functions. + */ + +#ifndef SDL_video_h_ +#define SDL_video_h_ + +#include +#include +#include +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The structure that defines a display mode + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() + * \sa SDL_GetDesktopDisplayMode() + * \sa SDL_GetCurrentDisplayMode() + * \sa SDL_GetClosestDisplayMode() + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_GetWindowDisplayMode() + */ +typedef struct +{ + Uint32 format; /**< pixel format */ + int w; /**< width, in screen coordinates */ + int h; /**< height, in screen coordinates */ + int refresh_rate; /**< refresh rate (or zero for unspecified) */ + void *driverdata; /**< driver-specific data, initialize to 0 */ +} SDL_DisplayMode; + +/** + * \brief The type used to identify a window + * + * \sa SDL_CreateWindow() + * \sa SDL_CreateWindowFrom() + * \sa SDL_DestroyWindow() + * \sa SDL_FlashWindow() + * \sa SDL_GetWindowData() + * \sa SDL_GetWindowFlags() + * \sa SDL_GetWindowGrab() + * \sa SDL_GetWindowKeyboardGrab() + * \sa SDL_GetWindowMouseGrab() + * \sa SDL_GetWindowPosition() + * \sa SDL_GetWindowSize() + * \sa SDL_GetWindowTitle() + * \sa SDL_HideWindow() + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + * \sa SDL_RaiseWindow() + * \sa SDL_RestoreWindow() + * \sa SDL_SetWindowData() + * \sa SDL_SetWindowFullscreen() + * \sa SDL_SetWindowGrab() + * \sa SDL_SetWindowKeyboardGrab() + * \sa SDL_SetWindowMouseGrab() + * \sa SDL_SetWindowIcon() + * \sa SDL_SetWindowPosition() + * \sa SDL_SetWindowSize() + * \sa SDL_SetWindowBordered() + * \sa SDL_SetWindowResizable() + * \sa SDL_SetWindowTitle() + * \sa SDL_ShowWindow() + */ +typedef struct SDL_Window SDL_Window; + +/** + * \brief The flags on a window + * + * \sa SDL_GetWindowFlags() + */ +typedef enum +{ + SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ + SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ + SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ + SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */ + SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */ + SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */ + SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */ + SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */ + SDL_WINDOW_MOUSE_GRABBED = 0x00000100, /**< window has grabbed mouse input */ + SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ + SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ + SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), + SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */ + SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, /**< window should be created in high-DPI mode if supported. + On macOS NSHighResolutionCapable must be set true in the + application's Info.plist for this to have any effect. */ + SDL_WINDOW_MOUSE_CAPTURE = 0x00004000, /**< window has mouse captured (unrelated to MOUSE_GRABBED) */ + SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000, /**< window should always be above others */ + SDL_WINDOW_SKIP_TASKBAR = 0x00010000, /**< window should not be added to the taskbar */ + SDL_WINDOW_UTILITY = 0x00020000, /**< window should be treated as a utility window */ + SDL_WINDOW_TOOLTIP = 0x00040000, /**< window should be treated as a tooltip */ + SDL_WINDOW_POPUP_MENU = 0x00080000, /**< window should be treated as a popup menu */ + SDL_WINDOW_KEYBOARD_GRABBED = 0x00100000, /**< window has grabbed keyboard input */ + SDL_WINDOW_VULKAN = 0x10000000, /**< window usable for Vulkan surface */ + SDL_WINDOW_METAL = 0x20000000, /**< window usable for Metal view */ + + SDL_WINDOW_INPUT_GRABBED = SDL_WINDOW_MOUSE_GRABBED /**< equivalent to SDL_WINDOW_MOUSE_GRABBED for compatibility */ +} SDL_WindowFlags; + +/** + * \brief Used to indicate that you don't care what the window position is. + */ +#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000u +#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) +#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) +#define SDL_WINDOWPOS_ISUNDEFINED(X) \ + (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) + +/** + * \brief Used to indicate that the window position should be centered. + */ +#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000u +#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) +#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) +#define SDL_WINDOWPOS_ISCENTERED(X) \ + (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) + +/** + * \brief Event subtype for window events + */ +typedef enum +{ + SDL_WINDOWEVENT_NONE, /**< Never used */ + SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ + SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ + SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be + redrawn */ + SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 + */ + SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */ + SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as + a result of an API call or through the + system or user changing the window size. */ + SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ + SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ + SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size + and position */ + SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */ + SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */ + SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */ + SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */ + SDL_WINDOWEVENT_CLOSE, /**< The window manager requests that the window be closed */ + SDL_WINDOWEVENT_TAKE_FOCUS, /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */ + SDL_WINDOWEVENT_HIT_TEST, /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */ + SDL_WINDOWEVENT_ICCPROF_CHANGED,/**< The ICC profile of the window's display has changed. */ + SDL_WINDOWEVENT_DISPLAY_CHANGED /**< Window has been moved to display data1. */ +} SDL_WindowEventID; + +/** + * \brief Event subtype for display events + */ +typedef enum +{ + SDL_DISPLAYEVENT_NONE, /**< Never used */ + SDL_DISPLAYEVENT_ORIENTATION, /**< Display orientation has changed to data1 */ + SDL_DISPLAYEVENT_CONNECTED, /**< Display has been added to the system */ + SDL_DISPLAYEVENT_DISCONNECTED, /**< Display has been removed from the system */ + SDL_DISPLAYEVENT_MOVED /**< Display has changed position */ +} SDL_DisplayEventID; + +/** + * \brief Display orientation + */ +typedef enum +{ + SDL_ORIENTATION_UNKNOWN, /**< The display orientation can't be determined */ + SDL_ORIENTATION_LANDSCAPE, /**< The display is in landscape mode, with the right side up, relative to portrait mode */ + SDL_ORIENTATION_LANDSCAPE_FLIPPED, /**< The display is in landscape mode, with the left side up, relative to portrait mode */ + SDL_ORIENTATION_PORTRAIT, /**< The display is in portrait mode */ + SDL_ORIENTATION_PORTRAIT_FLIPPED /**< The display is in portrait mode, upside down */ +} SDL_DisplayOrientation; + +/** + * \brief Window flash operation + */ +typedef enum +{ + SDL_FLASH_CANCEL, /**< Cancel any window flash state */ + SDL_FLASH_BRIEFLY, /**< Flash the window briefly to get attention */ + SDL_FLASH_UNTIL_FOCUSED /**< Flash the window until it gets focus */ +} SDL_FlashOperation; + +/** + * \brief An opaque handle to an OpenGL context. + */ +typedef void *SDL_GLContext; + +/** + * \brief OpenGL configuration attributes + */ +typedef enum +{ + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_RETAINED_BACKING, + SDL_GL_CONTEXT_MAJOR_VERSION, + SDL_GL_CONTEXT_MINOR_VERSION, + SDL_GL_CONTEXT_EGL, + SDL_GL_CONTEXT_FLAGS, + SDL_GL_CONTEXT_PROFILE_MASK, + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR, + SDL_GL_CONTEXT_RESET_NOTIFICATION, + SDL_GL_CONTEXT_NO_ERROR, + SDL_GL_FLOATBUFFERS +} SDL_GLattr; + +typedef enum +{ + SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, + SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, + SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /**< GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ +} SDL_GLprofile; + +typedef enum +{ + SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, + SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, + SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, + SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 +} SDL_GLcontextFlag; + +typedef enum +{ + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000, + SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001 +} SDL_GLcontextReleaseFlag; + +typedef enum +{ + SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000, + SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001 +} SDL_GLContextResetNotification; + +/* Function prototypes */ + +/** + * Get the number of video drivers compiled into SDL. + * + * \returns a number >= 1 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetVideoDriver + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); + +/** + * Get the name of a built in video driver. + * + * The video drivers are presented in the order in which they are normally + * checked during initialization. + * + * \param index the index of a video driver + * \returns the name of the video driver with the given **index**. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetNumVideoDrivers + */ +extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); + +/** + * Initialize the video subsystem, optionally specifying a video driver. + * + * This function initializes the video subsystem, setting up a connection to + * the window manager, etc, and determines the available display modes and + * pixel formats, but does not initialize a window or graphics mode. + * + * If you use this function and you haven't used the SDL_INIT_VIDEO flag with + * either SDL_Init() or SDL_InitSubSystem(), you should call SDL_VideoQuit() + * before calling SDL_Quit(). + * + * It is safe to call this function multiple times. SDL_VideoInit() will call + * SDL_VideoQuit() itself if the video subsystem has already been initialized. + * + * You can use SDL_GetNumVideoDrivers() and SDL_GetVideoDriver() to find a + * specific `driver_name`. + * + * \param driver_name the name of a video driver to initialize, or NULL for + * the default driver + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetNumVideoDrivers + * \sa SDL_GetVideoDriver + * \sa SDL_InitSubSystem + * \sa SDL_VideoQuit + */ +extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name); + +/** + * Shut down the video subsystem, if initialized with SDL_VideoInit(). + * + * This function closes all windows, and restores the original video mode. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_VideoInit + */ +extern DECLSPEC void SDLCALL SDL_VideoQuit(void); + +/** + * Get the name of the currently initialized video driver. + * + * \returns the name of the current video driver or NULL if no driver has been + * initialized. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetNumVideoDrivers + * \sa SDL_GetVideoDriver + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); + +/** + * Get the number of available video displays. + * + * \returns a number >= 1 or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetDisplayBounds + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); + +/** + * Get the name of a display in UTF-8 encoding. + * + * \param displayIndex the index of display from which the name should be + * queried + * \returns the name of a display or NULL for an invalid display index or + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetNumVideoDisplays + */ +extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); + +/** + * Get the desktop area represented by a display. + * + * The primary display (`displayIndex` zero) is always located at 0,0. + * + * \param displayIndex the index of the display to query + * \param rect the SDL_Rect structure filled in with the display bounds + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetNumVideoDisplays + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); + +/** + * Get the usable desktop area represented by a display. + * + * The primary display (`displayIndex` zero) is always located at 0,0. + * + * This is the same area as SDL_GetDisplayBounds() reports, but with portions + * reserved by the system removed. For example, on Apple's macOS, this + * subtracts the area occupied by the menu bar and dock. + * + * Setting a window to be fullscreen generally bypasses these unusable areas, + * so these are good guidelines for the maximum space available to a + * non-fullscreen window. + * + * The parameter `rect` is ignored if it is NULL. + * + * This function also returns -1 if the parameter `displayIndex` is out of + * range. + * + * \param displayIndex the index of the display to query the usable bounds + * from + * \param rect the SDL_Rect structure filled in with the display bounds + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_GetDisplayBounds + * \sa SDL_GetNumVideoDisplays + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect); + +/** + * Get the dots/pixels-per-inch for a display. + * + * Diagonal, horizontal and vertical DPI can all be optionally returned if the + * appropriate parameter is non-NULL. + * + * A failure of this function usually means that either no DPI information is + * available or the `displayIndex` is out of range. + * + * **WARNING**: This reports the DPI that the hardware reports, and it is not + * always reliable! It is almost always better to use SDL_GetWindowSize() to + * find the window size, which might be in logical points instead of pixels, + * and then SDL_GL_GetDrawableSize(), SDL_Vulkan_GetDrawableSize(), + * SDL_Metal_GetDrawableSize(), or SDL_GetRendererOutputSize(), and compare + * the two values to get an actual scaling value between the two. We will be + * rethinking how high-dpi details should be managed in SDL3 to make things + * more consistent, reliable, and clear. + * + * \param displayIndex the index of the display from which DPI information + * should be queried + * \param ddpi a pointer filled in with the diagonal DPI of the display; may + * be NULL + * \param hdpi a pointer filled in with the horizontal DPI of the display; may + * be NULL + * \param vdpi a pointer filled in with the vertical DPI of the display; may + * be NULL + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.4. + * + * \sa SDL_GetNumVideoDisplays + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi); + +/** + * Get the orientation of a display. + * + * \param displayIndex the index of the display to query + * \returns The SDL_DisplayOrientation enum value of the display, or + * `SDL_ORIENTATION_UNKNOWN` if it isn't available. + * + * \since This function is available since SDL 2.0.9. + * + * \sa SDL_GetNumVideoDisplays + */ +extern DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetDisplayOrientation(int displayIndex); + +/** + * Get the number of available display modes. + * + * The `displayIndex` needs to be in the range from 0 to + * SDL_GetNumVideoDisplays() - 1. + * + * \param displayIndex the index of the display to query + * \returns a number >= 1 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetDisplayMode + * \sa SDL_GetNumVideoDisplays + */ +extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); + +/** + * Get information about a specific display mode. + * + * The display modes are sorted in this priority: + * + * - width -> largest to smallest + * - height -> largest to smallest + * - bits per pixel -> more colors to fewer colors + * - packed pixel layout -> largest to smallest + * - refresh rate -> highest to lowest + * + * \param displayIndex the index of the display to query + * \param modeIndex the index of the display mode to query + * \param mode an SDL_DisplayMode structure filled in with the mode at + * `modeIndex` + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetNumDisplayModes + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, + SDL_DisplayMode * mode); + +/** + * Get information about the desktop's display mode. + * + * There's a difference between this function and SDL_GetCurrentDisplayMode() + * when SDL runs fullscreen and has changed the resolution. In that case this + * function will return the previous native display mode, and not the current + * display mode. + * + * \param displayIndex the index of the display to query + * \param mode an SDL_DisplayMode structure filled in with the current display + * mode + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetCurrentDisplayMode + * \sa SDL_GetDisplayMode + * \sa SDL_SetWindowDisplayMode + */ +extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode); + +/** + * Get information about the current display mode. + * + * There's a difference between this function and SDL_GetDesktopDisplayMode() + * when SDL runs fullscreen and has changed the resolution. In that case this + * function will return the current display mode, and not the previous native + * display mode. + * + * \param displayIndex the index of the display to query + * \param mode an SDL_DisplayMode structure filled in with the current display + * mode + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetDesktopDisplayMode + * \sa SDL_GetDisplayMode + * \sa SDL_GetNumVideoDisplays + * \sa SDL_SetWindowDisplayMode + */ +extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode); + + +/** + * Get the closest match to the requested display mode. + * + * The available display modes are scanned and `closest` is filled in with the + * closest mode matching the requested mode and returned. The mode format and + * refresh rate default to the desktop mode if they are set to 0. The modes + * are scanned with size being first priority, format being second priority, + * and finally checking the refresh rate. If all the available modes are too + * small, then NULL is returned. + * + * \param displayIndex the index of the display to query + * \param mode an SDL_DisplayMode structure containing the desired display + * mode + * \param closest an SDL_DisplayMode structure filled in with the closest + * match of the available display modes + * \returns the passed in value `closest` or NULL if no matching video mode + * was available; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetDisplayMode + * \sa SDL_GetNumDisplayModes + */ +extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); + +/** + * Get the index of the display containing a point + * + * \param point the point to query + * \returns the index of the display containing the point or a negative error + * code on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_GetDisplayBounds + * \sa SDL_GetNumVideoDisplays + */ +extern DECLSPEC int SDLCALL SDL_GetPointDisplayIndex(const SDL_Point * point); + +/** + * Get the index of the display primarily containing a rect + * + * \param rect the rect to query + * \returns the index of the display entirely containing the rect or closest + * to the center of the rect on success or a negative error code on + * failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.24.0. + * + * \sa SDL_GetDisplayBounds + * \sa SDL_GetNumVideoDisplays + */ +extern DECLSPEC int SDLCALL SDL_GetRectDisplayIndex(const SDL_Rect * rect); + +/** + * Get the index of the display associated with a window. + * + * \param window the window to query + * \returns the index of the display containing the center of the window on + * success or a negative error code on failure; call SDL_GetError() + * for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetDisplayBounds + * \sa SDL_GetNumVideoDisplays + */ +extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); + +/** + * Set the display mode to use when a window is visible at fullscreen. + * + * This only affects the display mode used when the window is fullscreen. To + * change the window size when the window is not fullscreen, use + * SDL_SetWindowSize(). + * + * \param window the window to affect + * \param mode the SDL_DisplayMode structure representing the mode to use, or + * NULL to use the window's dimensions and the desktop's format + * and refresh rate + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowDisplayMode + * \sa SDL_SetWindowFullscreen + */ +extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, + const SDL_DisplayMode * mode); + +/** + * Query the display mode to use when a window is visible at fullscreen. + * + * \param window the window to query + * \param mode an SDL_DisplayMode structure filled in with the fullscreen + * display mode + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetWindowDisplayMode + * \sa SDL_SetWindowFullscreen + */ +extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, + SDL_DisplayMode * mode); + +/** + * Get the raw ICC profile data for the screen the window is currently on. + * + * Data returned should be freed with SDL_free. + * + * \param window the window to query + * \param size the size of the ICC profile + * \returns the raw ICC profile data on success or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.18. + */ +extern DECLSPEC void* SDLCALL SDL_GetWindowICCProfile(SDL_Window * window, size_t* size); + +/** + * Get the pixel format associated with the window. + * + * \param window the window to query + * \returns the pixel format of the window on success or + * SDL_PIXELFORMAT_UNKNOWN on failure; call SDL_GetError() for more + * information. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); + +/** + * Create a window with the specified position, dimensions, and flags. + * + * `flags` may be any of the following OR'd together: + * + * - `SDL_WINDOW_FULLSCREEN`: fullscreen window + * - `SDL_WINDOW_FULLSCREEN_DESKTOP`: fullscreen window at desktop resolution + * - `SDL_WINDOW_OPENGL`: window usable with an OpenGL context + * - `SDL_WINDOW_VULKAN`: window usable with a Vulkan instance + * - `SDL_WINDOW_METAL`: window usable with a Metal instance + * - `SDL_WINDOW_HIDDEN`: window is not visible + * - `SDL_WINDOW_BORDERLESS`: no window decoration + * - `SDL_WINDOW_RESIZABLE`: window can be resized + * - `SDL_WINDOW_MINIMIZED`: window is minimized + * - `SDL_WINDOW_MAXIMIZED`: window is maximized + * - `SDL_WINDOW_INPUT_GRABBED`: window has grabbed input focus + * - `SDL_WINDOW_ALLOW_HIGHDPI`: window should be created in high-DPI mode if + * supported (>= SDL 2.0.1) + * + * `SDL_WINDOW_SHOWN` is ignored by SDL_CreateWindow(). The SDL_Window is + * implicitly shown if SDL_WINDOW_HIDDEN is not set. `SDL_WINDOW_SHOWN` may be + * queried later using SDL_GetWindowFlags(). + * + * On Apple's macOS, you **must** set the NSHighResolutionCapable Info.plist + * property to YES, otherwise you will not receive a High-DPI OpenGL canvas. + * + * If the window is created with the `SDL_WINDOW_ALLOW_HIGHDPI` flag, its size + * in pixels may differ from its size in screen coordinates on platforms with + * high-DPI support (e.g. iOS and macOS). Use SDL_GetWindowSize() to query the + * client area's size in screen coordinates, and SDL_GL_GetDrawableSize() or + * SDL_GetRendererOutputSize() to query the drawable size in pixels. Note that + * when this flag is set, the drawable size can vary after the window is + * created and should be queried after major window events such as when the + * window is resized or moved between displays. + * + * If the window is set fullscreen, the width and height parameters `w` and + * `h` will not be used. However, invalid size parameters (e.g. too large) may + * still fail. Window size is actually limited to 16384 x 16384 for all + * platforms at window creation. + * + * If the window is created with any of the SDL_WINDOW_OPENGL or + * SDL_WINDOW_VULKAN flags, then the corresponding LoadLibrary function + * (SDL_GL_LoadLibrary or SDL_Vulkan_LoadLibrary) is called and the + * corresponding UnloadLibrary function is called by SDL_DestroyWindow(). + * + * If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver, + * SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail. + * + * If SDL_WINDOW_METAL is specified on an OS that does not support Metal, + * SDL_CreateWindow() will fail. + * + * On non-Apple devices, SDL requires you to either not link to the Vulkan + * loader or link to a dynamic library version. This limitation may be removed + * in a future version of SDL. + * + * \param title the title of the window, in UTF-8 encoding + * \param x the x position of the window, `SDL_WINDOWPOS_CENTERED`, or + * `SDL_WINDOWPOS_UNDEFINED` + * \param y the y position of the window, `SDL_WINDOWPOS_CENTERED`, or + * `SDL_WINDOWPOS_UNDEFINED` + * \param w the width of the window, in screen coordinates + * \param h the height of the window, in screen coordinates + * \param flags 0, or one or more SDL_WindowFlags OR'd together + * \returns the window that was created or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateWindowFrom + * \sa SDL_DestroyWindow + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, + int x, int y, int w, + int h, Uint32 flags); + +/** + * Create an SDL window from an existing native window. + * + * In some cases (e.g. OpenGL) and on some platforms (e.g. Microsoft Windows) + * the hint `SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT` needs to be configured + * before using SDL_CreateWindowFrom(). + * + * \param data a pointer to driver-dependent window creation data, typically + * your native window cast to a void* + * \returns the window that was created or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateWindow + * \sa SDL_DestroyWindow + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); + +/** + * Get the numeric ID of a window. + * + * The numeric ID is what SDL_WindowEvent references, and is necessary to map + * these events to specific SDL_Window objects. + * + * \param window the window to query + * \returns the ID of the window on success or 0 on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowFromID + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); + +/** + * Get a window from a stored ID. + * + * The numeric ID is what SDL_WindowEvent references, and is necessary to map + * these events to specific SDL_Window objects. + * + * \param id the ID of the window + * \returns the window associated with `id` or NULL if it doesn't exist; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowID + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); + +/** + * Get the window flags. + * + * \param window the window to query + * \returns a mask of the SDL_WindowFlags associated with `window` + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateWindow + * \sa SDL_HideWindow + * \sa SDL_MaximizeWindow + * \sa SDL_MinimizeWindow + * \sa SDL_SetWindowFullscreen + * \sa SDL_SetWindowGrab + * \sa SDL_ShowWindow + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); + +/** + * Set the title of a window. + * + * This string is expected to be in UTF-8 encoding. + * + * \param window the window to change + * \param title the desired window title in UTF-8 format + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowTitle + */ +extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, + const char *title); + +/** + * Get the title of a window. + * + * \param window the window to query + * \returns the title of the window in UTF-8 format or "" if there is no + * title. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetWindowTitle + */ +extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); + +/** + * Set the icon for a window. + * + * \param window the window to change + * \param icon an SDL_Surface structure containing the icon for the window + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, + SDL_Surface * icon); + +/** + * Associate an arbitrary named pointer with a window. + * + * `name` is case-sensitive. + * + * \param window the window to associate with the pointer + * \param name the name of the pointer + * \param userdata the associated pointer + * \returns the previous value associated with `name`. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowData + */ +extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, + const char *name, + void *userdata); + +/** + * Retrieve the data pointer associated with a window. + * + * \param window the window to query + * \param name the name of the pointer + * \returns the value associated with `name`. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetWindowData + */ +extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, + const char *name); + +/** + * Set the position of a window. + * + * The window coordinate origin is the upper left of the display. + * + * \param window the window to reposition + * \param x the x coordinate of the window in screen coordinates, or + * `SDL_WINDOWPOS_CENTERED` or `SDL_WINDOWPOS_UNDEFINED` + * \param y the y coordinate of the window in screen coordinates, or + * `SDL_WINDOWPOS_CENTERED` or `SDL_WINDOWPOS_UNDEFINED` + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowPosition + */ +extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, + int x, int y); + +/** + * Get the position of a window. + * + * If you do not need the value for one of the positions a NULL may be passed + * in the `x` or `y` parameter. + * + * \param window the window to query + * \param x a pointer filled in with the x position of the window, in screen + * coordinates, may be NULL + * \param y a pointer filled in with the y position of the window, in screen + * coordinates, may be NULL + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetWindowPosition + */ +extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, + int *x, int *y); + +/** + * Set the size of a window's client area. + * + * The window size in screen coordinates may differ from the size in pixels, + * if the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a platform + * with high-dpi support (e.g. iOS or macOS). Use SDL_GL_GetDrawableSize() or + * SDL_GetRendererOutputSize() to get the real client area size in pixels. + * + * Fullscreen windows automatically match the size of the display mode, and + * you should use SDL_SetWindowDisplayMode() to change their size. + * + * \param window the window to change + * \param w the width of the window in pixels, in screen coordinates, must be + * > 0 + * \param h the height of the window in pixels, in screen coordinates, must be + * > 0 + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowSize + * \sa SDL_SetWindowDisplayMode + */ +extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, + int h); + +/** + * Get the size of a window's client area. + * + * NULL can safely be passed as the `w` or `h` parameter if the width or + * height value is not desired. + * + * The window size in screen coordinates may differ from the size in pixels, + * if the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a platform + * with high-dpi support (e.g. iOS or macOS). Use SDL_GL_GetDrawableSize(), + * SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to get the + * real client area size in pixels. + * + * \param window the window to query the width and height from + * \param w a pointer filled in with the width of the window, in screen + * coordinates, may be NULL + * \param h a pointer filled in with the height of the window, in screen + * coordinates, may be NULL + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_GetDrawableSize + * \sa SDL_Vulkan_GetDrawableSize + * \sa SDL_SetWindowSize + */ +extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, + int *h); + +/** + * Get the size of a window's borders (decorations) around the client area. + * + * Note: If this function fails (returns -1), the size values will be + * initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as if the + * window in question was borderless. + * + * Note: This function may fail on systems where the window has not yet been + * decorated by the display server (for example, immediately after calling + * SDL_CreateWindow). It is recommended that you wait at least until the + * window has been presented and composited, so that the window system has a + * chance to decorate the window and provide the border dimensions to SDL. + * + * This function also returns -1 if getting the information is not supported. + * + * \param window the window to query the size values of the border + * (decorations) from + * \param top pointer to variable for storing the size of the top border; NULL + * is permitted + * \param left pointer to variable for storing the size of the left border; + * NULL is permitted + * \param bottom pointer to variable for storing the size of the bottom + * border; NULL is permitted + * \param right pointer to variable for storing the size of the right border; + * NULL is permitted + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_GetWindowSize + */ +extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window, + int *top, int *left, + int *bottom, int *right); + +/** + * Get the size of a window in pixels. + * + * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI + * drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a + * platform with high-DPI support (Apple calls this "Retina"), and not + * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. + * + * \param window the window from which the drawable size should be queried + * \param w a pointer to variable for storing the width in pixels, may be NULL + * \param h a pointer to variable for storing the height in pixels, may be + * NULL + * + * \since This function is available since SDL 2.26.0. + * + * \sa SDL_CreateWindow + * \sa SDL_GetWindowSize + */ +extern DECLSPEC void SDLCALL SDL_GetWindowSizeInPixels(SDL_Window * window, + int *w, int *h); + +/** + * Set the minimum size of a window's client area. + * + * \param window the window to change + * \param min_w the minimum width of the window in pixels + * \param min_h the minimum height of the window in pixels + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowMinimumSize + * \sa SDL_SetWindowMaximumSize + */ +extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, + int min_w, int min_h); + +/** + * Get the minimum size of a window's client area. + * + * \param window the window to query + * \param w a pointer filled in with the minimum width of the window, may be + * NULL + * \param h a pointer filled in with the minimum height of the window, may be + * NULL + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowMaximumSize + * \sa SDL_SetWindowMinimumSize + */ +extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, + int *w, int *h); + +/** + * Set the maximum size of a window's client area. + * + * \param window the window to change + * \param max_w the maximum width of the window in pixels + * \param max_h the maximum height of the window in pixels + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowMaximumSize + * \sa SDL_SetWindowMinimumSize + */ +extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, + int max_w, int max_h); + +/** + * Get the maximum size of a window's client area. + * + * \param window the window to query + * \param w a pointer filled in with the maximum width of the window, may be + * NULL + * \param h a pointer filled in with the maximum height of the window, may be + * NULL + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowMinimumSize + * \sa SDL_SetWindowMaximumSize + */ +extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, + int *w, int *h); + +/** + * Set the border state of a window. + * + * This will add or remove the window's `SDL_WINDOW_BORDERLESS` flag and add + * or remove the border from the actual window. This is a no-op if the + * window's border already matches the requested state. + * + * You can't change the border state of a fullscreen window. + * + * \param window the window of which to change the border state + * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowFlags + */ +extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, + SDL_bool bordered); + +/** + * Set the user-resizable state of a window. + * + * This will add or remove the window's `SDL_WINDOW_RESIZABLE` flag and + * allow/disallow user resizing of the window. This is a no-op if the window's + * resizable state already matches the requested state. + * + * You can't change the resizable state of a fullscreen window. + * + * \param window the window of which to change the resizable state + * \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_GetWindowFlags + */ +extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window * window, + SDL_bool resizable); + +/** + * Set the window to always be above the others. + * + * This will add or remove the window's `SDL_WINDOW_ALWAYS_ON_TOP` flag. This + * will bring the window to the front and keep the window above the rest. + * + * \param window The window of which to change the always on top state + * \param on_top SDL_TRUE to set the window always on top, SDL_FALSE to + * disable + * + * \since This function is available since SDL 2.0.16. + * + * \sa SDL_GetWindowFlags + */ +extern DECLSPEC void SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window * window, + SDL_bool on_top); + +/** + * Show a window. + * + * \param window the window to show + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_HideWindow + * \sa SDL_RaiseWindow + */ +extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); + +/** + * Hide a window. + * + * \param window the window to hide + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_ShowWindow + */ +extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); + +/** + * Raise a window above other windows and set the input focus. + * + * \param window the window to raise + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); + +/** + * Make a window as large as possible. + * + * \param window the window to maximize + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_MinimizeWindow + * \sa SDL_RestoreWindow + */ +extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); + +/** + * Minimize a window to an iconic representation. + * + * \param window the window to minimize + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_MaximizeWindow + * \sa SDL_RestoreWindow + */ +extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); + +/** + * Restore the size and position of a minimized or maximized window. + * + * \param window the window to restore + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_MaximizeWindow + * \sa SDL_MinimizeWindow + */ +extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); + +/** + * Set a window's fullscreen state. + * + * `flags` may be `SDL_WINDOW_FULLSCREEN`, for "real" fullscreen with a + * videomode change; `SDL_WINDOW_FULLSCREEN_DESKTOP` for "fake" fullscreen + * that takes the size of the desktop; and 0 for windowed mode. + * + * \param window the window to change + * \param flags `SDL_WINDOW_FULLSCREEN`, `SDL_WINDOW_FULLSCREEN_DESKTOP` or 0 + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowDisplayMode + * \sa SDL_SetWindowDisplayMode + */ +extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, + Uint32 flags); + +/** + * Return whether the window has a surface associated with it. + * + * \returns SDL_TRUE if there is a surface associated with the window, or SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.28.0. + * + * \sa SDL_GetWindowSurface + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasWindowSurface(SDL_Window *window); + +/** + * Get the SDL surface associated with the window. + * + * A new surface will be created with the optimal format for the window, if + * necessary. This surface will be freed when the window is destroyed. Do not + * free this surface. + * + * This surface will be invalidated if the window is resized. After resizing a + * window this function must be called again to return a valid surface. + * + * You may not combine this with 3D or the rendering API on this window. + * + * This function is affected by `SDL_HINT_FRAMEBUFFER_ACCELERATION`. + * + * \param window the window to query + * \returns the surface associated with the window, or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_DestroyWindowSurface + * \sa SDL_HasWindowSurface + * \sa SDL_UpdateWindowSurface + * \sa SDL_UpdateWindowSurfaceRects + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); + +/** + * Copy the window surface to the screen. + * + * This is the function you use to reflect any changes to the surface on the + * screen. + * + * This function is equivalent to the SDL 1.2 API SDL_Flip(). + * + * \param window the window to update + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowSurface + * \sa SDL_UpdateWindowSurfaceRects + */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); + +/** + * Copy areas of the window surface to the screen. + * + * This is the function you use to reflect changes to portions of the surface + * on the screen. + * + * This function is equivalent to the SDL 1.2 API SDL_UpdateRects(). + * + * \param window the window to update + * \param rects an array of SDL_Rect structures representing areas of the + * surface to copy, in pixels + * \param numrects the number of rectangles + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowSurface + * \sa SDL_UpdateWindowSurface + */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, + const SDL_Rect * rects, + int numrects); + +/** + * Destroy the surface associated with the window. + * + * \param window the window to update + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.28.0. + * + * \sa SDL_GetWindowSurface + * \sa SDL_HasWindowSurface + */ +extern DECLSPEC int SDLCALL SDL_DestroyWindowSurface(SDL_Window *window); + +/** + * Set a window's input grab mode. + * + * When input is grabbed, the mouse is confined to the window. This function + * will also grab the keyboard if `SDL_HINT_GRAB_KEYBOARD` is set. To grab the + * keyboard without also grabbing the mouse, use SDL_SetWindowKeyboardGrab(). + * + * If the caller enables a grab while another window is currently grabbed, the + * other window loses its grab in favor of the caller's window. + * + * \param window the window for which the input grab mode should be set + * \param grabbed SDL_TRUE to grab input or SDL_FALSE to release input + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetGrabbedWindow + * \sa SDL_GetWindowGrab + */ +extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, + SDL_bool grabbed); + +/** + * Set a window's keyboard grab mode. + * + * Keyboard grab enables capture of system keyboard shortcuts like Alt+Tab or + * the Meta/Super key. Note that not all system keyboard shortcuts can be + * captured by applications (one example is Ctrl+Alt+Del on Windows). + * + * This is primarily intended for specialized applications such as VNC clients + * or VM frontends. Normal games should not use keyboard grab. + * + * When keyboard grab is enabled, SDL will continue to handle Alt+Tab when the + * window is full-screen to ensure the user is not trapped in your + * application. If you have a custom keyboard shortcut to exit fullscreen + * mode, you may suppress this behavior with + * `SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED`. + * + * If the caller enables a grab while another window is currently grabbed, the + * other window loses its grab in favor of the caller's window. + * + * \param window The window for which the keyboard grab mode should be set. + * \param grabbed This is SDL_TRUE to grab keyboard, and SDL_FALSE to release. + * + * \since This function is available since SDL 2.0.16. + * + * \sa SDL_GetWindowKeyboardGrab + * \sa SDL_SetWindowMouseGrab + * \sa SDL_SetWindowGrab + */ +extern DECLSPEC void SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window * window, + SDL_bool grabbed); + +/** + * Set a window's mouse grab mode. + * + * Mouse grab confines the mouse cursor to the window. + * + * \param window The window for which the mouse grab mode should be set. + * \param grabbed This is SDL_TRUE to grab mouse, and SDL_FALSE to release. + * + * \since This function is available since SDL 2.0.16. + * + * \sa SDL_GetWindowMouseGrab + * \sa SDL_SetWindowKeyboardGrab + * \sa SDL_SetWindowGrab + */ +extern DECLSPEC void SDLCALL SDL_SetWindowMouseGrab(SDL_Window * window, + SDL_bool grabbed); + +/** + * Get a window's input grab mode. + * + * \param window the window to query + * \returns SDL_TRUE if input is grabbed, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetWindowGrab + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); + +/** + * Get a window's keyboard grab mode. + * + * \param window the window to query + * \returns SDL_TRUE if keyboard is grabbed, and SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.16. + * + * \sa SDL_SetWindowKeyboardGrab + * \sa SDL_GetWindowGrab + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowKeyboardGrab(SDL_Window * window); + +/** + * Get a window's mouse grab mode. + * + * \param window the window to query + * \returns SDL_TRUE if mouse is grabbed, and SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.16. + * + * \sa SDL_SetWindowKeyboardGrab + * \sa SDL_GetWindowGrab + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowMouseGrab(SDL_Window * window); + +/** + * Get the window that currently has an input grab enabled. + * + * \returns the window if input is grabbed or NULL otherwise. + * + * \since This function is available since SDL 2.0.4. + * + * \sa SDL_GetWindowGrab + * \sa SDL_SetWindowGrab + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); + +/** + * Confines the cursor to the specified area of a window. + * + * Note that this does NOT grab the cursor, it only defines the area a cursor + * is restricted to when the window has mouse focus. + * + * \param window The window that will be associated with the barrier. + * \param rect A rectangle area in window-relative coordinates. If NULL the + * barrier for the specified window will be destroyed. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_GetWindowMouseRect + * \sa SDL_SetWindowMouseGrab + */ +extern DECLSPEC int SDLCALL SDL_SetWindowMouseRect(SDL_Window * window, const SDL_Rect * rect); + +/** + * Get the mouse confinement rectangle of a window. + * + * \param window The window to query + * \returns A pointer to the mouse confinement rectangle of a window, or NULL + * if there isn't one. + * + * \since This function is available since SDL 2.0.18. + * + * \sa SDL_SetWindowMouseRect + */ +extern DECLSPEC const SDL_Rect * SDLCALL SDL_GetWindowMouseRect(SDL_Window * window); + +/** + * Set the brightness (gamma multiplier) for a given window's display. + * + * Despite the name and signature, this method sets the brightness of the + * entire display, not an individual window. A window is considered to be + * owned by the display that contains the window's center pixel. (The index of + * this display can be retrieved using SDL_GetWindowDisplayIndex().) The + * brightness set will not follow the window if it is moved to another + * display. + * + * Many platforms will refuse to set the display brightness in modern times. + * You are better off using a shader to adjust gamma during rendering, or + * something similar. + * + * \param window the window used to select the display whose brightness will + * be changed + * \param brightness the brightness (gamma multiplier) value to set where 0.0 + * is completely dark and 1.0 is normal brightness + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowBrightness + * \sa SDL_SetWindowGammaRamp + */ +extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness); + +/** + * Get the brightness (gamma multiplier) for a given window's display. + * + * Despite the name and signature, this method retrieves the brightness of the + * entire display, not an individual window. A window is considered to be + * owned by the display that contains the window's center pixel. (The index of + * this display can be retrieved using SDL_GetWindowDisplayIndex().) + * + * \param window the window used to select the display whose brightness will + * be queried + * \returns the brightness for the display where 0.0 is completely dark and + * 1.0 is normal brightness. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetWindowBrightness + */ +extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); + +/** + * Set the opacity for a window. + * + * The parameter `opacity` will be clamped internally between 0.0f + * (transparent) and 1.0f (opaque). + * + * This function also returns -1 if setting the opacity isn't supported. + * + * \param window the window which will be made transparent or opaque + * \param opacity the opacity value (0.0f - transparent, 1.0f - opaque) + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_GetWindowOpacity + */ +extern DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window * window, float opacity); + +/** + * Get the opacity of a window. + * + * If transparency isn't supported on this platform, opacity will be reported + * as 1.0f without error. + * + * The parameter `opacity` is ignored if it is NULL. + * + * This function also returns -1 if an invalid window was provided. + * + * \param window the window to get the current opacity value from + * \param out_opacity the float filled in (0.0f - transparent, 1.0f - opaque) + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_SetWindowOpacity + */ +extern DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity); + +/** + * Set the window as a modal for another window. + * + * \param modal_window the window that should be set modal + * \param parent_window the parent window for the modal window + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + */ +extern DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window); + +/** + * Explicitly set input focus to the window. + * + * You almost certainly want SDL_RaiseWindow() instead of this function. Use + * this with caution, as you might give focus to a window that is completely + * obscured by other windows. + * + * \param window the window that should get the input focus + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.5. + * + * \sa SDL_RaiseWindow + */ +extern DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window * window); + +/** + * Set the gamma ramp for the display that owns a given window. + * + * Set the gamma translation table for the red, green, and blue channels of + * the video hardware. Each table is an array of 256 16-bit quantities, + * representing a mapping between the input and output for that channel. The + * input is the index into the array, and the output is the 16-bit gamma value + * at that index, scaled to the output color precision. + * + * Despite the name and signature, this method sets the gamma ramp of the + * entire display, not an individual window. A window is considered to be + * owned by the display that contains the window's center pixel. (The index of + * this display can be retrieved using SDL_GetWindowDisplayIndex().) The gamma + * ramp set will not follow the window if it is moved to another display. + * + * \param window the window used to select the display whose gamma ramp will + * be changed + * \param red a 256 element array of 16-bit quantities representing the + * translation table for the red channel, or NULL + * \param green a 256 element array of 16-bit quantities representing the + * translation table for the green channel, or NULL + * \param blue a 256 element array of 16-bit quantities representing the + * translation table for the blue channel, or NULL + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GetWindowGammaRamp + */ +extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, + const Uint16 * red, + const Uint16 * green, + const Uint16 * blue); + +/** + * Get the gamma ramp for a given window's display. + * + * Despite the name and signature, this method retrieves the gamma ramp of the + * entire display, not an individual window. A window is considered to be + * owned by the display that contains the window's center pixel. (The index of + * this display can be retrieved using SDL_GetWindowDisplayIndex().) + * + * \param window the window used to select the display whose gamma ramp will + * be queried + * \param red a 256 element array of 16-bit quantities filled in with the + * translation table for the red channel, or NULL + * \param green a 256 element array of 16-bit quantities filled in with the + * translation table for the green channel, or NULL + * \param blue a 256 element array of 16-bit quantities filled in with the + * translation table for the blue channel, or NULL + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_SetWindowGammaRamp + */ +extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, + Uint16 * red, + Uint16 * green, + Uint16 * blue); + +/** + * Possible return values from the SDL_HitTest callback. + * + * \sa SDL_HitTest + */ +typedef enum +{ + SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */ + SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */ + SDL_HITTEST_RESIZE_TOPLEFT, + SDL_HITTEST_RESIZE_TOP, + SDL_HITTEST_RESIZE_TOPRIGHT, + SDL_HITTEST_RESIZE_RIGHT, + SDL_HITTEST_RESIZE_BOTTOMRIGHT, + SDL_HITTEST_RESIZE_BOTTOM, + SDL_HITTEST_RESIZE_BOTTOMLEFT, + SDL_HITTEST_RESIZE_LEFT +} SDL_HitTestResult; + +/** + * Callback used for hit-testing. + * + * \param win the SDL_Window where hit-testing was set on + * \param area an SDL_Point which should be hit-tested + * \param data what was passed as `callback_data` to SDL_SetWindowHitTest() + * \return an SDL_HitTestResult value. + * + * \sa SDL_SetWindowHitTest + */ +typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win, + const SDL_Point *area, + void *data); + +/** + * Provide a callback that decides if a window region has special properties. + * + * Normally windows are dragged and resized by decorations provided by the + * system window manager (a title bar, borders, etc), but for some apps, it + * makes sense to drag them from somewhere else inside the window itself; for + * example, one might have a borderless window that wants to be draggable from + * any part, or simulate its own title bar, etc. + * + * This function lets the app provide a callback that designates pieces of a + * given window as special. This callback is run during event processing if we + * need to tell the OS to treat a region of the window specially; the use of + * this callback is known as "hit testing." + * + * Mouse input may not be delivered to your application if it is within a + * special area; the OS will often apply that input to moving the window or + * resizing the window and not deliver it to the application. + * + * Specifying NULL for a callback disables hit-testing. Hit-testing is + * disabled by default. + * + * Platforms that don't support this functionality will return -1 + * unconditionally, even if you're attempting to disable hit-testing. + * + * Your callback may fire at any time, and its firing does not indicate any + * specific behavior (for example, on Windows, this certainly might fire when + * the OS is deciding whether to drag your window, but it fires for lots of + * other reasons, too, some unrelated to anything you probably care about _and + * when the mouse isn't actually at the location it is testing_). Since this + * can fire at any time, you should try to keep your callback efficient, + * devoid of allocations, etc. + * + * \param window the window to set hit-testing on + * \param callback the function to call when doing a hit-test + * \param callback_data an app-defined void pointer passed to **callback** + * \returns 0 on success or -1 on error (including unsupported); call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.4. + */ +extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window, + SDL_HitTest callback, + void *callback_data); + +/** + * Request a window to demand attention from the user. + * + * \param window the window to be flashed + * \param operation the flash operation + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.16. + */ +extern DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window * window, SDL_FlashOperation operation); + +/** + * Destroy a window. + * + * If `window` is NULL, this function will return immediately after setting + * the SDL error message to "Invalid window". See SDL_GetError(). + * + * \param window the window to destroy + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_CreateWindow + * \sa SDL_CreateWindowFrom + */ +extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); + + +/** + * Check whether the screensaver is currently enabled. + * + * The screensaver is disabled by default since SDL 2.0.2. Before SDL 2.0.2 + * the screensaver was enabled by default. + * + * The default can also be changed using `SDL_HINT_VIDEO_ALLOW_SCREENSAVER`. + * + * \returns SDL_TRUE if the screensaver is enabled, SDL_FALSE if it is + * disabled. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_DisableScreenSaver + * \sa SDL_EnableScreenSaver + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); + +/** + * Allow the screen to be blanked by a screen saver. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_DisableScreenSaver + * \sa SDL_IsScreenSaverEnabled + */ +extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); + +/** + * Prevent the screen from being blanked by a screen saver. + * + * If you disable the screensaver, it is automatically re-enabled when SDL + * quits. + * + * The screensaver is disabled by default since SDL 2.0.2. Before SDL 2.0.2 + * the screensaver was enabled by default. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_EnableScreenSaver + * \sa SDL_IsScreenSaverEnabled + */ +extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); + + +/** + * \name OpenGL support functions + */ +/* @{ */ + +/** + * Dynamically load an OpenGL library. + * + * This should be done after initializing the video driver, but before + * creating any OpenGL windows. If no OpenGL library is loaded, the default + * library will be loaded upon creation of the first OpenGL window. + * + * If you do this, you need to retrieve all of the GL functions used in your + * program from the dynamic library using SDL_GL_GetProcAddress(). + * + * \param path the platform dependent OpenGL library name, or NULL to open the + * default OpenGL library + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_GetProcAddress + * \sa SDL_GL_UnloadLibrary + */ +extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); + +/** + * Get an OpenGL function by name. + * + * If the GL library is loaded at runtime with SDL_GL_LoadLibrary(), then all + * GL functions must be retrieved this way. Usually this is used to retrieve + * function pointers to OpenGL extensions. + * + * There are some quirks to looking up OpenGL functions that require some + * extra care from the application. If you code carefully, you can handle + * these quirks without any platform-specific code, though: + * + * - On Windows, function pointers are specific to the current GL context; + * this means you need to have created a GL context and made it current + * before calling SDL_GL_GetProcAddress(). If you recreate your context or + * create a second context, you should assume that any existing function + * pointers aren't valid to use with it. This is (currently) a + * Windows-specific limitation, and in practice lots of drivers don't suffer + * this limitation, but it is still the way the wgl API is documented to + * work and you should expect crashes if you don't respect it. Store a copy + * of the function pointers that comes and goes with context lifespan. + * - On X11, function pointers returned by this function are valid for any + * context, and can even be looked up before a context is created at all. + * This means that, for at least some common OpenGL implementations, if you + * look up a function that doesn't exist, you'll get a non-NULL result that + * is _NOT_ safe to call. You must always make sure the function is actually + * available for a given GL context before calling it, by checking for the + * existence of the appropriate extension with SDL_GL_ExtensionSupported(), + * or verifying that the version of OpenGL you're using offers the function + * as core functionality. + * - Some OpenGL drivers, on all platforms, *will* return NULL if a function + * isn't supported, but you can't count on this behavior. Check for + * extensions you use, and if you get a NULL anyway, act as if that + * extension wasn't available. This is probably a bug in the driver, but you + * can code defensively for this scenario anyhow. + * - Just because you're on Linux/Unix, don't assume you'll be using X11. + * Next-gen display servers are waiting to replace it, and may or may not + * make the same promises about function pointers. + * - OpenGL function pointers must be declared `APIENTRY` as in the example + * code. This will ensure the proper calling convention is followed on + * platforms where this matters (Win32) thereby avoiding stack corruption. + * + * \param proc the name of an OpenGL function + * \returns a pointer to the named OpenGL function. The returned pointer + * should be cast to the appropriate function signature. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_ExtensionSupported + * \sa SDL_GL_LoadLibrary + * \sa SDL_GL_UnloadLibrary + */ +extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); + +/** + * Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_LoadLibrary + */ +extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); + +/** + * Check if an OpenGL extension is supported for the current context. + * + * This function operates on the current GL context; you must have created a + * context and it must be current before calling this function. Do not assume + * that all contexts you create will have the same set of extensions + * available, or that recreating an existing context will offer the same + * extensions again. + * + * While it's probably not a massive overhead, this function is not an O(1) + * operation. Check the extensions you care about after creating the GL + * context and save that information somewhere instead of calling the function + * every time you need to know. + * + * \param extension the name of the extension to check + * \returns SDL_TRUE if the extension is supported, SDL_FALSE otherwise. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char + *extension); + +/** + * Reset all previously set OpenGL context attributes to their default values. + * + * \since This function is available since SDL 2.0.2. + * + * \sa SDL_GL_GetAttribute + * \sa SDL_GL_SetAttribute + */ +extern DECLSPEC void SDLCALL SDL_GL_ResetAttributes(void); + +/** + * Set an OpenGL window attribute before window creation. + * + * This function sets the OpenGL attribute `attr` to `value`. The requested + * attributes should be set before creating an OpenGL window. You should use + * SDL_GL_GetAttribute() to check the values after creating the OpenGL + * context, since the values obtained can differ from the requested ones. + * + * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to set + * \param value the desired value for the attribute + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_GetAttribute + * \sa SDL_GL_ResetAttributes + */ +extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); + +/** + * Get the actual value for an attribute from the current context. + * + * \param attr an SDL_GLattr enum value specifying the OpenGL attribute to get + * \param value a pointer filled in with the current value of `attr` + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_ResetAttributes + * \sa SDL_GL_SetAttribute + */ +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); + +/** + * Create an OpenGL context for an OpenGL window, and make it current. + * + * Windows users new to OpenGL should note that, for historical reasons, GL + * functions added after OpenGL version 1.1 are not available by default. + * Those functions must be loaded at run-time, either with an OpenGL + * extension-handling library or with SDL_GL_GetProcAddress() and its related + * functions. + * + * SDL_GLContext is an alias for `void *`. It's opaque to the application. + * + * \param window the window to associate with the context + * \returns the OpenGL context associated with `window` or NULL on error; call + * SDL_GetError() for more details. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_DeleteContext + * \sa SDL_GL_MakeCurrent + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * + window); + +/** + * Set up an OpenGL context for rendering into an OpenGL window. + * + * The context must have been created with a compatible window. + * + * \param window the window to associate with the context + * \param context the OpenGL context to associate with the window + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_CreateContext + */ +extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window, + SDL_GLContext context); + +/** + * Get the currently active OpenGL window. + * + * \returns the currently active OpenGL window on success or NULL on failure; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void); + +/** + * Get the currently active OpenGL context. + * + * \returns the currently active OpenGL context or NULL on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_MakeCurrent + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); + +/** + * Get the size of a window's underlying drawable in pixels. + * + * This returns info useful for calling glViewport(). + * + * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI + * drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a + * platform with high-DPI support (Apple calls this "Retina"), and not + * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. + * + * \param window the window from which the drawable size should be queried + * \param w a pointer to variable for storing the width in pixels, may be NULL + * \param h a pointer to variable for storing the height in pixels, may be + * NULL + * + * \since This function is available since SDL 2.0.1. + * + * \sa SDL_CreateWindow + * \sa SDL_GetWindowSize + */ +extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, + int *h); + +/** + * Set the swap interval for the current OpenGL context. + * + * Some systems allow specifying -1 for the interval, to enable adaptive + * vsync. Adaptive vsync works the same as vsync, but if you've already missed + * the vertical retrace for a given frame, it swaps buffers immediately, which + * might be less jarring for the user during occasional framerate drops. If an + * application requests adaptive vsync and the system does not support it, + * this function will fail and return -1. In such a case, you should probably + * retry the call with 1 for the interval. + * + * Adaptive vsync is implemented for some glX drivers with + * GLX_EXT_swap_control_tear, and for some Windows drivers with + * WGL_EXT_swap_control_tear. + * + * Read more on the Khronos wiki: + * https://www.khronos.org/opengl/wiki/Swap_Interval#Adaptive_Vsync + * + * \param interval 0 for immediate updates, 1 for updates synchronized with + * the vertical retrace, -1 for adaptive vsync + * \returns 0 on success or -1 if setting the swap interval is not supported; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_GetSwapInterval + */ +extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); + +/** + * Get the swap interval for the current OpenGL context. + * + * If the system can't determine the swap interval, or there isn't a valid + * current context, this function will return 0 as a safe default. + * + * \returns 0 if there is no vertical retrace synchronization, 1 if the buffer + * swap is synchronized with the vertical retrace, and -1 if late + * swaps happen immediately instead of waiting for the next retrace; + * call SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_SetSwapInterval + */ +extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); + +/** + * Update a window with OpenGL rendering. + * + * This is used with double-buffered OpenGL contexts, which are the default. + * + * On macOS, make sure you bind 0 to the draw framebuffer before swapping the + * window, otherwise nothing will happen. If you aren't using + * glBindFramebuffer(), this is the default and you won't have to do anything + * extra. + * + * \param window the window to change + * + * \since This function is available since SDL 2.0.0. + */ +extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); + +/** + * Delete an OpenGL context. + * + * \param context the OpenGL context to be deleted + * + * \since This function is available since SDL 2.0.0. + * + * \sa SDL_GL_CreateContext + */ +extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); + +/* @} *//* OpenGL support functions */ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_video_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_vulkan.h b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_vulkan.h new file mode 100644 index 00000000..cca130b5 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/SDL_vulkan.h @@ -0,0 +1,215 @@ +/* + Simple DirectMedia Layer + Copyright (C) 2017, Mark Callow + + 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. +*/ + +/** + * \file SDL_vulkan.h + * + * Header file for functions to creating Vulkan surfaces on SDL windows. + */ + +#ifndef SDL_vulkan_h_ +#define SDL_vulkan_h_ + +#include + +#include +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Avoid including vulkan.h, don't define VkInstance if it's already included */ +#ifdef VULKAN_H_ +#define NO_SDL_VULKAN_TYPEDEFS +#endif +#ifndef NO_SDL_VULKAN_TYPEDEFS +#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; + +#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; +#else +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; +#endif + +VK_DEFINE_HANDLE(VkInstance) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) + +#endif /* !NO_SDL_VULKAN_TYPEDEFS */ + +typedef VkInstance SDL_vulkanInstance; +typedef VkSurfaceKHR SDL_vulkanSurface; /* for compatibility with Tizen */ + +/** + * \name Vulkan support functions + * + * \note SDL_Vulkan_GetInstanceExtensions & SDL_Vulkan_CreateSurface API + * is compatable with Tizen's implementation of Vulkan in SDL. + */ +/* @{ */ + +/** + * Dynamically load the Vulkan loader library. + * + * This should be called after initializing the video driver, but before + * creating any Vulkan windows. If no Vulkan loader library is loaded, the + * default library will be loaded upon creation of the first Vulkan window. + * + * It is fairly common for Vulkan applications to link with libvulkan instead + * of explicitly loading it at run time. This will work with SDL provided the + * application links to a dynamic library and both it and SDL use the same + * search path. + * + * If you specify a non-NULL `path`, an application should retrieve all of the + * Vulkan functions it uses from the dynamic library using + * SDL_Vulkan_GetVkGetInstanceProcAddr unless you can guarantee `path` points + * to the same vulkan loader library the application linked to. + * + * On Apple devices, if `path` is NULL, SDL will attempt to find the + * `vkGetInstanceProcAddr` address within all the Mach-O images of the current + * process. This is because it is fairly common for Vulkan applications to + * link with libvulkan (and historically MoltenVK was provided as a static + * library). If it is not found, on macOS, SDL will attempt to load + * `vulkan.framework/vulkan`, `libvulkan.1.dylib`, + * `MoltenVK.framework/MoltenVK`, and `libMoltenVK.dylib`, in that order. On + * iOS, SDL will attempt to load `libMoltenVK.dylib`. Applications using a + * dynamic framework or .dylib must ensure it is included in its application + * bundle. + * + * On non-Apple devices, application linking with a static libvulkan is not + * supported. Either do not link to the Vulkan loader or link to a dynamic + * library version. + * + * \param path The platform dependent Vulkan loader library name or NULL + * \returns 0 on success or -1 if the library couldn't be loaded; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 2.0.6. + * + * \sa SDL_Vulkan_GetVkInstanceProcAddr + * \sa SDL_Vulkan_UnloadLibrary + */ +extern DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path); + +/** + * Get the address of the `vkGetInstanceProcAddr` function. + * + * This should be called after either calling SDL_Vulkan_LoadLibrary() or + * creating an SDL_Window with the `SDL_WINDOW_VULKAN` flag. + * + * \returns the function pointer for `vkGetInstanceProcAddr` or NULL on error. + * + * \since This function is available since SDL 2.0.6. + */ +extern DECLSPEC void *SDLCALL SDL_Vulkan_GetVkGetInstanceProcAddr(void); + +/** + * Unload the Vulkan library previously loaded by SDL_Vulkan_LoadLibrary() + * + * \since This function is available since SDL 2.0.6. + * + * \sa SDL_Vulkan_LoadLibrary + */ +extern DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); + +/** + * Get the names of the Vulkan instance extensions needed to create a surface + * with SDL_Vulkan_CreateSurface. + * + * If `pNames` is NULL, then the number of required Vulkan instance extensions + * is returned in `pCount`. Otherwise, `pCount` must point to a variable set + * to the number of elements in the `pNames` array, and on return the variable + * is overwritten with the number of names actually written to `pNames`. If + * `pCount` is less than the number of required extensions, at most `pCount` + * structures will be written. If `pCount` is smaller than the number of + * required extensions, SDL_FALSE will be returned instead of SDL_TRUE, to + * indicate that not all the required extensions were returned. + * + * The `window` parameter is currently needed to be valid as of SDL 2.0.8, + * however, this parameter will likely be removed in future releases + * + * \param window A window for which the required Vulkan instance extensions + * should be retrieved (will be deprecated in a future release) + * \param pCount A pointer to an unsigned int corresponding to the number of + * extensions to be returned + * \param pNames NULL or a pointer to an array to be filled with required + * Vulkan instance extensions + * \returns SDL_TRUE on success, SDL_FALSE on error. + * + * \since This function is available since SDL 2.0.6. + * + * \sa SDL_Vulkan_CreateSurface + */ +extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetInstanceExtensions(SDL_Window *window, + unsigned int *pCount, + const char **pNames); + +/** + * Create a Vulkan rendering surface for a window. + * + * The `window` must have been created with the `SDL_WINDOW_VULKAN` flag and + * `instance` must have been created with extensions returned by + * SDL_Vulkan_GetInstanceExtensions() enabled. + * + * \param window The window to which to attach the Vulkan surface + * \param instance The Vulkan instance handle + * \param surface A pointer to a VkSurfaceKHR handle to output the newly + * created surface + * \returns SDL_TRUE on success, SDL_FALSE on error. + * + * \since This function is available since SDL 2.0.6. + * + * \sa SDL_Vulkan_GetInstanceExtensions + * \sa SDL_Vulkan_GetDrawableSize + */ +extern DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, + VkInstance instance, + VkSurfaceKHR* surface); + +/** + * Get the size of the window's underlying drawable dimensions in pixels. + * + * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI + * drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a + * platform with high-DPI support (Apple calls this "Retina"), and not + * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint. + * + * \param window an SDL_Window for which the size is to be queried + * \param w Pointer to the variable to write the width to or NULL + * \param h Pointer to the variable to write the height to or NULL + * + * \since This function is available since SDL 2.0.6. + * + * \sa SDL_GetWindowSize + * \sa SDL_CreateWindow + * \sa SDL_Vulkan_CreateSurface + */ +extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window * window, + int *w, int *h); + +/* @} *//* Vulkan support functions */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include + +#endif /* SDL_vulkan_h_ */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/begin_code.h b/bindings/sdl2wgpu/src/main/headers/SDL2/begin_code.h new file mode 100644 index 00000000..4142ffeb --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/begin_code.h @@ -0,0 +1,187 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file begin_code.h + * + * This file sets things up for C dynamic library function definitions, + * static inlined functions, and structures aligned at 4-byte alignment. + * If you don't like ugly C preprocessor code, don't look at this file. :) + */ + +/* This shouldn't be nested -- included it around code only. */ +#ifdef SDL_begin_code_h +#error Nested inclusion of begin_code.h +#endif +#define SDL_begin_code_h + +#ifndef SDL_DEPRECATED +# if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ +# define SDL_DEPRECATED __attribute__((deprecated)) +# else +# define SDL_DEPRECATED +# endif +#endif + +#ifndef SDL_UNUSED +# ifdef __GNUC__ +# define SDL_UNUSED __attribute__((unused)) +# else +# define SDL_UNUSED +# endif +#endif + +/* Some compilers use a special export keyword */ +#ifndef DECLSPEC +# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__) +# ifdef DLL_EXPORT +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC +# endif +# elif defined(__OS2__) +# ifdef BUILD_SDL +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC +# endif +# else +# if defined(__GNUC__) && __GNUC__ >= 4 +# define DECLSPEC __attribute__ ((visibility("default"))) +# else +# define DECLSPEC +# endif +# endif +#endif + +/* By default SDL uses the C calling convention */ +#ifndef SDLCALL +#if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__) +#define SDLCALL __cdecl +#elif defined(__OS2__) || defined(__EMX__) +#define SDLCALL _System +# if defined (__GNUC__) && !defined(_System) +# define _System /* for old EMX/GCC compat. */ +# endif +#else +#define SDLCALL +#endif +#endif /* SDLCALL */ + +/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ +#ifdef __SYMBIAN32__ +#undef DECLSPEC +#define DECLSPEC +#endif /* __SYMBIAN32__ */ + +/* Force structure packing at 4 byte alignment. + This is necessary if the header is included in code which has structure + packing set to an alternate value, say for loading structures from disk. + The packing is reset to the previous value in close_code.h + */ +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) +#ifdef _MSC_VER +#pragma warning(disable: 4103) +#endif +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wpragma-pack" +#endif +#ifdef __BORLANDC__ +#pragma nopackwarning +#endif +#ifdef _WIN64 +/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ +#pragma pack(push,8) +#else +#pragma pack(push,4) +#endif +#endif /* Compiler needs structure packing set */ + +#ifndef SDL_INLINE +#if defined(__GNUC__) +#define SDL_INLINE __inline__ +#elif defined(_MSC_VER) || defined(__BORLANDC__) || \ + defined(__DMC__) || defined(__SC__) || \ + defined(__WATCOMC__) || defined(__LCC__) || \ + defined(__DECC) || defined(__CC_ARM) +#define SDL_INLINE __inline +#ifndef __inline__ +#define __inline__ __inline +#endif +#else +#define SDL_INLINE inline +#ifndef __inline__ +#define __inline__ inline +#endif +#endif +#endif /* SDL_INLINE not defined */ + +#ifndef SDL_FORCE_INLINE +#if defined(_MSC_VER) +#define SDL_FORCE_INLINE __forceinline +#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) +#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ +#else +#define SDL_FORCE_INLINE static SDL_INLINE +#endif +#endif /* SDL_FORCE_INLINE not defined */ + +#ifndef SDL_NORETURN +#if defined(__GNUC__) +#define SDL_NORETURN __attribute__((noreturn)) +#elif defined(_MSC_VER) +#define SDL_NORETURN __declspec(noreturn) +#else +#define SDL_NORETURN +#endif +#endif /* SDL_NORETURN not defined */ + +/* Apparently this is needed by several Windows compilers */ +#if !defined(__MACH__) +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif /* NULL */ +#endif /* ! Mac OS X - breaks precompiled headers */ + +#ifndef SDL_FALLTHROUGH +#if (defined(__cplusplus) && __cplusplus >= 201703L) || \ + (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L) +#define SDL_FALLTHROUGH [[fallthrough]] +#else +#if defined(__has_attribute) +#define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__) +#else +#define SDL_HAS_FALLTHROUGH 0 +#endif /* __has_attribute */ +#if SDL_HAS_FALLTHROUGH && \ + ((defined(__GNUC__) && __GNUC__ >= 7) || \ + (defined(__clang_major__) && __clang_major__ >= 10)) +#define SDL_FALLTHROUGH __attribute__((__fallthrough__)) +#else +#define SDL_FALLTHROUGH do {} while (0) /* fallthrough */ +#endif /* SDL_HAS_FALLTHROUGH */ +#undef SDL_HAS_FALLTHROUGH +#endif /* C++17 or C2x */ +#endif /* SDL_FALLTHROUGH not defined */ diff --git a/bindings/sdl2wgpu/src/main/headers/SDL2/close_code.h b/bindings/sdl2wgpu/src/main/headers/SDL2/close_code.h new file mode 100644 index 00000000..b5ff3e20 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/SDL2/close_code.h @@ -0,0 +1,40 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2023 Sam Lantinga + + 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. +*/ + +/** + * \file close_code.h + * + * This file reverses the effects of begin_code.h and should be included + * after you finish any function and structure declarations in your headers + */ + +#ifndef SDL_begin_code_h +#error close_code.h included without matching begin_code.h +#endif +#undef SDL_begin_code_h + +/* Reset structure packing at previous byte alignment */ +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) +#ifdef __BORLANDC__ +#pragma nopackwarning +#endif +#pragma pack(pop) +#endif /* Compiler needs structure packing set */ diff --git a/bindings/sdl2wgpu/src/main/headers/webgpu/webgpu.h b/bindings/sdl2wgpu/src/main/headers/webgpu/webgpu.h new file mode 100644 index 00000000..d2533513 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/webgpu/webgpu.h @@ -0,0 +1,1806 @@ +// BSD 3-Clause License +// +// Copyright (c) 2019, "WebGPU native" developers +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#ifndef WEBGPU_H_ +#define WEBGPU_H_ + +#if defined(WGPU_SHARED_LIBRARY) +# if defined(_WIN32) +# if defined(WGPU_IMPLEMENTATION) +# define WGPU_EXPORT __declspec(dllexport) +# else +# define WGPU_EXPORT __declspec(dllimport) +# endif +# else // defined(_WIN32) +# if defined(WGPU_IMPLEMENTATION) +# define WGPU_EXPORT __attribute__((visibility("default"))) +# else +# define WGPU_EXPORT +# endif +# endif // defined(_WIN32) +#else // defined(WGPU_SHARED_LIBRARY) +# define WGPU_EXPORT +#endif // defined(WGPU_SHARED_LIBRARY) + +#if !defined(WGPU_OBJECT_ATTRIBUTE) +#define WGPU_OBJECT_ATTRIBUTE +#endif +#if !defined(WGPU_ENUM_ATTRIBUTE) +#define WGPU_ENUM_ATTRIBUTE +#endif +#if !defined(WGPU_STRUCTURE_ATTRIBUTE) +#define WGPU_STRUCTURE_ATTRIBUTE +#endif +#if !defined(WGPU_FUNCTION_ATTRIBUTE) +#define WGPU_FUNCTION_ATTRIBUTE +#endif +#if !defined(WGPU_NULLABLE) +#define WGPU_NULLABLE +#endif + +#include +#include + +#define WGPU_ARRAY_LAYER_COUNT_UNDEFINED (0xffffffffUL) +#define WGPU_COPY_STRIDE_UNDEFINED (0xffffffffUL) +#define WGPU_LIMIT_U32_UNDEFINED (0xffffffffUL) +#define WGPU_LIMIT_U64_UNDEFINED (0xffffffffffffffffULL) +#define WGPU_MIP_LEVEL_COUNT_UNDEFINED (0xffffffffUL) +#define WGPU_QUERY_SET_INDEX_UNDEFINED (0xffffffffUL) +#define WGPU_WHOLE_MAP_SIZE SIZE_MAX +#define WGPU_WHOLE_SIZE (0xffffffffffffffffULL) + +typedef uint32_t WGPUFlags; +typedef uint32_t WGPUBool; + +typedef struct WGPUAdapterImpl* WGPUAdapter WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUBindGroupImpl* WGPUBindGroup WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUBindGroupLayoutImpl* WGPUBindGroupLayout WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUBufferImpl* WGPUBuffer WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUCommandBufferImpl* WGPUCommandBuffer WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUCommandEncoderImpl* WGPUCommandEncoder WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUComputePassEncoderImpl* WGPUComputePassEncoder WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUComputePipelineImpl* WGPUComputePipeline WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUDeviceImpl* WGPUDevice WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUInstanceImpl* WGPUInstance WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUPipelineLayoutImpl* WGPUPipelineLayout WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUQuerySetImpl* WGPUQuerySet WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUQueueImpl* WGPUQueue WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPURenderBundleImpl* WGPURenderBundle WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPURenderBundleEncoderImpl* WGPURenderBundleEncoder WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPURenderPassEncoderImpl* WGPURenderPassEncoder WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPURenderPipelineImpl* WGPURenderPipeline WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUSamplerImpl* WGPUSampler WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUShaderModuleImpl* WGPUShaderModule WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUSurfaceImpl* WGPUSurface WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUTextureImpl* WGPUTexture WGPU_OBJECT_ATTRIBUTE; +typedef struct WGPUTextureViewImpl* WGPUTextureView WGPU_OBJECT_ATTRIBUTE; + +// Structure forward declarations +struct WGPUAdapterProperties; +struct WGPUBindGroupEntry; +struct WGPUBlendComponent; +struct WGPUBufferBindingLayout; +struct WGPUBufferDescriptor; +struct WGPUColor; +struct WGPUCommandBufferDescriptor; +struct WGPUCommandEncoderDescriptor; +struct WGPUCompilationMessage; +struct WGPUComputePassTimestampWrites; +struct WGPUConstantEntry; +struct WGPUExtent3D; +struct WGPUInstanceDescriptor; +struct WGPULimits; +struct WGPUMultisampleState; +struct WGPUOrigin3D; +struct WGPUPipelineLayoutDescriptor; +struct WGPUPrimitiveDepthClipControl; +struct WGPUPrimitiveState; +struct WGPUQuerySetDescriptor; +struct WGPUQueueDescriptor; +struct WGPURenderBundleDescriptor; +struct WGPURenderBundleEncoderDescriptor; +struct WGPURenderPassDepthStencilAttachment; +struct WGPURenderPassDescriptorMaxDrawCount; +struct WGPURenderPassTimestampWrites; +struct WGPURequestAdapterOptions; +struct WGPUSamplerBindingLayout; +struct WGPUSamplerDescriptor; +struct WGPUShaderModuleCompilationHint; +struct WGPUShaderModuleSPIRVDescriptor; +struct WGPUShaderModuleWGSLDescriptor; +struct WGPUStencilFaceState; +struct WGPUStorageTextureBindingLayout; +struct WGPUSurfaceCapabilities; +struct WGPUSurfaceConfiguration; +struct WGPUSurfaceDescriptor; +struct WGPUSurfaceDescriptorFromAndroidNativeWindow; +struct WGPUSurfaceDescriptorFromCanvasHTMLSelector; +struct WGPUSurfaceDescriptorFromMetalLayer; +struct WGPUSurfaceDescriptorFromWaylandSurface; +struct WGPUSurfaceDescriptorFromWindowsHWND; +struct WGPUSurfaceDescriptorFromXcbWindow; +struct WGPUSurfaceDescriptorFromXlibWindow; +struct WGPUSurfaceTexture; +struct WGPUTextureBindingLayout; +struct WGPUTextureDataLayout; +struct WGPUTextureViewDescriptor; +struct WGPUVertexAttribute; +struct WGPUBindGroupDescriptor; +struct WGPUBindGroupLayoutEntry; +struct WGPUBlendState; +struct WGPUCompilationInfo; +struct WGPUComputePassDescriptor; +struct WGPUDepthStencilState; +struct WGPUImageCopyBuffer; +struct WGPUImageCopyTexture; +struct WGPUProgrammableStageDescriptor; +struct WGPURenderPassColorAttachment; +struct WGPURequiredLimits; +struct WGPUShaderModuleDescriptor; +struct WGPUSupportedLimits; +struct WGPUTextureDescriptor; +struct WGPUVertexBufferLayout; +struct WGPUBindGroupLayoutDescriptor; +struct WGPUColorTargetState; +struct WGPUComputePipelineDescriptor; +struct WGPUDeviceDescriptor; +struct WGPURenderPassDescriptor; +struct WGPUVertexState; +struct WGPUFragmentState; +struct WGPURenderPipelineDescriptor; + +typedef enum WGPUAdapterType { + WGPUAdapterType_DiscreteGPU = 0x00000000, + WGPUAdapterType_IntegratedGPU = 0x00000001, + WGPUAdapterType_CPU = 0x00000002, + WGPUAdapterType_Unknown = 0x00000003, + WGPUAdapterType_Force32 = 0x7FFFFFFF +} WGPUAdapterType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUAddressMode { + WGPUAddressMode_Repeat = 0x00000000, + WGPUAddressMode_MirrorRepeat = 0x00000001, + WGPUAddressMode_ClampToEdge = 0x00000002, + WGPUAddressMode_Force32 = 0x7FFFFFFF +} WGPUAddressMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUBackendType { + WGPUBackendType_Undefined = 0x00000000, + WGPUBackendType_Null = 0x00000001, + WGPUBackendType_WebGPU = 0x00000002, + WGPUBackendType_D3D11 = 0x00000003, + WGPUBackendType_D3D12 = 0x00000004, + WGPUBackendType_Metal = 0x00000005, + WGPUBackendType_Vulkan = 0x00000006, + WGPUBackendType_OpenGL = 0x00000007, + WGPUBackendType_OpenGLES = 0x00000008, + WGPUBackendType_Force32 = 0x7FFFFFFF +} WGPUBackendType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUBlendFactor { + WGPUBlendFactor_Zero = 0x00000000, + WGPUBlendFactor_One = 0x00000001, + WGPUBlendFactor_Src = 0x00000002, + WGPUBlendFactor_OneMinusSrc = 0x00000003, + WGPUBlendFactor_SrcAlpha = 0x00000004, + WGPUBlendFactor_OneMinusSrcAlpha = 0x00000005, + WGPUBlendFactor_Dst = 0x00000006, + WGPUBlendFactor_OneMinusDst = 0x00000007, + WGPUBlendFactor_DstAlpha = 0x00000008, + WGPUBlendFactor_OneMinusDstAlpha = 0x00000009, + WGPUBlendFactor_SrcAlphaSaturated = 0x0000000A, + WGPUBlendFactor_Constant = 0x0000000B, + WGPUBlendFactor_OneMinusConstant = 0x0000000C, + WGPUBlendFactor_Force32 = 0x7FFFFFFF +} WGPUBlendFactor WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUBlendOperation { + WGPUBlendOperation_Add = 0x00000000, + WGPUBlendOperation_Subtract = 0x00000001, + WGPUBlendOperation_ReverseSubtract = 0x00000002, + WGPUBlendOperation_Min = 0x00000003, + WGPUBlendOperation_Max = 0x00000004, + WGPUBlendOperation_Force32 = 0x7FFFFFFF +} WGPUBlendOperation WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUBufferBindingType { + WGPUBufferBindingType_Undefined = 0x00000000, + WGPUBufferBindingType_Uniform = 0x00000001, + WGPUBufferBindingType_Storage = 0x00000002, + WGPUBufferBindingType_ReadOnlyStorage = 0x00000003, + WGPUBufferBindingType_Force32 = 0x7FFFFFFF +} WGPUBufferBindingType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUBufferMapAsyncStatus { + WGPUBufferMapAsyncStatus_Success = 0x00000000, + WGPUBufferMapAsyncStatus_ValidationError = 0x00000001, + WGPUBufferMapAsyncStatus_Unknown = 0x00000002, + WGPUBufferMapAsyncStatus_DeviceLost = 0x00000003, + WGPUBufferMapAsyncStatus_DestroyedBeforeCallback = 0x00000004, + WGPUBufferMapAsyncStatus_UnmappedBeforeCallback = 0x00000005, + WGPUBufferMapAsyncStatus_MappingAlreadyPending = 0x00000006, + WGPUBufferMapAsyncStatus_OffsetOutOfRange = 0x00000007, + WGPUBufferMapAsyncStatus_SizeOutOfRange = 0x00000008, + WGPUBufferMapAsyncStatus_Force32 = 0x7FFFFFFF +} WGPUBufferMapAsyncStatus WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUBufferMapState { + WGPUBufferMapState_Unmapped = 0x00000000, + WGPUBufferMapState_Pending = 0x00000001, + WGPUBufferMapState_Mapped = 0x00000002, + WGPUBufferMapState_Force32 = 0x7FFFFFFF +} WGPUBufferMapState WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUCompareFunction { + WGPUCompareFunction_Undefined = 0x00000000, + WGPUCompareFunction_Never = 0x00000001, + WGPUCompareFunction_Less = 0x00000002, + WGPUCompareFunction_LessEqual = 0x00000003, + WGPUCompareFunction_Greater = 0x00000004, + WGPUCompareFunction_GreaterEqual = 0x00000005, + WGPUCompareFunction_Equal = 0x00000006, + WGPUCompareFunction_NotEqual = 0x00000007, + WGPUCompareFunction_Always = 0x00000008, + WGPUCompareFunction_Force32 = 0x7FFFFFFF +} WGPUCompareFunction WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUCompilationInfoRequestStatus { + WGPUCompilationInfoRequestStatus_Success = 0x00000000, + WGPUCompilationInfoRequestStatus_Error = 0x00000001, + WGPUCompilationInfoRequestStatus_DeviceLost = 0x00000002, + WGPUCompilationInfoRequestStatus_Unknown = 0x00000003, + WGPUCompilationInfoRequestStatus_Force32 = 0x7FFFFFFF +} WGPUCompilationInfoRequestStatus WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUCompilationMessageType { + WGPUCompilationMessageType_Error = 0x00000000, + WGPUCompilationMessageType_Warning = 0x00000001, + WGPUCompilationMessageType_Info = 0x00000002, + WGPUCompilationMessageType_Force32 = 0x7FFFFFFF +} WGPUCompilationMessageType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUCompositeAlphaMode { + WGPUCompositeAlphaMode_Auto = 0x00000000, + WGPUCompositeAlphaMode_Opaque = 0x00000001, + WGPUCompositeAlphaMode_Premultiplied = 0x00000002, + WGPUCompositeAlphaMode_Unpremultiplied = 0x00000003, + WGPUCompositeAlphaMode_Inherit = 0x00000004, + WGPUCompositeAlphaMode_Force32 = 0x7FFFFFFF +} WGPUCompositeAlphaMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUCreatePipelineAsyncStatus { + WGPUCreatePipelineAsyncStatus_Success = 0x00000000, + WGPUCreatePipelineAsyncStatus_ValidationError = 0x00000001, + WGPUCreatePipelineAsyncStatus_InternalError = 0x00000002, + WGPUCreatePipelineAsyncStatus_DeviceLost = 0x00000003, + WGPUCreatePipelineAsyncStatus_DeviceDestroyed = 0x00000004, + WGPUCreatePipelineAsyncStatus_Unknown = 0x00000005, + WGPUCreatePipelineAsyncStatus_Force32 = 0x7FFFFFFF +} WGPUCreatePipelineAsyncStatus WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUCullMode { + WGPUCullMode_None = 0x00000000, + WGPUCullMode_Front = 0x00000001, + WGPUCullMode_Back = 0x00000002, + WGPUCullMode_Force32 = 0x7FFFFFFF +} WGPUCullMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUDeviceLostReason { + WGPUDeviceLostReason_Undefined = 0x00000000, + WGPUDeviceLostReason_Destroyed = 0x00000001, + WGPUDeviceLostReason_Force32 = 0x7FFFFFFF +} WGPUDeviceLostReason WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUErrorFilter { + WGPUErrorFilter_Validation = 0x00000000, + WGPUErrorFilter_OutOfMemory = 0x00000001, + WGPUErrorFilter_Internal = 0x00000002, + WGPUErrorFilter_Force32 = 0x7FFFFFFF +} WGPUErrorFilter WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUErrorType { + WGPUErrorType_NoError = 0x00000000, + WGPUErrorType_Validation = 0x00000001, + WGPUErrorType_OutOfMemory = 0x00000002, + WGPUErrorType_Internal = 0x00000003, + WGPUErrorType_Unknown = 0x00000004, + WGPUErrorType_DeviceLost = 0x00000005, + WGPUErrorType_Force32 = 0x7FFFFFFF +} WGPUErrorType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUFeatureName { + WGPUFeatureName_Undefined = 0x00000000, + WGPUFeatureName_DepthClipControl = 0x00000001, + WGPUFeatureName_Depth32FloatStencil8 = 0x00000002, + WGPUFeatureName_TimestampQuery = 0x00000003, + WGPUFeatureName_TextureCompressionBC = 0x00000004, + WGPUFeatureName_TextureCompressionETC2 = 0x00000005, + WGPUFeatureName_TextureCompressionASTC = 0x00000006, + WGPUFeatureName_IndirectFirstInstance = 0x00000007, + WGPUFeatureName_ShaderF16 = 0x00000008, + WGPUFeatureName_RG11B10UfloatRenderable = 0x00000009, + WGPUFeatureName_BGRA8UnormStorage = 0x0000000A, + WGPUFeatureName_Float32Filterable = 0x0000000B, + WGPUFeatureName_Force32 = 0x7FFFFFFF +} WGPUFeatureName WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUFilterMode { + WGPUFilterMode_Nearest = 0x00000000, + WGPUFilterMode_Linear = 0x00000001, + WGPUFilterMode_Force32 = 0x7FFFFFFF +} WGPUFilterMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUFrontFace { + WGPUFrontFace_CCW = 0x00000000, + WGPUFrontFace_CW = 0x00000001, + WGPUFrontFace_Force32 = 0x7FFFFFFF +} WGPUFrontFace WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUIndexFormat { + WGPUIndexFormat_Undefined = 0x00000000, + WGPUIndexFormat_Uint16 = 0x00000001, + WGPUIndexFormat_Uint32 = 0x00000002, + WGPUIndexFormat_Force32 = 0x7FFFFFFF +} WGPUIndexFormat WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPULoadOp { + WGPULoadOp_Undefined = 0x00000000, + WGPULoadOp_Clear = 0x00000001, + WGPULoadOp_Load = 0x00000002, + WGPULoadOp_Force32 = 0x7FFFFFFF +} WGPULoadOp WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUMipmapFilterMode { + WGPUMipmapFilterMode_Nearest = 0x00000000, + WGPUMipmapFilterMode_Linear = 0x00000001, + WGPUMipmapFilterMode_Force32 = 0x7FFFFFFF +} WGPUMipmapFilterMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUPowerPreference { + WGPUPowerPreference_Undefined = 0x00000000, + WGPUPowerPreference_LowPower = 0x00000001, + WGPUPowerPreference_HighPerformance = 0x00000002, + WGPUPowerPreference_Force32 = 0x7FFFFFFF +} WGPUPowerPreference WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUPresentMode { + WGPUPresentMode_Fifo = 0x00000000, + WGPUPresentMode_FifoRelaxed = 0x00000001, + WGPUPresentMode_Immediate = 0x00000002, + WGPUPresentMode_Mailbox = 0x00000003, + WGPUPresentMode_Force32 = 0x7FFFFFFF +} WGPUPresentMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUPrimitiveTopology { + WGPUPrimitiveTopology_PointList = 0x00000000, + WGPUPrimitiveTopology_LineList = 0x00000001, + WGPUPrimitiveTopology_LineStrip = 0x00000002, + WGPUPrimitiveTopology_TriangleList = 0x00000003, + WGPUPrimitiveTopology_TriangleStrip = 0x00000004, + WGPUPrimitiveTopology_Force32 = 0x7FFFFFFF +} WGPUPrimitiveTopology WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUQueryType { + WGPUQueryType_Occlusion = 0x00000000, + WGPUQueryType_Timestamp = 0x00000001, + WGPUQueryType_Force32 = 0x7FFFFFFF +} WGPUQueryType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUQueueWorkDoneStatus { + WGPUQueueWorkDoneStatus_Success = 0x00000000, + WGPUQueueWorkDoneStatus_Error = 0x00000001, + WGPUQueueWorkDoneStatus_Unknown = 0x00000002, + WGPUQueueWorkDoneStatus_DeviceLost = 0x00000003, + WGPUQueueWorkDoneStatus_Force32 = 0x7FFFFFFF +} WGPUQueueWorkDoneStatus WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPURequestAdapterStatus { + WGPURequestAdapterStatus_Success = 0x00000000, + WGPURequestAdapterStatus_Unavailable = 0x00000001, + WGPURequestAdapterStatus_Error = 0x00000002, + WGPURequestAdapterStatus_Unknown = 0x00000003, + WGPURequestAdapterStatus_Force32 = 0x7FFFFFFF +} WGPURequestAdapterStatus WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPURequestDeviceStatus { + WGPURequestDeviceStatus_Success = 0x00000000, + WGPURequestDeviceStatus_Error = 0x00000001, + WGPURequestDeviceStatus_Unknown = 0x00000002, + WGPURequestDeviceStatus_Force32 = 0x7FFFFFFF +} WGPURequestDeviceStatus WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUSType { + WGPUSType_Invalid = 0x00000000, + WGPUSType_SurfaceDescriptorFromMetalLayer = 0x00000001, + WGPUSType_SurfaceDescriptorFromWindowsHWND = 0x00000002, + WGPUSType_SurfaceDescriptorFromXlibWindow = 0x00000003, + WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector = 0x00000004, + WGPUSType_ShaderModuleSPIRVDescriptor = 0x00000005, + WGPUSType_ShaderModuleWGSLDescriptor = 0x00000006, + WGPUSType_PrimitiveDepthClipControl = 0x00000007, + WGPUSType_SurfaceDescriptorFromWaylandSurface = 0x00000008, + WGPUSType_SurfaceDescriptorFromAndroidNativeWindow = 0x00000009, + WGPUSType_SurfaceDescriptorFromXcbWindow = 0x0000000A, + WGPUSType_RenderPassDescriptorMaxDrawCount = 0x0000000F, + WGPUSType_Force32 = 0x7FFFFFFF +} WGPUSType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUSamplerBindingType { + WGPUSamplerBindingType_Undefined = 0x00000000, + WGPUSamplerBindingType_Filtering = 0x00000001, + WGPUSamplerBindingType_NonFiltering = 0x00000002, + WGPUSamplerBindingType_Comparison = 0x00000003, + WGPUSamplerBindingType_Force32 = 0x7FFFFFFF +} WGPUSamplerBindingType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUStencilOperation { + WGPUStencilOperation_Keep = 0x00000000, + WGPUStencilOperation_Zero = 0x00000001, + WGPUStencilOperation_Replace = 0x00000002, + WGPUStencilOperation_Invert = 0x00000003, + WGPUStencilOperation_IncrementClamp = 0x00000004, + WGPUStencilOperation_DecrementClamp = 0x00000005, + WGPUStencilOperation_IncrementWrap = 0x00000006, + WGPUStencilOperation_DecrementWrap = 0x00000007, + WGPUStencilOperation_Force32 = 0x7FFFFFFF +} WGPUStencilOperation WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUStorageTextureAccess { + WGPUStorageTextureAccess_Undefined = 0x00000000, + WGPUStorageTextureAccess_WriteOnly = 0x00000001, + WGPUStorageTextureAccess_ReadOnly = 0x00000002, + WGPUStorageTextureAccess_ReadWrite = 0x00000003, + WGPUStorageTextureAccess_Force32 = 0x7FFFFFFF +} WGPUStorageTextureAccess WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUStoreOp { + WGPUStoreOp_Undefined = 0x00000000, + WGPUStoreOp_Store = 0x00000001, + WGPUStoreOp_Discard = 0x00000002, + WGPUStoreOp_Force32 = 0x7FFFFFFF +} WGPUStoreOp WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUSurfaceGetCurrentTextureStatus { + WGPUSurfaceGetCurrentTextureStatus_Success = 0x00000000, + WGPUSurfaceGetCurrentTextureStatus_Timeout = 0x00000001, + WGPUSurfaceGetCurrentTextureStatus_Outdated = 0x00000002, + WGPUSurfaceGetCurrentTextureStatus_Lost = 0x00000003, + WGPUSurfaceGetCurrentTextureStatus_OutOfMemory = 0x00000004, + WGPUSurfaceGetCurrentTextureStatus_DeviceLost = 0x00000005, + WGPUSurfaceGetCurrentTextureStatus_Force32 = 0x7FFFFFFF +} WGPUSurfaceGetCurrentTextureStatus WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUTextureAspect { + WGPUTextureAspect_All = 0x00000000, + WGPUTextureAspect_StencilOnly = 0x00000001, + WGPUTextureAspect_DepthOnly = 0x00000002, + WGPUTextureAspect_Force32 = 0x7FFFFFFF +} WGPUTextureAspect WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUTextureDimension { + WGPUTextureDimension_1D = 0x00000000, + WGPUTextureDimension_2D = 0x00000001, + WGPUTextureDimension_3D = 0x00000002, + WGPUTextureDimension_Force32 = 0x7FFFFFFF +} WGPUTextureDimension WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUTextureFormat { + WGPUTextureFormat_Undefined = 0x00000000, + WGPUTextureFormat_R8Unorm = 0x00000001, + WGPUTextureFormat_R8Snorm = 0x00000002, + WGPUTextureFormat_R8Uint = 0x00000003, + WGPUTextureFormat_R8Sint = 0x00000004, + WGPUTextureFormat_R16Uint = 0x00000005, + WGPUTextureFormat_R16Sint = 0x00000006, + WGPUTextureFormat_R16Float = 0x00000007, + WGPUTextureFormat_RG8Unorm = 0x00000008, + WGPUTextureFormat_RG8Snorm = 0x00000009, + WGPUTextureFormat_RG8Uint = 0x0000000A, + WGPUTextureFormat_RG8Sint = 0x0000000B, + WGPUTextureFormat_R32Float = 0x0000000C, + WGPUTextureFormat_R32Uint = 0x0000000D, + WGPUTextureFormat_R32Sint = 0x0000000E, + WGPUTextureFormat_RG16Uint = 0x0000000F, + WGPUTextureFormat_RG16Sint = 0x00000010, + WGPUTextureFormat_RG16Float = 0x00000011, + WGPUTextureFormat_RGBA8Unorm = 0x00000012, + WGPUTextureFormat_RGBA8UnormSrgb = 0x00000013, + WGPUTextureFormat_RGBA8Snorm = 0x00000014, + WGPUTextureFormat_RGBA8Uint = 0x00000015, + WGPUTextureFormat_RGBA8Sint = 0x00000016, + WGPUTextureFormat_BGRA8Unorm = 0x00000017, + WGPUTextureFormat_BGRA8UnormSrgb = 0x00000018, + WGPUTextureFormat_RGB10A2Uint = 0x00000019, + WGPUTextureFormat_RGB10A2Unorm = 0x0000001A, + WGPUTextureFormat_RG11B10Ufloat = 0x0000001B, + WGPUTextureFormat_RGB9E5Ufloat = 0x0000001C, + WGPUTextureFormat_RG32Float = 0x0000001D, + WGPUTextureFormat_RG32Uint = 0x0000001E, + WGPUTextureFormat_RG32Sint = 0x0000001F, + WGPUTextureFormat_RGBA16Uint = 0x00000020, + WGPUTextureFormat_RGBA16Sint = 0x00000021, + WGPUTextureFormat_RGBA16Float = 0x00000022, + WGPUTextureFormat_RGBA32Float = 0x00000023, + WGPUTextureFormat_RGBA32Uint = 0x00000024, + WGPUTextureFormat_RGBA32Sint = 0x00000025, + WGPUTextureFormat_Stencil8 = 0x00000026, + WGPUTextureFormat_Depth16Unorm = 0x00000027, + WGPUTextureFormat_Depth24Plus = 0x00000028, + WGPUTextureFormat_Depth24PlusStencil8 = 0x00000029, + WGPUTextureFormat_Depth32Float = 0x0000002A, + WGPUTextureFormat_Depth32FloatStencil8 = 0x0000002B, + WGPUTextureFormat_BC1RGBAUnorm = 0x0000002C, + WGPUTextureFormat_BC1RGBAUnormSrgb = 0x0000002D, + WGPUTextureFormat_BC2RGBAUnorm = 0x0000002E, + WGPUTextureFormat_BC2RGBAUnormSrgb = 0x0000002F, + WGPUTextureFormat_BC3RGBAUnorm = 0x00000030, + WGPUTextureFormat_BC3RGBAUnormSrgb = 0x00000031, + WGPUTextureFormat_BC4RUnorm = 0x00000032, + WGPUTextureFormat_BC4RSnorm = 0x00000033, + WGPUTextureFormat_BC5RGUnorm = 0x00000034, + WGPUTextureFormat_BC5RGSnorm = 0x00000035, + WGPUTextureFormat_BC6HRGBUfloat = 0x00000036, + WGPUTextureFormat_BC6HRGBFloat = 0x00000037, + WGPUTextureFormat_BC7RGBAUnorm = 0x00000038, + WGPUTextureFormat_BC7RGBAUnormSrgb = 0x00000039, + WGPUTextureFormat_ETC2RGB8Unorm = 0x0000003A, + WGPUTextureFormat_ETC2RGB8UnormSrgb = 0x0000003B, + WGPUTextureFormat_ETC2RGB8A1Unorm = 0x0000003C, + WGPUTextureFormat_ETC2RGB8A1UnormSrgb = 0x0000003D, + WGPUTextureFormat_ETC2RGBA8Unorm = 0x0000003E, + WGPUTextureFormat_ETC2RGBA8UnormSrgb = 0x0000003F, + WGPUTextureFormat_EACR11Unorm = 0x00000040, + WGPUTextureFormat_EACR11Snorm = 0x00000041, + WGPUTextureFormat_EACRG11Unorm = 0x00000042, + WGPUTextureFormat_EACRG11Snorm = 0x00000043, + WGPUTextureFormat_ASTC4x4Unorm = 0x00000044, + WGPUTextureFormat_ASTC4x4UnormSrgb = 0x00000045, + WGPUTextureFormat_ASTC5x4Unorm = 0x00000046, + WGPUTextureFormat_ASTC5x4UnormSrgb = 0x00000047, + WGPUTextureFormat_ASTC5x5Unorm = 0x00000048, + WGPUTextureFormat_ASTC5x5UnormSrgb = 0x00000049, + WGPUTextureFormat_ASTC6x5Unorm = 0x0000004A, + WGPUTextureFormat_ASTC6x5UnormSrgb = 0x0000004B, + WGPUTextureFormat_ASTC6x6Unorm = 0x0000004C, + WGPUTextureFormat_ASTC6x6UnormSrgb = 0x0000004D, + WGPUTextureFormat_ASTC8x5Unorm = 0x0000004E, + WGPUTextureFormat_ASTC8x5UnormSrgb = 0x0000004F, + WGPUTextureFormat_ASTC8x6Unorm = 0x00000050, + WGPUTextureFormat_ASTC8x6UnormSrgb = 0x00000051, + WGPUTextureFormat_ASTC8x8Unorm = 0x00000052, + WGPUTextureFormat_ASTC8x8UnormSrgb = 0x00000053, + WGPUTextureFormat_ASTC10x5Unorm = 0x00000054, + WGPUTextureFormat_ASTC10x5UnormSrgb = 0x00000055, + WGPUTextureFormat_ASTC10x6Unorm = 0x00000056, + WGPUTextureFormat_ASTC10x6UnormSrgb = 0x00000057, + WGPUTextureFormat_ASTC10x8Unorm = 0x00000058, + WGPUTextureFormat_ASTC10x8UnormSrgb = 0x00000059, + WGPUTextureFormat_ASTC10x10Unorm = 0x0000005A, + WGPUTextureFormat_ASTC10x10UnormSrgb = 0x0000005B, + WGPUTextureFormat_ASTC12x10Unorm = 0x0000005C, + WGPUTextureFormat_ASTC12x10UnormSrgb = 0x0000005D, + WGPUTextureFormat_ASTC12x12Unorm = 0x0000005E, + WGPUTextureFormat_ASTC12x12UnormSrgb = 0x0000005F, + WGPUTextureFormat_Force32 = 0x7FFFFFFF +} WGPUTextureFormat WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUTextureSampleType { + WGPUTextureSampleType_Undefined = 0x00000000, + WGPUTextureSampleType_Float = 0x00000001, + WGPUTextureSampleType_UnfilterableFloat = 0x00000002, + WGPUTextureSampleType_Depth = 0x00000003, + WGPUTextureSampleType_Sint = 0x00000004, + WGPUTextureSampleType_Uint = 0x00000005, + WGPUTextureSampleType_Force32 = 0x7FFFFFFF +} WGPUTextureSampleType WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUTextureViewDimension { + WGPUTextureViewDimension_Undefined = 0x00000000, + WGPUTextureViewDimension_1D = 0x00000001, + WGPUTextureViewDimension_2D = 0x00000002, + WGPUTextureViewDimension_2DArray = 0x00000003, + WGPUTextureViewDimension_Cube = 0x00000004, + WGPUTextureViewDimension_CubeArray = 0x00000005, + WGPUTextureViewDimension_3D = 0x00000006, + WGPUTextureViewDimension_Force32 = 0x7FFFFFFF +} WGPUTextureViewDimension WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUVertexFormat { + WGPUVertexFormat_Undefined = 0x00000000, + WGPUVertexFormat_Uint8x2 = 0x00000001, + WGPUVertexFormat_Uint8x4 = 0x00000002, + WGPUVertexFormat_Sint8x2 = 0x00000003, + WGPUVertexFormat_Sint8x4 = 0x00000004, + WGPUVertexFormat_Unorm8x2 = 0x00000005, + WGPUVertexFormat_Unorm8x4 = 0x00000006, + WGPUVertexFormat_Snorm8x2 = 0x00000007, + WGPUVertexFormat_Snorm8x4 = 0x00000008, + WGPUVertexFormat_Uint16x2 = 0x00000009, + WGPUVertexFormat_Uint16x4 = 0x0000000A, + WGPUVertexFormat_Sint16x2 = 0x0000000B, + WGPUVertexFormat_Sint16x4 = 0x0000000C, + WGPUVertexFormat_Unorm16x2 = 0x0000000D, + WGPUVertexFormat_Unorm16x4 = 0x0000000E, + WGPUVertexFormat_Snorm16x2 = 0x0000000F, + WGPUVertexFormat_Snorm16x4 = 0x00000010, + WGPUVertexFormat_Float16x2 = 0x00000011, + WGPUVertexFormat_Float16x4 = 0x00000012, + WGPUVertexFormat_Float32 = 0x00000013, + WGPUVertexFormat_Float32x2 = 0x00000014, + WGPUVertexFormat_Float32x3 = 0x00000015, + WGPUVertexFormat_Float32x4 = 0x00000016, + WGPUVertexFormat_Uint32 = 0x00000017, + WGPUVertexFormat_Uint32x2 = 0x00000018, + WGPUVertexFormat_Uint32x3 = 0x00000019, + WGPUVertexFormat_Uint32x4 = 0x0000001A, + WGPUVertexFormat_Sint32 = 0x0000001B, + WGPUVertexFormat_Sint32x2 = 0x0000001C, + WGPUVertexFormat_Sint32x3 = 0x0000001D, + WGPUVertexFormat_Sint32x4 = 0x0000001E, + WGPUVertexFormat_Force32 = 0x7FFFFFFF +} WGPUVertexFormat WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUVertexStepMode { + WGPUVertexStepMode_Vertex = 0x00000000, + WGPUVertexStepMode_Instance = 0x00000001, + WGPUVertexStepMode_VertexBufferNotUsed = 0x00000002, + WGPUVertexStepMode_Force32 = 0x7FFFFFFF +} WGPUVertexStepMode WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUBufferUsage { + WGPUBufferUsage_None = 0x00000000, + WGPUBufferUsage_MapRead = 0x00000001, + WGPUBufferUsage_MapWrite = 0x00000002, + WGPUBufferUsage_CopySrc = 0x00000004, + WGPUBufferUsage_CopyDst = 0x00000008, + WGPUBufferUsage_Index = 0x00000010, + WGPUBufferUsage_Vertex = 0x00000020, + WGPUBufferUsage_Uniform = 0x00000040, + WGPUBufferUsage_Storage = 0x00000080, + WGPUBufferUsage_Indirect = 0x00000100, + WGPUBufferUsage_QueryResolve = 0x00000200, + WGPUBufferUsage_Force32 = 0x7FFFFFFF +} WGPUBufferUsage WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUBufferUsageFlags WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUColorWriteMask { + WGPUColorWriteMask_None = 0x00000000, + WGPUColorWriteMask_Red = 0x00000001, + WGPUColorWriteMask_Green = 0x00000002, + WGPUColorWriteMask_Blue = 0x00000004, + WGPUColorWriteMask_Alpha = 0x00000008, + WGPUColorWriteMask_All = 0x0000000F, + WGPUColorWriteMask_Force32 = 0x7FFFFFFF +} WGPUColorWriteMask WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUColorWriteMaskFlags WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUMapMode { + WGPUMapMode_None = 0x00000000, + WGPUMapMode_Read = 0x00000001, + WGPUMapMode_Write = 0x00000002, + WGPUMapMode_Force32 = 0x7FFFFFFF +} WGPUMapMode WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUMapModeFlags WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUShaderStage { + WGPUShaderStage_None = 0x00000000, + WGPUShaderStage_Vertex = 0x00000001, + WGPUShaderStage_Fragment = 0x00000002, + WGPUShaderStage_Compute = 0x00000004, + WGPUShaderStage_Force32 = 0x7FFFFFFF +} WGPUShaderStage WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUShaderStageFlags WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUTextureUsage { + WGPUTextureUsage_None = 0x00000000, + WGPUTextureUsage_CopySrc = 0x00000001, + WGPUTextureUsage_CopyDst = 0x00000002, + WGPUTextureUsage_TextureBinding = 0x00000004, + WGPUTextureUsage_StorageBinding = 0x00000008, + WGPUTextureUsage_RenderAttachment = 0x00000010, + WGPUTextureUsage_Force32 = 0x7FFFFFFF +} WGPUTextureUsage WGPU_ENUM_ATTRIBUTE; +typedef WGPUFlags WGPUTextureUsageFlags WGPU_ENUM_ATTRIBUTE; + +typedef void (*WGPUBufferMapCallback)(WGPUBufferMapAsyncStatus status, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUCompilationInfoCallback)(WGPUCompilationInfoRequestStatus status, struct WGPUCompilationInfo const * compilationInfo, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUCreateComputePipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPUComputePipeline pipeline, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUCreateRenderPipelineAsyncCallback)(WGPUCreatePipelineAsyncStatus status, WGPURenderPipeline pipeline, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUDeviceLostCallback)(WGPUDeviceLostReason reason, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUErrorCallback)(WGPUErrorType type, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProc)(void) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUQueueWorkDoneCallback)(WGPUQueueWorkDoneStatus status, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPURequestAdapterCallback)(WGPURequestAdapterStatus status, WGPUAdapter adapter, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPURequestDeviceCallback)(WGPURequestDeviceStatus status, WGPUDevice device, char const * message, void * userdata) WGPU_FUNCTION_ATTRIBUTE; + +typedef struct WGPUChainedStruct { + struct WGPUChainedStruct const * next; + WGPUSType sType; +} WGPUChainedStruct WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUChainedStructOut { + struct WGPUChainedStructOut * next; + WGPUSType sType; +} WGPUChainedStructOut WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUAdapterProperties { + WGPUChainedStructOut * nextInChain; + uint32_t vendorID; + char const * vendorName; + char const * architecture; + uint32_t deviceID; + char const * name; + char const * driverDescription; + WGPUAdapterType adapterType; + WGPUBackendType backendType; +} WGPUAdapterProperties WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUBindGroupEntry { + WGPUChainedStruct const * nextInChain; + uint32_t binding; + WGPU_NULLABLE WGPUBuffer buffer; + uint64_t offset; + uint64_t size; + WGPU_NULLABLE WGPUSampler sampler; + WGPU_NULLABLE WGPUTextureView textureView; +} WGPUBindGroupEntry WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUBlendComponent { + WGPUBlendOperation operation; + WGPUBlendFactor srcFactor; + WGPUBlendFactor dstFactor; +} WGPUBlendComponent WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUBufferBindingLayout { + WGPUChainedStruct const * nextInChain; + WGPUBufferBindingType type; + WGPUBool hasDynamicOffset; + uint64_t minBindingSize; +} WGPUBufferBindingLayout WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUBufferDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + WGPUBufferUsageFlags usage; + uint64_t size; + WGPUBool mappedAtCreation; +} WGPUBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUColor { + double r; + double g; + double b; + double a; +} WGPUColor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUCommandBufferDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; +} WGPUCommandBufferDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUCommandEncoderDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; +} WGPUCommandEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUCompilationMessage { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * message; + WGPUCompilationMessageType type; + uint64_t lineNum; + uint64_t linePos; + uint64_t offset; + uint64_t length; + uint64_t utf16LinePos; + uint64_t utf16Offset; + uint64_t utf16Length; +} WGPUCompilationMessage WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUComputePassTimestampWrites { + WGPUQuerySet querySet; + uint32_t beginningOfPassWriteIndex; + uint32_t endOfPassWriteIndex; +} WGPUComputePassTimestampWrites WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUConstantEntry { + WGPUChainedStruct const * nextInChain; + char const * key; + double value; +} WGPUConstantEntry WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUExtent3D { + uint32_t width; + uint32_t height; + uint32_t depthOrArrayLayers; +} WGPUExtent3D WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUInstanceDescriptor { + WGPUChainedStruct const * nextInChain; +} WGPUInstanceDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPULimits { + uint32_t maxTextureDimension1D; + uint32_t maxTextureDimension2D; + uint32_t maxTextureDimension3D; + uint32_t maxTextureArrayLayers; + uint32_t maxBindGroups; + uint32_t maxBindGroupsPlusVertexBuffers; + uint32_t maxBindingsPerBindGroup; + uint32_t maxDynamicUniformBuffersPerPipelineLayout; + uint32_t maxDynamicStorageBuffersPerPipelineLayout; + uint32_t maxSampledTexturesPerShaderStage; + uint32_t maxSamplersPerShaderStage; + uint32_t maxStorageBuffersPerShaderStage; + uint32_t maxStorageTexturesPerShaderStage; + uint32_t maxUniformBuffersPerShaderStage; + uint64_t maxUniformBufferBindingSize; + uint64_t maxStorageBufferBindingSize; + uint32_t minUniformBufferOffsetAlignment; + uint32_t minStorageBufferOffsetAlignment; + uint32_t maxVertexBuffers; + uint64_t maxBufferSize; + uint32_t maxVertexAttributes; + uint32_t maxVertexBufferArrayStride; + uint32_t maxInterStageShaderComponents; + uint32_t maxInterStageShaderVariables; + uint32_t maxColorAttachments; + uint32_t maxColorAttachmentBytesPerSample; + uint32_t maxComputeWorkgroupStorageSize; + uint32_t maxComputeInvocationsPerWorkgroup; + uint32_t maxComputeWorkgroupSizeX; + uint32_t maxComputeWorkgroupSizeY; + uint32_t maxComputeWorkgroupSizeZ; + uint32_t maxComputeWorkgroupsPerDimension; +} WGPULimits WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUMultisampleState { + WGPUChainedStruct const * nextInChain; + uint32_t count; + uint32_t mask; + WGPUBool alphaToCoverageEnabled; +} WGPUMultisampleState WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUOrigin3D { + uint32_t x; + uint32_t y; + uint32_t z; +} WGPUOrigin3D WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUPipelineLayoutDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + size_t bindGroupLayoutCount; + WGPUBindGroupLayout const * bindGroupLayouts; +} WGPUPipelineLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUPrimitiveState +typedef struct WGPUPrimitiveDepthClipControl { + WGPUChainedStruct chain; + WGPUBool unclippedDepth; +} WGPUPrimitiveDepthClipControl WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUPrimitiveState { + WGPUChainedStruct const * nextInChain; + WGPUPrimitiveTopology topology; + WGPUIndexFormat stripIndexFormat; + WGPUFrontFace frontFace; + WGPUCullMode cullMode; +} WGPUPrimitiveState WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUQuerySetDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + WGPUQueryType type; + uint32_t count; +} WGPUQuerySetDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUQueueDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; +} WGPUQueueDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURenderBundleDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; +} WGPURenderBundleDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURenderBundleEncoderDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + size_t colorFormatCount; + WGPUTextureFormat const * colorFormats; + WGPUTextureFormat depthStencilFormat; + uint32_t sampleCount; + WGPUBool depthReadOnly; + WGPUBool stencilReadOnly; +} WGPURenderBundleEncoderDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURenderPassDepthStencilAttachment { + WGPUTextureView view; + WGPULoadOp depthLoadOp; + WGPUStoreOp depthStoreOp; + float depthClearValue; + WGPUBool depthReadOnly; + WGPULoadOp stencilLoadOp; + WGPUStoreOp stencilStoreOp; + uint32_t stencilClearValue; + WGPUBool stencilReadOnly; +} WGPURenderPassDepthStencilAttachment WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPURenderPassDescriptor +typedef struct WGPURenderPassDescriptorMaxDrawCount { + WGPUChainedStruct chain; + uint64_t maxDrawCount; +} WGPURenderPassDescriptorMaxDrawCount WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURenderPassTimestampWrites { + WGPUQuerySet querySet; + uint32_t beginningOfPassWriteIndex; + uint32_t endOfPassWriteIndex; +} WGPURenderPassTimestampWrites WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURequestAdapterOptions { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE WGPUSurface compatibleSurface; + WGPUPowerPreference powerPreference; + WGPUBackendType backendType; + WGPUBool forceFallbackAdapter; +} WGPURequestAdapterOptions WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSamplerBindingLayout { + WGPUChainedStruct const * nextInChain; + WGPUSamplerBindingType type; +} WGPUSamplerBindingLayout WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSamplerDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + WGPUAddressMode addressModeU; + WGPUAddressMode addressModeV; + WGPUAddressMode addressModeW; + WGPUFilterMode magFilter; + WGPUFilterMode minFilter; + WGPUMipmapFilterMode mipmapFilter; + float lodMinClamp; + float lodMaxClamp; + WGPUCompareFunction compare; + uint16_t maxAnisotropy; +} WGPUSamplerDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUShaderModuleCompilationHint { + WGPUChainedStruct const * nextInChain; + char const * entryPoint; + WGPUPipelineLayout layout; +} WGPUShaderModuleCompilationHint WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUShaderModuleDescriptor +typedef struct WGPUShaderModuleSPIRVDescriptor { + WGPUChainedStruct chain; + uint32_t codeSize; + uint32_t const * code; +} WGPUShaderModuleSPIRVDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUShaderModuleDescriptor +typedef struct WGPUShaderModuleWGSLDescriptor { + WGPUChainedStruct chain; + char const * code; +} WGPUShaderModuleWGSLDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUStencilFaceState { + WGPUCompareFunction compare; + WGPUStencilOperation failOp; + WGPUStencilOperation depthFailOp; + WGPUStencilOperation passOp; +} WGPUStencilFaceState WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUStorageTextureBindingLayout { + WGPUChainedStruct const * nextInChain; + WGPUStorageTextureAccess access; + WGPUTextureFormat format; + WGPUTextureViewDimension viewDimension; +} WGPUStorageTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceCapabilities { + WGPUChainedStructOut * nextInChain; + size_t formatCount; + WGPUTextureFormat * formats; + size_t presentModeCount; + WGPUPresentMode * presentModes; + size_t alphaModeCount; + WGPUCompositeAlphaMode * alphaModes; +} WGPUSurfaceCapabilities WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceConfiguration { + WGPUChainedStruct const * nextInChain; + WGPUDevice device; + WGPUTextureFormat format; + WGPUTextureUsageFlags usage; + size_t viewFormatCount; + WGPUTextureFormat const * viewFormats; + WGPUCompositeAlphaMode alphaMode; + uint32_t width; + uint32_t height; + WGPUPresentMode presentMode; +} WGPUSurfaceConfiguration WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; +} WGPUSurfaceDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSurfaceDescriptor +typedef struct WGPUSurfaceDescriptorFromAndroidNativeWindow { + WGPUChainedStruct chain; + void * window; +} WGPUSurfaceDescriptorFromAndroidNativeWindow WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSurfaceDescriptor +typedef struct WGPUSurfaceDescriptorFromCanvasHTMLSelector { + WGPUChainedStruct chain; + char const * selector; +} WGPUSurfaceDescriptorFromCanvasHTMLSelector WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSurfaceDescriptor +typedef struct WGPUSurfaceDescriptorFromMetalLayer { + WGPUChainedStruct chain; + void * layer; +} WGPUSurfaceDescriptorFromMetalLayer WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSurfaceDescriptor +typedef struct WGPUSurfaceDescriptorFromWaylandSurface { + WGPUChainedStruct chain; + void * display; + void * surface; +} WGPUSurfaceDescriptorFromWaylandSurface WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSurfaceDescriptor +typedef struct WGPUSurfaceDescriptorFromWindowsHWND { + WGPUChainedStruct chain; + void * hinstance; + void * hwnd; +} WGPUSurfaceDescriptorFromWindowsHWND WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSurfaceDescriptor +typedef struct WGPUSurfaceDescriptorFromXcbWindow { + WGPUChainedStruct chain; + void * connection; + uint32_t window; +} WGPUSurfaceDescriptorFromXcbWindow WGPU_STRUCTURE_ATTRIBUTE; + +// Can be chained in WGPUSurfaceDescriptor +typedef struct WGPUSurfaceDescriptorFromXlibWindow { + WGPUChainedStruct chain; + void * display; + uint64_t window; +} WGPUSurfaceDescriptorFromXlibWindow WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceTexture { + WGPUTexture texture; + WGPUBool suboptimal; + WGPUSurfaceGetCurrentTextureStatus status; +} WGPUSurfaceTexture WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUTextureBindingLayout { + WGPUChainedStruct const * nextInChain; + WGPUTextureSampleType sampleType; + WGPUTextureViewDimension viewDimension; + WGPUBool multisampled; +} WGPUTextureBindingLayout WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUTextureDataLayout { + WGPUChainedStruct const * nextInChain; + uint64_t offset; + uint32_t bytesPerRow; + uint32_t rowsPerImage; +} WGPUTextureDataLayout WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUTextureViewDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + WGPUTextureFormat format; + WGPUTextureViewDimension dimension; + uint32_t baseMipLevel; + uint32_t mipLevelCount; + uint32_t baseArrayLayer; + uint32_t arrayLayerCount; + WGPUTextureAspect aspect; +} WGPUTextureViewDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUVertexAttribute { + WGPUVertexFormat format; + uint64_t offset; + uint32_t shaderLocation; +} WGPUVertexAttribute WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUBindGroupDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + WGPUBindGroupLayout layout; + size_t entryCount; + WGPUBindGroupEntry const * entries; +} WGPUBindGroupDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUBindGroupLayoutEntry { + WGPUChainedStruct const * nextInChain; + uint32_t binding; + WGPUShaderStageFlags visibility; + WGPUBufferBindingLayout buffer; + WGPUSamplerBindingLayout sampler; + WGPUTextureBindingLayout texture; + WGPUStorageTextureBindingLayout storageTexture; +} WGPUBindGroupLayoutEntry WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUBlendState { + WGPUBlendComponent color; + WGPUBlendComponent alpha; +} WGPUBlendState WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUCompilationInfo { + WGPUChainedStruct const * nextInChain; + size_t messageCount; + WGPUCompilationMessage const * messages; +} WGPUCompilationInfo WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUComputePassDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + WGPU_NULLABLE WGPUComputePassTimestampWrites const * timestampWrites; +} WGPUComputePassDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUDepthStencilState { + WGPUChainedStruct const * nextInChain; + WGPUTextureFormat format; + WGPUBool depthWriteEnabled; + WGPUCompareFunction depthCompare; + WGPUStencilFaceState stencilFront; + WGPUStencilFaceState stencilBack; + uint32_t stencilReadMask; + uint32_t stencilWriteMask; + int32_t depthBias; + float depthBiasSlopeScale; + float depthBiasClamp; +} WGPUDepthStencilState WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUImageCopyBuffer { + WGPUChainedStruct const * nextInChain; + WGPUTextureDataLayout layout; + WGPUBuffer buffer; +} WGPUImageCopyBuffer WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUImageCopyTexture { + WGPUChainedStruct const * nextInChain; + WGPUTexture texture; + uint32_t mipLevel; + WGPUOrigin3D origin; + WGPUTextureAspect aspect; +} WGPUImageCopyTexture WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUProgrammableStageDescriptor { + WGPUChainedStruct const * nextInChain; + WGPUShaderModule module; + WGPU_NULLABLE char const * entryPoint; + size_t constantCount; + WGPUConstantEntry const * constants; +} WGPUProgrammableStageDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURenderPassColorAttachment { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE WGPUTextureView view; + WGPU_NULLABLE WGPUTextureView resolveTarget; + WGPULoadOp loadOp; + WGPUStoreOp storeOp; + WGPUColor clearValue; +} WGPURenderPassColorAttachment WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURequiredLimits { + WGPUChainedStruct const * nextInChain; + WGPULimits limits; +} WGPURequiredLimits WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUShaderModuleDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + size_t hintCount; + WGPUShaderModuleCompilationHint const * hints; +} WGPUShaderModuleDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSupportedLimits { + WGPUChainedStructOut * nextInChain; + WGPULimits limits; +} WGPUSupportedLimits WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUTextureDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + WGPUTextureUsageFlags usage; + WGPUTextureDimension dimension; + WGPUExtent3D size; + WGPUTextureFormat format; + uint32_t mipLevelCount; + uint32_t sampleCount; + size_t viewFormatCount; + WGPUTextureFormat const * viewFormats; +} WGPUTextureDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUVertexBufferLayout { + uint64_t arrayStride; + WGPUVertexStepMode stepMode; + size_t attributeCount; + WGPUVertexAttribute const * attributes; +} WGPUVertexBufferLayout WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUBindGroupLayoutDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + size_t entryCount; + WGPUBindGroupLayoutEntry const * entries; +} WGPUBindGroupLayoutDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUColorTargetState { + WGPUChainedStruct const * nextInChain; + WGPUTextureFormat format; + WGPU_NULLABLE WGPUBlendState const * blend; + WGPUColorWriteMaskFlags writeMask; +} WGPUColorTargetState WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUComputePipelineDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + WGPU_NULLABLE WGPUPipelineLayout layout; + WGPUProgrammableStageDescriptor compute; +} WGPUComputePipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUDeviceDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + size_t requiredFeatureCount; + WGPUFeatureName const * requiredFeatures; + WGPU_NULLABLE WGPURequiredLimits const * requiredLimits; + WGPUQueueDescriptor defaultQueue; + WGPUDeviceLostCallback deviceLostCallback; + void * deviceLostUserdata; +} WGPUDeviceDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURenderPassDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + size_t colorAttachmentCount; + WGPURenderPassColorAttachment const * colorAttachments; + WGPU_NULLABLE WGPURenderPassDepthStencilAttachment const * depthStencilAttachment; + WGPU_NULLABLE WGPUQuerySet occlusionQuerySet; + WGPU_NULLABLE WGPURenderPassTimestampWrites const * timestampWrites; +} WGPURenderPassDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUVertexState { + WGPUChainedStruct const * nextInChain; + WGPUShaderModule module; + WGPU_NULLABLE char const * entryPoint; + size_t constantCount; + WGPUConstantEntry const * constants; + size_t bufferCount; + WGPUVertexBufferLayout const * buffers; +} WGPUVertexState WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUFragmentState { + WGPUChainedStruct const * nextInChain; + WGPUShaderModule module; + WGPU_NULLABLE char const * entryPoint; + size_t constantCount; + WGPUConstantEntry const * constants; + size_t targetCount; + WGPUColorTargetState const * targets; +} WGPUFragmentState WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPURenderPipelineDescriptor { + WGPUChainedStruct const * nextInChain; + WGPU_NULLABLE char const * label; + WGPU_NULLABLE WGPUPipelineLayout layout; + WGPUVertexState vertex; + WGPUPrimitiveState primitive; + WGPU_NULLABLE WGPUDepthStencilState const * depthStencil; + WGPUMultisampleState multisample; + WGPU_NULLABLE WGPUFragmentState const * fragment; +} WGPURenderPipelineDescriptor WGPU_STRUCTURE_ATTRIBUTE; + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(WGPU_SKIP_PROCS) + +typedef WGPUInstance (*WGPUProcCreateInstance)(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUProc (*WGPUProcGetProcAddress)(WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of Adapter +typedef size_t (*WGPUProcAdapterEnumerateFeatures)(WGPUAdapter adapter, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcAdapterGetLimits)(WGPUAdapter adapter, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterGetProperties)(WGPUAdapter adapter, WGPUAdapterProperties * properties) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcAdapterHasFeature)(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterRequestDevice)(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterReference)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcAdapterRelease)(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of BindGroup +typedef void (*WGPUProcBindGroupSetLabel)(WGPUBindGroup bindGroup, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBindGroupReference)(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBindGroupRelease)(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of BindGroupLayout +typedef void (*WGPUProcBindGroupLayoutSetLabel)(WGPUBindGroupLayout bindGroupLayout, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBindGroupLayoutReference)(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBindGroupLayoutRelease)(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of Buffer +typedef void (*WGPUProcBufferDestroy)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +typedef void const * (*WGPUProcBufferGetConstMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBufferMapState (*WGPUProcBufferGetMapState)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +typedef void * (*WGPUProcBufferGetMappedRange)(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef uint64_t (*WGPUProcBufferGetSize)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBufferUsageFlags (*WGPUProcBufferGetUsage)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBufferMapAsync)(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBufferSetLabel)(WGPUBuffer buffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBufferUnmap)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBufferReference)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcBufferRelease)(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of CommandBuffer +typedef void (*WGPUProcCommandBufferSetLabel)(WGPUCommandBuffer commandBuffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandBufferReference)(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandBufferRelease)(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of CommandEncoder +typedef WGPUComputePassEncoder (*WGPUProcCommandEncoderBeginComputePass)(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUComputePassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPURenderPassEncoder (*WGPUProcCommandEncoderBeginRenderPass)(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderClearBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderCopyBufferToBuffer)(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderCopyBufferToTexture)(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderCopyTextureToBuffer)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderCopyTextureToTexture)(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUCommandBuffer (*WGPUProcCommandEncoderFinish)(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUCommandBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderInsertDebugMarker)(WGPUCommandEncoder commandEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderPopDebugGroup)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderPushDebugGroup)(WGPUCommandEncoder commandEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderResolveQuerySet)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderSetLabel)(WGPUCommandEncoder commandEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderWriteTimestamp)(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderReference)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcCommandEncoderRelease)(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of ComputePassEncoder +typedef void (*WGPUProcComputePassEncoderDispatchWorkgroups)(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderDispatchWorkgroupsIndirect)(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderEnd)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderInsertDebugMarker)(WGPUComputePassEncoder computePassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderPopDebugGroup)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderPushDebugGroup)(WGPUComputePassEncoder computePassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderSetBindGroup)(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderSetLabel)(WGPUComputePassEncoder computePassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderSetPipeline)(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderReference)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePassEncoderRelease)(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of ComputePipeline +typedef WGPUBindGroupLayout (*WGPUProcComputePipelineGetBindGroupLayout)(WGPUComputePipeline computePipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePipelineSetLabel)(WGPUComputePipeline computePipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePipelineReference)(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcComputePipelineRelease)(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of Device +typedef WGPUBindGroup (*WGPUProcDeviceCreateBindGroup)(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBindGroupLayout (*WGPUProcDeviceCreateBindGroupLayout)(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBuffer (*WGPUProcDeviceCreateBuffer)(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUCommandEncoder (*WGPUProcDeviceCreateCommandEncoder)(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUComputePipeline (*WGPUProcDeviceCreateComputePipeline)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceCreateComputePipelineAsync)(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUPipelineLayout (*WGPUProcDeviceCreatePipelineLayout)(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUQuerySet (*WGPUProcDeviceCreateQuerySet)(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPURenderBundleEncoder (*WGPUProcDeviceCreateRenderBundleEncoder)(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPURenderPipeline (*WGPUProcDeviceCreateRenderPipeline)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceCreateRenderPipelineAsync)(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUSampler (*WGPUProcDeviceCreateSampler)(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUShaderModule (*WGPUProcDeviceCreateShaderModule)(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTexture (*WGPUProcDeviceCreateTexture)(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceDestroy)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +typedef size_t (*WGPUProcDeviceEnumerateFeatures)(WGPUDevice device, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcDeviceGetLimits)(WGPUDevice device, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUQueue (*WGPUProcDeviceGetQueue)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUBool (*WGPUProcDeviceHasFeature)(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDevicePopErrorScope)(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDevicePushErrorScope)(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceSetLabel)(WGPUDevice device, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceSetUncapturedErrorCallback)(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceReference)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcDeviceRelease)(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of Instance +typedef WGPUSurface (*WGPUProcInstanceCreateSurface)(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcInstanceProcessEvents)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcInstanceRequestAdapter)(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcInstanceReference)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcInstanceRelease)(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of PipelineLayout +typedef void (*WGPUProcPipelineLayoutSetLabel)(WGPUPipelineLayout pipelineLayout, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcPipelineLayoutReference)(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcPipelineLayoutRelease)(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of QuerySet +typedef void (*WGPUProcQuerySetDestroy)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +typedef uint32_t (*WGPUProcQuerySetGetCount)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUQueryType (*WGPUProcQuerySetGetType)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQuerySetSetLabel)(WGPUQuerySet querySet, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQuerySetReference)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQuerySetRelease)(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of Queue +typedef void (*WGPUProcQueueOnSubmittedWorkDone)(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQueueSetLabel)(WGPUQueue queue, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQueueSubmit)(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQueueWriteBuffer)(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQueueWriteTexture)(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQueueReference)(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcQueueRelease)(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of RenderBundle +typedef void (*WGPUProcRenderBundleSetLabel)(WGPURenderBundle renderBundle, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleReference)(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleRelease)(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of RenderBundleEncoder +typedef void (*WGPUProcRenderBundleEncoderDraw)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderDrawIndexed)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderDrawIndexedIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderDrawIndirect)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPURenderBundle (*WGPUProcRenderBundleEncoderFinish)(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPURenderBundleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderInsertDebugMarker)(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderPopDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderPushDebugGroup)(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderSetBindGroup)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderSetIndexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderSetLabel)(WGPURenderBundleEncoder renderBundleEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderSetPipeline)(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderSetVertexBuffer)(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderReference)(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderBundleEncoderRelease)(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of RenderPassEncoder +typedef void (*WGPUProcRenderPassEncoderBeginOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderDraw)(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderDrawIndexed)(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderDrawIndexedIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderDrawIndirect)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderEnd)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderEndOcclusionQuery)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderExecuteBundles)(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderInsertDebugMarker)(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderPopDebugGroup)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderPushDebugGroup)(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetBindGroup)(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetBlendConstant)(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetIndexBuffer)(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetLabel)(WGPURenderPassEncoder renderPassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetPipeline)(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetScissorRect)(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetStencilReference)(WGPURenderPassEncoder renderPassEncoder, uint32_t reference) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetVertexBuffer)(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderSetViewport)(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderReference)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPassEncoderRelease)(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of RenderPipeline +typedef WGPUBindGroupLayout (*WGPUProcRenderPipelineGetBindGroupLayout)(WGPURenderPipeline renderPipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPipelineSetLabel)(WGPURenderPipeline renderPipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPipelineReference)(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcRenderPipelineRelease)(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of Sampler +typedef void (*WGPUProcSamplerSetLabel)(WGPUSampler sampler, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSamplerReference)(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSamplerRelease)(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of ShaderModule +typedef void (*WGPUProcShaderModuleGetCompilationInfo)(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcShaderModuleSetLabel)(WGPUShaderModule shaderModule, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcShaderModuleReference)(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcShaderModuleRelease)(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of Surface +typedef void (*WGPUProcSurfaceConfigure)(WGPUSurface surface, WGPUSurfaceConfiguration const * config) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceGetCapabilities)(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceGetCurrentTexture)(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTextureFormat (*WGPUProcSurfaceGetPreferredFormat)(WGPUSurface surface, WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfacePresent)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceUnconfigure)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceReference)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcSurfaceRelease)(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of SurfaceCapabilities +typedef void (*WGPUProcSurfaceCapabilitiesFreeMembers)(WGPUSurfaceCapabilities capabilities) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of Texture +typedef WGPUTextureView (*WGPUProcTextureCreateView)(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcTextureDestroy)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +typedef uint32_t (*WGPUProcTextureGetDepthOrArrayLayers)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTextureDimension (*WGPUProcTextureGetDimension)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTextureFormat (*WGPUProcTextureGetFormat)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +typedef uint32_t (*WGPUProcTextureGetHeight)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +typedef uint32_t (*WGPUProcTextureGetMipLevelCount)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +typedef uint32_t (*WGPUProcTextureGetSampleCount)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +typedef WGPUTextureUsageFlags (*WGPUProcTextureGetUsage)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +typedef uint32_t (*WGPUProcTextureGetWidth)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcTextureSetLabel)(WGPUTexture texture, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcTextureReference)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcTextureRelease)(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; + +// Procs of TextureView +typedef void (*WGPUProcTextureViewSetLabel)(WGPUTextureView textureView, char const * label) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcTextureViewReference)(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; +typedef void (*WGPUProcTextureViewRelease)(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; + +#endif // !defined(WGPU_SKIP_PROCS) + +#if !defined(WGPU_SKIP_DECLARATIONS) + +WGPU_EXPORT WGPUInstance wgpuCreateInstance(WGPU_NULLABLE WGPUInstanceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUProc wgpuGetProcAddress(WGPUDevice device, char const * procName) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of Adapter +WGPU_EXPORT size_t wgpuAdapterEnumerateFeatures(WGPUAdapter adapter, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuAdapterGetLimits(WGPUAdapter adapter, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterGetProperties(WGPUAdapter adapter, WGPUAdapterProperties * properties) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuAdapterHasFeature(WGPUAdapter adapter, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterRequestDevice(WGPUAdapter adapter, WGPU_NULLABLE WGPUDeviceDescriptor const * descriptor, WGPURequestDeviceCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterReference(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuAdapterRelease(WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of BindGroup +WGPU_EXPORT void wgpuBindGroupSetLabel(WGPUBindGroup bindGroup, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBindGroupReference(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBindGroupRelease(WGPUBindGroup bindGroup) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of BindGroupLayout +WGPU_EXPORT void wgpuBindGroupLayoutSetLabel(WGPUBindGroupLayout bindGroupLayout, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBindGroupLayoutReference(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBindGroupLayoutRelease(WGPUBindGroupLayout bindGroupLayout) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of Buffer +WGPU_EXPORT void wgpuBufferDestroy(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void const * wgpuBufferGetConstMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBufferMapState wgpuBufferGetMapState(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void * wgpuBufferGetMappedRange(WGPUBuffer buffer, size_t offset, size_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint64_t wgpuBufferGetSize(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBufferUsageFlags wgpuBufferGetUsage(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBufferMapAsync(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBufferSetLabel(WGPUBuffer buffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBufferUnmap(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBufferReference(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuBufferRelease(WGPUBuffer buffer) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of CommandBuffer +WGPU_EXPORT void wgpuCommandBufferSetLabel(WGPUCommandBuffer commandBuffer, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandBufferReference(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandBufferRelease(WGPUCommandBuffer commandBuffer) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of CommandEncoder +WGPU_EXPORT WGPUComputePassEncoder wgpuCommandEncoderBeginComputePass(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUComputePassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPURenderPassEncoder wgpuCommandEncoderBeginRenderPass(WGPUCommandEncoder commandEncoder, WGPURenderPassDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderClearBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderCopyBufferToBuffer(WGPUCommandEncoder commandEncoder, WGPUBuffer source, uint64_t sourceOffset, WGPUBuffer destination, uint64_t destinationOffset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderCopyBufferToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyBuffer const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderCopyTextureToBuffer(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyBuffer const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderCopyTextureToTexture(WGPUCommandEncoder commandEncoder, WGPUImageCopyTexture const * source, WGPUImageCopyTexture const * destination, WGPUExtent3D const * copySize) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUCommandBuffer wgpuCommandEncoderFinish(WGPUCommandEncoder commandEncoder, WGPU_NULLABLE WGPUCommandBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderInsertDebugMarker(WGPUCommandEncoder commandEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderPopDebugGroup(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderPushDebugGroup(WGPUCommandEncoder commandEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderResolveQuerySet(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t firstQuery, uint32_t queryCount, WGPUBuffer destination, uint64_t destinationOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderSetLabel(WGPUCommandEncoder commandEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderWriteTimestamp(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderReference(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuCommandEncoderRelease(WGPUCommandEncoder commandEncoder) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of ComputePassEncoder +WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroups(WGPUComputePassEncoder computePassEncoder, uint32_t workgroupCountX, uint32_t workgroupCountY, uint32_t workgroupCountZ) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderDispatchWorkgroupsIndirect(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderEnd(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderInsertDebugMarker(WGPUComputePassEncoder computePassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderPopDebugGroup(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderPushDebugGroup(WGPUComputePassEncoder computePassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderSetBindGroup(WGPUComputePassEncoder computePassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderSetLabel(WGPUComputePassEncoder computePassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderSetPipeline(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderReference(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePassEncoderRelease(WGPUComputePassEncoder computePassEncoder) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of ComputePipeline +WGPU_EXPORT WGPUBindGroupLayout wgpuComputePipelineGetBindGroupLayout(WGPUComputePipeline computePipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePipelineSetLabel(WGPUComputePipeline computePipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePipelineReference(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuComputePipelineRelease(WGPUComputePipeline computePipeline) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of Device +WGPU_EXPORT WGPUBindGroup wgpuDeviceCreateBindGroup(WGPUDevice device, WGPUBindGroupDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBindGroupLayout wgpuDeviceCreateBindGroupLayout(WGPUDevice device, WGPUBindGroupLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBuffer wgpuDeviceCreateBuffer(WGPUDevice device, WGPUBufferDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUCommandEncoder wgpuDeviceCreateCommandEncoder(WGPUDevice device, WGPU_NULLABLE WGPUCommandEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUComputePipeline wgpuDeviceCreateComputePipeline(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceCreateComputePipelineAsync(WGPUDevice device, WGPUComputePipelineDescriptor const * descriptor, WGPUCreateComputePipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUPipelineLayout wgpuDeviceCreatePipelineLayout(WGPUDevice device, WGPUPipelineLayoutDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUQuerySet wgpuDeviceCreateQuerySet(WGPUDevice device, WGPUQuerySetDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPURenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder(WGPUDevice device, WGPURenderBundleEncoderDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPURenderPipeline wgpuDeviceCreateRenderPipeline(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceCreateRenderPipelineAsync(WGPUDevice device, WGPURenderPipelineDescriptor const * descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUSampler wgpuDeviceCreateSampler(WGPUDevice device, WGPU_NULLABLE WGPUSamplerDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUShaderModule wgpuDeviceCreateShaderModule(WGPUDevice device, WGPUShaderModuleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTexture wgpuDeviceCreateTexture(WGPUDevice device, WGPUTextureDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceDestroy(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT size_t wgpuDeviceEnumerateFeatures(WGPUDevice device, WGPUFeatureName * features) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuDeviceGetLimits(WGPUDevice device, WGPUSupportedLimits * limits) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUQueue wgpuDeviceGetQueue(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUBool wgpuDeviceHasFeature(WGPUDevice device, WGPUFeatureName feature) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDevicePopErrorScope(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDevicePushErrorScope(WGPUDevice device, WGPUErrorFilter filter) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceSetLabel(WGPUDevice device, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceSetUncapturedErrorCallback(WGPUDevice device, WGPUErrorCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceReference(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuDeviceRelease(WGPUDevice device) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of Instance +WGPU_EXPORT WGPUSurface wgpuInstanceCreateSurface(WGPUInstance instance, WGPUSurfaceDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceProcessEvents(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceRequestAdapter(WGPUInstance instance, WGPU_NULLABLE WGPURequestAdapterOptions const * options, WGPURequestAdapterCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceReference(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuInstanceRelease(WGPUInstance instance) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of PipelineLayout +WGPU_EXPORT void wgpuPipelineLayoutSetLabel(WGPUPipelineLayout pipelineLayout, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuPipelineLayoutReference(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuPipelineLayoutRelease(WGPUPipelineLayout pipelineLayout) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of QuerySet +WGPU_EXPORT void wgpuQuerySetDestroy(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuQuerySetGetCount(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUQueryType wgpuQuerySetGetType(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQuerySetSetLabel(WGPUQuerySet querySet, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQuerySetReference(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQuerySetRelease(WGPUQuerySet querySet) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of Queue +WGPU_EXPORT void wgpuQueueOnSubmittedWorkDone(WGPUQueue queue, WGPUQueueWorkDoneCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueSetLabel(WGPUQueue queue, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueSubmit(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueWriteBuffer(WGPUQueue queue, WGPUBuffer buffer, uint64_t bufferOffset, void const * data, size_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueWriteTexture(WGPUQueue queue, WGPUImageCopyTexture const * destination, void const * data, size_t dataSize, WGPUTextureDataLayout const * dataLayout, WGPUExtent3D const * writeSize) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueReference(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuQueueRelease(WGPUQueue queue) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of RenderBundle +WGPU_EXPORT void wgpuRenderBundleSetLabel(WGPURenderBundle renderBundle, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleReference(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleRelease(WGPURenderBundle renderBundle) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of RenderBundleEncoder +WGPU_EXPORT void wgpuRenderBundleEncoderDraw(WGPURenderBundleEncoder renderBundleEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexed(WGPURenderBundleEncoder renderBundleEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndexedIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderDrawIndirect(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPURenderBundle wgpuRenderBundleEncoderFinish(WGPURenderBundleEncoder renderBundleEncoder, WGPU_NULLABLE WGPURenderBundleDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderInsertDebugMarker(WGPURenderBundleEncoder renderBundleEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderPopDebugGroup(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderPushDebugGroup(WGPURenderBundleEncoder renderBundleEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderSetBindGroup(WGPURenderBundleEncoder renderBundleEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderSetIndexBuffer(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderSetLabel(WGPURenderBundleEncoder renderBundleEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderSetPipeline(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderSetVertexBuffer(WGPURenderBundleEncoder renderBundleEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderReference(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderBundleEncoderRelease(WGPURenderBundleEncoder renderBundleEncoder) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of RenderPassEncoder +WGPU_EXPORT void wgpuRenderPassEncoderBeginOcclusionQuery(WGPURenderPassEncoder renderPassEncoder, uint32_t queryIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderDraw(WGPURenderPassEncoder renderPassEncoder, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexed(WGPURenderPassEncoder renderPassEncoder, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t baseVertex, uint32_t firstInstance) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderDrawIndexedIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderDrawIndirect(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, uint64_t indirectOffset) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderEnd(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderEndOcclusionQuery(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderExecuteBundles(WGPURenderPassEncoder renderPassEncoder, size_t bundleCount, WGPURenderBundle const * bundles) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderInsertDebugMarker(WGPURenderPassEncoder renderPassEncoder, char const * markerLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderPopDebugGroup(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderPushDebugGroup(WGPURenderPassEncoder renderPassEncoder, char const * groupLabel) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetBindGroup(WGPURenderPassEncoder renderPassEncoder, uint32_t groupIndex, WGPU_NULLABLE WGPUBindGroup group, size_t dynamicOffsetCount, uint32_t const * dynamicOffsets) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetBlendConstant(WGPURenderPassEncoder renderPassEncoder, WGPUColor const * color) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetIndexBuffer(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetLabel(WGPURenderPassEncoder renderPassEncoder, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetPipeline(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetScissorRect(WGPURenderPassEncoder renderPassEncoder, uint32_t x, uint32_t y, uint32_t width, uint32_t height) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetStencilReference(WGPURenderPassEncoder renderPassEncoder, uint32_t reference) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetVertexBuffer(WGPURenderPassEncoder renderPassEncoder, uint32_t slot, WGPU_NULLABLE WGPUBuffer buffer, uint64_t offset, uint64_t size) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderSetViewport(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderReference(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPassEncoderRelease(WGPURenderPassEncoder renderPassEncoder) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of RenderPipeline +WGPU_EXPORT WGPUBindGroupLayout wgpuRenderPipelineGetBindGroupLayout(WGPURenderPipeline renderPipeline, uint32_t groupIndex) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPipelineSetLabel(WGPURenderPipeline renderPipeline, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPipelineReference(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuRenderPipelineRelease(WGPURenderPipeline renderPipeline) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of Sampler +WGPU_EXPORT void wgpuSamplerSetLabel(WGPUSampler sampler, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSamplerReference(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSamplerRelease(WGPUSampler sampler) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of ShaderModule +WGPU_EXPORT void wgpuShaderModuleGetCompilationInfo(WGPUShaderModule shaderModule, WGPUCompilationInfoCallback callback, void * userdata) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuShaderModuleSetLabel(WGPUShaderModule shaderModule, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuShaderModuleReference(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuShaderModuleRelease(WGPUShaderModule shaderModule) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of Surface +WGPU_EXPORT void wgpuSurfaceConfigure(WGPUSurface surface, WGPUSurfaceConfiguration const * config) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSurfaceGetCapabilities(WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities * capabilities) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSurfaceGetCurrentTexture(WGPUSurface surface, WGPUSurfaceTexture * surfaceTexture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTextureFormat wgpuSurfaceGetPreferredFormat(WGPUSurface surface, WGPUAdapter adapter) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSurfacePresent(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSurfaceUnconfigure(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSurfaceReference(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuSurfaceRelease(WGPUSurface surface) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of SurfaceCapabilities +WGPU_EXPORT void wgpuSurfaceCapabilitiesFreeMembers(WGPUSurfaceCapabilities capabilities) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of Texture +WGPU_EXPORT WGPUTextureView wgpuTextureCreateView(WGPUTexture texture, WGPU_NULLABLE WGPUTextureViewDescriptor const * descriptor) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureDestroy(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuTextureGetDepthOrArrayLayers(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTextureDimension wgpuTextureGetDimension(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTextureFormat wgpuTextureGetFormat(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuTextureGetHeight(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuTextureGetMipLevelCount(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuTextureGetSampleCount(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT WGPUTextureUsageFlags wgpuTextureGetUsage(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT uint32_t wgpuTextureGetWidth(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureSetLabel(WGPUTexture texture, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureReference(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureRelease(WGPUTexture texture) WGPU_FUNCTION_ATTRIBUTE; + +// Methods of TextureView +WGPU_EXPORT void wgpuTextureViewSetLabel(WGPUTextureView textureView, char const * label) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureViewReference(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; +WGPU_EXPORT void wgpuTextureViewRelease(WGPUTextureView textureView) WGPU_FUNCTION_ATTRIBUTE; + +#endif // !defined(WGPU_SKIP_DECLARATIONS) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBGPU_H_ diff --git a/bindings/sdl2wgpu/src/main/headers/webgpu/wgpu.h b/bindings/sdl2wgpu/src/main/headers/webgpu/wgpu.h new file mode 100644 index 00000000..d397fa68 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/headers/webgpu/wgpu.h @@ -0,0 +1,263 @@ +#ifndef WGPU_H_ +#define WGPU_H_ + +#include "webgpu.h" + +typedef enum WGPUNativeSType { + // Start at 0003 since that's allocated range for wgpu-native + WGPUSType_DeviceExtras = 0x00030001, + WGPUSType_RequiredLimitsExtras = 0x00030002, + WGPUSType_PipelineLayoutExtras = 0x00030003, + WGPUSType_ShaderModuleGLSLDescriptor = 0x00030004, + WGPUSType_SupportedLimitsExtras = 0x00030005, + WGPUSType_InstanceExtras = 0x00030006, + WGPUSType_BindGroupEntryExtras = 0x00030007, + WGPUSType_BindGroupLayoutEntryExtras = 0x00030008, + WGPUSType_QuerySetDescriptorExtras = 0x00030009, + WGPUSType_SurfaceConfigurationExtras = 0x0003000A, + WGPUNativeSType_Force32 = 0x7FFFFFFF +} WGPUNativeSType; + +typedef enum WGPUNativeFeature { + WGPUNativeFeature_PushConstants = 0x00030001, + WGPUNativeFeature_TextureAdapterSpecificFormatFeatures = 0x00030002, + WGPUNativeFeature_MultiDrawIndirect = 0x00030003, + WGPUNativeFeature_MultiDrawIndirectCount = 0x00030004, + WGPUNativeFeature_VertexWritableStorage = 0x00030005, + WGPUNativeFeature_TextureBindingArray = 0x00030006, + WGPUNativeFeature_SampledTextureAndStorageBufferArrayNonUniformIndexing = 0x00030007, + WGPUNativeFeature_PipelineStatisticsQuery = 0x00030008, + WGPUNativeFeature_Force32 = 0x7FFFFFFF +} WGPUNativeFeature; + +typedef enum WGPULogLevel { + WGPULogLevel_Off = 0x00000000, + WGPULogLevel_Error = 0x00000001, + WGPULogLevel_Warn = 0x00000002, + WGPULogLevel_Info = 0x00000003, + WGPULogLevel_Debug = 0x00000004, + WGPULogLevel_Trace = 0x00000005, + WGPULogLevel_Force32 = 0x7FFFFFFF +} WGPULogLevel; + +typedef enum WGPUInstanceBackend { + WGPUInstanceBackend_All = 0x00000000, + WGPUInstanceBackend_Vulkan = 1 << 0, + WGPUInstanceBackend_GL = 1 << 1, + WGPUInstanceBackend_Metal = 1 << 2, + WGPUInstanceBackend_DX12 = 1 << 3, + WGPUInstanceBackend_DX11 = 1 << 4, + WGPUInstanceBackend_BrowserWebGPU = 1 << 5, + WGPUInstanceBackend_Primary = WGPUInstanceBackend_Vulkan | WGPUInstanceBackend_Metal | + WGPUInstanceBackend_DX12 | + WGPUInstanceBackend_BrowserWebGPU, + WGPUInstanceBackend_Secondary = WGPUInstanceBackend_GL | WGPUInstanceBackend_DX11, + WGPUInstanceBackend_Force32 = 0x7FFFFFFF +} WGPUInstanceBackend; +typedef WGPUFlags WGPUInstanceBackendFlags; + +typedef enum WGPUInstanceFlag { + WGPUInstanceFlag_Default = 0x00000000, + WGPUInstanceFlag_Debug = 1 << 0, + WGPUInstanceFlag_Validation = 1 << 1, + WGPUInstanceFlag_DiscardHalLabels = 1 << 2, + WGPUInstanceFlag_Force32 = 0x7FFFFFFF +} WGPUInstanceFlag; +typedef WGPUFlags WGPUInstanceFlags; + +typedef enum WGPUDx12Compiler { + WGPUDx12Compiler_Undefined = 0x00000000, + WGPUDx12Compiler_Fxc = 0x00000001, + WGPUDx12Compiler_Dxc = 0x00000002, + WGPUDx12Compiler_Force32 = 0x7FFFFFFF +} WGPUDx12Compiler; + +typedef enum WGPUGles3MinorVersion { + WGPUGles3MinorVersion_Automatic = 0x00000000, + WGPUGles3MinorVersion_Version0 = 0x00000001, + WGPUGles3MinorVersion_Version1 = 0x00000002, + WGPUGles3MinorVersion_Version2 = 0x00000003, + WGPUGles3MinorVersion_Force32 = 0x7FFFFFFF +} WGPUGles3MinorVersion; + +typedef enum WGPUPipelineStatisticName { + WGPUPipelineStatisticName_VertexShaderInvocations = 0x00000000, + WGPUPipelineStatisticName_ClipperInvocations = 0x00000001, + WGPUPipelineStatisticName_ClipperPrimitivesOut = 0x00000002, + WGPUPipelineStatisticName_FragmentShaderInvocations = 0x00000003, + WGPUPipelineStatisticName_ComputeShaderInvocations = 0x00000004, + WGPUPipelineStatisticName_Force32 = 0x7FFFFFFF +} WGPUPipelineStatisticName WGPU_ENUM_ATTRIBUTE; + +typedef enum WGPUNativeQueryType { + WGPUNativeQueryType_PipelineStatistics = 0x00030000, + WGPUNativeQueryType_Force32 = 0x7FFFFFFF +} WGPUNativeQueryType WGPU_ENUM_ATTRIBUTE; + +typedef struct WGPUInstanceExtras { + WGPUChainedStruct chain; + WGPUInstanceBackendFlags backends; + WGPUInstanceFlags flags; + WGPUDx12Compiler dx12ShaderCompiler; + WGPUGles3MinorVersion gles3MinorVersion; + const char * dxilPath; + const char * dxcPath; +} WGPUInstanceExtras; + +typedef struct WGPUDeviceExtras { + WGPUChainedStruct chain; + const char * tracePath; +} WGPUDeviceExtras; + +typedef struct WGPUNativeLimits { + uint32_t maxPushConstantSize; + uint32_t maxNonSamplerBindings; +} WGPUNativeLimits; + +typedef struct WGPURequiredLimitsExtras { + WGPUChainedStruct chain; + WGPUNativeLimits limits; +} WGPURequiredLimitsExtras; + +typedef struct WGPUSupportedLimitsExtras { + WGPUChainedStructOut chain; + WGPUNativeLimits limits; +} WGPUSupportedLimitsExtras; + +typedef struct WGPUPushConstantRange { + WGPUShaderStageFlags stages; + uint32_t start; + uint32_t end; +} WGPUPushConstantRange; + +typedef struct WGPUPipelineLayoutExtras { + WGPUChainedStruct chain; + size_t pushConstantRangeCount; + WGPUPushConstantRange const * pushConstantRanges; +} WGPUPipelineLayoutExtras; + +typedef uint64_t WGPUSubmissionIndex; + +typedef struct WGPUWrappedSubmissionIndex { + WGPUQueue queue; + WGPUSubmissionIndex submissionIndex; +} WGPUWrappedSubmissionIndex; + +typedef struct WGPUShaderDefine { + char const * name; + char const * value; +} WGPUShaderDefine; + +typedef struct WGPUShaderModuleGLSLDescriptor { + WGPUChainedStruct chain; + WGPUShaderStage stage; + char const * code; + uint32_t defineCount; + WGPUShaderDefine * defines; +} WGPUShaderModuleGLSLDescriptor; + +typedef struct WGPURegistryReport { + size_t numAllocated; + size_t numKeptFromUser; + size_t numReleasedFromUser; + size_t numError; + size_t elementSize; +} WGPURegistryReport; + +typedef struct WGPUHubReport { + WGPURegistryReport adapters; + WGPURegistryReport devices; + WGPURegistryReport queues; + WGPURegistryReport pipelineLayouts; + WGPURegistryReport shaderModules; + WGPURegistryReport bindGroupLayouts; + WGPURegistryReport bindGroups; + WGPURegistryReport commandBuffers; + WGPURegistryReport renderBundles; + WGPURegistryReport renderPipelines; + WGPURegistryReport computePipelines; + WGPURegistryReport querySets; + WGPURegistryReport buffers; + WGPURegistryReport textures; + WGPURegistryReport textureViews; + WGPURegistryReport samplers; +} WGPUHubReport; + +typedef struct WGPUGlobalReport { + WGPURegistryReport surfaces; + WGPUBackendType backendType; + WGPUHubReport vulkan; + WGPUHubReport metal; + WGPUHubReport dx12; + WGPUHubReport gl; +} WGPUGlobalReport; + +typedef struct WGPUInstanceEnumerateAdapterOptions { + WGPUChainedStruct const * nextInChain; + WGPUInstanceBackendFlags backends; +} WGPUInstanceEnumerateAdapterOptions; + +typedef struct WGPUBindGroupEntryExtras { + WGPUChainedStruct chain; + WGPUBuffer const * buffers; + size_t bufferCount; + WGPUSampler const * samplers; + size_t samplerCount; + WGPUTextureView const * textureViews; + size_t textureViewCount; +} WGPUBindGroupEntryExtras; + +typedef struct WGPUBindGroupLayoutEntryExtras { + WGPUChainedStruct chain; + uint32_t count; +} WGPUBindGroupLayoutEntryExtras; + +typedef struct WGPUQuerySetDescriptorExtras { + WGPUChainedStruct chain; + WGPUPipelineStatisticName const * pipelineStatistics; + size_t pipelineStatisticCount; +} WGPUQuerySetDescriptorExtras WGPU_STRUCTURE_ATTRIBUTE; + +typedef struct WGPUSurfaceConfigurationExtras { + WGPUChainedStruct chain; + WGPUBool desiredMaximumFrameLatency; +} WGPUSurfaceConfigurationExtras WGPU_STRUCTURE_ATTRIBUTE; + +typedef void (*WGPULogCallback)(WGPULogLevel level, char const * message, void * userdata); + +#ifdef __cplusplus +extern "C" { +#endif + +void wgpuGenerateReport(WGPUInstance instance, WGPUGlobalReport * report); +size_t wgpuInstanceEnumerateAdapters(WGPUInstance instance, WGPU_NULLABLE WGPUInstanceEnumerateAdapterOptions const * options, WGPUAdapter * adapters); + +WGPUSubmissionIndex wgpuQueueSubmitForIndex(WGPUQueue queue, size_t commandCount, WGPUCommandBuffer const * commands); + +// Returns true if the queue is empty, or false if there are more queue submissions still in flight. +WGPUBool wgpuDevicePoll(WGPUDevice device, WGPUBool wait, WGPU_NULLABLE WGPUWrappedSubmissionIndex const * wrappedSubmissionIndex); + +void wgpuSetLogCallback(WGPULogCallback callback, void * userdata); + +void wgpuSetLogLevel(WGPULogLevel level); + +uint32_t wgpuGetVersion(void); + +void wgpuRenderPassEncoderSetPushConstants(WGPURenderPassEncoder encoder, WGPUShaderStageFlags stages, uint32_t offset, uint32_t sizeBytes, void const * data); + +void wgpuRenderPassEncoderMultiDrawIndirect(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, uint32_t count); +void wgpuRenderPassEncoderMultiDrawIndexedIndirect(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, uint32_t count); + +void wgpuRenderPassEncoderMultiDrawIndirectCount(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, WGPUBuffer count_buffer, uint64_t count_buffer_offset, uint32_t max_count); +void wgpuRenderPassEncoderMultiDrawIndexedIndirectCount(WGPURenderPassEncoder encoder, WGPUBuffer buffer, uint64_t offset, WGPUBuffer count_buffer, uint64_t count_buffer_offset, uint32_t max_count); + +void wgpuComputePassEncoderBeginPipelineStatisticsQuery(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); +void wgpuComputePassEncoderEndPipelineStatisticsQuery(WGPUComputePassEncoder computePassEncoder); +void wgpuRenderPassEncoderBeginPipelineStatisticsQuery(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint32_t queryIndex); +void wgpuRenderPassEncoderEndPipelineStatisticsQuery(WGPURenderPassEncoder renderPassEncoder); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/bindings/sdl2wgpu/src/main/public/sdl2webgpu.h b/bindings/sdl2wgpu/src/main/public/sdl2webgpu.h new file mode 100644 index 00000000..6aaf6428 --- /dev/null +++ b/bindings/sdl2wgpu/src/main/public/sdl2webgpu.h @@ -0,0 +1,49 @@ +/** + * This is an extension of SDL2 for WebGPU, abstracting away the details of + * OS-specific operations. + * + * This file is part of the "Learn WebGPU for C++" book. + * https://eliemichel.github.io/LearnWebGPU + * + * MIT License + * Copyright (c) 2022-2023 Elie Michel and the wgpu-native authors + * + * 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 _sdl2_webgpu_h_ +#define _sdl2_webgpu_h_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Get a WGPUSurface from a SDL2 window. + */ +WGPUSurface SDL_GetWGPUSurface(WGPUInstance instance, SDL_Window* window); + +#ifdef __cplusplus +} +#endif + +#endif // _sdl2_webgpu_h_ \ No newline at end of file diff --git a/bindings/wgpu-native/binaries/build.gradle.kts b/bindings/wgpu-native/binaries/build.gradle.kts new file mode 100644 index 00000000..8b250881 --- /dev/null +++ b/bindings/wgpu-native/binaries/build.gradle.kts @@ -0,0 +1,63 @@ +import org.jetbrains.kotlin.de.undercouch.gradle.tasks.download.Download + +plugins { + kotlin("jvm") +} + +val resourcesDirectory = project.file("src").resolve("main").resolve("resources") +val zipBuildDirectory = project.file("build").resolve("zip") +val baseUrl = "https://github.com/gfx-rs/wgpu-native/releases/download/${libs.versions.wgpu.get()}/" +val fileToDownload = listOf( + NativeLibrary( + "wgpu-macos-aarch64-release.zip", + resourcesDirectory.resolve("darwin-aarch64").resolve("libWGPU.dylib"), + "libwgpu_native.dylib" + ), + NativeLibrary( + "wgpu-macos-x86_64-release.zip", + resourcesDirectory.resolve("darwin-x86-64").resolve("libWGPU.dylib"), + "libwgpu_native.dylib" + ), + NativeLibrary( + "wgpu-windows-x86_64-release.zip", + resourcesDirectory.resolve("win32").resolve("libWGPU.dll"), + "wgpu_native.dll" + ), +).forEach { (fileName, target, zipFilename) -> + val zipFile = zipBuildDirectory.resolve(fileName) + val downloadTask = downloadInto(fileName, zipFile) + val unzipTask = unzipTask(zipFile, target, zipFilename, downloadTask) + + tasks.named("processResources") { + dependsOn(unzipTask) + } +} + + +fun downloadInto(fileName: String, target: File): Task { + val url = "$baseUrl$fileName" + val taskName = "downloadFile-$fileName" + return tasks.register(taskName) { + onlyIf { !target.exists() } + src(url) + dest(target) + }.get() +} + +fun unzipTask( + zipFile: File, + target: File, + zipFilename: String, + downloadTask: Task +) = tasks.register("unzip-${zipFile.name}") { + onlyIf { !target.exists() } + from(zipTree(zipFile)) + include(zipFilename) + into(target.parent) + rename { fileName -> + fileName.replace(zipFilename, target.name) + } + dependsOn(downloadTask) +}.get() + +data class NativeLibrary(val remoteFile: String, val targetFile: File, val zipFileName: String) \ No newline at end of file diff --git a/bindings/wgpu-native/build.gradle.kts b/bindings/wgpu-native/build.gradle.kts index 636afdab..dd4212d2 100644 --- a/bindings/wgpu-native/build.gradle.kts +++ b/bindings/wgpu-native/build.gradle.kts @@ -1,9 +1,14 @@ +plugins { + kotlin("jvm") version libs.versions.kotlin + id("com.gradle.plugin-publish") version "1.0.0" +} allprojects { repositories { + mavenLocal() mavenCentral() } diff --git a/bindings/wgpu-native/example/build.gradle.kts b/bindings/wgpu-native/example/build.gradle.kts new file mode 100644 index 00000000..162ad613 --- /dev/null +++ b/bindings/wgpu-native/example/build.gradle.kts @@ -0,0 +1,41 @@ + +plugins { + kotlin("jvm") + application + id("org.beryx.jlink") version "3.0.1" +} + +//version = "1.0.0" + +dependencies { + api(project(":wgpu4k")) + api(project(":wgpu-binaries")) + api("$group:sdl2-4k:$version") + api("$group:sdl2-binaries:$version") + testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation(libs.kotest) +} + +application { + mainModule = "io.ygdrasil" + mainClass.set("io.ygdrasil.triangle.MainKt") + applicationDefaultJvmArgs += "-XstartOnFirstThread" + //tasks.run.get().workingDir = project.projectDir.resolve("src").resolve("main").resolve("resources") +} + +jlink { + addOptions("--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages") + launcher{ + moduleName = "io.ygdrasil" + //name = "Snake" + jvmArgs = listOf("-XstartOnFirstThread") + } +} + + +tasks.named("compileJava", JavaCompile::class.java) { + options.compilerArgumentProviders.add(CommandLineArgumentProvider { + // Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work + listOf("--patch-module", "io.ygdrasil=${sourceSets["main"].output.asPath}") + }) +} \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/CGFloat.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/CGFloat.kt new file mode 100644 index 00000000..220d47af --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/CGFloat.kt @@ -0,0 +1,41 @@ +package io.ygdrasil.darwin + +import com.sun.jna.FromNativeContext +import com.sun.jna.Native +import com.sun.jna.NativeMapped +import com.sun.jna.Structure + +@Structure.FieldOrder("value") +class CGFloat(val value: Double) : Number(), NativeMapped { + constructor() : this(0.0) + constructor(value: Float) : this(value.toDouble()) + constructor(value: Number) : this(value.toDouble()) + + companion object { + @JvmStatic + val SIZE = Native.LONG_SIZE + } + + override fun toByte(): Byte = value.toInt().toByte() + override fun toChar(): Char = value.toInt().toChar() + override fun toDouble(): Double = value + override fun toFloat(): Float = value.toFloat() + override fun toInt(): Int = value.toInt() + override fun toLong(): Long = value.toLong() + override fun toShort(): Short = value.toInt().toShort() + override fun nativeType(): Class<*> = when (SIZE) { + 4 -> Float::class.java + 8 -> Double::class.java + else -> TODO() + } + + override fun toNative(): Any = when (SIZE) { + 4 -> this.toFloat() + 8 -> this.toDouble() + else -> TODO() + } + + override fun fromNative(nativeValue: Any, context: FromNativeContext?): Any = CGFloat((nativeValue as Number).toDouble()) + + override fun toString(): String = "$value" +} \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/JNA.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/JNA.kt new file mode 100644 index 00000000..1eac8f6d --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/JNA.kt @@ -0,0 +1,27 @@ +package io.ygdrasil.darwin + +import com.sun.jna.FunctionMapper +import com.sun.jna.Library +import com.sun.jna.Native + +internal annotation class NativeName(val name: String) { + companion object { + val options = mapOf( + Library.OPTION_FUNCTION_MAPPER to FunctionMapper { _, method -> + method.getAnnotation(NativeName::class.java)?.name ?: method.name + } + ) + } +} + +internal inline fun NativeLoad(name: String): T = + Native.load(name, T::class.java, NativeName.options) as T + +internal typealias ID = Long + +internal fun Long.msgSend(sel: String, vararg args: Any?): Long = ObjectiveC.objc_msgSend(this, sel(sel), *args) + +internal fun sel(name: String): Long = ObjectiveC + .sel_registerName(name) + .takeIf { it != 0L } + ?: error("Invalid selector '$name'") \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSClass.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSClass.kt new file mode 100644 index 00000000..c2365ac7 --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSClass.kt @@ -0,0 +1,5 @@ +package io.ygdrasil.darwin + +open class NSClass(val name: String) : NSObject(ObjectiveC.objc_getClass(name)) { + val OBJ_CLASS = id +} \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSObject.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSObject.kt new file mode 100644 index 00000000..f7d3c86e --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSObject.kt @@ -0,0 +1,22 @@ +package io.ygdrasil.darwin + +import com.sun.jna.FromNativeContext +import com.sun.jna.NativeMapped + +open class NSObject(val id: Long) : NativeMapped { + fun msgSend(sel: String, vararg args: Any?): Long = ObjectiveC.objc_msgSend(id, sel(sel), *args) + fun msgSendInt(sel: String, vararg args: Any?): Int = ObjectiveC.objc_msgSendInt(id, sel(sel), *args) + fun msgSendCGFloat(sel: String, vararg args: Any?): CGFloat = ObjectiveC.objc_msgSendCGFloat(id, sel(sel), *args) + fun msgSend_stret(sel: String, vararg args: Any?) = ObjectiveC.objc_msgSend_stret(id, sel(sel), *args) + + fun alloc(): Long = msgSend("alloc") + + companion object : NSClass("NSObject") + + override fun toNative(): Any = this.id + + override fun fromNative(nativeValue: Any, context: FromNativeContext?): Any = NSObject((nativeValue as Number).toLong()) + override fun nativeType(): Class<*> = Long::class.javaPrimitiveType!! +} + + diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSRect.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSRect.kt new file mode 100644 index 00000000..7e0c61af --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSRect.kt @@ -0,0 +1,53 @@ +package io.ygdrasil.darwin + +import com.sun.jna.Pointer +import com.sun.jna.Structure + +@Structure.FieldOrder("x", "y", "width", "height") +open class NSRect : Structure { + @JvmField var x: Double = 0.0 + @JvmField var y: Double = 0.0 + @JvmField var width: Double = 0.0 + @JvmField var height: Double = 0.0 + + constructor() { + allocateMemory() + autoWrite() + } + + constructor(x: Number, y: Number, width: Number, height: Number) : this() { + this.x = x.toDouble() + this.y = y.toDouble() + this.width = width.toDouble() + this.height = height.toDouble() + } + + class ByReference() : NSRect(), Structure.ByReference { + constructor(x: Number, y: Number, width: Number, height: Number) : this() { + this.x = x.toDouble() + this.y = y.toDouble() + this.width = width.toDouble() + this.height = height.toDouble() + } + } + class ByValue() : NSRect(), Structure.ByValue { + constructor(x: Number, y: Number, width: Number, height: Number) : this() { + this.x = x.toDouble() + this.y = y.toDouble() + this.width = width.toDouble() + this.height = height.toDouble() + } + } + + override fun toString(): String = "NSRect($x, $y, $width, $height)" +} + +@Structure.FieldOrder("scancode", "sym", "mod", "unused") +open class SDL_Keysym(pointer: Pointer? = null) : Structure(pointer) { + @JvmField var scancode: Int = 0 + @JvmField var sym: Int = 0 + @JvmField var mod: Int = 0 + @JvmField var unused: Int = 0 + + class Ref(pointer: Pointer? = null) : SDL_Keysym(pointer), ByReference +} \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSWindow.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSWindow.kt new file mode 100644 index 00000000..ad18e599 --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/NSWindow.kt @@ -0,0 +1,11 @@ +package io.ygdrasil.darwin + + +val NSWindowClass2 by lazy { NSClass("NSWindow") } + +class NSWindow2(id: Long) : NSObject(id) { + + constructor(id: NSRect, windowStyle: Int, NSBackingStoreBuffered: Int, b: Boolean) + : this(NSWindowClass2.alloc().msgSend("initWithContentRect:styleMask:backing:defer:", id, windowStyle, NSBackingStoreBuffered, b)) + +} \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/ObjectiveC.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/ObjectiveC.kt new file mode 100644 index 00000000..1b3d1a03 --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/darwin/ObjectiveC.kt @@ -0,0 +1,96 @@ +package io.ygdrasil.darwin + +import com.sun.jna.* +/** + * https://developer.apple.com/documentation/objectivec/objective-c_runtime + */ +interface ObjectiveCLibrary : Library { + fun objc_copyProtocolList(outCount: IntArray): Pointer + fun protocol_getName(protocol: Long): String + + fun objc_getClass(name: String): Long + + fun objc_getClassList(buffer: Pointer?, bufferCount: Int): Int + + fun objc_getProtocol(name: String): Long + + fun class_addProtocol(a: Long, b: Long): Long + fun class_copyMethodList(clazz: Long, items: IntArray): Pointer + + // typedef struct objc_method_description { + // SEL name; // The name of the method + // char *types; // The types of the method arguments + // } MethodDescription; + fun protocol_copyMethodDescriptionList(proto: Long, isRequiredMethod: Boolean, isInstanceMethod: Boolean, outCount: IntArray): Pointer + + fun objc_registerClassPair(cls: Long) + fun objc_lookUpClass(name: String): Long + + fun objc_msgSend(vararg args: Any?): Long + @NativeName("objc_msgSend") + fun objc_msgSendInt(vararg args: Any?): Int + @NativeName("objc_msgSend") + fun objc_msgSendVoid(vararg args: Any?): Unit + @NativeName("objc_msgSend") + fun objc_msgSendCGFloat(vararg args: Any?): CGFloat + @NativeName("objc_msgSend") + fun objc_msgSendFloat(vararg args: Any?): Float + @NativeName("objc_msgSend_stret") + fun objc_msgSend_stret(structPtr: Any?, vararg args: Any?) + @NativeName("objc_msgSend_stret") + fun objc_msgSend_stret(stretAddr: Structure, theReceiver: Long, theSelector: Long, vararg args: Any?): Unit + + fun method_getName(m: Long): Long + @NativeName("method_getName") + fun method_getNameString(m: Long): String + + fun sel_registerName(name: String): Long + fun sel_getName(sel: Long): String + @NativeName("sel_getName") + fun sel_getNameString(sel: String): String + + fun objc_allocateClassPair(clazz: Long, name: String, extraBytes: Int): Long + fun object_getIvar(obj: Long, ivar: Long): Long + + fun class_getInstanceVariable(clazz: ID, name: String): ID + fun class_getProperty(clazz: ID, name: String): ID + + fun class_addMethod(cls: Long, name: Long, imp: Callback, types: String): Long + fun class_conformsToProtocol(cls: Long, protocol: Long): Boolean + + fun object_getClass(obj: ID): ID + fun class_getName(clazz: ID): String + + fun object_getClassName(obj: ID): String + fun class_getImageName(obj: ID): String + + fun property_getName(prop: ID): String + fun property_getAttributes(prop: ID): String + + fun class_getInstanceMethod(cls: ID, id: NativeLong): NativeLong + + fun method_getReturnType(id: NativeLong, dst: Pointer, dst_length: NativeLong) + fun method_getTypeEncoding(ptr: Pointer): String + + fun class_createInstance(cls: ID, extraBytes: NativeLong): ID + fun class_copyPropertyList(cls: ID, outCountPtr: IntArray): Pointer + fun class_copyIvarList(cls: ID, outCountPtr: IntArray): Pointer + fun ivar_getName(ivar: Pointer?): String? + fun ivar_getTypeEncoding(ivar: Pointer?): String? + +} + +val ObjectiveC by lazy { + NativeLoad("/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics") + NativeLoad("objc") +} + +fun nsAutoreleasePool(block: () -> T): T { + val pool = NSClass("NSAutoreleasePool").alloc().msgSend("init") + try { + return block() + } finally { + pool.msgSend("release") + } +} + diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/framework.c b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/framework.c new file mode 100644 index 00000000..9cee574e --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/framework.c @@ -0,0 +1,166 @@ +#include "framework.h" + +static void log_callback(WGPULogLevel level, char const *message, + void *userdata) { + UNUSED(userdata) + char *level_str; + switch (level) { + case WGPULogLevel_Error: + level_str = "error"; + break; + case WGPULogLevel_Warn: + level_str = "warn"; + break; + case WGPULogLevel_Info: + level_str = "info"; + break; + case WGPULogLevel_Debug: + level_str = "debug"; + break; + case WGPULogLevel_Trace: + level_str = "trace"; + break; + default: + level_str = "unknown_level"; + } + fprintf(stderr, "[wgpu] [%s] %s\n", level_str, message); +} + +void frmwrk_setup_logging(WGPULogLevel level) { + wgpuSetLogCallback(log_callback, NULL); + wgpuSetLogLevel(level); +} + +WGPUShaderModule frmwrk_load_shader_module(WGPUDevice device, + const char *name) { + FILE *file = NULL; + char *buf = NULL; + WGPUShaderModule shader_module = NULL; + + file = fopen(name, "rb"); + if (!file) { + perror("fopen"); + goto cleanup; + } + + if (fseek(file, 0, SEEK_END) != 0) { + perror("fseek"); + goto cleanup; + } + long length = ftell(file); + if (length == -1) { + perror("ftell"); + goto cleanup; + } + if (fseek(file, 0, SEEK_SET) != 0) { + perror("fseek"); + goto cleanup; + } + + buf = malloc(length + 1); + assert(buf); + fread(buf, 1, length, file); + buf[length] = 0; + + shader_module = wgpuDeviceCreateShaderModule( + device, &(const WGPUShaderModuleDescriptor){ + .label = name, + .nextInChain = + (const WGPUChainedStruct *)&( + const WGPUShaderModuleWGSLDescriptor){ + .chain = + (const WGPUChainedStruct){ + .sType = WGPUSType_ShaderModuleWGSLDescriptor, + }, + .code = buf, + }, + }); + +cleanup: + if (file) + fclose(file); + if (buf) + free(buf); + return shader_module; +} + +#define COPY_BUFFER_ALIGNMENT 4 +#define MAX(A, B) ((A) > (B) ? (A) : (B)) + +WGPUBuffer frmwrk_device_create_buffer_init( + WGPUDevice device, const frmwrk_buffer_init_descriptor *descriptor) { + assert(descriptor); + if (descriptor->content_size == 0) { + return wgpuDeviceCreateBuffer(device, &(WGPUBufferDescriptor){ + .label = descriptor->label, + .size = 0, + .usage = descriptor->usage, + .mappedAtCreation = false, + }); + } + + size_t unpadded_size = descriptor->content_size; + size_t align_mask = COPY_BUFFER_ALIGNMENT - 1; + size_t padded_size = + MAX((unpadded_size + align_mask) & ~align_mask, COPY_BUFFER_ALIGNMENT); + WGPUBuffer buffer = + wgpuDeviceCreateBuffer(device, &(WGPUBufferDescriptor){ + .label = descriptor->label, + .size = padded_size, + .usage = descriptor->usage, + .mappedAtCreation = true, + }); + void *buf = wgpuBufferGetMappedRange(buffer, 0, unpadded_size); + memcpy(buf, descriptor->content, unpadded_size); + wgpuBufferUnmap(buffer); + + return buffer; +} + +#define print_registry_report(report, prefix) \ + printf("%snumAllocated=%zu\n", prefix, report.numAllocated); \ + printf("%snumKeptFromUser=%zu\n", prefix, report.numKeptFromUser); \ + printf("%snumReleasedFromUser=%zu\n", prefix, report.numReleasedFromUser); \ + printf("%snumError=%zu\n", prefix, report.numError); \ + printf("%selementSize=%zu\n", prefix, report.elementSize) + +#define print_hub_report(report, prefix) \ + print_registry_report(report.adapters, prefix "adapter."); \ + print_registry_report(report.devices, prefix "devices."); \ + print_registry_report(report.queues, prefix "queues."); \ + print_registry_report(report.pipelineLayouts, prefix "pipelineLayouts."); \ + print_registry_report(report.shaderModules, prefix "shaderModules."); \ + print_registry_report(report.bindGroupLayouts, prefix "bindGroupLayouts."); \ + print_registry_report(report.bindGroups, prefix "bindGroups."); \ + print_registry_report(report.commandBuffers, prefix "commandBuffers."); \ + print_registry_report(report.renderBundles, prefix "renderBundles."); \ + print_registry_report(report.renderPipelines, prefix "renderPipelines."); \ + print_registry_report(report.computePipelines, prefix "computePipelines."); \ + print_registry_report(report.querySets, prefix "querySets."); \ + print_registry_report(report.textures, prefix "textures."); \ + print_registry_report(report.textureViews, prefix "textureViews."); \ + print_registry_report(report.samplers, prefix "samplers.") + +void frmwrk_print_global_report(WGPUGlobalReport report) { + printf("struct WGPUGlobalReport {\n"); + print_registry_report(report.surfaces, "\tsurfaces."); + + switch (report.backendType) { + case WGPUBackendType_D3D12: + print_hub_report(report.dx12, "\tdx12."); + break; + case WGPUBackendType_Metal: + print_hub_report(report.metal, "\tmetal."); + break; + case WGPUBackendType_Vulkan: + print_hub_report(report.vulkan, "\tvulkan."); + break; + case WGPUBackendType_OpenGL: + print_hub_report(report.gl, "\tgl."); + break; + default: + printf("[framework] frmwrk_print_global_report: invalid backend type: %d", + report.backendType); + } + printf("}\n"); +} diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/framework.h b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/framework.h new file mode 100644 index 00000000..8634b20b --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/framework.h @@ -0,0 +1,26 @@ +#ifndef FRAMEWORK_H +#define FRAMEWORK_H + +#include "wgpu.h" +#include +#include +#include +#include +#include + +#define UNUSED(x) (void)x; + +typedef struct frmwrk_buffer_init_descriptor { + WGPU_NULLABLE char const *label; + WGPUBufferUsageFlags usage; + void *content; + size_t content_size; +} frmwrk_buffer_init_descriptor; + +void frmwrk_setup_logging(WGPULogLevel level); +WGPUShaderModule frmwrk_load_shader_module(WGPUDevice device, const char *name); +void frmwrk_print_global_report(WGPUGlobalReport report); +WGPUBuffer frmwrk_device_create_buffer_init( + WGPUDevice device, const frmwrk_buffer_init_descriptor *descriptor); + +#endif // FRAMEWORK_H diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/helloTriangle.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/helloTriangle.kt new file mode 100644 index 00000000..c7fcad39 --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/helloTriangle.kt @@ -0,0 +1,150 @@ +import com.sun.jna.NativeLong +import com.sun.jna.ptr.IntByReference +import io.ygdrasil.libsdl.SDL_Event +import io.ygdrasil.libsdl.SDL_GetWindowSize +import io.ygdrasil.libsdl.SDL_PollEvent +import io.ygdrasil.libsdl.SDL_Window +import io.ygdrasil.triangle.LOG_PREFIX +import io.ygdrasil.triangle.shader +import libwgpu.* + + +fun helloTriangle( + device: WGPUDevice, + adapter: WGPUAdapterImpl, + surface: WGPUSurface, + window: SDL_Window, + config: WGPUSurfaceConfiguration +) { + + val queue = wgpuDeviceGetQueue(device) ?: error("fail to get queue") + + val shader_module = wgpuDeviceCreateShaderModule( + device, + WGPUShaderModuleDescriptor().apply { + label = "WGPUShaderModuleDescriptorKt" + nextInChain = WGPUShaderModuleWGSLDescriptor.ByReference().apply { + code = shader + chain.apply { + sType = WGPUSType.WGPUSType_ShaderModuleWGSLDescriptor.value + } + } + } + ) + check(shader_module != null) { "fail to get shader module" } + + val pipeline_layout = wgpuDeviceCreatePipelineLayout(device, WGPUPipelineLayoutDescriptor().apply { + label = "pipeline_layout" + }) ?: error("fail to create pipeline layout") + + val surface_capabilities = WGPUSurfaceCapabilities(); + wgpuSurfaceGetCapabilities(surface, adapter, surface_capabilities); + + val render_pipeline = wgpuDeviceCreateRenderPipeline( + device, + WGPURenderPipelineDescriptor().apply { + label = "render_pipeline" + layout = pipeline_layout + vertex.apply { + module = shader_module + entryPoint = "vs_main" + } + fragment = WGPUFragmentState.ByReference().apply { + module = shader_module + entryPoint = "fs_main" + targetCount = NativeLong(1) + targets = arrayOf( WGPUColorTargetState.ByReference().apply { + format = surface_capabilities.formats!!.getInt(0) + writeMask = WGPUColorWriteMask.WGPUColorWriteMask_All.value + }) + } + primitive.apply { + topology = WGPUPrimitiveTopology.WGPUPrimitiveTopology_TriangleList.value + } + multisample.apply { + count = 1 + mask = 0xFFFFFFF + } + }) ?: error("fail to create render pipeline") + + while (true) { + + val surface_texture = WGPUSurfaceTexture() + wgpuSurfaceGetCurrentTexture(surface, surface_texture); + when (WGPUSurfaceGetCurrentTextureStatus.of(surface_texture.status) ?: error("surface status not found")) { + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_Success -> Unit // All good, could check for `surface_texture.suboptimal` here. + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_Timeout, + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_Outdated, + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_Lost -> { + // Skip this frame, and re-configure surface. + if (surface_texture.texture != null) { + wgpuTextureRelease(surface_texture.texture); + } + val width = IntByReference() + val height = IntByReference() + SDL_GetWindowSize(window, width.pointer, height.pointer) + config.width = width.value + config.height = height.value + wgpuSurfaceConfigure(surface, config) + continue; + } + + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_OutOfMemory, + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_DeviceLost, + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_Force32 -> { + // Fatal error + println(LOG_PREFIX + " get_current_texture status=%#.8x\n".format(surface_texture.status)) + return; + } + + } + val view = wgpuTextureCreateView(surface_texture.texture, null) ?: error("fail to get frame") + val queue = wgpuDeviceGetQueue(device) ?: error("fail to get queue") + val encoder = wgpuDeviceCreateCommandEncoder(device, WGPUCommandEncoderDescriptor().apply { + label = "WGPUCommandEncoderDescriptorKt" + }) + + val render_pass_encoder = wgpuCommandEncoderBeginRenderPass(encoder, + WGPURenderPassDescriptor().apply { + label = "WGPURenderPassDescriptorKt" + colorAttachmentCount = 1L + colorAttachments = arrayOf(WGPURenderPassColorAttachment.ByReference().apply { + this.view = view + loadOp = WGPULoadOp.WGPULoadOp_Clear.value + storeOp = WGPUStoreOp.WGPUStoreOp_Store.value + clearValue = WGPUColor().apply { + r = 0.0 + g = 1.0 + b = 0.0 + a = 1.0 + } + }) + } + ) + wgpuRenderPassEncoderEnd(render_pass_encoder) + + wgpuRenderPassEncoderSetPipeline(render_pass_encoder, render_pipeline); + wgpuRenderPassEncoderDraw(render_pass_encoder, 3, 1, 0, 0); + wgpuRenderPassEncoderEnd(render_pass_encoder); + + val commandBuffer = wgpuCommandEncoderFinish(encoder, WGPUCommandBufferDescriptor().apply { + label = "WGPUCommandBufferDescriptorKt" + }) ?: error("fail to get commandBuffer") + wgpuQueueSubmit(queue, NativeLong(1), arrayOf(commandBuffer)) + + wgpuSurfacePresent(surface); + + wgpuCommandBufferRelease(commandBuffer); + wgpuRenderPassEncoderRelease(render_pass_encoder); + wgpuCommandEncoderRelease(encoder); + wgpuTextureViewRelease(view); + wgpuTextureRelease(surface_texture.texture); + + val event = SDL_Event() + while (SDL_PollEvent(event) != 0) { + + } + } + + +} \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/main.c b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/main.c new file mode 100644 index 00000000..869265c3 --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/main.c @@ -0,0 +1,377 @@ +#include "framework.h" +#include "webgpu-headers/webgpu.h" +#include "wgpu.h" +#include +#include +#include +#include +#include + +#if defined(WGPU_TARGET_MACOS) +#include +#include +#endif + +#include +#if defined(WGPU_TARGET_MACOS) +#define GLFW_EXPOSE_NATIVE_COCOA +#elif defined(WGPU_TARGET_LINUX_X11) +#define GLFW_EXPOSE_NATIVE_X11 +#elif defined(WGPU_TARGET_LINUX_WAYLAND) +#define GLFW_EXPOSE_NATIVE_WAYLAND +#elif defined(WGPU_TARGET_WINDOWS) +#define GLFW_EXPOSE_NATIVE_WIN32 +#endif +#include + +#define LOG_PREFIX "[triangle]" + +struct demo { + WGPUInstance instance; + WGPUSurface surface; + WGPUAdapter adapter; + WGPUDevice device; + WGPUSurfaceConfiguration config; +}; + +static void handle_request_adapter(WGPURequestAdapterStatus status, + WGPUAdapter adapter, char const *message, + void *userdata) { + if (status == WGPURequestAdapterStatus_Success) { + struct demo *demo = userdata; + demo->adapter = adapter; + } else { + printf(LOG_PREFIX " request_adapter status=%#.8x message=%s\n", status, + message); + } +} +static void handle_request_device(WGPURequestDeviceStatus status, + WGPUDevice device, char const *message, + void *userdata) { + if (status == WGPURequestDeviceStatus_Success) { + struct demo *demo = userdata; + demo->device = device; + } else { + printf(LOG_PREFIX " request_device status=%#.8x message=%s\n", status, + message); + } +} +static void handle_glfw_key(GLFWwindow *window, int key, int scancode, + int action, int mods) { + UNUSED(scancode) + UNUSED(mods) + if (key == GLFW_KEY_R && (action == GLFW_PRESS || action == GLFW_REPEAT)) { + struct demo *demo = glfwGetWindowUserPointer(window); + if (!demo || !demo->instance) + return; + + WGPUGlobalReport report; + wgpuGenerateReport(demo->instance, &report); + frmwrk_print_global_report(report); + } +} +static void handle_glfw_framebuffer_size(GLFWwindow *window, int width, + int height) { + if (width == 0 && height == 0) { + return; + } + + struct demo *demo = glfwGetWindowUserPointer(window); + if (!demo) + return; + + demo->config.width = width; + demo->config.height = height; + + wgpuSurfaceConfigure(demo->surface, &demo->config); +} + +int main(int argc, char *argv[]) { + UNUSED(argc) + UNUSED(argv) + frmwrk_setup_logging(WGPULogLevel_Warn); + +#if defined(WGPU_TARGET_LINUX_WAYLAND) + glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_WAYLAND); +#endif + assert(glfwInit()); + + struct demo demo = {0}; + demo.instance = wgpuCreateInstance(NULL); + assert(demo.instance); + + glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); + GLFWwindow *window = + glfwCreateWindow(640, 480, "triangle [wgpu-native + glfw]", NULL, NULL); + assert(window); + + glfwSetWindowUserPointer(window, (void *)&demo); + glfwSetKeyCallback(window, handle_glfw_key); + glfwSetFramebufferSizeCallback(window, handle_glfw_framebuffer_size); + +#if defined(WGPU_TARGET_MACOS) + { + id metal_layer = NULL; + NSWindow *ns_window = glfwGetCocoaWindow(window); + [ns_window.contentView setWantsLayer:YES]; + metal_layer = [CAMetalLayer layer]; + [ns_window.contentView setLayer:metal_layer]; + demo.surface = wgpuInstanceCreateSurface( + demo.instance, + &(const WGPUSurfaceDescriptor){ + .nextInChain = + (const WGPUChainedStruct *)&( + const WGPUSurfaceDescriptorFromMetalLayer){ + .chain = + (const WGPUChainedStruct){ + .sType = WGPUSType_SurfaceDescriptorFromMetalLayer, + }, + .layer = metal_layer, + }, + }); + assert(demo.surface); + } +#elif defined(WGPU_TARGET_LINUX_X11) + { + Display *x11_display = glfwGetX11Display(); + Window x11_window = glfwGetX11Window(window); + demo.surface = wgpuInstanceCreateSurface( + demo.instance, + &(const WGPUSurfaceDescriptor){ + .nextInChain = + (const WGPUChainedStruct *)&( + const WGPUSurfaceDescriptorFromXlibWindow){ + .chain = + (const WGPUChainedStruct){ + .sType = WGPUSType_SurfaceDescriptorFromXlibWindow, + }, + .display = x11_display, + .window = x11_window, + }, + }); + assert(demo.surface); + } +#elif defined(WGPU_TARGET_LINUX_WAYLAND) + { + struct wl_display *wayland_display = glfwGetWaylandDisplay(); + struct wl_surface *wayland_surface = glfwGetWaylandWindow(window); + demo.surface = wgpuInstanceCreateSurface( + demo.instance, + &(const WGPUSurfaceDescriptor){ + .nextInChain = + (const WGPUChainedStruct *)&( + const WGPUSurfaceDescriptorFromWaylandSurface){ + .chain = + (const WGPUChainedStruct){ + .sType = + WGPUSType_SurfaceDescriptorFromWaylandSurface, + }, + .display = wayland_display, + .surface = wayland_surface, + }, + }); + assert(demo.surface); + } +#elif defined(WGPU_TARGET_WINDOWS) + { + HWND hwnd = glfwGetWin32Window(window); + HINSTANCE hinstance = GetModuleHandle(NULL); + demo.surface = wgpuInstanceCreateSurface( + demo.instance, + &(const WGPUSurfaceDescriptor){ + .nextInChain = + (const WGPUChainedStruct *)&( + const WGPUSurfaceDescriptorFromWindowsHWND){ + .chain = + (const WGPUChainedStruct){ + .sType = WGPUSType_SurfaceDescriptorFromWindowsHWND, + }, + .hinstance = hinstance, + .hwnd = hwnd, + }, + }); + assert(demo.surface); + } +#else +#error "Unsupported WGPU_TARGET" +#endif + + wgpuInstanceRequestAdapter(demo.instance, + &(const WGPURequestAdapterOptions){ + .compatibleSurface = demo.surface, + }, + handle_request_adapter, &demo); + assert(demo.adapter); + + wgpuAdapterRequestDevice(demo.adapter, NULL, handle_request_device, &demo); + assert(demo.device); + + WGPUQueue queue = wgpuDeviceGetQueue(demo.device); + assert(queue); + + WGPUShaderModule shader_module = + frmwrk_load_shader_module(demo.device, "shader.wgsl"); + assert(shader_module); + + WGPUPipelineLayout pipeline_layout = wgpuDeviceCreatePipelineLayout( + demo.device, &(const WGPUPipelineLayoutDescriptor){ + .label = "pipeline_layout", + }); + assert(pipeline_layout); + + WGPUSurfaceCapabilities surface_capabilities = {0}; + wgpuSurfaceGetCapabilities(demo.surface, demo.adapter, &surface_capabilities); + + WGPURenderPipeline render_pipeline = wgpuDeviceCreateRenderPipeline( + demo.device, + &(const WGPURenderPipelineDescriptor){ + .label = "render_pipeline", + .layout = pipeline_layout, + .vertex = + (const WGPUVertexState){ + .module = shader_module, + .entryPoint = "vs_main", + }, + .fragment = + &(const WGPUFragmentState){ + .module = shader_module, + .entryPoint = "fs_main", + .targetCount = 1, + .targets = + (const WGPUColorTargetState[]){ + (const WGPUColorTargetState){ + .format = surface_capabilities.formats[0], + .writeMask = WGPUColorWriteMask_All, + }, + }, + }, + .primitive = + (const WGPUPrimitiveState){ + .topology = WGPUPrimitiveTopology_TriangleList, + }, + .multisample = + (const WGPUMultisampleState){ + .count = 1, + .mask = 0xFFFFFFFF, + }, + }); + assert(render_pipeline); + + demo.config = (const WGPUSurfaceConfiguration){ + .device = demo.device, + .usage = WGPUTextureUsage_RenderAttachment, + .format = surface_capabilities.formats[0], + .presentMode = WGPUPresentMode_Fifo, + .alphaMode = surface_capabilities.alphaModes[0], + }; + + { + int width, height; + glfwGetWindowSize(window, &width, &height); + demo.config.width = width; + demo.config.height = height; + } + + wgpuSurfaceConfigure(demo.surface, &demo.config); + + while (!glfwWindowShouldClose(window)) { + glfwPollEvents(); + + WGPUSurfaceTexture surface_texture; + wgpuSurfaceGetCurrentTexture(demo.surface, &surface_texture); + switch (surface_texture.status) { + case WGPUSurfaceGetCurrentTextureStatus_Success: + // All good, could check for `surface_texture.suboptimal` here. + break; + case WGPUSurfaceGetCurrentTextureStatus_Timeout: + case WGPUSurfaceGetCurrentTextureStatus_Outdated: + case WGPUSurfaceGetCurrentTextureStatus_Lost: { + // Skip this frame, and re-configure surface. + if (surface_texture.texture != NULL) { + wgpuTextureRelease(surface_texture.texture); + } + int width, height; + glfwGetWindowSize(window, &width, &height); + if (width != 0 && height != 0) { + demo.config.width = width; + demo.config.height = height; + wgpuSurfaceConfigure(demo.surface, &demo.config); + } + continue; + } + case WGPUSurfaceGetCurrentTextureStatus_OutOfMemory: + case WGPUSurfaceGetCurrentTextureStatus_DeviceLost: + case WGPUSurfaceGetCurrentTextureStatus_Force32: + // Fatal error + printf(LOG_PREFIX " get_current_texture status=%#.8x\n", + surface_texture.status); + abort(); + } + assert(surface_texture.texture); + + WGPUTextureView frame = + wgpuTextureCreateView(surface_texture.texture, NULL); + assert(frame); + + WGPUCommandEncoder command_encoder = wgpuDeviceCreateCommandEncoder( + demo.device, &(const WGPUCommandEncoderDescriptor){ + .label = "command_encoder", + }); + assert(command_encoder); + + WGPURenderPassEncoder render_pass_encoder = + wgpuCommandEncoderBeginRenderPass( + command_encoder, &(const WGPURenderPassDescriptor){ + .label = "render_pass_encoder", + .colorAttachmentCount = 1, + .colorAttachments = + (const WGPURenderPassColorAttachment[]){ + (const WGPURenderPassColorAttachment){ + .view = frame, + .loadOp = WGPULoadOp_Clear, + .storeOp = WGPUStoreOp_Store, + .clearValue = + (const WGPUColor){ + .r = 0.0, + .g = 1.0, + .b = 0.0, + .a = 1.0, + }, + }, + }, + }); + assert(render_pass_encoder); + + wgpuRenderPassEncoderSetPipeline(render_pass_encoder, render_pipeline); + wgpuRenderPassEncoderDraw(render_pass_encoder, 3, 1, 0, 0); + wgpuRenderPassEncoderEnd(render_pass_encoder); + + WGPUCommandBuffer command_buffer = wgpuCommandEncoderFinish( + command_encoder, &(const WGPUCommandBufferDescriptor){ + .label = "command_buffer", + }); + assert(command_buffer); + + wgpuQueueSubmit(queue, 1, (const WGPUCommandBuffer[]){command_buffer}); + wgpuSurfacePresent(demo.surface); + + wgpuCommandBufferRelease(command_buffer); + wgpuRenderPassEncoderRelease(render_pass_encoder); + wgpuCommandEncoderRelease(command_encoder); + wgpuTextureViewRelease(frame); + wgpuTextureRelease(surface_texture.texture); + } + + wgpuRenderPipelineRelease(render_pipeline); + wgpuPipelineLayoutRelease(pipeline_layout); + wgpuShaderModuleRelease(shader_module); + wgpuSurfaceCapabilitiesFreeMembers(surface_capabilities); + wgpuQueueRelease(queue); + wgpuDeviceRelease(demo.device); + wgpuAdapterRelease(demo.adapter); + wgpuSurfaceRelease(demo.surface); + glfwDestroyWindow(window); + wgpuInstanceRelease(demo.instance); + glfwTerminate(); + return 0; +} diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/main.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/main.kt new file mode 100644 index 00000000..e0cd331b --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/main.kt @@ -0,0 +1,94 @@ +package io.ygdrasil.triangle + +import com.sun.jna.Pointer +import com.sun.jna.ptr.IntByReference +import helloTriangle +import io.ygdrasil.libsdl.* +import io.ygdrasil.wgpu.SDL_GetWGPUSurface +import libwgpu.* + + +fun main() { + println("WGPU version ${wgpuGetVersion()}") + SDL_version().apply { + SDL_GetVersion(this) + println("SDL version $major.$minor.$patch") + } + + if (SDL_Init(SDL_INIT_EVERYTHING.toInt()) != 0) { + error("SDL_Init Error: ${SDL_GetError()}") + } + + val instance = wgpuCreateInstance(null) ?: error("fail to wgpu instance") + + val window = SDL_CreateWindow( + "", SDL_WINDOWPOS_CENTERED.toInt(), + SDL_WINDOWPOS_CENTERED.toInt(), 800, 600, + SDL_WindowFlags.SDL_WINDOW_SHOWN.value + ) ?: error("fail to create window ${SDL_GetError()}") + + val surface = SDL_GetWGPUSurface(instance, window) + check(surface != null) { "fail to create surface" } + + val options = WGPURequestAdapterOptions().apply { + compatibleSurface = surface + powerPreference = WGPUPowerPreference.WGPUPowerPreference_Undefined.value + backendType = WGPUBackendType.WGPUBackendType_Metal.value + } + + var adapter: WGPUAdapterImpl? = null + val handleRequestAdapter = object : WGPURequestAdapterCallback { + override fun invoke(statusAsInt: Int, adapterImpl: WGPUAdapterImpl, message: String?, param4: Pointer?) { + println("WGPURequestAdapterCallback") + val status = WGPURequestAdapterStatus.of(statusAsInt) + if (status == WGPURequestAdapterStatus.WGPURequestAdapterStatus_Success) { + adapter = adapterImpl + } else { + println(LOG_PREFIX + " request_adapter status=%.8X message=%s\n".format(status, message)) + } + } + } + + wgpuInstanceRequestAdapter(instance, options, handleRequestAdapter, null) + check(adapter != null) { "fail to get adapter" } + + var device: WGPUDevice? = null + val handleRequestDevice = object : WGPURequestDeviceCallback { + override fun invoke(statusAsInt: Int, deviceImpl: WGPUDeviceImpl, message: String?, param4: Pointer?) { + println("WGPURequestDeviceCallback") + val status = WGPURequestDeviceStatus.of(statusAsInt) + if (status == WGPURequestDeviceStatus.WGPURequestDeviceStatus_Success) { + device = deviceImpl + } else { + println(LOG_PREFIX + " request_device status=%#.8x message=%s\n".format(status, message)); + } + } + } + + wgpuAdapterRequestDevice(adapter, null, handleRequestDevice, null) + check(device != null) { "fail to get device" } + + val width = IntByReference() + val height = IntByReference() + SDL_GetWindowSize(window, width.pointer, height.pointer) + + val surface_capabilities = WGPUSurfaceCapabilities(); + wgpuSurfaceGetCapabilities(surface, adapter, surface_capabilities); + val config = WGPUSurfaceConfiguration().apply{ + this.device = device ?: error("") + usage = WGPUTextureUsage.WGPUTextureUsage_RenderAttachment.value + format = surface_capabilities.formats?.getInt(0) ?: error("") + presentMode = WGPUPresentMode.WGPUPresentMode_Fifo.value + alphaMode = surface_capabilities.alphaModes?.getInt(0) ?: error("") + this.width = width.value + this.height = height.value + }; + + wgpuSurfaceConfigure(surface, config); + + helloTriangle(device!!, adapter!!, surface, window, config) + + wgpuSurfaceRelease(surface) + wgpuAdapterRelease(adapter) + wgpuInstanceRelease(instance) +} \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/sdl2webgpu.c b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/sdl2webgpu.c new file mode 100644 index 00000000..5daf749f --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/sdl2webgpu.c @@ -0,0 +1,142 @@ +/** + * This is an extension of SDL2 for WebGPU, abstracting away the details of + * OS-specific operations. + * + * This file is part of the "Learn WebGPU for C++" book. + * https://eliemichel.github.io/LearnWebGPU + * + * Most of this code comes from the wgpu-native triangle example: + * https://github.com/gfx-rs/wgpu-native/blob/master/examples/triangle/main.c + * + * MIT License + * Copyright (c) 2022-2023 Elie Michel and the wgpu-native authors + * + * 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. + */ + +#include "sdl2webgpu.h" + +#include + +#if defined(SDL_VIDEO_DRIVER_COCOA) +#include +#include +#include +#endif + +#include +#include + +WGPUSurface SDL_GetWGPUSurface(WGPUInstance instance, SDL_Window* window) { + SDL_SysWMinfo windowWMInfo; + SDL_VERSION(&windowWMInfo.version); + SDL_GetWindowWMInfo(window, &windowWMInfo); + +#if defined(SDL_VIDEO_DRIVER_COCOA) + { + id metal_layer = NULL; + NSWindow* ns_window = windowWMInfo.info.cocoa.window; + [ns_window.contentView setWantsLayer : YES] ; + metal_layer = [CAMetalLayer layer]; + [ns_window.contentView setLayer : metal_layer] ; + return wgpuInstanceCreateSurface( + instance, + &(WGPUSurfaceDescriptor){ + .label = NULL, + .nextInChain = + (const WGPUChainedStruct*)&( + WGPUSurfaceDescriptorFromMetalLayer) { + .chain = + (WGPUChainedStruct){ + .next = NULL, + .sType = WGPUSType_SurfaceDescriptorFromMetalLayer, + }, + .layer = metal_layer, + }, + }); + } +#elif defined(SDL_VIDEO_DRIVER_X11) + { + Display* x11_display = windowWMInfo.info.x11.display; + Window x11_window = windowWMInfo.info.x11.window; + return wgpuInstanceCreateSurface( + instance, + &(WGPUSurfaceDescriptor){ + .label = NULL, + .nextInChain = + (const WGPUChainedStruct*)&( + WGPUSurfaceDescriptorFromXlibWindow) { + .chain = + (WGPUChainedStruct){ + .next = NULL, + .sType = WGPUSType_SurfaceDescriptorFromXlibWindow, + }, + .display = x11_display, + .window = x11_window, + }, + }); + } +#elif defined(SDL_VIDEO_DRIVER_WAYLAND) + { + struct wl_display* wayland_display = windowWMInfo.info.wl.display; + struct wl_surface* wayland_surface = windowWMInfo.info.wl.display; + return wgpuInstanceCreateSurface( + instance, + &(WGPUSurfaceDescriptor){ + .label = NULL, + .nextInChain = + (const WGPUChainedStruct*)&( + WGPUSurfaceDescriptorFromWaylandSurface) { + .chain = + (WGPUChainedStruct){ + .next = NULL, + .sType = + WGPUSType_SurfaceDescriptorFromWaylandSurface, + }, + .display = wayland_display, + .surface = wayland_surface, + }, + }); + } +#elif defined(SDL_VIDEO_DRIVER_WINDOWS) + { + HWND hwnd = windowWMInfo.info.win.window; + HINSTANCE hinstance = GetModuleHandle(NULL); + return wgpuInstanceCreateSurface( + instance, + &(WGPUSurfaceDescriptor){ + .label = NULL, + .nextInChain = + (const WGPUChainedStruct*)&( + WGPUSurfaceDescriptorFromWindowsHWND) { + .chain = + (WGPUChainedStruct){ + .next = NULL, + .sType = WGPUSType_SurfaceDescriptorFromWindowsHWND, + }, + .hinstance = hinstance, + .hwnd = hwnd, + }, + }); + } +#else + // TODO: See SDL_syswm.h for other possible enum values! +#error "Unsupported WGPU_TARGET" +#endif +} diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/sdl2webgpu.h b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/sdl2webgpu.h new file mode 100644 index 00000000..6aaf6428 --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/sdl2webgpu.h @@ -0,0 +1,49 @@ +/** + * This is an extension of SDL2 for WebGPU, abstracting away the details of + * OS-specific operations. + * + * This file is part of the "Learn WebGPU for C++" book. + * https://eliemichel.github.io/LearnWebGPU + * + * MIT License + * Copyright (c) 2022-2023 Elie Michel and the wgpu-native authors + * + * 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 _sdl2_webgpu_h_ +#define _sdl2_webgpu_h_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Get a WGPUSurface from a SDL2 window. + */ +WGPUSurface SDL_GetWGPUSurface(WGPUInstance instance, SDL_Window* window); + +#ifdef __cplusplus +} +#endif + +#endif // _sdl2_webgpu_h_ \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/shader.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/shader.kt new file mode 100644 index 00000000..2cf9ca63 --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/shader.kt @@ -0,0 +1,15 @@ +package io.ygdrasil.triangle + +val shader = """ + @vertex + fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4 { + let x = f32(i32(in_vertex_index) - 1); + let y = f32(i32(in_vertex_index & 1u) * 2 - 1); + return vec4(x, y, 0.0, 1.0); + } + + @fragment + fn fs_main() -> @location(0) vec4 { + return vec4(1.0, 0.0, 0.0, 1.0); + } +""".trimIndent() \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/shader.wgsl b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/shader.wgsl new file mode 100644 index 00000000..f84ccfe9 --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/shader.wgsl @@ -0,0 +1,11 @@ +@vertex +fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4 { + let x = f32(i32(in_vertex_index) - 1); + let y = f32(i32(in_vertex_index & 1u) * 2 - 1); + return vec4(x, y, 0.0, 1.0); +} + +@fragment +fn fs_main() -> @location(0) vec4 { + return vec4(1.0, 0.0, 0.0, 1.0); +} diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/step1.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/step1.kt new file mode 100644 index 00000000..895bffb4 --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/step1.kt @@ -0,0 +1,95 @@ +package io.ygdrasil.triangle + +import com.sun.jna.NativeLong +import com.sun.jna.ptr.IntByReference +import io.ygdrasil.libsdl.SDL_Event +import io.ygdrasil.libsdl.SDL_GetWindowSize +import io.ygdrasil.libsdl.SDL_PollEvent +import io.ygdrasil.libsdl.SDL_Window +import libwgpu.* + +fun step1( + device: WGPUDevice, + adapter: WGPUAdapterImpl, + surface: WGPUSurface, + window: SDL_Window, + config: WGPUSurfaceConfiguration +) { + + while (true) { + + val surface_texture = WGPUSurfaceTexture() + wgpuSurfaceGetCurrentTexture(surface, surface_texture); + when (WGPUSurfaceGetCurrentTextureStatus.of(surface_texture.status) ?: error("surface status not found")) { + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_Success -> Unit // All good, could check for `surface_texture.suboptimal` here. + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_Timeout, + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_Outdated, + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_Lost -> { + // Skip this frame, and re-configure surface. + if (surface_texture.texture != null) { + wgpuTextureRelease(surface_texture.texture); + } + val width = IntByReference() + val height = IntByReference() + SDL_GetWindowSize(window, width.pointer, height.pointer) + config.width = width.value + config.height = height.value + wgpuSurfaceConfigure(surface, config) + continue; + } + + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_OutOfMemory, + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_DeviceLost, + WGPUSurfaceGetCurrentTextureStatus.WGPUSurfaceGetCurrentTextureStatus_Force32 -> { + // Fatal error + println(LOG_PREFIX + " get_current_texture status=%#.8x\n".format(surface_texture.status)) + return; + } + + } + val frame = wgpuTextureCreateView(surface_texture.texture, null) ?: error("fail to get frame") + + val queue = wgpuDeviceGetQueue(device) ?: error("fail to get queue") + val encoder = wgpuDeviceCreateCommandEncoder(device, WGPUCommandEncoderDescriptor().apply { + label = "WGPUCommandEncoderDescriptorKt" + }) + + val render_pass_encoder = wgpuCommandEncoderBeginRenderPass(encoder, + WGPURenderPassDescriptor().apply { + label = "WGPURenderPassDescriptorKt" + colorAttachmentCount = 1L + colorAttachments = arrayOf(WGPURenderPassColorAttachment.ByReference().apply { + view = frame + loadOp = WGPULoadOp.WGPULoadOp_Clear.value + storeOp = WGPUStoreOp.WGPUStoreOp_Store.value + clearValue = WGPUColor().apply { + r = 0.0 + g = 0.0 + b = 0.4 + a = 1.0 + } + }) + } + ) + wgpuRenderPassEncoderEnd(render_pass_encoder) + + val commandBuffer = wgpuCommandEncoderFinish(encoder, WGPUCommandBufferDescriptor().apply { + label = "WGPUCommandBufferDescriptorKt" + }) ?: error("fail to get commandBuffer") + wgpuQueueSubmit(queue, NativeLong(1), arrayOf(commandBuffer)) + + wgpuSurfacePresent(surface); + + wgpuCommandBufferRelease(commandBuffer); + wgpuRenderPassEncoderRelease(render_pass_encoder); + wgpuCommandEncoderRelease(encoder); + wgpuTextureViewRelease(frame); + wgpuTextureRelease(surface_texture.texture); + + + val event = SDL_Event() + while (SDL_PollEvent(event) != 0) { + + } + } +} \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/wgpu.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/wgpu.kt new file mode 100644 index 00000000..43abfe5a --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/triangle/wgpu.kt @@ -0,0 +1,40 @@ +package io.ygdrasil.triangle + +const val LOG_PREFIX = "ReturnValueExtractor: " +// +//val log_callback = object : WGPULogCallback { +// override fun invoke(param1: Int, message: String, param3: Pointer) { +// val level = WGPULogLevel.of(param1) +// val levelStr = when (level) { +// WGPULogLevel.WGPULogLevel_Error -> "error" +// WGPULogLevel.WGPULogLevel_Warn -> "warn" +// WGPULogLevel.WGPULogLevel_Info -> "info" +// WGPULogLevel.WGPULogLevel_Debug -> "debug" +// WGPULogLevel.WGPULogLevel_Trace -> "trace" +// else -> "no level" +// } +// println("[wgpu] [$levelStr] $message") +// } +//} +// +//fun frmwrk_setup_logging(level: WGPULogLevel) { +// wgpuSetLogCallback(log_callback, null) +// wgpuSetLogLevel(level.value) +//} +// + +// +// +//fun SDL_GetWGPUSurface(instance: WGPUInstance, window: SDL_Window): WGPUSurface { +// val windowWMInfo = SDL_SysWMinfo() +// windowWMInfo.version.major = 2 +// windowWMInfo.version.minor = 30 +// windowWMInfo.version.patch = 0 +// SDL_GetWindowWMInfo(window, windowWMInfo) +// /*NSWindow* ns_window = windowWMInfo.info.cocoa.window; +// [ns_window.contentView setWantsLayer : YES] ; +// metal_layer = [CAMetalLayer layer]; +// [ns_window.contentView setLayer : metal_layer] ;*/ +// +// TODO() +//} \ No newline at end of file diff --git a/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/wgpu/sdl2wgpu.kt b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/wgpu/sdl2wgpu.kt new file mode 100644 index 00000000..5b1239f8 --- /dev/null +++ b/bindings/wgpu-native/example/src/main/kotlin/io.ygdrasil/wgpu/sdl2wgpu.kt @@ -0,0 +1,16 @@ +package io.ygdrasil.wgpu + +import com.sun.jna.Library +import io.ygdrasil.libsdl.SDL_Window +import libwgpu.WGPUInstance +import libwgpu.WGPUSurface + +public val libsdl2wgpu: Libsdl2wgpu by lazy { + klang.internal.NativeLoad("sdl2wgpu") +} + +interface Libsdl2wgpu : Library { + fun SDL_GetWGPUSurface(instance: WGPUInstance, window: SDL_Window): WGPUSurface? +} + +fun SDL_GetWGPUSurface(instance: WGPUInstance, window: SDL_Window): WGPUSurface? = libsdl2wgpu.SDL_GetWGPUSurface(instance, window) \ No newline at end of file diff --git a/bindings/wgpu-native/gradle.properties b/bindings/wgpu-native/gradle.properties new file mode 100644 index 00000000..1a9f3845 --- /dev/null +++ b/bindings/wgpu-native/gradle.properties @@ -0,0 +1,3 @@ +# Enable to use panama class on klang gradle plugin +org.gradle.jvmargs=--enable-preview +org.gradle.daemon=false \ No newline at end of file diff --git a/bindings/wgpu-native/gradle/libs.versions.toml b/bindings/wgpu-native/gradle/libs.versions.toml index 12809027..7a38d765 100644 --- a/bindings/wgpu-native/gradle/libs.versions.toml +++ b/bindings/wgpu-native/gradle/libs.versions.toml @@ -2,6 +2,9 @@ kotest = "5.6.1" klang = "0.0.0" jna = "5.13.0" +kotlin = "1.9.22" +wgpu = "v0.19.1.1" + [libraries] kotest = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" } diff --git a/bindings/wgpu-native/gradle/wrapper/gradle-wrapper.jar b/bindings/wgpu-native/gradle/wrapper/gradle-wrapper.jar index c1962a79..7f93135c 100644 Binary files a/bindings/wgpu-native/gradle/wrapper/gradle-wrapper.jar and b/bindings/wgpu-native/gradle/wrapper/gradle-wrapper.jar differ diff --git a/bindings/wgpu-native/gradle/wrapper/gradle-wrapper.properties b/bindings/wgpu-native/gradle/wrapper/gradle-wrapper.properties index 744c64d1..a80b22ce 100644 --- a/bindings/wgpu-native/gradle/wrapper/gradle-wrapper.properties +++ b/bindings/wgpu-native/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/bindings/wgpu-native/gradlew b/bindings/wgpu-native/gradlew index aeb74cbb..1aa94a42 100755 --- a/bindings/wgpu-native/gradlew +++ b/bindings/wgpu-native/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/bindings/wgpu-native/libwgpu/build.gradle.kts b/bindings/wgpu-native/libwgpu/build.gradle.kts index 25b4cd46..20a13afd 100644 --- a/bindings/wgpu-native/libwgpu/build.gradle.kts +++ b/bindings/wgpu-native/libwgpu/build.gradle.kts @@ -1,3 +1,6 @@ +import io.ygdrasil.ParsingMethod +import klang.domain.FunctionPointerType +import klang.domain.ResolvedTypeRef import klang.domain.typeOf import klang.domain.unchecked import org.gradle.api.tasks.testing.logging.TestExceptionFormat @@ -16,7 +19,7 @@ buildscript { } plugins { - kotlin("jvm") version "1.9.10" + kotlin("jvm") alias(libs.plugins.klang) } @@ -50,16 +53,41 @@ sourceSets.main { java.srcDirs(buildDir) } -val headerUrl = URL("https://github.com/gfx-rs/wgpu-native/releases/download/v0.18.1.2/wgpu-macos-x86_64-release.zip") +val headerUrl = URL("https://github.com/gfx-rs/wgpu-native/releases/download/${libs.versions.wgpu.get()}/wgpu-macos-x86_64-release.zip") klang { + + parsingMethod = ParsingMethod.Libclang + download(headerUrl) .let(::unpack) .let { parse(fileToParse = "wgpu.h", at = it) { - + // Hardfixes until Callback are fixed + (findTypeAliasByName("WGPURequestDeviceCallback") ?: error("WGPURequestAdapterCallback should exist")) + .let { callback -> + (((callback.typeRef as? ResolvedTypeRef)?.type as? FunctionPointerType) ?: error("should be resolved")) + .let { function -> + val arguments = function.arguments.toMutableList() + arguments[0] = typeOf("int").unchecked() + arguments[2] = typeOf("char *").unchecked() + arguments[3] = typeOf("void *").unchecked() + function.arguments = arguments.toList() + } + } + (findTypeAliasByName("WGPURequestAdapterCallback") ?: error("WGPURequestAdapterCallback should exist")) + .let { callback -> + (((callback.typeRef as? ResolvedTypeRef)?.type as? FunctionPointerType) ?: error("should be resolved")) + .let { function -> + val arguments = function.arguments.toMutableList() + arguments[0] = typeOf("int").unchecked() + arguments[2] = typeOf("char *").unchecked() + arguments[3] = typeOf("void *").unchecked() + function.arguments = arguments.toList() + } + } } } - generateBinding("libwgpu", "wgpu") + generateBinding("libwgpu", "WGPU") } diff --git a/bindings/wgpu-native/libwgpu/src/main/kotlin/libsdl/Constants.kt b/bindings/wgpu-native/libwgpu/src/main/kotlin/libsdl/Constants.kt deleted file mode 100644 index 89f05881..00000000 --- a/bindings/wgpu-native/libwgpu/src/main/kotlin/libsdl/Constants.kt +++ /dev/null @@ -1,16 +0,0 @@ -package libsdl - -const val SDL_INIT_TIMER: Int = 0x00000001 -const val SDL_INIT_AUDIO: Int = 0x00000010 -const val SDL_INIT_VIDEO: Int = 0x00000020 // SDL_INIT_VIDEO implies SDL_INIT_EVENTS -const val SDL_INIT_JOYSTICK: Int = 0x00000200 // SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS -const val SDL_INIT_HAPTIC: Int = 0x00001000 -const val SDL_INIT_GAMECONTROLLER: Int = 0x00002000 // SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK -const val SDL_INIT_EVENTS: Int = 0x00004000 -const val SDL_INIT_SENSOR: Int = 0x00008000 -const val SDL_INIT_NOPARACHUTE: Int = 0x00100000 // compatibility; this flag is ignored. - -val SDL_INIT_EVERYTHING: Int = SDL_INIT_TIMER or SDL_INIT_AUDIO or SDL_INIT_VIDEO or SDL_INIT_EVENTS or SDL_INIT_JOYSTICK or SDL_INIT_HAPTIC or SDL_INIT_GAMECONTROLLER or SDL_INIT_SENSOR - - -const val SDL_ALPHA_OPAQUE: Byte = 255.toByte() \ No newline at end of file diff --git a/bindings/wgpu-native/libwgpu/src/main/kotlin/libsdl/FixTypeAlias.kt b/bindings/wgpu-native/libwgpu/src/main/kotlin/libsdl/FixTypeAlias.kt deleted file mode 100644 index a47079eb..00000000 --- a/bindings/wgpu-native/libwgpu/src/main/kotlin/libsdl/FixTypeAlias.kt +++ /dev/null @@ -1,92 +0,0 @@ -package libsdl - -import com.sun.jna.Pointer -import com.sun.jna.PointerType -import com.sun.jna.ptr.PointerByReference - -typealias SDL_iconv_t = Pointer -typealias SDL_JoystickGUID = Pointer - -public class SDL_Haptic : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_AudioStream : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_hid_device : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_GameController : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_Sensor : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_sem : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} - -public class SDL_Joystick : PointerType { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - - public class ByReference : PointerByReference { - public constructor() : super() - - public constructor(pointer: Pointer?) : super(pointer) - } -} \ No newline at end of file diff --git a/bindings/wgpu-native/libwgpu/src/main/kotlin/libsdl/UnionDelegate.kt b/bindings/wgpu-native/libwgpu/src/main/kotlin/libsdl/UnionDelegate.kt deleted file mode 100644 index a6d61fe1..00000000 --- a/bindings/wgpu-native/libwgpu/src/main/kotlin/libsdl/UnionDelegate.kt +++ /dev/null @@ -1,70 +0,0 @@ -package libsdl - -import libsdl.SDL_EventType.* - -object SDL_HapticEffectDelegate { - fun read(union: SDL_HapticEffect) { - //TODO implement - } -} - -object SDL_WindowShapeParamsDelegate { - fun read(union: SDL_WindowShapeParams) { - //TODO implement - } -} - -object SDL_EventDelegate { - fun read(union: SDL_Event) = with(union) { - readField("type") - when (SDL_EventType.of(type)) { - SDL_QUIT -> setType(SDL_QuitEvent::class.java) - SDL_APP_TERMINATING, SDL_APP_LOWMEMORY, SDL_APP_WILLENTERBACKGROUND, SDL_APP_DIDENTERBACKGROUND, SDL_APP_WILLENTERFOREGROUND, SDL_APP_DIDENTERFOREGROUND -> setType( - SDL_OSEvent::class.java - ) - - SDL_LOCALECHANGED -> setType(SDL_CommonEvent::class.java) - SDL_DISPLAYEVENT -> setType(SDL_DisplayEvent::class.java) - SDL_WINDOWEVENT -> setType(SDL_WindowEvent::class.java) - SDL_SYSWMEVENT -> setType(SDL_SysWMEvent::class.java) - SDL_KEYDOWN, SDL_KEYUP -> setType(SDL_KeyboardEvent::class.java) - SDL_TEXTEDITING -> setType(SDL_TextEditingEvent::class.java) - SDL_TEXTINPUT -> setType(SDL_TextInputEvent::class.java) - SDL_KEYMAPCHANGED -> setType(SDL_CommonEvent::class.java) - SDL_TEXTEDITING_EXT -> setType(SDL_TextEditingExtEvent::class.java) - SDL_MOUSEMOTION -> setType(SDL_MouseMotionEvent::class.java) - SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP -> setType(SDL_MouseButtonEvent::class.java) - SDL_MOUSEWHEEL -> setType(SDL_MouseWheelEvent::class.java) - SDL_JOYAXISMOTION -> setType(SDL_JoyAxisEvent::class.java) - SDL_JOYBALLMOTION -> setType(SDL_JoyBallEvent::class.java) - SDL_JOYHATMOTION -> setType(SDL_JoyHatEvent::class.java) - SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP -> setType(SDL_JoyButtonEvent::class.java) - SDL_JOYDEVICEADDED, SDL_JOYDEVICEREMOVED -> setType(SDL_JoyDeviceEvent::class.java) - SDL_JOYBATTERYUPDATED -> setType(SDL_JoyBatteryEvent::class.java) - SDL_CONTROLLERAXISMOTION -> setType(SDL_ControllerAxisEvent::class.java) - SDL_CONTROLLERBUTTONDOWN, SDL_CONTROLLERBUTTONUP -> setType(SDL_ControllerButtonEvent::class.java) - SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED -> setType( - SDL_ControllerDeviceEvent::class.java - ) - - SDL_CONTROLLERTOUCHPADDOWN, SDL_CONTROLLERTOUCHPADMOTION, SDL_CONTROLLERTOUCHPADUP -> setType( - SDL_ControllerTouchpadEvent::class.java - ) - - SDL_CONTROLLERSENSORUPDATE -> setType(SDL_ControllerSensorEvent::class.java) - SDL_FINGERDOWN, SDL_FINGERUP, SDL_FINGERMOTION -> setType(SDL_TouchFingerEvent::class.java) - SDL_DOLLARGESTURE, SDL_DOLLARRECORD -> setType(SDL_DollarGestureEvent::class.java) - SDL_MULTIGESTURE -> setType(SDL_MultiGestureEvent::class.java) - SDL_CLIPBOARDUPDATE -> setType(SDL_CommonEvent::class.java) - SDL_DROPFILE, SDL_DROPTEXT, SDL_DROPBEGIN, SDL_DROPCOMPLETE -> setType(SDL_DropEvent::class.java) - SDL_AUDIODEVICEADDED, SDL_AUDIODEVICEREMOVED -> setType(SDL_AudioDeviceEvent::class.java) - SDL_SENSORUPDATE -> setType(SDL_SensorEvent::class.java) - SDL_RENDER_TARGETS_RESET, SDL_RENDER_DEVICE_RESET -> setType(SDL_CommonEvent::class.java) - else -> if (type >= SDL_USEREVENT.value && type < SDL_LASTEVENT.value) { - setType(SDL_UserEvent::class.java) - } else { - setType(SDL_CommonEvent::class.java) - } - } - } -} \ No newline at end of file diff --git a/bindings/wgpu-native/libwgpu/src/main/kotlin/main.kt b/bindings/wgpu-native/libwgpu/src/main/kotlin/main.kt deleted file mode 100644 index 2e435ec9..00000000 --- a/bindings/wgpu-native/libwgpu/src/main/kotlin/main.kt +++ /dev/null @@ -1,49 +0,0 @@ -import com.sun.jna.Pointer -import libsdl.SDL_WindowFlags -import libsdl.libSDL2Library - -typealias unnamed = Pointer - -const val SDL_INIT_TIMER: Int = 0x00000001 -const val SDL_INIT_AUDIO: Int = 0x00000010 -const val SDL_INIT_VIDEO: Int = 0x00000020 // SDL_INIT_VIDEO implies SDL_INIT_EVENTS -const val SDL_INIT_JOYSTICK: Int = 0x00000200 // SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS -const val SDL_INIT_HAPTIC: Int = 0x00001000 -const val SDL_INIT_GAMECONTROLLER: Int = 0x00002000 // SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK -const val SDL_INIT_EVENTS: Int = 0x00004000 -const val SDL_INIT_SENSOR: Int = 0x00008000 -const val SDL_INIT_NOPARACHUTE: Int = 0x00100000 // compatibility; this flag is ignored. - -val SDL_INIT_EVERYTHING: Int = SDL_INIT_TIMER or SDL_INIT_AUDIO or SDL_INIT_VIDEO or SDL_INIT_EVENTS or SDL_INIT_JOYSTICK or SDL_INIT_HAPTIC or SDL_INIT_GAMECONTROLLER or SDL_INIT_SENSOR - -const val SDL_WINDOWPOS_CENTERED_MASK: Int = 0x2FFF0000 - -fun SDL_WINDOWPOS_CENTERED_DISPLAY(X: Int): Int { - return SDL_WINDOWPOS_CENTERED_MASK or X -} - -val SDL_WINDOWPOS_CENTERED: Int = SDL_WINDOWPOS_CENTERED_DISPLAY(0) - -fun main() { - libSDL2Library.SDL_Init(0) - - if (libSDL2Library.SDL_Init(SDL_INIT_EVERYTHING) != 0) { - println("error initializing SDL: ${libSDL2Library.SDL_GetError()}" ); - return - } - libSDL2Library.SDL_CreateWindow( - "Game", - SDL_WINDOWPOS_CENTERED, - SDL_WINDOWPOS_CENTERED, - 800, 600, - SDL_WindowFlags.SDL_WINDOW_SHOWN or SDL_WindowFlags.SDL_WINDOW_RESIZABLE - ) - do { - - - // Set to ~60 fps. - // 1000 ms/ 60 fps = 1/16 s^2/frame - libSDL2Library.SDL_Delay(16); - } while (true) - -} \ No newline at end of file diff --git a/bindings/wgpu-native/libwgpu/src/main/kotlin/snake/main.kt b/bindings/wgpu-native/libwgpu/src/main/kotlin/snake/main.kt deleted file mode 100644 index aa26f7a8..00000000 --- a/bindings/wgpu-native/libwgpu/src/main/kotlin/snake/main.kt +++ /dev/null @@ -1,472 +0,0 @@ -package snake - - -import SDL_WINDOWPOS_CENTERED -import com.sun.jna.Native -import com.sun.jna.Pointer -import com.sun.jna.ptr.IntByReference -import com.sun.jna.ptr.PointerByReference -import libsdl.* -import java.io.File -import java.nio.ByteBuffer -import kotlin.math.max -import kotlin.random.Random - - -fun main() { - val initialGame = Game( - width = 20, - height = 10, - snake = Snake( - cells = listOf(Cell(4, 4), Cell(3, 4), Cell(2, 4), Cell(1, 4), Cell(0, 4)), - direction = Direction.right - ) - ) - var game = initialGame - - SdlUI(game.width, game.height).use { sdlUI -> - - var ticks = 0 - val speed = 10 - while (true) { - - sdlUI.draw(game) - - sdlUI.delay(1000 / 60) - ticks++ - if (ticks >= speed) { - game = game.update() - ticks -= speed - } - - sdlUI.readCommands().forEach { command -> - var direction: Direction? = null - when (command) { - SdlUI.UserCommand.up -> direction = Direction.up - SdlUI.UserCommand.down -> direction = Direction.down - SdlUI.UserCommand.left -> direction = Direction.left - SdlUI.UserCommand.right -> direction = Direction.right - SdlUI.UserCommand.restart -> game = initialGame - SdlUI.UserCommand.quit -> return - } - game = game.update(direction) - sdlUI.draw(game) - } - } - } -} - -class SdlUI(width: Int, height: Int): AutoCloseable { - private val window: SDL_Window - private val renderer: SDL_Renderer - private val controller: SDL_GameController? - private val font: Font - private val sprites: Sprites - - private val pixelWidth = width * Sprites.w - private val pixelHeight = height * Sprites.h - - init { - if (libSDL2Library.SDL_Init(SDL_INIT_EVERYTHING) != 0) { - println("SDL_Init Error: ${libSDL2Library.SDL_GetError()}") - throw Error() - } - - window = libSDL2Library.SDL_CreateWindow("Snake", SDL_WINDOWPOS_CENTERED, - SDL_WINDOWPOS_CENTERED, pixelWidth, pixelHeight, - SDL_WindowFlags.SDL_WINDOW_SHOWN.value - ) - - renderer = libSDL2Library.SDL_CreateRenderer( - window, -1, SDL_RendererFlags.SDL_RENDERER_ACCELERATED or SDL_RendererFlags.SDL_RENDERER_PRESENTVSYNC - ) - - controller = when (libSDL2Library.SDL_NumJoysticks() != 0) { - true -> libSDL2Library.SDL_GameControllerOpen(0) - false -> null - } - - font = Font(renderer) - sprites = Sprites(renderer) - - playMusic() - } - - fun draw(game: Game) { - libSDL2Library.SDL_RenderClear(renderer) - libSDL2Library.SDL_SetRenderDrawColor(renderer, (200 / 2).toByte(), (230 / 2).toByte(), (151 / 2).toByte(), SDL_ALPHA_OPAQUE) - - val grassW = 256 - val grassScaledW = 400 // scale grass up to reduce its resolution so that it's similar to snake sprites - 0.until(pixelWidth / grassW + 1).forEach { x -> - 0.until(pixelHeight / grassW + 1).forEach { y -> - sprites.render(sprites.grassRect, allocRect(x * grassW, y * grassW, grassScaledW, grassScaledW)) - } - } - - game.apples.cells.forEach { - sprites.render(sprites.appleRect, cellRect(it)) - } - - game.snake.tail.dropLast(1).forEachIndexed { i, it -> - val index = i + 1 - val direction = direction(from = game.snake.cells[index - 1], to = it) - val nextDirection = direction(from = it, to = game.snake.cells[index + 1]) - - val srcRect = if (direction == nextDirection) { - when (direction) { - Direction.right, Direction.left -> sprites.bodyHorRect - Direction.up, Direction.down -> sprites.bodyVertRect - } - } else if ((direction == Direction.left && nextDirection == Direction.down) || (direction == Direction.up && nextDirection == Direction.right)) { - sprites.bodyLeftDownRect - } else if ((direction == Direction.left && nextDirection == Direction.up) || (direction == Direction.down && nextDirection == Direction.right)) { - sprites.bodyLeftUpRect - } else if ((direction == Direction.right && nextDirection == Direction.down) || (direction == Direction.up && nextDirection == Direction.left)) { - sprites.bodyRightDownRect - } else if ((direction == Direction.right && nextDirection == Direction.up) || (direction == Direction.down && nextDirection == Direction.left)) { - sprites.bodyRightUpRect - } else { - sprites.emptyRect - } - sprites.render(srcRect, cellRect(it)) - } - - val tipRect = when (game.snake.cells.let { direction(from = it.last(), to = it[it.size - 2]) }) { - Direction.up -> sprites.tipUpRect - Direction.down -> sprites.tipDownRect - Direction.left -> sprites.tipLeftRect - Direction.right -> sprites.tipRightRect - } - sprites.render(tipRect, cellRect(game.snake.tail.last())) - - val headRect = when (game.snake.direction) { - Direction.up -> sprites.headUpRect - Direction.down -> sprites.headDownRect - Direction.left -> sprites.headLeftRect - Direction.right -> sprites.headRightRect - } - sprites.render(headRect, cellRect(game.snake.head)) - - if (game.isOver) { - renderStringCentered(3, game.width, "game over") - renderStringCentered(5, game.width, "your score is ${game.score}") - } - - libSDL2Library.SDL_RenderPresent(renderer) - - } - - fun delay(timeMs: Int) { - libSDL2Library.SDL_Delay(timeMs) - } - - fun readCommands(): List { - val result = ArrayList() - val event = SDL_Event() - while (libSDL2Library.SDL_PollEvent(event) != 0) { - event.read() - println("event(${event.type}): ${SDL_EventType.of(event.type)}") - when (SDL_EventType.of(event.type)) { - SDL_EventType.SDL_WINDOWEVENT -> { - val windowEvent = SDL_WindowEventID.of(event.window.event.toInt()) - println("controllerButtonEvent(${windowEvent})") - - if (windowEvent == SDL_WindowEventID.SDL_WINDOWEVENT_SHOWN) { - //playMusic() - } - } - SDL_EventType.SDL_QUIT -> result.add(UserCommand.quit) - SDL_EventType.SDL_CONTROLLERBUTTONDOWN -> { - val controllerButtonEvent = event.cbutton - val button = controllerButtonEvent.button.toInt() - println("controllerButtonEvent($button): ${SDL_GameControllerButton.of(button)}") - val command = when (SDL_GameControllerButton.of(button)) { - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_UP -> UserCommand.up - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_DOWN -> UserCommand.down - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_LEFT -> UserCommand.left - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_DPAD_RIGHT -> UserCommand.right - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_START -> UserCommand.restart - SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_BACK -> UserCommand.quit - else -> null - } - if (command != null) result.add(command) - } - SDL_EventType.SDL_KEYDOWN -> { - val keyboardEvent = event.key - val keysym = keyboardEvent.keysym - println("keyboardEvent(${keysym.scancode}): ${SDL_Scancode.of(keysym.scancode)}") - val command = when (SDL_Scancode.of(keysym.scancode)) { - SDL_Scancode.SDL_SCANCODE_I -> UserCommand.up - SDL_Scancode.SDL_SCANCODE_J -> UserCommand.left - SDL_Scancode.SDL_SCANCODE_K -> UserCommand.down - SDL_Scancode.SDL_SCANCODE_L -> UserCommand.right - SDL_Scancode.SDL_SCANCODE_R -> UserCommand.restart - SDL_Scancode.SDL_SCANCODE_Q -> UserCommand.quit - else -> null - } - if (command != null) result.add(command) - } - else -> Unit - } - } - return result - } - - private fun playMusic() { - val fileName = "Crowander-Stop-on-a-Bench.wav" - val paths = listOf(fileName, "resources/$fileName", "../resources/$fileName") - val filePath = paths.find { File(it).canRead() } ?: error("Can't find sound file.") - val audioFile = libSDL2Library.SDL_RWFromFile(filePath, "rb") - val audio_spec = SDL_AudioSpec() - val audio_buf = PointerByReference() - val audio_len = IntByReference() - libSDL2Library.SDL_LoadWAV_RW( - src = audioFile, - freesrc = 1, - spec = audio_spec, - audio_buf.pointer, - audio_len.pointer - ) - - val deviceName = libSDL2Library.SDL_GetAudioDeviceName(0, 0) - val device_id = libSDL2Library.SDL_OpenAudioDevice(deviceName, 0, audio_spec, SDL_AudioSpec(), 0) - libSDL2Library.SDL_QueueAudio(device_id, audio_buf.value, audio_len.value) - libSDL2Library.SDL_PauseAudioDevice(device_id, 0) - } - - private fun direction(from: Cell, to: Cell): Direction = when { - from.x == to.x && from.y > to.y -> Direction.up - from.x == to.x && from.y < to.y -> Direction.down - from.x > to.x && from.y == to.y -> Direction.left - from.x < to.x && from.y == to.y -> Direction.right - else -> error("") - } - - private fun cellRect(cell: Cell): SDL_Rect { - val x = cell.x * Sprites.w - val y = cell.y * Sprites.h - return allocRect(x, y, Sprites.w, Sprites.h) - } - - private fun renderStringCentered(y: Int, width: Int, s: String) { - var x = (width / 2) - (s.length / 2) - if (x.rem(2) != 0) x-- - renderString(Cell(x, y), s) - } - - private fun renderString(atCell: Cell, s: String) { - s.toCharArray().forEachIndexed { i, c -> - font.render(c, cellRect(atCell.copy(x = atCell.x + i))) - } - } - - enum class UserCommand { - up, down, left, right, restart, quit - } - - - class Font(private val renderer: SDL_Renderer) { - companion object { - const val w = 48 - const val h = 46 - } - - internal val texture = renderer.loadTexture("Font16_42_Normal4_sheet.bmp") - private val letters: Map - - init { - letters = mapOf( - 'A' to textureRect(0, 0, -7), - 'B' to textureRect(1, 0), - 'C' to textureRect(2, 0, -9), - 'D' to textureRect(3, 0), - 'E' to textureRect(4, 0, -5), - 'F' to textureRect(5, 0, -5), - 'G' to textureRect(6, 0), - 'H' to textureRect(7, 0, -7), - 'I' to textureRect(8, 0, -15), - 'J' to textureRect(9, 0, -5), - 'K' to textureRect(0, 1, -10), - 'L' to textureRect(1, 1, -5), - 'M' to textureRect(2, 1), - 'N' to textureRect(3, 1), - 'O' to textureRect(4, 1, -7), - 'P' to textureRect(5, 1, -7), - 'Q' to textureRect(6, 1), - 'R' to textureRect(7, 1), - 'S' to textureRect(8, 1), - 'T' to textureRect(9, 1), - 'U' to textureRect(0, 2, -13), - 'V' to textureRect(1, 2, -10), - 'W' to textureRect(2, 2), - 'X' to textureRect(3, 2), - 'Y' to textureRect(4, 2, -5), - 'Z' to textureRect(5, 2), - '0' to textureRect(2, 5), - '1' to textureRect(3, 5, -15), - '2' to textureRect(4, 5), - '3' to textureRect(5, 5), - '4' to textureRect(6, 5), - '5' to textureRect(7, 5), - '6' to textureRect(8, 5), - '7' to textureRect(9, 5), - '8' to textureRect(0, 6), - '9' to textureRect(1, 6), - ' ' to allocRect(0, 0, 0, 0) - ) - } - - fun render(char: Char, cellRect: SDL_Rect) { - val charRect = letters[char.uppercaseChar()] ?: (letters[' '] ?: error("")) - libSDL2Library.SDL_RenderCopy(renderer, texture, charRect, cellRect) - } - - private fun textureRect(x: Int, y: Int, wAdjust: Int = 0): SDL_Rect { - val xShift = x * w - val yShift = y * h - return allocRect(xShift, yShift, w + wAdjust, h) - } - } - - class Sprites(private val renderer: SDL_Renderer) { - companion object { - const val w = 64 - const val h = 64 - } - - internal val texture = renderer.loadTexture("snake-graphics.bmp") - internal val grassTexture = renderer.loadTexture("grass.bmp") - - val headUpRect = textureRect(3, 0) - val headRightRect = textureRect(4, 0) - val headLeftRect = textureRect(3, 1) - val headDownRect = textureRect(4, 1) - - val tipUpRect = textureRect(3, 2) - val tipRightRect = textureRect(4, 2) - val tipLeftRect = textureRect(3, 3) - val tipDownRect = textureRect(4, 3) - - val bodyHorRect = textureRect(1, 0) - val bodyVertRect = textureRect(2, 1) - val bodyLeftDownRect = textureRect(0, 0) - val bodyLeftUpRect = textureRect(0, 1) - val bodyRightDownRect = textureRect(2, 0) - val bodyRightUpRect = textureRect(2, 2) - - val appleRect = textureRect(0, 3) - val emptyRect = textureRect(0, 2) - - val grassRect = allocRect(0, 0, 256, 256) - - private fun textureRect(x: Int, y: Int) = allocRect(x * w, y * h, w, h) - - fun render(srcRect: SDL_Rect, dstRect: SDL_Rect) { - if (srcRect == grassRect) libSDL2Library.SDL_RenderCopy(renderer, grassTexture, srcRect, dstRect) - else libSDL2Library.SDL_RenderCopy(renderer, texture, srcRect, dstRect) - } - } - - companion object { - fun SDL_Renderer.loadTexture(fileName: String): SDL_Texture { - val paths = listOf(fileName, "resources/$fileName", "../resources/$fileName") - val filePath = paths.find { File(it).canRead() } ?: error("Can't find image file.") - - val bmp = libSDL2Library.SDL_LoadBMP_RW(libSDL2Library.SDL_RWFromFile(filePath, "rb"), 1) - - return libSDL2Library.SDL_CreateTextureFromSurface(this@loadTexture, bmp) - } - - fun allocRect(x: Int, y: Int, w: Int, h: Int) = SDL_Rect().also { - it.x = x - it.y = y - it.w = w - it.h = h - } - } - - override fun close() { - controller.takeIf { it != null } - ?.let { libSDL2Library.SDL_GameControllerClose(it) } - libSDL2Library.SDL_DestroyTexture(sprites.texture) - libSDL2Library.SDL_DestroyTexture(sprites.grassTexture) - libSDL2Library.SDL_DestroyTexture(font.texture) - libSDL2Library.SDL_DestroyRenderer(renderer) - libSDL2Library.SDL_DestroyWindow(window) - libSDL2Library.SDL_Quit() - } -} - -data class Game( - val width: Int, - val height: Int, - val snake: Snake, - val apples: Apples = Apples(width, height) -) { - val isOver = - snake.tail.contains(snake.head) || - snake.cells.any { it.x < 0 || it.x >= width || it.y < 0 || it.y >= height } - - val score = snake.cells.size - - fun update(direction: Direction? = null): Game { - if (isOver) return this - val (newSnake, newApples) = snake.turn(direction).move().eat(apples.grow()) - return copy(snake = newSnake, apples = newApples) - } -} - -data class Snake( - val cells: List, - val direction: Direction, - val eatenApples: Int = 0 -) { - val head = cells.first() - val tail = cells.subList(1, cells.size) - - fun move(): Snake { - val newHead = head.move(direction) - val newTail = if (eatenApples == 0) cells.dropLast(1) else cells - return copy( - cells = listOf(newHead) + newTail, - eatenApples = max(eatenApples - 1, 0) - ) - } - - fun turn(newDirection: Direction?): Snake { - if (newDirection == null || newDirection.isOpposite(direction)) return this - return copy(direction = newDirection) - } - - fun eat(apples: Apples): Pair { - if (!apples.cells.contains(head)) return Pair(this, apples) - return Pair( - copy(eatenApples = eatenApples + 1), - apples.copy(cells = apples.cells - head) - ) - } -} - -data class Apples( - val fieldWidth: Int, - val fieldHeight: Int, - val cells: Set = emptySet(), - val growthSpeed: Int = 3, - val random: Random = Random -) { - fun grow(): Apples { - if (random.nextInt(growthSpeed) != 0) return this - return copy(cells = cells + Cell(random.nextInt(fieldWidth), random.nextInt(fieldHeight))) - } -} - -data class Cell(val x: Int, val y: Int) { - fun move(direction: Direction) = Cell(x + direction.dx, y + direction.dy) -} - -enum class Direction(val dx: Int, val dy: Int) { - up(0, -1), down(0, 1), left(-1, 0), right(1, 0); - - fun isOpposite(that: Direction) = dx + that.dx == 0 && dy + that.dy == 0 -} \ No newline at end of file diff --git a/bindings/wgpu-native/settings.gradle.kts b/bindings/wgpu-native/settings.gradle.kts index 799928b8..eb4f022f 100644 --- a/bindings/wgpu-native/settings.gradle.kts +++ b/bindings/wgpu-native/settings.gradle.kts @@ -1,4 +1,3 @@ -rootProject.name = "wgpu" pluginManagement { repositories { @@ -8,6 +7,8 @@ pluginManagement { } } -include(":libwgpu") +include(":libwgpu", ":binaries") findProject(":libwgpu")?.name = "wgpu4k" +findProject(":binaries")?.name = "wgpu-binaries" +include(":example") diff --git a/bindings/wgpu/build.gradle.kts b/bindings/wgpu/build.gradle.kts new file mode 100644 index 00000000..fa46e2a4 --- /dev/null +++ b/bindings/wgpu/build.gradle.kts @@ -0,0 +1,23 @@ + +plugins { + alias(libs.plugins.kotlinMultiplatform).apply(false) +} + + +allprojects { + + repositories { + mavenLocal() + mavenCentral() + // Use by rococoa + maven { + url = uri("http://repo.maven.cyberduck.io.s3.amazonaws.com/releases") + isAllowInsecureProtocol = true + } + } + + group = "io.ygdrasil" + version = "1.0.0-SNAPSHOT" +} + + diff --git a/bindings/wgpu/examples/SDL2/build.gradle.kts b/bindings/wgpu/examples/SDL2/build.gradle.kts new file mode 100644 index 00000000..70b9ae57 --- /dev/null +++ b/bindings/wgpu/examples/SDL2/build.gradle.kts @@ -0,0 +1,14 @@ + +plugins { + kotlin("jvm") + application +} + +dependencies { + implementation(project(":examples:common")) +} + +application { + mainClass.set("io.ygdrasil.wgpu.examples.MainKt") + applicationDefaultJvmArgs += "-XstartOnFirstThread" +} diff --git a/bindings/wgpu/examples/SDL2/src/main/kotlin/JvmApplication.kt b/bindings/wgpu/examples/SDL2/src/main/kotlin/JvmApplication.kt new file mode 100644 index 00000000..f24c2bb0 --- /dev/null +++ b/bindings/wgpu/examples/SDL2/src/main/kotlin/JvmApplication.kt @@ -0,0 +1,58 @@ +package io.ygdrasil.wgpu.examples + +import com.sun.jna.ptr.IntByReference +import io.ygdrasil.libsdl.* +import io.ygdrasil.wgpu.RenderingContext +import io.ygdrasil.wgpu.WGPU + +suspend fun jvmApplication() = (WGPU.createInstance() ?: error("fail to wgpu instance")).use { instance -> + + val window = SDL_CreateWindow( + "", SDL_WINDOWPOS_CENTERED.toInt(), + SDL_WINDOWPOS_CENTERED.toInt(), 800, 600, + SDL_WindowFlags.SDL_WINDOW_SHOWN.value + ) ?: error("fail to create window ${SDL_GetError()}") + + val surface = instance.getSurface(window) ?: error("fail to create surface") + val renderingContext = RenderingContext(surface) { + val width = IntByReference() + val height = IntByReference() + SDL_GetWindowSize(window, width.pointer, height.pointer) + width.value to height.value + } + + val adapter = instance.requestAdapter(renderingContext) + ?: error("fail to get adapter") + + val device = adapter.requestDevice() + ?: error("fail to get device") + + renderingContext.computeSurfaceCapabilities(adapter) + + val application = object : Application( + renderingContext, + device, + adapter, + assetManager + ) { + override fun run() { + while (true) { + renderFrame() + pollEvent() + } + } + + private fun pollEvent() { + val event = SDL_Event() + while (SDL_PollEvent(event) != 0) { + } + } + + + } + + application.run() + +} + + diff --git a/bindings/wgpu/examples/SDL2/src/main/kotlin/main.kt b/bindings/wgpu/examples/SDL2/src/main/kotlin/main.kt new file mode 100644 index 00000000..1e21074a --- /dev/null +++ b/bindings/wgpu/examples/SDL2/src/main/kotlin/main.kt @@ -0,0 +1,27 @@ +package io.ygdrasil.wgpu.examples + +import io.ygdrasil.libsdl.* +import io.ygdrasil.wgpu.internal.jvm.wgpuGetVersion +import kotlinx.coroutines.runBlocking + +fun main() { + printVersion() + initSDL() + runBlocking { + jvmApplication() + } +} + +fun initSDL() { + if (SDL_Init(SDL_INIT_EVERYTHING.toInt()) != 0) { + error("SDL_Init Error: ${SDL_GetError()}") + } +} + +fun printVersion() { + println("WGPU version ${wgpuGetVersion()}") + SDL_version().apply { + SDL_GetVersion(this) + println("SDL version $major.$minor.$patch") + } +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/build.gradle.kts b/bindings/wgpu/examples/common/build.gradle.kts new file mode 100644 index 00000000..5fe30fdf --- /dev/null +++ b/bindings/wgpu/examples/common/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + alias(libs.plugins.kotlinMultiplatform) +} + +kotlin { + js { + binaries.executable() + browser() + generateTypeScriptDefinitions() + } + jvm() + + + sourceSets { + val commonMain by getting { + dependencies { + api(project(":wgpu4k")) + api(libs.coroutines) + api("com.soywiz.korge:korge-foundation:5.4.0") + } + } + + val jvmMain by getting { + dependencies { + api(project(":librococoa")) + } + } + } +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/Application.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/Application.kt new file mode 100644 index 00000000..72bc922b --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/Application.kt @@ -0,0 +1,103 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu.examples + +import io.ygdrasil.wgpu.* +import io.ygdrasil.wgpu.examples.scenes.basic.* +import kotlin.js.JsExport + +@JsExport +abstract class Application( + val renderingContext: RenderingContext, + val device: Device, + val adapter: Adapter, + assetManager: AssetManager +) : AutoCloseable, AssetManager by assetManager { + + lateinit var currentScene: Scene + private set + private var onError = false + + val dummyTexture by lazy { + device.createTexture( + TextureDescriptor( + size = GPUExtent3DDictStrict(1, 1), + format = TextureFormat.depth24plus, + usage = TextureUsage.renderattachment.value, + ) + ) + } + + + var frame = 0 + private set + + init { + changeScene(availableScenes.first()) + } + + abstract class Scene { + + abstract fun Application.initialiaze() + + abstract fun Application.render() + + } + + fun changeScene(nextScene: Scene) { + with(nextScene) { + try { + configureRenderingContext() + initialiaze() + } catch (e: Throwable) { + e.printStackTrace() + onError = true + throw e + } + } + currentScene = nextScene + } + + fun renderFrame() { + if (onError) return + frame += 1 + with(currentScene) { + try { + render() + } catch (e: Throwable) { + e.printStackTrace() + onError = true + throw e + } + } + } + + override fun close() { + renderingContext.close() + device.close() + adapter.close() + } + + abstract fun run() + + fun configureRenderingContext() { + renderingContext.configure( + CanvasConfiguration( + device = device + ) + ) + } +} + +val availableScenes = listOf( + RotatingCubeScene(), + + + BlueTitlingScene(), + CubemapScene(), + FractalCubeScene(), + InstancedCubeScene(), + TexturedCubeScene(), + TwoCubesScene(), + SimpleTriangleScene(), +) \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/AssetManager.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/AssetManager.kt new file mode 100644 index 00000000..745911f8 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/AssetManager.kt @@ -0,0 +1,16 @@ +package io.ygdrasil.wgpu.examples + +import io.ygdrasil.wgpu.ImageBitmapHolder + + +interface AssetManager { + + val Di3d: ImageBitmapHolder + + val cubemapPosx: ImageBitmapHolder + val cubemapNegx: ImageBitmapHolder + val cubemapPosy: ImageBitmapHolder + val cubemapNegy: ImageBitmapHolder + val cubemapPosz: ImageBitmapHolder + val cubemapNegz: ImageBitmapHolder +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/AutoClosableContext.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/AutoClosableContext.kt new file mode 100644 index 00000000..53288945 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/AutoClosableContext.kt @@ -0,0 +1,18 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu.examples + +fun autoClosableContext(block: AutoClosableContext.() -> T): T = AutoClosableContext() + .use { it.block() } + +class AutoClosableContext : AutoCloseable { + + private val subjects: MutableList = mutableListOf() + + fun T.bind(): T = also { subjects.add(it) } + + override fun close() { + subjects.reversed() + .forEach { it.close() } + } +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/BlueTitlingScene.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/BlueTitlingScene.kt new file mode 100644 index 00000000..0a2e40d9 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/BlueTitlingScene.kt @@ -0,0 +1,69 @@ +package io.ygdrasil.wgpu.examples + +import io.ygdrasil.wgpu.RenderPassDescriptor + +class TitlingManager() { + fun nextFrame() { + if (value > 255.0) { + delta = -5.0 + } else if (value < 0) { + delta = 5.0 + } + + value += delta + } + + fun reset() { + delta = 5.0 + value = 0.0 + } + + private var delta = 5.0 + var value = 0.0 + private set +} + +class BlueTitlingScene : Application.Scene() { + + private val titlingManager = TitlingManager() + + override fun Application.initialiaze() { + titlingManager.reset() + } + + override fun Application.render() = autoClosableContext { + titlingManager.nextFrame() + + // Clear the canvas with a render pass + val encoder = device.createCommandEncoder() + .bind() + + val texture = renderingContext.getCurrentTexture() + .bind() + val view = texture.createView() + .bind() + + val renderPassEncoder = encoder.beginRenderPass( + RenderPassDescriptor( + colorAttachments = arrayOf( + RenderPassDescriptor.ColorAttachment( + view = view, + loadOp = "clear", + clearValue = arrayOf(0, 0, titlingManager.value / 255.0, 1.0), + storeOp = "store" + ) + ) + ) + ).bind() + renderPassEncoder.end() + + val commandBuffer = encoder.finish() + .bind() + + device.queue.submit(arrayOf(commandBuffer)) + + renderingContext.present() + + } + +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/SimpleTriangleScene.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/SimpleTriangleScene.kt new file mode 100644 index 00000000..b9800b36 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/SimpleTriangleScene.kt @@ -0,0 +1,97 @@ +package io.ygdrasil.wgpu.examples + +import io.ygdrasil.wgpu.* + +class SimpleTriangleScene : Application.Scene() { + + lateinit var renderPipeline: RenderPipeline + + override fun Application.initialiaze() { + val shaderModule = device.createShaderModule( + ShaderModuleDescriptor( + code = shader + ) + ) + + val pipelineLayout = device.createPipelineLayout(PipelineLayoutDescriptor()) + + renderPipeline = device.createRenderPipeline( + RenderPipelineDescriptor( + layout = pipelineLayout, + vertex = RenderPipelineDescriptor.VertexState( + module = shaderModule, + entryPoint = "vs_main" + ), + fragment = RenderPipelineDescriptor.FragmentState( + module = shaderModule, + entryPoint = "fs_main", + targets = arrayOf( + RenderPipelineDescriptor.FragmentState.ColorTargetState( + format = renderingContext.textureFormat, + writeMask = ColorWriteMask.all + ) + ) + ), + primitive = RenderPipelineDescriptor.PrimitiveState( + topology = PrimitiveTopology.trianglelist + ), + multisample = RenderPipelineDescriptor.MultisampleState( + count = 1, + mask = 0xFFFFFFF + ) + ) + ) + } + + override fun Application.render() = autoClosableContext { + + // Clear the canvas with a render pass + val encoder = device.createCommandEncoder() + .bind() + + val texture = renderingContext.getCurrentTexture() + .bind() + val view = texture.createView() + .bind() + + val renderPassEncoder = encoder.beginRenderPass( + RenderPassDescriptor( + colorAttachments = arrayOf( + RenderPassDescriptor.ColorAttachment( + view = view, + loadOp = "clear", + clearValue = arrayOf(0, 1.0, 0, 1.0), + storeOp = "store" + ) + ) + ) + ) + .bind() + + renderPassEncoder.setPipeline(renderPipeline) + renderPassEncoder.draw(3, 1, 0, 0) + renderPassEncoder.end() + + val commandBuffer = encoder.finish() + .bind() + + device.queue.submit(arrayOf(commandBuffer)) + + renderingContext.present() + + } +} + +private val shader = """ + @vertex + fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4 { + let x = f32(i32(in_vertex_index) - 1); + let y = f32(i32(in_vertex_index & 1u) * 2 - 1); + return vec4(x, y, 0.0, 1.0); + } + + @fragment + fn fs_main() -> @location(0) vec4 { + return vec4(1.0, 0.0, 0.0, 1.0); + } +""".trimIndent() \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/Cubemap.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/Cubemap.kt new file mode 100644 index 00000000..be80e000 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/Cubemap.kt @@ -0,0 +1,270 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu.examples.scenes.basic + +import io.ygdrasil.wgpu.* +import io.ygdrasil.wgpu.examples.Application +import io.ygdrasil.wgpu.examples.AutoClosableContext +import io.ygdrasil.wgpu.examples.autoClosableContext +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubePositionOffset +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeUVOffset +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexArray +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexCount +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexSize +import io.ygdrasil.wgpu.examples.scenes.shader.fragment.sampleCubemapShader +import io.ygdrasil.wgpu.examples.scenes.shader.vertex.basicVertexShader +import korlibs.math.geom.Angle +import korlibs.math.geom.Matrix4 +import kotlin.js.JsExport +import kotlin.math.PI + +@JsExport +class CubemapScene : Application.Scene(), AutoCloseable { + + lateinit var renderPipeline: RenderPipeline + lateinit var projectionMatrix: Matrix4 + lateinit var renderPassDescriptor: RenderPassDescriptor + lateinit var uniformBuffer: Buffer + lateinit var uniformBindGroup: BindGroup + lateinit var verticesBuffer: Buffer + + val modelMatrix = Matrix4.scale(1000, 1000, 1000) + + val autoClosableContext = AutoClosableContext() + + override fun Application.initialiaze() = with(autoClosableContext) { + + // Create a vertex buffer from the cube data. + verticesBuffer = device.createBuffer( + BufferDescriptor( + size = (cubeVertexArray.size * Float.SIZE_BYTES).toLong(), + usage = BufferUsage.vertex.value, + mappedAtCreation = true + ) + ) + + // Util method to use getMappedRange + verticesBuffer.map(cubeVertexArray) + verticesBuffer.unmap() + + renderPipeline = device.createRenderPipeline( + RenderPipelineDescriptor( + vertex = RenderPipelineDescriptor.VertexState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = basicVertexShader + ) + ).bind(), // bind to autoClosableContext to release it later + buffers = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout( + arrayStride = cubeVertexSize, + attributes = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 0, + offset = cubePositionOffset, + format = VertexFormat.float32x4 + ), + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 1, + offset = cubeUVOffset, + format = VertexFormat.float32x2 + ) + ) + ) + ) + ), + fragment = RenderPipelineDescriptor.FragmentState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = sampleCubemapShader + ) + ).bind(), // bind to autoClosableContext to release it later + targets = arrayOf( + RenderPipelineDescriptor.FragmentState.ColorTargetState( + format = renderingContext.textureFormat + ) + ) + ), + primitive = RenderPipelineDescriptor.PrimitiveState( + topology = PrimitiveTopology.trianglelist, + cullMode = CullMode.none + ), + depthStencil = RenderPipelineDescriptor.DepthStencilState( + depthWriteEnabled = true, + depthCompare = "less", + format = TextureFormat.depth24plus + ) + ) + ).bind() + + val depthTexture = device.createTexture( + TextureDescriptor( + size = GPUExtent3DDictStrict(renderingContext.width, renderingContext.height), + format = TextureFormat.depth24plus, + usage = TextureUsage.renderattachment.value, + ) + ).bind() + + val imageBitmaps = listOf( + cubemapPosx, + cubemapNegx, + cubemapPosy, + cubemapNegy, + cubemapPosz, + cubemapNegz, + ) + + val cubemapTexture = device.createTexture( + TextureDescriptor( + dimension = TextureDimension._2d, + // Create a 2d array texture. + // Assume each image has the same size. + size = GPUExtent3DDictStrict(imageBitmaps[0].width, imageBitmaps[0].height, 6), + format = TextureFormat.rgba8unorm, + usage = TextureUsage.texturebinding or TextureUsage.copydst or TextureUsage.renderattachment, + ) + ).bind() + + + imageBitmaps.forEachIndexed { index, imageBitmap -> + device.queue.copyExternalImageToTexture( + ImageCopyExternalImage(source = imageBitmap), + ImageCopyTextureTagged(texture = cubemapTexture, origin = GPUExtent3DDictStrict(0, 0, index)), + imageBitmap.width to imageBitmap.height + ) + } + + + val uniformBufferSize = 4L * 16L; // 4x4 matrix + uniformBuffer = device.createBuffer( + BufferDescriptor( + size = uniformBufferSize, + usage = BufferUsage.uniform or BufferUsage.copydst + ) + ).bind() + + val sampler = device.createSampler( + SamplerDescriptor( + magFilter = "linear", + minFilter = "linear", + ) + ).bind() + + + uniformBindGroup = device.createBindGroup( + BindGroupDescriptor( + layout = renderPipeline.getBindGroupLayout(0), + entries = arrayOf( + BindGroupDescriptor.BindGroupEntry( + binding = 0, + resource = BindGroupDescriptor.BufferBinding( + buffer = uniformBuffer, + offset = 0, + size = uniformBufferSize + ) + ), + BindGroupDescriptor.BindGroupEntry( + binding = 1, + resource = BindGroupDescriptor.SamplerBinding( + sampler = sampler + ) + ), + BindGroupDescriptor.BindGroupEntry( + binding = 2, + resource = BindGroupDescriptor.TextureViewBinding( + view = cubemapTexture.createView( + TextureViewDescriptor( + dimension = "cube" + ) + ) + ) + ) + ) + ) + ) + + renderPassDescriptor = RenderPassDescriptor( + colorAttachments = arrayOf( + RenderPassDescriptor.ColorAttachment( + view = dummyTexture.createView().bind(), // Assigned later + loadOp = "clear", + clearValue = arrayOf(0.5, 0.5, 0.5, 1.0), + storeOp = "store", + ) + ), + depthStencilAttachment = RenderPassDescriptor.RenderPassDepthStencilAttachment( + view = depthTexture.createView(), + depthClearValue = 1.0f, + depthLoadOp = LoadOp.clear, + depthStoreOp = StoreOp.store + ) + ) + + + val aspect = renderingContext.width / renderingContext.height.toDouble() + val fox = Angle.fromRadians((2 * PI) / 5) + projectionMatrix = Matrix4.perspective(fox, aspect, 1.0, 3000.0) + + } + + override fun Application.render() = autoClosableContext { + + val transformationMatrix = getTransformationMatrix( + frame / 100.0, + projectionMatrix + ) + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix, + 0, + transformationMatrix.size.toLong() + ) + + renderPassDescriptor.colorAttachments[0].view = renderingContext + .getCurrentTexture() + .bind() + .createView() + + val encoder = device.createCommandEncoder() + .bind() + + val renderPassEncoder = encoder.beginRenderPass(renderPassDescriptor) + .bind() + renderPassEncoder.setPipeline(renderPipeline) + renderPassEncoder.setBindGroup(0, uniformBindGroup) + renderPassEncoder.setVertexBuffer(0, verticesBuffer) + renderPassEncoder.draw(cubeVertexCount) + renderPassEncoder.end() + + val commandBuffer = encoder.finish() + .bind() + + device.queue.submit(arrayOf(commandBuffer)) + + renderingContext.present() + + } + + override fun close() { + autoClosableContext.close() + } + + private fun getTransformationMatrix(angle: Double, projectionMatrix: Matrix4): FloatArray { + + var viewMatrix = Matrix4.IDENTITY + viewMatrix *= Matrix4.rotation( + angle = Angle.fromRadians((PI / 10) * Angle.fromRadians(angle).sine), + x = 1, y = 0, z = 0 + ) + viewMatrix *= Matrix4.rotation( + angle = Angle.fromRadians(angle * 0.2), + x = 0, y = 1, z = 0 + ) + val modelViewProjectionMatrix = viewMatrix * modelMatrix + + return (projectionMatrix * modelViewProjectionMatrix).copyToColumns() + } +} + + diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/FractalCube.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/FractalCube.kt new file mode 100644 index 00000000..bd0244dc --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/FractalCube.kt @@ -0,0 +1,259 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu.examples.scenes.basic + +import io.ygdrasil.wgpu.* +import io.ygdrasil.wgpu.examples.Application +import io.ygdrasil.wgpu.examples.AutoClosableContext +import io.ygdrasil.wgpu.examples.autoClosableContext +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubePositionOffset +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeUVOffset +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexArray +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexCount +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexSize +import io.ygdrasil.wgpu.examples.scenes.shader.fragment.sampleSelfShader +import io.ygdrasil.wgpu.examples.scenes.shader.vertex.basicVertexShader +import korlibs.math.geom.Angle +import korlibs.math.geom.Matrix4 +import kotlin.js.JsExport +import kotlin.math.PI + +@JsExport +class FractalCubeScene : Application.Scene(), AutoCloseable { + + lateinit var renderPipeline: RenderPipeline + lateinit var projectionMatrix: Matrix4 + lateinit var renderPassDescriptor: RenderPassDescriptor + lateinit var uniformBuffer: Buffer + lateinit var uniformBindGroup: BindGroup + lateinit var verticesBuffer: Buffer + lateinit var cubeTexture: Texture + + val autoClosableContext = AutoClosableContext() + + override fun Application.initialiaze() = with(autoClosableContext) { + + renderingContext.configure( + CanvasConfiguration( + device, + format = renderingContext.textureFormat, + + // Specify we want both RENDER_ATTACHMENT and COPY_SRC since we + // will copy out of the swapchain texture. + usage = TextureUsage.renderattachment or TextureUsage.copysrc, + alphaMode = CompositeAlphaMode.premultiplied + ) + ) + + // Create a vertex buffer from the cube data. + verticesBuffer = device.createBuffer( + BufferDescriptor( + size = (cubeVertexArray.size * Float.SIZE_BYTES).toLong(), + usage = BufferUsage.vertex.value, + mappedAtCreation = true + ) + ) + + // Util method to use getMappedRange + verticesBuffer.map(cubeVertexArray) + verticesBuffer.unmap() + + renderPipeline = device.createRenderPipeline( + RenderPipelineDescriptor( + vertex = RenderPipelineDescriptor.VertexState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = basicVertexShader + ) + ).bind(), // bind to autoClosableContext to release it later + buffers = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout( + arrayStride = cubeVertexSize, + attributes = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 0, + offset = cubePositionOffset, + format = VertexFormat.float32x4 + ), + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 1, + offset = cubeUVOffset, + format = VertexFormat.float32x2 + ) + ) + ) + ) + ), + fragment = RenderPipelineDescriptor.FragmentState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = sampleSelfShader + ) + ).bind(), // bind to autoClosableContext to release it later + targets = arrayOf( + RenderPipelineDescriptor.FragmentState.ColorTargetState( + format = renderingContext.textureFormat + ) + ) + ), + primitive = RenderPipelineDescriptor.PrimitiveState( + topology = PrimitiveTopology.trianglelist, + cullMode = CullMode.back + ), + depthStencil = RenderPipelineDescriptor.DepthStencilState( + depthWriteEnabled = true, + depthCompare = "less", + format = TextureFormat.depth24plus + ) + ) + ).bind() + + val depthTexture = device.createTexture( + TextureDescriptor( + size = GPUExtent3DDictStrict(renderingContext.width, renderingContext.height), + format = TextureFormat.depth24plus, + usage = TextureUsage.renderattachment.value, + ) + ).bind() + + val uniformBufferSize = 4L * 16L; // 4x4 matrix + uniformBuffer = device.createBuffer( + BufferDescriptor( + size = uniformBufferSize, + usage = BufferUsage.uniform or BufferUsage.copydst + ) + ).bind() + + // We will copy the frame's rendering results into this texture and + // sample it on the next frame. + cubeTexture = device.createTexture( + TextureDescriptor( + size = GPUExtent3DDictStrict(renderingContext.width, renderingContext.height), + format = renderingContext.textureFormat, + usage = TextureUsage.texturebinding or TextureUsage.copydst, + ) + ) + + // Create a sampler with linear filtering for smooth interpolation. + val sampler = device.createSampler( + SamplerDescriptor( + magFilter = "linear", + minFilter = "linear", + ) + ) + + + uniformBindGroup = device.createBindGroup( + BindGroupDescriptor( + layout = renderPipeline.getBindGroupLayout(0), + entries = arrayOf( + BindGroupDescriptor.BindGroupEntry( + binding = 0, + resource = BindGroupDescriptor.BufferBinding( + buffer = uniformBuffer + ) + ), + BindGroupDescriptor.BindGroupEntry( + binding = 1, + resource = BindGroupDescriptor.SamplerBinding( + sampler = sampler + ) + ), + BindGroupDescriptor.BindGroupEntry( + binding = 2, + resource = BindGroupDescriptor.TextureViewBinding( + view = cubeTexture.createView() + ) + ) + ) + ) + ) + + renderPassDescriptor = RenderPassDescriptor( + colorAttachments = arrayOf( + RenderPassDescriptor.ColorAttachment( + view = dummyTexture.createView().bind(), // Assigned later + loadOp = "clear", + clearValue = arrayOf(0.5, 0.5, 0.5, 1.0), + storeOp = "store", + ) + ), + depthStencilAttachment = RenderPassDescriptor.RenderPassDepthStencilAttachment( + view = depthTexture.createView(), + depthClearValue = 1.0f, + depthLoadOp = LoadOp.clear, + depthStoreOp = StoreOp.store + ) + ) + + + val aspect = renderingContext.width / renderingContext.height.toDouble() + val fox = Angle.fromRadians((2 * PI) / 5) + projectionMatrix = Matrix4.perspective(fox, aspect, 1.0, 100.0) + } + + override fun Application.render() = autoClosableContext { + + val transformationMatrix = getTransformationMatrix( + frame / 100.0, + projectionMatrix + ) + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix, + 0, + transformationMatrix.size.toLong() + ) + + val swapChainTexture = renderingContext.getCurrentTexture() + + renderPassDescriptor.colorAttachments[0].view = swapChainTexture + .bind() + .createView() + + val encoder = device.createCommandEncoder() + .bind() + + val renderPassEncoder = encoder.beginRenderPass(renderPassDescriptor) + .bind() + renderPassEncoder.setPipeline(renderPipeline) + renderPassEncoder.setBindGroup(0, uniformBindGroup) + renderPassEncoder.setVertexBuffer(0, verticesBuffer) + renderPassEncoder.draw(cubeVertexCount) + renderPassEncoder.end() + + encoder.copyTextureToTexture( + ImageCopyTexture(texture = swapChainTexture), + ImageCopyTexture(texture = cubeTexture), + renderingContext.width to renderingContext.height + ) + + val commandBuffer = encoder.finish() + .bind() + + device.queue.submit(arrayOf(commandBuffer)) + + renderingContext.present() + + } + + override fun close() { + autoClosableContext.close() + } + +} + + +private fun getTransformationMatrix(angle: Double, projectionMatrix: Matrix4): FloatArray { + var viewMatrix = Matrix4.IDENTITY + viewMatrix = viewMatrix.translated(0, 0, -4) + + viewMatrix = viewMatrix.rotated( + Angle.fromRadians(Angle.fromRadians(angle).sine), + Angle.fromRadians(Angle.fromRadians(angle).cosine), + Angle.fromRadians(0) + ) + + return (projectionMatrix * viewMatrix).copyToColumns() +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/InstancedCube.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/InstancedCube.kt new file mode 100644 index 00000000..f515fe38 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/InstancedCube.kt @@ -0,0 +1,226 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu.examples.scenes.basic + +import io.ygdrasil.wgpu.* +import io.ygdrasil.wgpu.examples.Application +import io.ygdrasil.wgpu.examples.AutoClosableContext +import io.ygdrasil.wgpu.examples.autoClosableContext +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube +import io.ygdrasil.wgpu.examples.scenes.shader.fragmentVertexPositionColorShader +import io.ygdrasil.wgpu.examples.scenes.shader.vertex.instancedShader +import korlibs.math.geom.Angle +import korlibs.math.geom.Matrix4 +import kotlin.math.PI + +val xCount = 4 +val yCount = 4 +val numInstances = xCount * yCount + +class InstancedCubeScene() : Application.Scene(), AutoCloseable { + + + lateinit var renderPipeline: RenderPipeline + lateinit var projectionMatrix: Matrix4 + lateinit var renderPassDescriptor: RenderPassDescriptor + lateinit var uniformBuffer: Buffer + lateinit var uniformBindGroup: BindGroup + lateinit var verticesBuffer: Buffer + val modelMatrices = Array(numInstances) { null } + + val autoClosableContext = AutoClosableContext() + + override fun Application.initialiaze() = with(autoClosableContext) { + + // Create a vertex buffer from the cube data. + verticesBuffer = device.createBuffer( + BufferDescriptor( + size = (Cube.cubeVertexArray.size * Float.SIZE_BYTES).toLong(), + usage = BufferUsage.vertex.value, + mappedAtCreation = true + ) + ) + + // Util method to use getMappedRange + verticesBuffer.map(Cube.cubeVertexArray) + verticesBuffer.unmap() + + renderPipeline = device.createRenderPipeline( + RenderPipelineDescriptor( + vertex = RenderPipelineDescriptor.VertexState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = instancedShader + ) + ).bind(), // bind to autoClosableContext to release it later + buffers = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout( + arrayStride = Cube.cubeVertexSize, + attributes = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 0, + offset = Cube.cubePositionOffset, + format = VertexFormat.float32x4 + ), + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 1, + offset = Cube.cubeUVOffset, + format = VertexFormat.float32x2 + ) + ) + ) + ) + ), + fragment = RenderPipelineDescriptor.FragmentState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = fragmentVertexPositionColorShader + ) + ).bind(), // bind to autoClosableContext to release it later + targets = arrayOf( + RenderPipelineDescriptor.FragmentState.ColorTargetState( + format = renderingContext.textureFormat + ) + ) + ), + primitive = RenderPipelineDescriptor.PrimitiveState( + topology = PrimitiveTopology.trianglelist, + cullMode = CullMode.back + ), + depthStencil = RenderPipelineDescriptor.DepthStencilState( + depthWriteEnabled = true, + depthCompare = "less", + format = TextureFormat.depth24plus + ) + ) + ).bind() + + val depthTexture = device.createTexture( + TextureDescriptor( + size = GPUExtent3DDictStrict(renderingContext.width, renderingContext.height), + format = TextureFormat.depth24plus, + usage = TextureUsage.renderattachment.value, + ) + ).bind() + + val uniformBufferSize = numInstances * 4L * 16L; // 4x4 matrix + uniformBuffer = device.createBuffer( + BufferDescriptor( + size = uniformBufferSize, + usage = BufferUsage.uniform or BufferUsage.copydst + ) + ).bind() + + uniformBindGroup = device.createBindGroup( + BindGroupDescriptor( + layout = renderPipeline.getBindGroupLayout(0), + entries = arrayOf( + BindGroupDescriptor.BindGroupEntry( + binding = 0, + resource = BindGroupDescriptor.BufferBinding( + buffer = uniformBuffer + ) + ) + ) + ) + ) + + renderPassDescriptor = RenderPassDescriptor( + colorAttachments = arrayOf( + RenderPassDescriptor.ColorAttachment( + view = dummyTexture.createView().bind(), // Assigned later + loadOp = "clear", + clearValue = arrayOf(0.5, 0.5, 0.5, 1.0), + storeOp = "store", + ) + ), + depthStencilAttachment = RenderPassDescriptor.RenderPassDepthStencilAttachment( + view = depthTexture.createView(), + depthClearValue = 1.0f, + depthLoadOp = LoadOp.clear, + depthStoreOp = StoreOp.store + ) + ) + + + val aspect = renderingContext.width / renderingContext.height.toDouble() + val fox = Angle.fromRadians((2 * PI) / 5) + projectionMatrix = Matrix4.perspective(fox, aspect, 1.0, 100.0) + + val step = 4.0 + var m = 0 + (0 until xCount).forEach { x -> + (0 until yCount).forEach { y -> + modelMatrices[m] = projectionMatrix + .translated( + step * (x - xCount / 2 + 0.5), + step * (y - yCount / 2 + 0.5), + -12.0 + ) + m += 1 + } + } + } + + override fun Application.render() = autoClosableContext { + + val transformationMatrix = getTransformationMatrix( + frame / 100.0, + modelMatrices + ) + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix, + 0, + transformationMatrix.size.toLong() + ) + + renderPassDescriptor.colorAttachments[0].view = renderingContext + .getCurrentTexture() + .bind() + .createView() + + val encoder = device.createCommandEncoder() + .bind() + + val renderPassEncoder = encoder.beginRenderPass(renderPassDescriptor) + .bind() + renderPassEncoder.setPipeline(renderPipeline) + renderPassEncoder.setBindGroup(0, uniformBindGroup) + renderPassEncoder.setVertexBuffer(0, verticesBuffer) + renderPassEncoder.draw(Cube.cubeVertexCount, numInstances) + renderPassEncoder.end() + + val commandBuffer = encoder.finish() + .bind() + + device.queue.submit(arrayOf(commandBuffer)) + + renderingContext.present() + + } + + override fun close() { + autoClosableContext.close() + } +} + +private fun getTransformationMatrix(angle: Double, modelMatrices: Array): FloatArray { + val uniform = mutableListOf() + + var m = 0 + (0 until xCount).forEach { x -> + (0 until yCount).forEach { y -> + modelMatrices[m]!!.rotated( + Angle.fromRadians(Angle.fromRadians((x + 0.5) * angle).sine), + Angle.fromRadians(Angle.fromRadians((x + 0.5) * angle).cosine), + Angle.fromRadians(0) + ).copyToColumns() + .let { uniform.add(it) } + m += 1 + } + } + + return uniform.flatMap { it.asList() }.toFloatArray() +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/RotatingCube.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/RotatingCube.kt new file mode 100644 index 00000000..d6d0b117 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/RotatingCube.kt @@ -0,0 +1,212 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu.examples.scenes.basic + +import io.ygdrasil.wgpu.* +import io.ygdrasil.wgpu.examples.Application +import io.ygdrasil.wgpu.examples.AutoClosableContext +import io.ygdrasil.wgpu.examples.autoClosableContext +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubePositionOffset +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeUVOffset +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexArray +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexCount +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexSize +import io.ygdrasil.wgpu.examples.scenes.shader.fragmentVertexPositionColorShader +import io.ygdrasil.wgpu.examples.scenes.shader.vertex.basicVertexShader +import korlibs.math.geom.Angle +import korlibs.math.geom.Matrix4 +import kotlin.js.JsExport +import kotlin.math.PI + +@JsExport +class RotatingCubeScene : Application.Scene(), AutoCloseable { + + lateinit var renderPipeline: RenderPipeline + lateinit var projectionMatrix: Matrix4 + lateinit var renderPassDescriptor: RenderPassDescriptor + lateinit var uniformBuffer: Buffer + lateinit var uniformBindGroup: BindGroup + lateinit var verticesBuffer: Buffer + + val autoClosableContext = AutoClosableContext() + + override fun Application.initialiaze() = with(autoClosableContext) { + + // Create a vertex buffer from the cube data. + verticesBuffer = device.createBuffer( + BufferDescriptor( + size = (cubeVertexArray.size * Float.SIZE_BYTES).toLong(), + usage = BufferUsage.vertex.value, + mappedAtCreation = true + ) + ) + + // Util method to use getMappedRange + verticesBuffer.map(cubeVertexArray) + verticesBuffer.unmap() + + renderPipeline = device.createRenderPipeline( + RenderPipelineDescriptor( + vertex = RenderPipelineDescriptor.VertexState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = basicVertexShader + ) + ).bind(), // bind to autoClosableContext to release it later + buffers = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout( + arrayStride = cubeVertexSize, + attributes = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 0, + offset = cubePositionOffset, + format = VertexFormat.float32x4 + ), + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 1, + offset = cubeUVOffset, + format = VertexFormat.float32x2 + ) + ) + ) + ) + ), + fragment = RenderPipelineDescriptor.FragmentState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = fragmentVertexPositionColorShader + ) + ).bind(), // bind to autoClosableContext to release it later + targets = arrayOf( + RenderPipelineDescriptor.FragmentState.ColorTargetState( + format = renderingContext.textureFormat + ) + ) + ), + primitive = RenderPipelineDescriptor.PrimitiveState( + topology = PrimitiveTopology.trianglelist, + cullMode = CullMode.back + ), + depthStencil = RenderPipelineDescriptor.DepthStencilState( + depthWriteEnabled = true, + depthCompare = "less", + format = TextureFormat.depth24plus + ), + multisample = RenderPipelineDescriptor.MultisampleState( + count = 1, + mask = 0xFFFFFFF + ) + ) + ).bind() + + val depthTexture = device.createTexture( + TextureDescriptor( + size = GPUExtent3DDictStrict(renderingContext.width, renderingContext.height), + format = TextureFormat.depth24plus, + usage = TextureUsage.renderattachment.value, + ) + ).bind() + + val uniformBufferSize = 4L * 16L; // 4x4 matrix + uniformBuffer = device.createBuffer( + BufferDescriptor( + size = uniformBufferSize, + usage = BufferUsage.uniform or BufferUsage.copydst + ) + ).bind() + + uniformBindGroup = device.createBindGroup( + BindGroupDescriptor( + layout = renderPipeline.getBindGroupLayout(0), + entries = arrayOf( + BindGroupDescriptor.BindGroupEntry( + binding = 0, + resource = BindGroupDescriptor.BufferBinding( + buffer = uniformBuffer + ) + ) + ) + ) + ) + + renderPassDescriptor = RenderPassDescriptor( + colorAttachments = arrayOf( + RenderPassDescriptor.ColorAttachment( + view = dummyTexture.createView().bind(), // Assigned later + loadOp = "clear", + clearValue = arrayOf(0.5, 0.5, 0.5, 1.0), + storeOp = "store", + ) + ), + depthStencilAttachment = RenderPassDescriptor.RenderPassDepthStencilAttachment( + view = depthTexture.createView(), + depthClearValue = 1.0f, + depthLoadOp = LoadOp.clear, + depthStoreOp = StoreOp.store + ) + ) + + + val aspect = renderingContext.width / renderingContext.height.toDouble() + val fox = Angle.fromRadians((2 * PI) / 5) + projectionMatrix = Matrix4.perspective(fox, aspect, 1.0, 100.0) + } + + override fun Application.render() = autoClosableContext { + + val transformationMatrix = getTransformationMatrix( + frame / 100.0, + projectionMatrix + ) + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix, + 0, + transformationMatrix.size.toLong() + ) + + renderPassDescriptor.colorAttachments[0].view = renderingContext + .getCurrentTexture() + .bind() + .createView() + + val encoder = device.createCommandEncoder() + .bind() + + val renderPassEncoder = encoder.beginRenderPass(renderPassDescriptor) + .bind() + renderPassEncoder.setPipeline(renderPipeline) + renderPassEncoder.setBindGroup(0, uniformBindGroup) + renderPassEncoder.setVertexBuffer(0, verticesBuffer) + renderPassEncoder.draw(cubeVertexCount) + renderPassEncoder.end() + + val commandBuffer = encoder.finish() + .bind() + + device.queue.submit(arrayOf(commandBuffer)) + + renderingContext.present() + + } + + override fun close() { + autoClosableContext.close() + } + +} + + +private fun getTransformationMatrix(angle: Double, projectionMatrix: Matrix4): FloatArray { + var viewMatrix = Matrix4.IDENTITY + viewMatrix = viewMatrix.translated(0, 0, -4) + + viewMatrix = viewMatrix.rotated( + Angle.fromRadians(Angle.fromRadians(angle).sine), + Angle.fromRadians(Angle.fromRadians(angle).cosine), + Angle.fromRadians(0) + ) + + return (projectionMatrix * viewMatrix).copyToColumns() +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/TexturedCube.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/TexturedCube.kt new file mode 100644 index 00000000..654df270 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/TexturedCube.kt @@ -0,0 +1,242 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu.examples.scenes.basic + +import io.ygdrasil.wgpu.* +import io.ygdrasil.wgpu.examples.Application +import io.ygdrasil.wgpu.examples.AutoClosableContext +import io.ygdrasil.wgpu.examples.autoClosableContext +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube +import io.ygdrasil.wgpu.examples.scenes.shader.fragmentSampleTextureMixColorShader +import io.ygdrasil.wgpu.examples.scenes.shader.vertex.basicVertexShader +import korlibs.math.geom.Angle +import korlibs.math.geom.Matrix4 +import kotlin.js.JsExport +import kotlin.math.PI + +@JsExport +class TexturedCubeScene : Application.Scene(), AutoCloseable { + + lateinit var renderPipeline: RenderPipeline + lateinit var projectionMatrix: Matrix4 + lateinit var renderPassDescriptor: RenderPassDescriptor + lateinit var uniformBuffer: Buffer + lateinit var uniformBindGroup: BindGroup + lateinit var verticesBuffer: Buffer + + val autoClosableContext = AutoClosableContext() + + override fun Application.initialiaze() = with(autoClosableContext) { + + // Create a vertex buffer from the cube data. + verticesBuffer = device.createBuffer( + BufferDescriptor( + size = (Cube.cubeVertexArray.size * Float.SIZE_BYTES).toLong(), + usage = BufferUsage.vertex.value, + mappedAtCreation = true + ) + ) + + // Util method to use getMappedRange + verticesBuffer.map(Cube.cubeVertexArray) + verticesBuffer.unmap() + + renderPipeline = device.createRenderPipeline( + RenderPipelineDescriptor( + vertex = RenderPipelineDescriptor.VertexState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = basicVertexShader + ) + ).bind(), // bind to autoClosableContext to release it later + buffers = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout( + arrayStride = Cube.cubeVertexSize, + attributes = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 0, + offset = Cube.cubePositionOffset, + format = VertexFormat.float32x4 + ), + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 1, + offset = Cube.cubeUVOffset, + format = VertexFormat.float32x2 + ) + ) + ) + ) + ), + fragment = RenderPipelineDescriptor.FragmentState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = fragmentSampleTextureMixColorShader + ) + ).bind(), // bind to autoClosableContext to release it later + targets = arrayOf( + RenderPipelineDescriptor.FragmentState.ColorTargetState( + format = renderingContext.textureFormat + ) + ) + ), + primitive = RenderPipelineDescriptor.PrimitiveState( + topology = PrimitiveTopology.trianglelist, + cullMode = CullMode.back + ), + depthStencil = RenderPipelineDescriptor.DepthStencilState( + depthWriteEnabled = true, + depthCompare = "less", + format = TextureFormat.depth24plus + ) + ) + ).bind() + + val depthTexture = device.createTexture( + TextureDescriptor( + size = GPUExtent3DDictStrict(renderingContext.width, renderingContext.height), + format = TextureFormat.depth24plus, + usage = TextureUsage.renderattachment.value, + ) + ).bind() + + val uniformBufferSize = 4L * 16L; // 4x4 matrix + uniformBuffer = device.createBuffer( + BufferDescriptor( + size = uniformBufferSize, + usage = BufferUsage.uniform or BufferUsage.copydst + ) + ).bind() + + + // Fetch the image and upload it into a GPUTexture. + val imageBitmapWidth = 512 + val imageBitmapHeight = 512 + val cubeTexture = device.createTexture( + TextureDescriptor( + size = GPUExtent3DDictStrict(imageBitmapWidth, imageBitmapHeight), + format = TextureFormat.rgba8unorm, + usage = TextureUsage.texturebinding or TextureUsage.copydst or TextureUsage.renderattachment, + ) + ) + + device.queue.copyExternalImageToTexture( + ImageCopyExternalImage(source = Di3d), + ImageCopyTextureTagged(texture = cubeTexture), + imageBitmapWidth to imageBitmapHeight + ) + + // Create a sampler with linear filtering for smooth interpolation. + val sampler = device.createSampler( + SamplerDescriptor( + magFilter = "linear", + minFilter = "linear", + ) + ) + + uniformBindGroup = device.createBindGroup( + BindGroupDescriptor( + layout = renderPipeline.getBindGroupLayout(0), + entries = arrayOf( + BindGroupDescriptor.BindGroupEntry( + binding = 0, + resource = BindGroupDescriptor.BufferBinding( + buffer = uniformBuffer + ) + ), + BindGroupDescriptor.BindGroupEntry( + binding = 1, + resource = BindGroupDescriptor.SamplerBinding( + sampler = sampler + ) + ), + BindGroupDescriptor.BindGroupEntry( + binding = 2, + resource = BindGroupDescriptor.TextureViewBinding( + view = cubeTexture.createView() + ) + ) + ) + ) + ) + + renderPassDescriptor = RenderPassDescriptor( + colorAttachments = arrayOf( + RenderPassDescriptor.ColorAttachment( + view = dummyTexture.createView().bind(), // Assigned later + loadOp = "clear", + clearValue = arrayOf(0.5, 0.5, 0.5, 1.0), + storeOp = "store", + ) + ), + depthStencilAttachment = RenderPassDescriptor.RenderPassDepthStencilAttachment( + view = depthTexture.createView(), + depthClearValue = 1.0f, + depthLoadOp = LoadOp.clear, + depthStoreOp = StoreOp.store + ) + ) + + + val aspect = renderingContext.width / renderingContext.height.toDouble() + val fox = Angle.fromRadians((2 * PI) / 5) + projectionMatrix = Matrix4.perspective(fox, aspect, 1.0, 100.0) + } + + override fun Application.render() = autoClosableContext { + + val transformationMatrix = getTransformationMatrix( + frame / 100.0, + projectionMatrix + ) + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix, + 0, + transformationMatrix.size.toLong() + ) + + renderPassDescriptor.colorAttachments[0].view = renderingContext + .getCurrentTexture() + .bind() + .createView() + + val encoder = device.createCommandEncoder() + .bind() + + val renderPassEncoder = encoder.beginRenderPass(renderPassDescriptor) + .bind() + renderPassEncoder.setPipeline(renderPipeline) + renderPassEncoder.setBindGroup(0, uniformBindGroup) + renderPassEncoder.setVertexBuffer(0, verticesBuffer) + renderPassEncoder.draw(Cube.cubeVertexCount) + renderPassEncoder.end() + + val commandBuffer = encoder.finish() + .bind() + + device.queue.submit(arrayOf(commandBuffer)) + + renderingContext.present() + + } + + override fun close() { + autoClosableContext.close() + } + +} + + +private fun getTransformationMatrix(angle: Double, projectionMatrix: Matrix4): FloatArray { + var viewMatrix = Matrix4.IDENTITY + viewMatrix = viewMatrix.translated(0, 0, -4) + + viewMatrix = viewMatrix.rotated( + Angle.fromRadians(Angle.fromRadians(angle).sine), + Angle.fromRadians(Angle.fromRadians(angle).cosine), + Angle.fromRadians(0) + ) + + return (projectionMatrix * viewMatrix).copyToColumns() +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/TwoCubes.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/TwoCubes.kt new file mode 100644 index 00000000..fb3f4a20 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/basic/TwoCubes.kt @@ -0,0 +1,247 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu.examples.scenes.basic + +import io.ygdrasil.wgpu.* +import io.ygdrasil.wgpu.examples.Application +import io.ygdrasil.wgpu.examples.AutoClosableContext +import io.ygdrasil.wgpu.examples.autoClosableContext +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubePositionOffset +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeUVOffset +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexArray +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexCount +import io.ygdrasil.wgpu.examples.scenes.mesh.Cube.cubeVertexSize +import io.ygdrasil.wgpu.examples.scenes.shader.fragmentVertexPositionColorShader +import io.ygdrasil.wgpu.examples.scenes.shader.vertex.basicVertexShader +import korlibs.math.geom.Angle +import korlibs.math.geom.Matrix4 +import kotlin.js.JsExport +import kotlin.math.PI + +@JsExport +class TwoCubesScene : Application.Scene(), AutoCloseable { + + val offset = 256L; // uniformBindGroup offset must be 256-byte aligned + + lateinit var renderPipeline: RenderPipeline + lateinit var projectionMatrix1: Matrix4 + lateinit var projectionMatrix2: Matrix4 + lateinit var renderPassDescriptor: RenderPassDescriptor + lateinit var uniformBuffer: Buffer + lateinit var uniformBindGroup1: BindGroup + lateinit var uniformBindGroup2: BindGroup + lateinit var verticesBuffer: Buffer + + val autoClosableContext = AutoClosableContext() + + override fun Application.initialiaze() = with(autoClosableContext) { + + // Create a vertex buffer from the cube data. + verticesBuffer = device.createBuffer( + BufferDescriptor( + size = (cubeVertexArray.size * Float.SIZE_BYTES).toLong(), + usage = BufferUsage.vertex.value, + mappedAtCreation = true + ) + ) + + // Util method to use getMappedRange + verticesBuffer.map(cubeVertexArray) + verticesBuffer.unmap() + + renderPipeline = device.createRenderPipeline( + RenderPipelineDescriptor( + vertex = RenderPipelineDescriptor.VertexState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = basicVertexShader + ) + ).bind(), // bind to autoClosableContext to release it later + buffers = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout( + arrayStride = cubeVertexSize, + attributes = arrayOf( + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 0, + offset = cubePositionOffset, + format = VertexFormat.float32x4 + ), + RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute( + shaderLocation = 1, + offset = cubeUVOffset, + format = VertexFormat.float32x2 + ) + ) + ) + ) + ), + fragment = RenderPipelineDescriptor.FragmentState( + module = device.createShaderModule( + ShaderModuleDescriptor( + code = fragmentVertexPositionColorShader + ) + ).bind(), // bind to autoClosableContext to release it later + targets = arrayOf( + RenderPipelineDescriptor.FragmentState.ColorTargetState( + format = renderingContext.textureFormat + ) + ) + ), + primitive = RenderPipelineDescriptor.PrimitiveState( + topology = PrimitiveTopology.trianglelist, + cullMode = CullMode.back + ), + depthStencil = RenderPipelineDescriptor.DepthStencilState( + depthWriteEnabled = true, + depthCompare = "less", + format = TextureFormat.depth24plus + ) + ) + ).bind() + + val depthTexture = device.createTexture( + TextureDescriptor( + size = GPUExtent3DDictStrict(renderingContext.width, renderingContext.height), + format = TextureFormat.depth24plus, + usage = TextureUsage.renderattachment.value, + ) + ).bind() + + val matrixSize = 4L * 16L; // 4x4 matrix + val uniformBufferSize = offset + matrixSize; + uniformBuffer = device.createBuffer( + BufferDescriptor( + size = uniformBufferSize, + usage = BufferUsage.uniform or BufferUsage.copydst + ) + ).bind() + + uniformBindGroup1 = device.createBindGroup( + BindGroupDescriptor( + layout = renderPipeline.getBindGroupLayout(0), + entries = arrayOf( + BindGroupDescriptor.BindGroupEntry( + binding = 0, + resource = BindGroupDescriptor.BufferBinding( + buffer = uniformBuffer + ) + ) + ) + ) + ) + + uniformBindGroup2 = device.createBindGroup( + BindGroupDescriptor( + layout = renderPipeline.getBindGroupLayout(0), + entries = arrayOf( + BindGroupDescriptor.BindGroupEntry( + binding = 0, + resource = BindGroupDescriptor.BufferBinding( + buffer = uniformBuffer, + offset = offset + ) + ) + ) + ) + ) + + renderPassDescriptor = RenderPassDescriptor( + colorAttachments = arrayOf( + RenderPassDescriptor.ColorAttachment( + view = dummyTexture.createView().bind(), // Assigned later + loadOp = "clear", + clearValue = arrayOf(0.5, 0.5, 0.5, 1.0), + storeOp = "store", + ) + ), + depthStencilAttachment = RenderPassDescriptor.RenderPassDepthStencilAttachment( + view = depthTexture.createView(), + depthClearValue = 1.0f, + depthLoadOp = LoadOp.clear, + depthStoreOp = StoreOp.store + ) + ) + + + val aspect = renderingContext.width / renderingContext.height.toDouble() + val fox = Angle.fromRadians((2 * PI) / 5) + projectionMatrix1 = Matrix4.perspective(fox, aspect, 1.0, 100.0) + .translated(-2.0, 0.0, -7.0) + projectionMatrix2 = Matrix4.perspective(fox, aspect, 1.0, 100.0) + .translated(2.0, 0.0, -7.0) + } + + override fun Application.render() = autoClosableContext { + + val transformationMatrix1 = getTransformationMatrix( + frame / 100.0, + projectionMatrix1 + ) + val transformationMatrix2 = getTransformationMatrix( + frame / 100.0, + projectionMatrix2 + ) + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix1, + 0, + transformationMatrix1.size.toLong() + ) + device.queue.writeBuffer( + uniformBuffer, + offset, + transformationMatrix2, + 0, + transformationMatrix2.size.toLong() + ) + + renderPassDescriptor.colorAttachments[0].view = renderingContext + .getCurrentTexture() + .bind() + .createView() + + val encoder = device.createCommandEncoder() + .bind() + + val renderPassEncoder = encoder.beginRenderPass(renderPassDescriptor) + .bind() + renderPassEncoder.setPipeline(renderPipeline) + renderPassEncoder.setBindGroup(0, uniformBindGroup1) + renderPassEncoder.setVertexBuffer(0, verticesBuffer) + + // Bind the bind group (with the transformation matrix) for + // each cube, and draw. + renderPassEncoder.setBindGroup(0, uniformBindGroup1); + renderPassEncoder.draw(cubeVertexCount); + + renderPassEncoder.setBindGroup(0, uniformBindGroup2); + renderPassEncoder.draw(cubeVertexCount); + + renderPassEncoder.end() + val commandBuffer = encoder.finish() + .bind() + + device.queue.submit(arrayOf(commandBuffer)) + + renderingContext.present() + + } + + override fun close() { + autoClosableContext.close() + } + +} + +private fun getTransformationMatrix(angle: Double, projectionMatrix: Matrix4): FloatArray { + var viewMatrix = Matrix4.IDENTITY + + viewMatrix = viewMatrix.rotated( + Angle.fromRadians(Angle.fromRadians(angle).sine), + Angle.fromRadians(Angle.fromRadians(angle).cosine), + Angle.fromRadians(0) + ) + + return (projectionMatrix * viewMatrix).copyToColumns() +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/mesh/Cube.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/mesh/Cube.kt new file mode 100644 index 00000000..0d65dac8 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/mesh/Cube.kt @@ -0,0 +1,56 @@ +package io.ygdrasil.wgpu.examples.scenes.mesh + +object Cube { + + val cubeVertexSize = 4L * 10L // Byte size of one cube vertex. + val cubePositionOffset = 0L + val cubeColorOffset = 4 * 4 // Byte offset of cube vertex color attribute. + val cubeUVOffset = 4L * 8L + val cubeVertexCount = 36 + + val cubeVertexArray = arrayOf( + // float4 position, float4 color, float2 uv, + 1, -1, 1, 1, 1, 0, 1, 1, 0, 1, + -1, -1, 1, 1, 0, 0, 1, 1, 1, 1, + -1, -1, -1, 1, 0, 0, 0, 1, 1, 0, + 1, -1, -1, 1, 1, 0, 0, 1, 0, 0, + 1, -1, 1, 1, 1, 0, 1, 1, 0, 1, + -1, -1, -1, 1, 0, 0, 0, 1, 1, 0, + + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, + 1, -1, -1, 1, 1, 0, 0, 1, 1, 0, + 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, -1, -1, 1, 1, 0, 0, 1, 1, 0, + + -1, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, -1, 1, 1, 1, 0, 1, 1, 0, + -1, 1, -1, 1, 0, 1, 0, 1, 0, 0, + -1, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 1, -1, 1, 1, 1, 0, 1, 1, 0, + + -1, -1, 1, 1, 0, 0, 1, 1, 0, 1, + -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, + -1, -1, -1, 1, 0, 0, 0, 1, 0, 0, + -1, -1, 1, 1, 0, 0, 1, 1, 0, 1, + -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, + + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, + -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + -1, -1, 1, 1, 0, 0, 1, 1, 1, 0, + -1, -1, 1, 1, 0, 0, 1, 1, 1, 0, + 1, -1, 1, 1, 1, 0, 1, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, + + 1, -1, -1, 1, 1, 0, 0, 1, 0, 1, + -1, -1, -1, 1, 0, 0, 0, 1, 1, 1, + -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, + 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, + 1, -1, -1, 1, 1, 0, 0, 1, 0, 1, + -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, + ).let { FloatArray(it.size) { index -> it[index].toFloat() } } + +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/FragmentSampleTextureMixcolorShader.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/FragmentSampleTextureMixcolorShader.kt new file mode 100644 index 00000000..cbcb0d90 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/FragmentSampleTextureMixcolorShader.kt @@ -0,0 +1,14 @@ +package io.ygdrasil.wgpu.examples.scenes.shader + +const val fragmentSampleTextureMixColorShader = """ +@group(0) @binding(1) var mySampler: sampler; +@group(0) @binding(2) var myTexture: texture_2d; + +@fragment +fn main( + @location(0) fragUV: vec2f, + @location(1) fragPosition: vec4f +) -> @location(0) vec4f { + return textureSample(myTexture, mySampler, fragUV) * fragPosition; +} +""" \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/FragmentVertexPositionColorShader.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/FragmentVertexPositionColorShader.kt new file mode 100644 index 00000000..d2209a33 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/FragmentVertexPositionColorShader.kt @@ -0,0 +1,11 @@ +package io.ygdrasil.wgpu.examples.scenes.shader + +const val fragmentVertexPositionColorShader = """ +@fragment +fn main( + @location(0) fragUV: vec2, + @location(1) fragPosition: vec4 +) -> @location(0) vec4 { + return fragPosition; +} +""" \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/fragment/SampleCubemap.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/fragment/SampleCubemap.kt new file mode 100644 index 00000000..7bfdbade --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/fragment/SampleCubemap.kt @@ -0,0 +1,18 @@ +package io.ygdrasil.wgpu.examples.scenes.shader.fragment + +const val sampleCubemapShader = """ +@group(0) @binding(1) var mySampler: sampler; +@group(0) @binding(2) var myTexture: texture_cube; + +@fragment +fn main( + @location(0) fragUV: vec2f, + @location(1) fragPosition: vec4f +) -> @location(0) vec4f { + // Our camera and the skybox cube are both centered at (0, 0, 0) + // so we can use the cube geomtry position to get viewing vector to sample the cube texture. + // The magnitude of the vector doesn't matter. + var cubemapVec = fragPosition.xyz - vec3(0.5); + return textureSample(myTexture, mySampler, cubemapVec); +} +""" \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/fragment/SampleSelfShader.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/fragment/SampleSelfShader.kt new file mode 100644 index 00000000..25e8ebcc --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/fragment/SampleSelfShader.kt @@ -0,0 +1,16 @@ +package io.ygdrasil.wgpu.examples.scenes.shader.fragment + +const val sampleSelfShader = """ +@binding(1) @group(0) var mySampler: sampler; +@binding(2) @group(0) var myTexture: texture_2d; + +@fragment +fn main( + @location(0) fragUV: vec2f, + @location(1) fragPosition: vec4f +) -> @location(0) vec4f { + let texColor = textureSample(myTexture, mySampler, fragUV * 0.8 + vec2(0.1)); + let f = select(1.0, 0.0, length(texColor.rgb - vec3(0.5)) < 0.01); + return f * texColor + (1.0 - f) * fragPosition; +} +""" \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/vertex/BasicVertexShader.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/vertex/BasicVertexShader.kt new file mode 100644 index 00000000..3e2e9c15 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/vertex/BasicVertexShader.kt @@ -0,0 +1,27 @@ +package io.ygdrasil.wgpu.examples.scenes.shader.vertex + +const val basicVertexShader = """ +struct Uniforms { + modelViewProjectionMatrix : mat4x4, +} +@binding(0) @group(0) var uniforms : Uniforms; + +struct VertexOutput { + @builtin(position) Position : vec4, + @location(0) fragUV : vec2, + @location(1) fragPosition: vec4, +} + +@vertex +fn main( + @location(0) position : vec4, + @location(1) uv : vec2 +) -> VertexOutput { + var output : VertexOutput; + output.Position = uniforms.modelViewProjectionMatrix * position; + output.fragUV = uv; + output.fragPosition = 0.5 * (position + vec4(1.0, 1.0, 1.0, 1.0)); + return output; +} + +""" \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/vertex/InstancedShader.kt b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/vertex/InstancedShader.kt new file mode 100644 index 00000000..88b78c56 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/kotlin/io.ygdrasil.wgpu.examples/scenes/shader/vertex/InstancedShader.kt @@ -0,0 +1,28 @@ +package io.ygdrasil.wgpu.examples.scenes.shader.vertex + +val instancedShader = """ + struct Uniforms { + modelViewProjectionMatrix : array, + } + + @binding(0) @group(0) var uniforms : Uniforms; + + struct VertexOutput { + @builtin(position) Position : vec4f, + @location(0) fragUV : vec2f, + @location(1) fragPosition: vec4f, + } + + @vertex + fn main( + @builtin(instance_index) instanceIdx : u32, + @location(0) position : vec4f, + @location(1) uv : vec2f + ) -> VertexOutput { + var output : VertexOutput; + output.Position = uniforms.modelViewProjectionMatrix[instanceIdx] * position; + output.fragUV = uv; + output.fragPosition = 0.5 * (position + vec4(1.0)); + return output; + } +""".trimIndent() \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/font/ya-hei-ascii-msdf.json b/bindings/wgpu/examples/common/src/commonMain/resources/assets/font/ya-hei-ascii-msdf.json new file mode 100644 index 00000000..19ec37ac --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/resources/assets/font/ya-hei-ascii-msdf.json @@ -0,0 +1,3407 @@ +{ + "pages": [ + "ya-hei-ascii.png" + ], + "chars": [ + { + "id": 124, + "index": 98, + "char": "|", + "width": 8, + "height": 49, + "xoffset": 2, + "yoffset": 1, + "xadvance": 11, + "chnl": 15, + "x": 0, + "y": 0, + "page": 0 + }, + { + "id": 106, + "index": 80, + "char": "j", + "width": 16, + "height": 48, + "xoffset": -6, + "yoffset": 3, + "xadvance": 11, + "chnl": 15, + "x": 0, + "y": 50, + "page": 0 + }, + { + "id": 87, + "index": 61, + "char": "W", + "width": 46, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 43, + "chnl": 15, + "x": 9, + "y": 0, + "page": 0 + }, + { + "id": 81, + "index": 55, + "char": "Q", + "width": 35, + "height": 45, + "xoffset": 0, + "yoffset": 4, + "xadvance": 34, + "chnl": 15, + "x": 0, + "y": 99, + "page": 0 + }, + { + "id": 36, + "index": 10, + "char": "$", + "width": 22, + "height": 44, + "xoffset": 1, + "yoffset": 0, + "xadvance": 25, + "chnl": 15, + "x": 17, + "y": 37, + "page": 0 + }, + { + "id": 40, + "index": 14, + "char": "(", + "width": 14, + "height": 43, + "xoffset": 1, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 145, + "page": 0 + }, + { + "id": 41, + "index": 15, + "char": ")", + "width": 15, + "height": 43, + "xoffset": -2, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 189, + "page": 0 + }, + { + "id": 91, + "index": 65, + "char": "[", + "width": 12, + "height": 43, + "xoffset": 2, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 15, + "y": 145, + "page": 0 + }, + { + "id": 93, + "index": 67, + "char": "]", + "width": 12, + "height": 43, + "xoffset": -1, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 233, + "page": 0 + }, + { + "id": 123, + "index": 97, + "char": "{", + "width": 15, + "height": 43, + "xoffset": 0, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 277, + "page": 0 + }, + { + "id": 125, + "index": 99, + "char": "}", + "width": 15, + "height": 43, + "xoffset": -1, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 13, + "y": 233, + "page": 0 + }, + { + "id": 47, + "index": 21, + "char": "/", + "width": 23, + "height": 41, + "xoffset": -3, + "yoffset": 4, + "xadvance": 18, + "chnl": 15, + "x": 16, + "y": 189, + "page": 0 + }, + { + "id": 92, + "index": 66, + "char": "\\", + "width": 23, + "height": 41, + "xoffset": -3, + "yoffset": 4, + "xadvance": 17, + "chnl": 15, + "x": 28, + "y": 145, + "page": 0 + }, + { + "id": 12385, + "index": 28668, + "char": "ち", + "width": 33, + "height": 41, + "xoffset": 3, + "yoffset": 2, + "xadvance": 42, + "chnl": 15, + "x": 36, + "y": 82, + "page": 0 + }, + { + "id": 64, + "index": 38, + "char": "@", + "width": 40, + "height": 40, + "xoffset": 2, + "yoffset": 4, + "xadvance": 43, + "chnl": 15, + "x": 40, + "y": 37, + "page": 0 + }, + { + "id": 12435, + "index": 28718, + "char": "ん", + "width": 39, + "height": 38, + "xoffset": 1, + "yoffset": 3, + "xadvance": 42, + "chnl": 15, + "x": 0, + "y": 321, + "page": 0 + }, + { + "id": 37, + "index": 11, + "char": "%", + "width": 38, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 37, + "chnl": 15, + "x": 16, + "y": 277, + "page": 0 + }, + { + "id": 98, + "index": 72, + "char": "b", + "width": 25, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 27, + "chnl": 15, + "x": 29, + "y": 231, + "page": 0 + }, + { + "id": 100, + "index": 74, + "char": "d", + "width": 25, + "height": 38, + "xoffset": 0, + "yoffset": 2, + "xadvance": 27, + "chnl": 15, + "x": 40, + "y": 187, + "page": 0 + }, + { + "id": 102, + "index": 76, + "char": "f", + "width": 18, + "height": 38, + "xoffset": -1, + "yoffset": 2, + "xadvance": 15, + "chnl": 15, + "x": 52, + "y": 124, + "page": 0 + }, + { + "id": 103, + "index": 77, + "char": "g", + "width": 25, + "height": 38, + "xoffset": 0, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 70, + "y": 78, + "page": 0 + }, + { + "id": 104, + "index": 78, + "char": "h", + "width": 23, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 26, + "chnl": 15, + "x": 81, + "y": 0, + "page": 0 + }, + { + "id": 107, + "index": 81, + "char": "k", + "width": 23, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 23, + "chnl": 15, + "x": 81, + "y": 39, + "page": 0 + }, + { + "id": 108, + "index": 82, + "char": "l", + "width": 8, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 11, + "chnl": 15, + "x": 0, + "y": 360, + "page": 0 + }, + { + "id": 112, + "index": 86, + "char": "p", + "width": 25, + "height": 38, + "xoffset": 2, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 0, + "y": 399, + "page": 0 + }, + { + "id": 113, + "index": 87, + "char": "q", + "width": 25, + "height": 38, + "xoffset": 0, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 9, + "y": 360, + "page": 0 + }, + { + "id": 12399, + "index": 28682, + "char": "は", + "width": 38, + "height": 38, + "xoffset": 3, + "yoffset": 4, + "xadvance": 42, + "chnl": 15, + "x": 0, + "y": 438, + "page": 0 + }, + { + "id": 38, + "index": 12, + "char": "&", + "width": 37, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 37, + "chnl": 15, + "x": 26, + "y": 399, + "page": 0 + }, + { + "id": 48, + "index": 22, + "char": "0", + "width": 25, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 35, + "y": 360, + "page": 0 + }, + { + "id": 51, + "index": 25, + "char": "3", + "width": 23, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 40, + "y": 315, + "page": 0 + }, + { + "id": 54, + "index": 28, + "char": "6", + "width": 24, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 61, + "y": 353, + "page": 0 + }, + { + "id": 56, + "index": 30, + "char": "8", + "width": 24, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 39, + "y": 437, + "page": 0 + }, + { + "id": 57, + "index": 31, + "char": "9", + "width": 24, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 39, + "y": 475, + "page": 0 + }, + { + "id": 63, + "index": 37, + "char": "?", + "width": 19, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 20, + "chnl": 15, + "x": 55, + "y": 226, + "page": 0 + }, + { + "id": 67, + "index": 41, + "char": "C", + "width": 28, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 28, + "chnl": 15, + "x": 55, + "y": 264, + "page": 0 + }, + { + "id": 71, + "index": 45, + "char": "G", + "width": 30, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 31, + "chnl": 15, + "x": 64, + "y": 302, + "page": 0 + }, + { + "id": 77, + "index": 51, + "char": "M", + "width": 37, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 41, + "chnl": 15, + "x": 66, + "y": 163, + "page": 0 + }, + { + "id": 79, + "index": 53, + "char": "O", + "width": 34, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 34, + "chnl": 15, + "x": 71, + "y": 117, + "page": 0 + }, + { + "id": 83, + "index": 57, + "char": "S", + "width": 24, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 24, + "chnl": 15, + "x": 96, + "y": 78, + "page": 0 + }, + { + "id": 105, + "index": 79, + "char": "i", + "width": 9, + "height": 37, + "xoffset": 1, + "yoffset": 3, + "xadvance": 11, + "chnl": 15, + "x": 75, + "y": 200, + "page": 0 + }, + { + "id": 109, + "index": 83, + "char": "m", + "width": 37, + "height": 27, + "xoffset": 2, + "yoffset": 13, + "xadvance": 39, + "chnl": 15, + "x": 0, + "y": 477, + "page": 0 + }, + { + "id": 121, + "index": 95, + "char": "y", + "width": 26, + "height": 37, + "xoffset": -2, + "yoffset": 13, + "xadvance": 22, + "chnl": 15, + "x": 84, + "y": 238, + "page": 0 + }, + { + "id": 12395, + "index": 28678, + "char": "に", + "width": 37, + "height": 37, + "xoffset": 3, + "yoffset": 4, + "xadvance": 42, + "chnl": 15, + "x": 85, + "y": 200, + "page": 0 + }, + { + "id": 33, + "index": 7, + "char": "!", + "width": 9, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 13, + "chnl": 15, + "x": 56, + "y": 0, + "page": 0 + }, + { + "id": 49, + "index": 23, + "char": "1", + "width": 22, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 104, + "y": 155, + "page": 0 + }, + { + "id": 50, + "index": 24, + "char": "2", + "width": 24, + "height": 36, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 106, + "y": 116, + "page": 0 + }, + { + "id": 52, + "index": 26, + "char": "4", + "width": 27, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 105, + "y": 0, + "page": 0 + }, + { + "id": 53, + "index": 27, + "char": "5", + "width": 22, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 105, + "y": 37, + "page": 0 + }, + { + "id": 55, + "index": 29, + "char": "7", + "width": 25, + "height": 36, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 121, + "y": 74, + "page": 0 + }, + { + "id": 65, + "index": 39, + "char": "A", + "width": 33, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 30, + "chnl": 15, + "x": 128, + "y": 37, + "page": 0 + }, + { + "id": 66, + "index": 40, + "char": "B", + "width": 24, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 26, + "chnl": 15, + "x": 133, + "y": 0, + "page": 0 + }, + { + "id": 68, + "index": 42, + "char": "D", + "width": 30, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 32, + "chnl": 15, + "x": 158, + "y": 0, + "page": 0 + }, + { + "id": 69, + "index": 43, + "char": "E", + "width": 21, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 23, + "chnl": 15, + "x": 64, + "y": 391, + "page": 0 + }, + { + "id": 70, + "index": 44, + "char": "F", + "width": 20, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 22, + "chnl": 15, + "x": 64, + "y": 428, + "page": 0 + }, + { + "id": 72, + "index": 46, + "char": "H", + "width": 28, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 32, + "chnl": 15, + "x": 64, + "y": 465, + "page": 0 + }, + { + "id": 73, + "index": 47, + "char": "I", + "width": 14, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 12, + "chnl": 15, + "x": 66, + "y": 0, + "page": 0 + }, + { + "id": 74, + "index": 48, + "char": "J", + "width": 16, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 17, + "chnl": 15, + "x": 85, + "y": 428, + "page": 0 + }, + { + "id": 75, + "index": 49, + "char": "K", + "width": 27, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 93, + "y": 465, + "page": 0 + }, + { + "id": 76, + "index": 50, + "char": "L", + "width": 21, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 22, + "chnl": 15, + "x": 86, + "y": 340, + "page": 0 + }, + { + "id": 78, + "index": 52, + "char": "N", + "width": 30, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 34, + "chnl": 15, + "x": 86, + "y": 377, + "page": 0 + }, + { + "id": 80, + "index": 54, + "char": "P", + "width": 24, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 26, + "chnl": 15, + "x": 102, + "y": 414, + "page": 0 + }, + { + "id": 82, + "index": 56, + "char": "R", + "width": 27, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 121, + "y": 451, + "page": 0 + }, + { + "id": 84, + "index": 58, + "char": "T", + "width": 26, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 24, + "chnl": 15, + "x": 95, + "y": 276, + "page": 0 + }, + { + "id": 85, + "index": 59, + "char": "U", + "width": 28, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 31, + "chnl": 15, + "x": 111, + "y": 238, + "page": 0 + }, + { + "id": 86, + "index": 60, + "char": "V", + "width": 32, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 28, + "chnl": 15, + "x": 123, + "y": 192, + "page": 0 + }, + { + "id": 88, + "index": 62, + "char": "X", + "width": 30, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 127, + "y": 153, + "page": 0 + }, + { + "id": 89, + "index": 63, + "char": "Y", + "width": 29, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 131, + "y": 111, + "page": 0 + }, + { + "id": 90, + "index": 64, + "char": "Z", + "width": 28, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 26, + "chnl": 15, + "x": 147, + "y": 74, + "page": 0 + }, + { + "id": 119, + "index": 93, + "char": "w", + "width": 36, + "height": 27, + "xoffset": -1, + "yoffset": 13, + "xadvance": 33, + "chnl": 15, + "x": 162, + "y": 37, + "page": 0 + }, + { + "id": 116, + "index": 90, + "char": "t", + "width": 18, + "height": 34, + "xoffset": -1, + "yoffset": 7, + "xadvance": 16, + "chnl": 15, + "x": 189, + "y": 0, + "page": 0 + }, + { + "id": 35, + "index": 9, + "char": "#", + "width": 29, + "height": 33, + "xoffset": -1, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 108, + "y": 313, + "page": 0 + }, + { + "id": 59, + "index": 33, + "char": ";", + "width": 11, + "height": 33, + "xoffset": -1, + "yoffset": 13, + "xadvance": 10, + "chnl": 15, + "x": 122, + "y": 275, + "page": 0 + }, + { + "id": 12371, + "index": 28654, + "char": "こ", + "width": 32, + "height": 31, + "xoffset": 5, + "yoffset": 8, + "xadvance": 42, + "chnl": 15, + "x": 134, + "y": 275, + "page": 0 + }, + { + "id": 58, + "index": 32, + "char": ":", + "width": 9, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 10, + "chnl": 15, + "x": 108, + "y": 347, + "page": 0 + }, + { + "id": 97, + "index": 71, + "char": "a", + "width": 22, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 23, + "chnl": 15, + "x": 117, + "y": 376, + "page": 0 + }, + { + "id": 99, + "index": 73, + "char": "c", + "width": 21, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 21, + "chnl": 15, + "x": 118, + "y": 347, + "page": 0 + }, + { + "id": 101, + "index": 75, + "char": "e", + "width": 24, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 24, + "chnl": 15, + "x": 138, + "y": 307, + "page": 0 + }, + { + "id": 111, + "index": 85, + "char": "o", + "width": 27, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 140, + "y": 229, + "page": 0 + }, + { + "id": 115, + "index": 89, + "char": "s", + "width": 19, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 19, + "chnl": 15, + "x": 156, + "y": 190, + "page": 0 + }, + { + "id": 110, + "index": 84, + "char": "n", + "width": 23, + "height": 27, + "xoffset": 2, + "yoffset": 13, + "xadvance": 26, + "chnl": 15, + "x": 158, + "y": 148, + "page": 0 + }, + { + "id": 114, + "index": 88, + "char": "r", + "width": 16, + "height": 27, + "xoffset": 2, + "yoffset": 13, + "xadvance": 16, + "chnl": 15, + "x": 161, + "y": 111, + "page": 0 + }, + { + "id": 117, + "index": 91, + "char": "u", + "width": 23, + "height": 27, + "xoffset": 1, + "yoffset": 13, + "xadvance": 26, + "chnl": 15, + "x": 127, + "y": 405, + "page": 0 + }, + { + "id": 118, + "index": 92, + "char": "v", + "width": 26, + "height": 27, + "xoffset": -2, + "yoffset": 13, + "xadvance": 22, + "chnl": 15, + "x": 176, + "y": 65, + "page": 0 + }, + { + "id": 120, + "index": 94, + "char": "x", + "width": 24, + "height": 27, + "xoffset": -1, + "yoffset": 13, + "xadvance": 21, + "chnl": 15, + "x": 199, + "y": 35, + "page": 0 + }, + { + "id": 122, + "index": 96, + "char": "z", + "width": 23, + "height": 27, + "xoffset": -1, + "yoffset": 13, + "xadvance": 21, + "chnl": 15, + "x": 208, + "y": 0, + "page": 0 + }, + { + "id": 60, + "index": 34, + "char": "<", + "width": 23, + "height": 26, + "xoffset": 4, + "yoffset": 12, + "xadvance": 31, + "chnl": 15, + "x": 178, + "y": 93, + "page": 0 + }, + { + "id": 62, + "index": 36, + "char": ">", + "width": 23, + "height": 26, + "xoffset": 4, + "yoffset": 12, + "xadvance": 31, + "chnl": 15, + "x": 178, + "y": 120, + "page": 0 + }, + { + "id": 126, + "index": 100, + "char": "~", + "width": 26, + "height": 11, + "xoffset": 3, + "yoffset": 19, + "xadvance": 31, + "chnl": 15, + "x": 158, + "y": 176, + "page": 0 + }, + { + "id": 43, + "index": 17, + "char": "+", + "width": 25, + "height": 25, + "xoffset": 3, + "yoffset": 12, + "xadvance": 31, + "chnl": 15, + "x": 182, + "y": 147, + "page": 0 + }, + { + "id": 61, + "index": 35, + "char": "=", + "width": 25, + "height": 17, + "xoffset": 3, + "yoffset": 17, + "xadvance": 31, + "chnl": 15, + "x": 127, + "y": 433, + "page": 0 + }, + { + "id": 94, + "index": 68, + "char": "^", + "width": 25, + "height": 23, + "xoffset": 3, + "yoffset": 4, + "xadvance": 31, + "chnl": 15, + "x": 121, + "y": 488, + "page": 0 + }, + { + "id": 95, + "index": 69, + "char": "_", + "width": 23, + "height": 7, + "xoffset": -2, + "yoffset": 40, + "xadvance": 19, + "chnl": 15, + "x": 0, + "y": 505, + "page": 0 + }, + { + "id": 42, + "index": 16, + "char": "*", + "width": 20, + "height": 20, + "xoffset": 0, + "yoffset": 4, + "xadvance": 19, + "chnl": 15, + "x": 147, + "y": 488, + "page": 0 + }, + { + "id": 45, + "index": 19, + "char": "-", + "width": 16, + "height": 7, + "xoffset": 1, + "yoffset": 22, + "xadvance": 18, + "chnl": 15, + "x": 71, + "y": 155, + "page": 0 + }, + { + "id": 44, + "index": 18, + "char": ",", + "width": 10, + "height": 15, + "xoffset": -1, + "yoffset": 31, + "xadvance": 10, + "chnl": 15, + "x": 84, + "y": 276, + "page": 0 + }, + { + "id": 34, + "index": 8, + "char": "\"", + "width": 14, + "height": 14, + "xoffset": 2, + "yoffset": 4, + "xadvance": 18, + "chnl": 15, + "x": 36, + "y": 124, + "page": 0 + }, + { + "id": 39, + "index": 13, + "char": "'", + "width": 8, + "height": 14, + "xoffset": 1, + "yoffset": 4, + "xadvance": 11, + "chnl": 15, + "x": 66, + "y": 200, + "page": 0 + }, + { + "id": 96, + "index": 70, + "char": "`", + "width": 13, + "height": 11, + "xoffset": 0, + "yoffset": 2, + "xadvance": 12, + "chnl": 15, + "x": 52, + "y": 163, + "page": 0 + }, + { + "id": 46, + "index": 20, + "char": ".", + "width": 9, + "height": 9, + "xoffset": 0, + "yoffset": 31, + "xadvance": 10, + "chnl": 15, + "x": 156, + "y": 219, + "page": 0 + }, + { + "id": 32, + "index": 3, + "char": " ", + "width": 0, + "height": 0, + "xoffset": -2, + "yoffset": 36, + "xadvance": 12, + "chnl": 15, + "x": 26, + "y": 437, + "page": 0 + } + ], + "info": { + "face": "ya-hei-ascii", + "size": 42, + "bold": 0, + "italic": 0, + "charset": [ + " ", + "!", + "\"", + "#", + "$", + "%", + "&", + "'", + "(", + ")", + "*", + "+", + ",", + "-", + ".", + "/", + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + ":", + ";", + "<", + "=", + ">", + "?", + "@", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "[", + "\\", + "]", + "^", + "_", + "`", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "{", + "|", + "}", + "~", + "こ", + "ん", + "に", + "ち", + "は" + ], + "unicode": 1, + "stretchH": 100, + "smooth": 1, + "aa": 1, + "padding": [ + 2, + 2, + 2, + 2 + ], + "spacing": [ + 0, + 0 + ] + }, + "common": { + "lineHeight": 45, + "base": 36, + "scaleW": 512, + "scaleH": 512, + "pages": 1, + "packed": 0, + "alphaChnl": 0, + "redChnl": 0, + "greenChnl": 0, + "blueChnl": 0 + }, + "distanceField": { + "fieldType": "msdf", + "distanceRange": 4 + }, + "kernings": [ + { + "first": 34, + "second": 114, + "amount": -1 + }, + { + "first": 34, + "second": 115, + "amount": -1 + }, + { + "first": 39, + "second": 114, + "amount": -1 + }, + { + "first": 39, + "second": 115, + "amount": -1 + }, + { + "first": 40, + "second": 106, + "amount": 5 + }, + { + "first": 42, + "second": 65, + "amount": -4 + }, + { + "first": 42, + "second": 74, + "amount": -3 + }, + { + "first": 42, + "second": 99, + "amount": -2 + }, + { + "first": 42, + "second": 100, + "amount": -2 + }, + { + "first": 42, + "second": 101, + "amount": -2 + }, + { + "first": 42, + "second": 103, + "amount": -2 + }, + { + "first": 42, + "second": 111, + "amount": -2 + }, + { + "first": 42, + "second": 113, + "amount": -2 + }, + { + "first": 65, + "second": 42, + "amount": -3 + }, + { + "first": 65, + "second": 44, + "amount": 1 + }, + { + "first": 65, + "second": 59, + "amount": 1 + }, + { + "first": 65, + "second": 67, + "amount": -1 + }, + { + "first": 65, + "second": 71, + "amount": -1 + }, + { + "first": 65, + "second": 74, + "amount": 2 + }, + { + "first": 65, + "second": 79, + "amount": -1 + }, + { + "first": 65, + "second": 84, + "amount": -3 + }, + { + "first": 65, + "second": 85, + "amount": -1 + }, + { + "first": 65, + "second": 86, + "amount": -3 + }, + { + "first": 65, + "second": 87, + "amount": -2 + }, + { + "first": 65, + "second": 89, + "amount": -3 + }, + { + "first": 65, + "second": 90, + "amount": 1 + }, + { + "first": 65, + "second": 116, + "amount": -1 + }, + { + "first": 65, + "second": 118, + "amount": -1 + }, + { + "first": 65, + "second": 119, + "amount": -1 + }, + { + "first": 65, + "second": 121, + "amount": -1 + }, + { + "first": 66, + "second": 84, + "amount": -2 + }, + { + "first": 66, + "second": 89, + "amount": -1 + }, + { + "first": 67, + "second": 63, + "amount": 0 + }, + { + "first": 67, + "second": 67, + "amount": -1 + }, + { + "first": 67, + "second": 71, + "amount": -1 + }, + { + "first": 67, + "second": 79, + "amount": -1 + }, + { + "first": 67, + "second": 81, + "amount": -1 + }, + { + "first": 68, + "second": 44, + "amount": -3 + }, + { + "first": 68, + "second": 46, + "amount": -3 + }, + { + "first": 68, + "second": 65, + "amount": -1 + }, + { + "first": 68, + "second": 84, + "amount": -2 + }, + { + "first": 68, + "second": 88, + "amount": -1 + }, + { + "first": 68, + "second": 90, + "amount": -1 + }, + { + "first": 69, + "second": 65, + "amount": 0 + }, + { + "first": 69, + "second": 74, + "amount": 1 + }, + { + "first": 69, + "second": 84, + "amount": 0 + }, + { + "first": 69, + "second": 87, + "amount": 1 + }, + { + "first": 69, + "second": 88, + "amount": 0 + }, + { + "first": 70, + "second": 44, + "amount": -3 + }, + { + "first": 70, + "second": 46, + "amount": -3 + }, + { + "first": 70, + "second": 65, + "amount": -3 + }, + { + "first": 70, + "second": 74, + "amount": -1 + }, + { + "first": 70, + "second": 83, + "amount": -1 + }, + { + "first": 70, + "second": 84, + "amount": 0 + }, + { + "first": 70, + "second": 97, + "amount": -2 + }, + { + "first": 70, + "second": 102, + "amount": 0 + }, + { + "first": 71, + "second": 84, + "amount": -1 + }, + { + "first": 71, + "second": 86, + "amount": -1 + }, + { + "first": 71, + "second": 121, + "amount": -1 + }, + { + "first": 74, + "second": 44, + "amount": -2 + }, + { + "first": 74, + "second": 46, + "amount": -2 + }, + { + "first": 74, + "second": 65, + "amount": -1 + }, + { + "first": 74, + "second": 74, + "amount": -1 + }, + { + "first": 74, + "second": 97, + "amount": -1 + }, + { + "first": 75, + "second": 44, + "amount": 1 + }, + { + "first": 75, + "second": 59, + "amount": 1 + }, + { + "first": 75, + "second": 67, + "amount": -2 + }, + { + "first": 75, + "second": 71, + "amount": -2 + }, + { + "first": 75, + "second": 74, + "amount": 2 + }, + { + "first": 75, + "second": 79, + "amount": -2 + }, + { + "first": 75, + "second": 81, + "amount": -2 + }, + { + "first": 75, + "second": 88, + "amount": 1 + }, + { + "first": 75, + "second": 90, + "amount": 1 + }, + { + "first": 75, + "second": 99, + "amount": -1 + }, + { + "first": 75, + "second": 100, + "amount": -1 + }, + { + "first": 75, + "second": 101, + "amount": -1 + }, + { + "first": 75, + "second": 103, + "amount": -1 + }, + { + "first": 75, + "second": 111, + "amount": -1 + }, + { + "first": 75, + "second": 113, + "amount": -1 + }, + { + "first": 75, + "second": 116, + "amount": -1 + }, + { + "first": 75, + "second": 118, + "amount": -2 + }, + { + "first": 75, + "second": 119, + "amount": -1 + }, + { + "first": 75, + "second": 121, + "amount": -2 + }, + { + "first": 76, + "second": 42, + "amount": -5 + }, + { + "first": 76, + "second": 63, + "amount": -2 + }, + { + "first": 76, + "second": 65, + "amount": 1 + }, + { + "first": 76, + "second": 67, + "amount": -1 + }, + { + "first": 76, + "second": 71, + "amount": -1 + }, + { + "first": 76, + "second": 74, + "amount": 2 + }, + { + "first": 76, + "second": 79, + "amount": -2 + }, + { + "first": 76, + "second": 81, + "amount": -2 + }, + { + "first": 76, + "second": 84, + "amount": -3 + }, + { + "first": 76, + "second": 85, + "amount": -1 + }, + { + "first": 76, + "second": 86, + "amount": -3 + }, + { + "first": 76, + "second": 87, + "amount": -1 + }, + { + "first": 76, + "second": 89, + "amount": -3 + }, + { + "first": 76, + "second": 90, + "amount": 1 + }, + { + "first": 76, + "second": 116, + "amount": -1 + }, + { + "first": 76, + "second": 118, + "amount": -2 + }, + { + "first": 76, + "second": 119, + "amount": -1 + }, + { + "first": 76, + "second": 121, + "amount": -2 + }, + { + "first": 79, + "second": 44, + "amount": -2 + }, + { + "first": 79, + "second": 46, + "amount": -2 + }, + { + "first": 79, + "second": 65, + "amount": -1 + }, + { + "first": 79, + "second": 74, + "amount": 0 + }, + { + "first": 79, + "second": 84, + "amount": -2 + }, + { + "first": 79, + "second": 88, + "amount": -1 + }, + { + "first": 79, + "second": 89, + "amount": -1 + }, + { + "first": 79, + "second": 90, + "amount": -1 + }, + { + "first": 80, + "second": 44, + "amount": -7 + }, + { + "first": 80, + "second": 46, + "amount": -7 + }, + { + "first": 80, + "second": 65, + "amount": -4 + }, + { + "first": 80, + "second": 71, + "amount": 0 + }, + { + "first": 80, + "second": 74, + "amount": -3 + }, + { + "first": 80, + "second": 87, + "amount": 1 + }, + { + "first": 80, + "second": 88, + "amount": -1 + }, + { + "first": 80, + "second": 97, + "amount": -1 + }, + { + "first": 80, + "second": 99, + "amount": -2 + }, + { + "first": 80, + "second": 100, + "amount": -2 + }, + { + "first": 80, + "second": 101, + "amount": -2 + }, + { + "first": 80, + "second": 103, + "amount": -2 + }, + { + "first": 80, + "second": 111, + "amount": -2 + }, + { + "first": 80, + "second": 113, + "amount": -2 + }, + { + "first": 81, + "second": 44, + "amount": -2 + }, + { + "first": 81, + "second": 46, + "amount": -3 + }, + { + "first": 81, + "second": 65, + "amount": -1 + }, + { + "first": 81, + "second": 84, + "amount": -2 + }, + { + "first": 81, + "second": 88, + "amount": -1 + }, + { + "first": 81, + "second": 89, + "amount": 0 + }, + { + "first": 81, + "second": 90, + "amount": -1 + }, + { + "first": 82, + "second": 59, + "amount": 2 + }, + { + "first": 82, + "second": 67, + "amount": -1 + }, + { + "first": 82, + "second": 71, + "amount": -1 + }, + { + "first": 82, + "second": 74, + "amount": 1 + }, + { + "first": 82, + "second": 79, + "amount": 0 + }, + { + "first": 82, + "second": 81, + "amount": 0 + }, + { + "first": 82, + "second": 84, + "amount": -1 + }, + { + "first": 82, + "second": 89, + "amount": -1 + }, + { + "first": 82, + "second": 99, + "amount": -1 + }, + { + "first": 82, + "second": 100, + "amount": -1 + }, + { + "first": 82, + "second": 101, + "amount": -1 + }, + { + "first": 82, + "second": 103, + "amount": -1 + }, + { + "first": 82, + "second": 111, + "amount": -1 + }, + { + "first": 82, + "second": 113, + "amount": -1 + }, + { + "first": 83, + "second": 116, + "amount": -1 + }, + { + "first": 83, + "second": 118, + "amount": -1 + }, + { + "first": 83, + "second": 119, + "amount": -1 + }, + { + "first": 83, + "second": 121, + "amount": -1 + }, + { + "first": 84, + "second": 44, + "amount": -3 + }, + { + "first": 84, + "second": 46, + "amount": -4 + }, + { + "first": 84, + "second": 58, + "amount": -1 + }, + { + "first": 84, + "second": 59, + "amount": -1 + }, + { + "first": 84, + "second": 65, + "amount": -3 + }, + { + "first": 84, + "second": 67, + "amount": -2 + }, + { + "first": 84, + "second": 71, + "amount": -2 + }, + { + "first": 84, + "second": 74, + "amount": -3 + }, + { + "first": 84, + "second": 79, + "amount": -2 + }, + { + "first": 84, + "second": 81, + "amount": -2 + }, + { + "first": 84, + "second": 84, + "amount": 1 + }, + { + "first": 84, + "second": 86, + "amount": 1 + }, + { + "first": 84, + "second": 87, + "amount": 1 + }, + { + "first": 84, + "second": 88, + "amount": 0 + }, + { + "first": 84, + "second": 89, + "amount": 1 + }, + { + "first": 84, + "second": 97, + "amount": -5 + }, + { + "first": 84, + "second": 99, + "amount": -5 + }, + { + "first": 84, + "second": 100, + "amount": -5 + }, + { + "first": 84, + "second": 101, + "amount": -5 + }, + { + "first": 84, + "second": 102, + "amount": -2 + }, + { + "first": 84, + "second": 103, + "amount": -5 + }, + { + "first": 84, + "second": 109, + "amount": -4 + }, + { + "first": 84, + "second": 110, + "amount": -4 + }, + { + "first": 84, + "second": 111, + "amount": -5 + }, + { + "first": 84, + "second": 112, + "amount": -4 + }, + { + "first": 84, + "second": 113, + "amount": -5 + }, + { + "first": 84, + "second": 114, + "amount": -4 + }, + { + "first": 84, + "second": 115, + "amount": -3 + }, + { + "first": 84, + "second": 117, + "amount": -4 + }, + { + "first": 84, + "second": 118, + "amount": -2 + }, + { + "first": 84, + "second": 119, + "amount": -3 + }, + { + "first": 84, + "second": 120, + "amount": -4 + }, + { + "first": 84, + "second": 121, + "amount": -3 + }, + { + "first": 84, + "second": 122, + "amount": -3 + }, + { + "first": 85, + "second": 65, + "amount": -1 + }, + { + "first": 86, + "second": 44, + "amount": -5 + }, + { + "first": 86, + "second": 46, + "amount": -5 + }, + { + "first": 86, + "second": 65, + "amount": -3 + }, + { + "first": 86, + "second": 67, + "amount": -1 + }, + { + "first": 86, + "second": 71, + "amount": -1 + }, + { + "first": 86, + "second": 74, + "amount": -2 + }, + { + "first": 86, + "second": 79, + "amount": 0 + }, + { + "first": 86, + "second": 81, + "amount": -1 + }, + { + "first": 86, + "second": 83, + "amount": -1 + }, + { + "first": 86, + "second": 84, + "amount": 1 + }, + { + "first": 86, + "second": 97, + "amount": -3 + }, + { + "first": 86, + "second": 99, + "amount": -3 + }, + { + "first": 86, + "second": 100, + "amount": -3 + }, + { + "first": 86, + "second": 101, + "amount": -3 + }, + { + "first": 86, + "second": 103, + "amount": -3 + }, + { + "first": 86, + "second": 109, + "amount": -2 + }, + { + "first": 86, + "second": 110, + "amount": -2 + }, + { + "first": 86, + "second": 111, + "amount": -3 + }, + { + "first": 86, + "second": 112, + "amount": -2 + }, + { + "first": 86, + "second": 113, + "amount": -3 + }, + { + "first": 86, + "second": 114, + "amount": -2 + }, + { + "first": 86, + "second": 115, + "amount": -1 + }, + { + "first": 86, + "second": 117, + "amount": -2 + }, + { + "first": 87, + "second": 44, + "amount": -3 + }, + { + "first": 87, + "second": 46, + "amount": -3 + }, + { + "first": 87, + "second": 65, + "amount": -2 + }, + { + "first": 87, + "second": 84, + "amount": 1 + }, + { + "first": 87, + "second": 97, + "amount": -2 + }, + { + "first": 87, + "second": 99, + "amount": -1 + }, + { + "first": 87, + "second": 100, + "amount": -1 + }, + { + "first": 87, + "second": 101, + "amount": -1 + }, + { + "first": 87, + "second": 103, + "amount": -1 + }, + { + "first": 87, + "second": 111, + "amount": -1 + }, + { + "first": 87, + "second": 113, + "amount": -1 + }, + { + "first": 88, + "second": 44, + "amount": 1 + }, + { + "first": 88, + "second": 46, + "amount": 1 + }, + { + "first": 88, + "second": 59, + "amount": 2 + }, + { + "first": 88, + "second": 67, + "amount": -1 + }, + { + "first": 88, + "second": 71, + "amount": -1 + }, + { + "first": 88, + "second": 74, + "amount": 2 + }, + { + "first": 88, + "second": 79, + "amount": -1 + }, + { + "first": 88, + "second": 81, + "amount": -1 + }, + { + "first": 88, + "second": 84, + "amount": 1 + }, + { + "first": 89, + "second": 44, + "amount": -4 + }, + { + "first": 89, + "second": 46, + "amount": -4 + }, + { + "first": 89, + "second": 65, + "amount": -4 + }, + { + "first": 89, + "second": 67, + "amount": -1 + }, + { + "first": 89, + "second": 71, + "amount": -1 + }, + { + "first": 89, + "second": 74, + "amount": -1 + }, + { + "first": 89, + "second": 79, + "amount": -1 + }, + { + "first": 89, + "second": 81, + "amount": -1 + }, + { + "first": 89, + "second": 83, + "amount": -1 + }, + { + "first": 89, + "second": 84, + "amount": 1 + }, + { + "first": 89, + "second": 97, + "amount": -4 + }, + { + "first": 89, + "second": 99, + "amount": -4 + }, + { + "first": 89, + "second": 100, + "amount": -4 + }, + { + "first": 89, + "second": 101, + "amount": -4 + }, + { + "first": 89, + "second": 102, + "amount": -1 + }, + { + "first": 89, + "second": 103, + "amount": -4 + }, + { + "first": 89, + "second": 109, + "amount": -3 + }, + { + "first": 89, + "second": 110, + "amount": -3 + }, + { + "first": 89, + "second": 111, + "amount": -4 + }, + { + "first": 89, + "second": 112, + "amount": -3 + }, + { + "first": 89, + "second": 113, + "amount": -4 + }, + { + "first": 89, + "second": 114, + "amount": -3 + }, + { + "first": 89, + "second": 115, + "amount": -3 + }, + { + "first": 89, + "second": 117, + "amount": -3 + }, + { + "first": 90, + "second": 74, + "amount": 2 + }, + { + "first": 90, + "second": 84, + "amount": 1 + }, + { + "first": 90, + "second": 121, + "amount": -1 + }, + { + "first": 91, + "second": 106, + "amount": 5 + }, + { + "first": 98, + "second": 97, + "amount": -1 + }, + { + "first": 98, + "second": 102, + "amount": 0 + }, + { + "first": 98, + "second": 120, + "amount": -1 + }, + { + "first": 99, + "second": 74, + "amount": 2 + }, + { + "first": 99, + "second": 84, + "amount": -2 + }, + { + "first": 99, + "second": 89, + "amount": -2 + }, + { + "first": 101, + "second": 34, + "amount": -2 + }, + { + "first": 101, + "second": 39, + "amount": -2 + }, + { + "first": 102, + "second": 41, + "amount": 3 + }, + { + "first": 102, + "second": 44, + "amount": -3 + }, + { + "first": 102, + "second": 45, + "amount": -2 + }, + { + "first": 102, + "second": 46, + "amount": -3 + }, + { + "first": 102, + "second": 58, + "amount": 2 + }, + { + "first": 102, + "second": 59, + "amount": 2 + }, + { + "first": 102, + "second": 63, + "amount": 1 + }, + { + "first": 102, + "second": 93, + "amount": 3 + }, + { + "first": 102, + "second": 98, + "amount": 0 + }, + { + "first": 102, + "second": 104, + "amount": 0 + }, + { + "first": 102, + "second": 116, + "amount": 1 + }, + { + "first": 102, + "second": 118, + "amount": 1 + }, + { + "first": 102, + "second": 119, + "amount": 1 + }, + { + "first": 102, + "second": 120, + "amount": 0 + }, + { + "first": 102, + "second": 121, + "amount": 1 + }, + { + "first": 102, + "second": 125, + "amount": 2 + }, + { + "first": 103, + "second": 106, + "amount": 1 + }, + { + "first": 106, + "second": 106, + "amount": 1 + }, + { + "first": 107, + "second": 44, + "amount": 2 + }, + { + "first": 107, + "second": 45, + "amount": -3 + }, + { + "first": 107, + "second": 46, + "amount": 2 + }, + { + "first": 107, + "second": 58, + "amount": 2 + }, + { + "first": 107, + "second": 59, + "amount": 2 + }, + { + "first": 107, + "second": 99, + "amount": -1 + }, + { + "first": 107, + "second": 100, + "amount": -1 + }, + { + "first": 107, + "second": 101, + "amount": -1 + }, + { + "first": 107, + "second": 103, + "amount": -1 + }, + { + "first": 107, + "second": 111, + "amount": -1 + }, + { + "first": 107, + "second": 113, + "amount": -1 + }, + { + "first": 107, + "second": 116, + "amount": 0 + }, + { + "first": 110, + "second": 34, + "amount": -2 + }, + { + "first": 110, + "second": 39, + "amount": -2 + }, + { + "first": 111, + "second": 34, + "amount": -3 + }, + { + "first": 111, + "second": 39, + "amount": -3 + }, + { + "first": 111, + "second": 97, + "amount": -1 + }, + { + "first": 111, + "second": 102, + "amount": -1 + }, + { + "first": 111, + "second": 120, + "amount": -1 + }, + { + "first": 112, + "second": 97, + "amount": -1 + }, + { + "first": 112, + "second": 102, + "amount": -1 + }, + { + "first": 112, + "second": 120, + "amount": -1 + }, + { + "first": 113, + "second": 106, + "amount": 2 + }, + { + "first": 114, + "second": 44, + "amount": -4 + }, + { + "first": 114, + "second": 45, + "amount": -3 + }, + { + "first": 114, + "second": 46, + "amount": -4 + }, + { + "first": 114, + "second": 58, + "amount": 2 + }, + { + "first": 114, + "second": 59, + "amount": 2 + }, + { + "first": 114, + "second": 99, + "amount": -1 + }, + { + "first": 114, + "second": 100, + "amount": -1 + }, + { + "first": 114, + "second": 101, + "amount": -1 + }, + { + "first": 114, + "second": 102, + "amount": 1 + }, + { + "first": 114, + "second": 103, + "amount": -1 + }, + { + "first": 114, + "second": 109, + "amount": 0 + }, + { + "first": 114, + "second": 110, + "amount": 0 + }, + { + "first": 114, + "second": 111, + "amount": -1 + }, + { + "first": 114, + "second": 113, + "amount": -1 + }, + { + "first": 114, + "second": 115, + "amount": 0 + }, + { + "first": 114, + "second": 116, + "amount": 1 + }, + { + "first": 114, + "second": 118, + "amount": 2 + }, + { + "first": 114, + "second": 119, + "amount": 2 + }, + { + "first": 114, + "second": 120, + "amount": 1 + }, + { + "first": 114, + "second": 121, + "amount": 2 + }, + { + "first": 114, + "second": 122, + "amount": 1 + }, + { + "first": 116, + "second": 45, + "amount": -3 + }, + { + "first": 116, + "second": 63, + "amount": -1 + }, + { + "first": 116, + "second": 99, + "amount": -1 + }, + { + "first": 116, + "second": 100, + "amount": -1 + }, + { + "first": 116, + "second": 101, + "amount": 0 + }, + { + "first": 116, + "second": 103, + "amount": 0 + }, + { + "first": 116, + "second": 111, + "amount": 0 + }, + { + "first": 116, + "second": 113, + "amount": 0 + }, + { + "first": 116, + "second": 120, + "amount": 1 + }, + { + "first": 117, + "second": 34, + "amount": -1 + }, + { + "first": 117, + "second": 39, + "amount": -1 + }, + { + "first": 118, + "second": 44, + "amount": -3 + }, + { + "first": 118, + "second": 46, + "amount": -3 + }, + { + "first": 118, + "second": 97, + "amount": -1 + }, + { + "first": 118, + "second": 99, + "amount": 0 + }, + { + "first": 118, + "second": 100, + "amount": 0 + }, + { + "first": 118, + "second": 101, + "amount": 0 + }, + { + "first": 118, + "second": 103, + "amount": 0 + }, + { + "first": 118, + "second": 111, + "amount": 0 + }, + { + "first": 118, + "second": 113, + "amount": 0 + }, + { + "first": 119, + "second": 44, + "amount": -2 + }, + { + "first": 119, + "second": 46, + "amount": -2 + }, + { + "first": 119, + "second": 99, + "amount": 0 + }, + { + "first": 119, + "second": 100, + "amount": 0 + }, + { + "first": 119, + "second": 101, + "amount": 0 + }, + { + "first": 119, + "second": 103, + "amount": 0 + }, + { + "first": 119, + "second": 111, + "amount": 0 + }, + { + "first": 119, + "second": 113, + "amount": 0 + }, + { + "first": 120, + "second": 99, + "amount": 0 + }, + { + "first": 120, + "second": 100, + "amount": 0 + }, + { + "first": 120, + "second": 101, + "amount": 0 + }, + { + "first": 120, + "second": 103, + "amount": 0 + }, + { + "first": 120, + "second": 111, + "amount": 0 + }, + { + "first": 120, + "second": 113, + "amount": 0 + }, + { + "first": 121, + "second": 34, + "amount": 1 + }, + { + "first": 121, + "second": 39, + "amount": 1 + }, + { + "first": 121, + "second": 44, + "amount": -2 + }, + { + "first": 121, + "second": 46, + "amount": -3 + }, + { + "first": 121, + "second": 63, + "amount": -2 + }, + { + "first": 121, + "second": 99, + "amount": 0 + }, + { + "first": 121, + "second": 100, + "amount": 0 + }, + { + "first": 121, + "second": 101, + "amount": 0 + }, + { + "first": 121, + "second": 102, + "amount": 0 + }, + { + "first": 121, + "second": 103, + "amount": 0 + }, + { + "first": 121, + "second": 111, + "amount": 0 + }, + { + "first": 121, + "second": 113, + "amount": 0 + }, + { + "first": 121, + "second": 116, + "amount": 0 + }, + { + "first": 123, + "second": 106, + "amount": 4 + } + ] +} \ No newline at end of file diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/font/ya-hei-ascii.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/font/ya-hei-ascii.png new file mode 100644 index 00000000..a23980bb Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/font/ya-hei-ascii.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/gltf/whale.glb b/bindings/wgpu/examples/common/src/commonMain/resources/assets/gltf/whale.glb new file mode 100644 index 00000000..4d361020 Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/gltf/whale.glb differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/Di-3d.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/Di-3d.png new file mode 100644 index 00000000..ebbff45e Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/Di-3d.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/brickwall_albedo.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/brickwall_albedo.png new file mode 100644 index 00000000..35835088 Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/brickwall_albedo.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/brickwall_height.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/brickwall_height.png new file mode 100644 index 00000000..48ab26fa Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/brickwall_height.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/brickwall_normal.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/brickwall_normal.png new file mode 100644 index 00000000..aa6643de Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/brickwall_normal.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/negx.jpg b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/negx.jpg new file mode 100644 index 00000000..992fde51 Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/negx.jpg differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/negy.jpg b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/negy.jpg new file mode 100644 index 00000000..a51a38dc Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/negy.jpg differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/negz.jpg b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/negz.jpg new file mode 100644 index 00000000..c463f0d5 Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/negz.jpg differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/posx.jpg b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/posx.jpg new file mode 100644 index 00000000..106d3a68 Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/posx.jpg differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/posy.jpg b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/posy.jpg new file mode 100644 index 00000000..1ea42cd2 Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/posy.jpg differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/posz.jpg b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/posz.jpg new file mode 100644 index 00000000..69463d06 Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/posz.jpg differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/readme.txt b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/readme.txt new file mode 100644 index 00000000..0ce9e3d2 --- /dev/null +++ b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/cubemap/readme.txt @@ -0,0 +1,20 @@ +Author +====== + +This is the work of Emil Persson, aka Humus. +http://www.humus.name +humus@comhem.se + + + +Legal stuff +=========== + +This work is free and may be used by anyone for any purpose +and may be distributed freely to anyone using any distribution +media or distribution method as long as this file is included. +Distribution without this file is allowed if it's distributed +with free non-commercial software; however, fair credit of the +original author is expected. +Any commercial distribution of this software requires the written +approval of Emil Persson. diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/moon.jpg b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/moon.jpg new file mode 100644 index 00000000..daec570b Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/moon.jpg differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/saturn.jpg b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/saturn.jpg new file mode 100644 index 00000000..d8b23dfe Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/saturn.jpg differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/spiral_height.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/spiral_height.png new file mode 100644 index 00000000..1f1680ff Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/spiral_height.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/spiral_normal.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/spiral_normal.png new file mode 100644 index 00000000..5cba15cf Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/spiral_normal.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/toybox_height.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/toybox_height.png new file mode 100644 index 00000000..35510d73 Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/toybox_height.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/toybox_normal.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/toybox_normal.png new file mode 100644 index 00000000..634728fb Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/toybox_normal.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/webgpu.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/webgpu.png new file mode 100644 index 00000000..a44b73ea Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/webgpu.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/wood_albedo.png b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/wood_albedo.png new file mode 100644 index 00000000..e28e2aee Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/img/wood_albedo.png differ diff --git a/bindings/wgpu/examples/common/src/commonMain/resources/assets/video/pano.webm b/bindings/wgpu/examples/common/src/commonMain/resources/assets/video/pano.webm new file mode 100644 index 00000000..62aa3085 Binary files /dev/null and b/bindings/wgpu/examples/common/src/commonMain/resources/assets/video/pano.webm differ diff --git a/bindings/wgpu/examples/common/src/jvmMain/kotlin/io.ygdrasil.wgpu.examples/Os.kt b/bindings/wgpu/examples/common/src/jvmMain/kotlin/io.ygdrasil.wgpu.examples/Os.kt new file mode 100644 index 00000000..5c3d1c41 --- /dev/null +++ b/bindings/wgpu/examples/common/src/jvmMain/kotlin/io.ygdrasil.wgpu.examples/Os.kt @@ -0,0 +1,20 @@ +package io.ygdrasil.wgpu.examples + +enum class Os { + Linux, + Window, + MacOs +} + +object Platform { + val os: Os + get() = System.getProperty("os.name").let { name -> + when { + arrayOf("Linux", "SunOS", "Unit").any { name.startsWith(it) } -> Os.Linux + arrayOf("Mac OS X", "Darwin").any { name.startsWith(it) } -> Os.MacOs + arrayOf("Windows").any { name.startsWith(it) } -> Os.Window + else -> error("Unrecognized or unsupported operating system.") + } + } + +} diff --git a/bindings/wgpu/examples/compose/build.gradle.kts b/bindings/wgpu/examples/compose/build.gradle.kts new file mode 100644 index 00000000..232ea6b6 --- /dev/null +++ b/bindings/wgpu/examples/compose/build.gradle.kts @@ -0,0 +1,50 @@ +import org.jetbrains.compose.desktop.application.dsl.TargetFormat + +plugins { + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.compose) +} + +repositories { + mavenCentral() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + google() + maven { + url = uri("http://repo.maven.cyberduck.io.s3.amazonaws.com/releases") + isAllowInsecureProtocol = true + } +} + +kotlin { + jvm() + + sourceSets { + val commonMain by getting { + dependencies { + implementation(project(":examples:common")) + } + } + + val jvmMain by getting { + dependencies { + implementation(compose.desktop.currentOs) + implementation(project(":librococoa")) + + } + } + } +} + +compose.desktop { + application { + mainClass = "MainKt" + + jvmArgs += "--add-opens=java.base/java.lang=ALL-UNNAMED" + + nativeDistributions { + targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) + packageName = "compose" + packageVersion = "1.0.0" + } + } +} diff --git a/bindings/wgpu/examples/compose/src/jvmMain/kotlin/Main.kt b/bindings/wgpu/examples/compose/src/jvmMain/kotlin/Main.kt new file mode 100644 index 00000000..d24ec4b8 --- /dev/null +++ b/bindings/wgpu/examples/compose/src/jvmMain/kotlin/Main.kt @@ -0,0 +1,177 @@ +import androidx.compose.desktop.ui.tooling.preview.Preview +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.* +import androidx.compose.material.Button +import androidx.compose.material.Card +import androidx.compose.material.MaterialTheme +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.awt.ComposeWindow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.Window +import androidx.compose.ui.window.WindowPosition +import androidx.compose.ui.window.application +import androidx.compose.ui.window.rememberWindowState +import com.sun.jna.Pointer +import darwin.NSWindow +import io.ygdrasil.wgpu.ImageBitmapHolder +import io.ygdrasil.wgpu.RenderingContext +import io.ygdrasil.wgpu.WGPU +import io.ygdrasil.wgpu.examples.Application +import io.ygdrasil.wgpu.examples.AssetManager +import kotlinx.coroutines.* +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.filterNotNull +import kotlinx.coroutines.flow.update +import org.rococoa.ID +import org.rococoa.Rococoa + +@Composable +@Preview +fun App() { + + MaterialTheme { + Column( + Modifier + .width(300.dp) + .fillMaxHeight() + .background(MaterialTheme.colors.background) + ) { + + Card( + Modifier + .fillMaxWidth() + .padding(5.dp) + ) { + Column( + Modifier + .fillMaxWidth() + .background(MaterialTheme.colors.error) + ) { + Text( + "Basic Graphics", + style = MaterialTheme.typography.h4 + ) + Button( + onClick = { + + } + ) { + Text( + "Titling screen", + style = MaterialTheme.typography.subtitle1 + ) + } + } + } + + } + + } +} + + +val windowStateFlow = MutableStateFlow(null) + + +fun main() { + val thread = Thread { + runBlocking { + windowStateFlow + .filterNotNull() + .collect { window -> + runApp(window) + } + } + } + thread.start() + + + application { + val windowState = rememberWindowState( + width = 775.dp, + height = 1500.dp, + position = WindowPosition(0.dp, 0.dp) + ) + Window( + onCloseRequest = ::exitApplication, + //alwaysOnTop = true, + state = windowState + ) { + windowStateFlow.update { window } + + App() + } + } + + +} + +val applicationScope = CoroutineScope(Dispatchers.Default) + +suspend fun runApp(window: ComposeWindow) { + val nswindow = Rococoa.wrap(ID.fromLong(window.windowHandle), NSWindow::class.java) + val layer = nswindow.contentView()?.layer() ?: error("fail to get layer") + + println("window handler ${window.windowHandle}") + println("window hander ${nswindow.description()}") + println("window hander ${layer.description()}") + + (WGPU.createInstance() ?: error("fail to wgpu instance")).use { instance -> + + + val surface = instance.getSurfaceFromMetalLayer(Pointer(layer.id().toLong())) ?: error("fail to get surface") + val renderingContext = RenderingContext(surface) { + window.width to window.height + } + + val adapter = instance.requestAdapter(renderingContext) + ?: error("fail to get adapter") + + val device = adapter.requestDevice() + ?: error("fail to get device") + + renderingContext.computeSurfaceCapabilities(adapter) + + val assetManager = object : AssetManager { + override val Di3d: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapPosx: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapNegx: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapPosy: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapNegy: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapPosz: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapNegz: ImageBitmapHolder + get() = TODO("Not yet implemented") + + } + + val application = object : Application( + renderingContext, + device, + adapter, + assetManager + ) { + override fun run() { + renderFrame() + applicationScope.launch() { + delay(UPDATE_INTERVAL) + run() + } + } + + + } + application.run() + } +} + + +// ~60 Frame per second +val UPDATE_INTERVAL = (1000.0 / 60.0).toLong() \ No newline at end of file diff --git a/bindings/wgpu/examples/glfw/build.gradle.kts b/bindings/wgpu/examples/glfw/build.gradle.kts new file mode 100644 index 00000000..61c7ab55 --- /dev/null +++ b/bindings/wgpu/examples/glfw/build.gradle.kts @@ -0,0 +1,50 @@ +plugins { + kotlin("jvm") + application +} + +val lwjglNatives = Pair( + System.getProperty("os.name")!!, + System.getProperty("os.arch")!! +).let { (name, arch) -> + when { + arrayOf("Linux", "SunOS", "Unit").any { name.startsWith(it) } -> + if (arrayOf("arm", "aarch64").any { arch.startsWith(it) }) + "natives-linux${if (arch.contains("64") || arch.startsWith("armv8")) "-arm64" else "-arm32"}" + else if (arch.startsWith("ppc")) + "natives-linux-ppc64le" + else if (arch.startsWith("riscv")) + "natives-linux-riscv64" + else + "natives-linux" + + arrayOf("Mac OS X", "Darwin").any { name.startsWith(it) } -> + "natives-macos${if (arch.startsWith("aarch64")) "-arm64" else ""}" + + arrayOf("Windows").any { name.startsWith(it) } -> + "natives-windows" + + else -> + throw Error("Unrecognized or unsupported platform. Please set \"lwjglNatives\" manually") + } +} + +val lwjglVersion = "3.3.3" +dependencies { + + implementation(project(":examples:common")) + + implementation(platform("org.lwjgl:lwjgl-bom:$lwjglVersion")) + implementation("org.lwjgl", "lwjgl") + implementation("org.lwjgl", "lwjgl-glfw") + runtimeOnly("org.lwjgl", "lwjgl", classifier = lwjglNatives) + runtimeOnly("org.lwjgl", "lwjgl-glfw", classifier = lwjglNatives) +} + + + +application { + mainClass.set("io.ygdrasil.wgpu.examples.GlfwMainKt") + applicationDefaultJvmArgs += "-XstartOnFirstThread" + applicationDefaultJvmArgs += "--add-opens=java.base/java.lang=ALL-UNNAMED" +} diff --git a/bindings/wgpu/examples/glfw/src/main/kotlin/GlfwCoroutineDispatcher.kt b/bindings/wgpu/examples/glfw/src/main/kotlin/GlfwCoroutineDispatcher.kt new file mode 100644 index 00000000..4fbefc31 --- /dev/null +++ b/bindings/wgpu/examples/glfw/src/main/kotlin/GlfwCoroutineDispatcher.kt @@ -0,0 +1,38 @@ +package io.ygdrasil.wgpu.examples + +import kotlinx.coroutines.CoroutineDispatcher +import org.lwjgl.glfw.GLFW +import kotlin.coroutines.CoroutineContext + +class GlfwCoroutineDispatcher : CoroutineDispatcher() { + private val tasks = mutableListOf() + private val tasksCopy = mutableListOf() + private var isStopped = false + + fun runLoop() { + while (!isStopped) { + synchronized(tasks) { + tasksCopy.addAll(tasks) + tasks.clear() + } + for (runnable in tasksCopy) { + if (!isStopped) { + runnable.run() + } + } + tasksCopy.clear() + GLFW.glfwWaitEvents() + } + } + + fun stop() { + isStopped = true + } + + override fun dispatch(context: CoroutineContext, block: Runnable) { + synchronized(tasks) { + tasks.add(block) + } + GLFW.glfwPostEmptyEvent() + } +} \ No newline at end of file diff --git a/bindings/wgpu/examples/glfw/src/main/kotlin/GlfwMain.kt b/bindings/wgpu/examples/glfw/src/main/kotlin/GlfwMain.kt new file mode 100644 index 00000000..5afb1422 --- /dev/null +++ b/bindings/wgpu/examples/glfw/src/main/kotlin/GlfwMain.kt @@ -0,0 +1,169 @@ +package io.ygdrasil.wgpu.examples + +import com.sun.jna.Pointer +import darwin.CAMetalLayer +import darwin.NSWindow +import io.ygdrasil.wgpu.ImageBitmapHolder +import io.ygdrasil.wgpu.RenderingContext +import io.ygdrasil.wgpu.WGPU +import io.ygdrasil.wgpu.WGPU.Companion.createInstance +import io.ygdrasil.wgpu.internal.jvm.WGPULogCallback +import io.ygdrasil.wgpu.internal.jvm.WGPUSurface +import io.ygdrasil.wgpu.internal.jvm.wgpuSetLogCallback +import io.ygdrasil.wgpu.internal.jvm.wgpuSetLogLevel +import kotlinx.coroutines.Dispatchers +import org.lwjgl.glfw.GLFW.* +import org.lwjgl.glfw.GLFWNativeCocoa.glfwGetCocoaWindow +import org.lwjgl.system.MemoryUtil.NULL +import org.rococoa.ID +import org.rococoa.Rococoa +import kotlin.system.exitProcess + +val callback = object : WGPULogCallback { + override fun invoke(level: Int, message: String, param3: Pointer?) { + println("{$level} $message") + } + + +} + +suspend fun main() { + wgpuSetLogLevel(4) + wgpuSetLogCallback(callback, null) + + var width = 640 + var height = 480 + + glfwInit() + glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE) + glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE) + val windowHandle: Long = glfwCreateWindow(width, height, "LWJGL Demo", NULL, NULL) + glfwMakeContextCurrent(windowHandle) + glfwSwapInterval(1) + + val glfwDispatcher = GlfwCoroutineDispatcher() // a custom coroutine dispatcher, in which Compose will run + + glfwSetWindowCloseCallback(windowHandle) { + glfwDispatcher.stop() + } + + val wgpu = createInstance() ?: error("fail to wgpu instance") + val surface = wgpu.getSurface(windowHandle) + + val renderingContext = RenderingContext(surface) { + val width = intArrayOf(1) + val height = intArrayOf(1) + glfwGetWindowSize(windowHandle, width, height) + width[0] to height[0] + } + + val adapter = wgpu.requestAdapter(renderingContext) + ?: error("fail to get adapter") + + val device = adapter.requestDevice() + ?: error("fail to get device") + + renderingContext.computeSurfaceCapabilities(adapter) + + val assetManager = object : AssetManager { + override val Di3d: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapPosx: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapNegx: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapPosy: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapNegy: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapPosz: ImageBitmapHolder + get() = TODO("Not yet implemented") + override val cubemapNegz: ImageBitmapHolder + get() = TODO("Not yet implemented") + + } + + val application = object : Application( + renderingContext, + device, + adapter, + assetManager + ) { + + override fun run() { + glfwDispatcher.dispatch(Dispatchers.Main) { + renderFrame() + run() + } + } + + } + + fun render() { + + application.configureRenderingContext() + application.renderFrame() + glfwSwapBuffers(windowHandle) + } + + + glfwSetWindowSizeCallback(windowHandle) { _, windowWidth, windowHeight -> + width = windowWidth + height = windowHeight + + + glfwSwapInterval(0) + render() + glfwSwapInterval(1) + } + + glfwSetKeyCallback(windowHandle) { _, key, scancode, action, mods -> + + if ((key == GLFW_KEY_PAGE_UP || key == GLFW_KEY_PAGE_DOWN) && action == GLFW_PRESS) { + val currentIndex = availableScenes.indexOf(application.currentScene) + val index = if (key == GLFW_KEY_PAGE_UP) { + currentIndex - 1 + } else { + currentIndex + 1 + }.let { + when (it) { + availableScenes.size -> 0 + -1 -> availableScenes.size - 1 + else -> it + } + } + + + glfwDispatcher.dispatch(Dispatchers.Main) { + application.changeScene(availableScenes[index]) + } + } + } + + + glfwShowWindow(windowHandle) + + application.run() + glfwDispatcher.runLoop() + + application.close() + wgpu.close() + glfwDestroyWindow(windowHandle) + exitProcess(0) +} + +fun WGPU.getSurface(window: Long): WGPUSurface = when (Platform.os) { + Os.Linux -> TODO() + Os.Window -> TODO() + Os.MacOs -> { + val nsWindowPtr = glfwGetCocoaWindow(window) + val nswindow = Rococoa.wrap(ID.fromLong(nsWindowPtr), NSWindow::class.java) + nswindow.contentView()?.setWantsLayer(true) + val layer = CAMetalLayer.layer() + nswindow.contentView()?.setLayer(layer.id().toLong().toPointer()) + getSurfaceFromMetalLayer(Pointer(layer.id().toLong())) ?: error("fail to get surface on MacOs") + } +} + +private fun Long.toPointer(): Pointer = Pointer(this) + diff --git a/bindings/wgpu/examples/web-js/build.gradle.kts b/bindings/wgpu/examples/web-js/build.gradle.kts new file mode 100644 index 00000000..9a4f3c74 --- /dev/null +++ b/bindings/wgpu/examples/web-js/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + alias(libs.plugins.kotlinMultiplatform) +} + +kotlin { + js { + binaries.executable() + browser() + nodejs() + generateTypeScriptDefinitions() + } + + sourceSets { + val commonMain by getting { + dependencies { + implementation(project(":examples:common")) + } + } + + } +} + diff --git a/bindings/wgpu/examples/web-js/src/jsMain/kotlin/JsApplication.kt b/bindings/wgpu/examples/web-js/src/jsMain/kotlin/JsApplication.kt new file mode 100644 index 00000000..10c96d04 --- /dev/null +++ b/bindings/wgpu/examples/web-js/src/jsMain/kotlin/JsApplication.kt @@ -0,0 +1,102 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu.examples + +import io.ygdrasil.wgpu.ImageBitmapHolder +import io.ygdrasil.wgpu.getRenderingContext +import io.ygdrasil.wgpu.requestAdapter +import kotlinx.browser.window +import kotlinx.coroutines.MainScope +import kotlinx.coroutines.await +import kotlinx.coroutines.promise +import org.w3c.dom.HTMLCanvasElement +import kotlin.js.Promise + +external fun setInterval(render: () -> Unit, updateInterval: Int) + +// ~60 Frame per second +val UPDATE_INTERVAL = (1000.0 / 60.0).toInt() + +@JsExport +fun jsApplication(canvas: HTMLCanvasElement): Promise { + return MainScope().promise { + + val assetManager = getAssetManager() + + val devicePixelRatio = window.devicePixelRatio + canvas.width = (canvas.clientWidth * devicePixelRatio).toInt() + canvas.height = (canvas.clientHeight * devicePixelRatio).toInt() + println("${canvas.width} ${canvas.height}") + val adapter = requestAdapter() ?: error("No appropriate Adapter found.") + val device = adapter.requestDevice() ?: error("No appropriate Device found.") + val renderingContext = canvas.getRenderingContext() ?: error("fail to get context") + + + + object : Application( + renderingContext, + device, + adapter, + assetManager + ) { + override fun run() { + // Schedule main loop to run repeatedly + setInterval({ + renderFrame() + }, UPDATE_INTERVAL); + } + }.also { application -> + window.onkeydown = { event -> + if (event.keyCode == 33 || event.keyCode == 34) { + val currentIndex = availableScenes.indexOf(application.currentScene) + val index = if (event.keyCode == 33) { + currentIndex - 1 + } else { + currentIndex + 1 + }.let { + when (it) { + availableScenes.size -> 0 + -1 -> availableScenes.size - 1 + else -> it + } + } + + + application.changeScene(availableScenes[index]) + } + + + } + } + + + } + +} + +suspend fun getAssetManager(): AssetManager { + val Di3d: ImageBitmapHolder = getImage("./assets/img/Di-3d.png") + val cubemapPosx = getImage("./assets/img/cubemap/posx.jpg") + val cubemapNegx = getImage("./assets/img/cubemap/negx.jpg") + val cubemapPosy = getImage("./assets/img/cubemap/posy.jpg") + val cubemapNegy = getImage("./assets/img/cubemap/negy.jpg") + val cubemapPosz = getImage("./assets/img/cubemap/posz.jpg") + val cubemapNegz = getImage("./assets/img/cubemap/negz.jpg") + + return object : AssetManager { + override val Di3d: ImageBitmapHolder = Di3d + override val cubemapPosx: ImageBitmapHolder = cubemapPosx + override val cubemapNegx: ImageBitmapHolder = cubemapNegx + override val cubemapPosy: ImageBitmapHolder = cubemapPosy + override val cubemapNegy: ImageBitmapHolder = cubemapNegy + override val cubemapPosz: ImageBitmapHolder = cubemapPosz + override val cubemapNegz: ImageBitmapHolder = cubemapNegz + } +} + +private suspend fun getImage(url: String): ImageBitmapHolder { + return window.fetch(url).await() + .blob().await() + .let { window.createImageBitmap(it) }.await() + .let { ImageBitmapHolder(it) } +} diff --git a/bindings/wgpu/examples/web-js/src/jsMain/kotlin/main.kt b/bindings/wgpu/examples/web-js/src/jsMain/kotlin/main.kt new file mode 100644 index 00000000..42b779d4 --- /dev/null +++ b/bindings/wgpu/examples/web-js/src/jsMain/kotlin/main.kt @@ -0,0 +1,13 @@ +import io.ygdrasil.wgpu.examples.jsApplication +import kotlinx.browser.document +import kotlinx.browser.window +import org.w3c.dom.HTMLCanvasElement + +fun main() { + window.addEventListener("DOMContentLoaded", { + val canvas = (document.getElementById("webgpu") as? HTMLCanvasElement) ?: error("fail to get canvas") + jsApplication(canvas) + .then { it.run() } + + }) +} \ No newline at end of file diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/font/ya-hei-ascii-msdf.json b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/font/ya-hei-ascii-msdf.json new file mode 100644 index 00000000..19ec37ac --- /dev/null +++ b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/font/ya-hei-ascii-msdf.json @@ -0,0 +1,3407 @@ +{ + "pages": [ + "ya-hei-ascii.png" + ], + "chars": [ + { + "id": 124, + "index": 98, + "char": "|", + "width": 8, + "height": 49, + "xoffset": 2, + "yoffset": 1, + "xadvance": 11, + "chnl": 15, + "x": 0, + "y": 0, + "page": 0 + }, + { + "id": 106, + "index": 80, + "char": "j", + "width": 16, + "height": 48, + "xoffset": -6, + "yoffset": 3, + "xadvance": 11, + "chnl": 15, + "x": 0, + "y": 50, + "page": 0 + }, + { + "id": 87, + "index": 61, + "char": "W", + "width": 46, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 43, + "chnl": 15, + "x": 9, + "y": 0, + "page": 0 + }, + { + "id": 81, + "index": 55, + "char": "Q", + "width": 35, + "height": 45, + "xoffset": 0, + "yoffset": 4, + "xadvance": 34, + "chnl": 15, + "x": 0, + "y": 99, + "page": 0 + }, + { + "id": 36, + "index": 10, + "char": "$", + "width": 22, + "height": 44, + "xoffset": 1, + "yoffset": 0, + "xadvance": 25, + "chnl": 15, + "x": 17, + "y": 37, + "page": 0 + }, + { + "id": 40, + "index": 14, + "char": "(", + "width": 14, + "height": 43, + "xoffset": 1, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 145, + "page": 0 + }, + { + "id": 41, + "index": 15, + "char": ")", + "width": 15, + "height": 43, + "xoffset": -2, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 189, + "page": 0 + }, + { + "id": 91, + "index": 65, + "char": "[", + "width": 12, + "height": 43, + "xoffset": 2, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 15, + "y": 145, + "page": 0 + }, + { + "id": 93, + "index": 67, + "char": "]", + "width": 12, + "height": 43, + "xoffset": -1, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 233, + "page": 0 + }, + { + "id": 123, + "index": 97, + "char": "{", + "width": 15, + "height": 43, + "xoffset": 0, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 277, + "page": 0 + }, + { + "id": 125, + "index": 99, + "char": "}", + "width": 15, + "height": 43, + "xoffset": -1, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 13, + "y": 233, + "page": 0 + }, + { + "id": 47, + "index": 21, + "char": "/", + "width": 23, + "height": 41, + "xoffset": -3, + "yoffset": 4, + "xadvance": 18, + "chnl": 15, + "x": 16, + "y": 189, + "page": 0 + }, + { + "id": 92, + "index": 66, + "char": "\\", + "width": 23, + "height": 41, + "xoffset": -3, + "yoffset": 4, + "xadvance": 17, + "chnl": 15, + "x": 28, + "y": 145, + "page": 0 + }, + { + "id": 12385, + "index": 28668, + "char": "ち", + "width": 33, + "height": 41, + "xoffset": 3, + "yoffset": 2, + "xadvance": 42, + "chnl": 15, + "x": 36, + "y": 82, + "page": 0 + }, + { + "id": 64, + "index": 38, + "char": "@", + "width": 40, + "height": 40, + "xoffset": 2, + "yoffset": 4, + "xadvance": 43, + "chnl": 15, + "x": 40, + "y": 37, + "page": 0 + }, + { + "id": 12435, + "index": 28718, + "char": "ん", + "width": 39, + "height": 38, + "xoffset": 1, + "yoffset": 3, + "xadvance": 42, + "chnl": 15, + "x": 0, + "y": 321, + "page": 0 + }, + { + "id": 37, + "index": 11, + "char": "%", + "width": 38, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 37, + "chnl": 15, + "x": 16, + "y": 277, + "page": 0 + }, + { + "id": 98, + "index": 72, + "char": "b", + "width": 25, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 27, + "chnl": 15, + "x": 29, + "y": 231, + "page": 0 + }, + { + "id": 100, + "index": 74, + "char": "d", + "width": 25, + "height": 38, + "xoffset": 0, + "yoffset": 2, + "xadvance": 27, + "chnl": 15, + "x": 40, + "y": 187, + "page": 0 + }, + { + "id": 102, + "index": 76, + "char": "f", + "width": 18, + "height": 38, + "xoffset": -1, + "yoffset": 2, + "xadvance": 15, + "chnl": 15, + "x": 52, + "y": 124, + "page": 0 + }, + { + "id": 103, + "index": 77, + "char": "g", + "width": 25, + "height": 38, + "xoffset": 0, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 70, + "y": 78, + "page": 0 + }, + { + "id": 104, + "index": 78, + "char": "h", + "width": 23, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 26, + "chnl": 15, + "x": 81, + "y": 0, + "page": 0 + }, + { + "id": 107, + "index": 81, + "char": "k", + "width": 23, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 23, + "chnl": 15, + "x": 81, + "y": 39, + "page": 0 + }, + { + "id": 108, + "index": 82, + "char": "l", + "width": 8, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 11, + "chnl": 15, + "x": 0, + "y": 360, + "page": 0 + }, + { + "id": 112, + "index": 86, + "char": "p", + "width": 25, + "height": 38, + "xoffset": 2, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 0, + "y": 399, + "page": 0 + }, + { + "id": 113, + "index": 87, + "char": "q", + "width": 25, + "height": 38, + "xoffset": 0, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 9, + "y": 360, + "page": 0 + }, + { + "id": 12399, + "index": 28682, + "char": "は", + "width": 38, + "height": 38, + "xoffset": 3, + "yoffset": 4, + "xadvance": 42, + "chnl": 15, + "x": 0, + "y": 438, + "page": 0 + }, + { + "id": 38, + "index": 12, + "char": "&", + "width": 37, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 37, + "chnl": 15, + "x": 26, + "y": 399, + "page": 0 + }, + { + "id": 48, + "index": 22, + "char": "0", + "width": 25, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 35, + "y": 360, + "page": 0 + }, + { + "id": 51, + "index": 25, + "char": "3", + "width": 23, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 40, + "y": 315, + "page": 0 + }, + { + "id": 54, + "index": 28, + "char": "6", + "width": 24, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 61, + "y": 353, + "page": 0 + }, + { + "id": 56, + "index": 30, + "char": "8", + "width": 24, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 39, + "y": 437, + "page": 0 + }, + { + "id": 57, + "index": 31, + "char": "9", + "width": 24, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 39, + "y": 475, + "page": 0 + }, + { + "id": 63, + "index": 37, + "char": "?", + "width": 19, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 20, + "chnl": 15, + "x": 55, + "y": 226, + "page": 0 + }, + { + "id": 67, + "index": 41, + "char": "C", + "width": 28, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 28, + "chnl": 15, + "x": 55, + "y": 264, + "page": 0 + }, + { + "id": 71, + "index": 45, + "char": "G", + "width": 30, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 31, + "chnl": 15, + "x": 64, + "y": 302, + "page": 0 + }, + { + "id": 77, + "index": 51, + "char": "M", + "width": 37, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 41, + "chnl": 15, + "x": 66, + "y": 163, + "page": 0 + }, + { + "id": 79, + "index": 53, + "char": "O", + "width": 34, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 34, + "chnl": 15, + "x": 71, + "y": 117, + "page": 0 + }, + { + "id": 83, + "index": 57, + "char": "S", + "width": 24, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 24, + "chnl": 15, + "x": 96, + "y": 78, + "page": 0 + }, + { + "id": 105, + "index": 79, + "char": "i", + "width": 9, + "height": 37, + "xoffset": 1, + "yoffset": 3, + "xadvance": 11, + "chnl": 15, + "x": 75, + "y": 200, + "page": 0 + }, + { + "id": 109, + "index": 83, + "char": "m", + "width": 37, + "height": 27, + "xoffset": 2, + "yoffset": 13, + "xadvance": 39, + "chnl": 15, + "x": 0, + "y": 477, + "page": 0 + }, + { + "id": 121, + "index": 95, + "char": "y", + "width": 26, + "height": 37, + "xoffset": -2, + "yoffset": 13, + "xadvance": 22, + "chnl": 15, + "x": 84, + "y": 238, + "page": 0 + }, + { + "id": 12395, + "index": 28678, + "char": "に", + "width": 37, + "height": 37, + "xoffset": 3, + "yoffset": 4, + "xadvance": 42, + "chnl": 15, + "x": 85, + "y": 200, + "page": 0 + }, + { + "id": 33, + "index": 7, + "char": "!", + "width": 9, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 13, + "chnl": 15, + "x": 56, + "y": 0, + "page": 0 + }, + { + "id": 49, + "index": 23, + "char": "1", + "width": 22, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 104, + "y": 155, + "page": 0 + }, + { + "id": 50, + "index": 24, + "char": "2", + "width": 24, + "height": 36, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 106, + "y": 116, + "page": 0 + }, + { + "id": 52, + "index": 26, + "char": "4", + "width": 27, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 105, + "y": 0, + "page": 0 + }, + { + "id": 53, + "index": 27, + "char": "5", + "width": 22, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 105, + "y": 37, + "page": 0 + }, + { + "id": 55, + "index": 29, + "char": "7", + "width": 25, + "height": 36, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 121, + "y": 74, + "page": 0 + }, + { + "id": 65, + "index": 39, + "char": "A", + "width": 33, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 30, + "chnl": 15, + "x": 128, + "y": 37, + "page": 0 + }, + { + "id": 66, + "index": 40, + "char": "B", + "width": 24, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 26, + "chnl": 15, + "x": 133, + "y": 0, + "page": 0 + }, + { + "id": 68, + "index": 42, + "char": "D", + "width": 30, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 32, + "chnl": 15, + "x": 158, + "y": 0, + "page": 0 + }, + { + "id": 69, + "index": 43, + "char": "E", + "width": 21, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 23, + "chnl": 15, + "x": 64, + "y": 391, + "page": 0 + }, + { + "id": 70, + "index": 44, + "char": "F", + "width": 20, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 22, + "chnl": 15, + "x": 64, + "y": 428, + "page": 0 + }, + { + "id": 72, + "index": 46, + "char": "H", + "width": 28, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 32, + "chnl": 15, + "x": 64, + "y": 465, + "page": 0 + }, + { + "id": 73, + "index": 47, + "char": "I", + "width": 14, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 12, + "chnl": 15, + "x": 66, + "y": 0, + "page": 0 + }, + { + "id": 74, + "index": 48, + "char": "J", + "width": 16, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 17, + "chnl": 15, + "x": 85, + "y": 428, + "page": 0 + }, + { + "id": 75, + "index": 49, + "char": "K", + "width": 27, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 93, + "y": 465, + "page": 0 + }, + { + "id": 76, + "index": 50, + "char": "L", + "width": 21, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 22, + "chnl": 15, + "x": 86, + "y": 340, + "page": 0 + }, + { + "id": 78, + "index": 52, + "char": "N", + "width": 30, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 34, + "chnl": 15, + "x": 86, + "y": 377, + "page": 0 + }, + { + "id": 80, + "index": 54, + "char": "P", + "width": 24, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 26, + "chnl": 15, + "x": 102, + "y": 414, + "page": 0 + }, + { + "id": 82, + "index": 56, + "char": "R", + "width": 27, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 121, + "y": 451, + "page": 0 + }, + { + "id": 84, + "index": 58, + "char": "T", + "width": 26, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 24, + "chnl": 15, + "x": 95, + "y": 276, + "page": 0 + }, + { + "id": 85, + "index": 59, + "char": "U", + "width": 28, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 31, + "chnl": 15, + "x": 111, + "y": 238, + "page": 0 + }, + { + "id": 86, + "index": 60, + "char": "V", + "width": 32, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 28, + "chnl": 15, + "x": 123, + "y": 192, + "page": 0 + }, + { + "id": 88, + "index": 62, + "char": "X", + "width": 30, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 127, + "y": 153, + "page": 0 + }, + { + "id": 89, + "index": 63, + "char": "Y", + "width": 29, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 131, + "y": 111, + "page": 0 + }, + { + "id": 90, + "index": 64, + "char": "Z", + "width": 28, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 26, + "chnl": 15, + "x": 147, + "y": 74, + "page": 0 + }, + { + "id": 119, + "index": 93, + "char": "w", + "width": 36, + "height": 27, + "xoffset": -1, + "yoffset": 13, + "xadvance": 33, + "chnl": 15, + "x": 162, + "y": 37, + "page": 0 + }, + { + "id": 116, + "index": 90, + "char": "t", + "width": 18, + "height": 34, + "xoffset": -1, + "yoffset": 7, + "xadvance": 16, + "chnl": 15, + "x": 189, + "y": 0, + "page": 0 + }, + { + "id": 35, + "index": 9, + "char": "#", + "width": 29, + "height": 33, + "xoffset": -1, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 108, + "y": 313, + "page": 0 + }, + { + "id": 59, + "index": 33, + "char": ";", + "width": 11, + "height": 33, + "xoffset": -1, + "yoffset": 13, + "xadvance": 10, + "chnl": 15, + "x": 122, + "y": 275, + "page": 0 + }, + { + "id": 12371, + "index": 28654, + "char": "こ", + "width": 32, + "height": 31, + "xoffset": 5, + "yoffset": 8, + "xadvance": 42, + "chnl": 15, + "x": 134, + "y": 275, + "page": 0 + }, + { + "id": 58, + "index": 32, + "char": ":", + "width": 9, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 10, + "chnl": 15, + "x": 108, + "y": 347, + "page": 0 + }, + { + "id": 97, + "index": 71, + "char": "a", + "width": 22, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 23, + "chnl": 15, + "x": 117, + "y": 376, + "page": 0 + }, + { + "id": 99, + "index": 73, + "char": "c", + "width": 21, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 21, + "chnl": 15, + "x": 118, + "y": 347, + "page": 0 + }, + { + "id": 101, + "index": 75, + "char": "e", + "width": 24, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 24, + "chnl": 15, + "x": 138, + "y": 307, + "page": 0 + }, + { + "id": 111, + "index": 85, + "char": "o", + "width": 27, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 140, + "y": 229, + "page": 0 + }, + { + "id": 115, + "index": 89, + "char": "s", + "width": 19, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 19, + "chnl": 15, + "x": 156, + "y": 190, + "page": 0 + }, + { + "id": 110, + "index": 84, + "char": "n", + "width": 23, + "height": 27, + "xoffset": 2, + "yoffset": 13, + "xadvance": 26, + "chnl": 15, + "x": 158, + "y": 148, + "page": 0 + }, + { + "id": 114, + "index": 88, + "char": "r", + "width": 16, + "height": 27, + "xoffset": 2, + "yoffset": 13, + "xadvance": 16, + "chnl": 15, + "x": 161, + "y": 111, + "page": 0 + }, + { + "id": 117, + "index": 91, + "char": "u", + "width": 23, + "height": 27, + "xoffset": 1, + "yoffset": 13, + "xadvance": 26, + "chnl": 15, + "x": 127, + "y": 405, + "page": 0 + }, + { + "id": 118, + "index": 92, + "char": "v", + "width": 26, + "height": 27, + "xoffset": -2, + "yoffset": 13, + "xadvance": 22, + "chnl": 15, + "x": 176, + "y": 65, + "page": 0 + }, + { + "id": 120, + "index": 94, + "char": "x", + "width": 24, + "height": 27, + "xoffset": -1, + "yoffset": 13, + "xadvance": 21, + "chnl": 15, + "x": 199, + "y": 35, + "page": 0 + }, + { + "id": 122, + "index": 96, + "char": "z", + "width": 23, + "height": 27, + "xoffset": -1, + "yoffset": 13, + "xadvance": 21, + "chnl": 15, + "x": 208, + "y": 0, + "page": 0 + }, + { + "id": 60, + "index": 34, + "char": "<", + "width": 23, + "height": 26, + "xoffset": 4, + "yoffset": 12, + "xadvance": 31, + "chnl": 15, + "x": 178, + "y": 93, + "page": 0 + }, + { + "id": 62, + "index": 36, + "char": ">", + "width": 23, + "height": 26, + "xoffset": 4, + "yoffset": 12, + "xadvance": 31, + "chnl": 15, + "x": 178, + "y": 120, + "page": 0 + }, + { + "id": 126, + "index": 100, + "char": "~", + "width": 26, + "height": 11, + "xoffset": 3, + "yoffset": 19, + "xadvance": 31, + "chnl": 15, + "x": 158, + "y": 176, + "page": 0 + }, + { + "id": 43, + "index": 17, + "char": "+", + "width": 25, + "height": 25, + "xoffset": 3, + "yoffset": 12, + "xadvance": 31, + "chnl": 15, + "x": 182, + "y": 147, + "page": 0 + }, + { + "id": 61, + "index": 35, + "char": "=", + "width": 25, + "height": 17, + "xoffset": 3, + "yoffset": 17, + "xadvance": 31, + "chnl": 15, + "x": 127, + "y": 433, + "page": 0 + }, + { + "id": 94, + "index": 68, + "char": "^", + "width": 25, + "height": 23, + "xoffset": 3, + "yoffset": 4, + "xadvance": 31, + "chnl": 15, + "x": 121, + "y": 488, + "page": 0 + }, + { + "id": 95, + "index": 69, + "char": "_", + "width": 23, + "height": 7, + "xoffset": -2, + "yoffset": 40, + "xadvance": 19, + "chnl": 15, + "x": 0, + "y": 505, + "page": 0 + }, + { + "id": 42, + "index": 16, + "char": "*", + "width": 20, + "height": 20, + "xoffset": 0, + "yoffset": 4, + "xadvance": 19, + "chnl": 15, + "x": 147, + "y": 488, + "page": 0 + }, + { + "id": 45, + "index": 19, + "char": "-", + "width": 16, + "height": 7, + "xoffset": 1, + "yoffset": 22, + "xadvance": 18, + "chnl": 15, + "x": 71, + "y": 155, + "page": 0 + }, + { + "id": 44, + "index": 18, + "char": ",", + "width": 10, + "height": 15, + "xoffset": -1, + "yoffset": 31, + "xadvance": 10, + "chnl": 15, + "x": 84, + "y": 276, + "page": 0 + }, + { + "id": 34, + "index": 8, + "char": "\"", + "width": 14, + "height": 14, + "xoffset": 2, + "yoffset": 4, + "xadvance": 18, + "chnl": 15, + "x": 36, + "y": 124, + "page": 0 + }, + { + "id": 39, + "index": 13, + "char": "'", + "width": 8, + "height": 14, + "xoffset": 1, + "yoffset": 4, + "xadvance": 11, + "chnl": 15, + "x": 66, + "y": 200, + "page": 0 + }, + { + "id": 96, + "index": 70, + "char": "`", + "width": 13, + "height": 11, + "xoffset": 0, + "yoffset": 2, + "xadvance": 12, + "chnl": 15, + "x": 52, + "y": 163, + "page": 0 + }, + { + "id": 46, + "index": 20, + "char": ".", + "width": 9, + "height": 9, + "xoffset": 0, + "yoffset": 31, + "xadvance": 10, + "chnl": 15, + "x": 156, + "y": 219, + "page": 0 + }, + { + "id": 32, + "index": 3, + "char": " ", + "width": 0, + "height": 0, + "xoffset": -2, + "yoffset": 36, + "xadvance": 12, + "chnl": 15, + "x": 26, + "y": 437, + "page": 0 + } + ], + "info": { + "face": "ya-hei-ascii", + "size": 42, + "bold": 0, + "italic": 0, + "charset": [ + " ", + "!", + "\"", + "#", + "$", + "%", + "&", + "'", + "(", + ")", + "*", + "+", + ",", + "-", + ".", + "/", + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + ":", + ";", + "<", + "=", + ">", + "?", + "@", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "[", + "\\", + "]", + "^", + "_", + "`", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "{", + "|", + "}", + "~", + "こ", + "ん", + "に", + "ち", + "は" + ], + "unicode": 1, + "stretchH": 100, + "smooth": 1, + "aa": 1, + "padding": [ + 2, + 2, + 2, + 2 + ], + "spacing": [ + 0, + 0 + ] + }, + "common": { + "lineHeight": 45, + "base": 36, + "scaleW": 512, + "scaleH": 512, + "pages": 1, + "packed": 0, + "alphaChnl": 0, + "redChnl": 0, + "greenChnl": 0, + "blueChnl": 0 + }, + "distanceField": { + "fieldType": "msdf", + "distanceRange": 4 + }, + "kernings": [ + { + "first": 34, + "second": 114, + "amount": -1 + }, + { + "first": 34, + "second": 115, + "amount": -1 + }, + { + "first": 39, + "second": 114, + "amount": -1 + }, + { + "first": 39, + "second": 115, + "amount": -1 + }, + { + "first": 40, + "second": 106, + "amount": 5 + }, + { + "first": 42, + "second": 65, + "amount": -4 + }, + { + "first": 42, + "second": 74, + "amount": -3 + }, + { + "first": 42, + "second": 99, + "amount": -2 + }, + { + "first": 42, + "second": 100, + "amount": -2 + }, + { + "first": 42, + "second": 101, + "amount": -2 + }, + { + "first": 42, + "second": 103, + "amount": -2 + }, + { + "first": 42, + "second": 111, + "amount": -2 + }, + { + "first": 42, + "second": 113, + "amount": -2 + }, + { + "first": 65, + "second": 42, + "amount": -3 + }, + { + "first": 65, + "second": 44, + "amount": 1 + }, + { + "first": 65, + "second": 59, + "amount": 1 + }, + { + "first": 65, + "second": 67, + "amount": -1 + }, + { + "first": 65, + "second": 71, + "amount": -1 + }, + { + "first": 65, + "second": 74, + "amount": 2 + }, + { + "first": 65, + "second": 79, + "amount": -1 + }, + { + "first": 65, + "second": 84, + "amount": -3 + }, + { + "first": 65, + "second": 85, + "amount": -1 + }, + { + "first": 65, + "second": 86, + "amount": -3 + }, + { + "first": 65, + "second": 87, + "amount": -2 + }, + { + "first": 65, + "second": 89, + "amount": -3 + }, + { + "first": 65, + "second": 90, + "amount": 1 + }, + { + "first": 65, + "second": 116, + "amount": -1 + }, + { + "first": 65, + "second": 118, + "amount": -1 + }, + { + "first": 65, + "second": 119, + "amount": -1 + }, + { + "first": 65, + "second": 121, + "amount": -1 + }, + { + "first": 66, + "second": 84, + "amount": -2 + }, + { + "first": 66, + "second": 89, + "amount": -1 + }, + { + "first": 67, + "second": 63, + "amount": 0 + }, + { + "first": 67, + "second": 67, + "amount": -1 + }, + { + "first": 67, + "second": 71, + "amount": -1 + }, + { + "first": 67, + "second": 79, + "amount": -1 + }, + { + "first": 67, + "second": 81, + "amount": -1 + }, + { + "first": 68, + "second": 44, + "amount": -3 + }, + { + "first": 68, + "second": 46, + "amount": -3 + }, + { + "first": 68, + "second": 65, + "amount": -1 + }, + { + "first": 68, + "second": 84, + "amount": -2 + }, + { + "first": 68, + "second": 88, + "amount": -1 + }, + { + "first": 68, + "second": 90, + "amount": -1 + }, + { + "first": 69, + "second": 65, + "amount": 0 + }, + { + "first": 69, + "second": 74, + "amount": 1 + }, + { + "first": 69, + "second": 84, + "amount": 0 + }, + { + "first": 69, + "second": 87, + "amount": 1 + }, + { + "first": 69, + "second": 88, + "amount": 0 + }, + { + "first": 70, + "second": 44, + "amount": -3 + }, + { + "first": 70, + "second": 46, + "amount": -3 + }, + { + "first": 70, + "second": 65, + "amount": -3 + }, + { + "first": 70, + "second": 74, + "amount": -1 + }, + { + "first": 70, + "second": 83, + "amount": -1 + }, + { + "first": 70, + "second": 84, + "amount": 0 + }, + { + "first": 70, + "second": 97, + "amount": -2 + }, + { + "first": 70, + "second": 102, + "amount": 0 + }, + { + "first": 71, + "second": 84, + "amount": -1 + }, + { + "first": 71, + "second": 86, + "amount": -1 + }, + { + "first": 71, + "second": 121, + "amount": -1 + }, + { + "first": 74, + "second": 44, + "amount": -2 + }, + { + "first": 74, + "second": 46, + "amount": -2 + }, + { + "first": 74, + "second": 65, + "amount": -1 + }, + { + "first": 74, + "second": 74, + "amount": -1 + }, + { + "first": 74, + "second": 97, + "amount": -1 + }, + { + "first": 75, + "second": 44, + "amount": 1 + }, + { + "first": 75, + "second": 59, + "amount": 1 + }, + { + "first": 75, + "second": 67, + "amount": -2 + }, + { + "first": 75, + "second": 71, + "amount": -2 + }, + { + "first": 75, + "second": 74, + "amount": 2 + }, + { + "first": 75, + "second": 79, + "amount": -2 + }, + { + "first": 75, + "second": 81, + "amount": -2 + }, + { + "first": 75, + "second": 88, + "amount": 1 + }, + { + "first": 75, + "second": 90, + "amount": 1 + }, + { + "first": 75, + "second": 99, + "amount": -1 + }, + { + "first": 75, + "second": 100, + "amount": -1 + }, + { + "first": 75, + "second": 101, + "amount": -1 + }, + { + "first": 75, + "second": 103, + "amount": -1 + }, + { + "first": 75, + "second": 111, + "amount": -1 + }, + { + "first": 75, + "second": 113, + "amount": -1 + }, + { + "first": 75, + "second": 116, + "amount": -1 + }, + { + "first": 75, + "second": 118, + "amount": -2 + }, + { + "first": 75, + "second": 119, + "amount": -1 + }, + { + "first": 75, + "second": 121, + "amount": -2 + }, + { + "first": 76, + "second": 42, + "amount": -5 + }, + { + "first": 76, + "second": 63, + "amount": -2 + }, + { + "first": 76, + "second": 65, + "amount": 1 + }, + { + "first": 76, + "second": 67, + "amount": -1 + }, + { + "first": 76, + "second": 71, + "amount": -1 + }, + { + "first": 76, + "second": 74, + "amount": 2 + }, + { + "first": 76, + "second": 79, + "amount": -2 + }, + { + "first": 76, + "second": 81, + "amount": -2 + }, + { + "first": 76, + "second": 84, + "amount": -3 + }, + { + "first": 76, + "second": 85, + "amount": -1 + }, + { + "first": 76, + "second": 86, + "amount": -3 + }, + { + "first": 76, + "second": 87, + "amount": -1 + }, + { + "first": 76, + "second": 89, + "amount": -3 + }, + { + "first": 76, + "second": 90, + "amount": 1 + }, + { + "first": 76, + "second": 116, + "amount": -1 + }, + { + "first": 76, + "second": 118, + "amount": -2 + }, + { + "first": 76, + "second": 119, + "amount": -1 + }, + { + "first": 76, + "second": 121, + "amount": -2 + }, + { + "first": 79, + "second": 44, + "amount": -2 + }, + { + "first": 79, + "second": 46, + "amount": -2 + }, + { + "first": 79, + "second": 65, + "amount": -1 + }, + { + "first": 79, + "second": 74, + "amount": 0 + }, + { + "first": 79, + "second": 84, + "amount": -2 + }, + { + "first": 79, + "second": 88, + "amount": -1 + }, + { + "first": 79, + "second": 89, + "amount": -1 + }, + { + "first": 79, + "second": 90, + "amount": -1 + }, + { + "first": 80, + "second": 44, + "amount": -7 + }, + { + "first": 80, + "second": 46, + "amount": -7 + }, + { + "first": 80, + "second": 65, + "amount": -4 + }, + { + "first": 80, + "second": 71, + "amount": 0 + }, + { + "first": 80, + "second": 74, + "amount": -3 + }, + { + "first": 80, + "second": 87, + "amount": 1 + }, + { + "first": 80, + "second": 88, + "amount": -1 + }, + { + "first": 80, + "second": 97, + "amount": -1 + }, + { + "first": 80, + "second": 99, + "amount": -2 + }, + { + "first": 80, + "second": 100, + "amount": -2 + }, + { + "first": 80, + "second": 101, + "amount": -2 + }, + { + "first": 80, + "second": 103, + "amount": -2 + }, + { + "first": 80, + "second": 111, + "amount": -2 + }, + { + "first": 80, + "second": 113, + "amount": -2 + }, + { + "first": 81, + "second": 44, + "amount": -2 + }, + { + "first": 81, + "second": 46, + "amount": -3 + }, + { + "first": 81, + "second": 65, + "amount": -1 + }, + { + "first": 81, + "second": 84, + "amount": -2 + }, + { + "first": 81, + "second": 88, + "amount": -1 + }, + { + "first": 81, + "second": 89, + "amount": 0 + }, + { + "first": 81, + "second": 90, + "amount": -1 + }, + { + "first": 82, + "second": 59, + "amount": 2 + }, + { + "first": 82, + "second": 67, + "amount": -1 + }, + { + "first": 82, + "second": 71, + "amount": -1 + }, + { + "first": 82, + "second": 74, + "amount": 1 + }, + { + "first": 82, + "second": 79, + "amount": 0 + }, + { + "first": 82, + "second": 81, + "amount": 0 + }, + { + "first": 82, + "second": 84, + "amount": -1 + }, + { + "first": 82, + "second": 89, + "amount": -1 + }, + { + "first": 82, + "second": 99, + "amount": -1 + }, + { + "first": 82, + "second": 100, + "amount": -1 + }, + { + "first": 82, + "second": 101, + "amount": -1 + }, + { + "first": 82, + "second": 103, + "amount": -1 + }, + { + "first": 82, + "second": 111, + "amount": -1 + }, + { + "first": 82, + "second": 113, + "amount": -1 + }, + { + "first": 83, + "second": 116, + "amount": -1 + }, + { + "first": 83, + "second": 118, + "amount": -1 + }, + { + "first": 83, + "second": 119, + "amount": -1 + }, + { + "first": 83, + "second": 121, + "amount": -1 + }, + { + "first": 84, + "second": 44, + "amount": -3 + }, + { + "first": 84, + "second": 46, + "amount": -4 + }, + { + "first": 84, + "second": 58, + "amount": -1 + }, + { + "first": 84, + "second": 59, + "amount": -1 + }, + { + "first": 84, + "second": 65, + "amount": -3 + }, + { + "first": 84, + "second": 67, + "amount": -2 + }, + { + "first": 84, + "second": 71, + "amount": -2 + }, + { + "first": 84, + "second": 74, + "amount": -3 + }, + { + "first": 84, + "second": 79, + "amount": -2 + }, + { + "first": 84, + "second": 81, + "amount": -2 + }, + { + "first": 84, + "second": 84, + "amount": 1 + }, + { + "first": 84, + "second": 86, + "amount": 1 + }, + { + "first": 84, + "second": 87, + "amount": 1 + }, + { + "first": 84, + "second": 88, + "amount": 0 + }, + { + "first": 84, + "second": 89, + "amount": 1 + }, + { + "first": 84, + "second": 97, + "amount": -5 + }, + { + "first": 84, + "second": 99, + "amount": -5 + }, + { + "first": 84, + "second": 100, + "amount": -5 + }, + { + "first": 84, + "second": 101, + "amount": -5 + }, + { + "first": 84, + "second": 102, + "amount": -2 + }, + { + "first": 84, + "second": 103, + "amount": -5 + }, + { + "first": 84, + "second": 109, + "amount": -4 + }, + { + "first": 84, + "second": 110, + "amount": -4 + }, + { + "first": 84, + "second": 111, + "amount": -5 + }, + { + "first": 84, + "second": 112, + "amount": -4 + }, + { + "first": 84, + "second": 113, + "amount": -5 + }, + { + "first": 84, + "second": 114, + "amount": -4 + }, + { + "first": 84, + "second": 115, + "amount": -3 + }, + { + "first": 84, + "second": 117, + "amount": -4 + }, + { + "first": 84, + "second": 118, + "amount": -2 + }, + { + "first": 84, + "second": 119, + "amount": -3 + }, + { + "first": 84, + "second": 120, + "amount": -4 + }, + { + "first": 84, + "second": 121, + "amount": -3 + }, + { + "first": 84, + "second": 122, + "amount": -3 + }, + { + "first": 85, + "second": 65, + "amount": -1 + }, + { + "first": 86, + "second": 44, + "amount": -5 + }, + { + "first": 86, + "second": 46, + "amount": -5 + }, + { + "first": 86, + "second": 65, + "amount": -3 + }, + { + "first": 86, + "second": 67, + "amount": -1 + }, + { + "first": 86, + "second": 71, + "amount": -1 + }, + { + "first": 86, + "second": 74, + "amount": -2 + }, + { + "first": 86, + "second": 79, + "amount": 0 + }, + { + "first": 86, + "second": 81, + "amount": -1 + }, + { + "first": 86, + "second": 83, + "amount": -1 + }, + { + "first": 86, + "second": 84, + "amount": 1 + }, + { + "first": 86, + "second": 97, + "amount": -3 + }, + { + "first": 86, + "second": 99, + "amount": -3 + }, + { + "first": 86, + "second": 100, + "amount": -3 + }, + { + "first": 86, + "second": 101, + "amount": -3 + }, + { + "first": 86, + "second": 103, + "amount": -3 + }, + { + "first": 86, + "second": 109, + "amount": -2 + }, + { + "first": 86, + "second": 110, + "amount": -2 + }, + { + "first": 86, + "second": 111, + "amount": -3 + }, + { + "first": 86, + "second": 112, + "amount": -2 + }, + { + "first": 86, + "second": 113, + "amount": -3 + }, + { + "first": 86, + "second": 114, + "amount": -2 + }, + { + "first": 86, + "second": 115, + "amount": -1 + }, + { + "first": 86, + "second": 117, + "amount": -2 + }, + { + "first": 87, + "second": 44, + "amount": -3 + }, + { + "first": 87, + "second": 46, + "amount": -3 + }, + { + "first": 87, + "second": 65, + "amount": -2 + }, + { + "first": 87, + "second": 84, + "amount": 1 + }, + { + "first": 87, + "second": 97, + "amount": -2 + }, + { + "first": 87, + "second": 99, + "amount": -1 + }, + { + "first": 87, + "second": 100, + "amount": -1 + }, + { + "first": 87, + "second": 101, + "amount": -1 + }, + { + "first": 87, + "second": 103, + "amount": -1 + }, + { + "first": 87, + "second": 111, + "amount": -1 + }, + { + "first": 87, + "second": 113, + "amount": -1 + }, + { + "first": 88, + "second": 44, + "amount": 1 + }, + { + "first": 88, + "second": 46, + "amount": 1 + }, + { + "first": 88, + "second": 59, + "amount": 2 + }, + { + "first": 88, + "second": 67, + "amount": -1 + }, + { + "first": 88, + "second": 71, + "amount": -1 + }, + { + "first": 88, + "second": 74, + "amount": 2 + }, + { + "first": 88, + "second": 79, + "amount": -1 + }, + { + "first": 88, + "second": 81, + "amount": -1 + }, + { + "first": 88, + "second": 84, + "amount": 1 + }, + { + "first": 89, + "second": 44, + "amount": -4 + }, + { + "first": 89, + "second": 46, + "amount": -4 + }, + { + "first": 89, + "second": 65, + "amount": -4 + }, + { + "first": 89, + "second": 67, + "amount": -1 + }, + { + "first": 89, + "second": 71, + "amount": -1 + }, + { + "first": 89, + "second": 74, + "amount": -1 + }, + { + "first": 89, + "second": 79, + "amount": -1 + }, + { + "first": 89, + "second": 81, + "amount": -1 + }, + { + "first": 89, + "second": 83, + "amount": -1 + }, + { + "first": 89, + "second": 84, + "amount": 1 + }, + { + "first": 89, + "second": 97, + "amount": -4 + }, + { + "first": 89, + "second": 99, + "amount": -4 + }, + { + "first": 89, + "second": 100, + "amount": -4 + }, + { + "first": 89, + "second": 101, + "amount": -4 + }, + { + "first": 89, + "second": 102, + "amount": -1 + }, + { + "first": 89, + "second": 103, + "amount": -4 + }, + { + "first": 89, + "second": 109, + "amount": -3 + }, + { + "first": 89, + "second": 110, + "amount": -3 + }, + { + "first": 89, + "second": 111, + "amount": -4 + }, + { + "first": 89, + "second": 112, + "amount": -3 + }, + { + "first": 89, + "second": 113, + "amount": -4 + }, + { + "first": 89, + "second": 114, + "amount": -3 + }, + { + "first": 89, + "second": 115, + "amount": -3 + }, + { + "first": 89, + "second": 117, + "amount": -3 + }, + { + "first": 90, + "second": 74, + "amount": 2 + }, + { + "first": 90, + "second": 84, + "amount": 1 + }, + { + "first": 90, + "second": 121, + "amount": -1 + }, + { + "first": 91, + "second": 106, + "amount": 5 + }, + { + "first": 98, + "second": 97, + "amount": -1 + }, + { + "first": 98, + "second": 102, + "amount": 0 + }, + { + "first": 98, + "second": 120, + "amount": -1 + }, + { + "first": 99, + "second": 74, + "amount": 2 + }, + { + "first": 99, + "second": 84, + "amount": -2 + }, + { + "first": 99, + "second": 89, + "amount": -2 + }, + { + "first": 101, + "second": 34, + "amount": -2 + }, + { + "first": 101, + "second": 39, + "amount": -2 + }, + { + "first": 102, + "second": 41, + "amount": 3 + }, + { + "first": 102, + "second": 44, + "amount": -3 + }, + { + "first": 102, + "second": 45, + "amount": -2 + }, + { + "first": 102, + "second": 46, + "amount": -3 + }, + { + "first": 102, + "second": 58, + "amount": 2 + }, + { + "first": 102, + "second": 59, + "amount": 2 + }, + { + "first": 102, + "second": 63, + "amount": 1 + }, + { + "first": 102, + "second": 93, + "amount": 3 + }, + { + "first": 102, + "second": 98, + "amount": 0 + }, + { + "first": 102, + "second": 104, + "amount": 0 + }, + { + "first": 102, + "second": 116, + "amount": 1 + }, + { + "first": 102, + "second": 118, + "amount": 1 + }, + { + "first": 102, + "second": 119, + "amount": 1 + }, + { + "first": 102, + "second": 120, + "amount": 0 + }, + { + "first": 102, + "second": 121, + "amount": 1 + }, + { + "first": 102, + "second": 125, + "amount": 2 + }, + { + "first": 103, + "second": 106, + "amount": 1 + }, + { + "first": 106, + "second": 106, + "amount": 1 + }, + { + "first": 107, + "second": 44, + "amount": 2 + }, + { + "first": 107, + "second": 45, + "amount": -3 + }, + { + "first": 107, + "second": 46, + "amount": 2 + }, + { + "first": 107, + "second": 58, + "amount": 2 + }, + { + "first": 107, + "second": 59, + "amount": 2 + }, + { + "first": 107, + "second": 99, + "amount": -1 + }, + { + "first": 107, + "second": 100, + "amount": -1 + }, + { + "first": 107, + "second": 101, + "amount": -1 + }, + { + "first": 107, + "second": 103, + "amount": -1 + }, + { + "first": 107, + "second": 111, + "amount": -1 + }, + { + "first": 107, + "second": 113, + "amount": -1 + }, + { + "first": 107, + "second": 116, + "amount": 0 + }, + { + "first": 110, + "second": 34, + "amount": -2 + }, + { + "first": 110, + "second": 39, + "amount": -2 + }, + { + "first": 111, + "second": 34, + "amount": -3 + }, + { + "first": 111, + "second": 39, + "amount": -3 + }, + { + "first": 111, + "second": 97, + "amount": -1 + }, + { + "first": 111, + "second": 102, + "amount": -1 + }, + { + "first": 111, + "second": 120, + "amount": -1 + }, + { + "first": 112, + "second": 97, + "amount": -1 + }, + { + "first": 112, + "second": 102, + "amount": -1 + }, + { + "first": 112, + "second": 120, + "amount": -1 + }, + { + "first": 113, + "second": 106, + "amount": 2 + }, + { + "first": 114, + "second": 44, + "amount": -4 + }, + { + "first": 114, + "second": 45, + "amount": -3 + }, + { + "first": 114, + "second": 46, + "amount": -4 + }, + { + "first": 114, + "second": 58, + "amount": 2 + }, + { + "first": 114, + "second": 59, + "amount": 2 + }, + { + "first": 114, + "second": 99, + "amount": -1 + }, + { + "first": 114, + "second": 100, + "amount": -1 + }, + { + "first": 114, + "second": 101, + "amount": -1 + }, + { + "first": 114, + "second": 102, + "amount": 1 + }, + { + "first": 114, + "second": 103, + "amount": -1 + }, + { + "first": 114, + "second": 109, + "amount": 0 + }, + { + "first": 114, + "second": 110, + "amount": 0 + }, + { + "first": 114, + "second": 111, + "amount": -1 + }, + { + "first": 114, + "second": 113, + "amount": -1 + }, + { + "first": 114, + "second": 115, + "amount": 0 + }, + { + "first": 114, + "second": 116, + "amount": 1 + }, + { + "first": 114, + "second": 118, + "amount": 2 + }, + { + "first": 114, + "second": 119, + "amount": 2 + }, + { + "first": 114, + "second": 120, + "amount": 1 + }, + { + "first": 114, + "second": 121, + "amount": 2 + }, + { + "first": 114, + "second": 122, + "amount": 1 + }, + { + "first": 116, + "second": 45, + "amount": -3 + }, + { + "first": 116, + "second": 63, + "amount": -1 + }, + { + "first": 116, + "second": 99, + "amount": -1 + }, + { + "first": 116, + "second": 100, + "amount": -1 + }, + { + "first": 116, + "second": 101, + "amount": 0 + }, + { + "first": 116, + "second": 103, + "amount": 0 + }, + { + "first": 116, + "second": 111, + "amount": 0 + }, + { + "first": 116, + "second": 113, + "amount": 0 + }, + { + "first": 116, + "second": 120, + "amount": 1 + }, + { + "first": 117, + "second": 34, + "amount": -1 + }, + { + "first": 117, + "second": 39, + "amount": -1 + }, + { + "first": 118, + "second": 44, + "amount": -3 + }, + { + "first": 118, + "second": 46, + "amount": -3 + }, + { + "first": 118, + "second": 97, + "amount": -1 + }, + { + "first": 118, + "second": 99, + "amount": 0 + }, + { + "first": 118, + "second": 100, + "amount": 0 + }, + { + "first": 118, + "second": 101, + "amount": 0 + }, + { + "first": 118, + "second": 103, + "amount": 0 + }, + { + "first": 118, + "second": 111, + "amount": 0 + }, + { + "first": 118, + "second": 113, + "amount": 0 + }, + { + "first": 119, + "second": 44, + "amount": -2 + }, + { + "first": 119, + "second": 46, + "amount": -2 + }, + { + "first": 119, + "second": 99, + "amount": 0 + }, + { + "first": 119, + "second": 100, + "amount": 0 + }, + { + "first": 119, + "second": 101, + "amount": 0 + }, + { + "first": 119, + "second": 103, + "amount": 0 + }, + { + "first": 119, + "second": 111, + "amount": 0 + }, + { + "first": 119, + "second": 113, + "amount": 0 + }, + { + "first": 120, + "second": 99, + "amount": 0 + }, + { + "first": 120, + "second": 100, + "amount": 0 + }, + { + "first": 120, + "second": 101, + "amount": 0 + }, + { + "first": 120, + "second": 103, + "amount": 0 + }, + { + "first": 120, + "second": 111, + "amount": 0 + }, + { + "first": 120, + "second": 113, + "amount": 0 + }, + { + "first": 121, + "second": 34, + "amount": 1 + }, + { + "first": 121, + "second": 39, + "amount": 1 + }, + { + "first": 121, + "second": 44, + "amount": -2 + }, + { + "first": 121, + "second": 46, + "amount": -3 + }, + { + "first": 121, + "second": 63, + "amount": -2 + }, + { + "first": 121, + "second": 99, + "amount": 0 + }, + { + "first": 121, + "second": 100, + "amount": 0 + }, + { + "first": 121, + "second": 101, + "amount": 0 + }, + { + "first": 121, + "second": 102, + "amount": 0 + }, + { + "first": 121, + "second": 103, + "amount": 0 + }, + { + "first": 121, + "second": 111, + "amount": 0 + }, + { + "first": 121, + "second": 113, + "amount": 0 + }, + { + "first": 121, + "second": 116, + "amount": 0 + }, + { + "first": 123, + "second": 106, + "amount": 4 + } + ] +} \ No newline at end of file diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/font/ya-hei-ascii.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/font/ya-hei-ascii.png new file mode 100644 index 00000000..a23980bb Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/font/ya-hei-ascii.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/gltf/whale.glb b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/gltf/whale.glb new file mode 100644 index 00000000..4d361020 Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/gltf/whale.glb differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/Di-3d.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/Di-3d.png new file mode 100644 index 00000000..ebbff45e Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/Di-3d.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/brickwall_albedo.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/brickwall_albedo.png new file mode 100644 index 00000000..35835088 Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/brickwall_albedo.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/brickwall_height.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/brickwall_height.png new file mode 100644 index 00000000..48ab26fa Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/brickwall_height.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/brickwall_normal.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/brickwall_normal.png new file mode 100644 index 00000000..aa6643de Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/brickwall_normal.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/negx.jpg b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/negx.jpg new file mode 100644 index 00000000..992fde51 Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/negx.jpg differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/negy.jpg b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/negy.jpg new file mode 100644 index 00000000..a51a38dc Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/negy.jpg differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/negz.jpg b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/negz.jpg new file mode 100644 index 00000000..c463f0d5 Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/negz.jpg differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/posx.jpg b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/posx.jpg new file mode 100644 index 00000000..106d3a68 Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/posx.jpg differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/posy.jpg b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/posy.jpg new file mode 100644 index 00000000..1ea42cd2 Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/posy.jpg differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/posz.jpg b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/posz.jpg new file mode 100644 index 00000000..69463d06 Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/posz.jpg differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/readme.txt b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/readme.txt new file mode 100644 index 00000000..0ce9e3d2 --- /dev/null +++ b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/cubemap/readme.txt @@ -0,0 +1,20 @@ +Author +====== + +This is the work of Emil Persson, aka Humus. +http://www.humus.name +humus@comhem.se + + + +Legal stuff +=========== + +This work is free and may be used by anyone for any purpose +and may be distributed freely to anyone using any distribution +media or distribution method as long as this file is included. +Distribution without this file is allowed if it's distributed +with free non-commercial software; however, fair credit of the +original author is expected. +Any commercial distribution of this software requires the written +approval of Emil Persson. diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/moon.jpg b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/moon.jpg new file mode 100644 index 00000000..daec570b Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/moon.jpg differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/saturn.jpg b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/saturn.jpg new file mode 100644 index 00000000..d8b23dfe Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/saturn.jpg differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/spiral_height.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/spiral_height.png new file mode 100644 index 00000000..1f1680ff Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/spiral_height.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/spiral_normal.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/spiral_normal.png new file mode 100644 index 00000000..5cba15cf Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/spiral_normal.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/toybox_height.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/toybox_height.png new file mode 100644 index 00000000..35510d73 Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/toybox_height.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/toybox_normal.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/toybox_normal.png new file mode 100644 index 00000000..634728fb Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/toybox_normal.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/webgpu.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/webgpu.png new file mode 100644 index 00000000..a44b73ea Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/webgpu.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/wood_albedo.png b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/wood_albedo.png new file mode 100644 index 00000000..e28e2aee Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/img/wood_albedo.png differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/video/pano.webm b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/video/pano.webm new file mode 100644 index 00000000..62aa3085 Binary files /dev/null and b/bindings/wgpu/examples/web-js/src/jsMain/resources/assets/video/pano.webm differ diff --git a/bindings/wgpu/examples/web-js/src/jsMain/resources/index.html b/bindings/wgpu/examples/web-js/src/jsMain/resources/index.html new file mode 100644 index 00000000..39671cbe --- /dev/null +++ b/bindings/wgpu/examples/web-js/src/jsMain/resources/index.html @@ -0,0 +1,31 @@ + + + + + WebGPU Kotlin Example + + + + + + + + + + \ No newline at end of file diff --git a/bindings/wgpu/gradle.properties b/bindings/wgpu/gradle.properties new file mode 100644 index 00000000..473892af --- /dev/null +++ b/bindings/wgpu/gradle.properties @@ -0,0 +1,4 @@ +# Enable to use panama class on klang gradle plugin +org.gradle.jvmargs=--enable-preview +org.gradle.daemon=false +klangIsEnabled=false \ No newline at end of file diff --git a/bindings/wgpu/gradle/libs.versions.toml b/bindings/wgpu/gradle/libs.versions.toml new file mode 100644 index 00000000..8451ba72 --- /dev/null +++ b/bindings/wgpu/gradle/libs.versions.toml @@ -0,0 +1,28 @@ +[versions] +kotest = "5.7.2" +klang = "0.0.0" +jna = "5.13.0" +kotlin = "1.9.23" +wgpu = "v0.19.3.1" +compose = "1.6.0" +coroutines = "1.6.0" + + +[libraries] +kotest-core = { module = "io.kotest:kotest-framework-engine", version.ref = "kotest" } +kotest-assertions = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" } +jna = { module = "net.java.dev.jna:jna", version.ref = "jna" } +jnaPlatform = { module = "net.java.dev.jna:jna-platform", version.ref = "jna" } +coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } + +[plugins] +klang = { id = "io.ygdrasil.klang-plugin", version.ref = "klang" } +kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +kotlinJvm = { id = "org.jetbrains.kotlin.jvm" } +compose = { id = "org.jetbrains.compose", version.ref = "compose" } +kotest = { id = "io.kotest.multiplatform", version.ref = "kotest" } + + + +[bundles] +kotest = ["kotest-core", "kotest-assertions"] \ No newline at end of file diff --git a/bindings/wgpu/gradle/wrapper/gradle-wrapper.properties b/bindings/wgpu/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..a80b22ce --- /dev/null +++ b/bindings/wgpu/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/bindings/wgpu/gradlew b/bindings/wgpu/gradlew new file mode 100755 index 00000000..1aa94a42 --- /dev/null +++ b/bindings/wgpu/gradlew @@ -0,0 +1,249 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/bindings/wgpu/gradlew.bat b/bindings/wgpu/gradlew.bat new file mode 100644 index 00000000..93e3f59f --- /dev/null +++ b/bindings/wgpu/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/bindings/wgpu/librococoa/build.gradle.kts b/bindings/wgpu/librococoa/build.gradle.kts new file mode 100644 index 00000000..5b3d70be --- /dev/null +++ b/bindings/wgpu/librococoa/build.gradle.kts @@ -0,0 +1,52 @@ +import java.net.URI +import java.nio.file.Files +import java.nio.file.Paths + +plugins { + kotlin("jvm") +} + +repositories { + maven { + url = uri("http://repo.maven.cyberduck.io.s3.amazonaws.com/releases") + isAllowInsecureProtocol = true + } +} + +dependencies { + api("org.rococoa:rococoa-core:0.9.1") + implementation(libs.jna) + implementation(libs.jnaPlatform) + implementation("org.apache.logging.log4j:log4j-api:2.20.0") + implementation("org.apache.logging.log4j:log4j-core:2.20.0") + implementation("org.apache.logging.log4j:log4j-slf4j-impl:2.20.0") +} + + +abstract class DownloadTask : DefaultTask() { + @TaskAction + fun run() { + val remoteLibrary = + URI("http://repo.maven.cyberduck.io.s3.amazonaws.com/releases/org/rococoa/librococoa/0.9.1/librococoa-0.9.1.dylib") + val url = remoteLibrary.toURL() + + val path = project.projectDir + .resolve("src").resolve("main").resolve("resources").resolve("darwin") + .also { it.mkdirs() } + .resolve("librococoa.dylib") + + if (path.exists().not()) { + url.openStream().use { input -> + Files.copy(input, Paths.get(path.absolutePath)) + } + } + } +} + + +val copyFileFromDependencyTask = tasks.register("copyFileFromUrl") + + +tasks.named("processResources") { + dependsOn(copyFileFromDependencyTask) +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/AlertSheetReturnCodeMapper.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/AlertSheetReturnCodeMapper.kt new file mode 100644 index 00000000..94d7a487 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/AlertSheetReturnCodeMapper.kt @@ -0,0 +1,32 @@ +package darwin + +import org.apache.logging.log4j.LogManager + +class AlertSheetReturnCodeMapper { + /** + * Translate return codes from sheet selection + * + * @param sender Button pressed + * @return Sheet callback constant + * @see SheetCallback.DEFAULT_OPTION + * + * @see SheetCallback.CANCEL_OPTION + */ + fun getOption(sender: darwin.NSButton?): Int { + return this.getOption(sender?.tag() ?: 0) + } + + fun getOption(option: Int): Int { + when (option) { + darwin.NSAlert.Companion.NSAlertFirstButtonReturn, darwin.NSPanel.Companion.NSOKButton -> return darwin.SheetCallback.Companion.DEFAULT_OPTION + darwin.NSAlert.Companion.NSAlertSecondButtonReturn, darwin.NSPanel.Companion.NSCancelButton -> return darwin.SheetCallback.Companion.CANCEL_OPTION + darwin.NSAlert.Companion.NSAlertThirdButtonReturn -> return darwin.SheetCallback.Companion.ALTERNATE_OPTION + } + darwin.AlertSheetReturnCodeMapper.Companion.log.warn(String.format("Unknown return code %d", option)) + return darwin.SheetCallback.Companion.DEFAULT_OPTION + } + + companion object { + private val log = LogManager.getLogger(darwin.AlertSheetReturnCodeMapper::class.java) + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/AppKitFunctions.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/AppKitFunctions.kt new file mode 100644 index 00000000..643abee0 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/AppKitFunctions.kt @@ -0,0 +1,16 @@ +package darwin + +import com.sun.jna.Library +import com.sun.jna.Native + +interface AppKitFunctions : Library { + /** + * Original signature : `void NSBeep()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/AppKitDefines.h:194* + */ + open fun NSBeep() + + companion object { + val instance: AppKitFunctions = Native.load("AppKit", AppKitFunctions::class.java) + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/AppKitFunctionsLibrary.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/AppKitFunctionsLibrary.kt new file mode 100644 index 00000000..e315acb3 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/AppKitFunctionsLibrary.kt @@ -0,0 +1,8 @@ +package darwin + +object AppKitFunctionsLibrary { + fun beep() { + AppKitFunctions.instance.NSBeep() + } +} + diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/CALayer.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CALayer.kt new file mode 100644 index 00000000..a49272e1 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CALayer.kt @@ -0,0 +1,22 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.Rococoa + +abstract class CALayer : NSObject() { + + abstract fun init(): CALayer + + interface _Class : ObjCClass { + fun alloc(): CALayer + } + + companion object { + private val CLASS: CALayer._Class = Rococoa.createClass("CALayer", CALayer._Class::class.java) + + fun create(): CALayer { + return CLASS.alloc().init() + } + + } +} \ No newline at end of file diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/CAMetalLayer.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CAMetalLayer.kt new file mode 100644 index 00000000..86230f73 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CAMetalLayer.kt @@ -0,0 +1,20 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.Rococoa + +abstract class CAMetalLayer : CALayer() { + + interface _Class : ObjCClass { + fun layer(): CAMetalLayer + } + + companion object { + private val CLASS: CAMetalLayer._Class = Rococoa.createClass("CAMetalLayer", CAMetalLayer._Class::class.java) + + fun layer(): CAMetalLayer { + return CLASS.layer() + } + + } +} \ No newline at end of file diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFAllocatorRef.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFAllocatorRef.kt new file mode 100644 index 00000000..f0c1eeae --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFAllocatorRef.kt @@ -0,0 +1,5 @@ +package darwin + +import com.sun.jna.ptr.PointerByReference + +class CFAllocatorRef : PointerByReference() \ No newline at end of file diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFArrayRef.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFArrayRef.kt new file mode 100644 index 00000000..983cf069 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFArrayRef.kt @@ -0,0 +1,5 @@ +package darwin + +import com.sun.jna.ptr.PointerByReference + +class CFArrayRef : PointerByReference() \ No newline at end of file diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFIndex.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFIndex.kt new file mode 100644 index 00000000..cc4bb842 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFIndex.kt @@ -0,0 +1,23 @@ +package darwin + +import com.sun.jna.NativeLong + +class CFIndex : NativeLong() { + + companion object { + fun valueOf(i: Int): CFIndex? { + val idx: CFIndex = CFIndex() + idx.setValue(i.toLong()) + return idx + } + } + + + override fun toByte(): Byte { + TODO("Not yet implemented") + } + + override fun toShort(): Short { + TODO("Not yet implemented") + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFRunLoopRef.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFRunLoopRef.kt new file mode 100644 index 00000000..4c268c24 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFRunLoopRef.kt @@ -0,0 +1,5 @@ +package darwin + +import com.sun.jna.ptr.PointerByReference + +class CFRunLoopRef : PointerByReference() \ No newline at end of file diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFStringRef.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFStringRef.kt new file mode 100644 index 00000000..06852a3a --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/CFStringRef.kt @@ -0,0 +1,11 @@ +package darwin + +import com.sun.jna.platform.mac.CoreFoundation + +object CFStringRef : CoreFoundation.CFTypeRef() { + fun toCFString(s: String?): CFStringRef? { + val chars: CharArray = s?.toCharArray() ?: CharArray(0) + val length = chars.size + return FoundationKitFunctions.library.CFStringCreateWithCharacters(null, chars, CFIndex.valueOf(length)) + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/FoundationKitFunctions.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/FoundationKitFunctions.kt new file mode 100644 index 00000000..4a21d0fa --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/FoundationKitFunctions.kt @@ -0,0 +1,328 @@ +package darwin + +import com.sun.jna.Library +import com.sun.jna.Native +import com.sun.jna.platform.mac.CoreFoundation +import org.rococoa.cocoa.foundation.NSPoint +import org.rococoa.cocoa.foundation.NSRect +import org.rococoa.cocoa.foundation.NSSize +import org.rococoa.internal.RococoaTypeMapper +import java.util.* + +interface FoundationKitFunctions : Library { + /** + * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:36*

+ * enum values + */ + interface CGRectEdge { + companion object { + const val CGRectMinXEdge: Int = 0 + const val CGRectMinYEdge: Int = 1 + const val CGRectMaxXEdge: Int = 2 + const val CGRectMaxYEdge: Int = 3 + } + } + + /** + * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h*

+ * enum values + */ + interface NSRectEdge { + companion object { + const val NSMinXEdge: Int = 0 + const val NSMinYEdge: Int = 1 + const val NSMaxXEdge: Int = 2 + const val NSMaxYEdge: Int = 3 + } + } + + /** + * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h*

+ * enum values + */ + interface NSSearchPathDirectory { + companion object { + /// supported applications (Applications) + const val NSApplicationDirectory: Int = 1 + + /// unsupported applications, demonstration versions (Demos) + const val NSDemoApplicationDirectory: Int = 2 + + /// developer applications (Developer/Applications). DEPRECATED - there is no one single Developer directory. + const val NSDeveloperApplicationDirectory: Int = 3 + + /// system and network administration applications (Administration) + const val NSAdminApplicationDirectory: Int = 4 + + /// various user-visible documentation, support, and configuration files, resources (Library) + const val NSLibraryDirectory: Int = 5 + + /// developer resources (Developer) DEPRECATED - there is no one single Developer directory. + const val NSDeveloperDirectory: Int = 6 + + /// user home directories (Users) + const val NSUserDirectory: Int = 7 + + /// documentation (Documentation) + const val NSDocumentationDirectory: Int = 8 + + /// documents (Documents) + const val NSDocumentDirectory: Int = 9 + + /// location of CoreServices directory (System/Library/CoreServices) + const val NSCoreServiceDirectory: Int = 10 + + /// location of autosaved documents (Documents/Autosaved) + const val NSAutosavedInformationDirectory: Int = 11 + + /// location of user's desktop + const val NSDesktopDirectory: Int = 12 + + /// location of discardable cache files (Library/Caches) + const val NSCachesDirectory: Int = 13 + + /// location of application support files (plug-ins, etc) (Library/Application Support) + const val NSApplicationSupportDirectory: Int = 14 + + /// location of the user's "Downloads" directory + const val NSDownloadsDirectory: Int = 15 + + /// input methods (Library/Input Methods) + const val NSInputMethodsDirectory: Int = 16 + + /// location of user's Movies directory (~/Movies) + const val NSMoviesDirectory: Int = 17 + + /// location of user's Music directory (~/Music) + const val NSMusicDirectory: Int = 18 + + /// location of user's Pictures directory (~/Pictures) + const val NSPicturesDirectory: Int = 19 + + /// location of system's PPDs directory (Library/Printers/PPDs) + const val NSPrinterDescriptionDirectory: Int = 20 + + /// location of user's Public sharing directory (~/Public) + const val NSSharedPublicDirectory: Int = 21 + + /// location of the PreferencePanes directory for use with System Preferences (Library/PreferencePanes) + const val NSPreferencePanesDirectory: Int = 22 + + /// For use with NSFileManager's URLForDirectory:inDomain:appropriateForURL:create:error: + const val NSItemReplacementDirectory: Int = 99 + + /// all directories where applications can occur + const val NSAllApplicationsDirectory: Int = 100 + + /// all directories where resources can occur + const val NSAllLibrariesDirectory: Int = 101 + } + } + + /** + * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h*

+ * enum values + */ + interface NSSearchPathDomainMask { + companion object { + /// user's home directory --- place to install user's personal items (~) + const val NSUserDomainMask: Int = 1 + + /// local to the current machine --- place to install items available to everyone on this machine (/Library) + const val NSLocalDomainMask: Int = 2 + + /// publically available location in the local area network --- place to install items available on the network (/Network) + const val NSNetworkDomainMask: Int = 4 + + /// provided by Apple, unmodifiable (/System) + const val NSSystemDomainMask: Int = 8 + + /// all domains: all of the above and future items + const val NSAllDomainsMask: Int = 65535 + } + } + + /** + * Original signature : `BOOL NSEqualPoints(NSPoint, NSPoint)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:447* + */ + open fun NSEqualPoints(aPoint: NSPoint?, bPoint: NSPoint?): Boolean + + /** + * Original signature : `BOOL NSEqualSizes(NSSize, NSSize)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:448* + */ + open fun NSEqualSizes(aSize: NSSize?, bSize: NSSize?): Boolean + + /** + * Original signature : `BOOL NSEqualRects(NSRect, NSRect)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:449* + */ + open fun NSEqualRects(aRect: NSRect?, bRect: NSRect?): Boolean + + /** + * Original signature : `BOOL NSIsEmptyRect(NSRect)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:450* + */ + open fun NSIsEmptyRect(aRect: NSRect?): Boolean + + /** + * Original signature : `NSRect NSInsetRect(NSRect, CGFloat, CGFloat)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:452* + */ + open fun NSInsetRect(aRect: NSRect?, dX: org.rococoa.cocoa.CGFloat?, dY: org.rococoa.cocoa.CGFloat?): NSRect? + + /** + * Original signature : `NSRect NSIntegralRect(NSRect)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:453* + */ + open fun NSIntegralRect(aRect: NSRect?): NSRect? + + /** + * Original signature : `NSRect NSUnionRect(NSRect, NSRect)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:454* + */ + open fun NSUnionRect(aRect: NSRect?, bRect: NSRect?): NSRect? + + /** + * Original signature : `NSRect NSIntersectionRect(NSRect, NSRect)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:455* + */ + open fun NSIntersectionRect(aRect: NSRect?, bRect: NSRect?): NSRect? + + /** + * Original signature : `NSRect NSOffsetRect(NSRect, CGFloat, CGFloat)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:456* + */ + open fun NSOffsetRect(aRect: NSRect?, dX: org.rococoa.cocoa.CGFloat?, dY: org.rococoa.cocoa.CGFloat?): NSRect? + + /** + * Original signature : `void NSDivideRect(NSRect, NSRect*, NSRect*, CGFloat, NSRectEdge)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:457*

+ * + * @param edge @see NSRectEdge + */ + open fun NSDivideRect(inRect: NSRect?, slice: NSRect?, rem: NSRect?, amount: org.rococoa.cocoa.CGFloat?, edge: Int) + + /** + * Original signature : `BOOL NSPointInRect(NSPoint, NSRect)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:458* + */ + open fun NSPointInRect(aPoint: NSPoint?, aRect: NSRect?): Boolean + + /** + * Original signature : `BOOL NSMouseInRect(NSPoint, NSRect, BOOL)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:459* + */ + open fun NSMouseInRect(aPoint: NSPoint?, aRect: NSRect?, flipped: Boolean): Boolean + + /** + * Original signature : `BOOL NSContainsRect(NSRect, NSRect)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:460* + */ + open fun NSContainsRect(aRect: NSRect?, bRect: NSRect?): Boolean + + /** + * Original signature : `BOOL NSIntersectsRect(NSRect, NSRect)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:461* + */ + open fun NSIntersectsRect(aRect: NSRect?, bRect: NSRect?): Boolean + + /** + * Original signature : `NSString* NSStringFromPoint(NSPoint)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:463* + */ + open fun NSStringFromPoint(aPoint: NSPoint?): String? + + /** + * Original signature : `NSString* NSStringFromSize(NSSize)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:464* + */ + open fun NSStringFromSize(aSize: NSSize?): String? + + /** + * Original signature : `NSString* NSStringFromRect(NSRect)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:465* + */ + open fun NSStringFromRect(aRect: NSRect?): String? + + /** + * Original signature : `NSPoint NSPointFromString(NSString*)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:466* + */ + open fun NSPointFromString(aString: String?): NSPoint? + + /** + * Original signature : `NSSize NSSizeFromString(NSString*)`

+ * *native declaration : /System/Library/Frameworks/ApplicationServices.framework/Headers/../Frameworks/framework/Headers/CGGeometry.h:467* + */ + open fun NSSizeFromString(aString: String?): NSSize? + + /** + * Original signature : `NSString* NSUserName()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:46* + */ + open fun NSUserName(): String? + + /** + * Original signature : `NSString* NSFullUserName()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:47* + */ + open fun NSFullUserName(): String? + + /** + * Original signature : `NSString* NSHomeDirectory()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:49* + */ + open fun NSHomeDirectory(): String? + + /** + * Original signature : `NSString* NSHomeDirectoryForUser(String*)`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:50* + */ + open fun NSHomeDirectoryForUser(userName: String?): String? + + /** + * Original signature : `NSString* NSTemporaryDirectory()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:52* + */ + open fun NSTemporaryDirectory(): String? + + /** + * Original signature : `NSArray* NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory, + * NSSearchPathDomainMask, BOOL)`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:106*

+ * + * @param directory @see NSSearchPathDirectory

+ * @param domainMask @see NSSearchPathDomainMask + */ + open fun NSSearchPathForDirectoriesInDomains(directory: Int, domainMask: Int, expandTilde: Boolean): NSArray? + + /** + * Logs an error message to the Apple System Log facility. + * + * @param format Statement + */ + open fun NSLog(format: String?, vararg args: String?) + + open fun CFStringCreateWithCharacters(allocator: CFAllocatorRef?, chars: CharArray?, index: CFIndex?): CFStringRef? + + /** + * Releases a Core Foundation object. If the retain count of cf becomes zero the memory allocated to the object is + * deallocated and the object is destroyed. If you create, copy, or explicitly retain (see the CFRetain function) a + * Core Foundation object, you are responsible for releasing it when you no longer need it (see Memory Management + * Programming Guide for Core Foundation). + * + * @param ref A CFType object to release. This value must not be NULL. + */ + open fun CFRelease(ref: CoreFoundation.CFTypeRef?) + + companion object { + val library: FoundationKitFunctions = Native.load( + "Foundation", + FoundationKitFunctions::class.java, + Collections.singletonMap(Library.OPTION_TYPE_MAPPER, RococoaTypeMapper()) + ) + } +} + diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSActionCell.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSActionCell.kt new file mode 100644 index 00000000..aaeeb62d --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSActionCell.kt @@ -0,0 +1,22 @@ +package darwin + +import org.rococoa.ObjCClass + +/// native declaration : :10 +abstract class NSActionCell : NSCell() { + interface _Class : ObjCClass { + open fun alloc(): NSActionCell? + } + + /** + * Original signature : `id target()`

+ * *native declaration : :30* + */ + abstract fun target(): org.rococoa.ID? + + /** + * Original signature : `void setTarget(id)`

+ * *native declaration : :31* + */ + abstract fun setTarget(anObject: org.rococoa.ID?) +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAlert.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAlert.kt new file mode 100644 index 00000000..fa15aaf9 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAlert.kt @@ -0,0 +1,265 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSError + +/// native declaration : :20 +abstract class NSAlert : NSObject() { + interface _Class : ObjCClass { + open fun alloc(): NSAlert + + /** + * Given an NSError, create an NSAlert that can be used to present the error to the user. The error's localized description, recovery suggestion, and recovery options will be used to set the alert's message text, informative text, and button titles, respectively.

+ * Original signature : `NSAlert* alertWithError(NSError*)`

+ * *native declaration : :60* + */ + open fun alertWithError(error: NSError?): NSAlert? + + /** + * the following class method is for use by apps migrating from the C-based API. Note that this returns an NSAlert that is equivalent to the one created in NSRunAlertPanel, so the layout, button return values, and key equivalents are the same as for the C-based API.

+ * Original signature : `NSAlert* alertWithMessageText(NSString*, NSString*, NSString*, NSString*, NSString*, null)`

+ * *native declaration : :65* + */ + open fun alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat( + message: String?, defaultButton: String?, alternateButton: String?, otherButton: String?, format: String? + ): NSAlert? + } + + abstract fun init(): NSAlert + + /** + * Original signature : `void setMessageText(NSString*)`

+ * *native declaration : :67* + */ + abstract fun setMessageText(messageText: String?) + + /** + * Original signature : `void setInformativeText(NSString*)`

+ * *native declaration : :68* + */ + abstract fun setInformativeText(informativeText: String?) + + /** + * Original signature : `NSString* messageText()`

+ * *native declaration : :70* + */ + abstract fun messageText(): String? + + /** + * Original signature : `NSString* informativeText()`

+ * *native declaration : :71* + */ + abstract fun informativeText(): String? + + /** + * customize the icon. By default uses the image named NSApplicationIcon

+ * Original signature : `void setIcon(NSImage*)`

+ * *native declaration : :74* + */ + abstract fun setIcon(icon: NSImage?) + + /** + * Original signature : `NSImage* icon()`

+ * *native declaration : :75* + */ + abstract fun icon(): NSImage? + + /** + * buttons are added from right to left (for left to right languages)

+ * Original signature : `NSButton* addButtonWithTitle(NSString*)`

+ * *native declaration : :79* + */ + abstract fun addButtonWithTitle(title: String?): NSButton? + + /** + * get the buttons, where the rightmost button is at index 0

+ * Original signature : `NSArray* buttons()`

+ * *native declaration : :81* + */ + abstract fun buttons(): NSArray? + + /** + * -setShowsHelp:YES adds a help button to the alert panel. When the help button is pressed, the delegate is first consulted. If the delegate does not implement alertShowHelp: or returns NO, then -[NSHelpManager openHelpAnchor:inBook:] is called with a nil book and the anchor specified by -setHelpAnchor:, if any. An exception will be raised if the delegate returns NO and there is no help anchor set.

+ * Original signature : `void setShowsHelp(BOOL)`

+ * *native declaration : :99* + */ + abstract fun setShowsHelp(showsHelp: Boolean) + + /** + * Original signature : `BOOL showsHelp()`

+ * *native declaration : :100* + */ + abstract fun showsHelp(): Boolean + + /** + * Original signature : `void setHelpAnchor(NSString*)`

+ * *native declaration : :102* + */ + abstract fun setHelpAnchor(anchor: String?) + + /** + * Original signature : `NSString* helpAnchor()`

+ * *native declaration : :103* + */ + abstract fun helpAnchor(): String? + + /** + * Original signature : `void setAlertStyle(NSAlertStyle)`

+ * *native declaration : :105* + */ + abstract fun setAlertStyle(style: Int) + + /** + * Original signature : `NSAlertStyle alertStyle()`

+ * *native declaration : :106* + */ + abstract fun alertStyle(): Int + + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : :108* + */ + abstract fun setDelegate(delegate: ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :109* + */ + abstract fun delegate(): ID? + + /** + * -setShowsSuppressionButton: indicates whether or not the alert should contain a suppression checkbox. The default is NO. This checkbox is typically used to give the user an option to not show this alert again. If shown, the suppression button will have a default localized title similar to @"Do not show this message again". You can customize this title using [[alert suppressionButton] setTitle:]. When the alert is dismissed, you can get the state of the suppression button, using [[alert suppressionButton] state] and store the result in user defaults, for example. This setting can then be checked before showing the alert again. By default, the suppression button is positioned below the informative text, and above the accessory view (if any) and the alert buttons, and left-aligned with the informative text. However do not count on the placement of this button, since it might be moved if the alert panel user interface is changed in the future. If you need a checkbox for purposes other than suppression text, it is recommended you create your own using an accessory view.

+ * Original signature : `void setShowsSuppressionButton(BOOL)`

+ * *native declaration : :114* + */ + abstract fun setShowsSuppressionButton(flag: Boolean) + + /** + * Original signature : `BOOL showsSuppressionButton()`

+ * *native declaration : :115* + */ + abstract fun showsSuppressionButton(): Boolean + + /** + * -suppressionButton returns a suppression button which may be customized, including the title and the initial state. You can also use this method to get the state of the button after the alert is dismissed, which may be stored in user defaults and checked before showing the alert again. In order to show the suppression button in the alert panel, you must call -setShowsSuppressionButton:YES.

+ * Original signature : `NSButton* suppressionButton()`

+ * *native declaration : :119* + */ + abstract fun suppressionButton(): NSButton? + + /** + * -setAccessoryView: sets the accessory view displayed in the alert panel. By default, the accessory view is positioned below the informative text and the suppression button (if any) and above the alert buttons, left-aligned with the informative text. If you want to customize the location of the accessory view, you must first call -layout. See the discussion of -layout for more information.

+ * Original signature : `void setAccessoryView(NSView*)`

+ * *native declaration : :124* + */ + abstract fun setAccessoryView(view: NSView?) + + /** + * Original signature : `NSView* accessoryView()`

+ * *native declaration : :125* + */ + abstract fun accessoryView(): NSView? + + /** + * -layout can be used to indicate that the alert panel should do immediate layout, overriding the default behavior of laying out lazily just before showing panel. You should only call this method if you want to do your own custom layout after it returns. You should call this method only after you have finished with NSAlert customization, including setting message and informative text, and adding buttons and an accessory view if needed. You can make layout changes after this method returns, in particular to adjust the frame of an accessory view. Note that the standard layout of the alert may change in the future, so layout customization should be done with caution.

+ * Original signature : `void layout()`

+ * *native declaration : :129* + */ + abstract fun layout() + + /** + * Run the alert as an application-modal panel and return the result

+ * Original signature : `NSInteger runModal()`

+ * *native declaration : :134* + */ + abstract fun runModal(): Int + + /** + * Original signature : `void beginSheetModalForWindow(NSWindow*, id, SEL, void*)`

+ * *native declaration : :139* + */ + abstract fun beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo( + window: NSWindow?, + delegate: ID?, + didEndSelector: org.rococoa.Selector?, + contextInfo: ID? + ) + + fun beginSheet(window: NSWindow?, delegate: ID?, didEndSelector: org.rococoa.Selector?, contextInfo: ID?) { + this.beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo( + window, + delegate, + didEndSelector, + contextInfo + ) + } + + /** + * return the application-modal panel or the document-modal sheet corresponding to this alert

+ * Original signature : `id window()`

+ * *native declaration : :142* + */ + abstract fun window(): NSWindow? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSAlert", _Class::class.java) + + const val NSAlertFirstButtonReturn: Int = 1000 + const val NSAlertSecondButtonReturn: Int = 1001 + const val NSAlertThirdButtonReturn: Int = 1002 + + /// native declaration : :54 + const val NSAlertDefaultReturn: Int = 1 + + /// native declaration : :55 + const val NSAlertAlternateReturn: Int = 0 + + /// native declaration : :56 + const val NSAlertOtherReturn: Int = -1 + + /// native declaration : :57 + const val NSAlertErrorReturn: Int = -2 + + /// native declaration : line 12 + const val NSWarningAlertStyle: Int = 0 + + /// native declaration : line 13 + const val NSInformationalAlertStyle: Int = 1 + + /// native declaration : line 14 + const val NSCriticalAlertStyle: Int = 2 + + fun alert(): NSAlert { + return CLASS.alloc().init() + } + + fun alertWithError(error: NSError?): NSAlert? { + return CLASS.alertWithError(error) + } + + fun alert( + title: String?, + message: String?, + defaultButton: String?, + alternateButton: String?, + otherButton: String? + ): NSAlert? { + val alert = alert() + alert.setMessageText(title) + alert.setInformativeText(message) + if (defaultButton !== "") { + // OK + alert.addButtonWithTitle(defaultButton) + } + if (otherButton !== "") { + // Cancel + alert.addButtonWithTitle(otherButton) + } + if (alternateButton !== "") { + alert.addButtonWithTitle(alternateButton) + } + return alert + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAppleEventDescriptor.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAppleEventDescriptor.kt new file mode 100644 index 00000000..a5637bba --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAppleEventDescriptor.kt @@ -0,0 +1,348 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.cocoa.foundation.NSInteger + +/** + * This file was autogenerated by [JNAerator](http://jnaerator.googlecode.com/),

+ * a tool written by [Olivier Chafik](http://ochafik.free.fr/) that [uses a few opensource projects.](http://code.google.com/p/jnaerator/wiki/CreditsAndLicense).

+ * For help, please visit [NativeLibs4Java](http://nativelibs4java.googlecode.com/), [Rococoa](http://rococoa.dev.java.net/), or [JNA](http://jna.dev.java.net/). + */ +abstract class NSAppleEventDescriptor : NSObject() { + interface _Class : ObjCClass { + /** + * Create an autoreleased NSAppleEventDescriptor whose AEDesc type is typeNull.

+ * Original signature : `+(NSAppleEventDescriptor*)nullDescriptor`

+ * *native declaration : line 18* + */ + open fun nullDescriptor(): NSAppleEventDescriptor? + /** + * *native declaration : line 22*

+ * Conversion Error : /// Original signature : `+(NSAppleEventDescriptor*)descriptorWithDescriptorType:() bytes:(const void*) length:(NSUInteger)`

+ * + (NSAppleEventDescriptor*)descriptorWithDescriptorType:(null)descriptorType bytes:(const void*)bytes length:(NSUInteger)byteCount; (Argument descriptorType cannot be converted) + */ + /** + * *native declaration : line 24*

+ * Conversion Error : /// Original signature : `+(NSAppleEventDescriptor*)descriptorWithDescriptorType:() data:(NSData*)`

+ * + (NSAppleEventDescriptor*)descriptorWithDescriptorType:(null)descriptorType data:(NSData*)data; (Argument descriptorType cannot be converted) + */ + /** + * Original signature : `+(NSAppleEventDescriptor*)descriptorWithBoolean:(Boolean)`

+ * *native declaration : line 28* + */ + open fun descriptorWithBoolean(boolean_: Boolean): NSAppleEventDescriptor? + /** + * *native declaration : line 29*

+ * Conversion Error : /// Original signature : `+(NSAppleEventDescriptor*)descriptorWithEnumCode:()`

+ * + (NSAppleEventDescriptor*)descriptorWithEnumCode:(null)enumerator; (Argument enumerator cannot be converted) + */ + /** + * Original signature : `+(NSAppleEventDescriptor*)descriptorWithInt32:(SInt32)`

+ * *native declaration : line 30* + */ + open fun descriptorWithInt32(signedInt: Int): NSAppleEventDescriptor? + /** + * *native declaration : line 31*

+ * Conversion Error : /// Original signature : `+(NSAppleEventDescriptor*)descriptorWithTypeCode:()`

+ * + (NSAppleEventDescriptor*)descriptorWithTypeCode:(null)typeCode; (Argument typeCode cannot be converted) + */ + /** + * Original signature : `+(NSAppleEventDescriptor*)descriptorWithString:(NSString*)`

+ * *native declaration : line 36* + */ + open fun descriptorWithString(string: String?): NSAppleEventDescriptor? + /** + * *native declaration : line 40*

+ * Conversion Error : / **

+ * * Create and return an autoreleased event, list, or record NSAppleEventDescriptor, respectively.

+ * * Original signature : `+(NSAppleEventDescriptor*)appleEventWithEventClass:() eventID:() targetDescriptor:(NSAppleEventDescriptor*) returnID:() transactionID:()`

+ * * /

+ * + (NSAppleEventDescriptor*)appleEventWithEventClass:(null)eventClass eventID:(null)eventID targetDescriptor:(NSAppleEventDescriptor*)targetDescriptor returnID:(null)returnID transactionID:(null)transactionID; (Argument eventClass cannot be converted) + */ + /** + * Original signature : `+(NSAppleEventDescriptor*)listDescriptor`

+ * *native declaration : line 41* + */ + open fun listDescriptor(): NSAppleEventDescriptor? + + /** + * Original signature : `+(NSAppleEventDescriptor*)recordDescriptor`

+ * *native declaration : line 42* + */ + open fun recordDescriptor(): NSAppleEventDescriptor? + + open fun alloc(): NSAppleEventDescriptor + } + + /** + * Original signature : `-(id)initWithAEDescNoCopy:(const AEDesc*)`

+ * *native declaration : line 46* + */ + abstract fun initWithAEDescNoCopy(aeDesc: com.sun.jna.Pointer?): NSAppleEventDescriptor? + + /** + * *native declaration : line 50*

+ * Conversion Error : / **

+ * * Other initializers.

+ * * Original signature : `-(id)initWithDescriptorType:() bytes:(const void*) length:(NSUInteger)`

+ * * /

+ * - (id)initWithDescriptorType:(null)descriptorType bytes:(const void*)bytes length:(NSUInteger)byteCount; (Argument descriptorType cannot be converted) + */ + /** + * *native declaration : line 51*

+ * Conversion Error : /// Original signature : `-(id)initWithDescriptorType:() data:(NSData*)`

+ * - (id)initWithDescriptorType:(null)descriptorType data:(NSData*)data; (Argument descriptorType cannot be converted) + */ + /** + * *native declaration : line 52*

+ * Conversion Error : /// Original signature : `-(id)initWithEventClass:() eventID:() targetDescriptor:(NSAppleEventDescriptor*) returnID:() transactionID:()`

+ * - (id)initWithEventClass:(null)eventClass eventID:(null)eventID targetDescriptor:(NSAppleEventDescriptor*)targetDescriptor returnID:(null)returnID transactionID:(null)transactionID; (Argument eventClass cannot be converted) + */ + /** + * Original signature : `-(id)initListDescriptor`

+ * *native declaration : line 53* + */ + abstract fun initListDescriptor(): NSAppleEventDescriptor? + + /** + * Original signature : `-(id)initRecordDescriptor`

+ * *native declaration : line 54* + */ + abstract fun initRecordDescriptor(): NSAppleEventDescriptor? + + /** + * Original signature : `-(const AEDesc*)aeDesc`

+ * *native declaration : line 58* + */ + abstract fun aeDesc(): com.sun.jna.Pointer? + + /** + * Get the four-character type code or the data from a fully-initialized descriptor.

+ * Original signature : `-(id)descriptorType`

+ * *native declaration : line 62* + */ + abstract fun descriptorType(): NSObject? + + /** + * Original signature : `-(NSData*)data`

+ * *native declaration : line 63* + */ + abstract fun data(): com.sun.jna.Pointer? + + /** + * Original signature : `-(Boolean)booleanValue`

+ * *native declaration : line 67* + */ + abstract fun booleanValue(): Boolean + + /** + * Original signature : `-(id)enumCodeValue`

+ * *native declaration : line 68* + */ + abstract fun enumCodeValue(): NSObject? + + /** + * Original signature : `-(SInt32)int32Value`

+ * *native declaration : line 69* + */ + abstract fun int32Value(): Int + + /** + * Original signature : `-(id)typeCodeValue`

+ * *native declaration : line 70* + */ + abstract fun typeCodeValue(): NSObject? + + /** + * Original signature : `-(NSString*)stringValue`

+ * *native declaration : line 75* + */ + abstract fun stringValue(): String? + + /** + * Accessors for an event descriptor.

+ * Original signature : `-(id)eventClass`

+ * *native declaration : line 79* + */ + abstract fun eventClass(): NSObject? + + /** + * Original signature : `-(id)eventID`

+ * *native declaration : line 80* + */ + abstract fun eventID(): NSObject? + + /** + * Original signature : `-(id)returnID`

+ * *native declaration : line 81* + */ + abstract fun returnID(): NSObject? + + /** + * Original signature : `-(id)transactionID`

+ * *native declaration : line 82* + */ + abstract fun transactionID(): NSObject? + /** + * *native declaration : line 85*

+ * Conversion Error : / **

+ * * Set, retrieve, or remove parameter descriptors inside an event descriptor.

+ * * Original signature : `-(void)setParamDescriptor:(NSAppleEventDescriptor*) forKeyword:()`

+ * * /

+ * - (void)setParamDescriptor:(NSAppleEventDescriptor*)descriptor forKeyword:(null)keyword; (Argument keyword cannot be converted) + */ + /** + * *native declaration : line 86*

+ * Conversion Error : /// Original signature : `-(NSAppleEventDescriptor*)paramDescriptorForKeyword:()`

+ * - (NSAppleEventDescriptor*)paramDescriptorForKeyword:(null)keyword; (Argument keyword cannot be converted) + */ + abstract fun paramDescriptorForKeyword(keyword: Int): NSAppleEventDescriptor? + /** + * *native declaration : line 87*

+ * Conversion Error : /// Original signature : `-(void)removeParamDescriptorWithKeyword:()`

+ * - (void)removeParamDescriptorWithKeyword:(null)keyword; (Argument keyword cannot be converted) + */ + /** + * *native declaration : line 90*

+ * Conversion Error : / **

+ * * Set or retrieve attribute descriptors inside an event descriptor.

+ * * Original signature : `-(void)setAttributeDescriptor:(NSAppleEventDescriptor*) forKeyword:()`

+ * * /

+ * - (void)setAttributeDescriptor:(NSAppleEventDescriptor*)descriptor forKeyword:(null)keyword; (Argument keyword cannot be converted) + */ + /** + * *native declaration : line 91*

+ * Conversion Error : /// Original signature : `-(NSAppleEventDescriptor*)attributeDescriptorForKeyword:()`

+ * - (NSAppleEventDescriptor*)attributeDescriptorForKeyword:(null)keyword; (Argument keyword cannot be converted) + */ + /** + * Return the number of items inside a list or record descriptor.

+ * Original signature : `-(NSInteger)numberOfItems`

+ * *native declaration : line 94* + */ + abstract fun numberOfItems(): NSInteger? + + /** + * Set, retrieve, or remove indexed descriptors inside a list or record descriptor.

+ * Original signature : `-(void)insertDescriptor:(NSAppleEventDescriptor*) atIndex:(NSInteger)`

+ * *native declaration : line 97* + */ + abstract fun insertDescriptor_atIndex(descriptor: NSAppleEventDescriptor?, index: NSInteger?) + + /** + * Original signature : `-(NSAppleEventDescriptor*)descriptorAtIndex:(NSInteger)`

+ * *native declaration : line 98* + */ + abstract fun descriptorAtIndex(index: NSInteger?): NSAppleEventDescriptor? + + /** + * Original signature : `-(void)removeDescriptorAtIndex:(NSInteger)`

+ * *native declaration : line 100* + */ + abstract fun removeDescriptorAtIndex(index: NSInteger?) + /** + * *native declaration : line 106*

+ * Conversion Error : / **

+ * * Set, retrieve, or remove keyed descriptors inside a record descriptor.

+ * * Original signature : `-(void)setDescriptor:(NSAppleEventDescriptor*) forKeyword:()`

+ * * /

+ * - (void)setDescriptor:(NSAppleEventDescriptor*)descriptor forKeyword:(null)keyword; (Argument keyword cannot be converted) + */ + /** + * *native declaration : line 107*

+ * Conversion Error : /// Original signature : `-(NSAppleEventDescriptor*)descriptorForKeyword:()`

+ * - (NSAppleEventDescriptor*)descriptorForKeyword:(null)keyword; (Argument keyword cannot be converted) + */ + /** + * *native declaration : line 108*

+ * Conversion Error : /// Original signature : `-(void)removeDescriptorWithKeyword:()`

+ * - (void)removeDescriptorWithKeyword:(null)keyword; (Argument keyword cannot be converted) + */ + /** + * Return the keyword associated with an indexed descriptor inside a record descriptor.

+ * Original signature : `-(id)keywordForDescriptorAtIndex:(NSInteger)`

+ * *native declaration : line 111* + */ + abstract fun keywordForDescriptorAtIndex(index: NSInteger?): NSObject? + + companion object { + private val CLASS: _Class = Rococoa.createClass("NSAppleEventDescriptor", _Class::class.java) + + /** + * Create an autoreleased NSAppleEventDescriptor whose AEDesc type is typeNull.

+ * Original signature : `+(NSAppleEventDescriptor*)nullDescriptor`

+ * *native declaration : line 18* + */ + fun nullDescriptor(): NSAppleEventDescriptor? { + return CLASS.nullDescriptor() + } + + /** + * Original signature : `+(NSAppleEventDescriptor*)descriptorWithBoolean:(Boolean)`

+ * *native declaration : line 28* + */ + fun descriptorWithBoolean(boolean_: Boolean): NSAppleEventDescriptor? { + return CLASS.descriptorWithBoolean(boolean_) + } + + /** + * Original signature : `+(NSAppleEventDescriptor*)descriptorWithInt32:(SInt32)`

+ * *native declaration : line 30* + */ + fun descriptorWithInt32(signedInt: Int): NSAppleEventDescriptor? { + return CLASS.descriptorWithInt32(signedInt) + } + + /** + * Original signature : `+(NSAppleEventDescriptor*)descriptorWithString:(NSString*)`

+ * *native declaration : line 36* + */ + fun descriptorWithString(string: String?): NSAppleEventDescriptor? { + return CLASS.descriptorWithString(string) + } + + /** + * Original signature : `+(NSAppleEventDescriptor*)listDescriptor`

+ * *native declaration : line 41* + */ + fun listDescriptor(): NSAppleEventDescriptor? { + return CLASS.listDescriptor() + } + + /** + * Original signature : `+(NSAppleEventDescriptor*)recordDescriptor`

+ * *native declaration : line 42* + */ + fun recordDescriptor(): NSAppleEventDescriptor? { + return CLASS.recordDescriptor() + } + + /** + * Factory method

+ * + * @see .initWithAEDescNoCopy + */ + fun createWithAEDescNoCopy(aeDesc: com.sun.jna.Pointer?): NSAppleEventDescriptor? { + return CLASS.alloc().initWithAEDescNoCopy(aeDesc) + } + + /** + * Factory method

+ * + * @see .initListDescriptor + */ + fun createListDescriptor(): NSAppleEventDescriptor? { + return CLASS.alloc().initListDescriptor() + } + + /** + * Factory method

+ * + * @see .initRecordDescriptor + */ + fun createRecordDescriptor(): NSAppleEventDescriptor? { + return CLASS.alloc().initRecordDescriptor() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAppleEventManager.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAppleEventManager.kt new file mode 100644 index 00000000..aadab39e --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAppleEventManager.kt @@ -0,0 +1,110 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.Selector + +/** + * This file was autogenerated by [JNAerator](http://jnaerator.googlecode.com/),

+ * a tool written by [Olivier Chafik](http://ochafik.free.fr/) that [uses a few opensource projects.](http://code.google.com/p/jnaerator/wiki/CreditsAndLicense).

+ * For help, please visit [NativeLibs4Java](http://nativelibs4java.googlecode.com/), [Rococoa](http://rococoa.dev.java.net/), or [JNA](http://jna.dev.java.net/). + */ +abstract class NSAppleEventManager : NSObject() { + interface _Class : ObjCClass { + /** + * Get the pointer to the program's single NSAppleEventManager.

+ * Original signature : `+(NSAppleEventManager*)sharedAppleEventManager`

+ * *native declaration : line 30* + */ + open fun sharedAppleEventManager(): NSAppleEventManager? + } + + /** + * *native declaration : line 35*

+ * Conversion Error : / **

+ * * When it is invoked, the value of the first parameter will be the event to be handled. The value of the second parameter will be the reply event to fill in. A reply event object will always be passed in (replyEvent will never be nil), but it should not be touched if the event sender has not requested a reply, which is indicated by [replyEvent descriptorType]==typeNull.

+ * * Original signature : `-(void)setEventHandler:(id) andSelector:(SEL) forEventClass:() andEventID:()`

+ * * /

+ */ + abstract fun setEventHandler_andSelector_forEventClass_andEventID( + handler: ID?, + selector: Selector?, + eventClass: Int, + eventID: Int + ) + /** + * *native declaration : line 36*

+ * Conversion Error : /// Original signature : `-(void)removeEventHandlerForEventClass:() andEventID:()`

+ * - (void)removeEventHandlerForEventClass:(null)eventClass andEventID:(null)eventID; (Argument eventClass cannot be converted) + */ + /** + * *native declaration : line 40*

+ * Conversion Error : / **

+ * * This method is primarily meant for Cocoa's internal use. It does not send events to other applications!

+ * * Original signature : `-(id)dispatchRawAppleEvent:(const AppleEvent*) withRawReply:(AppleEvent*) handlerRefCon:()`

+ * * /

+ * - dispatchRawAppleEvent:(const AppleEvent*)theAppleEvent withRawReply:(AppleEvent*)theReply handlerRefCon:(null)handlerRefCon; (Argument handlerRefCon cannot be converted) + */ + /** + * If an Apple event is being handled on the current thread (i.e., a handler that was registered with -setEventHandler:andSelector:forEventClass:andEventID: is being messaged at this instant or -setCurrentAppleEventAndReplyEventWithSuspensionID: has just been invoked), return the descriptor for the event. Return nil otherwise. The effects of mutating or retaining the returned descriptor are undefined, though it may be copied.

+ * Original signature : `-(NSAppleEventDescriptor*)currentAppleEvent`

+ * *native declaration : line 45* + */ + abstract fun currentAppleEvent(): NSAppleEventDescriptor? + + /** + * If an Apple event is being handled on the current thread (i.e., -currentAppleEvent would not return nil), return the corresponding reply event descriptor. Return nil otherwise. This descriptor, including any mutatations, will be returned to the sender of the current event when all handling of the event has been completed, if the sender has requested a reply. The effects of retaining the descriptor are undefined; it may be copied, but mutations of the copy will not be returned to the sender of the current event.

+ * Original signature : `-(NSAppleEventDescriptor*)currentReplyAppleEvent`

+ * *native declaration : line 48* + */ + abstract fun currentReplyAppleEvent(): NSAppleEventDescriptor? + + /** + * If an Apple event is being handled on the current thread (i.e., -currentAppleEvent would not return nil), suspend the handling of the event, returning an ID that must be used to resume the handling of the event. Return zero otherwise. The suspended event will no longer be the current event after this method has returned.

+ * Original signature : `-(NSAppleEventManagerSuspensionID)suspendCurrentAppleEvent`

+ * *native declaration : line 51* + */ + abstract fun suspendCurrentAppleEvent(): com.sun.jna.Pointer? + + /** + * Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, return the descriptor for the event whose handling was suspended. The effects of mutating or retaining the returned descriptor are undefined, though it may be copied. This method may be invoked in any thread, not just the one in which the corresponding invocation of -suspendCurrentAppleEvent occurred.

+ * Original signature : `-(NSAppleEventDescriptor*)appleEventForSuspensionID:(NSAppleEventManagerSuspensionID)`

+ * *native declaration : line 54* + */ + abstract fun appleEventForSuspensionID(suspensionID: com.sun.jna.Pointer?): NSAppleEventDescriptor? + + /** + * Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, return the corresponding reply event descriptor. This descriptor, including any mutatations, will be returned to the sender of the suspended event when handling of the event is resumed, if the sender has requested a reply. The effects of retaining the descriptor are undefined; it may be copied, but mutations of the copy will not be returned to the sender of the suspended event. This method may be invoked in any thread, not just the one in which the corresponding invocation of -suspendCurrentAppleEvent occurred.

+ * Original signature : `-(NSAppleEventDescriptor*)replyAppleEventForSuspensionID:(NSAppleEventManagerSuspensionID)`

+ * *native declaration : line 57* + */ + abstract fun replyAppleEventForSuspensionID(suspensionID: com.sun.jna.Pointer?): NSAppleEventDescriptor? + + /** + * Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, set the values that will be returned by subsequent invocations of -currentAppleEvent and -currentReplyAppleEvent to be the event whose handling was suspended and its corresponding reply event, respectively. Redundant invocations of this method will be ignored.

+ * Original signature : `-(void)setCurrentAppleEventAndReplyEventWithSuspensionID:(NSAppleEventManagerSuspensionID)`

+ * *native declaration : line 60* + */ + abstract fun setCurrentAppleEventAndReplyEventWithSuspensionID(suspensionID: com.sun.jna.Pointer?) + + /** + * Given a nonzero suspension ID returned by an invocation of -suspendCurrentAppleEvent, signal that handling of the suspended event may now continue. This may result in the immediate sending of the reply event to the sender of the suspended event, if the sender has requested a reply. If the suspension ID has been used in a previous invocation of -setCurrentAppleEventAndReplyEventWithSuspensionID: the effects of that invocation will be completely undone. Subsequent invocations of other NSAppleEventManager methods using the same suspension ID are invalid. This method may be invoked in any thread, not just the one in which the corresponding invocation of -suspendCurrentAppleEvent occurred.

+ * Original signature : `-(void)resumeWithSuspensionID:(NSAppleEventManagerSuspensionID)`

+ * *native declaration : line 63* + */ + abstract fun resumeWithSuspensionID(suspensionID: com.sun.jna.Pointer?) + + companion object { + private val CLASS: _Class = Rococoa.createClass("NSAppleEventManager", _Class::class.java) + + /** + * Get the pointer to the program's single NSAppleEventManager.

+ * Original signature : `+(NSAppleEventManager*)sharedAppleEventManager`

+ * *native declaration : line 30* + */ + fun sharedAppleEventManager(): NSAppleEventManager? { + return CLASS.sharedAppleEventManager() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAppleScript.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAppleScript.kt new file mode 100644 index 00000000..8c241a79 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAppleScript.kt @@ -0,0 +1,95 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.Rococoa + +/** + * This file was autogenerated by [JNAerator](http://jnaerator.googlecode.com/),

+ * a tool written by [Olivier Chafik](http://ochafik.free.fr/) that [uses a few opensource projects.](http://code.google.com/p/jnaerator/wiki/CreditsAndLicense).

+ * For help, please visit [NativeLibs4Java](http://nativelibs4java.googlecode.com/), [Rococoa](http://rococoa.dev.java.net/), or [JNA](http://jna.dev.java.net/). + */ +abstract class NSAppleScript : NSObject() { + interface _Class : ObjCClass { + open fun alloc(): NSAppleScript + } + + /** + * Given a URL that locates a script, in either text or compiled form, initialize. Return nil and a pointer to an error information dictionary if an error occurs. This is a designated initializer for this class.

+ * Given a URL that locates a script, in either text or compiled form, initialize. Return nil and a pointer to an error information dictionary if an error occurs. This is a designated initializer for this class.

+ * Given a URL that locates a script, in either text or compiled form, initialize. Return nil and a pointer to an error information dictionary if an error occurs. This is a designated initializer for this class.

+ * Original signature : `-(id)initWithContentsOfURL:(NSURL*) error:(NSDictionary**)`

+ * *native declaration : line 28* + */ + abstract fun initWithContentsOfURL_error(url: NSURL?, errorInfo: com.sun.jna.ptr.ByReference?): NSAppleScript? + + /** + * Given a string containing the AppleScript source code of a script, initialize. Return nil if an error occurs. This is also a designated initializer for this class.

+ * Original signature : `-(id)initWithSource:(NSString*)`

+ * *native declaration : line 31* + */ + abstract fun initWithSource(source: String?): NSAppleScript? + + /** + * Return the source code of the script if it is available, nil otherwise. It is possible for an NSAppleScript that has been instantiated with -initWithContentsOfURL:error: to be a script for which the source code is not available, but is nonetheless executable.

+ * Original signature : `-(NSString*)source`

+ * *native declaration : line 34* + */ + abstract fun source(): String? + + /** + * Return yes if the script is already compiled, no otherwise.

+ * Original signature : `-(BOOL)isCompiled`

+ * *native declaration : line 37* + */ + abstract fun isCompiled(): Boolean + + /** + * Compile the script, if it is not already compiled. Return yes for success or if the script was already compiled, no and a pointer to an error information dictionary otherwise.

+ * Original signature : `-(BOOL)compileAndReturnError:(NSDictionary**)`

+ * *native declaration : line 40* + */ + abstract fun compileAndReturnError(errorInfo: com.sun.jna.ptr.ByReference?): Boolean + + /** + * Execute the script, compiling it first if it is not already compiled. Return the result of executing the script, or nil and a pointer to an error information dictionary for failure.

+ * Original signature : `-(NSAppleEventDescriptor*)executeAndReturnError:(NSDictionary**)`

+ * *native declaration : line 43* + */ + abstract fun executeAndReturnError(errorInfo: com.sun.jna.ptr.ByReference?): NSAppleEventDescriptor? + + /** + * Execute an Apple event in the context of the script, compiling the script first if it is not already compiled. Return the result of executing the event, or nil and a pointer to an error information dictionary for failure.

+ * Original signature : `-(NSAppleEventDescriptor*)executeAppleEvent:(NSAppleEventDescriptor*) error:(NSDictionary**)`

+ * *native declaration : line 46* + */ + abstract fun executeAppleEvent_error( + event: NSAppleEventDescriptor?, + errorInfo: com.sun.jna.ptr.ByReference? + ): NSAppleEventDescriptor? + + companion object { + private val CLASS: _Class = Rococoa.createClass("NSAppleScript", _Class::class.java) + + /** + * Factory method

+ * + * @see .initWithContentsOfURL_error + */ + fun createWithContentsOfURL_error(url: NSURL?, errorInfo: com.sun.jna.ptr.ByReference?): NSAppleScript? { + return CLASS.alloc().initWithContentsOfURL_error(url, errorInfo) + } + + /** + * Factory method

+ * + * @see .initWithSource + */ + fun createWithSource(source: String?): NSAppleScript? { + return CLASS.alloc().initWithSource(source) + } + + fun alloc(): NSAppleScript? { + return CLASS.alloc() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSApplication.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSApplication.kt new file mode 100644 index 00000000..f09305cc --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSApplication.kt @@ -0,0 +1,772 @@ +package darwin + +import org.apache.logging.log4j.LogManager +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.Selector +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSUInteger + +abstract class NSApplication : NSObject() { + interface Delegate { + /** + * Tells the delegate to open a single file. + * + * + * Sent directly by theApplication to the delegate. The method should open the file filename, returning YES if + * the file is successfully opened, and NO otherwise. If the user started up the application by double-clicking + * a file, the delegate receives the application:openFile: message before receiving + * applicationDidFinishLaunching:. (applicationWillFinishLaunching: is sent before application:openFile:.) + * + * @param app The application object associated with the delegate. + * @param filename The name of the file to open. + * @return YES if the file was successfully opened or NO if it was not. + */ + open fun application_openFile(app: NSApplication?, filename: String?): Boolean + + /** + * Tells the delegate to open a temporary file. + * + * + * + * + * Sent directly by theApplication to the delegate. The method should attempt to open the file filename, + * returning YES if the file is successfully opened, and NO otherwise. + * + * + * By design, a file opened through this method is assumed to be temporary—it’s the application’s responsibility + * to remove the file at the appropriate time. + * + * @param app The application object associated with the delegate. + * @param filename The name of the temporary file to open. + * @return YES if the file was successfully opened or NO if it was not. + */ + open fun application_openTempFile(app: NSApplication?, filename: String?): Boolean + + /** + * Invoked immediately before opening an untitled file. + * + * + * Use this method to decide whether the application should open a new, untitled file. Note that + * applicationOpenUntitledFile: is invoked if this method returns YES. + * + * @param sender The application object associated with the delegate. + * @return YES if the application should open a new untitled file or NO if it should not. + */ + open fun applicationShouldOpenUntitledFile(sender: NSApplication?): Boolean + + /** + * Tells the delegate to open an untitled file. + * + * + * Sent directly by theApplication to the delegate to request that a new, untitled file be opened. + * + * @param sender The application object associated with the delegate. + * @return YES if the file was successfully opened or NO if it was not. + */ + open fun applicationOpenUntitledFile(sender: NSApplication?): Boolean + + /** + * Sent by the application to the delegate prior to default behavior to reopen (rapp) AppleEvents. + * + * + * These events are sent whenever the Finder reactivates an already running application because someone + * double-clicked it again or used the dock to activate it. + * + * + * By default the Application Kit will handle this event by checking whether there are any visible NSWindow (not + * NSPanel) objects, and, if there are none, it goes through the standard untitled document creation (the same + * as it does if theApplication is launched without any document to open). For most document-based applications, + * an untitled document will be created. + * + * + * The application delegate will also get a chance to respond to the normal untitled document delegate methods. + * If you implement this method in your application delegate, it will be called before any of the default + * behavior happens. If you return YES, then NSApplication will proceed as normal. If you return NO, then + * NSApplication will do nothing. So, you can either implement this method with a version that does nothing, and + * return NO if you do not want anything to happen at all (not recommended), or you can implement this method, + * handle the event yourself in some custom way, and return NO. + * + * + * Miniaturized windows, windows in the Dock, are considered visible by this method, and cause flag to return + * YES, despite the fact that miniaturized windows return NO when sent an visible message. + * + * @param app The application object. + * @param visibleWindowsFound Indicates whether the NSApplication object found any visible windows in your + * application. You can use this value as an indication of whether the application + * would do anything if you return YES. + * @return YES if you want the application to perform its normal tasks or NO if you want the application to do + * nothing. + */ + open fun applicationShouldHandleReopen_hasVisibleWindows( + app: NSApplication?, + visibleWindowsFound: Boolean + ): Boolean + + /** + * Sent by the default notification center immediately before the application object is initialized. + * + * @param notification A notification named NSApplicationWillFinishLaunchingNotification. Calling the object + * method of this notification returns the NSApplication object itself. + */ + fun applicationWillFinishLaunching(notification: NSNotification?) { + if (log.isDebugEnabled()) { + log.debug(notification) + } + } + + /** + * Sent by the default notification center after the application has been launched and initialized but before it + * has received its first event. + * + * + * Delegates can implement this method to perform further initialization. This method is called after the + * application’s main run loop has been started but before it has processed any events. If the application was + * launched by the user opening a file, the delegate’s application:openFile: method is called before this + * method. If you want to perform initialization before any files are opened, implement the + * applicationWillFinishLaunching: method in your delegate, which is called before application:openFile:.) + * + * @param notification A notification named NSApplicationDidFinishLaunchingNotification. Calling the object + * method of this notification returns the NSApplication object itself. + */ + fun applicationDidFinishLaunching(notification: NSNotification?) { + if (log.isDebugEnabled()) { + log.debug(notification) + } + } + + /** + * Sent to notify the delegate that the application is about to terminate. + * + * + * This method is called after the application’s Quit menu item has been selected, or after the terminate: + * method has been called. Generally, you should return NSTerminateNow to allow the termination to complete, but + * you can cancel the termination process or delay it somewhat as needed. For example, you might delay + * termination to finish processing some critical data but then terminate the application as soon as you are + * done by calling the replyToApplicationShouldTerminate: method. + * + * @param app The application object that is about to be terminated. + * @return One of the values defined in NSApplicationTerminateReply constants indicating whether the application + * should terminate. For compatibility reasons, a return value of NO is equivalent to NSTerminateCancel, and a + * return value of YES is equivalent to NSTerminateNow. + */ + open fun applicationShouldTerminate(app: NSApplication?): NSUInteger? + + fun applicationWillTerminate(notification: NSNotification?) { + if (log.isDebugEnabled()) { + log.debug(notification) + } + } + + /** + * Invoked when the user closes the last window the application has open. + * + * + * The application sends this message to your delegate when the application’s last window is closed. It sends + * this message regardless of whether there are still panels open. (A panel in this case is defined as being an + * instance of NSPanel or one of its subclasses.) + * + * + * If your implementation returns NO, control returns to the main event loop and the application is not + * terminated. If you return YES, your delegate’s applicationShouldTerminate: method is subsequently invoked to + * confirm that the application should be terminated. + * + * @param app The application object whose last window was closed. + * @return NO if the application should not be terminated when its last window is closed; otherwise, YES to + * terminate the application. + */ + open fun applicationShouldTerminateAfterLastWindowClosed(app: NSApplication?): Boolean + + /** + * Sent by the default notification center immediately before the application becomes active. + * + * @param notification A notification named NSApplicationWillBecomeActiveNotification. Calling the object method + * of this notification returns the NSApplication object itself. + */ + fun applicationWillBecomeActive(notification: NSNotification?) { + if (log.isDebugEnabled()) { + log.debug(notification) + } + } + + /** + * Sent by the default notification center immediately after the application becomes active. + * + * @param notification A notification named NSApplicationDidBecomeActiveNotification. Calling the object method + * of this notification returns the NSApplication object itself. + */ + fun applicationDidBecomeActive(notification: NSNotification?) { + if (log.isDebugEnabled()) { + log.debug(notification) + } + } + + /** + * Sent by the default notification center immediately before the application is deactivated. + * + * @param notification A notification named NSApplicationWillResignActiveNotification. Calling the object method + * of this notification returns the NSApplication object itself. + */ + fun applicationWillResignActive(notification: NSNotification?) { + if (log.isDebugEnabled()) { + log.debug(notification) + } + } + + /** + * Sent by the default notification center immediately after the application is deactivated. + * + * @param notification A notification named NSApplicationDidResignActiveNotification. Calling the object method + * of this notification returns the NSApplication object itself. + */ + fun applicationDidResignActive(notification: NSNotification?) { + if (log.isDebugEnabled()) { + log.debug(notification) + } + } + } + + interface _Class : ObjCClass { + /** + * Returns the application instance, creating it if it doesn’t exist yet. + * + * + * This method also makes a connection to the window server and completes other initialization. Your program + * should invoke this method as one of the first statements in main(); + * + * @return The shared application object. + */ + open fun sharedApplication(): NSApplication + } + + abstract fun windows(): NSArray? + + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : :108* + */ + abstract fun setDelegate(anObject: ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :109* + */ + abstract fun delegate(): ID? + + /** + * Original signature : `NSGraphicsContext* context()`

+ * *native declaration : :110* + */ + abstract fun context(): com.sun.jna.Pointer? + + /** + * Original signature : `void hide(id)`

+ * *native declaration : :111* + */ + abstract fun hide(sender: ID?) + + /** + * Original signature : `void unhide(id)`

+ * *native declaration : :112* + */ + abstract fun unhide(sender: ID?) + + /** + * Original signature : `void unhideWithoutActivation()`

+ * *native declaration : :113* + */ + abstract fun unhideWithoutActivation() + + /** + * Original signature : `NSWindow* windowWithWindowNumber(NSInteger)`

+ * *native declaration : :114* + */ + abstract fun windowWithWindowNumber(windowNum: Int): NSWindow? + + /** + * Original signature : `NSWindow* mainWindow()`

+ * *native declaration : :115* + */ + abstract fun mainWindow(): NSWindow? + + /** + * Original signature : `NSWindow* keyWindow()`

+ * *native declaration : :116* + */ + abstract fun keyWindow(): NSWindow? + + /** + * Original signature : `BOOL isActive()`

+ * *native declaration : :117* + */ + abstract fun isActive(): Boolean + + /** + * Original signature : `BOOL isHidden()`

+ * *native declaration : :118* + */ + abstract fun isHidden(): Boolean + + /** + * Original signature : `BOOL isRunning()`

+ * *native declaration : :119* + */ + abstract fun isRunning(): Boolean + + /** + * Original signature : `void deactivate()`

+ * *native declaration : :120* + */ + abstract fun deactivate() + + /** + * Original signature : `void activateIgnoringOtherApps(BOOL)`

+ * *native declaration : :121* + */ + abstract fun activateIgnoringOtherApps(flag: Boolean) + + /** + * Original signature : `void hideOtherApplications(id)`

+ * *native declaration : :123* + */ + abstract fun hideOtherApplications(sender: ID?) + + /** + * Original signature : `void unhideAllApplications(id)`

+ * *native declaration : :124* + */ + abstract fun unhideAllApplications(sender: ID?) + + /** + * Original signature : `void finishLaunching()`

+ * *native declaration : :126* + */ + abstract fun finishLaunching() + + /** + * Original signature : `void run()`

+ * *native declaration : :127* + */ + abstract fun run() + + /** + * Original signature : `NSInteger runModalForWindow(NSWindow*)`

+ * *native declaration : :128* + */ + abstract fun runModalForWindow(theWindow: NSWindow?): NSInteger? + + /** + * Original signature : `void stop(id)`

+ * *native declaration : :129* + */ + abstract fun stop(sender: ID?) + + /** + * Original signature : `void stopModal()`

+ * *native declaration : :130* + */ + abstract fun stopModal() + + /** + * Original signature : `void stopModalWithCode(NSInteger)`

+ * *native declaration : :131* + */ + abstract fun stopModalWithCode(returnCode: Int) + + /** + * Original signature : `void abortModal()`

+ * *native declaration : :132* + */ + abstract fun abortModal() + + /** + * Original signature : `NSWindow* modalWindow()`

+ * *native declaration : :133* + */ + abstract fun modalWindow(): NSWindow? + + /** + * Original signature : `NSModalSession beginModalSessionForWindow(NSWindow*)`

+ * *native declaration : :134* + */ + abstract fun beginModalSessionForWindow(theWindow: NSWindow?): com.sun.jna.Pointer? + + /** + * Original signature : `NSInteger runModalSession(NSModalSession)`

+ * *native declaration : :135* + */ + abstract fun runModalSession(session: com.sun.jna.Pointer?): NSInteger? + + /** + * Original signature : `void endModalSession(NSModalSession)`

+ * *native declaration : :136* + */ + abstract fun endModalSession(session: com.sun.jna.Pointer?) + + /** + * Original signature : `void terminate(id)`

+ * *native declaration : :137* + */ + abstract fun terminate(sender: ID?) + + /** + * A key value coding compliant get-accessor for the orderedDocuments to-many-relationship declared in Cocoa's + * definition of the Standard Suite. Return an array of currently open scriptable documents, in a predictable order + * that will be meaningful to script writers. NSApplication's implementation of this method returns pointers to all + * NSDocuments in the front-to-back order of each document's frontmost window. NSDocuments that have no associated + * windows are at the end of the array.

Original signature : `NSArray* orderedDocuments()`

+ * *from NSScripting native declaration : :14* + */ + abstract fun orderedDocuments(): NSArray? + + /** + * A key value coding compliant get-accessor for the orderedWindows to-many-relationship declared in Cocoa's + * definition of the Standard Suite. Return an array of currently open scriptable windows, including hidden + * windows, but typically not includings things like panels.

Original signature : `NSArray* + * orderedWindows()`

+ * *from NSScripting native declaration : :17* + */ + abstract fun orderedWindows(): NSArray? + /** + * *native declaration : :138*

+ * Conversion Error : / **

+ * * inform the user that this application needs attention - call this method only if your application is not already active

+ * * Original signature : `NSInteger requestUserAttention(null)`

+ * * /

+ * - (NSInteger)requestUserAttention:(null)requestType; (Argument requestType cannot be converted) + */ + /** + * Original signature : `void cancelUserAttentionRequest(NSInteger)`

+ * *native declaration : :139* + */ + abstract fun cancelUserAttentionRequest(request: Int) + + /** + * *native declaration : :149*

+ * Conversion Error : / **

* * Present a sheet on the given window. When the modal session is ended,

* * + * the didEndSelector will be invoked in the modalDelegate. The didEndSelector

* * should have the following + * signature, and will be invoked when the modal session ends.

* * This method should dimiss the sheet using + * orderOut:

* * - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void + * *)contextInfo;

* *

* Original signature : `void beginSheet(NSWindow*, NSWindow*, id, null, + * void*)`

* /

- (void)beginSheet:(NSWindow*)sheet modalForWindow:(NSWindow*)docWindow + * modalDelegate:(id)modalDelegate didEndSelector:(null)didEndSelector contextInfo:(void*)contextInfo; (Argument + * didEndSelector cannot be converted) + */ + abstract fun beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo( + sheet: NSWindow?, + docWindow: NSWindow?, + modalDelegate: ID?, + didEndSelector: Selector?, + contextInfo: ID? + ) + + fun beginSheet( + sheet: NSWindow?, + docWindow: NSWindow?, + modalDelegate: ID?, + didEndSelector: Selector?, + contextInfo: ID? + ) { + this.beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo( + sheet, + docWindow, + modalDelegate, + didEndSelector, + contextInfo + ) + } + + /** + * Original signature : `void endSheet(NSWindow*)`

+ * *native declaration : :150* + */ + abstract fun endSheet(sheet: NSWindow?) + + /** + * Original signature : `void endSheet(NSWindow*, NSInteger)`

+ * *native declaration : :151* + */ + abstract fun endSheet_returnCode(sheet: NSWindow?, returnCode: Int) + + fun endSheet(sheet: NSWindow?, returnCode: Int) { + this.endSheet_returnCode(sheet, returnCode) + } + + /** + * * runModalForWindow:relativeToWindow: is deprecated.

* Please use beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:

+ * Original signature : `NSInteger runModalForWindow(NSWindow*, NSWindow*)`

+ * *native declaration : :157* + */ + abstract fun runModalForWindow_relativeToWindow(theWindow: NSWindow?, docWindow: NSWindow?): NSInteger? + + /** + * * beginModalSessionForWindow:relativeToWindow: is deprecated.

* Please use + * beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:

Original signature : `NSModalSession + * beginModalSessionForWindow(NSWindow*, NSWindow*)`

+ * *native declaration : :163* + */ + abstract fun beginModalSessionForWindow_relativeToWindow( + theWindow: NSWindow?, + docWindow: NSWindow? + ): com.sun.jna.Pointer? + + /** + * Original signature : `NSEvent* nextEventMatchingMask(NSUInteger, NSDate*, NSString*, BOOL)`

+ * *native declaration : :164* + */ + abstract fun nextEventMatchingMask_untilDate_inMode_dequeue( + mask: Int, + expiration: NSDate?, + mode: String?, + deqFlag: Boolean + ): com.sun.jna.Pointer? + + /** + * Original signature : `void discardEventsMatchingMask(NSUInteger, NSEvent*)`

+ * *native declaration : :165* + */ + abstract fun discardEventsMatchingMask_beforeEvent(mask: Int, lastEvent: com.sun.jna.Pointer?) + + /** + * Original signature : `void postEvent(NSEvent*, BOOL)`

+ * *native declaration : :166* + */ + abstract fun postEvent_atStart(event: NSEvent?, flag: Boolean) + + /** + * Original signature : `NSEvent* currentEvent()`

+ * *native declaration : :167* + */ + abstract fun currentEvent(): NSEvent? + + /** + * Original signature : `void sendEvent(NSEvent*)`

+ * *native declaration : :169* + */ + abstract fun sendEvent(event: NSEvent?) + + /** + * Original signature : `void preventWindowOrdering()`

+ * *native declaration : :170* + */ + abstract fun preventWindowOrdering() + + /** + * *native declaration : :171*

+ * Conversion Error : /// Original signature : `NSWindow* makeWindowsPerform(null, BOOL)`

+ * - (NSWindow*)makeWindowsPerform:(null)aSelector inOrder:(BOOL)flag; (Argument aSelector cannot be converted) + */ + /** + * Original signature : `void setWindowsNeedUpdate(BOOL)`

+ * *native declaration : :173* + */ + abstract fun setWindowsNeedUpdate(needUpdate: Boolean) + + /** + * Original signature : `void updateWindows()`

+ * *native declaration : :174* + */ + abstract fun updateWindows() + + /** + * Original signature : `void setMainMenu(NSMenu*)`

+ * *native declaration : :176* + */ + abstract fun setMainMenu(aMenu: NSMenu?) + + /** + * Original signature : `NSMenu* mainMenu()`

+ * *native declaration : :177* + */ + abstract fun mainMenu(): NSMenu? + + /** + * Original signature : `void setApplicationIconImage(NSImage*)`

+ * *native declaration : :179* + */ + abstract fun setApplicationIconImage(image: NSImage?) + + /** + * Original signature : `NSImage* applicationIconImage()`

+ * *native declaration : :180* + */ + abstract fun applicationIconImage(): NSImage? + + /** + * Original signature : `NSDockTile* dockTile()`

+ * *native declaration : :183* + */ + abstract fun dockTile(): NSDockTile? + /** + * *native declaration : :186*

+ * Conversion Error : /// Original signature : `BOOL sendAction(null, id, id)`

+ * - (BOOL)sendAction:(null)theAction to:(id)theTarget from:(id)sender; (Argument theAction cannot be converted) + */ + /** + * *native declaration : :187*

+ * Conversion Error : /// Original signature : `id targetForAction(null)`

+ * - (id)targetForAction:(null)theAction; (Argument theAction cannot be converted) + */ + /** + * *native declaration : :188*

+ * Conversion Error : /// Original signature : `id targetForAction(null, id, id)`

+ * - (id)targetForAction:(null)theAction to:(id)theTarget from:(id)sender; (Argument theAction cannot be converted) + */ + /** + * *native declaration : :189*

+ * Conversion Error : /// Original signature : `BOOL tryToPerform(null, id)`

+ * - (BOOL)tryToPerform:(null)anAction with:(id)anObject; (Argument anAction cannot be converted) + */ + /** + * Original signature : `id validRequestorForSendType(NSString*, NSString*)`

+ * *native declaration : :190* + */ + abstract fun validRequestorForSendType_returnType(sendType: String?, returnType: String?): ID? + + /** + * Original signature : `void reportException(NSException*)`

+ * *native declaration : :192* + */ + abstract fun reportException(theException: com.sun.jna.Pointer?) + + /** + * If an application delegate returns NSTerminateLater from -applicationShouldTerminate:, + * -replyToApplicationShouldTerminate: must be called with YES or NO once the application decides if it can + * terminate

Original signature : `void replyToApplicationShouldTerminate(BOOL)`

+ * *native declaration : :196* + */ + abstract fun replyToApplicationShouldTerminate(shouldTerminate: Boolean) + + /** + * *native declaration : :200*

+ * Conversion Error : / **

+ * * If an application delegate encounters an error while handling -application:openFiles: or -application:printFiles:, -replyToOpenOrPrint: should be called with NSApplicationDelegateReplyFailure. If the user cancels the operation, NSApplicationDelegateReplyCancel should be used, and if the operation succeeds, NSApplicationDelegateReplySuccess should be used

+ * * Original signature : `void replyToOpenOrPrint(null)`

+ * * /

+ * - (void)replyToOpenOrPrint:(null)reply; (Argument reply cannot be converted) + */ + /** + * Opens the character palette

Original signature : `void orderFrontCharacterPalette(id)`

+ * *native declaration : :204* + */ + abstract fun orderFrontCharacterPalette(sender: ID?) + + /** + * Original signature : `void setWindowsMenu(NSMenu*)`

+ * *from NSWindowsMenu native declaration : :209* + */ + abstract fun setWindowsMenu(aMenu: NSMenu?) + + /** + * Original signature : `NSMenu* windowsMenu()`

+ * *from NSWindowsMenu native declaration : :210* + */ + abstract fun windowsMenu(): NSMenu? + + /** + * Original signature : `void arrangeInFront(id)`

+ * *from NSWindowsMenu native declaration : :211* + */ + abstract fun arrangeInFront(sender: ID?) + + /** + * Original signature : `void removeWindowsItem(NSWindow*)`

+ * *from NSWindowsMenu native declaration : :212* + */ + abstract fun removeWindowsItem(win: NSWindow?) + + /** + * Original signature : `void addWindowsItem(NSWindow*, NSString*, BOOL)`

+ * *from NSWindowsMenu native declaration : :213* + */ + abstract fun addWindowsItem_title_filename(win: NSWindow?, aString: String?, isFilename: Boolean) + + /** + * Original signature : `void changeWindowsItem(NSWindow*, NSString*, BOOL)`

+ * *from NSWindowsMenu native declaration : :214* + */ + abstract fun changeWindowsItem_title_filename(win: NSWindow?, aString: String?, isFilename: Boolean) + + /** + * Original signature : `void updateWindowsItem(NSWindow*)`

+ * *from NSWindowsMenu native declaration : :215* + */ + abstract fun updateWindowsItem(win: NSWindow?) + + /** + * Original signature : `void miniaturizeAll(id)`

+ * *from NSWindowsMenu native declaration : :216* + */ + abstract fun miniaturizeAll(sender: ID?) + + /** + * Original signature : `void setServicesMenu(NSMenu*)`

+ * *from NSServicesMenu native declaration : :275* + */ + abstract fun setServicesMenu(aMenu: NSMenu?) + + /** + * Original signature : `NSMenu* servicesMenu()`

+ * *from NSServicesMenu native declaration : :276* + */ + abstract fun servicesMenu(): NSMenu? + + /** + * Original signature : `void registerServicesMenuSendTypes(NSArray*, NSArray*)`

+ * *from NSServicesMenu native declaration : :277* + */ + abstract fun registerServicesMenuSendTypes_returnTypes(sendTypes: NSArray?, returnTypes: NSArray?) + + /** + * Original signature : `void setServicesProvider(id)`

+ * *from NSServicesHandling native declaration : :286* + */ + abstract fun setServicesProvider(provider: ID?) + + /** + * Original signature : `id servicesProvider()`

+ * *from NSServicesHandling native declaration : :287* + */ + abstract fun servicesProvider(): NSObject? + + /** + * Original signature : `void orderFrontStandardAboutPanel(id)`

+ * *from NSStandardAboutPanel native declaration : :291* + */ + abstract fun orderFrontStandardAboutPanel(sender: ID?) + + /** + * Original signature : `void orderFrontStandardAboutPanelWithOptions(NSDictionary*)`

+ * *from NSStandardAboutPanel native declaration : :292* + */ + abstract fun orderFrontStandardAboutPanelWithOptions(optionsDictionary: NSDictionary?) + + abstract fun setActivationPolicy(activationPolicy: Int) + + abstract fun activationPolicy(): Int + + enum class NSApplicationActivationPolicy { + /* The application is an ordinary app that appears in the Dock and may have a user interface. This is the + default for bundled apps, unless overridden in the Info.plist. */ + NSApplicationActivationPolicyRegular, + + /* The application does not appear in the Dock and does not have a menu bar, but it may be activated + programmatically or by clicking on one of its windows. This corresponds to LSUIElement=1 in the Info.plist. */ + NSApplicationActivationPolicyAccessory + } + + companion object { + private val CLASS: _Class = Rococoa.createClass("NSApplication", _Class::class.java) //$NON-NLS-1$ + + private val log = LogManager.getLogger(NSApplication::class.java) + + val NSTerminateCancel: NSUInteger? = NSUInteger(0) + val NSTerminateNow: NSUInteger? = NSUInteger(1) + val NSTerminateLater: NSUInteger? = NSUInteger(2) + + fun sharedApplication(): NSApplication { + return CLASS.sharedApplication() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSArray.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSArray.kt new file mode 100644 index 00000000..1b78e24a --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSArray.kt @@ -0,0 +1,284 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.ObjCObjectByReference +import org.rococoa.Rococoa +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :14 +abstract class NSArray : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `id array()`

+ * *from NSArrayCreation native declaration : :60* + */ + fun array(): NSArray + + /** + * Original signature : `id arrayWithObject(id)`

+ * *from NSArrayCreation native declaration : :61* + */ + fun arrayWithObject(anObject: NSObject?): NSArray + + fun arrayWithObject(anObject: String?): NSArray? + + /** + * Original signature : `id arrayWithObjects(const id*, NSUInteger)`

+ * *from NSArrayCreation native declaration : :62* + */ + fun arrayWithObjects_count(objects: NSObject?, cnt: NSUInteger?): NSArray? + + /** + * Original signature : `id arrayWithObjects(id, null)`

+ * *from NSArrayCreation native declaration : :63* + */ + fun arrayWithObjects(vararg varargs: NSObject?): NSArray + + fun arrayWithObjects(vararg varargs: String?): NSArray + + /** + * Original signature : `id arrayWithArray(NSArray*)`

+ * *from NSArrayCreation native declaration : :64* + */ + fun arrayWithArray(array: NSArray?): NSArray? + + /** + * Original signature : `id arrayWithContentsOfFile(NSString*)`

+ * *from NSArrayCreation native declaration : :71* + */ + fun arrayWithContentsOfFile(path: String?): NSArray + + /** + * Original signature : `id arrayWithContentsOfURL(NSURL*)`

+ * *from NSArrayCreation native declaration : :72* + */ + fun arrayWithContentsOfURL(url: NSURL?): NSArray + } + + abstract fun init(): NSArray? + + /** + * Original signature : `NSUInteger count()`

+ * *native declaration : :16* + */ + abstract fun count(): NSUInteger? + + /** + * Original signature : `objectAtIndex(NSUInteger)`

+ * *native declaration : :17* + */ + abstract fun objectAtIndex(index: NSUInteger?): NSObject? + + /** + * *from NSExtendedArray native declaration : :23*

+ * Conversion Error : /// Original signature : `NSArray* arrayByAddingObject(null)`

+ * - (NSArray*)arrayByAddingObject:(null)anObject; (Argument anObject cannot be converted) + */ + /** + * Original signature : `NSArray* arrayByAddingObjectsFromArray(NSArray*)`

+ * *from NSExtendedArray native declaration : :24* + */ + abstract fun arrayByAddingObjectsFromArray(otherArray: NSArray?): NSArray? + + /** + * Original signature : `NSString* componentsJoinedByString(NSString*)`

+ * *from NSExtendedArray native declaration : :25* + */ + abstract fun componentsJoinedByString(separator: String?): String? + /** + * *from NSExtendedArray native declaration : :26*

+ * Conversion Error : /// Original signature : `BOOL containsObject(null)`

+ * - (BOOL)containsObject:(null)anObject; (Argument anObject cannot be converted) + */ + /** + * *from NSExtendedArray native declaration : :28*

+ * Conversion Error : /// Original signature : `NSString* descriptionWithLocale(null)`

+ * - (NSString*)descriptionWithLocale:(null)locale; (Argument locale cannot be converted) + */ + /** + * *from NSExtendedArray native declaration : :29*

+ * Conversion Error : /// Original signature : `NSString* descriptionWithLocale(null, NSUInteger)`

+ * - (NSString*)descriptionWithLocale:(null)locale indent:(NSUInteger)level; (Argument locale cannot be converted) + */ + /** + * Original signature : `firstObjectCommonWithArray(NSArray*)`

+ * *from NSExtendedArray native declaration : :30* + */ + abstract fun firstObjectCommonWithArray(otherArray: NSArray?): NSObject? + + /** + * Original signature : `void getObjects(id*)`

+ * *from NSExtendedArray native declaration : :31* + */ + abstract fun getObjects(objects: ObjCObjectByReference?) + /** + * *from NSExtendedArray native declaration : :32*

+ * Conversion Error : /// Original signature : `void getObjects(id*, null)`

+ * - (void)getObjects:(id*)objects range:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `NSUInteger indexOfObject(id)`

+ * *from NSExtendedArray native declaration : :33* + */ + abstract fun indexOfObject(anObject: NSObject?): NSUInteger? + /** + * *from NSExtendedArray native declaration : :34*

+ * Conversion Error : /// Original signature : `NSUInteger indexOfObject(id, null)`

+ * - (NSUInteger)indexOfObject:(id)anObject inRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `NSUInteger indexOfObjectIdenticalTo(id)`

+ * *from NSExtendedArray native declaration : :35* + */ + abstract fun indexOfObjectIdenticalTo(anObject: NSObject?): NSUInteger? + /** + * *from NSExtendedArray native declaration : :36*

+ * Conversion Error : /// Original signature : `NSUInteger indexOfObjectIdenticalTo(id, null)`

+ * - (NSUInteger)indexOfObjectIdenticalTo:(id)anObject inRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `BOOL isEqualToArray(NSArray*)`

+ * *from NSExtendedArray native declaration : :37* + */ + abstract fun isEqualToArray(otherArray: NSArray?): Byte + + /** + * Original signature : `id lastObject()`

+ * *from NSExtendedArray native declaration : :38* + */ + abstract fun lastObject(): NSObject? + + /** + * Original signature : `NSEnumerator* objectEnumerator()`

+ * *from NSExtendedArray native declaration : :39* + */ + abstract fun objectEnumerator(): NSEnumerator? + + /** + * Original signature : `NSEnumerator* reverseObjectEnumerator()`

+ * *from NSExtendedArray native declaration : :40* + */ + abstract fun reverseObjectEnumerator(): NSEnumerator? + + /** + * Original signature : `NSData* sortedArrayHint()`

+ * *from NSExtendedArray native declaration : :41* + */ + abstract fun sortedArrayHint(): NSData? + + /** + * *from NSExtendedArray native declaration : :44*

+ * Conversion Error : /// Original signature : `NSArray* sortedArrayUsingSelector(null)`

+ * - (NSArray*)sortedArrayUsingSelector:(null)comparator; (Argument comparator cannot be converted) + */ + /** + * *from NSExtendedArray native declaration : :45*

+ * Conversion Error : /// Original signature : `NSArray* subarrayWithRange(null)`

+ * - (NSArray*)subarrayWithRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `BOOL writeToFile(NSString*, BOOL)`

+ * *from NSExtendedArray native declaration : :46* + */ + abstract fun writeToFile_atomically(path: String?, useAuxiliaryFile: Boolean): Boolean + + fun writeToFile(path: String?): Boolean { + return this.writeToFile_atomically(path, true) + } + + /** + * Original signature : `BOOL writeToURL(NSURL*, BOOL)`

+ * *from NSExtendedArray native declaration : :47* + */ + abstract fun writeToURL_atomically(url: NSURL?, atomically: Boolean): Boolean + + fun writeToURL(url: NSURL?): Boolean { + return this.writeToURL_atomically(url, true) + } + + /** + * *from NSExtendedArray native declaration : :49*

+ * Conversion Error : /// Original signature : `void makeObjectsPerformSelector(null)`

+ * - (void)makeObjectsPerformSelector:(null)aSelector; (Argument aSelector cannot be converted) + */ + /** + * *from NSExtendedArray native declaration : :50*

+ * Conversion Error : /// Original signature : `void makeObjectsPerformSelector(null, id)`

+ * - (void)makeObjectsPerformSelector:(null)aSelector withObject:(id)argument; (Argument aSelector cannot be converted) + */ + /** + * Original signature : `NSArray* objectsAtIndexes(NSIndexSet*)`

+ * *from NSExtendedArray native declaration : :53* + */ + abstract fun objectsAtIndexes(indexes: NSIndexSet?): NSArray? + + /** + * Original signature : `id initWithObjects(const id*, NSUInteger)`

+ * *from NSArrayCreation native declaration : :66* + */ + abstract fun initWithObjects_count(objects: ObjCObjectByReference?, cnt: NSUInteger?): NSArray? + + /** + * Original signature : `id initWithObjects(id, null)`

+ * *from NSArrayCreation native declaration : :67* + */ + abstract fun initWithObjects(vararg varargs: NSObject?): NSArray? + + abstract fun initWithObjects(vararg varargs: String?): NSArray? + + /** + * Original signature : `id initWithArray(NSArray*)`

+ * *from NSArrayCreation native declaration : :68* + */ + abstract fun initWithArray(array: NSArray?): NSArray? + + /** + * Original signature : `id initWithArray(NSArray*, BOOL)`

+ * *from NSArrayCreation native declaration : :69* + */ + abstract fun initWithArray_copyItems(array: NSArray?, flag: Byte): NSArray? + + /** + * Original signature : `id initWithContentsOfFile(NSString*)`

+ * *from NSArrayCreation native declaration : :73* + */ + abstract fun initWithContentsOfFile(path: String?): NSArray? + + /** + * Original signature : `id initWithContentsOfURL(NSURL*)`

+ * *from NSArrayCreation native declaration : :74* + */ + abstract fun initWithContentsOfURL(url: NSURL?): NSArray? + + companion object { + val CLASS: _Class = Rococoa.createClass("NSArray", _Class::class.java) + + fun array(): NSArray { + return CLASS.array() + } + + fun arrayWithContentsOfFile(path: String?): NSArray { + return CLASS.arrayWithContentsOfFile(path) + } + + fun arrayWithContentsOfURL(url: NSURL?): NSArray { + return CLASS.arrayWithContentsOfURL(url) + } + + fun arrayWithObject(anObject: NSObject?): NSArray { + return CLASS.arrayWithObject(anObject) + } + + fun arrayWithObject(anObject: String?): NSArray { + return CLASS.arrayWithObject(NSString.stringWithString(anObject)) + } + + fun arrayWithObjects(vararg arrayWithObjects: NSObject?): NSArray { + return CLASS.arrayWithObjects(*arrayWithObjects) + } + + fun arrayWithObjects(vararg arrayWithObjects: String?): NSArray { + return CLASS.arrayWithObjects(*arrayWithObjects) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAttributedString.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAttributedString.kt new file mode 100644 index 00000000..31ffa57f --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSAttributedString.kt @@ -0,0 +1,392 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.ObjCObjectByReference +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:9 +abstract class NSAttributedString : NSObject() { + interface _Class : ObjCClass { + /** + * Methods to determine what types can be loaded as NSAttributedStrings.

+ * Original signature : `NSArray* textTypes()`

+ * *from NSAttributedStringKitAdditions native declaration : :183* + */ + open fun textTypes(): NSArray? + + /** + * Original signature : `NSArray* textUnfilteredTypes()`

+ * *from NSAttributedStringKitAdditions native declaration : :184* + */ + open fun textUnfilteredTypes(): NSArray? + + /** + * Methods that were deprecated in Mac OS 10.5. You can now use +textTypes and +textUnfilteredTypes to get arrays of Uniform Type Identifiers (UTIs).

+ * Original signature : `NSArray* textFileTypes()`

+ * *from NSDeprecatedKitAdditions native declaration : :249* + */ + open fun textFileTypes(): NSArray? + + /** + * Original signature : `NSArray* textPasteboardTypes()`

+ * *from NSDeprecatedKitAdditions native declaration : :250* + */ + open fun textPasteboardTypes(): NSArray? + + /** + * Original signature : `NSArray* textUnfilteredFileTypes()`

+ * *from NSDeprecatedKitAdditions native declaration : :251* + */ + open fun textUnfilteredFileTypes(): NSArray? + + /** + * Original signature : `NSArray* textUnfilteredPasteboardTypes()`

+ * *from NSDeprecatedKitAdditions native declaration : :252* + */ + open fun textUnfilteredPasteboardTypes(): NSArray? + + open fun alloc(): NSAttributedString + } + + /** + * Original signature : `NSString* string()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:11* + */ + abstract fun string(): String? + /** + * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:12*

+ * Conversion Error : /// Original signature : `NSDictionary* attributesAtIndex(NSUInteger, null)`

+ * - (NSDictionary*)attributesAtIndex:(NSUInteger)location effectiveRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `NSUInteger length()`

+ * *from NSExtendedAttributedString native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:18* + */ + abstract fun length(): NSUInteger? + /** + * *from NSExtendedAttributedString native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:19*

+ * Conversion Error : /// Original signature : `attribute(NSString*, NSUInteger, null)`

+ * - (null)attribute:(NSString*)attrName atIndex:(NSUInteger)location effectiveRange:(null)range; (Argument range cannot be converted) + */ + /** + * *from NSExtendedAttributedString native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:20*

+ * Conversion Error : /// Original signature : `NSAttributedString* attributedSubstringFromRange(null)`

+ * - (NSAttributedString*)attributedSubstringFromRange:(null)range; (Argument range cannot be converted) + */ + /** + * *from NSExtendedAttributedString native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:22*

+ * Conversion Error : /// Original signature : `NSDictionary* attributesAtIndex(NSUInteger, null, null)`

+ * - (NSDictionary*)attributesAtIndex:(NSUInteger)location longestEffectiveRange:(null)range inRange:(null)rangeLimit; (Argument range cannot be converted) + */ + /** + * *from NSExtendedAttributedString native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:23*

+ * Conversion Error : /// Original signature : `attribute(NSString*, NSUInteger, null, null)`

+ * - (null)attribute:(NSString*)attrName atIndex:(NSUInteger)location longestEffectiveRange:(null)range inRange:(null)rangeLimit; (Argument range cannot be converted) + */ + /** + * Original signature : `BOOL isEqualToAttributedString(NSAttributedString*)`

+ * *from NSExtendedAttributedString native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:25* + */ + abstract fun isEqualToAttributedString(other: NSAttributedString?): Byte + + /** + * Original signature : `initWithString(NSString*)`

+ * *from NSExtendedAttributedString native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:27* + */ + abstract fun initWithString(str: String?): NSAttributedString? + + /** + * Original signature : `initWithString(String*, NSDictionary*)`

+ * *from NSExtendedAttributedString native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:28* + */ + abstract fun initWithString_attributes(str: String?, attrs: NSDictionary?): NSAttributedString? + + /** + * Original signature : `initWithAttributedString(NSAttributedString*)`

+ * *from NSExtendedAttributedString native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:29* + */ + abstract fun initWithAttributedString(attrStr: NSAttributedString?): NSAttributedString? + /** + * *from NSAttributedStringKitAdditions native declaration : :156*

+ * Conversion Error : / **

+ * * Attributes which should be copied/pasted with "copy font".

+ * * Original signature : `NSDictionary* fontAttributesInRange(null)`

+ * * /

+ * - (NSDictionary*)fontAttributesInRange:(null)range; (Argument range cannot be converted) + */ + /** + * *from NSAttributedStringKitAdditions native declaration : :160*

+ * Conversion Error : / **

+ * * Attributes which should be copied/pasted with "copy ruler".

+ * * Original signature : `NSDictionary* rulerAttributesInRange(null)`

+ * * /

+ * - (NSDictionary*)rulerAttributesInRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `BOOL containsAttachments()`

+ * *from NSAttributedStringKitAdditions native declaration : :162* + */ + abstract fun containsAttachments(): Byte + /** + * *from NSAttributedStringKitAdditions native declaration : :166*

+ * Conversion Error : / **

+ * * Returns NSNotFound if no line break location found in the specified range; otherwise returns the index of the first character that should go on the NEXT line.

+ * * Original signature : `NSUInteger lineBreakBeforeIndex(NSUInteger, null)`

+ * * /

+ * - (NSUInteger)lineBreakBeforeIndex:(NSUInteger)location withinRange:(null)aRange; (Argument aRange cannot be converted) + */ + /** + * *from NSAttributedStringKitAdditions native declaration : :168*

+ * Conversion Error : /// Original signature : `NSUInteger lineBreakByHyphenatingBeforeIndex(NSUInteger, null)`

+ * - (NSUInteger)lineBreakByHyphenatingBeforeIndex:(NSUInteger)location withinRange:(null)aRange; (Argument aRange cannot be converted) + */ + /** + * Original signature : `doubleClickAtIndex(NSUInteger)`

+ * *from NSAttributedStringKitAdditions native declaration : :171* + */ + abstract fun doubleClickAtIndex(location: NSUInteger?): NSObject? + + /** + * Original signature : `NSUInteger nextWordFromIndex(NSUInteger, BOOL)`

+ * *from NSAttributedStringKitAdditions native declaration : :172* + */ + abstract fun nextWordFromIndex_forward(location: NSUInteger?, isForward: Byte): NSUInteger? + /** + * *from NSAttributedStringKitAdditions native declaration : :177*

+ * Conversion Error : / **

+ * * Returns a URL either from a link attribute or from text at the given location that appears to be a URL string, for use in automatic link detection. The effective range is the range of the link attribute or URL string.

+ * * Original signature : `NSURL* URLAtIndex(NSUInteger, null)`

+ * * /

+ * - (NSURL*)URLAtIndex:(NSUInteger)location effectiveRange:(null)effectiveRange; (Argument effectiveRange cannot be converted) + */ + /** + * Convenience methods for calculating the range of an individual text block, range of an entire table, range of a list, and the index within a list.

+ * Original signature : `rangeOfTextBlock(NSTextBlock*, NSUInteger)`

+ * *from NSAttributedStringKitAdditions native declaration : :190* + */ + abstract fun rangeOfTextBlock_atIndex(block: com.sun.jna.Pointer?, location: NSUInteger?): NSObject? + + /** + * Original signature : `rangeOfTextTable(NSTextTable*, NSUInteger)`

+ * *from NSAttributedStringKitAdditions native declaration : :191* + */ + abstract fun rangeOfTextTable_atIndex(table: com.sun.jna.Pointer?, location: NSUInteger?): NSObject? + + /** + * Original signature : `rangeOfTextList(NSTextList*, NSUInteger)`

+ * *from NSAttributedStringKitAdditions native declaration : :192* + */ + abstract fun rangeOfTextList_atIndex(list: com.sun.jna.Pointer?, location: NSUInteger?): NSObject? + + /** + * Original signature : `NSInteger itemNumberInTextList(NSTextList*, NSUInteger)`

+ * *from NSAttributedStringKitAdditions native declaration : :193* + */ + abstract fun itemNumberInTextList_atIndex(list: com.sun.jna.Pointer?, location: NSUInteger?): NSInteger? + + /** + * These first two general methods supersede the previous versions shown below. They take a dictionary of options to specify how the document should be loaded. The various possible options are specified above, as NS...DocumentOption. If NSDocumentTypeDocumentOption is specified, the document will be treated as being in the specified format. If NSDocumentTypeDocumentOption is not specified, these methods will examine the document and do their best to load it using whatever format it seems to contain.

+ * Original signature : `initWithURL(NSURL*, NSDictionary*, NSDictionary**, NSError**)`

+ * *from NSAttributedStringKitAdditions native declaration : :201* + */ + abstract fun initWithURL_options_documentAttributes_error( + url: com.sun.jna.Pointer?, + options: NSDictionary?, + dict: ObjCObjectByReference?, + error: ObjCObjectByReference? + ): NSAttributedString? + + /** + * Original signature : `initWithData(NSData*, NSDictionary*, NSDictionary**, NSError**)`

+ * *from NSAttributedStringKitAdditions native declaration : :202* + */ + abstract fun initWithData_options_documentAttributes_error( + data: com.sun.jna.Pointer?, + options: NSDictionary?, + dict: ObjCObjectByReference?, + error: ObjCObjectByReference? + ): NSAttributedString? + + /** + * These two superseded methods are similar to the first listed above except that they lack the options dictionary and error return arguments. They will always attempt to determine the format from the document.

+ * Original signature : `initWithPath(String*, NSDictionary**)`

+ * *from NSAttributedStringKitAdditions native declaration : :207* + */ + abstract fun initWithPath_documentAttributes(path: String?, dict: ObjCObjectByReference?): NSAttributedString? + + /** + * Original signature : `initWithURL(NSURL*, NSDictionary**)`

+ * *from NSAttributedStringKitAdditions native declaration : :208* + */ + abstract fun initWithURL_documentAttributes( + url: com.sun.jna.Pointer?, + dict: ObjCObjectByReference? + ): NSAttributedString? + + /** + * The following methods should now be considered as conveniences for various common document types.

+ * Original signature : `initWithRTF(NSData*, NSDictionary**)`

+ * *from NSAttributedStringKitAdditions native declaration : :212* + */ + abstract fun initWithRTF_documentAttributes( + data: com.sun.jna.Pointer?, + dict: ObjCObjectByReference? + ): NSAttributedString? + + /** + * Original signature : `initWithRTFD(NSData*, NSDictionary**)`

+ * *from NSAttributedStringKitAdditions native declaration : :213* + */ + abstract fun initWithRTFD_documentAttributes( + data: com.sun.jna.Pointer?, + dict: ObjCObjectByReference? + ): NSAttributedString? + + /** + * Original signature : `initWithHTML(NSData*, NSDictionary**)`

+ * *from NSAttributedStringKitAdditions native declaration : :214* + */ + abstract fun initWithHTML_documentAttributes( + data: com.sun.jna.Pointer?, + dict: ObjCObjectByReference? + ): NSAttributedString? + + /** + * Original signature : `initWithHTML(NSData*, NSURL*, NSDictionary**)`

+ * *from NSAttributedStringKitAdditions native declaration : :215* + */ + abstract fun initWithHTML_baseURL_documentAttributes( + data: com.sun.jna.Pointer?, + base: com.sun.jna.Pointer?, + dict: ObjCObjectByReference? + ): NSAttributedString? + + /** + * Original signature : `initWithDocFormat(NSData*, NSDictionary**)`

+ * *from NSAttributedStringKitAdditions native declaration : :217* + */ + abstract fun initWithDocFormat_documentAttributes( + data: com.sun.jna.Pointer?, + dict: ObjCObjectByReference? + ): NSAttributedString? + + /** + * Original signature : `initWithHTML(NSData*, NSDictionary*, NSDictionary**)`

+ * *from NSAttributedStringKitAdditions native declaration : :218* + */ + abstract fun initWithHTML_options_documentAttributes( + data: com.sun.jna.Pointer?, + options: NSDictionary?, + dict: ObjCObjectByReference? + ): NSAttributedString? + + /** + * A separate method is available for initializing from an RTFD file wrapper. No options apply in this case.

+ * Original signature : `initWithRTFDFileWrapper(NSFileWrapper*, NSDictionary**)`

+ * *from NSAttributedStringKitAdditions native declaration : :223* + */ + abstract fun initWithRTFDFileWrapper_documentAttributes( + wrapper: com.sun.jna.Pointer?, + dict: ObjCObjectByReference? + ): NSAttributedString? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSAttributedString", _Class::class.java) + + fun attributedString(str: String?): NSAttributedString? { + var str = str + if (null == str) { + str = "" + } + return CLASS.alloc().initWithString(str) + } + + fun attributedStringWithAttributes(str: String?, attrs: NSDictionary?): NSAttributedString? { + var str = str + if (null == str) { + str = "" + } + return CLASS.alloc().initWithString_attributes(str, attrs) + } + + /** + * *from NSAttributedStringKitAdditions native declaration : :230*

+ * Conversion Error : / **

+ * * These first two methods generalize on the more specific previous versions shown below. They require a document attributes dict specifying at least the NSDocumentTypeDocumentAttribute to determine the format to be written. The file wrapper method will return a directory file wrapper for those document types for which it is appropriate, otherwise a regular-file file wrapper.

+ * * Original signature : `NSData* dataFromRange(null, NSDictionary*, NSError**)`

+ * * /

+ * - (NSData*)dataFromRange:(null)range documentAttributes:(NSDictionary*)dict error:(NSError**)error; (Argument range cannot be converted) + */ + /** + * *from NSAttributedStringKitAdditions native declaration : :231*

+ * Conversion Error : /// Original signature : `NSFileWrapper* fileWrapperFromRange(null, NSDictionary*, NSError**)`

+ * - (NSFileWrapper*)fileWrapperFromRange:(null)range documentAttributes:(NSDictionary*)dict error:(NSError**)error; (Argument range cannot be converted) + */ + /** + * *from NSAttributedStringKitAdditions native declaration : :236*

+ * Conversion Error : / **

+ * * The following methods should now be considered as conveniences for various common document types. In these methods the document attributes dictionary is optional.

+ * * Original signature : `NSData* RTFFromRange(null, NSDictionary*)`

+ * * /

+ * - (NSData*)RTFFromRange:(null)range documentAttributes:(NSDictionary*)dict; (Argument range cannot be converted) + */ + /** + * *from NSAttributedStringKitAdditions native declaration : :237*

+ * Conversion Error : /// Original signature : `NSData* RTFDFromRange(null, NSDictionary*)`

+ * - (NSData*)RTFDFromRange:(null)range documentAttributes:(NSDictionary*)dict; (Argument range cannot be converted) + */ + /** + * *from NSAttributedStringKitAdditions native declaration : :238*

+ * Conversion Error : /// Original signature : `NSFileWrapper* RTFDFileWrapperFromRange(null, NSDictionary*)`

+ * - (NSFileWrapper*)RTFDFileWrapperFromRange:(null)range documentAttributes:(NSDictionary*)dict; (Argument range cannot be converted) + */ + /** + * *from NSAttributedStringKitAdditions native declaration : :240*

+ * Conversion Error : /// Original signature : `NSData* docFormatFromRange(null, NSDictionary*)`

+ * - (NSData*)docFormatFromRange:(null)range documentAttributes:(NSDictionary*)dict; (Argument range cannot be converted) + */ + val FontAttributeName: String? = "NSFont" + val ParagraphStyleAttributeName: String? = "NSParagraphStyle" + val ForegroundColorAttributeName: String? = "NSColor" + val UnderlineStyleAttributeName: String? = "NSUnderline" + val SuperscriptAttributeName: String? = "NSSuperScript" + val BackgroundColorAttributeName: String? = "NSBackgroundColor" + val AttachmentAttributeName: String? = "NSAttachment" + val LigatureAttributeName: String? = "NSLigature" + val BaselineOffsetAttributeName: String? = "NSBaselineOffset" + val KernAttributeName: String? = "NSKern" + val LinkAttributeName: String? = "NSLink" + val CharacterShapeAttributeName: String? = "NSCharacterShape" + val StrokeWidthAttributeName: String? = "NSStrokeWidth" + val StrokeColorAttributeName: String? = "NSStrokeColor" + val UnderlineColorAttributeName: String? = "NSUnderlineColor" + val StrikethroughStyleAttributeName: String? = "NSStrikethrough" + val StrikethroughColorAttributeName: String? = "NSStrikethroughColor" + val ShadowAttributeName: String? = "NSShadow" + val ObliquenessAttributeName: String? = "NSObliqueness" + val ExpansionAttributeName: String? = "NSExpansion" + val CursorAttributeName: String? = "NSCursor" + val ToolTipAttributeName: String? = "NSToolTip" + val NSPlainTextDocumentType: String? = "NSPlainText" + val NSRTFTextDocumentType: String? = "NSRTF" + val NSRTFDTextDocumentType: String? = "NSRTFD" + val NSMacSimpleTextDocumentType: String? = "NSMacSimpleText" + val NSHTMLTextDocumentType: String? = "NSHTML" + val NSDocFormatTextDocumentType: String? = "NSDocFormat" + val NSWordMLTextDocumentType: String? = "NSWordML" + const val UnderlineStyleNone: Int = 0 + const val UnderlineStyleSingle: Int = 1 + const val UnderlineStyleThick: Int = 2 + const val UnderlineStyleDouble: Int = 9 + const val UnderlinePatternSolid: Int = 0 + const val UnderlinePatternDot: Int = 256 + const val UnderlinePatternDash: Int = 512 + const val UnderlinePatternDashDot: Int = 768 + const val UnderlinePatternDashDotDot: Int = 1024 + const val UnderlineByWordMask: Int = 32768 + const val NoUnderlineStyle: Int = 0 + const val SingleUnderlineStyle: Int = 1 + const val UnderlineStrikethroughMask: Int = 16384 + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSBundle.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSBundle.kt new file mode 100644 index 00000000..ef8712e5 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSBundle.kt @@ -0,0 +1,257 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.ObjCObjectByReference + +/// native declaration : :12 +abstract class NSBundle : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `NSBundle* mainBundle)`

+ * *native declaration : :24* + */ + open fun mainBundle(): NSBundle? + + /** + * Original signature : `NSBundle* bundleWithPath(String*)`

+ * *native declaration : :25* + */ + open fun bundleWithPath(path1: String?): NSBundle? + + /** + * Original signature : `NSBundle* bundleWithIdentifier(String*)`

+ * *native declaration : :29* + */ + open fun bundleWithIdentifier(identifier1: String?): NSBundle? + + /** + * Original signature : `NSArray* allBundles)`

+ * *native declaration : :31* + */ + open fun allBundles(): NSArray? + + /** + * Original signature : `NSArray* allFrameworks)`

+ * *native declaration : :32* + */ + open fun allFrameworks(): NSArray? + + /** + * In the following methods, bundlePath is an absolute path to a bundle, and may not be nil; subpath is a relative path to a subdirectory inside the relevant global or localized resource directory, and should be nil if the resource file in question is not in a subdirectory.

+ * Original signature : `String* pathForResource(String*, String*, String*)`

+ * *native declaration : :62* + */ + open fun pathForResource_ofType_inDirectory(name1: String?, ext2: String?, bundlePath3: String?): String? + + /** + * Original signature : `NSArray* pathsForResourcesOfType(String*, String*)`

+ * *native declaration : :67* + */ + open fun pathsForResourcesOfType_inDirectory(ext1: String?, bundlePath2: String?): NSArray? + + /** + * Original signature : `NSArray* preferredLocalizationsFromArray(NSArray*)`

+ * *native declaration : :85* + */ + open fun preferredLocalizationsFromArray(localizationsArray1: NSArray?): NSArray? + + /** + * Original signature : `NSArray* preferredLocalizationsFromArray(NSArray*, NSArray*)`

+ * *native declaration : :87* + */ + open fun preferredLocalizationsFromArray_forPreferences( + localizationsArray1: NSArray?, + preferencesArray2: NSArray? + ): NSArray? + + open fun loadNibNamed_owner(nibName: String?, owner: org.rococoa.ID?): Boolean + } + + /** + * Original signature : `id initWithPath(String*)`

+ * *native declaration : :26* + */ + abstract fun initWithPath(path1: String?): NSBundle? + + /** + * Original signature : `BOOL load)`

+ * *native declaration : :34* + */ + abstract fun load(): Boolean + + /** + * Original signature : `BOOL isLoaded)`

+ * *native declaration : :36* + */ + abstract fun isLoaded(): Boolean + + /** + * Original signature : `BOOL unload)`

+ * *native declaration : :37* + */ + abstract fun unload(): Boolean + + /** + * Original signature : `BOOL preflightAndReturnError(NSError**)`

+ * *native declaration : :41* + */ + abstract fun preflightAndReturnError(error1: ObjCObjectByReference?): Boolean + + /** + * Original signature : `BOOL loadAndReturnError(NSError**)`

+ * *native declaration : :42* + */ + abstract fun loadAndReturnError(error1: ObjCObjectByReference?): Boolean + + /** + * Original signature : `String* bundlePath)`

+ * *native declaration : :45* + */ + abstract fun bundlePath(): String? + + /** + * Original signature : `String* resourcePath)`

+ * *native declaration : :46* + */ + abstract fun resourcePath(): String? + + /** + * Original signature : `String* executablePath)`

+ * *native declaration : :47* + */ + abstract fun executablePath(): String? + + /** + * Original signature : `String* pathForAuxiliaryExecutable(String*)`

+ * *native declaration : :48* + */ + abstract fun pathForAuxiliaryExecutable(executableName1: String?): String? + + /** + * Original signature : `String* privateFrameworksPath)`

+ * *native declaration : :50* + */ + abstract fun privateFrameworksPath(): String? + + /** + * Original signature : `String* sharedFrameworksPath)`

+ * *native declaration : :51* + */ + abstract fun sharedFrameworksPath(): String? + + /** + * Original signature : `String* sharedSupportPath)`

+ * *native declaration : :52* + */ + abstract fun sharedSupportPath(): String? + + /** + * Original signature : `String* builtInPlugInsPath)`

+ * *native declaration : :53* + */ + abstract fun builtInPlugInsPath(): String? + + /** + * Original signature : `String* bundleIdentifier)`

+ * *native declaration : :55* + */ + abstract fun bundleIdentifier(): String? + + /** + * Original signature : `String* pathForResource(String*, String*)`

+ * *native declaration : :63* + */ + abstract fun pathForResource_ofType(name1: String?, ext2: String?): String? + + /** + * Original signature : `String* pathForResource(String*, String*, String*, String*)`

+ * *native declaration : :65* + */ + abstract fun pathForResource_ofType_inDirectory_forLocalization( + name1: String?, + ext2: String?, + subpath3: String?, + localizationName4: String? + ): String? + + /** + * Original signature : `NSArray* pathsForResourcesOfType(String*, String*, String*)`

+ * *native declaration : :69* + */ + abstract fun pathsForResourcesOfType_inDirectory_forLocalization( + ext1: String?, + subpath2: String?, + localizationName3: String? + ): NSArray? + + fun localizedString(key: String?, tableName: String?): String? { + return localizedStringForKey_value_table(key, key, tableName) + } + + /** + * Original signature : `String* localizedStringForKey(String*, String*, String*)`

+ * *native declaration : :71* + */ + abstract fun localizedStringForKey_value_table(key1: String?, value2: String?, tableName3: String?): String? + + /** + * Original signature : `NSDictionary* infoDictionary)`

+ * *native declaration : :73* + */ + abstract fun infoDictionary(): NSDictionary? + + /** + * Original signature : `NSDictionary* localizedInfoDictionary)`

+ * *native declaration : :75* + */ + abstract fun localizedInfoDictionary(): NSDictionary? + + /** + * Original signature : `id objectForInfoDictionaryKey(String*)`

+ * *native declaration : :76* + */ + abstract fun objectForInfoDictionaryKey(key1: String?): NSObject? + + /** + * Original signature : `NSArray* localizations)`

+ * *native declaration : :79* + */ + abstract fun localizations(): NSArray? + + /** + * Original signature : `NSArray* preferredLocalizations)`

+ * *native declaration : :80* + */ + abstract fun preferredLocalizations(): NSArray? + + /** + * Original signature : `String* developmentLocalization)`

+ * *native declaration : :82* + */ + abstract fun developmentLocalization(): String? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSBundle", _Class::class.java) + + private var mainBundle: NSBundle? = null + + fun mainBundle(): NSBundle? { + if (null == mainBundle) { + mainBundle = CLASS.mainBundle() + } + return mainBundle + } + + fun allBundles(): NSArray? { + return CLASS.allBundles() + } + + fun loadNibNamed(nibName: String?, owner: org.rococoa.ID?): Boolean { + return CLASS.loadNibNamed_owner(nibName, owner) + } + + fun bundleWithPath(path: String?): NSBundle? { + return CLASS.bundleWithPath(path) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSButton.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSButton.kt new file mode 100644 index 00000000..2d468c03 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSButton.kt @@ -0,0 +1,279 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSRect +import org.rococoa.cocoa.foundation.NSUInteger +import java.nio.FloatBuffer + +/// native declaration : :15 +abstract class NSButton : NSControl() { + interface _Class : ObjCClass { + open fun alloc(): NSButton + } + + @Override + abstract override fun initWithFrame(frameRect: NSRect?): NSButton + + /** + * Original signature : `NSString* title()`

+ * *native declaration : :17* + */ + abstract fun title(): String? + + /** + * Original signature : `void setTitle(NSString*)`

+ * *native declaration : :18* + */ + abstract fun setTitle(aString: String?) + + /** + * Original signature : `NSString* alternateTitle()`

+ * *native declaration : :19* + */ + abstract fun alternateTitle(): String? + + /** + * Original signature : `void setAlternateTitle(NSString*)`

+ * *native declaration : :20* + */ + abstract fun setAlternateTitle(aString: String?) + + /** + * Original signature : `NSImage* image()`

+ * *native declaration : :21* + */ + abstract fun image(): NSImage? + + /** + * Original signature : `void setImage(NSImage*)`

+ * *native declaration : :22* + */ + abstract fun setImage(image: NSImage?) + + /** + * Original signature : `NSImage* alternateImage()`

+ * *native declaration : :23* + */ + abstract fun alternateImage(): NSImage? + + /** + * Original signature : `void setAlternateImage(NSImage*)`

+ * *native declaration : :24* + */ + abstract fun setAlternateImage(image: NSImage?) + + /** + * Original signature : `imagePosition()`

+ * *native declaration : :25* + */ + abstract fun imagePosition(): com.sun.jna.Pointer? + + /** + * *native declaration : :26*

+ * Conversion Error : /// Original signature : `void setImagePosition(null)`

+ * - (void)setImagePosition:(null)aPosition; (Argument aPosition cannot be converted) + */ + abstract fun setImagePosition(position: Int) + + /** + * *native declaration : :27*

+ * Conversion Error : /// Original signature : `void setButtonType(null)`

+ * - (void)setButtonType:(null)aType; (Argument aType cannot be converted) + */ + abstract fun setButtonType(type: Int) + + /** + * Original signature : `NSInteger state()`

+ * *native declaration : :28* + */ + abstract fun state(): Int + + /** + * Original signature : `void setState(NSInteger)`

+ * *native declaration : :29* + */ + abstract fun setState(value: Int) + + /** + * Original signature : `BOOL isBordered()`

+ * *native declaration : :30* + */ + abstract fun isBordered(): Boolean + + /** + * Original signature : `void setBordered(BOOL)`

+ * *native declaration : :31* + */ + abstract fun setBordered(flag: Boolean) + + /** + * Original signature : `BOOL isTransparent()`

+ * *native declaration : :32* + */ + abstract fun isTransparent(): Boolean + + /** + * Original signature : `void setTransparent(BOOL)`

+ * *native declaration : :33* + */ + abstract fun setTransparent(flag: Boolean) + + /** + * Original signature : `void setPeriodicDelay(float, float)`

+ * *native declaration : :34* + */ + abstract fun setPeriodicDelay_interval(delay: Float, interval: Float) + + /** + * Original signature : `void getPeriodicDelay(float*, float*)`

+ * *native declaration : :35* + */ + abstract fun getPeriodicDelay_interval(delay: FloatBuffer?, interval: FloatBuffer?) + + /** + * Original signature : `NSString* keyEquivalent()`

+ * *native declaration : :36* + */ + abstract fun keyEquivalent(): String? + + /** + * Original signature : `void setKeyEquivalent(NSString*)`

+ * *native declaration : :37* + */ + abstract fun setKeyEquivalent(charCode: String?) + + /** + * Original signature : `NSUInteger keyEquivalentModifierMask()`

+ * *native declaration : :38* + */ + abstract fun keyEquivalentModifierMask(): NSUInteger? + + /** + * Original signature : `void setKeyEquivalentModifierMask(NSUInteger)`

+ * *native declaration : :39* + */ + abstract fun setKeyEquivalentModifierMask(mask: NSUInteger?) + + /** + * Original signature : `void highlight(BOOL)`

+ * *native declaration : :40* + */ + abstract fun highlight(flag: Boolean) + + /** + * Original signature : `void setTitleWithMnemonic(NSString*)`

+ * *from NSKeyboardUI native declaration : :46* + */ + abstract fun setTitleWithMnemonic(stringWithAmpersand: String?) + + /** + * Original signature : `NSAttributedString* attributedTitle()`

+ * *from NSButtonAttributedStringMethods native declaration : :50* + */ + abstract fun attributedTitle(): NSAttributedString? + + /** + * Original signature : `void setAttributedTitle(NSAttributedString*)`

+ * *from NSButtonAttributedStringMethods native declaration : :51* + */ + abstract fun setAttributedTitle(aString: NSAttributedString?) + + /** + * Original signature : `NSAttributedString* attributedAlternateTitle()`

+ * *from NSButtonAttributedStringMethods native declaration : :52* + */ + abstract fun attributedAlternateTitle(): NSAttributedString? + + /** + * Original signature : `void setAttributedAlternateTitle(NSAttributedString*)`

+ * *from NSButtonAttributedStringMethods native declaration : :53* + */ + abstract fun setAttributedAlternateTitle(obj: NSAttributedString?) + + /** + * *from NSButtonBezelStyles native declaration : :57*

+ * Conversion Error : /// Original signature : `void setBezelStyle(null)`

+ * - (void)setBezelStyle:(null)bezelStyle; (Argument bezelStyle cannot be converted) + */ + abstract fun setBezelStyle(style: Int) + + /** + * Original signature : `bezelStyle()`

+ * *from NSButtonBezelStyles native declaration : :58* + */ + abstract fun bezelStyle(): Int + + /** + * Original signature : `void setAllowsMixedState(BOOL)`

+ * *from NSButtonMixedState native declaration : :62* + */ + abstract fun setAllowsMixedState(flag: Boolean) + + /** + * Original signature : `BOOL allowsMixedState()`

+ * *from NSButtonMixedState native declaration : :63* + */ + abstract fun allowsMixedState(): Boolean + + /** + * Original signature : `void setNextState()`

+ * *from NSButtonMixedState native declaration : :64* + */ + abstract fun setNextState() + + /** + * Original signature : `void setShowsBorderOnlyWhileMouseInside(BOOL)`

+ * *from NSButtonBorder native declaration : :68* + */ + abstract fun setShowsBorderOnlyWhileMouseInside(show: Boolean) + + /** + * Original signature : `BOOL showsBorderOnlyWhileMouseInside()`

+ * *from NSButtonBorder native declaration : :69* + */ + abstract fun showsBorderOnlyWhileMouseInside(): Boolean + + /** + * Original signature : `void setSound(NSSound*)`

+ * *from NSButtonSoundExtensions native declaration : :73* + */ + abstract fun setSound(aSound: com.sun.jna.Pointer?) + + /** + * Original signature : `NSSound* sound()`

+ * *from NSButtonSoundExtensions native declaration : :74* + */ + abstract fun sound(): com.sun.jna.Pointer? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSButton", _Class::class.java) + + fun buttonWithFrame(frameRect: NSRect?): NSButton? { + return CLASS.alloc().initWithFrame(frameRect) + } + + const val NSMomentaryLightButton: Int = 0 // was NSMomentaryPushButton + const val NSMomentaryPushButtonButton: Int = 1 + const val NSToggleButton: Int = 2 + const val NSSwitchButton: Int = 3 + const val NSRadioButton: Int = 4 + const val NSMomentaryChangeButton: Int = 5 + const val NSOnOffButton: Int = 6 + const val NSMomentaryPushInButton: Int = 7 // was NSMomentaryLight + + const val NSRoundedBezelStyle: Int = 1 + const val NSRegularSquareBezelStyle: Int = 2 + const val NSThickSquareBezelStyle: Int = 3 + const val NSThickerSquareBezelStyle: Int = 4 + const val NSDisclosureBezelStyle: Int = 5 + const val NSShadowlessSquareBezelStyle: Int = 6 + const val NSCircularBezelStyle: Int = 7 + const val NSTexturedSquareBezelStyle: Int = 8 + const val NSHelpButtonBezelStyle: Int = 9 + const val NSSmallSquareBezelStyle: Int = 10 + const val NSTexturedRoundedBezelStyle: Int = 11 + const val NSRoundRectBezelStyle: Int = 12 + const val NSRecessedBezelStyle: Int = 13 + const val NSRoundedDisclosureBezelStyle: Int = 14 + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSButtonCell.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSButtonCell.kt new file mode 100644 index 00000000..d310e370 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSButtonCell.kt @@ -0,0 +1,418 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSUInteger + +abstract class NSButtonCell : NSActionCell() { + interface _Class : ObjCClass { + open fun alloc(): NSButtonCell + } + + abstract fun init(): NSButtonCell? + + /** + * Original signature : `NSString* title()`

+ * *native declaration : :143* + */ + abstract override fun title(): String? + + /** + * Original signature : `void setTitle(NSString*)`

+ * *native declaration : :144* + */ + abstract override fun setTitle(aString: String?) + + /** + * Original signature : `NSString* alternateTitle()`

+ * *native declaration : :145* + */ + abstract fun alternateTitle(): String? + + /** + * Original signature : `void setAlternateTitle(NSString*)`

+ * *native declaration : :146* + */ + abstract fun setAlternateTitle(aString: String?) + + /** + * Original signature : `NSImage* alternateImage()`

+ * *native declaration : :148* + */ + abstract fun alternateImage(): NSImage? + + /** + * Original signature : `void setAlternateImage(NSImage*)`

+ * *native declaration : :149* + */ + abstract fun setAlternateImage(image: NSImage?) + + /** + * Original signature : `imagePosition()`

+ * *native declaration : :150* + */ + abstract fun imagePosition(): com.sun.jna.Pointer? + /** + * *native declaration : :151*

+ * Conversion Error : /// Original signature : `void setImagePosition(null)`

+ * - (void)setImagePosition:(null)aPosition; (Argument aPosition cannot be converted) + */ + /** + * Original signature : `imageScaling()`

+ * *native declaration : :153* + */ + abstract fun imageScaling(): com.sun.jna.Pointer? + /** + * *native declaration : :154*

+ * Conversion Error : /// Original signature : `void setImageScaling(null)`

+ * - (void)setImageScaling:(null)scaling; (Argument scaling cannot be converted) + */ + /** + * Original signature : `NSInteger highlightsBy()`

+ * *native declaration : :157* + */ + abstract fun highlightsBy(): Int + + /** + * Original signature : `void setHighlightsBy(NSInteger)`

+ * *native declaration : :158* + */ + abstract fun setHighlightsBy(aType: Int) + + /** + * Original signature : `NSInteger showsStateBy()`

+ * *native declaration : :159* + */ + abstract fun showsStateBy(): Int + + /** + * Original signature : `void setShowsStateBy(NSInteger)`

+ * *native declaration : :160* + */ + abstract fun setShowsStateBy(aType: Int) + + /** + * Original signature : `void setButtonType(NSButtonType)`

+ * *native declaration : :161* + */ + abstract fun setButtonType(aType: Int) + + /** + * Original signature : `BOOL isTransparent()`

+ * *native declaration : :164* + */ + abstract fun isTransparent(): Boolean + + /** + * Original signature : `void setTransparent(BOOL)`

+ * *native declaration : :165* + */ + abstract fun setTransparent(flag: Boolean) + + /** + * Original signature : `void setPeriodicDelay(float, float)`

+ * *native declaration : :166* + */ + abstract fun setPeriodicDelay_interval(delay: Float, interval: Float) + + /** + * Original signature : `void setKeyEquivalent(NSString*)`

+ * *native declaration : :169* + */ + abstract fun setKeyEquivalent(aKeyEquivalent: String?) + + /** + * Original signature : `NSUInteger keyEquivalentModifierMask()`

+ * *native declaration : :170* + */ + abstract fun keyEquivalentModifierMask(): Int + + /** + * Original signature : `void setKeyEquivalentModifierMask(NSUInteger)`

+ * *native declaration : :171* + */ + abstract fun setKeyEquivalentModifierMask(mask: Int) + + /** + * Original signature : `NSFont* keyEquivalentFont()`

+ * *native declaration : :172* + */ + abstract fun keyEquivalentFont(): NSFont? + + /** + * Original signature : `void setKeyEquivalentFont(NSFont*)`

+ * *native declaration : :173* + */ + abstract fun setKeyEquivalentFont(fontObj: NSFont?) + + /** + * Original signature : `void setKeyEquivalentFont(NSString*, CGFloat)`

+ * *native declaration : :174* + */ + abstract fun setKeyEquivalentFont_size(fontName: String?, fontSize: CGFloat?) + + /** + * Original signature : `void performClick(id)`

+ * Significant NSCell override, actually clicks itself.

+ * *native declaration : :175* + */ + abstract override fun performClick(sender: ID?) + /** + * *native declaration : :178*

+ * Conversion Error : /// Original signature : `void drawImage(NSImage*, null, NSView*)`

+ * - (void)drawImage:(NSImage*)image withFrame:(null)frame inView:(NSView*)controlView; (Argument frame cannot be converted) + */ + /** + * *native declaration : :179*

+ * Conversion Error : /// Original signature : `drawTitle(NSAttributedString*, null, NSView*)`

+ * - (null)drawTitle:(NSAttributedString*)title withFrame:(null)frame inView:(NSView*)controlView; (Argument frame cannot be converted) + */ + /** + * *native declaration : :180*

+ * Conversion Error : /// Original signature : `void drawBezelWithFrame(null, NSView*)`

+ * - (void)drawBezelWithFrame:(null)frame inView:(NSView*)controlView; (Argument frame cannot be converted) + */ + /** + * Original signature : `void setTitleWithMnemonic(NSString*)`

+ * *from NSKeyboardUI native declaration : :185* + */ + abstract override fun setTitleWithMnemonic(stringWithAmpersand: String?) + + /** + * Original signature : `void setAlternateTitleWithMnemonic(NSString*)`

+ * *from NSKeyboardUI native declaration : :186* + */ + abstract fun setAlternateTitleWithMnemonic(stringWithAmpersand: String?) + + /** + * Original signature : `void setAlternateMnemonicLocation(NSUInteger)`

+ * *from NSKeyboardUI native declaration : :187* + */ + abstract fun setAlternateMnemonicLocation(location: Int) + + /** + * Original signature : `NSUInteger alternateMnemonicLocation()`

+ * *from NSKeyboardUI native declaration : :188* + */ + abstract fun alternateMnemonicLocation(): Int + + /** + * Original signature : `NSString* alternateMnemonic()`

+ * *from NSKeyboardUI native declaration : :189* + */ + abstract fun alternateMnemonic(): String? + + /** + * Original signature : `NSGradientType gradientType()`

+ * *from NSButtonCellExtensions native declaration : :209* + */ + abstract fun gradientType(): Int + + /** + * Original signature : `void setGradientType(NSGradientType)`

+ * *from NSButtonCellExtensions native declaration : :210* + */ + abstract fun setGradientType(type: Int) + + /** + * Radio buttons and switches use (imageDimsWhenDisabled == NO) so only their text is dimmed.

+ * Original signature : `void setImageDimsWhenDisabled(BOOL)`

+ * *from NSButtonCellExtensions native declaration : :214* + */ + abstract fun setImageDimsWhenDisabled(flag: Boolean) + + /** + * Original signature : `BOOL imageDimsWhenDisabled()`

+ * *from NSButtonCellExtensions native declaration : :215* + */ + abstract fun imageDimsWhenDisabled(): Boolean + + /** + * Original signature : `void setShowsBorderOnlyWhileMouseInside(BOOL)`

+ * *from NSButtonCellExtensions native declaration : :217* + */ + abstract fun setShowsBorderOnlyWhileMouseInside(show: Boolean) + + /** + * Original signature : `BOOL showsBorderOnlyWhileMouseInside()`

+ * *from NSButtonCellExtensions native declaration : :218* + */ + abstract fun showsBorderOnlyWhileMouseInside(): Boolean + + /** + * Original signature : `void mouseEntered(NSEvent*)`

+ * *from NSButtonCellExtensions native declaration : :220* + */ + abstract fun mouseEntered(event: NSEvent?) + + /** + * Original signature : `void mouseExited(NSEvent*)`

+ * *from NSButtonCellExtensions native declaration : :221* + */ + abstract fun mouseExited(event: NSEvent?) + + /** + * Original signature : `NSColor* backgroundColor()`

+ * *from NSButtonCellExtensions native declaration : :224* + */ + abstract fun backgroundColor(): NSColor? + + /** + * Original signature : `void setBackgroundColor(NSColor*)`

+ * *from NSButtonCellExtensions native declaration : :225* + */ + abstract fun setBackgroundColor(color: NSColor?) + + /** + * Original signature : `NSAttributedString* attributedTitle()`

+ * *from NSButtonCellAttributedStringMethods native declaration : :231* + */ + abstract fun attributedTitle(): NSAttributedString? + + /** + * Original signature : `void setAttributedTitle(NSAttributedString*)`

+ * *from NSButtonCellAttributedStringMethods native declaration : :232* + */ + abstract fun setAttributedTitle(obj: NSAttributedString?) + + /** + * Original signature : `NSAttributedString* attributedAlternateTitle()`

+ * *from NSButtonCellAttributedStringMethods native declaration : :233* + */ + abstract fun attributedAlternateTitle(): NSAttributedString? + + /** + * Original signature : `void setAttributedAlternateTitle(NSAttributedString*)`

+ * *from NSButtonCellAttributedStringMethods native declaration : :234* + */ + abstract fun setAttributedAlternateTitle(obj: String?) + + /** + * Original signature : `void setBezelStyle(NSBezelStyle)`

+ * *from NSButtonCellBezelStyles native declaration : :239* + */ + abstract fun setBezelStyle(bezelStyle: NSUInteger?) + + /** + * Original signature : `NSBezelStyle bezelStyle()`

+ * *from NSButtonCellBezelStyles native declaration : :240* + */ + abstract fun bezelStyle(): NSUInteger? + + /** + * Original signature : `void setSound(NSSound*)`

+ * *from NSButtonCellSoundExtensions native declaration : :245* + */ + abstract fun setSound(aSound: com.sun.jna.Pointer?) + + /** + * Original signature : `NSSound* sound()`

+ * *from NSButtonCellSoundExtensions native declaration : :246* + */ + abstract fun sound(): com.sun.jna.Pointer? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSButtonCell", _Class::class.java) + + fun buttonCell(): NSButtonCell? { + return CLASS.alloc().init() + } + + /** + * was NSMomentaryPushButton

+ * *native declaration : :12* + */ + const val NSMomentaryLightButton: Int = 0 + + /// native declaration : :13 + const val NSPushOnPushOffButton: Int = 1 + + /// native declaration : :14 + const val NSToggleButton: Int = 2 + + /// native declaration : :15 + const val NSSwitchButton: Int = 3 + + /// native declaration : :16 + const val NSRadioButton: Int = 4 + + /// native declaration : :17 + const val NSMomentaryChangeButton: Int = 5 + + /// native declaration : :18 + const val NSOnOffButton: Int = 6 + + /** + * was NSMomentaryLight

+ * *native declaration : :19* + */ + const val NSMomentaryPushInButton: Int = 7 + + /// native declaration : :24 + const val NSMomentaryPushButton: Int = 0 + + /// native declaration : :25 + const val NSMomentaryLight: Int = 7 + + /// native declaration : :32 + const val NSRoundedBezelStyle: Int = 1 + + /// native declaration : :33 + const val NSRegularSquareBezelStyle: Int = 2 + + /// native declaration : :34 + const val NSThickSquareBezelStyle: Int = 3 + + /// native declaration : :35 + const val NSThickerSquareBezelStyle: Int = 4 + + /// native declaration : :37 + const val NSDisclosureBezelStyle: Int = 5 + + /// native declaration : :39 + const val NSShadowlessSquareBezelStyle: Int = 6 + + /// native declaration : :40 + const val NSCircularBezelStyle: Int = 7 + + /// native declaration : :42 + const val NSTexturedSquareBezelStyle: Int = 8 + + /// native declaration : :43 + const val NSHelpButtonBezelStyle: Int = 9 + + /// native declaration : :46 + const val NSSmallSquareBezelStyle: Int = 10 + + /// native declaration : :47 + const val NSTexturedRoundedBezelStyle: Int = 11 + + /// native declaration : :48 + const val NSRoundRectBezelStyle: Int = 12 + + /// native declaration : :49 + const val NSRecessedBezelStyle: Int = 13 + + /// native declaration : :50 + const val NSRoundedDisclosureBezelStyle: Int = 14 + + /// native declaration : :55 + const val NSSmallIconButtonBezelStyle: Int = 2 + + /// native declaration : :200 + const val NSGradientNone: Int = 0 + + /// native declaration : :201 + const val NSGradientConcaveWeak: Int = 1 + + /// native declaration : :202 + const val NSGradientConcaveStrong: Int = 2 + + /// native declaration : :203 + const val NSGradientConvexWeak: Int = 3 + + /// native declaration : :204 + const val NSGradientConvexStrong: Int = 4 + } +} \ No newline at end of file diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSCell.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSCell.kt new file mode 100644 index 00000000..77d1be3d --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSCell.kt @@ -0,0 +1,1106 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Selector +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSSize +import org.rococoa.cocoa.foundation.NSUInteger +import java.nio.FloatBuffer + +abstract class NSCell : NSObject(), NSCopying { + interface _Class : ObjCClass { + /** + * Original signature : `BOOL prefersTrackingUntilMouseUp()`

+ * *native declaration : :175* + */ + open fun prefersTrackingUntilMouseUp(): Boolean + + /** + * Original signature : `NSMenu* defaultMenu()`

+ * *native declaration : :280* + */ + open fun defaultMenu(): NSMenu? + + /** + * Original signature : `defaultFocusRingType()`

+ * *from NSKeyboardUI native declaration : :323* + */ + open fun defaultFocusRingType(): com.sun.jna.Pointer? + + open fun alloc(): NSCell? + } + + /** + * Original signature : `id initTextCell(NSString*)`

+ * *native declaration : :178* + */ + abstract fun initTextCell(aString: NSString?): NSCell? + + /** + * Original signature : `id initImageCell(NSImage*)`

+ * *native declaration : :179* + */ + abstract fun initImageCell(image: NSImage?): NSCell? + + /** + * Original signature : `NSView* controlView()`

+ * *native declaration : :181* + */ + abstract fun controlView(): NSView? + + /** + * Original signature : `void setControlView(NSView*)`

+ * *native declaration : :183* + */ + abstract fun setControlView(view: NSView?) + + /** + * Original signature : `NSCellType type()`

+ * *native declaration : :185* + */ + abstract fun type(): Int + + /** + * Original signature : `void setType(NSCellType)`

+ * *native declaration : :186* + */ + abstract fun setType(aType: Int) + + /** + * Original signature : `NSInteger state()`

+ * *native declaration : :187* + */ + abstract fun state(): Int + + /** + * Original signature : `void setState(NSInteger)`

+ * *native declaration : :188* + */ + abstract fun setState(value: Int) + + /** + * Original signature : `action()`

+ * *native declaration : :191* + */ + abstract fun action(): Selector? + + /** + * *native declaration : :192*

+ * Conversion Error : /// Original signature : `void setAction(null)`

+ * - (void)setAction:(null)aSelector; (Argument aSelector cannot be converted) + */ + abstract fun setAction(action: Selector?) + + /** + * Original signature : `NSInteger tag()`

+ * *native declaration : :193* + */ + abstract fun tag(): Int + + /** + * Original signature : `void setTag(NSInteger)`

+ * *native declaration : :194* + */ + abstract fun setTag(anInt: Int) + + /** + * Original signature : `NSString* title()`

+ * *native declaration : :195* + */ + abstract fun title(): String? + + /** + * Original signature : `void setTitle(NSString*)`

+ * *native declaration : :196* + */ + abstract fun setTitle(aString: String?) + + /** + * Original signature : `BOOL isOpaque()`

+ * *native declaration : :197* + */ + abstract fun isOpaque(): Boolean + + /** + * Original signature : `BOOL isEnabled()`

+ * *native declaration : :198* + */ + abstract fun isEnabled(): Boolean + + /** + * Original signature : `void setEnabled(BOOL)`

+ * *native declaration : :199* + */ + abstract fun setEnabled(flag: Boolean) + + /** + * Original signature : `NSInteger sendActionOn(NSInteger)`

+ * *native declaration : :200* + */ + abstract fun sendActionOn(mask: Int): Int + + /** + * Original signature : `BOOL isContinuous()`

+ * *native declaration : :201* + */ + abstract fun isContinuous(): Boolean + + /** + * Original signature : `void setContinuous(BOOL)`

+ * *native declaration : :202* + */ + abstract fun setContinuous(flag: Boolean) + + /** + * Original signature : `BOOL isEditable()`

+ * *native declaration : :203* + */ + abstract fun isEditable(): Boolean + + /** + * Original signature : `void setEditable(BOOL)`

+ * *native declaration : :204* + */ + abstract fun setEditable(flag: Boolean) + + /** + * Original signature : `BOOL isSelectable()`

+ * *native declaration : :205* + */ + abstract fun isSelectable(): Boolean + + /** + * Original signature : `void setSelectable(BOOL)`

+ * *native declaration : :206* + */ + abstract fun setSelectable(flag: Boolean) + + /** + * Original signature : `BOOL isBordered()`

+ * *native declaration : :207* + */ + abstract fun isBordered(): Boolean + + /** + * Original signature : `void setBordered(BOOL)`

+ * *native declaration : :208* + */ + abstract fun setBordered(flag: Boolean) + + /** + * Original signature : `BOOL isBezeled()`

+ * *native declaration : :209* + */ + abstract fun isBezeled(): Boolean + + /** + * Original signature : `void setBezeled(BOOL)`

+ * *native declaration : :210* + */ + abstract fun setBezeled(flag: Boolean) + + /** + * Original signature : `BOOL isScrollable()`

+ * *native declaration : :211* + */ + abstract fun isScrollable(): Boolean + + /** + * Original signature : `void setScrollable(BOOL)`

+ * If YES, sets wraps to NO

+ * *native declaration : :212* + */ + abstract fun setScrollable(flag: Boolean) + + /** + * Original signature : `BOOL isHighlighted()`

+ * *native declaration : :213* + */ + abstract fun isHighlighted(): Boolean + + /** + * Original signature : `void setHighlighted(BOOL)`

+ * *native declaration : :214* + */ + abstract fun setHighlighted(flag: Boolean) + + /** + * Original signature : `alignment()`

+ * *native declaration : :215* + */ + abstract fun alignment(): com.sun.jna.Pointer? + + /** + * *native declaration : :216*

+ * Conversion Error : /// Original signature : `void setAlignment(null)`

+ * - (void)setAlignment:(null)mode; (Argument mode cannot be converted) + */ + abstract fun setAlignment(mode: Int) + + /** + * Original signature : `BOOL wraps()`

+ * *native declaration : :217* + */ + abstract fun wraps(): Boolean + + /** + * Original signature : `void setWraps(BOOL)`

+ * If YES, sets scrollable to NO

+ * *native declaration : :218* + */ + abstract fun setWraps(flag: Boolean) + + /** + * Original signature : `NSFont* font()`

+ * *native declaration : :219* + */ + abstract fun font(): NSFont? + + /** + * Original signature : `void setFont(NSFont*)`

+ * *native declaration : :220* + */ + abstract fun setFont(fontObj: NSFont?) + + /** + * Original signature : `NSInteger entryType()`

+ * *native declaration : :221* + */ + abstract fun entryType(): Int + + /** + * Original signature : `void setEntryType(NSInteger)`

+ * *native declaration : :222* + */ + abstract fun setEntryType(aType: Int) + + /** + * Original signature : `BOOL isEntryAcceptable(NSString*)`

+ * *native declaration : :223* + */ + abstract fun isEntryAcceptable(aString: String?): Boolean + + /** + * Original signature : `void setFloatingPointFormat(BOOL, NSUInteger, NSUInteger)`

+ * *native declaration : :224* + */ + abstract fun setFloatingPointFormat_left_right(autoRange: Boolean, leftDigits: Int, rightDigits: Int) + + /** + * Original signature : `NSString* keyEquivalent()`

+ * *native declaration : :225* + */ + abstract fun keyEquivalent(): String? + + /** + * Original signature : `void setFormatter(NSFormatter*)`

+ * *native declaration : :226* + */ + abstract fun setFormatter(newFormatter: com.sun.jna.Pointer?) + + /** + * Original signature : `id formatter()`

+ * *native declaration : :227* + */ + abstract fun formatter(): ID? + + /** + * Original signature : `id objectValue()`

+ * *native declaration : :228* + */ + abstract fun objectValue(): NSObject? + + /** + * *native declaration : :229*

+ * Conversion Error : id + */ + abstract fun setObjectValue(value: NSObject?) + + /** + * Original signature : `BOOL hasValidObjectValue()`

+ * *native declaration : :230* + */ + abstract fun hasValidObjectValue(): Boolean + + /** + * Original signature : `NSString* stringValue()`

+ * *native declaration : :231* + */ + abstract fun stringValue(): String? + + /** + * Original signature : `void setStringValue(NSString*)`

+ * *native declaration : :232* + */ + abstract fun setStringValue(aString: String?) + + /** + * Original signature : `compare(id)`

+ * *native declaration : :233* + */ + abstract fun compare(otherCell: NSObject?): com.sun.jna.Pointer? + + /** + * Original signature : `int intValue()`

+ * *native declaration : :234* + */ + abstract fun intValue(): Int + + /** + * Original signature : `void setIntValue(int)`

+ * *native declaration : :235* + */ + abstract fun setIntValue(anInt: Int) + + /** + * Original signature : `float floatValue()`

+ * *native declaration : :236* + */ + abstract fun floatValue(): Float + + /** + * Original signature : `void setFloatValue(float)`

+ * *native declaration : :237* + */ + abstract fun setFloatValue(aFloat: Float) + + /** + * Original signature : `double doubleValue()`

+ * *native declaration : :238* + */ + abstract fun doubleValue(): Double + + /** + * Original signature : `void setDoubleValue(double)`

+ * *native declaration : :239* + */ + abstract fun setDoubleValue(aDouble: Double) + + /** + * Original signature : `void takeIntValueFrom(id)`

+ * *native declaration : :240* + */ + abstract fun takeIntValueFrom(sender: ID?) + + /** + * Original signature : `void takeFloatValueFrom(id)`

+ * *native declaration : :241* + */ + abstract fun takeFloatValueFrom(sender: ID?) + + /** + * Original signature : `void takeDoubleValueFrom(id)`

+ * *native declaration : :242* + */ + abstract fun takeDoubleValueFrom(sender: ID?) + + /** + * Original signature : `void takeStringValueFrom(id)`

+ * *native declaration : :243* + */ + abstract fun takeStringValueFrom(sender: ID?) + + /** + * Original signature : `void takeObjectValueFrom(id)`

+ * *native declaration : :244* + */ + abstract fun takeObjectValueFrom(sender: ID?) + + /** + * Original signature : `NSImage* image()`

+ * *native declaration : :245* + */ + abstract fun image(): NSImage? + + /** + * Original signature : `void setImage(NSImage*)`

+ * *native declaration : :246* + */ + abstract fun setImage(image: NSImage?) + + /** + * Original signature : `void setControlTint(NSControlTint)`

+ * *native declaration : :247* + */ + abstract fun setControlTint(controlTint: NSUInteger?) + + /** + * Original signature : `NSControlTint controlTint()`

+ * *native declaration : :248* + */ + abstract fun controlTint(): NSUInteger? + + /** + * Original signature : `void setControlSize(NSControlSize)`

+ * *native declaration : :249* + */ + abstract fun setControlSize(size: Int) + + /** + * Original signature : `NSControlSize controlSize()`

+ * *native declaration : :250* + */ + abstract fun controlSize(): Int + + /** + * Original signature : `id representedObject()`

+ * *native declaration : :251* + */ + abstract fun representedObject(): ID? + + /** + * Original signature : `void setRepresentedObject(id)`

+ * *native declaration : :252* + */ + abstract fun setRepresentedObject(anObject: ID?) + + /** + * Original signature : `NSInteger cellAttribute(NSCellAttribute)`

+ * *native declaration : :253* + */ + abstract fun cellAttribute(aParameter: Int): Int + + /** + * Original signature : `void setCellAttribute(NSCellAttribute, NSInteger)`

+ * *native declaration : :254* + */ + abstract fun setCellAttribute_to(aParameter: Int, value: Int) + /** + * *native declaration : :255*

+ * Conversion Error : /// Original signature : `imageRectForBounds(null)`

+ * - (null)imageRectForBounds:(null)theRect; (Argument theRect cannot be converted) + */ + /** + * *native declaration : :256*

+ * Conversion Error : /// Original signature : `titleRectForBounds(null)`

+ * - (null)titleRectForBounds:(null)theRect; (Argument theRect cannot be converted) + */ + /** + * *native declaration : :257*

+ * Conversion Error : /// Original signature : `drawingRectForBounds(null)`

+ * - (null)drawingRectForBounds:(null)theRect; (Argument theRect cannot be converted) + */ + /** + * Original signature : `cellSize()`

+ * *native declaration : :258* + */ + abstract fun cellSize(): NSSize? + /** + * *native declaration : :259*

+ * Conversion Error : /// Original signature : `cellSizeForBounds(null)`

+ * - (null)cellSizeForBounds:(null)aRect; (Argument aRect cannot be converted) + */ + /** + * *native declaration : :260*

+ * Conversion Error : /// Original signature : `NSColor* highlightColorWithFrame(null, NSView*)`

+ * - (NSColor*)highlightColorWithFrame:(null)cellFrame inView:(NSView*)controlView; (Argument cellFrame cannot be converted) + */ + /** + * *native declaration : :261*

+ * Conversion Error : /// Original signature : `void calcDrawInfo(null)`

+ * - (void)calcDrawInfo:(null)aRect; (Argument aRect cannot be converted) + */ + /** + * Original signature : `NSText* setUpFieldEditorAttributes(NSText*)`

+ * *native declaration : :262* + */ + abstract fun setUpFieldEditorAttributes(textObj: com.sun.jna.Pointer?): NSText? + /** + * *native declaration : :263*

+ * Conversion Error : /// Original signature : `void drawInteriorWithFrame(null, NSView*)`

+ * - (void)drawInteriorWithFrame:(null)cellFrame inView:(NSView*)controlView; (Argument cellFrame cannot be converted) + */ + /** + * *native declaration : :264*

+ * Conversion Error : /// Original signature : `void drawWithFrame(null, NSView*)`

+ * - (void)drawWithFrame:(null)cellFrame inView:(NSView*)controlView; (Argument cellFrame cannot be converted) + */ + /** + * *native declaration : :265*

+ * Conversion Error : /// Original signature : `void highlight(BOOL, null, NSView*)`

+ * - (void)highlight:(BOOL)flag withFrame:(null)cellFrame inView:(NSView*)controlView; (Argument cellFrame cannot be converted) + */ + /** + * Original signature : `NSInteger mouseDownFlags()`

+ * *native declaration : :266* + */ + abstract fun mouseDownFlags(): Int + + /** + * Original signature : `void getPeriodicDelay(float*, float*)`

+ * *native declaration : :267* + */ + abstract fun getPeriodicDelay_interval(delay: FloatBuffer?, interval: FloatBuffer?) + /** + * *native declaration : :268*

+ * Conversion Error : /// Original signature : `BOOL startTrackingAt(null, NSView*)`

+ * - (BOOL)startTrackingAt:(null)startPoint inView:(NSView*)controlView; (Argument startPoint cannot be converted) + */ + /** + * *native declaration : :269*

+ * Conversion Error : /// Original signature : `BOOL continueTracking(null, null, NSView*)`

+ * - (BOOL)continueTracking:(null)lastPoint at:(null)currentPoint inView:(NSView*)controlView; (Argument lastPoint cannot be converted) + */ + /** + * *native declaration : :270*

+ * Conversion Error : /// Original signature : `void stopTracking(null, null, NSView*, BOOL)`

+ * - (void)stopTracking:(null)lastPoint at:(null)stopPoint inView:(NSView*)controlView mouseIsUp:(BOOL)flag; (Argument lastPoint cannot be converted) + */ + /** + * *native declaration : :271*

+ * Conversion Error : /// Original signature : `BOOL trackMouse(NSEvent*, null, NSView*, BOOL)`

+ * - (BOOL)trackMouse:(NSEvent*)theEvent inRect:(null)cellFrame ofView:(NSView*)controlView untilMouseUp:(BOOL)flag; (Argument cellFrame cannot be converted) + */ + /** + * *native declaration : :272*

+ * Conversion Error : /// Original signature : `void editWithFrame(null, NSView*, NSText*, id, NSEvent*)`

+ * - (void)editWithFrame:(null)aRect inView:(NSView*)controlView editor:(NSText*)textObj delegate:(id)anObject event:(NSEvent*)theEvent; (Argument aRect cannot be converted) + */ + /** + * *native declaration : :273*

+ * Conversion Error : /// Original signature : `void selectWithFrame(null, NSView*, NSText*, id, NSInteger, NSInteger)`

+ * - (void)selectWithFrame:(null)aRect inView:(NSView*)controlView editor:(NSText*)textObj delegate:(id)anObject start:(NSInteger)selStart length:(NSInteger)selLength; (Argument aRect cannot be converted) + */ + /** + * Original signature : `void endEditing(NSText*)`

+ * *native declaration : :274* + */ + abstract fun endEditing(textObj: NSText?) + /** + * *native declaration : :275*

+ * Conversion Error : /// Original signature : `void resetCursorRect(null, NSView*)`

+ * - (void)resetCursorRect:(null)cellFrame inView:(NSView*)controlView; (Argument cellFrame cannot be converted) + */ + /** + * Original signature : `void setMenu(NSMenu*)`

+ * *native declaration : :277* + */ + abstract fun setMenu(aMenu: NSMenu?) + + /** + * Original signature : `NSMenu* menu()`

+ * *native declaration : :278* + */ + abstract fun menu(): NSMenu? + /** + * *native declaration : :279*

+ * Conversion Error : /// Original signature : `NSMenu* menuForEvent(NSEvent*, null, NSView*)`

+ * - (NSMenu*)menuForEvent:(NSEvent*)event inRect:(null)cellFrame ofView:(NSView*)view; (Argument cellFrame cannot be converted) + */ + /** + * Original signature : `void setSendsActionOnEndEditing(BOOL)`

+ * *native declaration : :282* + */ + abstract fun setSendsActionOnEndEditing(flag: Boolean) + + /** + * Original signature : `BOOL sendsActionOnEndEditing()`

+ * *native declaration : :283* + */ + abstract fun sendsActionOnEndEditing(): Boolean + + /** + * Original signature : `baseWritingDirection()`

+ * *native declaration : :286* + */ + abstract fun baseWritingDirection(): Int + /** + * *native declaration : :287*

+ * Conversion Error : /// Original signature : `void setBaseWritingDirection(null)`

+ * - (void)setBaseWritingDirection:(null)writingDirection; (Argument writingDirection cannot be converted) + */ + /** + * *native declaration : :289*

+ * Conversion Error : /// Original signature : `void setLineBreakMode(null)`

+ * - (void)setLineBreakMode:(null)mode; (Argument mode cannot be converted) + */ + /** + * Original signature : `lineBreakMode()`

+ * *native declaration : :290* + */ + abstract fun lineBreakMode(): com.sun.jna.Pointer? + + /** + * Original signature : `void setAllowsUndo(BOOL)`

+ * *native declaration : :292* + */ + abstract fun setAllowsUndo(allowsUndo: Boolean) + + /** + * Original signature : `BOOL allowsUndo()`

+ * *native declaration : :293* + */ + abstract fun allowsUndo(): Boolean + + /** + * Original signature : `NSInteger integerValue()`

+ * *native declaration : :297* + */ + abstract fun integerValue(): NSInteger? + + /** + * Original signature : `void setIntegerValue(NSInteger)`

+ * *native declaration : :298* + */ + abstract fun setIntegerValue(anInteger: NSInteger?) + + /** + * Original signature : `void takeIntegerValueFrom(id)`

+ * *native declaration : :299* + */ + abstract fun takeIntegerValueFrom(sender: ID?) + + /** + * Truncates and adds the ellipsis character to the last visible line if the text doesn't fit into the cell bounds. The setting is ignored if -lineBreakMode is neither NSLineBreakByWordWrapping nor NSLineBreakByCharWrapping.

+ * Original signature : `BOOL truncatesLastVisibleLine()`

+ * *native declaration : :304* + */ + abstract fun truncatesLastVisibleLine(): Boolean + + /** + * Original signature : `void setTruncatesLastVisibleLine(BOOL)`

+ * *native declaration : :305* + */ + abstract fun setTruncatesLastVisibleLine(flag: Boolean) + + /** + * Original signature : `void setRefusesFirstResponder(BOOL)`

+ * *from NSKeyboardUI native declaration : :309* + */ + abstract fun setRefusesFirstResponder(flag: Boolean) + + /** + * Original signature : `BOOL refusesFirstResponder()`

+ * *from NSKeyboardUI native declaration : :310* + */ + abstract fun refusesFirstResponder(): Boolean + + /** + * Original signature : `BOOL acceptsFirstResponder()`

+ * *from NSKeyboardUI native declaration : :311* + */ + abstract fun acceptsFirstResponder(): Boolean + + /** + * Original signature : `void setShowsFirstResponder(BOOL)`

+ * *from NSKeyboardUI native declaration : :312* + */ + abstract fun setShowsFirstResponder(showFR: Boolean) + + /** + * Original signature : `BOOL showsFirstResponder()`

+ * *from NSKeyboardUI native declaration : :313* + */ + abstract fun showsFirstResponder(): Boolean + + /** + * Original signature : `void setMnemonicLocation(NSUInteger)`

+ * *from NSKeyboardUI native declaration : :314* + */ + abstract fun setMnemonicLocation(location: Int) + + /** + * Original signature : `NSUInteger mnemonicLocation()`

+ * *from NSKeyboardUI native declaration : :315* + */ + abstract fun mnemonicLocation(): Int + + /** + * Original signature : `NSString* mnemonic()`

+ * *from NSKeyboardUI native declaration : :316* + */ + abstract fun mnemonic(): String? + + /** + * Original signature : `void setTitleWithMnemonic(NSString*)`

+ * *from NSKeyboardUI native declaration : :317* + */ + abstract fun setTitleWithMnemonic(stringWithAmpersand: String?) + + /** + * Original signature : `void performClick(id)`

+ * *from NSKeyboardUI native declaration : :318* + */ + abstract fun performClick(sender: ID?) + /** + * *from NSKeyboardUI native declaration : :321*

+ * Conversion Error : /// Original signature : `void setFocusRingType(null)`

+ * - (void)setFocusRingType:(null)focusRingType; (Argument focusRingType cannot be converted) + */ + /** + * Original signature : `focusRingType()`

+ * *from NSKeyboardUI native declaration : :322* + */ + abstract fun focusRingType(): com.sun.jna.Pointer? + + /** + * Original signature : `BOOL wantsNotificationForMarkedText()`

+ * If the receiver returns YES, the field editor initiated by it posts text change notifications (i.e. NSTextDidChangeNotification) while editing marked text; otherwise, they are delayed until the marked text confirmation. The NSCell's implementation returns NO.

+ * *from NSKeyboardUI native declaration : :326* + */ + abstract fun wantsNotificationForMarkedText(): Boolean + + /** + * Original signature : `NSAttributedString* attributedStringValue()`

+ * *from NSCellAttributedStringMethods native declaration : :331* + */ + abstract fun attributedStringValue(): NSAttributedString? + + /** + * Original signature : `void setAttributedStringValue(NSAttributedString*)`

+ * *from NSCellAttributedStringMethods native declaration : :332* + */ + abstract fun setAttributedStringValue(obj: NSAttributedString?) + + /** + * These methods determine whether the user can modify text attributes and import graphics in a rich cell. Note that whatever these flags are, cells can still contain attributed text if programmatically set.

+ * Original signature : `BOOL allowsEditingTextAttributes()`

+ * *from NSCellAttributedStringMethods native declaration : :334* + */ + abstract fun allowsEditingTextAttributes(): Boolean + + /** + * Original signature : `void setAllowsEditingTextAttributes(BOOL)`

+ * If NO, also clears setImportsGraphics:

+ * *from NSCellAttributedStringMethods native declaration : :335* + */ + abstract fun setAllowsEditingTextAttributes(flag: Boolean) + + /** + * Original signature : `BOOL importsGraphics()`

+ * *from NSCellAttributedStringMethods native declaration : :336* + */ + abstract fun importsGraphics(): Boolean + + /** + * Original signature : `void setImportsGraphics(BOOL)`

+ * If YES, also sets setAllowsEditingTextAttributes:

+ * *from NSCellAttributedStringMethods native declaration : :337* + */ + abstract fun setImportsGraphics(flag: Boolean) + + /** + * Original signature : `void setAllowsMixedState(BOOL)`

+ * allow button to have mixed state value

+ * *from NSCellMixedState native declaration : :341* + */ + abstract fun setAllowsMixedState(flag: Boolean) + + /** + * Original signature : `BOOL allowsMixedState()`

+ * *from NSCellMixedState native declaration : :342* + */ + abstract fun allowsMixedState(): Boolean + + /** + * Original signature : `NSInteger nextState()`

+ * get next state state in cycle

+ * *from NSCellMixedState native declaration : :343* + */ + abstract fun nextState(): NSInteger? + + /** + * Original signature : `void setNextState()`

+ * toggle/cycle through states

+ * *from NSCellMixedState native declaration : :344* + */ + abstract fun setNextState() + /** + * *from NSCellHitTest native declaration : :382*

+ * Conversion Error : / **

+ * * Return hit testing information for the cell. Use a bit-wise mask to look for a specific value when calling the method. Generally, this should be overridden by custom NSCell subclasses to return the correct result. Currently, it is called by some multi-cell views, such as NSTableView.

+ * * By default, NSCell will look at the cell type and do the following:

+ * * NSImageCellType:

+ * * If the image exists, and the event point is in the image return NSCellHitContentArea, else NSCellHitNone.

+ * * NSTextCellType (also applies to NSTextFieldCell):

+ * * If there is text:

+ * * If the event point hits in the text, return NSCellHitContentArea. Additionally, if the cell is enabled return NSCellHitContentArea | NSCellHitEditableTextArea.

+ * * If there is not text:

+ * * Returns NSCellHitNone.

+ * * NSNullCellType (this is the default that applies to non text or image cells who don't override hitTestForEvent:):

+ * * Return NSCellHitContentArea by default.

+ * * If the cell not disabled, and it would track, return NSCellHitContentArea | NSCellHitTrackableArea.

+ * * Original signature : `NSUInteger hitTestForEvent(NSEvent*, null, NSView*)`

+ * * /

+ * - (NSUInteger)hitTestForEvent:(NSEvent*)event inRect:(null)cellFrame ofView:(NSView*)controlView; (Argument cellFrame cannot be converted) + */ + /** + * *from NSCellExpansion native declaration : :388*

+ * Conversion Error : / **

+ * * Allows the cell to return an expansion cell frame if cellFrame is too small for the entire contents in the view. When the mouse is hovered over the cell in certain controls, the full cell contents will be shown in a special floating tool tip view. If the frame is not too small, return an empty rect, and no expansion tool tip view will be shown. By default, NSCell returns NSZeroRect, while some subclasses (such as NSTextFieldCell) will return the proper frame when required.

+ * * Original signature : `expansionFrameWithFrame(null, NSView*)`

+ * * /

+ * - (null)expansionFrameWithFrame:(null)cellFrame inView:(NSView*)view; (Argument cellFrame cannot be converted) + */ + /** + * *from NSCellExpansion native declaration : :392*

+ * Conversion Error : / **

+ * * Allows the cell to perform custom expansion tool tip drawing. Note that the view may be different from the original view that the cell appeared in. By default, NSCell simply calls drawWithFrame:inView:.

+ * * Original signature : `void drawWithExpansionFrame(null, NSView*)`

+ * * /

+ * - (void)drawWithExpansionFrame:(null)cellFrame inView:(NSView*)view; (Argument cellFrame cannot be converted) + */ + /** + * Describes the surface the cell is drawn onto in -[NSCell drawWithFrame:inView:]. A control typically sets this before it asks the cell to draw. A cell may draw differently based on background characteristics. For example, a tableview drawing a cell in a selected row might call [cell setBackgroundStyle:NSBackgroundStyleDark]. A text cell might decide to render its text white as a result. A rating-style level indicator might draw its stars white instead of gray.

+ * Original signature : `NSBackgroundStyle backgroundStyle()`

+ * *from NSCellBackgroundStyle native declaration : :407* + */ + abstract fun backgroundStyle(): NSUInteger? + + /** + * Original signature : `void setBackgroundStyle(NSBackgroundStyle)`

+ * *from NSCellBackgroundStyle native declaration : :408* + */ + abstract fun setBackgroundStyle(style: NSUInteger?) + + /** + * Describes the surface drawn onto in -[NSCell drawInteriorWithFrame:inView:]. This is often the same as the backgroundStyle, but a button that draws a bezel would have a different interiorBackgroundStyle.

+ * This is both an override point and a useful method to call. A button that draws a custom bezel would override this to describe that surface. A cell that has custom interior drawing might query this method to help pick an image that looks good on the cell. Calling this method gives you some independence from changes in framework art style.

+ * Original signature : `NSBackgroundStyle interiorBackgroundStyle()`

+ * *from NSCellBackgroundStyle native declaration : :415* + */ + abstract fun interiorBackgroundStyle(): NSUInteger? + + companion object { + /// native declaration : :11 + const val NSAnyType: Int = 0 + + /// native declaration : :12 + const val NSIntType: Int = 1 + + /// native declaration : :13 + const val NSPositiveIntType: Int = 2 + + /// native declaration : :14 + const val NSFloatType: Int = 3 + + /// native declaration : :15 + const val NSPositiveFloatType: Int = 4 + + /// native declaration : :16 + const val NSDoubleType: Int = 6 + + /// native declaration : :17 + const val NSPositiveDoubleType: Int = 7 + + /// native declaration : :21 + const val NSNullCellType: Int = 0 + + /// native declaration : :22 + const val NSTextCellType: Int = 1 + + /// native declaration : :23 + const val NSImageCellType: Int = 2 + + /// native declaration : :28 + const val NSCellDisabled: Int = 0 + + /// native declaration : :29 + const val NSCellState: Int = 1 + + /// native declaration : :30 + const val NSPushInCell: Int = 2 + + /// native declaration : :31 + const val NSCellEditable: Int = 3 + + /// native declaration : :32 + const val NSChangeGrayCell: Int = 4 + + /// native declaration : :33 + const val NSCellHighlighted: Int = 5 + + /// native declaration : :34 + const val NSCellLightsByContents: Int = 6 + + /// native declaration : :35 + const val NSCellLightsByGray: Int = 7 + + /// native declaration : :36 + const val NSChangeBackgroundCell: Int = 8 + + /// native declaration : :37 + const val NSCellLightsByBackground: Int = 9 + + /// native declaration : :38 + const val NSCellIsBordered: Int = 10 + + /// native declaration : :39 + const val NSCellHasOverlappingImage: Int = 11 + + /// native declaration : :40 + const val NSCellHasImageHorizontal: Int = 12 + + /// native declaration : :41 + const val NSCellHasImageOnLeftOrBottom: Int = 13 + + /// native declaration : :42 + const val NSCellChangesContents: Int = 14 + + /// native declaration : :43 + const val NSCellIsInsetButton: Int = 15 + + /// native declaration : :44 + const val NSCellAllowsMixedState: Int = 16 + + /// native declaration : :49 + const val NSNoImage: Int = 0 + + /// native declaration : :50 + const val NSImageOnly: Int = 1 + + /// native declaration : :51 + const val NSImageLeft: Int = 2 + + /// native declaration : :52 + const val NSImageRight: Int = 3 + + /// native declaration : :53 + const val NSImageBelow: Int = 4 + + /// native declaration : :54 + const val NSImageAbove: Int = 5 + + /// native declaration : :55 + const val NSImageOverlaps: Int = 6 + + /** + * Deprecated. Use NSScaleProportionallyDown

+ * *native declaration : :60* + */ + const val NSScaleProportionally: Int = 0 + + /** + * Deprecated. Use NSScaleAxesIndependently

+ * *native declaration : :61* + */ + const val NSScaleToFit: Int = 1 + + /** + * Deprecated. Use NSImageScaleNone

+ * *native declaration : :62* + */ + const val NSScaleNone: Int = 2 + + /** + * Scale image down if it is too large for destination. Preserve aspect ratio.

+ * *native declaration : :67* + */ + const val NSImageScaleProportionallyDown: Int = 0 + + /** + * Scale each dimension to exactly fit destination. Do not preserve aspect ratio.

+ * *native declaration : :68* + */ + const val NSImageScaleAxesIndependently: Int = 1 + + /** + * Do not scale.

+ * *native declaration : :69* + */ + const val NSImageScaleNone: Int = 2 + + /** + * Scale image to maximum possible dimensions while (1) staying within destination area (2) preserving aspect ratio

+ * *native declaration : :70* + */ + const val NSImageScaleProportionallyUpOrDown: Int = 3 + + /// native declaration : :76 + const val NSMixedState: Int = -1 + + /// native declaration : :77 + const val NSOffState: Int = 0 + + /// native declaration : :78 + const val NSOnState: Int = 1 + + /// native declaration : :85 + const val NSNoCellMask: Int = 0 + + /// native declaration : :86 + const val NSContentsCellMask: Int = 1 + + /// native declaration : :87 + const val NSPushInCellMask: Int = 2 + + /// native declaration : :88 + const val NSChangeGrayCellMask: Int = 4 + + /// native declaration : :89 + const val NSChangeBackgroundCellMask: Int = 8 + + /** + * system 'default'

+ * *native declaration : :93* + */ + const val NSDefaultControlTint: Int = 0 + + /// native declaration : :95 + const val NSBlueControlTint: Int = 1 + + /// native declaration : :96 + const val NSGraphiteControlTint: Int = 6 + + /// native declaration : :98 + const val NSClearControlTint: Int = 7 + + /// native declaration : :103 + const val NSRegularControlSize: Int = 0 + + /// native declaration : :104 + const val NSSmallControlSize: Int = 1 + + /// native declaration : :106 + const val NSMiniControlSize: Int = 2 + + /** + * An empty area, or did not hit in the cell

+ * *native declaration : :355* + */ + const val NSCellHitNone: Int = 0 + + /** + * A content area in the cell

+ * *native declaration : :357* + */ + const val NSCellHitContentArea: Int = 1 shl 0 + + /** + * An editable text area of the cell

+ * *native declaration : :359* + */ + const val NSCellHitEditableTextArea: Int = 1 shl 1 + + /** + * A trackable area in the cell

+ * *native declaration : :361* + */ + const val NSCellHitTrackableArea: Int = 1 shl 2 + + /** + * The background is a light color. Dark content contrasts well with this background.

+ * *native declaration : :396* + */ + const val NSBackgroundStyleLight: Int = 0 + + /** + * The background is a dark color. Light content contrasts well with this background.

+ * *native declaration : :397* + */ + const val NSBackgroundStyleDark: Int = 1 + + /** + * The background is intended to appear higher than the content drawn on it. Content might need to be inset.

+ * *native declaration : :398* + */ + const val NSBackgroundStyleRaised: Int = 2 + + /** + * The background is intended to appear lower than the content drawn on it. Content might need to be embossed.

+ * *native declaration : :399* + */ + const val NSBackgroundStyleLowered: Int = 3 + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSCoder.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSCoder.kt new file mode 100644 index 00000000..7efb5370 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSCoder.kt @@ -0,0 +1,36 @@ +package darwin + +import com.sun.jna.Pointer +import org.rococoa.cocoa.foundation.NSInteger + +abstract class NSCoder : NSObject() { + /** + * Original signature : `-(void)encodeValueOfObjCType:(const char*) at:(const void*)`

+ * *native declaration : NSCoder.h:12* + */ + abstract fun encodeValueOfObjCType_at(type: String?, addr: Pointer?) + + /** + * Original signature : `-(void)encodeDataObject:(NSData*)`

+ * *native declaration : NSCoder.h:13* + */ + abstract fun encodeDataObject(data: NSData?) + + /** + * Original signature : `-(void)decodeValueOfObjCType:(const char*) at:(void*)`

+ * *native declaration : NSCoder.h:14* + */ + abstract fun decodeValueOfObjCType_at(type: String?, data: Pointer?) + + /** + * Original signature : `-(NSData*)decodeDataObject`

+ * *native declaration : NSCoder.h:15* + */ + abstract fun decodeDataObject(): NSData? + + /** + * Original signature : `-(NSInteger)versionForClassName:(NSString*)`

+ * *native declaration : NSCoder.h:16* + */ + abstract fun versionForClassName(className: NSString?): NSInteger? /// native declaration : NSCoder.h +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSColor.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSColor.kt new file mode 100644 index 00000000..316e6235 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSColor.kt @@ -0,0 +1,1091 @@ +package darwin + +import com.sun.jna.Pointer +import org.rococoa.Foundation +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.cocoa.CGFloat +import java.nio.FloatBuffer + +/// native declaration : :35 +abstract class NSColor : NSObject(), NSCopying { + interface _Class : ObjCClass { + /** + * Create NSCalibratedWhiteColorSpace colors.

Original signature : `NSColor* + * colorWithCalibratedWhite(CGFloat, CGFloat)`

+ * *native declaration : :39* + */ + fun colorWithCalibratedWhite_alpha(white: CGFloat?, alpha: CGFloat?): NSColor? + + /** + * Create NSCalibratedRGBColorSpace colors.

Original signature : `NSColor* + * colorWithCalibratedHue(CGFloat, CGFloat, CGFloat, CGFloat)`

+ * *native declaration : :44* + */ + fun colorWithCalibratedHue_saturation_brightness_alpha( + hue: CGFloat?, + saturation: CGFloat?, + brightness: CGFloat?, + alpha: CGFloat? + ): NSColor? + + /** + * Original signature : `NSColor* colorWithCalibratedRed(CGFloat, CGFloat, CGFloat, CGFloat)`

+ * *native declaration : :45* + */ + fun colorWithCalibratedRed_green_blue_alpha( + red: CGFloat?, + green: CGFloat?, + blue: CGFloat?, + alpha: CGFloat? + ): NSColor? + + /** + * Create colors in various device color spaces. In PostScript these colorspaces correspond directly to the + * device-dependent operators setgray, sethsbcolor, setrgbcolor, and setcmykcolor.

Original signature : + * `NSColor* colorWithDeviceWhite(CGFloat, CGFloat)`

+ * *native declaration : :50* + */ + fun colorWithDeviceWhite_alpha(white: CGFloat?, alpha: CGFloat?): NSColor? + + /** + * Original signature : `NSColor* colorWithDeviceHue(CGFloat, CGFloat, CGFloat, CGFloat)`

+ * *native declaration : :51* + */ + fun colorWithDeviceHue_saturation_brightness_alpha( + hue: CGFloat?, + saturation: CGFloat?, + brightness: CGFloat?, + alpha: CGFloat? + ): NSColor? + + /** + * Original signature : `NSColor* colorWithDeviceRed(CGCGFloat, CGCGFloat, CGCGFloat, + * CGCGFloat)`

+ * *native declaration : :52* + */ + fun colorWithDeviceRed_green_blue_alpha( + red: CGFloat?, + green: CGFloat?, + blue: CGFloat?, + alpha: CGFloat? + ): NSColor? + + /** + * Original signature : `NSColor* colorWithDeviceCyan(CGFloat, CGFloat, CGFloat, CGFloat, + * CGFloat)`

+ * *native declaration : :53* + */ + fun colorWithDeviceCyan_magenta_yellow_black_alpha( + cyan: CGFloat?, + magenta: CGFloat?, + yellow: CGFloat?, + black: CGFloat?, + alpha: CGFloat? + ): NSColor? + + /** + * Create named colors from standard color catalogs (such as Pantone).

Original signature : `NSColor* + * colorWithCatalogName(NSString*, NSString*)`

+ * *native declaration : :58* + */ + fun colorWithCatalogName_colorName(listName: Pointer?, colorName: Pointer?): NSColor? + + /** + * Create colors with arbitrary colorspace. The number of components in the provided array should match the + * number dictated by the specified colorspace, plus one for alpha (supply 1.0 for opaque colors); otherwise an + * exception will be raised. If the colorspace is one which cannot be used with NSColors, nil is returned.

+ * Original signature : `NSColor* colorWithColorSpace(NSColorSpace*, const CGFloat*, NSInteger)`

+ * *native declaration : :64* + */ + fun colorWithColorSpace_components_count( + space: Pointer?, + components: Array?, + numberOfComponents: Int + ): NSColor? + + /** + * Create colors with arbitrary colorspace. The number of components in the provided array should match the + * number dictated by the specified colorspace, plus one for alpha (supply 1.0 for opaque colors); otherwise an + * exception will be raised. If the colorspace is one which cannot be used with NSColors, nil is returned.

+ * Original signature : `NSColor* colorWithColorSpace(NSColorSpace*, const CGFloat*, NSInteger)`

+ * *native declaration : :64* + */ + fun colorWithColorSpace_components_count( + space: Pointer?, + components: FloatBuffer?, + numberOfComponents: Int + ): NSColor? + + /** + * Some convenience methods to create colors in the calibrated color spaces...

Original signature : + * `NSColor* blackColor()`

0.0 white

+ * *native declaration : :70* + */ + fun blackColor(): NSColor? + + /** + * Original signature : `NSColor* darkGrayColor()`

0.333 white

+ * *native declaration : :71* + */ + fun darkGrayColor(): NSColor + + /** + * Original signature : `NSColor* lightGrayColor()`

0.667 white

+ * *native declaration : :72* + */ + fun lightGrayColor(): NSColor? + + /** + * Original signature : `NSColor* whiteColor()`

1.0 white

+ * *native declaration : :73* + */ + fun whiteColor(): NSColor + + /** + * Original signature : `NSColor* grayColor()`

0.5 white

+ * *native declaration : :74* + */ + fun grayColor(): NSColor? + + /** + * Original signature : `NSColor* redColor()`

1.0, 0.0, 0.0 RGB

+ * *native declaration : :75* + */ + fun redColor(): NSColor + + /** + * Original signature : `NSColor* greenColor()`

0.0, 1.0, 0.0 RGB

+ * *native declaration : :76* + */ + fun greenColor(): NSColor? + + /** + * Original signature : `NSColor* blueColor()`

0.0, 0.0, 1.0 RGB

+ * *native declaration : :77* + */ + fun blueColor(): NSColor + + /** + * Original signature : `NSColor* cyanColor()`

0.0, 1.0, 1.0 RGB

+ * *native declaration : :78* + */ + fun cyanColor(): NSColor? + + /** + * Original signature : `NSColor* yellowColor()`

1.0, 1.0, 0.0 RGB

+ * *native declaration : :79* + */ + fun yellowColor(): NSColor? + + /** + * Original signature : `NSColor* magentaColor()`

1.0, 0.0, 1.0 RGB

+ * *native declaration : :80* + */ + fun magentaColor(): NSColor? + + /** + * Original signature : `NSColor* orangeColor()`

1.0, 0.5, 0.0 RGB

+ * *native declaration : :81* + */ + fun orangeColor(): NSColor? + + /** + * Original signature : `NSColor* purpleColor()`

0.5, 0.0, 0.5 RGB

+ * *native declaration : :82* + */ + fun purpleColor(): NSColor? + + /** + * Original signature : `NSColor* brownColor()`

0.6, 0.4, 0.2 RGB

+ * *native declaration : :83* + */ + fun brownColor(): NSColor? + + /** + * Original signature : `NSColor* clearColor()`

0.0 white, 0.0 alpha

+ * *native declaration : :84* + */ + fun clearColor(): NSColor? + + /** + * Original signature : `NSColor* controlShadowColor()`

Dark border for controls

+ * *native declaration : :86* + */ + fun controlShadowColor(): NSColor + + /** + * Original signature : `NSColor* controlDarkShadowColor()`

Darker border for controls

+ * *native declaration : :87* + */ + fun controlDarkShadowColor(): NSColor + + /** + * Original signature : `NSColor* controlColor()`

Control face and old window background + * color

+ * *native declaration : :88* + */ + fun controlColor(): NSColor + + /** + * Original signature : `NSColor* controlHighlightColor()`

Light border for controls

+ * *native declaration : :89* + */ + fun controlHighlightColor(): NSColor + + /** + * Original signature : `NSColor* controlLightHighlightColor()`

Lighter border for controls

+ * *native declaration : :90* + */ + fun controlLightHighlightColor(): NSColor + + /** + * Original signature : `NSColor* controlTextColor()`

Text on controls

+ * *native declaration : :91* + */ + fun controlTextColor(): NSColor + + /** + * Original signature : `NSColor* controlBackgroundColor()`

Background of large controls + * (browser, tableview, clipview, ...)

+ * *native declaration : :92* + */ + fun controlBackgroundColor(): NSColor + + /** + * Original signature : `NSColor* selectedControlColor()`

Control face for selected controls

+ * *native declaration : :93* + */ + fun selectedControlColor(): NSColor + + /** + * Original signature : `NSColor* secondarySelectedControlColor()`

Color for selected controls + * when control is not active (that is, not focused)

+ * *native declaration : :94* + */ + fun secondarySelectedControlColor(): NSColor + + /** + * Original signature : `NSColor* selectedControlTextColor()`

Text on selected controls

+ * *native declaration : :95* + */ + fun selectedControlTextColor(): NSColor + + /** + * Original signature : `NSColor* disabledControlTextColor()`

Text on disabled controls

+ * *native declaration : :96* + */ + fun disabledControlTextColor(): NSColor + + /** + * Original signature : `NSColor* textColor()`

Document text

+ * *native declaration : :97* + */ + fun textColor(): NSColor + + /** + * Original signature : `NSColor* textBackgroundColor()`

Document text background

+ * *native declaration : :98* + */ + fun textBackgroundColor(): NSColor + + /** + * Original signature : `NSColor* selectedTextColor()`

Selected document text

+ * *native declaration : :99* + */ + fun selectedTextColor(): NSColor + + /** + * Original signature : `NSColor* selectedTextBackgroundColor()`

Selected document text + * background

+ * *native declaration : :100* + */ + fun selectedTextBackgroundColor(): NSColor + + /** + * Original signature : `NSColor* gridColor()`

Grids in controls

+ * *native declaration : :101* + */ + fun gridColor(): NSColor + + /** + * Original signature : `NSColor* keyboardFocusIndicatorColor()`

Keyboard focus ring around + * controls

+ * *native declaration : :102* + */ + fun keyboardFocusIndicatorColor(): NSColor + + /** + * Original signature : `NSColor* windowBackgroundColor()`

Background fill for window + * contents

+ * *native declaration : :103* + */ + fun windowBackgroundColor(): NSColor + + /** + * Original signature : `NSColor* scrollBarColor()`

Scroll bar slot color

+ * *native declaration : :105* + */ + fun scrollBarColor(): NSColor + + /** + * Original signature : `NSColor* knobColor()`

Knob face color for controls

+ * *native declaration : :106* + */ + fun knobColor(): NSColor + + /** + * Original signature : `NSColor* selectedKnobColor()`

Knob face color for selected controls

+ * *native declaration : :107* + */ + fun selectedKnobColor(): NSColor + + /** + * Original signature : `NSColor* windowFrameColor()`

Window frames

+ * *native declaration : :109* + */ + fun windowFrameColor(): NSColor + + /** + * Original signature : `NSColor* windowFrameTextColor()`

Text on window frames

+ * *native declaration : :110* + */ + fun windowFrameTextColor(): NSColor + + /** + * Original signature : `NSColor* selectedMenuItemColor()`

Highlight color for menus

+ * *native declaration : :112* + */ + fun selectedMenuItemColor(): NSColor + + /** + * Original signature : `NSColor* selectedMenuItemTextColor()`

Highlight color for menu text

+ * *native declaration : :113* + */ + fun selectedMenuItemTextColor(): NSColor + + /** + * Original signature : `NSColor* highlightColor()`

Highlight color for UI elements (this is + * abstract and defines the color all highlights tend toward)

+ * *native declaration : :115* + */ + fun highlightColor(): NSColor + + /** + * Original signature : `NSColor* shadowColor()`

Shadow color for UI elements (this is abstract + * and defines the color all shadows tend toward)

+ * *native declaration : :116* + */ + fun shadowColor(): NSColor + + /** + * Original signature : `NSColor* headerColor()`

Background color for header cells in + * Table/OutlineView

+ * *native declaration : :118* + */ + fun headerColor(): NSColor + + /** + * Original signature : `NSColor* headerTextColor()`

Text color for header cells in + * Table/OutlineView

+ * *native declaration : :119* + */ + fun headerTextColor(): NSColor + + /** + * Original signature : `NSColor* alternateSelectedControlColor()`

Similar to + * selectedControlColor; for use in lists and tables

+ * *native declaration : :122* + */ + fun alternateSelectedControlColor(): NSColor + + /** + * Original signature : `NSColor* alternateSelectedControlTextColor()`

Similar to + * selectedControlTextColor; see alternateSelectedControlColor

+ * *native declaration : :123* + */ + fun alternateSelectedControlTextColor(): NSColor + + /** + * Original signature : `NSArray* controlAlternatingRowBackgroundColors()`

Standard colors for + * alternating colored rows in tables and lists (for instance, light blue/white; don't assume just two + * colors)

+ * *native declaration : :127* + */ + fun controlAlternatingRowBackgroundColors(): NSArray? + /** + * *native declaration : :133*

+ * Conversion Error : /// Original signature : `NSColor* colorForControlTint(null)`

+ * + (NSColor*)colorForControlTint:(null)controlTint; // pass in valid tint to get rough color matching. returns default if invalid tint

+ * (Argument controlTint cannot be converted) + */ + /** + * Original signature : `currentControlTint()`

returns current system control tint

+ * *native declaration : :136* + */ + fun currentControlTint(): Pointer? + + /** + * Pasteboard methods

Original signature : `NSColor* colorFromPasteboard(NSPasteboard*)`

+ * *native declaration : :243* + */ + fun colorFromPasteboard(pasteBoard: NSPasteboard?): NSColor? + + /** + * Pattern methods. Note that colorWithPatternImage: mistakenly returns a non-autoreleased color in 10.1.x and + * earlier. This has been fixed in (NSAppKitVersionNumber >= NSAppKitVersionNumberWithPatternColorLeakFix), for + * apps linked post-10.1.x.

Original signature : `NSColor* colorWithPatternImage(NSImage*)`

+ * *native declaration : :248* + */ + fun colorWithPatternImage(image: NSImage?): NSColor? + + /** + * Global flag for determining whether an application supports alpha. This flag is consulted when an + * application imports alpha (through color dragging, for instance). The value of this flag also determines + * whether the color panel has an opacity slider. This value is YES by default, indicating that the opacity + * components of imported colors will be set to 1.0. If an application wants alpha, it can either set the + * "NSIgnoreAlpha" default to NO or call the set method below.

This method provides a global approach to + * removing alpha which might not always be appropriate. Applications which need to import alpha sometimes + * should set this flag to NO and explicitly make colors opaque in cases where it matters to them.

Original + * signature : `void setIgnoresAlpha(BOOL)`

+ * *native declaration : :260* + */ + fun setIgnoresAlpha(flag: Boolean) + + /** + * Original signature : `BOOL ignoresAlpha()`

+ * *native declaration : :261* + */ + fun ignoresAlpha(): Boolean + + /** + * Original signature : `NSColor* colorWithCIColor(CIColor*)`

+ * *from NSQuartzCoreAdditions native declaration : :268* + */ + // NSColor colorWithCIColor(CIColor color); + fun systemBlueColor(): NSColor? + + fun systemBrownColor(): NSColor? + + fun systemGrayColor(): NSColor + + fun systemGreenColor(): NSColor? + + fun systemOrangeColor(): NSColor? + + fun systemPinkColor(): NSColor? + + fun systemPurpleColor(): NSColor? + + fun systemRedColor(): NSColor? + + fun systemYellowColor(): NSColor? + + fun placeholderTextColor(): NSColor + + fun labelColor(): NSColor + + fun secondaryLabelColor(): NSColor + + fun tertiaryLabelColor(): NSColor + + fun quaternaryLabelColor(): NSColor + } + + /** + * Original signature : `NSColor* highlightWithLevel(CGFloat)`

val = 0 => receiver, val = 1 => + * highlightColor

+ * *native declaration : :130* + */ + abstract fun highlightWithLevel(`val`: CGFloat?): NSColor? + + /** + * Original signature : `NSColor* shadowWithLevel(CGFloat)`

val = 0 => receiver, val = 1 => + * shadowColor

+ * *native declaration : :131* + */ + abstract fun shadowWithLevel(`val`: CGFloat?): NSColor? + + /** + * Set the color: Sets the fill and stroke colors in the current drawing context. If the color doesn't know about + * alpha, it's set to 1.0. Should be implemented by subclassers.

Original signature : `void + * set()`

+ * *native declaration : :142* + */ + abstract fun set() + + /** + * Set the fill or stroke colors individually. These should be implemented by subclassers.

Original signature : + * `void setFill()`

+ * *native declaration : :147* + */ + abstract fun setFill() + + /** + * Original signature : `void setStroke()`

+ * *native declaration : :148* + */ + abstract fun setStroke() + + /** + * Get the color space of the color. Should be implemented by subclassers.

Original signature : `NSString* + * colorSpaceName()`

+ * *native declaration : :153* + */ + abstract fun colorSpaceName(): Pointer? + + /** + * Convert the color to another colorspace, using a colorspace name. This may return nil if the specified conversion + * cannot be done. The abstract implementation of this method returns the receiver if the specified colorspace + * matches that of the receiver; otherwise it returns nil. Subclassers who can convert themselves to other + * colorspaces override this method to do something better.

The version of this method which takes a device + * description allows the color to specialize itself for the given device. Device descriptions can be obtained from + * windows, screens, and printers with the "deviceDescription" method.

If device is nil then the current device + * (as obtained from the currently lockFocus'ed view's window or, if printing, the current printer) is used. The + * method without the device: argument passes nil for the device.

If colorSpace is nil, then the most + * appropriate color space is used.

Original signature : `NSColor* colorUsingColorSpaceName(NSString*)`

+ * *native declaration : :164* + */ + abstract fun colorUsingColorSpaceName(colorSpace: Pointer?): NSColor? + + /** + * Original signature : `NSColor* colorUsingColorSpaceName(NSString*, NSDictionary*)`

+ * *native declaration : :165* + */ + abstract fun colorUsingColorSpaceName_device(colorSpace: Pointer?, deviceDescription: Pointer?): NSColor? + + /** + * colorUsingColorSpace: will convert existing color to a new colorspace and create a new color, which will likely + * have different component values but look the same. It will return the same color if the colorspace is already the + * same as the one specified. Will return nil if conversion is not possible.

Original signature : + * `NSColor* colorUsingColorSpace(NSColorSpace*)`

+ * *native declaration : :171* + */ + abstract fun colorUsingColorSpace(space: Pointer?): NSColor? + + /** + * Blend using the NSCalibratedRGB color space. Both colors are converted into the calibrated RGB color space, and + * they are blended by taking fraction of color and 1 - fraction of the receiver. The result is in the calibrated + * RGB color space. If the colors cannot be converted into the calibrated RGB color space the blending fails and nil + * is returned.

Original signature : `NSColor* blendedColorWithFraction(CGFloat, NSColor*)`

+ * *native declaration : :177* + */ + abstract fun blendedColorWithFraction_ofColor(fraction: CGFloat?, color: NSColor?): NSColor? + + /** + * Returns a color in the same color space as the receiver with the specified alpha component. The abstract + * implementation of this method returns the receiver if alpha is 1.0, otherwise it returns nil; subclassers who + * have explicit opacity components override this method to actually return a color with the specified alpha.

+ * Original signature : `NSColor* colorWithAlphaComponent(CGFloat)`

+ * *native declaration : :182* + */ + abstract fun colorWithAlphaComponent(alpha: CGFloat?): NSColor? + + /** + * Get the catalog and color name of standard colors from catalogs. These colors are special colors which are + * usually looked up on each device by their name.

Original signature : `NSString* + * catalogNameComponent()`

+ * *native declaration : :189* + */ + abstract fun catalogNameComponent(): String? + + /** + * Original signature : `NSString* colorNameComponent()`

+ * *native declaration : :190* + */ + abstract fun colorNameComponent(): String? + + /** + * Return localized versions of the above.

Original signature : `NSString* + * localizedCatalogNameComponent()`

+ * *native declaration : :194* + */ + abstract fun localizedCatalogNameComponent(): String? + + /** + * Original signature : `NSString* localizedColorNameComponent()`

+ * *native declaration : :195* + */ + abstract fun localizedColorNameComponent(): String? + + /** + * Get the red, green, or blue components of NSCalibratedRGB or NSDeviceRGB colors.

Original signature : + * `CGFloat redComponent()`

+ * *native declaration : :199* + */ + abstract fun redComponent(): CGFloat? + + /** + * Original signature : `CGFloat greenComponent()`

+ * *native declaration : :200* + */ + abstract fun greenComponent(): CGFloat? + + /** + * Original signature : `CGFloat blueComponent()`

+ * *native declaration : :201* + */ + abstract fun blueComponent(): CGFloat? + + /** + * Original signature : `void getRed(CGFloat*, CGFloat*, CGFloat*, CGFloat*)`

+ * *native declaration : :202* + */ + abstract fun getRed_green_blue_alpha(red: CGFloat?, green: CGFloat?, blue: CGFloat?, alpha: CGFloat?) + + /** + * Get the components of NSCalibratedRGB or NSDeviceRGB colors as hue, saturation, or brightness.

Original + * signature : `CGFloat hueComponent()`

+ * *native declaration : :206* + */ + abstract fun hueComponent(): CGFloat? + + /** + * Original signature : `CGFloat saturationComponent()`

+ * *native declaration : :207* + */ + abstract fun saturationComponent(): CGFloat? + + /** + * Original signature : `CGFloat brightnessComponent()`

+ * *native declaration : :208* + */ + abstract fun brightnessComponent(): CGFloat? + + /** + * Original signature : `void getHue(CGFloat*, CGFloat*, CGFloat*, CGFloat*)`

+ * *native declaration : :209* + */ + abstract fun getHue_saturation_brightness_alpha( + hue: FloatBuffer?, + saturation: FloatBuffer?, + brightness: FloatBuffer?, + alpha: FloatBuffer? + ) + + /** + * Get the white component of NSCalibratedWhite or NSDeviceWhite colors.

Original signature : `CGFloat + * whiteComponent()`

+ * *native declaration : :214* + */ + abstract fun whiteComponent(): CGFloat? + + /** + * Original signature : `void getWhite(CGFloat*, CGFloat*)`

+ * *native declaration : :215* + */ + abstract fun getWhite_alpha(white: FloatBuffer?, alpha: FloatBuffer?) + + /** + * Get the CMYK components of NSDeviceCMYK colors.

Original signature : `CGFloat + * cyanComponent()`

+ * *native declaration : :220* + */ + abstract fun cyanComponent(): CGFloat? + + /** + * Original signature : `CGFloat magentaComponent()`

+ * *native declaration : :221* + */ + abstract fun magentaComponent(): CGFloat? + + /** + * Original signature : `CGFloat yellowComponent()`

+ * *native declaration : :222* + */ + abstract fun yellowComponent(): CGFloat? + + /** + * Original signature : `CGFloat blackComponent()`

+ * *native declaration : :223* + */ + abstract fun blackComponent(): CGFloat? + + /** + * Original signature : `void getCyan(CGFloat*, CGFloat*, CGFloat*, CGFloat*, CGFloat*)`

+ * *native declaration : :224* + */ + abstract fun getCyan_magenta_yellow_black_alpha( + cyan: FloatBuffer?, + magenta: FloatBuffer?, + yellow: FloatBuffer?, + black: FloatBuffer?, + alpha: FloatBuffer? + ) + + /** + * For colors with custom colorspace; get the colorspace and individual floating point components, including alpha. + * Note that all these methods will work for other NSColors which have floating point components. They will raise + * exceptions otherwise, like other existing colorspace-specific methods.

Original signature : + * `NSColorSpace* colorSpace()`

+ * *native declaration : :230* + */ + abstract fun colorSpace(): Pointer? + + /** + * Original signature : `NSInteger numberOfComponents()`

+ * *native declaration : :231* + */ + abstract fun numberOfComponents(): Int + + /** + * Original signature : `void getComponents(CGFloat*)`

+ * *native declaration : :232* + */ + abstract fun getComponents(components: FloatBuffer?) + + /** + * Get the alpha component. For colors which do not have alpha components, this will return 1.0 (opaque).

+ * Original signature : `CGFloat alphaComponent()`

+ * *native declaration : :238* + */ + abstract fun alphaComponent(): CGFloat? + + /** + * Original signature : `void writeToPasteboard(NSPasteboard*)`

+ * *native declaration : :244* + */ + abstract fun writeToPasteboard(pasteBoard: NSPasteboard?) + + /** + * Original signature : `NSImage* patternImage()`

+ * *native declaration : :249* + */ + abstract fun patternImage(): NSImage? + + /** + * *native declaration : :253*

+ * Conversion Error : / **

+ * * Draws the color and adorns it to indicate the type of color. Used by colorwells, swatches, and other UI objects that need to display colors. Implementation in NSColor simply draws the color (with an indication of transparency if the color isn't fully opaque); subclassers can draw more stuff as they see fit.

+ * * Original signature : `void drawSwatchInRect(null)`

+ * * /

+ * - (void)drawSwatchInRect:(null)rect; (Argument rect cannot be converted) + */ + companion object { + private val CLASS: _Class = Rococoa.createClass("NSColor", _Class::class.java) + + fun labelColor(): NSColor { + if (Rococoa.cast(CLASS, NSColor::class.java).respondsToSelector(Foundation.selector("labelColor"))) { + return CLASS.labelColor() + } + return controlTextColor() + } + + fun secondaryLabelColor(): NSColor { + if (Rococoa.cast(CLASS, NSColor::class.java) + .respondsToSelector(Foundation.selector("secondaryLabelColor")) + ) { + return CLASS.secondaryLabelColor() + } + return systemGrayColor() + } + + fun tertiaryLabelColor(): NSColor { + if (Rococoa.cast(CLASS, NSColor::class.java) + .respondsToSelector(Foundation.selector("tertiaryLabelColor")) + ) { + return CLASS.tertiaryLabelColor() + } + return systemGrayColor() + } + + fun quaternaryLabelColor(): NSColor { + if (Rococoa.cast(CLASS, NSColor::class.java) + .respondsToSelector(Foundation.selector("quaternaryLabelColor")) + ) { + return CLASS.quaternaryLabelColor() + } + return systemGrayColor() + } + + fun placeholderTextColor(): NSColor { + if (Rococoa.cast(CLASS, NSColor::class.java) + .respondsToSelector(Foundation.selector("placeholderTextColor")) + ) { + return CLASS.placeholderTextColor() + } + return systemGrayColor() + } + + fun whiteColor(): NSColor { + return CLASS.whiteColor() + } + + fun systemGrayColor(): NSColor { + if (Rococoa.cast(CLASS, NSObject::class.java).respondsToSelector(Foundation.selector("systemGrayColor"))) { + return CLASS.systemGrayColor() + } + return darkGrayColor() + } + + fun darkGrayColor(): NSColor { + return CLASS.darkGrayColor() + } + + fun blueColor(): NSColor { + return CLASS.blueColor() + } + + fun redColor(): NSColor { + return CLASS.redColor() + } + + /** + * Original signature : `NSColor* controlShadowColor()`

Dark border for controls

+ * *native declaration : :86* + */ + fun controlShadowColor(): NSColor { + return CLASS.controlShadowColor() + } + + /** + * Original signature : `NSColor* controlDarkShadowColor()`

Darker border for controls

+ * *native declaration : :87* + */ + fun controlDarkShadowColor(): NSColor { + return CLASS.controlDarkShadowColor() + } + + /** + * Original signature : `NSColor* controlColor()`

Control face and old window background color

+ * *native declaration : :88* + */ + fun controlColor(): NSColor { + return CLASS.controlColor() + } + + /** + * Original signature : `NSColor* controlHighlightColor()`

Light border for controls

+ * *native declaration : :89* + */ + fun controlHighlightColor(): NSColor { + return CLASS.controlHighlightColor() + } + + /** + * Original signature : `NSColor* controlLightHighlightColor()`

Lighter border for controls

+ * *native declaration : :90* + */ + fun controlLightHighlightColor(): NSColor { + return CLASS.controlLightHighlightColor() + } + + /** + * Original signature : `NSColor* controlTextColor()`

Text on controls

+ * *native declaration : :91* + */ + fun controlTextColor(): NSColor { + return CLASS.controlTextColor() + } + + /** + * Original signature : `NSColor* controlBackgroundColor()`

Background of large controls (browser, + * tableview, clipview, ...)

+ * *native declaration : :92* + */ + fun controlBackgroundColor(): NSColor { + return CLASS.controlBackgroundColor() + } + + /** + * Original signature : `NSColor* selectedControlColor()`

Control face for selected controls

+ * *native declaration : :93* + */ + fun selectedControlColor(): NSColor { + return CLASS.selectedControlColor() + } + + /** + * Original signature : `NSColor* secondarySelectedControlColor()`

Color for selected controls when + * control is not active (that is, not focused)

+ * *native declaration : :94* + */ + fun secondarySelectedControlColor(): NSColor { + return CLASS.secondarySelectedControlColor() + } + + /** + * Original signature : `NSColor* selectedControlTextColor()`

Text on selected controls

+ * *native declaration : :95* + */ + fun selectedControlTextColor(): NSColor { + return CLASS.selectedControlTextColor() + } + + /** + * Original signature : `NSColor* disabledControlTextColor()`

Text on disabled controls

+ * *native declaration : :96* + */ + fun disabledControlTextColor(): NSColor { + return CLASS.disabledControlTextColor() + } + + /** + * Original signature : `NSColor* textColor()`

Document text

+ * *native declaration : :97* + */ + fun textColor(): NSColor { + return CLASS.textColor() + } + + /** + * Original signature : `NSColor* textBackgroundColor()`

Document text background

+ * *native declaration : :98* + */ + fun textBackgroundColor(): NSColor { + return CLASS.textBackgroundColor() + } + + /** + * Original signature : `NSColor* selectedTextColor()`

Selected document text

+ * *native declaration : :99* + */ + fun selectedTextColor(): NSColor { + return CLASS.selectedTextColor() + } + + /** + * Original signature : `NSColor* selectedTextBackgroundColor()`

Selected document text + * background

+ * *native declaration : :100* + */ + fun selectedTextBackgroundColor(): NSColor { + return CLASS.selectedTextBackgroundColor() + } + + /** + * Original signature : `NSColor* gridColor()`

Grids in controls

+ * *native declaration : :101* + */ + fun gridColor(): NSColor { + return CLASS.gridColor() + } + + /** + * Original signature : `NSColor* keyboardFocusIndicatorColor()`

Keyboard focus ring around + * controls

+ * *native declaration : :102* + */ + fun keyboardFocusIndicatorColor(): NSColor { + return CLASS.keyboardFocusIndicatorColor() + } + + /** + * Original signature : `NSColor* windowBackgroundColor()`

Background fill for window contents

+ * *native declaration : :103* + */ + fun windowBackgroundColor(): NSColor { + return CLASS.windowBackgroundColor() + } + + /** + * Original signature : `NSColor* scrollBarColor()`

Scroll bar slot color

+ * *native declaration : :105* + */ + fun scrollBarColor(): NSColor { + return CLASS.scrollBarColor() + } + + /** + * Original signature : `NSColor* knobColor()`

Knob face color for controls

+ * *native declaration : :106* + */ + fun knobColor(): NSColor { + return CLASS.knobColor() + } + + /** + * Original signature : `NSColor* selectedKnobColor()`

Knob face color for selected controls

+ * *native declaration : :107* + */ + fun selectedKnobColor(): NSColor { + return CLASS.selectedKnobColor() + } + + /** + * Original signature : `NSColor* windowFrameColor()`

Window frames

+ * *native declaration : :109* + */ + fun windowFrameColor(): NSColor { + return CLASS.windowFrameColor() + } + + /** + * Original signature : `NSColor* windowFrameTextColor()`

Text on window frames

+ * *native declaration : :110* + */ + fun windowFrameTextColor(): NSColor { + return CLASS.windowFrameTextColor() + } + + /** + * Original signature : `NSColor* selectedMenuItemColor()`

Highlight color for menus

+ * *native declaration : :112* + */ + fun selectedMenuItemColor(): NSColor { + return CLASS.selectedMenuItemColor() + } + + /** + * Original signature : `NSColor* selectedMenuItemTextColor()`

Highlight color for menu text

+ * *native declaration : :113* + */ + fun selectedMenuItemTextColor(): NSColor { + return CLASS.selectedMenuItemTextColor() + } + + /** + * Original signature : `NSColor* highlightColor()`

Highlight color for UI elements (this is abstract + * and defines the color all highlights tend toward)

+ * *native declaration : :115* + */ + fun highlightColor(): NSColor { + return CLASS.highlightColor() + } + + /** + * Original signature : `NSColor* shadowColor()`

Shadow color for UI elements (this is abstract and + * defines the color all shadows tend toward)

+ * *native declaration : :116* + */ + fun shadowColor(): NSColor { + return CLASS.shadowColor() + } + + /** + * Original signature : `NSColor* headerColor()`

Background color for header cells in + * Table/OutlineView

+ * *native declaration : :118* + */ + fun headerColor(): NSColor { + return CLASS.headerColor() + } + + /** + * Original signature : `NSColor* headerTextColor()`

Text color for header cells in + * Table/OutlineView

+ * *native declaration : :119* + */ + fun headerTextColor(): NSColor { + return CLASS.headerTextColor() + } + + /** + * Original signature : `NSColor* alternateSelectedControlColor()`

Similar to selectedControlColor; + * for use in lists and tables

+ * *native declaration : :122* + */ + fun alternateSelectedControlColor(): NSColor { + return CLASS.alternateSelectedControlColor() + } + + /** + * Original signature : `NSColor* alternateSelectedControlTextColor()`

Similar to + * selectedControlTextColor; see alternateSelectedControlColor

+ * *native declaration : :123* + */ + fun alternateSelectedControlTextColor(): NSColor { + return CLASS.alternateSelectedControlTextColor() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSComboBox.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSComboBox.kt new file mode 100644 index 00000000..aa705788 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSComboBox.kt @@ -0,0 +1,245 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSRect + +/// native declaration : :16 +abstract class NSComboBox : NSTextField() { + interface DataSource { + open fun numberOfItemsInComboBox(combo: NSComboBox?): NSInteger? + + open fun comboBox_objectValueForItemAtIndex(sender: NSComboBox?, row: NSInteger?): NSObject? + } + + interface _Class : ObjCClass { + open fun alloc(): NSComboBox + } + + @Override + abstract override fun initWithFrame(frameRect: NSRect?): NSComboBox + + /** + * Original signature : `BOOL hasVerticalScroller()`

+ * *native declaration : :21* + */ + abstract fun hasVerticalScroller(): Boolean + + /** + * Original signature : `void setHasVerticalScroller(BOOL)`

+ * *native declaration : :22* + */ + abstract fun setHasVerticalScroller(flag: Boolean) + + /** + * Original signature : `intercellSpacing()`

+ * *native declaration : :23* + */ + abstract fun intercellSpacing(): NSObject? + /** + * *native declaration : :24*

+ * Conversion Error : /// Original signature : `void setIntercellSpacing(null)`

+ * - (void)setIntercellSpacing:(null)aSize; (Argument aSize cannot be converted) + */ + /** + * Original signature : `CGFloat itemHeight()`

+ * *native declaration : :25* + */ + abstract fun itemHeight(): CGFloat? + + /** + * Original signature : `void setItemHeight(CGFloat)`

+ * *native declaration : :26* + */ + abstract fun setItemHeight(itemHeight: CGFloat?) + + /** + * Original signature : `NSInteger numberOfVisibleItems()`

+ * *native declaration : :27* + */ + abstract fun numberOfVisibleItems(): NSInteger? + + /** + * Original signature : `void setNumberOfVisibleItems(NSInteger)`

+ * *native declaration : :28* + */ + abstract fun setNumberOfVisibleItems(visibleItems: NSInteger?) + + /** + * Original signature : `void setButtonBordered(BOOL)`

+ * *native declaration : :31* + */ + abstract fun setButtonBordered(flag: Boolean) + + /** + * Original signature : `BOOL isButtonBordered()`

+ * *native declaration : :32* + */ + abstract fun isButtonBordered(): Boolean + + /** + * Original signature : `void reloadData()`

+ * *native declaration : :35* + */ + abstract fun reloadData() + + /** + * Original signature : `void noteNumberOfItemsChanged()`

+ * *native declaration : :36* + */ + abstract fun noteNumberOfItemsChanged() + + /** + * Original signature : `void setUsesDataSource(BOOL)`

+ * *native declaration : :38* + */ + abstract fun setUsesDataSource(flag: Boolean) + + /** + * Original signature : `BOOL usesDataSource()`

+ * *native declaration : :39* + */ + abstract fun usesDataSource(): Boolean + + /** + * Original signature : `void scrollItemAtIndexToTop(NSInteger)`

+ * *native declaration : :41* + */ + abstract fun scrollItemAtIndexToTop(index: NSInteger?) + + /** + * Original signature : `void scrollItemAtIndexToVisible(NSInteger)`

+ * *native declaration : :42* + */ + abstract fun scrollItemAtIndexToVisible(index: NSInteger?) + + /** + * Original signature : `void selectItemAtIndex(NSInteger)`

+ * *native declaration : :44* + */ + abstract fun selectItemAtIndex(index: NSInteger?) + + /** + * Original signature : `void deselectItemAtIndex(NSInteger)`

+ * *native declaration : :45* + */ + abstract fun deselectItemAtIndex(index: NSInteger?) + + /** + * Original signature : `NSInteger indexOfSelectedItem()`

+ * *native declaration : :46* + */ + abstract fun indexOfSelectedItem(): NSInteger? + + /** + * Original signature : `NSInteger numberOfItems()`

+ * *native declaration : :47* + */ + abstract fun numberOfItems(): NSInteger? + + /** + * Original signature : `BOOL completes()`

+ * *native declaration : :49* + */ + abstract fun completes(): Boolean + + /** + * Original signature : `void setCompletes(BOOL)`

+ * *native declaration : :50* + */ + abstract fun setCompletes(completes: Boolean) + + /** + * These two methods can only be used when usesDataSource is YES

+ * Original signature : `id dataSource()`

+ * *native declaration : :53* + */ + abstract fun dataSource(): org.rococoa.ID? + + /** + * Original signature : `void setDataSource(id)`

+ * *native declaration : :54* + */ + abstract fun setDataSource(aSource: org.rococoa.ID?) + + /** + * These methods can only be used when usesDataSource is NO

+ * Original signature : `void addItemWithObjectValue(id)`

+ * *native declaration : :57* + */ + abstract fun addItemWithObjectValue(`object`: NSObject?) + + /** + * Original signature : `void addItemsWithObjectValues(NSArray*)`

+ * *native declaration : :58* + */ + abstract fun addItemsWithObjectValues(objects: NSArray?) + + /** + * Original signature : `void insertItemWithObjectValue(id, NSInteger)`

+ * *native declaration : :59* + */ + abstract fun insertItemWithObjectValue_atIndex(`object`: NSObject?, index: NSInteger?) + + /** + * Original signature : `void removeItemWithObjectValue(id)`

+ * *native declaration : :60* + */ + abstract fun removeItemWithObjectValue(`object`: NSObject?) + + /** + * Original signature : `void removeItemAtIndex(NSInteger)`

+ * *native declaration : :61* + */ + abstract fun removeItemAtIndex(index: NSInteger?) + + /** + * Original signature : `void removeAllItems()`

+ * *native declaration : :62* + */ + abstract fun removeAllItems() + + /** + * Original signature : `void selectItemWithObjectValue(id)`

+ * *native declaration : :63* + */ + abstract fun selectItemWithObjectValue(`object`: NSObject?) + + /** + * Original signature : `id itemObjectValueAtIndex(NSInteger)`

+ * *native declaration : :64* + */ + abstract fun itemObjectValueAtIndex(index: NSInteger?): NSObject? + + /** + * Original signature : `id objectValueOfSelectedItem()`

+ * *native declaration : :65* + */ + abstract fun objectValueOfSelectedItem(): NSObject? + + /** + * Original signature : `NSInteger indexOfItemWithObjectValue(id)`

+ * *native declaration : :66* + */ + abstract fun indexOfItemWithObjectValue(`object`: NSObject?): NSInteger? + + /** + * Original signature : `NSArray* objectValues()`

+ * *native declaration : :67* + */ + abstract fun objectValues(): NSArray? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSComboBox", _Class::class.java) + + fun textfieldWithFrame(frameRect: NSRect?): NSComboBox? { + return CLASS.alloc().initWithFrame(frameRect) + } + + val ComboBoxWillPopUpNotification: String? = "NSComboBoxWillPopUpNotification" + val ComboBoxWillDismissNotification: String? = "NSComboBoxWillDismissNotification" + val ComboBoxSelectionDidChangeNotification: String? = "NSComboBoxSelectionDidChangeNotification" + val ComboBoxSelectionIsChangingNotification: String? = "NSComboBoxSelectionIsChangingNotification" + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSComboBoxCell.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSComboBoxCell.kt new file mode 100644 index 00000000..286ba7e8 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSComboBoxCell.kt @@ -0,0 +1,244 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.ObjCObject +import org.rococoa.cocoa.foundation.NSInteger + +/** + * This file was autogenerated by [JNAerator](http://jnaerator.googlecode.com/),

+ * a tool written by [Olivier Chafik](http://ochafik.free.fr/) that [uses a few opensource projects.](http://code.google.com/p/jnaerator/wiki/CreditsAndLicense).

+ * For help, please visit [NativeLibs4Java](http://nativelibs4java.googlecode.com/), [Rococoa](http://rococoa.dev.java.net/), or [JNA](http://jna.dev.java.net/). + * + */ +abstract class NSComboBoxCell : NSTextFieldCell() { + interface _Class : ObjCClass { + open fun alloc(): NSComboBoxCell + } + + @Override + abstract override fun init(): NSComboBoxCell? + + /** + * Original signature : `-(BOOL)hasVerticalScroller`

+ * *native declaration : NSComboBoxCell.h:38* + */ + abstract fun hasVerticalScroller(): Boolean + + /** + * Original signature : `-(void)setHasVerticalScroller:(BOOL)`

+ * *native declaration : NSComboBoxCell.h:39* + */ + abstract fun setHasVerticalScroller(flag: Boolean) + + /** + * Original signature : `-(id)intercellSpacing`

+ * *native declaration : NSComboBoxCell.h:40* + */ + abstract fun intercellSpacing(): NSObject? + /** + * *native declaration : NSComboBoxCell.h:41*

+ * Conversion Error : /// Original signature : `-(void)setIntercellSpacing:()`

+ * - (void)setIntercellSpacing:(null)aSize; (Argument aSize cannot be converted) + */ + /** + * Original signature : `-(CGFloat)itemHeight`

+ * *native declaration : NSComboBoxCell.h:42* + */ + abstract fun itemHeight(): org.rococoa.cocoa.CGFloat? + + /** + * Original signature : `-(void)setItemHeight:(CGFloat)`

+ * *native declaration : NSComboBoxCell.h:43* + */ + abstract fun setItemHeight(itemHeight: org.rococoa.cocoa.CGFloat?) + + /** + * Original signature : `-(NSInteger)numberOfVisibleItems`

+ * *native declaration : NSComboBoxCell.h:44* + */ + abstract fun numberOfVisibleItems(): NSInteger? + + /** + * Original signature : `-(void)setNumberOfVisibleItems:(NSInteger)`

+ * *native declaration : NSComboBoxCell.h:45* + */ + abstract fun setNumberOfVisibleItems(visibleItems: NSInteger?) + + /** + * Original signature : `-(void)setButtonBordered:(BOOL)`

+ * *native declaration : NSComboBoxCell.h:48* + */ + abstract fun setButtonBordered(flag: Boolean) + + /** + * Original signature : `-(BOOL)isButtonBordered`

+ * *native declaration : NSComboBoxCell.h:49* + */ + abstract fun isButtonBordered(): Boolean + + /** + * Original signature : `-(void)reloadData`

+ * *native declaration : NSComboBoxCell.h:52* + */ + abstract fun reloadData() + + /** + * Original signature : `-(void)noteNumberOfItemsChanged`

+ * *native declaration : NSComboBoxCell.h:53* + */ + abstract fun noteNumberOfItemsChanged() + + /** + * Original signature : `-(void)setUsesDataSource:(BOOL)`

+ * *native declaration : NSComboBoxCell.h:55* + */ + abstract fun setUsesDataSource(flag: Boolean) + + /** + * Original signature : `-(BOOL)usesDataSource`

+ * *native declaration : NSComboBoxCell.h:56* + */ + abstract fun usesDataSource(): Boolean + + /** + * Original signature : `-(void)scrollItemAtIndexToTop:(NSInteger)`

+ * *native declaration : NSComboBoxCell.h:58* + */ + abstract fun scrollItemAtIndexToTop(index: NSInteger?) + + /** + * Original signature : `-(void)scrollItemAtIndexToVisible:(NSInteger)`

+ * *native declaration : NSComboBoxCell.h:59* + */ + abstract fun scrollItemAtIndexToVisible(index: NSInteger?) + + /** + * Original signature : `-(void)selectItemAtIndex:(NSInteger)`

+ * *native declaration : NSComboBoxCell.h:61* + */ + abstract fun selectItemAtIndex(index: NSInteger?) + + /** + * Original signature : `-(void)deselectItemAtIndex:(NSInteger)`

+ * *native declaration : NSComboBoxCell.h:62* + */ + abstract fun deselectItemAtIndex(index: NSInteger?) + + /** + * Original signature : `-(NSInteger)indexOfSelectedItem`

+ * *native declaration : NSComboBoxCell.h:63* + */ + abstract fun indexOfSelectedItem(): NSInteger? + + /** + * Original signature : `-(NSInteger)numberOfItems`

+ * *native declaration : NSComboBoxCell.h:64* + */ + abstract fun numberOfItems(): NSInteger? + + /** + * Original signature : `-(BOOL)completes`

+ * *native declaration : NSComboBoxCell.h:66* + */ + abstract fun completes(): Boolean + + /** + * Original signature : `-(void)setCompletes:(BOOL)`

+ * *native declaration : NSComboBoxCell.h:67* + */ + abstract fun setCompletes(completes: Boolean) + + /** + * Original signature : `-(NSString*)completedString:(NSString*)`

+ * *native declaration : NSComboBoxCell.h:68* + */ + abstract fun completedString(string: org.rococoa.cocoa.foundation.NSString?): org.rococoa.cocoa.foundation.NSString? + + /** + * These two methods can only be used when usesDataSource is YES

+ * Original signature : `-(id)dataSource`

+ * *native declaration : NSComboBoxCell.h:71* + */ + abstract fun dataSource(): Object? + + /** + * Original signature : `-(void)setDataSource:(id)`

+ * *native declaration : NSComboBoxCell.h:72* + */ + abstract fun setDataSource(aSource: Object?) + + /** + * These methods can only be used when usesDataSource is NO

+ * Original signature : `-(void)addItemWithObjectValue:(id)`

+ * *native declaration : NSComboBoxCell.h:75* + */ + abstract fun addItemWithObjectValue(`object`: ObjCObject?) + + /** + * Original signature : `-(void)addItemsWithObjectValues:(NSArray*)`

+ * *native declaration : NSComboBoxCell.h:76* + */ + abstract fun addItemsWithObjectValues(objects: org.rococoa.cocoa.foundation.NSArray?) + + /** + * Original signature : `-(void)insertItemWithObjectValue:(id) atIndex:(NSInteger)`

+ * *native declaration : NSComboBoxCell.h:77* + */ + abstract fun insertItemWithObjectValue_atIndex(`object`: ObjCObject?, index: NSInteger?) + + /** + * Original signature : `-(void)removeItemWithObjectValue:(id)`

+ * *native declaration : NSComboBoxCell.h:78* + */ + abstract fun removeItemWithObjectValue(`object`: ObjCObject?) + + /** + * Original signature : `-(void)removeItemAtIndex:(NSInteger)`

+ * *native declaration : NSComboBoxCell.h:79* + */ + abstract fun removeItemAtIndex(index: NSInteger?) + + /** + * Original signature : `-(void)removeAllItems`

+ * *native declaration : NSComboBoxCell.h:80* + */ + abstract fun removeAllItems() + + /** + * Original signature : `-(void)selectItemWithObjectValue:(id)`

+ * *native declaration : NSComboBoxCell.h:81* + */ + abstract fun selectItemWithObjectValue(`object`: ObjCObject?) + + /** + * Original signature : `-(id)itemObjectValueAtIndex:(NSInteger)`

+ * *native declaration : NSComboBoxCell.h:82* + */ + abstract fun itemObjectValueAtIndex(index: NSInteger?): NSObject? + + /** + * Original signature : `-(id)objectValueOfSelectedItem`

+ * *native declaration : NSComboBoxCell.h:83* + */ + abstract fun objectValueOfSelectedItem(): NSObject? + + /** + * Original signature : `-(NSInteger)indexOfItemWithObjectValue:(id)`

+ * *native declaration : NSComboBoxCell.h:84* + */ + abstract fun indexOfItemWithObjectValue(`object`: ObjCObject?): NSInteger? + + /** + * Original signature : `-(NSArray*)objectValues`

+ * *native declaration : NSComboBoxCell.h:85* + */ + abstract fun objectValues(): org.rococoa.cocoa.foundation.NSArray? /// native declaration : NSComboBoxCell.h:18 + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSComboBoxCell", _Class::class.java) + + fun comboBoxCell(): NSComboBoxCell? { + return CLASS.alloc().init() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSControl.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSControl.kt new file mode 100644 index 00000000..bbcde841 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSControl.kt @@ -0,0 +1,381 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.Selector +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSRect + +/// native declaration : :10 +abstract class NSControl : NSView() { + /** + * *native declaration : :29*

+ * Conversion Error : /// Original signature : `id initWithFrame(null)`

+ * - (id)initWithFrame:(null)frameRect; (Argument frameRect cannot be converted) + */ + abstract override fun initWithFrame(frameRect: NSRect?): NSControl + + /** + * Original signature : `void sizeToFit()`

+ * *native declaration : :30* + */ + abstract fun sizeToFit() + + /** + * Original signature : `void calcSize()`

+ * *native declaration : :31* + */ + abstract fun calcSize() + + /** + * Original signature : `id cell()`

+ * *native declaration : :32* + */ + abstract fun cell(): NSCell? + + /** + * Original signature : `void setCell(NSCell*)`

+ * *native declaration : :33* + */ + abstract fun setCell(aCell: NSTextFieldCell?) + + /** + * Original signature : `id selectedCell()`

+ * *native declaration : :34* + */ + abstract fun selectedCell(): NSCell? + + /** + * Original signature : `id target()`

+ * *native declaration : :35* + */ + abstract fun target(): ID? + + /** + * Original signature : `void setTarget(id)`

+ * *native declaration : :36* + */ + abstract fun setTarget(anObject: ID?) + + /** + * Original signature : `action()`

+ * *native declaration : :37* + */ + abstract fun action(): Selector? + + /** + * *native declaration : :38*

+ * Conversion Error : /// Original signature : `void setAction(null)`

+ * - (void)setAction:(null)aSelector; (Argument aSelector cannot be converted) + */ + abstract fun setAction(action: Selector?) + + /** + * Original signature : `void setTag(NSInteger)`

+ * *native declaration : :40* + */ + abstract fun setTag(anInt: NSInteger?) + + /** + * Original signature : `NSInteger selectedTag()`

+ * *native declaration : :41* + */ + abstract fun selectedTag(): NSInteger? + + /** + * Original signature : `void setIgnoresMultiClick(BOOL)`

+ * *native declaration : :42* + */ + abstract fun setIgnoresMultiClick(flag: Boolean) + + /** + * Original signature : `BOOL ignoresMultiClick()`

+ * *native declaration : :43* + */ + abstract fun ignoresMultiClick(): Boolean + + /** + * Original signature : `NSInteger sendActionOn(NSInteger)`

+ * *native declaration : :44* + */ + abstract fun sendActionOn(mask: Int): Int + + /** + * Original signature : `BOOL isContinuous()`

+ * *native declaration : :45* + */ + abstract fun isContinuous(): Boolean + + /** + * Original signature : `void setContinuous(BOOL)`

+ * *native declaration : :46* + */ + abstract fun setContinuous(flag: Boolean) + + /** + * Original signature : `BOOL isEnabled()`

+ * *native declaration : :47* + */ + abstract fun isEnabled(): Boolean + + /** + * Original signature : `void setEnabled(BOOL)`

+ * *native declaration : :48* + */ + abstract fun setEnabled(flag: Boolean) + + /** + * Original signature : `void setFloatingPointFormat(BOOL, NSUInteger, NSUInteger)`

+ * *native declaration : :49* + */ + abstract fun setFloatingPointFormat_left_right(autoRange: Boolean, leftDigits: Int, rightDigits: Int) + + /** + * Original signature : `alignment()`

+ * *native declaration : :50* + */ + abstract fun alignment(): NSObject? + /** + * *native declaration : :51*

+ * Conversion Error : /// Original signature : `void setAlignment(null)`

+ * - (void)setAlignment:(null)mode; (Argument mode cannot be converted) + */ + /** + * Original signature : `NSFont* font()`

+ * *native declaration : :52* + */ + abstract fun font(): NSFont? + + /** + * Original signature : `void setFont(NSFont*)`

+ * *native declaration : :53* + */ + abstract fun setFont(fontObj: NSFont?) + + /** + * Original signature : `void setFormatter(NSFormatter*)`

+ * *native declaration : :54* + */ + abstract fun setFormatter(newFormatter: NSFormatter?) + + /** + * Original signature : `id formatter()`

+ * *native declaration : :55* + */ + abstract fun formatter(): NSObject? + /** + * *native declaration : :56*

+ * Conversion Error : id + */ + /** + * Original signature : `void setStringValue(NSString*)`

+ * *native declaration : :57* + */ + abstract fun setStringValue(aString: String?) + + /** + * Original signature : `void setIntValue(int)`

+ * *native declaration : :58* + */ + abstract fun setIntValue(anInt: Int) + + /** + * Original signature : `void setFloatValue(float)`

+ * *native declaration : :59* + */ + abstract fun setFloatValue(aFloat: Float) + + /** + * Original signature : `void setDoubleValue(double)`

+ * *native declaration : :60* + */ + abstract fun setDoubleValue(aDouble: Double) + + /** + * Original signature : `id objectValue()`

+ * *native declaration : :61* + */ + abstract fun objectValue(): NSObject? + + /** + * Original signature : `NSString* stringValue()`

+ * *native declaration : :62* + */ + abstract fun stringValue(): String? + + /** + * Original signature : `int intValue()`

+ * *native declaration : :63* + */ + abstract fun intValue(): Int + + /** + * Original signature : `float floatValue()`

+ * *native declaration : :64* + */ + abstract fun floatValue(): Float + + /** + * Original signature : `double doubleValue()`

+ * *native declaration : :65* + */ + abstract fun doubleValue(): Double + + /** + * Original signature : `void setNeedsDisplay()`

+ * *native declaration : :66* + */ + abstract fun setNeedsDisplay() + + /** + * Original signature : `void updateCell(NSCell*)`

+ * *native declaration : :67* + */ + abstract fun updateCell(aCell: NSCell?) + + /** + * Original signature : `void updateCellInside(NSCell*)`

+ * *native declaration : :68* + */ + abstract fun updateCellInside(aCell: NSCell?) + + /** + * Original signature : `void drawCellInside(NSCell*)`

+ * *native declaration : :69* + */ + abstract fun drawCellInside(aCell: NSCell?) + + /** + * Original signature : `void drawCell(NSCell*)`

+ * *native declaration : :70* + */ + abstract fun drawCell(aCell: NSCell?) + + /** + * Original signature : `void selectCell(NSCell*)`

+ * *native declaration : :71* + */ + abstract fun selectCell(aCell: NSCell?) + /** + * *native declaration : :73*

+ * Conversion Error : /// Original signature : `BOOL sendAction(null, id)`

+ * - (BOOL)sendAction:(null)theAction to:(id)theTarget; (Argument theAction cannot be converted) + */ + /** + * Original signature : `void takeIntValueFrom(id)`

+ * *native declaration : :74* + */ + abstract fun takeIntValueFrom(sender: ID?) + + /** + * Original signature : `void takeFloatValueFrom(id)`

+ * *native declaration : :75* + */ + abstract fun takeFloatValueFrom(sender: ID?) + + /** + * Original signature : `void takeDoubleValueFrom(id)`

+ * *native declaration : :76* + */ + abstract fun takeDoubleValueFrom(sender: ID?) + + /** + * Original signature : `void takeStringValueFrom(id)`

+ * *native declaration : :77* + */ + abstract fun takeStringValueFrom(sender: ID?) + + /** + * Original signature : `void takeObjectValueFrom(id)`

+ * *native declaration : :78* + */ + abstract fun takeObjectValueFrom(sender: ID?) + + /** + * Original signature : `NSText* currentEditor()`

+ * *native declaration : :79* + */ + abstract fun currentEditor(): NSText? + + /** + * Original signature : `BOOL abortEditing()`

+ * *native declaration : :80* + */ + abstract fun abortEditing(): Boolean + + /** + * Original signature : `void validateEditing()`

+ * *native declaration : :81* + */ + abstract fun validateEditing() + + /** + * Original signature : `void mouseDown(NSEvent*)`

+ * *native declaration : :82* + */ + abstract override fun mouseDown(event: NSEvent?) + + /** + * Original signature : `baseWritingDirection()`

+ * *native declaration : :85* + */ + abstract fun baseWritingDirection(): NSObject? + /** + * *native declaration : :86*

+ * Conversion Error : /// Original signature : `void setBaseWritingDirection(null)`

+ * - (void)setBaseWritingDirection:(null)writingDirection; (Argument writingDirection cannot be converted) + */ + /** + * Original signature : `NSInteger integerValue()`

+ * *native declaration : :90* + */ + abstract fun integerValue(): Int + + /** + * Original signature : `void setIntegerValue(NSInteger)`

+ * *native declaration : :91* + */ + abstract fun setIntegerValue(anInteger: Int) + + /** + * Original signature : `void takeIntegerValueFrom(id)`

+ * *native declaration : :92* + */ + abstract fun takeIntegerValueFrom(sender: ID?) + + /** + * *from NSKeyboardUI native declaration : :98*

+ * Conversion Error : /// Original signature : `void performClick(null)`

+ * - (void)performClick:(null)sender; (Argument sender cannot be converted) + */ + abstract fun performClick(sender: ID?) + + /** + * Original signature : `void setRefusesFirstResponder(BOOL)`

+ * *from NSKeyboardUI native declaration : :99* + */ + abstract fun setRefusesFirstResponder(flag: Boolean) + + /** + * Original signature : `BOOL refusesFirstResponder()`

+ * *from NSKeyboardUI native declaration : :100* + */ + abstract fun refusesFirstResponder(): Boolean + + /** + * Original signature : `NSAttributedString* attributedStringValue()`

+ * *from NSControlAttributedStringMethods native declaration : :135* + */ + abstract fun attributedStringValue(): NSAttributedString? + + /** + * Original signature : `void setAttributedStringValue(NSAttributedString*)`

+ * *from NSControlAttributedStringMethods native declaration : :136* + */ + abstract fun setAttributedStringValue(obj: NSAttributedString?) + + companion object { + val NSControlTextDidBeginEditingNotification: String? = "NSControlTextDidBeginEditingNotification" + val NSControlTextDidEndEditingNotification: String? = "NSControlTextDidEndEditingNotification" + val NSControlTextDidChangeNotification: String? = "NSControlTextDidChangeNotification" + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSCopying.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSCopying.kt new file mode 100644 index 00000000..b6630d4f --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSCopying.kt @@ -0,0 +1,4 @@ +package darwin + +/// native declaration : :45 +interface NSCopying diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSData.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSData.kt new file mode 100644 index 00000000..a449bb8a --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSData.kt @@ -0,0 +1,259 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.ObjCObjectByReference +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :27 +abstract class NSData : NSObject() { + interface _Class : ObjCClass { + open fun alloc(): NSData + + /** + * Original signature : `data()`

+ * *from NSDataCreation native declaration : :53* + */ + open fun data(): NSData? + + /** + * Original signature : `dataWithBytes(const void*, NSUInteger)`

+ * *from NSDataCreation native declaration : :54* + */ + open fun dataWithBytes_length(bytes: com.sun.jna.Pointer?, length: NSUInteger?): NSData? + + /** + * Original signature : `dataWithBytesNoCopy(void*, NSUInteger)`

+ * *from NSDataCreation native declaration : :55* + */ + open fun dataWithBytesNoCopy_length(bytes: com.sun.jna.Pointer?, length: NSUInteger?): NSData? + + /** + * Original signature : `dataWithBytesNoCopy(void*, NSUInteger, BOOL)`

+ * *from NSDataCreation native declaration : :57* + */ + open fun dataWithBytesNoCopy_length_freeWhenDone( + bytes: com.sun.jna.Pointer?, + length: NSUInteger?, + b: Byte + ): NSData? + + /** + * Original signature : `dataWithContentsOfFile(NSString*, NSUInteger, NSError**)`

+ * *from NSDataCreation native declaration : :60* + */ + open fun dataWithContentsOfFile_options_error( + path: String?, + readOptionsMask: Int, + errorPtr: ObjCObjectByReference? + ): NSData? + + /** + * Original signature : `dataWithContentsOfURL(NSURL*, NSUInteger, NSError**)`

+ * *from NSDataCreation native declaration : :61* + */ + open fun dataWithContentsOfURL_options_error( + url: NSURL?, + readOptionsMask: Int, + errorPtr: ObjCObjectByReference? + ): NSData? + + /** + * Original signature : `dataWithContentsOfFile(NSString*)`

+ * *from NSDataCreation native declaration : :63* + */ + open fun dataWithContentsOfFile(path: String?): NSData? + + /** + * Original signature : `dataWithContentsOfURL(NSURL*)`

+ * *from NSDataCreation native declaration : :64* + */ + open fun dataWithContentsOfURL(url: NSURL?): NSData? + + /** + * Original signature : `dataWithContentsOfMappedFile(NSString*)`

+ * *from NSDataCreation native declaration : :65* + */ + open fun dataWithContentsOfMappedFile(path: String?): NSData? + + /** + * NSData+Base64 + */ + open fun dataWithBase64EncodedString(string: String?): NSData? + + /** + * Original signature : `dataWithData(NSData*)`

+ * *from NSDataCreation native declaration : :79* + */ + open fun dataWithData(data: NSData?): NSData? + } + + /** + * Original signature : `NSUInteger length()`

+ * *native declaration : :29* + */ + abstract fun length(): NSUInteger? + + /** + * Original signature : `const void* bytes()`

+ * *native declaration : :30* + */ + abstract fun bytes(): com.sun.jna.Pointer? + + /** + * Original signature : `NSString* description()`

+ * *from NSExtendedData native declaration : :36* + */ + abstract override fun description(): String? + + /** + * Original signature : `void getBytes(void*)`

+ * *from NSExtendedData native declaration : :37* + */ + abstract fun getBytes(buffer: com.sun.jna.Pointer?) + + /** + * Original signature : `void getBytes(void*, NSUInteger)`

+ * *from NSExtendedData native declaration : :38* + */ + abstract fun getBytes_length(buffer: com.sun.jna.Pointer?, length: NSUInteger?) + /** + * *from NSExtendedData native declaration : :39*

+ * Conversion Error : /// Original signature : `void getBytes(void*, null)`

+ * - (void)getBytes:(void*)buffer range:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `BOOL isEqualToData(NSData*)`

+ * *from NSExtendedData native declaration : :40* + */ + abstract fun isEqualToData(other: NSData?): Boolean + /** + * *from NSExtendedData native declaration : :41*

+ * Conversion Error : /// Original signature : `NSData* subdataWithRange(null)`

+ * - (NSData*)subdataWithRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `BOOL writeToFile(NSString*, BOOL)`

+ * *from NSExtendedData native declaration : :42* + */ + abstract fun writeToFile_atomically(path: String?, useAuxiliaryFile: Boolean): Boolean + + fun writeToFile(path: String?): Boolean { + return this.writeToFile_atomically(path, true) + } + + /** + * Original signature : `BOOL writeToURL(NSURL*, BOOL)`

+ * the atomically flag is ignored if the url is not of a type the supports atomic writes

+ * *from NSExtendedData native declaration : :43* + */ + abstract fun writeToURL_atomically(url: NSURL?, atomically: Boolean): Boolean + + fun writeToURL(url: NSURL?): Boolean { + return this.writeToURL_atomically(url, true) + } + + /** + * Original signature : `BOOL writeToFile(NSString*, NSUInteger, NSError**)`

+ * *from NSExtendedData native declaration : :45* + */ + abstract fun writeToFile_options_error( + path: String?, + writeOptionsMask: Int, + errorPtr: ObjCObjectByReference? + ): Boolean + + /** + * Original signature : `BOOL writeToURL(NSURL*, NSUInteger, NSError**)`

+ * *from NSExtendedData native declaration : :46* + */ + abstract fun writeToURL_options_error(url: NSURL?, writeOptionsMask: Int, errorPtr: ObjCObjectByReference?): Boolean + + /** + * Original signature : `initWithBytes(const void*, NSUInteger)`

+ * *from NSDataCreation native declaration : :66* + */ + abstract fun initWithBytes_length(bytes: com.sun.jna.Pointer?, length: NSUInteger?): NSData? + + /** + * Original signature : `initWithBytesNoCopy(void*, NSUInteger)`

+ * *from NSDataCreation native declaration : :67* + */ + abstract fun initWithBytesNoCopy_length(bytes: com.sun.jna.Pointer?, length: Int): NSData? + + /** + * Original signature : `initWithBytesNoCopy(void*, NSUInteger, BOOL)`

+ * *from NSDataCreation native declaration : :69* + */ + abstract fun initWithBytesNoCopy_length_freeWhenDone( + bytes: com.sun.jna.Pointer?, + length: NSUInteger?, + b: Byte + ): NSData? + + /** + * Original signature : `initWithContentsOfFile(NSString*, NSUInteger, NSError**)`

+ * *from NSDataCreation native declaration : :72* + */ + abstract fun initWithContentsOfFile_options_error( + path: String?, + readOptionsMask: Int, + errorPtr: ObjCObjectByReference? + ): NSData? + + /** + * Original signature : `initWithContentsOfURL(NSURL*, NSUInteger, NSError**)`

+ * *from NSDataCreation native declaration : :73* + */ + abstract fun initWithContentsOfURL_options_error( + url: NSURL?, + readOptionsMask: Int, + errorPtr: ObjCObjectByReference? + ): NSData? + + /** + * Original signature : `initWithContentsOfFile(NSString*)`

+ * *from NSDataCreation native declaration : :75* + */ + abstract fun initWithContentsOfFile(path: String?): NSData? + + /** + * Original signature : `initWithContentsOfURL(NSURL*)`

+ * *from NSDataCreation native declaration : :76* + */ + abstract fun initWithContentsOfURL(url: NSURL?): NSData? + + /** + * Original signature : `initWithContentsOfMappedFile(NSString*)`

+ * *from NSDataCreation native declaration : :77* + */ + abstract fun initWithContentsOfMappedFile(path: String?): NSData? + + /** + * Original signature : `initWithData(NSData*)`

+ * *from NSDataCreation native declaration : :78* + */ + abstract fun initWithData(data: NSData?): NSData? + + /** + * Returns a data object initialized with the given Base-64 encoded string + */ + abstract fun initWithBase64Encoding(base64String: String?): NSData? + + /** + * Create a Base-64 encoded NSString from the receiver's contents + */ + abstract fun base64Encoding(): String? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSData", _Class::class.java) + + fun dataWithContentsOfURL(url: NSURL?): NSData? { + return CLASS.dataWithContentsOfURL(url) + } + + fun dataWithBase64EncodedString(base64String: String?): NSData? { + return CLASS.alloc().initWithBase64Encoding(base64String) + } + } +} + diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDate.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDate.kt new file mode 100644 index 00000000..84f0886b --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDate.kt @@ -0,0 +1,156 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.Rococoa + +abstract class NSDate : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `date()`

+ * *from NSDateCreation native declaration : :41* + */ + fun date(): NSDate + + /** + * Original signature : `dateWithTimeIntervalSinceNow(NSTimeInterval)`

+ * *from NSDateCreation native declaration : :43* + */ + fun dateWithTimeIntervalSinceNow(secs: Double): NSDate + + /** + * Original signature : `dateWithTimeIntervalSinceReferenceDate(NSTimeInterval)`

+ * *from NSDateCreation native declaration : :44* + */ + fun dateWithTimeIntervalSinceReferenceDate(secs: Double): NSDate + + /** + * Original signature : `dateWithTimeIntervalSince1970(NSTimeInterval)`

+ * *from NSDateCreation native declaration : :45* + */ + fun dateWithTimeIntervalSince1970(secs: Double): NSDate + + /** + * Original signature : `distantFuture()`

+ * *from NSDateCreation native declaration : :47* + */ + fun distantFuture(): NSDate + + /** + * Original signature : `distantPast()`

+ * *from NSDateCreation native declaration : :48* + */ + fun distantPast(): NSDate + } + + /** + * Original signature : `NSTimeInterval timeIntervalSinceReferenceDate()`

+ * *native declaration : :16* + */ + abstract fun timeIntervalSinceReferenceDate(): Double + + /** + * Original signature : `NSTimeInterval timeIntervalSinceDate(NSDate*)`

+ * *from NSExtendedDate native declaration : :22* + */ + abstract fun timeIntervalSinceDate(anotherDate: NSDate?): Double + + /** + * Original signature : `NSTimeInterval timeIntervalSinceNow()`

+ * *from NSExtendedDate native declaration : :23* + */ + abstract fun timeIntervalSinceNow(): Double + + /** + * Original signature : `NSTimeInterval timeIntervalSince1970()`

+ * *from NSExtendedDate native declaration : :24* + */ + abstract fun timeIntervalSince1970(): Double + + /** + * Original signature : `addTimeInterval(NSTimeInterval)`

+ * *from NSExtendedDate native declaration : :26* + */ + abstract fun addTimeInterval(seconds: Double): NSDate? + + /** + * Original signature : `NSDate* earlierDate(NSDate*)`

+ * *from NSExtendedDate native declaration : :28* + */ + abstract fun earlierDate(anotherDate: NSDate?): NSDate? + + /** + * Original signature : `NSDate* laterDate(NSDate*)`

+ * *from NSExtendedDate native declaration : :29* + */ + abstract fun laterDate(anotherDate: NSDate?): NSDate? + + /** + * Original signature : `compare(NSDate*)`

+ * *from NSExtendedDate native declaration : :30* + */ + abstract fun compare(other: NSDate?): NSObject? + + /** + * Original signature : `NSString* description()`

+ * *from NSExtendedDate native declaration : :32* + */ + abstract override fun description(): String + + /** + * Original signature : `BOOL isEqualToDate(NSDate*)`

+ * *from NSExtendedDate native declaration : :33* + */ + abstract fun isEqualToDate(otherDate: NSDate?): Byte + + /** + * Original signature : `init()`

+ * *from NSDateCreation native declaration : :50* + */ + abstract fun init(): NSDate? + + /** + * Original signature : `initWithTimeIntervalSinceReferenceDate(NSTimeInterval)`

+ * *from NSDateCreation native declaration : :51* + */ + abstract fun initWithTimeIntervalSinceReferenceDate(secsToBeAdded: Double): NSDate? + + /** + * Original signature : `initWithTimeInterval(NSTimeInterval, NSDate*)`

+ * *from NSDateCreation native declaration : :52* + */ + abstract fun initWithTimeInterval_sinceDate(secsToBeAdded: Double, anotherDate: NSDate?): NSDate? + + /** + * Original signature : `initWithTimeIntervalSinceNow(NSTimeInterval)`

+ * *from NSDateCreation native declaration : :53* + */ + abstract fun initWithTimeIntervalSinceNow(secsToBeAddedToNow: Double): NSDate? + + companion object { + private val CLASS: _Class = Rococoa.createClass("NSDate", _Class::class.java) + + fun date(): NSDate { + return CLASS.date() + } + + fun dateWithTimeIntervalSinceNow(secs: Double): NSDate { + return CLASS.dateWithTimeIntervalSinceNow(secs) + } + + fun dateWithTimeIntervalSinceReferenceDate(secs: Double): NSDate { + return CLASS.dateWithTimeIntervalSinceReferenceDate(secs) + } + + fun dateWithTimeIntervalSince1970(secs: Double): NSDate { + return CLASS.dateWithTimeIntervalSince1970(secs) + } + + fun distantFuture(): NSDate { + return CLASS.distantFuture() + } + + fun distantPast(): NSDate { + return CLASS.distantPast() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDateFormatter.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDateFormatter.kt new file mode 100644 index 00000000..c4b2ab98 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDateFormatter.kt @@ -0,0 +1,133 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSUInteger + +abstract class NSDateFormatter : NSFormatter() { + interface _Class : ObjCClass { + open fun alloc(): NSDateFormatter + } + + /** + * Original signature : `init()`

+ * *native declaration : :18* + */ + abstract fun init(): NSDateFormatter? + + abstract fun setDoesRelativeDateFormatting(relative: Boolean) + + + /** + * Original signature : `NSString* stringFromDate(NSDate*)`

+ * *native declaration : :29* + */ + abstract fun stringFromDate(date: NSDate?): String? + + /** + * Original signature : `NSDate* dateFromString(NSString*)`

+ * *native declaration : :30* + */ + abstract fun dateFromString(string: String?): String? + + /** + * Original signature : `NSString* dateFormat()`

+ * *native declaration : :36* + */ + abstract fun dateFormat(): String? + + /** + * Original signature : `dateStyle()`

+ * *native declaration : :41* + */ + abstract fun dateStyle(): NSUInteger? + + /** + * *native declaration : :42*

+ * Conversion Error : /// Original signature : `void setDateStyle(null)`

+ * - (void)setDateStyle:(null)style; (Argument style cannot be converted) + */ + abstract fun setDateStyle(style: NSUInteger?) + + /** + * Original signature : `timeStyle()`

+ * *native declaration : :44* + */ + abstract fun timeStyle(): NSUInteger? + + /** + * *native declaration : :45*

+ * Conversion Error : /// Original signature : `void setTimeStyle(null)`

+ */ + abstract fun setTimeStyle(style: NSUInteger?) + + /** + * Original signature : `NSLocale* locale()`

+ * *native declaration : :47* + */ + abstract fun locale(): com.sun.jna.Pointer? + + /** + * Original signature : `void setLocale(NSLocale*)`

+ * *native declaration : :48* + */ + abstract fun setLocale(locale: NSLocale?) + + /** + * Original signature : `BOOL generatesCalendarDates()`

+ * *native declaration : :50* + */ + abstract fun generatesCalendarDates(): Boolean + + /** + * Original signature : `void setGeneratesCalendarDates(BOOL)`

+ * *native declaration : :51* + */ + abstract fun setGeneratesCalendarDates(b: Boolean) + + /** + * Original signature : `-(NSTimeZone*)timeZone`

+ * *native declaration : /System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:55* + */ + abstract fun timeZone(): NSTimeZone? + + /** + * Original signature : `-(void)setTimeZone:(NSTimeZone*)`

+ * *native declaration : /System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:56* + */ + abstract fun setTimeZone(tz: NSTimeZone?) + + /** + * Original signature : `-(BOOL)isLenient`

+ * *native declaration : /System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:61* + */ + abstract fun isLenient(): Boolean + + /** + * Original signature : `-(void)setLenient:(BOOL)`

+ * *native declaration : /System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:62* + */ + abstract fun setLenient(b: Boolean) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSDateFormatter", _Class::class.java) + + /// native declaration : :24 + val kCFDateFormatterNoStyle: NSUInteger? = NSUInteger(0) + + /// native declaration : :25 + val kCFDateFormatterShortStyle: NSUInteger? = NSUInteger(1) + + /// native declaration : :26 + val kCFDateFormatterMediumStyle: NSUInteger? = NSUInteger(2) + + /// native declaration : :27 + val kCFDateFormatterLongStyle: NSUInteger? = NSUInteger(3) + + /// native declaration : :28 + val kCFDateFormatterFullStyle: NSUInteger? = NSUInteger(4) + + fun dateFormatter(): NSDateFormatter? { + return CLASS.alloc().init() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDatePicker.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDatePicker.kt new file mode 100644 index 00000000..00e17c47 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDatePicker.kt @@ -0,0 +1,18 @@ +package darwin + +import org.rococoa.ObjCClass + +abstract class NSDatePicker : NSControl() { + interface _Class : ObjCClass { + open fun alloc(): NSDatePicker? + } + + abstract fun dateValue(): NSDate? + + abstract fun setDateValue(value: NSDate?) + + companion object { + private val CLASS: NSButton._Class = + org.rococoa.Rococoa.createClass("NSDatePicker", NSButton._Class::class.java) + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDictionary.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDictionary.kt new file mode 100644 index 00000000..5a78dc4d --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDictionary.kt @@ -0,0 +1,216 @@ +package darwin + +import com.sun.jna.Pointer +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :10 +abstract class NSDictionary : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `id dictionary()`

+ * *from NSDictionaryCreation native declaration : :40* + */ + fun dictionary(): NSDictionary? + + /** + * Original signature : `id dictionaryWithObject(id, id)`

+ * *from NSDictionaryCreation native declaration : :41* + */ + fun dictionaryWithObject_forKey(`object`: NSObject?, key: NSObject?): NSDictionary? + + /** + * Original signature : `id dictionaryWithObjects(id*, id*, NSUInteger)`

+ * *from NSDictionaryCreation native declaration : :42* + */ + fun dictionaryWithObjects_forKeys_count(objects: NSObject?, keys: NSObject?, cnt: NSUInteger?): NSDictionary? + + /** + * Original signature : `id dictionaryWithObjectsAndKeys(id, null)`

+ * *from NSDictionaryCreation native declaration : :43* + */ + fun dictionaryWithObjectsAndKeys(firstObject: NSObject?, vararg varargs: NSObject?): NSDictionary? + + /** + * Original signature : `id dictionaryWithDictionary(NSDictionary*)`

+ * *from NSDictionaryCreation native declaration : :44* + */ + fun dictionaryWithDictionary(dict: NSDictionary?): NSDictionary? + + /** + * Original signature : `id dictionaryWithObjects(NSArray*, NSArray*)`

+ * *from NSDictionaryCreation native declaration : :45* + */ + fun dictionaryWithObjects_forKeys(objects: NSArray?, keys: NSArray?): NSDictionary + + /** + * Original signature : `id dictionaryWithContentsOfFile(NSString*)`

+ * *from NSDictionaryCreation native declaration : :53* + */ + fun dictionaryWithContentsOfFile(path: String?): NSDictionary + + /** + * Original signature : `id dictionaryWithContentsOfURL(NSURL*)`

+ * *from NSDictionaryCreation native declaration : :54* + */ + fun dictionaryWithContentsOfURL(url: NSURL?): NSDictionary + } + + /** + * Original signature : `NSUInteger count()`

+ * *native declaration : :12* + */ + abstract fun count(): NSUInteger? + + /** + * *native declaration : :13*

+ * Conversion Error : /// Original signature : `objectForKey(null)`

+ * - (null)objectForKey:(null)aKey; (Argument aKey cannot be converted) + */ + abstract fun objectForKey(key: String?): NSObject? + + + /** + * Original signature : `NSEnumerator* keyEnumerator()`

+ * *native declaration : :14* + */ + abstract fun keyEnumerator(): NSEnumerator? + + /** + * Original signature : `NSArray* allKeys()`

+ * *from NSExtendedDictionary native declaration : :20* + */ + abstract fun allKeys(): NSArray? + /** + * *from NSExtendedDictionary native declaration : :21*

+ * Conversion Error : /// Original signature : `NSArray* allKeysForObject(null)`

+ * - (NSArray*)allKeysForObject:(null)anObject; (Argument anObject cannot be converted) + */ + /** + * Original signature : `NSArray* allValues()`

+ * *from NSExtendedDictionary native declaration : :22* + */ + abstract fun allValues(): NSArray? + + /** + * Original signature : `NSString* descriptionInStringsFileFormat()`

+ * *from NSExtendedDictionary native declaration : :24* + */ + abstract fun descriptionInStringsFileFormat(): Pointer? + /** + * *from NSExtendedDictionary native declaration : :25*

+ * Conversion Error : /// Original signature : `NSString* descriptionWithLocale(null)`

+ * - (NSString*)descriptionWithLocale:(null)locale; (Argument locale cannot be converted) + */ + /** + * *from NSExtendedDictionary native declaration : :26*

+ * Conversion Error : /// Original signature : `NSString* descriptionWithLocale(null, NSUInteger)`

+ * - (NSString*)descriptionWithLocale:(null)locale indent:(NSUInteger)level; (Argument locale cannot be converted) + */ + /** + * Original signature : `BOOL isEqualToDictionary(NSDictionary*)`

+ * *from NSExtendedDictionary native declaration : :27* + */ + abstract fun isEqualToDictionary(otherDictionary: NSDictionary?): Boolean + + /** + * Original signature : `NSEnumerator* objectEnumerator()`

+ * *from NSExtendedDictionary native declaration : :28* + */ + abstract fun objectEnumerator(): NSEnumerator? + /** + * *from NSExtendedDictionary native declaration : :29*

+ * Conversion Error : /// Original signature : `NSArray* objectsForKeys(NSArray*, null)`

+ * - (NSArray*)objectsForKeys:(NSArray*)keys notFoundMarker:(null)marker; (Argument marker cannot be converted) + */ + /** + * Original signature : `BOOL writeToFile(NSString*, BOOL)`

+ * *from NSExtendedDictionary native declaration : :30* + */ + abstract fun writeToFile_atomically(path: String?, useAuxiliaryFile: Boolean): Boolean + + fun writeToFile(path: String?): Boolean { + return this.writeToFile_atomically(path, true) + } + + /** + * Original signature : `BOOL writeToURL(NSURL*, BOOL)`

+ * the atomically flag is ignored if url of a type that cannot be written atomically.

+ * *from NSExtendedDictionary native declaration : :31* + */ + abstract fun writeToURL_atomically(url: NSURL?, atomically: Boolean): Boolean + + fun writeToURL(url: NSURL?): Boolean { + return this.writeToURL_atomically(url, true) + } + + /** + * *from NSExtendedDictionary native declaration : :33*

+ * Conversion Error : /// Original signature : `NSArray* keysSortedByValueUsingSelector(null)`

+ * - (NSArray*)keysSortedByValueUsingSelector:(null)comparator; (Argument comparator cannot be converted) + */ + /** + * Original signature : `void getObjects(id*, id*)`

+ * *from NSExtendedDictionary native declaration : :34* + */ + abstract fun getObjects_andKeys(objects: NSObject?, keys: NSObject?) + + /** + * Original signature : `id initWithObjects(id*, id*, NSUInteger)`

+ * *from NSDictionaryCreation native declaration : :47* + */ + abstract fun initWithObjects_forKeys_count(objects: NSObject?, keys: NSObject?, cnt: NSUInteger?): NSDictionary? + + /** + * Original signature : `id initWithObjectsAndKeys(id, null)`

+ * *from NSDictionaryCreation native declaration : :48* + */ + abstract fun initWithObjectsAndKeys(firstObject: NSObject?, vararg varargs: NSObject?): NSDictionary? + + /** + * Original signature : `id initWithDictionary(NSDictionary*)`

+ * *from NSDictionaryCreation native declaration : :49* + */ + abstract fun initWithDictionary(otherDictionary: NSDictionary?): NSDictionary? + + /** + * Original signature : `id initWithDictionary(NSDictionary*, BOOL)`

+ * *from NSDictionaryCreation native declaration : :50* + */ + abstract fun initWithDictionary_copyItems(otherDictionary: NSDictionary?, flag: Boolean): NSDictionary? + + /** + * Original signature : `id initWithObjects(NSArray*, NSArray*)`

+ * *from NSDictionaryCreation native declaration : :51* + */ + abstract fun initWithObjects_forKeys(objects: NSArray?, keys: NSArray?): NSDictionary? + + /** + * Original signature : `id initWithContentsOfFile(NSString*)`

+ * *from NSDictionaryCreation native declaration : :55* + */ + abstract fun initWithContentsOfFile(path: String?): NSDictionary? + + /** + * Original signature : `id initWithContentsOfURL(NSURL*)`

+ * *from NSDictionaryCreation native declaration : :56* + */ + abstract fun initWithContentsOfURL(url: NSURL?): NSDictionary? + + companion object { + val CLASS: _Class = Rococoa.createClass("NSDictionary", _Class::class.java) + + fun dictionaryWithObjectsForKeys(objects: NSArray?, keys: NSArray?): NSDictionary { + return CLASS.dictionaryWithObjects_forKeys(objects, keys) + } + + fun dictionaryWithContentsOfURL(url: NSURL?): NSDictionary { + return CLASS.dictionaryWithContentsOfURL(url) + } + + fun dictionaryWithContentsOfFile(path: String?): NSDictionary { + return CLASS.dictionaryWithContentsOfFile(path) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDistributedNotificationCenter.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDistributedNotificationCenter.kt new file mode 100644 index 00000000..4485a2d8 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDistributedNotificationCenter.kt @@ -0,0 +1,40 @@ +package darwin + +import org.rococoa.ObjCClass + +/// native declaration : :27 +abstract class NSDistributedNotificationCenter : NSNotificationCenter() { + interface _Class : ObjCClass { + /** + * Original signature : `NSDistributedNotificationCenter* notificationCenterForType(NSString*)`

+ * *native declaration : :29* + */ + open fun notificationCenterForType(notificationCenterType: String?): NSDistributedNotificationCenter? + + /** + * Original signature : `defaultCenter()`

+ * *native declaration : :32* + */ + open fun defaultCenter(): NSDistributedNotificationCenter? + } + + /** + * Original signature : `void postNotificationName(NSString*, NSString*, NSDictionary*, BOOL)`

+ * *native declaration : :38* + */ + abstract fun postNotificationName_object_userInfo_deliverImmediately( + name: String?, + `object`: String?, + userInfo: NSDictionary?, + deliverImmediately: Boolean + ) + + companion object { + private val CLASS: _Class = + org.rococoa.Rococoa.createClass("NSDistributedNotificationCenter", _Class::class.java) + + fun defaultCenter(): NSNotificationCenter? { + return CLASS.defaultCenter() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDockTile.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDockTile.kt new file mode 100644 index 00000000..265c38b3 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDockTile.kt @@ -0,0 +1,97 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSSize + +abstract class NSDockTile : NSObject() { + interface _Class : ObjCClass { + /// native declaration : NSDockTile.h + open fun alloc(): NSDockTile? + + /// native declaration : NSDockTile.h + open fun create(): NSDockTile? + } + + /** + * get the size of the dock tile, in screen coordinates

Original signature : `-(NSSize)size`

+ * *native declaration : NSDockTile.h:37* + */ + abstract fun size(): NSSize? + + /** + * set the content view to view. view should be height and width resizable. In order to initiate drawing in view, + * you must call -[NSDockTile display].

Original signature : `-(void)setContentView:(NSView*)`

+ * *native declaration : NSDockTile.h:41* + */ + abstract fun setContentView(view: NSView?) + + /** + * Original signature : `-(NSView*)contentView`

+ * *native declaration : NSDockTile.h:42* + */ + abstract fun contentView(): NSView? + + /** + * cause the dock tile to be redrawn. The contentView and any subviews will be sent drawRect: messages.

+ * Original signature : `-(void)display`

+ * *native declaration : NSDockTile.h:46* + */ + abstract fun display() + + /** + * setShowsApplicationBadge: sets whether or not the dock tile should be badged with the application icon. Default + * is YES for NSWindow dock tiles, NO for the NSApplication dock tile.

Original signature : + * `-(void)setShowsApplicationBadge:(BOOL)`

+ * *native declaration : NSDockTile.h:50* + */ + abstract fun setShowsApplicationBadge(flag: Boolean) + + /** + * Original signature : `-(BOOL)showsApplicationBadge`

+ * *native declaration : NSDockTile.h:51* + */ + abstract fun showsApplicationBadge(): Boolean + + /** + * Assign an image to this property when you want to temporarily change the app icon in the dock app tile. The image + * you provide is scaled as needed so that it fits in the tile. To restore your app’s original icon, set this + * property to nil. + * + * @param image The image used for the app’s icon. + */ + abstract fun setApplicationIconImage(image: NSImage?) + + /** + * Badge the dock icon with a localized string. The badge appearance is system defined. This is often used to show + * an unread count in the application dock icon.

Original signature : `-(void)setBadgeLabel:(NSString*)`

+ * *native declaration : NSDockTile.h:55* + */ + abstract fun setBadgeLabel(string: String?) + + /** + * Original signature : `-(NSString*)badgeLabel`

+ * *native declaration : NSDockTile.h:56* + */ + abstract fun badgeLabel(): String? + + /** + * -owner will return NSApp for the application dock tile, or the NSWindow for a mini window dock tile.

Original + * signature : `-(id)owner`

+ * *native declaration : NSDockTile.h:60* + */ + abstract fun owner(): NSObject? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSDockTile", _Class::class.java) + + /// native declaration : NSDockTile.h + fun alloc(): NSDockTile? { + return CLASS.alloc() + } + + /// native declaration : NSDockTile.h + fun create(): NSDockTile? { + return CLASS.create() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDraggingDestination.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDraggingDestination.kt new file mode 100644 index 00000000..31bc261f --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDraggingDestination.kt @@ -0,0 +1,56 @@ +package darwin + +import org.rococoa.cocoa.foundation.NSUInteger + +interface NSDraggingDestination { + /** + * Original signature : `NSDragOperation draggingEntered(id)`

+ * *native declaration : line 47* + */ + open fun draggingEntered(sender: org.rococoa.ID?): NSUInteger? + + /** + * Original signature : `NSDragOperation draggingUpdated(org.rococoa.ID)`

+ * if the destination responded to draggingEntered: but not to draggingUpdated: the return value from draggingEntered: is used

+ * *native declaration : line 48* + */ + open fun draggingUpdated(sender: org.rococoa.ID?): NSUInteger? + + /** + * Original signature : `void draggingExited(org.rococoa.ID)`

+ * *native declaration : line 49* + */ + open fun draggingExited(sender: org.rococoa.ID?) + + /** + * Original signature : `BOOL prepareForDragOperation(org.rococoa.ID)`

+ * *native declaration : line 50* + */ + open fun prepareForDragOperation(sender: org.rococoa.ID?): Boolean + + /** + * Original signature : `BOOL performDragOperation(org.rococoa.ID)`

+ * *native declaration : line 51* + */ + open fun performDragOperation(sender: org.rococoa.ID?): Boolean + + /** + * Original signature : `void concludeDragOperation(org.rococoa.ID)`

+ * *native declaration : line 52* + */ + open fun concludeDragOperation(sender: org.rococoa.ID?) + + /** + * draggingEnded: is implemented as of Mac OS 10.5

+ * Original signature : `void draggingEnded(org.rococoa.ID)`

+ * *native declaration : line 54* + */ + open fun draggingEnded(sender: org.rococoa.ID?) + + /** + * the receiver of -wantsPeriodicDraggingUpdates should return NO if it does not require periodic -draggingUpdated messages (eg. not autoscrolling or otherwise dependent on draggingUpdated: sent while mouse is stationary)

+ * Original signature : `BOOL wantsPeriodicDraggingUpdates()`

+ * *native declaration : line 57* + */ + open fun wantsPeriodicDraggingUpdates(): Boolean +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDraggingInfo.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDraggingInfo.kt new file mode 100644 index 00000000..b1ad20e0 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDraggingInfo.kt @@ -0,0 +1,88 @@ +package darwin + +import org.rococoa.cocoa.foundation.NSPoint +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :32 +abstract class NSDraggingInfo : NSObject() { + /** + * Original signature : `NSWindow* draggingDestinationWindow()`

+ * *native declaration : :33* + */ + abstract fun draggingDestinationWindow(): NSWindow? + + /** + * Original signature : `NSDragOperation draggingSourceOperationMask()`

+ * *native declaration : :34* + */ + abstract fun draggingSourceOperationMask(): NSUInteger? + + /** + * Original signature : `draggingLocation()`

+ * *native declaration : :35* + */ + abstract fun draggingLocation(): NSPoint? + + /** + * Original signature : `draggedImageLocation()`

+ * *native declaration : :36* + */ + abstract fun draggedImageLocation(): NSPoint? + + /** + * Original signature : `NSImage* draggedImage()`

+ * *native declaration : :37* + */ + abstract fun draggedImage(): NSImage? + + /** + * Original signature : `NSPasteboard* draggingPasteboard()`

+ * *native declaration : :38* + */ + abstract fun draggingPasteboard(): NSPasteboard? + + /** + * Original signature : `draggingSource()`

+ * *native declaration : :39* + */ + abstract fun draggingSource(): NSObject? + + /** + * Original signature : `NSInteger draggingSequenceNumber()`

+ * *native declaration : :40* + */ + abstract fun draggingSequenceNumber(): Int + /** + * *native declaration : :41*

+ * Conversion Error : /// Original signature : `void slideDraggedImageTo(null)`

+ * - (void)slideDraggedImageTo:(null)screenPoint; (Argument screenPoint cannot be converted) + */ + /** + * Original signature : `NSArray* namesOfPromisedFilesDroppedAtDestination(NSURL*)`

+ * *native declaration : :43* + */ + abstract fun namesOfPromisedFilesDroppedAtDestination(dropDestination: NSURL?): NSArray? + + companion object { + /// native declaration : line 15 + val NSDragOperationNone: NSUInteger? = NSUInteger(0) + + /// native declaration : line 16 + val NSDragOperationCopy: NSUInteger? = NSUInteger(1) + + /// native declaration : line 17 + val NSDragOperationLink: NSUInteger? = NSUInteger(2) + + /// native declaration : line 18 + val NSDragOperationGeneric: NSUInteger? = NSUInteger(4) + + /// native declaration : line 19 + val NSDragOperationPrivate: NSUInteger? = NSUInteger(8) + + /// native declaration : line 21 + val NSDragOperationMove: NSUInteger? = NSUInteger(16) + + /// native declaration : line 22 + val NSDragOperationDelete: NSUInteger? = NSUInteger(32) + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDraggingSource.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDraggingSource.kt new file mode 100644 index 00000000..4df6e30c --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDraggingSource.kt @@ -0,0 +1,41 @@ +package darwin + +import org.rococoa.cocoa.foundation.NSPoint +import org.rococoa.cocoa.foundation.NSUInteger + +interface NSDraggingSource { + /** + * Original signature : `NSDragOperation draggingSourceOperationMaskForLocal(BOOL)`

+ * *native declaration : line 72* + */ + open fun draggingSourceOperationMaskForLocal(flag: Boolean): NSUInteger? + + /** + * *native declaration : line 76*

+ * Conversion Error : /// Original signature : `void draggedImage(NSImage*, null)`

+ * - (void)draggedImage:(NSImage*)image beganAt:(null)screenPoint; (Argument screenPoint cannot be converted) + */ + open fun draggedImage_beganAt(image: NSImage?, point: NSPoint?) + + /** + * *native declaration : line 77*

+ * Conversion Error : /// Original signature : `void draggedImage(NSImage*, null, NSDragOperation)`

+ * - (void)draggedImage:(NSImage*)image endedAt:(null)screenPoint operation:(NSDragOperation)operation; (Argument screenPoint cannot be converted) + */ + open fun draggedImage_endedAt_operation(image: NSImage?, point: NSPoint?, operation: NSUInteger?) + + /** + * *native declaration : line 78*

+ * Conversion Error : /// Original signature : `void draggedImage(NSImage*, null)`

+ * - (void)draggedImage:(NSImage*)image movedTo:(null)screenPoint; (Argument screenPoint cannot be converted) + */ + open fun draggedImage_movedTo(image: NSImage?, point: NSPoint?) + + /** + * Original signature : `BOOL ignoreModifierKeysWhileDragging()`

+ * *native declaration : line 79* + */ + open fun ignoreModifierKeysWhileDragging(): Boolean + + open fun namesOfPromisedFilesDroppedAtDestination(dropDestination: NSURL?): NSArray? +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDrawer.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDrawer.kt new file mode 100644 index 00000000..26449163 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSDrawer.kt @@ -0,0 +1,174 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSSize + +/// native declaration : :31 +abstract class NSDrawer : NSObject() { + interface _Class : ObjCClass { + open fun alloc(): NSDrawer? + } + /** + * *native declaration : :57*

+ * Conversion Error : /// Original signature : `id initWithContentSize(null, NSRectEdge)`

+ * - (id)initWithContentSize:(null)contentSize preferredEdge:(NSRectEdge)edge; (Argument contentSize cannot be converted) + */ + /** + * Original signature : `void setParentWindow(NSWindow*)`

+ * *native declaration : :59* + */ + abstract fun setParentWindow(parent: NSWindow?) + + /** + * Original signature : `NSWindow* parentWindow()`

+ * *native declaration : :60* + */ + abstract fun parentWindow(): NSWindow? + + /** + * Original signature : `void setContentView(NSView*)`

+ * *native declaration : :61* + */ + abstract fun setContentView(aView: NSView?) + + /** + * Original signature : `NSView* contentView()`

+ * *native declaration : :62* + */ + abstract fun contentView(): NSView? + /** + * *native declaration : :63*

+ * Conversion Error : NSRectEdge + */ + /** + * *native declaration : :64*

+ * Conversion Error : NSRectEdge + */ + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : :65* + */ + abstract fun setDelegate(anObject: ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :66* + */ + abstract fun delegate(): ID? + + /** + * Original signature : `void open()`

+ * *native declaration : :68* + */ + abstract fun open() + /** + * *native declaration : :69*

+ * Conversion Error : NSRectEdge + */ + /** + * Original signature : `void close()`

+ * *native declaration : :70* + */ + abstract fun close() + + /** + * Original signature : `void open(id)`

+ * *native declaration : :72* + */ + abstract fun open(sender: ID?) + + /** + * Original signature : `void close(id)`

+ * *native declaration : :73* + */ + abstract fun close(sender: ID?) + + /** + * Original signature : `void toggle(id)`

+ * *native declaration : :74* + */ + abstract fun toggle(sender: ID?) + + /** + * Original signature : `NSInteger state()`

+ * *native declaration : :76* + */ + abstract fun state(): Int + /** + * *native declaration : :77*

+ * Conversion Error : NSRectEdge + */ + /** + * *native declaration : :79*

+ * Conversion Error : /// Original signature : `void setContentSize(null)`

+ * - (void)setContentSize:(null)size; (Argument size cannot be converted) + */ + abstract fun setContentSize(size: NSSize?) + + /** + * Original signature : `contentSize()`

+ * *native declaration : :80* + */ + abstract fun contentSize(): NSSize? + /** + * *native declaration : :81*

+ * Conversion Error : /// Original signature : `void setMinContentSize(null)`

+ * - (void)setMinContentSize:(null)size; (Argument size cannot be converted) + */ + /** + * Original signature : `minContentSize()`

+ * *native declaration : :82* + */ + abstract fun minContentSize(): NSSize? + /** + * *native declaration : :83*

+ * Conversion Error : /// Original signature : `void setMaxContentSize(null)`

+ * - (void)setMaxContentSize:(null)size; (Argument size cannot be converted) + */ + /** + * Original signature : `maxContentSize()`

+ * *native declaration : :84* + */ + abstract fun maxContentSize(): NSSize? + + /** + * Original signature : `void setLeadingOffset(CGFloat)`

+ * *native declaration : :86* + */ + abstract fun setLeadingOffset(offset: CGFloat?) + + /** + * Original signature : `CGFloat leadingOffset()`

+ * *native declaration : :87* + */ + abstract fun leadingOffset(): CGFloat? + + /** + * Original signature : `void setTrailingOffset(CGFloat)`

+ * *native declaration : :88* + */ + abstract fun setTrailingOffset(offset: CGFloat?) + + /** + * Original signature : `CGFloat trailingOffset()`

+ * *native declaration : :89* + */ + abstract fun trailingOffset(): CGFloat? + + companion object { + const val NSDrawerClosedState: Int = 0 + const val NSDrawerOpeningState: Int = 1 + const val NSDrawerOpenState: Int = 2 + const val NSDrawerClosingState: Int = 3 + const val ClosedState: Int = 0 + const val OpeningState: Int = 1 + const val OpenState: Int = 2 + const val ClosingState: Int = 3 + val DrawerWillOpenNotification: String? = "NSDrawerWillOpenNotification" + val DrawerDidOpenNotification: String? = "NSDrawerDidOpenNotification" + val DrawerWillCloseNotification: String? = "NSDrawerWillCloseNotification" + val DrawerDidCloseNotification: String? = "NSDrawerDidCloseNotification" + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSEnumerator.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSEnumerator.kt new file mode 100644 index 00000000..25058aae --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSEnumerator.kt @@ -0,0 +1,16 @@ +package darwin + +/// native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:33 +abstract class NSEnumerator : NSObject() { + /** + * Original signature : `id nextObject()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:35* + */ + abstract fun nextObject(): NSObject? + + /** + * Original signature : `NSArray* allObjects()`

+ * *from NSExtendedEnumerator native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:41* + */ + abstract fun allObjects(): NSArray? +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSEvent.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSEvent.kt new file mode 100644 index 00000000..39e5e49b --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSEvent.kt @@ -0,0 +1,760 @@ +package darwin + +import com.sun.jna.Pointer +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSPoint + +abstract class NSEvent : NSObject(), NSCopying { + interface _Class : ObjCClass { + /** + * +eventWithEventRef: returns an autoreleased NSEvent corresponding to the EventRef. The EventRef is retained by the NSEvent and will be released when the NSEvent is freed. If there is no NSEvent corresponding to the EventRef, +eventWithEventRef will return nil.

+ * Original signature : `NSEvent* eventWithEventRef(const void*)`

+ * EventRef

+ * *native declaration : :232* + */ + fun eventWithEventRef(eventRef: NSEvent?): NSEvent? + /** + * *native declaration : :240*

+ * Conversion Error : / **

+ * * +eventWithCGEvent: returns an autoreleased NSEvent corresponding to the CGEventRef. The CGEventRef is retained by the NSEvent and will be released when the NSEvent is freed. If there is no NSEvent corresponding to the CGEventRef, +eventWithEventRef will return nil.

+ * * Original signature : `NSEvent* eventWithCGEvent(null)`

+ * * /

+ * + (NSEvent*)eventWithCGEvent:(null)cgEvent; (Argument cgEvent cannot be converted) + */ + + /** + * Original signature : `BOOL isMouseCoalescingEnabled()`

+ * *native declaration : :245* + */ + /** + * Enable or disable coalescing of mouse movement events, including mouse moved, mouse dragged, and tablet events. Coalescing is enabled by default.

+ * Original signature : `void setMouseCoalescingEnabled(BOOL)`

+ * *native declaration : :244* + */ + var isMouseCoalescingEnabled: Boolean + /** + * *native declaration : :296*

+ * Conversion Error : NSTimeInterval + */ + /** + * Original signature : `void stopPeriodicEvents()`

+ * *native declaration : :297* + */ + fun stopPeriodicEvents() + /** + * *native declaration : :300*

+ * Conversion Error : NSPoint + */ + /** + * *native declaration : :301*

+ * Conversion Error : NSPoint + */ + /** + * *native declaration : :302*

+ * Conversion Error : NSPoint + */ + /** + * *native declaration : :303*

+ * Conversion Error : NSPoint + */ + /** + * *native declaration : :306*

+ * Conversion Error : NSPoint + */ + } + + /** + * these messages are valid for all events

+ * Original signature : `NSEventType type()`

+ * *native declaration : :177* + */ + abstract fun type(): Int + + /** + * Original signature : `NSUInteger modifierFlags()`

+ * *native declaration : :178* + */ + abstract fun modifierFlags(): Int + /** + * *native declaration : :179*

+ * Conversion Error : NSTimeInterval + */ + /** + * Original signature : `NSWindow* window()`

+ * *native declaration : :180* + */ + abstract fun window(): NSWindow? + + /** + * Original signature : `NSInteger windowNumber()`

+ * *native declaration : :181* + */ + abstract fun windowNumber(): Int + + /** + * Original signature : `NSGraphicsContext* context()`

+ * *native declaration : :182* + */ + abstract fun context(): Pointer? + + /** + * these messages are valid for all mouse down/up/drag events

+ * Original signature : `NSInteger clickCount()`

+ * *native declaration : :185* + */ + abstract fun clickCount(): Int + + /** + * Original signature : `NSInteger buttonNumber()`

+ * for NSOtherMouse events, but will return valid constants for NSLeftMouse and NSRightMouse

+ * *native declaration : :186* + */ + abstract fun buttonNumber(): Int + + /** + * these messages are valid for all mouse down/up/drag and enter/exit events

+ * Original signature : `NSInteger eventNumber()`

+ * *native declaration : :188* + */ + abstract fun eventNumber(): Int + + /** + * These messages are also valid for NSTabletPoint events on 10.4 or later

+ * Original signature : `float pressure()`

+ * *native declaration : :192* + */ + abstract fun pressure(): Float + + /** + * *native declaration : :193*

+ * Conversion Error : NSPoint + */ + abstract fun locationInWindow(): NSPoint? + + /** + * these messages are valid for scroll wheel events and mouse move/drag events

+ * Original signature : `CGFloat deltaX()`

+ * *native declaration : :196* + */ + abstract fun deltaX(): CGFloat? + + /** + * Original signature : `CGFloat deltaY()`

+ * *native declaration : :197* + */ + abstract fun deltaY(): CGFloat? + + /** + * Original signature : `CGFloat deltaZ()`

+ * 0 for most scroll wheel and mouse events

+ * *native declaration : :198* + */ + abstract fun deltaZ(): CGFloat? + + /** + * these messages are valid for keyup and keydown events

+ * Original signature : `NSString* characters()`

+ * *native declaration : :201* + */ + abstract fun characters(): String? + + /** + * Original signature : `NSString* charactersIgnoringModifiers()`

+ * *native declaration : :202* + */ + abstract fun charactersIgnoringModifiers(): String? + + /** + * the chars that would have been generated, regardless of modifier keys (except shift)

+ * Original signature : `BOOL isARepeat()`

+ * *native declaration : :204* + */ + abstract val isARepeat: Boolean + + /** + * this message is valid for keyup, keydown and flagschanged events

+ * Original signature : `unsigned short keyCode()`

+ * device-independent key number

+ * *native declaration : :206* + */ + abstract fun keyCode(): Short + + /** + * these messages are valid for enter and exit events

+ * Original signature : `NSInteger trackingNumber()`

+ * *native declaration : :209* + */ + abstract fun trackingNumber(): Int + + /** + * Original signature : `void* userData()`

+ * *native declaration : :210* + */ + abstract fun userData(): NSObject? + + /** + * -trackingArea returns the NSTrackingArea that generated this event. It is possible for there to be no trackingArea associated with the event in some cases where the event corresponds to a trackingRect installed with -[NSView addTrackingRect:owner:userData:assumeInside:], in which case nil is returned.

+ * Original signature : `NSTrackingArea* trackingArea()`

+ * *native declaration : :213* + */ + abstract fun trackingArea(): Pointer? + + /** + * this message is also valid for mouse events on 10.4 or later

+ * Original signature : `short subtype()`

+ * *native declaration : :218* + */ + abstract fun subtype(): Short + + /** + * these messages are valid for kit, system, and app-defined events

+ * Original signature : `NSInteger data1()`

+ * *native declaration : :221* + */ + abstract fun data1(): Int + + /** + * Original signature : `NSInteger data2()`

+ * *native declaration : :222* + */ + abstract fun data2(): Int + + /** + * -eventRef returns an EventRef corresponding to the NSEvent. The EventRef is retained by the NSEvent, so will be valid as long as the NSEvent is valid, and will be released when the NSEvent is freed. You can use RetainEvent to extend the lifetime of the EventRef, with a corresponding ReleaseEvent when you are done with it. If there is no EventRef corresponding to the NSEvent, -eventRef will return NULL.

+ * Original signature : `const void* eventRef()`

+ * *native declaration : :229* + */ + abstract fun eventRef(): NSEvent? + + /** + * -CGEvent returns an autoreleased CGEventRef corresponding to the NSEvent. If there is no CGEventRef corresponding to the NSEvent, -CGEvent will return NULL.

+ * Original signature : `CGEvent()`

+ * *native declaration : :236* + */ + abstract fun CGEvent(): Pointer? + + /** + * this message is valid for mouse events with subtype NSTabletPointEventSubtype or NSTabletProximityEventSubtype, and for NSTabletPoint and NSTabletProximity events

+ * Original signature : `NSUInteger deviceID()`

+ * *native declaration : :251* + */ + abstract fun deviceID(): Int + + /** + * absolute x coordinate in tablet space at full tablet resolution

+ * Original signature : `NSInteger absoluteX()`

+ * *native declaration : :255* + */ + abstract fun absoluteX(): Int + + /** + * absolute y coordinate in tablet space at full tablet resolution

+ * Original signature : `NSInteger absoluteY()`

+ * *native declaration : :257* + */ + abstract fun absoluteY(): Int + + /** + * absolute z coordinate in tablet space at full tablet resolution

+ * Original signature : `NSInteger absoluteZ()`

+ * *native declaration : :259* + */ + abstract fun absoluteZ(): Int + + /** + * mask indicating which buttons are pressed.

+ * Original signature : `NSUInteger buttonMask()`

+ * *native declaration : :261* + */ + abstract fun buttonMask(): Int + /** + * *native declaration : :263*

+ * Conversion Error : NSPoint + */ + /** + * device rotation in degrees

+ * Original signature : `float rotation()`

+ * *native declaration : :265* + */ + abstract fun rotation(): Float + + /** + * tangential pressure on the device; range is -1 to 1

+ * Original signature : `float tangentialPressure()`

+ * *native declaration : :267* + */ + abstract fun tangentialPressure(): Float + + /** + * NSArray of 3 vendor defined shorts

+ * Original signature : `vendorDefined()`

+ * *native declaration : :269* + */ + abstract fun vendorDefined(): NSArray? + + /** + * vendor defined, typically USB vendor ID

+ * Original signature : `NSUInteger vendorID()`

+ * *native declaration : :273* + */ + abstract fun vendorID(): Int + + /** + * vendor defined tablet ID

+ * Original signature : `NSUInteger tabletID()`

+ * *native declaration : :275* + */ + abstract fun tabletID(): Int + + /** + * index of the device on the tablet. Usually 0, except for tablets that support multiple concurrent devices

+ * Original signature : `NSUInteger pointingDeviceID()`

+ * *native declaration : :277* + */ + abstract fun pointingDeviceID(): Int + + /** + * system assigned unique tablet ID

+ * Original signature : `NSUInteger systemTabletID()`

+ * *native declaration : :279* + */ + abstract fun systemTabletID(): Int + + /** + * vendor defined pointing device type

+ * Original signature : `NSUInteger vendorPointingDeviceType()`

+ * *native declaration : :281* + */ + abstract fun vendorPointingDeviceType(): Int + + /** + * vendor defined serial number of pointing device

+ * Original signature : `NSUInteger pointingDeviceSerialNumber()`

+ * *native declaration : :283* + */ + abstract fun pointingDeviceSerialNumber(): Int + + /** + * vendor defined unique ID

+ * Original signature : `unsigned long long uniqueID()`

+ * *native declaration : :285* + */ + abstract fun uniqueID(): Long + + /** + * mask representing capabilities of device

+ * Original signature : `NSUInteger capabilityMask()`

+ * *native declaration : :287* + */ + abstract fun capabilityMask(): Int + + /** + * mask representing capabilities of device

+ * Original signature : `NSPointingDeviceType pointingDeviceType()`

+ * *native declaration : :289* + */ + abstract fun pointingDeviceType(): Int + + /** + * YES - entering; NO - leaving

+ * Original signature : `BOOL isEnteringProximity()`

+ * *native declaration : :291* + */ + abstract val isEnteringProximity: Boolean + + companion object { + /// native declaration : :12 + const val NSLeftMouseDown: Int = 1 + + /// native declaration : :13 + const val NSLeftMouseUp: Int = 2 + + /// native declaration : :14 + const val NSRightMouseDown: Int = 3 + + /// native declaration : :15 + const val NSRightMouseUp: Int = 4 + + /// native declaration : :16 + const val NSMouseMoved: Int = 5 + + /// native declaration : :17 + const val NSLeftMouseDragged: Int = 6 + + /// native declaration : :18 + const val NSRightMouseDragged: Int = 7 + + /// native declaration : :19 + const val NSMouseEntered: Int = 8 + + /// native declaration : :20 + const val NSMouseExited: Int = 9 + + /// native declaration : :21 + const val NSKeyDown: Int = 10 + + /// native declaration : :22 + const val NSKeyUp: Int = 11 + + /// native declaration : :23 + const val NSFlagsChanged: Int = 12 + + /// native declaration : :24 + const val NSAppKitDefined: Int = 13 + + /// native declaration : :25 + const val NSSystemDefined: Int = 14 + + /// native declaration : :26 + const val NSApplicationDefined: Int = 15 + + /// native declaration : :27 + const val NSPeriodic: Int = 16 + + /// native declaration : :28 + const val NSCursorUpdate: Int = 17 + + /// native declaration : :29 + const val NSScrollWheel: Int = 22 + + /// native declaration : :31 + const val NSTabletPoint: Int = 23 + + /// native declaration : :32 + const val NSTabletProximity: Int = 24 + + /// native declaration : :34 + const val NSOtherMouseDown: Int = 25 + + /// native declaration : :35 + const val NSOtherMouseUp: Int = 26 + + /// native declaration : :36 + const val NSOtherMouseDragged: Int = 27 + + /// native declaration : :41 + const val NSLeftMouseDownMask: Int = 1 shl NSLeftMouseDown + + /// native declaration : :42 + const val NSLeftMouseUpMask: Int = 1 shl NSLeftMouseUp + + /// native declaration : :43 + const val NSRightMouseDownMask: Int = 1 shl NSRightMouseDown + + /// native declaration : :44 + const val NSRightMouseUpMask: Int = 1 shl NSRightMouseUp + + /// native declaration : :45 + const val NSMouseMovedMask: Int = 1 shl NSMouseMoved + + /// native declaration : :46 + const val NSLeftMouseDraggedMask: Int = 1 shl NSLeftMouseDragged + + /// native declaration : :47 + const val NSRightMouseDraggedMask: Int = 1 shl NSRightMouseDragged + + /// native declaration : :48 + const val NSMouseEnteredMask: Int = 1 shl NSMouseEntered + + /// native declaration : :49 + const val NSMouseExitedMask: Int = 1 shl NSMouseExited + + /// native declaration : :50 + const val NSKeyDownMask: Int = 1 shl NSKeyDown + + /// native declaration : :51 + const val NSKeyUpMask: Int = 1 shl NSKeyUp + + /// native declaration : :52 + const val NSFlagsChangedMask: Int = 1 shl NSFlagsChanged + + /// native declaration : :53 + const val NSAppKitDefinedMask: Int = 1 shl NSAppKitDefined + + /// native declaration : :54 + const val NSSystemDefinedMask: Int = 1 shl NSSystemDefined + + /// native declaration : :55 + const val NSApplicationDefinedMask: Int = 1 shl NSApplicationDefined + + /// native declaration : :56 + const val NSPeriodicMask: Int = 1 shl NSPeriodic + + /// native declaration : :57 + const val NSCursorUpdateMask: Int = 1 shl NSCursorUpdate + + /// native declaration : :58 + const val NSScrollWheelMask: Int = 1 shl NSScrollWheel + + /// native declaration : :60 + const val NSTabletPointMask: Int = 1 shl NSTabletPoint + + /// native declaration : :61 + const val NSTabletProximityMask: Int = 1 shl NSTabletProximity + + /// native declaration : :63 + const val NSOtherMouseDownMask: Int = 1 shl NSOtherMouseDown + + /// native declaration : :64 + const val NSOtherMouseUpMask: Int = 1 shl NSOtherMouseUp + + /// native declaration : :65 + const val NSOtherMouseDraggedMask: Int = 1 shl NSOtherMouseDragged + + /// Failed to infer type of NSUIntegerMax + /// Failed to infer type of NX_TABLET_POINTER_UNKNOWN + /// Failed to infer type of NX_TABLET_POINTER_PEN + /// Failed to infer type of NX_TABLET_POINTER_CURSOR + /// Failed to infer type of NX_TABLET_POINTER_ERASER + /// Failed to infer type of NX_TABLET_BUTTON_PENTIPMASK + /// Failed to infer type of NX_TABLET_BUTTON_PENLOWERSIDEMASK + /// Failed to infer type of NX_TABLET_BUTTON_PENUPPERSIDEMASK + /// native declaration : :313 + const val NSUpArrowFunctionKey: Int = 63232 + + /// native declaration : :314 + const val NSDownArrowFunctionKey: Int = 63233 + + /// native declaration : :315 + const val NSLeftArrowFunctionKey: Int = 63234 + + /// native declaration : :316 + const val NSRightArrowFunctionKey: Int = 63235 + + /// native declaration : :317 + const val NSF1FunctionKey: Int = 63236 + + /// native declaration : :318 + const val NSF2FunctionKey: Int = 63237 + + /// native declaration : :319 + const val NSF3FunctionKey: Int = 63238 + + /// native declaration : :320 + const val NSF4FunctionKey: Int = 63239 + + /// native declaration : :321 + const val NSF5FunctionKey: Int = 63240 + + /// native declaration : :322 + const val NSF6FunctionKey: Int = 63241 + + /// native declaration : :323 + const val NSF7FunctionKey: Int = 63242 + + /// native declaration : :324 + const val NSF8FunctionKey: Int = 63243 + + /// native declaration : :325 + const val NSF9FunctionKey: Int = 63244 + + /// native declaration : :326 + const val NSF10FunctionKey: Int = 63245 + + /// native declaration : :327 + const val NSF11FunctionKey: Int = 63246 + + /// native declaration : :328 + const val NSF12FunctionKey: Int = 63247 + + /// native declaration : :329 + const val NSF13FunctionKey: Int = 63248 + + /// native declaration : :330 + const val NSF14FunctionKey: Int = 63249 + + /// native declaration : :331 + const val NSF15FunctionKey: Int = 63250 + + /// native declaration : :332 + const val NSF16FunctionKey: Int = 63251 + + /// native declaration : :333 + const val NSF17FunctionKey: Int = 63252 + + /// native declaration : :334 + const val NSF18FunctionKey: Int = 63253 + + /// native declaration : :335 + const val NSF19FunctionKey: Int = 63254 + + /// native declaration : :336 + const val NSF20FunctionKey: Int = 63255 + + /// native declaration : :337 + const val NSF21FunctionKey: Int = 63256 + + /// native declaration : :338 + const val NSF22FunctionKey: Int = 63257 + + /// native declaration : :339 + const val NSF23FunctionKey: Int = 63258 + + /// native declaration : :340 + const val NSF24FunctionKey: Int = 63259 + + /// native declaration : :341 + const val NSF25FunctionKey: Int = 63260 + + /// native declaration : :342 + const val NSF26FunctionKey: Int = 63261 + + /// native declaration : :343 + const val NSF27FunctionKey: Int = 63262 + + /// native declaration : :344 + const val NSF28FunctionKey: Int = 63263 + + /// native declaration : :345 + const val NSF29FunctionKey: Int = 63264 + + /// native declaration : :346 + const val NSF30FunctionKey: Int = 63265 + + /// native declaration : :347 + const val NSF31FunctionKey: Int = 63266 + + /// native declaration : :348 + const val NSF32FunctionKey: Int = 63267 + + /// native declaration : :349 + const val NSF33FunctionKey: Int = 63268 + + /// native declaration : :350 + const val NSF34FunctionKey: Int = 63269 + + /// native declaration : :351 + const val NSF35FunctionKey: Int = 63270 + + /// native declaration : :352 + const val NSInsertFunctionKey: Int = 63271 + + /// native declaration : :353 + const val NSDeleteFunctionKey: Int = 63272 + + /// native declaration : :354 + const val NSHomeFunctionKey: Int = 63273 + + /// native declaration : :355 + const val NSBeginFunctionKey: Int = 63274 + + /// native declaration : :356 + const val NSEndFunctionKey: Int = 63275 + + /// native declaration : :357 + const val NSPageUpFunctionKey: Int = 63276 + + /// native declaration : :358 + const val NSPageDownFunctionKey: Int = 63277 + + /// native declaration : :359 + const val NSPrintScreenFunctionKey: Int = 63278 + + /// native declaration : :360 + const val NSScrollLockFunctionKey: Int = 63279 + + /// native declaration : :361 + const val NSPauseFunctionKey: Int = 63280 + + /// native declaration : :362 + const val NSSysReqFunctionKey: Int = 63281 + + /// native declaration : :363 + const val NSBreakFunctionKey: Int = 63282 + + /// native declaration : :364 + const val NSResetFunctionKey: Int = 63283 + + /// native declaration : :365 + const val NSStopFunctionKey: Int = 63284 + + /// native declaration : :366 + const val NSMenuFunctionKey: Int = 63285 + + /// native declaration : :367 + const val NSUserFunctionKey: Int = 63286 + + /// native declaration : :368 + const val NSSystemFunctionKey: Int = 63287 + + /// native declaration : :369 + const val NSPrintFunctionKey: Int = 63288 + + /// native declaration : :370 + const val NSClearLineFunctionKey: Int = 63289 + + /// native declaration : :371 + const val NSClearDisplayFunctionKey: Int = 63290 + + /// native declaration : :372 + const val NSInsertLineFunctionKey: Int = 63291 + + /// native declaration : :373 + const val NSDeleteLineFunctionKey: Int = 63292 + + /// native declaration : :374 + const val NSInsertCharFunctionKey: Int = 63293 + + /// native declaration : :375 + const val NSDeleteCharFunctionKey: Int = 63294 + + /// native declaration : :376 + const val NSPrevFunctionKey: Int = 63295 + + /// native declaration : :377 + const val NSNextFunctionKey: Int = 63296 + + /// native declaration : :378 + const val NSSelectFunctionKey: Int = 63297 + + /// native declaration : :379 + const val NSExecuteFunctionKey: Int = 63298 + + /// native declaration : :380 + const val NSUndoFunctionKey: Int = 63299 + + /// native declaration : :381 + const val NSRedoFunctionKey: Int = 63300 + + /// native declaration : :382 + const val NSFindFunctionKey: Int = 63301 + + /// native declaration : :383 + const val NSHelpFunctionKey: Int = 63302 + + /// native declaration : :384 + const val NSModeSwitchFunctionKey: Int = 63303 + + /// native declaration : :389 + const val NSWindowExposedEventType: Int = 0 + + /// native declaration : :390 + const val NSApplicationActivatedEventType: Int = 1 + + /// native declaration : :391 + const val NSApplicationDeactivatedEventType: Int = 2 + + /// native declaration : :392 + const val NSWindowMovedEventType: Int = 4 + + /// native declaration : :393 + const val NSScreenChangedEventType: Int = 8 + + /// native declaration : :394 + const val NSAWTEventType: Int = 16 + + /// native declaration : :398 + const val NSPowerOffEventType: Int = 1 + + + const val NSAlphaShiftKeyMask: Int = 1 shl 16 + const val NSShiftKeyMask: Int = 1 shl 17 + const val NSControlKeyMask: Int = 1 shl 18 + const val NSAlternateKeyMask: Int = 1 shl 19 + const val NSCommandKeyMask: Int = 1 shl 20 + const val NSNumericPadKeyMask: Int = 1 shl 21 + const val NSHelpKeyMask: Int = 1 shl 22 + const val NSFunctionKeyMask: Int = 1 shl 23 + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSFileManager.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSFileManager.kt new file mode 100644 index 00000000..f26a1ad6 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSFileManager.kt @@ -0,0 +1,523 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.ObjCObject +import org.rococoa.ObjCObjectByReference +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :12 +abstract class NSFileManager : NSObject() { + interface _Class : ObjCClass { + /** + * Returns the default singleton CLASS.

Original signature : `NSFileManager* + * defaultManager()`

+ * *native declaration : :16* + */ + open fun defaultManager(): NSFileManager? + } + + /** + * *native declaration : :22*

+ * Conversion Error : / **

* CLASSs of NSFileManager may now have delegates. Each CLASS has one delegate, and the + * delegate is not retained. In versions of Mac OS X prior to 10.5, the behavior of calling [[NSFileManager alloc] + * init] was undefined. In Mac OS X 10.5 "Leopard" and later, calling [[NSFileManager alloc] init] returns a new + * CLASS of an NSFileManager.

* Original signature : `void setDelegate(null)`

* /

- + * (void)setDelegate:(null)delegate; (Argument delegate cannot be converted) + */ + abstract fun setDelegate(delegate: org.rococoa.ID?) + + /** + * Original signature : `delegate()`

+ * *native declaration : :23* + */ + abstract fun delegate(): org.rococoa.ID? + + /** + * -mountedVolumeURLsIncludingResourceValuesForKeys:options: returns an NSArray of NSURLs locating the mounted + * volumes available on the computer. The property keys that can be requested are available in + * /NSURL.h>.

Original signature : `-(NSArray*)mountedVolumeURLsIncludingResourceValuesForKeys:(NSArray*) + * options:(NSVolumeEnumerationOptions)`

+ * *native declaration : NSFileManager.h:69* + */ + abstract fun mountedVolumeURLsIncludingResourceValuesForKeys_options( + propertyKeys: NSArray?, + options: NSUInteger? + ): NSArray? + + /** + * -contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error: returns an NSArray of NSURLs identifying the + * the directory entries. If this method returns nil, an NSError will be returned by reference in the 'error' + * parameter. If the directory contains no entries, this method will return the empty array. When an array is + * specified for the 'keys' parameter, the specified property values will be pre-fetched and cached with each + * enumerated URL.

This method always does a shallow enumeration of the specified directory (i.e. it always acts + * as if NSDirectoryEnumerationSkipsSubdirectoryDescendants has been specified). If you need to perform a deep + * enumeration, use +[NSFileManager enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:].

If you + * wish to only receive the URLs and no other attributes, then pass '0' for 'options' and an empty NSArray + * ('[NSArray array]') for 'keys'. If you wish to have the property caches of the vended URLs pre-populated with a + * default set of attributes, then pass '0' for 'options' and 'nil' for 'keys'.

Original signature : + * `-(NSArray*)contentsOfDirectoryAtURL:(NSURL*) includingPropertiesForKeys:(NSArray*) + * options:(NSDirectoryEnumerationOptions) error:(NSError**)`

+ * *native declaration : NSFileManager.h:77* + */ + abstract fun contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error( + url: NSURL?, + keys: NSArray?, + mask: NSUInteger?, + error: ObjCObjectByReference? + ): NSArray? + /** + * *native declaration : NSFileManager.h:82*

+ * Conversion Error : / **

+ * * -URLsForDirectory:inDomains: is analogous to NSSearchPathForDirectoriesInDomains(), but returns an array of NSURL instances for use with URL-taking APIs. This API is suitable when you need to search for a file or files which may live in one of a variety of locations in the domains specified.

+ * * Original signature : `-(NSArray*)URLsForDirectory:() inDomains:()`

+ * * /

+ * - (NSArray*)URLsForDirectory:(null)directory inDomains:(null)domainMask; (Argument directory cannot be converted) + */ + /** + * *native declaration : NSFileManager.h:88*

+ * Conversion Error : / **

+ * * -URLForDirectory:inDomain:appropriateForURL:create:error: is a URL-based replacement for FSFindFolder(). It allows for the specification and (optional) creation of a specific directory for a particular purpose (e.g. the replacement of a particular item on disk, or a particular Library directory.

+ * * You may pass only one of the values from the NSSearchPathDomainMask enumeration, and you may not pass NSAllDomainsMask.

+ * * Original signature : `-(NSURL*)URLForDirectory:() inDomain:() appropriateForURL:(NSURL*) create:(BOOL) error:(NSError**)`

+ * * /

+ * - (NSURL*)URLForDirectory:(null)directory inDomain:(null)domain appropriateForURL:(NSURL*)url create:(BOOL)shouldCreate error:(NSError**)error; (Argument directory cannot be converted) + */ + /** + * Instances of NSFileManager may now have delegates. Each instance has one delegate, and the delegate is not + * retained. In versions of Mac OS X prior to 10.5, the behavior of calling [[NSFileManager alloc] init] was + * undefined. In Mac OS X 10.5 "Leopard" and later, calling [[NSFileManager alloc] init] returns a new instance of + * an NSFileManager.

Original signature : `-(void)setDelegate:(id)`

+ * *native declaration : NSFileManager.h:94* + */ + abstract fun setDelegate(delegate: ObjCObject?) + + /** + * setAttributes:ofItemAtPath:error: returns YES when the attributes specified in the 'attributes' dictionary are + * set successfully on the item specified by 'path'. If this method returns NO, a presentable NSError will be + * provided by-reference in the 'error' parameter. If no error is required, you may pass 'nil' for the error.

+ * This method replaces changeFileAttributes:atPath:.

Original signature : `-(BOOL)setAttributes:(NSDictionary*) + * ofItemAtPath:(String*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:101* + */ + abstract fun setAttributes_ofItemAtPath_error( + attributes: NSDictionary?, + path: String?, + error: ObjCObjectByReference? + ): Boolean + + /** + * createDirectoryAtPath:withIntermediateDirectories:attributes:error: creates a directory at the specified path. If + * you pass 'NO' for createIntermediates, the directory must not exist at the time this call is made. Passing 'YES' + * for 'createIntermediates' will create any necessary intermediate directories. This method returns YES if all + * directories specified in 'path' were created and attributes were set. Directories are created with attributes + * specified by the dictionary passed to 'attributes'. If no dictionary is supplied, directories are created + * according to the umask of the process. This method returns NO if a failure occurs at any stage of the operation. + * If an error parameter was provided, a presentable NSError will be returned by reference.

This method replaces + * createDirectoryAtPath:attributes:

Original signature : `-(BOOL)createDirectoryAtPath:(String*) + * withIntermediateDirectories:(BOOL) attributes:(NSDictionary*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:107* + */ + abstract fun createDirectoryAtPath_withIntermediateDirectories_attributes_error( + path: String?, + createIntermediates: Boolean, + attributes: NSDictionary?, + error: ObjCObjectByReference? + ): Boolean + + /** + * contentsOfDirectoryAtPath:error: returns an NSArray of Strings representing the filenames of the items in the + * directory. If this method returns 'nil', an NSError will be returned by reference in the 'error' parameter. If + * the directory contains no items, this method will return the empty array.

This method replaces + * directoryContentsAtPath:

Original signature : `-(NSArray*)contentsOfDirectoryAtPath:(String*) + * error:(NSError**)`

+ * *native declaration : NSFileManager.h:113* + */ + abstract fun contentsOfDirectoryAtPath_error(path: String?, error: ObjCObjectByReference?): NSArray? + + /** + * subpathsOfDirectoryAtPath:error: returns an NSArray of Strings represeting the filenames of the items in the + * specified directory and all its subdirectories recursively. If this method returns 'nil', an NSError will be + * returned by reference in the 'error' parameter. If the directory contains no items, this method will return the + * empty array.

This method replaces subpathsAtPath:

Original signature : + * `-(NSArray*)subpathsOfDirectoryAtPath:(String*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:119* + */ + abstract fun subpathsOfDirectoryAtPath_error(path: String?, error: ObjCObjectByReference?): NSArray? + + /** + * attributesOfItemAtPath:error: returns an NSDictionary of key/value pairs containing the attributes of the item + * (file, directory, symlink, etc.) at the path in question. If this method returns 'nil', an NSError will be + * returned by reference in the 'error' parameter. This method does not traverse a terminal symlink.

This method + * replaces fileAttributesAtPath:traverseLink:.

Original signature : `-(NSDictionary*)attributesOfItemAtPath:(String*) + * error:(NSError**)`

+ * *native declaration : NSFileManager.h:125* + */ + abstract fun attributesOfItemAtPath_error(path: String?, error: ObjCObjectByReference?): NSDictionary? + + /** + * attributesOfFileSystemForPath:error: returns an NSDictionary of key/value pairs containing the attributes of the + * filesystem containing the provided path. If this method returns 'nil', an NSError will be returned by reference + * in the 'error' parameter. This method does not traverse a terminal symlink.

This method replaces + * fileSystemAttributesAtPath:.

Original signature : `-(NSDictionary*)attributesOfFileSystemForPath:(String*) + * error:(NSError**)`

+ * *native declaration : NSFileManager.h:131* + */ + abstract fun attributesOfFileSystemForPath_error(path: String?, error: ObjCObjectByReference?): NSDictionary? + + /** + * createSymbolicLinkAtPath:withDestination:error: returns YES if the symbolic link that point at 'destPath' was + * able to be created at the location specified by 'path'. If this method returns NO, the link was unable to be + * created and an NSError will be returned by reference in the 'error' parameter. This method does not traverse a + * terminal symlink.

This method replaces createSymbolicLinkAtPath:pathContent:

Original signature : + * `-(BOOL)createSymbolicLinkAtPath:(String*) withDestinationPath:(String*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:137* + */ + abstract fun createSymbolicLinkAtPath_withDestinationPath_error( + path: String?, + destPath: String?, + error: ObjCObjectByReference? + ): Boolean + + /** + * destinationOfSymbolicLinkAtPath:error: returns an String containing the path of the item pointed at by the + * symlink specified by 'path'. If this method returns 'nil', an NSError will be returned by reference in the + * 'error' parameter.

This method replaces pathContentOfSymbolicLinkAtPath:

Original signature : + * `-(String*)destinationOfSymbolicLinkAtPath:(String*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:143* + */ + abstract fun destinationOfSymbolicLinkAtPath_error(path: String?, error: ObjCObjectByReference?): String? + + /** + * These methods replace their non-error returning counterparts below. See the NSFileManagerFileOperationAdditions + * category below for methods that are dispatched to the NSFileManager instance's delegate.

Original signature + * : + * `-(BOOL)copyItemAtPath:(String*) toPath:(String*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:147* + */ + abstract fun copyItemAtPath_toPath_error(srcPath: String?, dstPath: String?, error: ObjCObjectByReference?): Boolean + + /** + * Original signature : `-(BOOL)moveItemAtPath:(String*) toPath:(String*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:148* + */ + abstract fun moveItemAtPath_toPath_error(srcPath: String?, dstPath: String?, error: ObjCObjectByReference?): Boolean + + /** + * Original signature : `-(BOOL)linkItemAtPath:(String*) toPath:(String*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:149* + */ + abstract fun linkItemAtPath_toPath_error(srcPath: String?, dstPath: String?, error: ObjCObjectByReference?): Boolean + + /** + * Original signature : `-(BOOL)removeItemAtPath:(String*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:150* + */ + abstract fun removeItemAtPath_error(path: String?, error: ObjCObjectByReference?): Boolean + + /** + * These methods are URL-taking equivalents of the four methods above. Their delegate methods are defined in the + * NSFileManagerFileOperationAdditions category below.

Original signature : `-(BOOL)copyItemAtURL:(NSURL*) + * toURL:(NSURL*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:156* + */ + abstract fun copyItemAtURL_toURL_error(srcURL: NSURL?, dstURL: NSURL?, error: ObjCObjectByReference?): Boolean + + /** + * Original signature : `-(BOOL)moveItemAtURL:(NSURL*) toURL:(NSURL*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:157* + */ + abstract fun moveItemAtURL_toURL_error(srcURL: NSURL?, dstURL: NSURL?, error: ObjCObjectByReference?): Boolean + + /** + * Original signature : `-(BOOL)linkItemAtURL:(NSURL*) toURL:(NSURL*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:158* + */ + abstract fun linkItemAtURL_toURL_error(srcURL: NSURL?, dstURL: NSURL?, error: ObjCObjectByReference?): Boolean + + /** + * Original signature : `-(BOOL)removeItemAtURL:(NSURL*) error:(NSError**)`

+ * *native declaration : NSFileManager.h:159* + */ + abstract fun removeItemAtURL_error(URL: NSURL?, error: ObjCObjectByReference?): Boolean + + /** + * The following methods are deprecated on Mac OS X 10.5. Their URL-based and/or error-returning replacements are + * listed above.

Original signature : `-(NSDictionary*)fileAttributesAtPath:(String*) + * traverseLink:(BOOL)`

+ * *native declaration : NSFileManager.h:163* + */ + abstract fun fileAttributesAtPath_traverseLink(path: String?, yorn: Boolean): NSDictionary? + + /** + * Original signature : `-(BOOL)changeFileAttributes:(NSDictionary*) atPath:(String*)`

+ * *native declaration : NSFileManager.h:164* + */ + abstract fun changeFileAttributes_atPath(attributes: NSDictionary?, path: String?): Boolean + + /** + * Original signature : `-(NSArray*)directoryContentsAtPath:(String*)`

+ * *native declaration : NSFileManager.h:165* + */ + abstract fun directoryContentsAtPath(path: String?): NSArray? + + /** + * Original signature : `-(NSDictionary*)fileSystemAttributesAtPath:(String*)`

+ * *native declaration : NSFileManager.h:166* + */ + abstract fun fileSystemAttributesAtPath(path: String?): NSDictionary? + + /** + * Original signature : `-(String*)pathContentOfSymbolicLinkAtPath:(String*)`

+ * *native declaration : NSFileManager.h:167* + */ + abstract fun pathContentOfSymbolicLinkAtPath(path: String?): String? + + /** + * Original signature : `-(BOOL)createSymbolicLinkAtPath:(String*) pathContent:(String*)`

+ * *native declaration : NSFileManager.h:168* + */ + abstract fun createSymbolicLinkAtPath_pathContent(path: String?, otherpath: String?): Boolean + + /** + * Original signature : `-(BOOL)createDirectoryAtPath:(String*) attributes:(NSDictionary*)`

+ * *native declaration : NSFileManager.h:169* + */ + abstract fun createDirectoryAtPath_attributes(path: String?, attributes: NSDictionary?): Boolean + + /** + * Original signature : `-(BOOL)linkPath:(String*) toPath:(String*) handler:(id)`

+ * *native declaration : NSFileManager.h:172* + */ + abstract fun linkPath_toPath_handler(src: String?, dest: String?, handler: ObjCObject?): Boolean + + /** + * Original signature : `-(BOOL)copyPath:(String*) toPath:(String*) handler:(id)`

+ * *native declaration : NSFileManager.h:173* + */ + abstract fun copyPath_toPath_handler(src: String?, dest: String?, handler: ObjCObject?): Boolean + + /** + * Original signature : `-(BOOL)movePath:(String*) toPath:(String*) handler:(id)`

+ * *native declaration : NSFileManager.h:174* + */ + abstract fun movePath_toPath_handler(src: String?, dest: String?, handler: ObjCObject?): Boolean + + /** + * Original signature : `-(BOOL)removeFileAtPath:(String*) handler:(id)`

+ * *native declaration : NSFileManager.h:175* + */ + abstract fun removeFileAtPath_handler(path: String?, handler: ObjCObject?): Boolean + + /** + * Process working directory management. Despite the fact that these are instance methods on NSFileManager, these + * methods report and change (respectively) the working directory for the entire process. Developers are cautioned + * that doing so is fraught with peril.

Original signature : `-(String*)currentDirectoryPath`

+ * *native declaration : NSFileManager.h:180* + */ + abstract fun currentDirectoryPath(): String? + + /** + * Original signature : `-(BOOL)changeCurrentDirectoryPath:(String*)`

+ * *native declaration : NSFileManager.h:181* + */ + abstract fun changeCurrentDirectoryPath(path: String?): Boolean + + /** + * The following methods are of limited utility. Attempting to predicate behavior based on the current state of the + * filesystem or a particular file on the filesystem is encouraging odd behavior in the face of filesystem race + * conditions. It's far better to attempt an operation (like loading a file or creating a directory) and handle the + * error gracefully than it is to try to figure out ahead of time whether the operation will succeed.

Original + * signature : `-(BOOL)fileExistsAtPath:(String*)`

+ * *native declaration : NSFileManager.h:185* + */ + abstract fun fileExistsAtPath(path: String?): Boolean + + /** + * Original signature : `-(BOOL)fileExistsAtPath:(String*) isDirectory:(BOOL*)`

+ * *native declaration : NSFileManager.h:186* + */ + abstract fun fileExistsAtPath_isDirectory(path: String?, isDirectory: Boolean): Boolean + + /** + * Original signature : `-(BOOL)isReadableFileAtPath:(String*)`

+ * *native declaration : NSFileManager.h:187* + */ + abstract fun isReadableFileAtPath(path: String?): Boolean + + /** + * Original signature : `-(BOOL)isWritableFileAtPath:(String*)`

+ * *native declaration : NSFileManager.h:188* + */ + abstract fun isWritableFileAtPath(path: String?): Boolean + + /** + * Original signature : `-(BOOL)isExecutableFileAtPath:(String*)`

+ * *native declaration : NSFileManager.h:189* + */ + abstract fun isExecutableFileAtPath(path: String?): Boolean + + /** + * Original signature : `-(BOOL)isDeletableFileAtPath:(String*)`

+ * *native declaration : NSFileManager.h:190* + */ + abstract fun isDeletableFileAtPath(path: String?): Boolean + + /** + * -contentsEqualAtPath:andPath: does not take into account data stored in the resource fork or filesystem extended + * attributes.

Original signature : `-(BOOL)contentsEqualAtPath:(String*) andPath:(String*)`

+ * *native declaration : NSFileManager.h:194* + */ + abstract fun contentsEqualAtPath_andPath(path1: String?, path2: String?): Boolean + + /** + * displayNameAtPath: returns an String suitable for presentation to the user. For directories which have + * localization information, this will return the appropriate localized string. This string is not suitable for + * passing to anything that must interact with the filesystem.

Original signature : + * `-(String*)displayNameAtPath:(String*)`

+ * *native declaration : NSFileManager.h:198* + */ + abstract fun displayNameAtPath(path: String?): String? + + /** + * componentsToDisplayForPath: returns an NSArray of display names for the path provided. Localization will occur as + * in displayNameAtPath: above. This array cannot and should not be reassembled into an usable filesystem path for + * any kind of access.

Original signature : `-(NSArray*)componentsToDisplayForPath:(String*)`

+ * *native declaration : NSFileManager.h:203* + */ + abstract fun componentsToDisplayForPath(path: String?): NSArray? + + /** + * subpathsAtPath: returns an NSArray of all contents and subpaths recursively from the provided path. This may be + * very expensive to compute for deep filesystem hierarchies, and should probably be avoided.

Original signature + * : `-(NSArray*)subpathsAtPath:(String*)`

+ * *native declaration : NSFileManager.h:220* + */ + abstract fun subpathsAtPath(path: String?): NSArray? + + /** + * These methods are provided here for compatibility. The corresponding methods on NSData which return NSErrors + * should be regarded as the primary method of creating a file from an NSData or retrieving the contents of a file + * as an NSData.

Original signature : `-(NSData*)contentsAtPath:(String*)`

+ * *native declaration : NSFileManager.h:224* + */ + abstract fun contentsAtPath(path: String?): NSData? + + /** + * Original signature : `-(BOOL)createFileAtPath:(String*) contents:(NSData*) + * attributes:(NSDictionary*)`

+ * *native declaration : NSFileManager.h:225* + */ + abstract fun createFileAtPath_contents_attributes(path: String?, data: NSData?, attr: NSDictionary?): Boolean + + /** + * fileSystemRepresentationWithPath: returns an array of characters suitable for passing to lower-level POSIX style + * APIs. The string is provided in the representation most appropriate for the filesystem in question.

Original + * signature : `-(const char*)fileSystemRepresentationWithPath:(String*)`

+ * *native declaration : NSFileManager.h:229* + */ + abstract fun fileSystemRepresentationWithPath(path: String?): String? + + /** + * stringWithFileSystemRepresentation:length: returns an String created from an array of bytes that are in the + * filesystem representation.

Original signature : `-(String*)stringWithFileSystemRepresentation:(const + * char*) length:(NSUInteger)`

+ * *native declaration : NSFileManager.h:233* + */ + abstract fun stringWithFileSystemRepresentation_length(str: String?, len: NSUInteger?): String? + + /** + * -replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: is for developers who wish to + * perform a safe-save without using the full NSDocument machinery that is available in the AppKit.

The + * `originalItemURL` is the item being replaced.

`newItemURL` is the item which will replace the original item. + * This item should be placed in a temporary directory as provided by the OS, or in a uniquely named directory + * placed in the same directory as the original item if the temporary directory is not available.

If + * `backupItemName` is provided, that name will be used to create a backup of the original item. The backup is + * placed in the same directory as the original item. If an error occurs during the creation of the backup item, the + * operation will fail. If there is already an item with the same name as the backup item, that item will be + * removed. The backup item will be removed in the event of success unless the `NSFileManagerItemReplacementWithoutDeletingBackupItem` + * option is provided in `options`.

For `options`, pass `0` to get the default behavior, which uses only the + * metadata from the new item while adjusting some properties using values from the original item. Pass + * `NSFileManagerItemReplacementUsingNewMetadataOnly` in order to use all possible metadata from the new item.

+ * Original signature : `-(BOOL)replaceItemAtURL:(NSURL*) withItemAtURL:(NSURL*) backupItemName:(String*) + * options:(NSFileManagerItemReplacementOptions) resultingItemURL:(NSURL**) error:(NSError**)`

+ * *native declaration : NSFileManager.h:242* + */ + abstract fun replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error( + originalItemURL: NSURL?, + newItemURL: NSURL?, + backupItemName: String?, + options: NSUInteger?, + resultingURL: ObjCObjectByReference?, + error: ObjCObjectByReference? + ): Boolean + + /// native declaration : NSFileManager.h + /** + * As explained in App Sandbox Design Guide, groups of sandboxed apps that need to share files and other information + * can request a container directory as part of their entitlements. These directories are stored in ~/Library/Group + * Containers/. + * + * + * + * @return When called with a valid group identifier, this method returns the location of that directory as a n + * NSURL object. This method also creates the directory if it does not yet exist. + */ + abstract fun containerURLForSecurityApplicationGroupIdentifier(groupIdentifier: String?): NSURL? + + /** + * Moves an item to the trash. + * + * @param url The item to move to the trash. + * @param outResultingURL On input, a pointer to a URL object. On output, this pointer is set to the item’s location + * in the trash. The actual name of the item may be changed when moving it to the trash, so + * use this URL to access it. You may specify nil for this parameter if you do not want the + * information. + * @param error On input, a pointer to an error object. If an error occurs, this pointer is set to an + * actual error object containing the error information. You may specify nil for this + * parameter if you do not want the error information. + * @return YES if the item at url was successfully moved to the trash, or NO if the item was not moved to the trash. + */ + abstract fun trashItemAtURL_resultingItemURL_error( + url: NSURL?, + outResultingURL: NSURL?, + error: ObjCObjectByReference? + ): Boolean + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSFileManager", _Class::class.java) + + fun defaultManager(): NSFileManager? { + return CLASS.defaultManager() + } + + val NSFileType: String? = "NSFileType" + val NSFileTypeDirectory: String? = "NSFileTypeDirectory" + val NSFileTypeRegular: String? = "NSFileTypeRegular" + val NSFileTypeSymbolicLink: String? = "NSFileTypeSymbolicLink" + val NSFileTypeSocket: String? = "NSFileTypeSocket" + val NSFileTypeCharacterSpecial: String? = "NSFileTypeCharacterSpecial" + val NSFileTypeBlockSpecial: String? = "NSFileTypeBlockSpecial" + val NSFileTypeUnknown: String? = "NSFileTypeUnknown" + val NSFileSize: String? = "NSFileSize" + val NSFileModificationDate: String? = "NSFileModificationDate" + val NSFileReferenceCount: String? = "NSFileReferenceCount" + val NSFileDeviceIdentifier: String? = "NSFileDeviceIdentifier" + val NSFileOwnerAccountName: String? = "NSFileOwnerAccountName" + val NSFileGroupOwnerAccountName: String? = "NSFileGroupOwnerAccountName" + val NSFilePosixPermissions: String? = "NSFilePosixPermissions" + val NSFileSystemNumber: String? = "NSFileSystemNumber" + val NSFileSystemFileNumber: String? = "NSFileSystemFileNumber" + val NSFileExtensionHidden: String? = "NSFileExtensionHidden" + val NSFileHFSCreatorCode: String? = "NSFileHFSCreatorCode" + val NSFileHFSTypeCode: String? = "NSFileHFSTypeCode" + val NSFileImmutable: String? = "NSFileImmutable" + val NSFileAppendOnly: String? = "NSFileAppendOnly" + val NSFileCreationDate: String? = "NSFileCreationDate" + val NSFileOwnerAccountID: String? = "NSFileOwnerAccountID" + val NSFileGroupOwnerAccountID: String? = "NSFileGroupOwnerAccountID" + val NSFileSystemSize: String? = "NSFileSystemSize" + val NSFileSystemFreeSize: String? = "NSFileSystemFreeSize" + val NSFileSystemNodes: String? = "NSFileSystemNodes" + val NSFileSystemFreeNodes: String? = "NSFileSystemFreeNodes" + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSFont.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSFont.kt new file mode 100644 index 00000000..a56f9d75 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSFont.kt @@ -0,0 +1,553 @@ +package darwin + +import org.rococoa.Foundation +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :45 +abstract class NSFont : NSObject(), NSCopying { + interface _Class : ObjCClass { + /** + * Factory ********

+ * Original signature : `NSFont* fontWithName(NSString*, CGFloat)`

+ * *native declaration : :62* + */ + open fun fontWithName_size(fontName: String?, fontSize: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* fontWithName(NSString*, const CGFloat*)`

+ * *native declaration : :63* + */ + open fun fontWithName_matrix(fontName: String?, fontMatrix: Array?): NSFont? + + /** + * Original signature : `NSFont* fontWithName(NSString*, const CGFloat*)`

+ * *native declaration : :63* + */ + open fun fontWithName_matrix(fontName: String?, fontMatrix: CGFloat?): NSFont? + + /** + * Instantiates an NSFont object matching fontDescriptor. If fontSize is greater than 0.0, it has precedence over NSFontSizeAttribute in fontDescriptor.

+ * Original signature : `NSFont* fontWithDescriptor(NSFontDescriptor*, CGFloat)`

+ * *native declaration : :67* + */ + open fun fontWithDescriptor_size(fontDescriptor: com.sun.jna.Pointer?, fontSize: CGFloat?): NSFont? + + /** + * Instantiates an NSFont object matching fontDescriptor. If textTransform is non-nil, it has precedence over NSFontMatrixAttribute in fontDescriptor.

+ * Original signature : `NSFont* fontWithDescriptor(NSFontDescriptor*, NSAffineTransform*)`

+ * *native declaration : :71* + */ + open fun fontWithDescriptor_textTransform( + fontDescriptor: com.sun.jna.Pointer?, + textTransform: com.sun.jna.Pointer? + ): NSFont? + + /** + * User font settings

+ * Original signature : `NSFont* userFontOfSize(CGFloat)`

+ * Aqua Application font

+ * *native declaration : :77* + */ + open fun userFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* userFixedPitchFontOfSize(CGFloat)`

+ * Aqua fixed-pitch font

+ * *native declaration : :78* + */ + open fun userFixedPitchFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * Original signature : `void setUserFont(NSFont*)`

+ * set preference for Application font.

+ * *native declaration : :79* + */ + open fun setUserFont(aFont: NSFont?) + + /** + * Original signature : `void setUserFixedPitchFont(NSFont*)`

+ * set preference for fixed-pitch.

+ * *native declaration : :80* + */ + open fun setUserFixedPitchFont(aFont: NSFont?) + + /** + * UI font settings

+ * Original signature : `NSFont* systemFontOfSize(CGFloat)`

+ * Aqua System font

+ * *native declaration : :84* + */ + open fun systemFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* boldSystemFontOfSize(CGFloat)`

+ * Aqua System font (emphasized)

+ * *native declaration : :85* + */ + open fun boldSystemFontOfSize(fontSize: CGFloat?): NSFont? + + open fun monospacedDigitSystemFontOfSize_weight(fontSize: CGFloat?, fontWeight: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* labelFontOfSize(CGFloat)`

+ * Aqua label font

+ * *native declaration : :86* + */ + open fun labelFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* titleBarFontOfSize(CGFloat)`

+ * *native declaration : :88* + */ + open fun titleBarFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* menuFontOfSize(CGFloat)`

+ * *native declaration : :89* + */ + open fun menuFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* menuBarFontOfSize(CGFloat)`

+ * *native declaration : :91* + */ + open fun menuBarFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* messageFontOfSize(CGFloat)`

+ * *native declaration : :93* + */ + open fun messageFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* paletteFontOfSize(CGFloat)`

+ * *native declaration : :94* + */ + open fun paletteFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* toolTipsFontOfSize(CGFloat)`

+ * *native declaration : :95* + */ + open fun toolTipsFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * Original signature : `NSFont* controlContentFontOfSize(CGFloat)`

+ * *native declaration : :96* + */ + open fun controlContentFontOfSize(fontSize: CGFloat?): NSFont? + + /** + * UI font size settings

+ * Original signature : `CGFloat systemFontSize()`

+ * size of the standard System font.

+ * *native declaration : :100* + */ + open fun systemFontSize(): CGFloat + + /** + * Original signature : `CGFloat smallSystemFontSize()`

+ * size of standard small System font.

+ * *native declaration : :101* + */ + open fun smallSystemFontSize(): CGFloat + + /** + * Original signature : `CGFloat labelFontSize()`

+ * size of the standard Label Font.

+ * *native declaration : :102* + */ + open fun labelFontSize(): CGFloat + /** + * *native declaration : :105*

+ * Conversion Error : /// Original signature : `CGFloat systemFontSizeForControlSize(null)`

+ * + (CGFloat)systemFontSizeForControlSize:(null)controlSize; (Argument controlSize cannot be converted) + */ + /** + * Original signature : `void useFont(NSString*)`

+ * This is now automatically handled by Quartz.

+ * *from NSFontDeprecated native declaration : :211* + */ + open fun useFont(fontName: NSFont?) + + /** + * Original signature : `NSArray* preferredFontNames()`

+ * NSFontCascadeListAttribute offers more powerful font substitution management

+ * *from NSFontDeprecated native declaration : :217* + */ + open fun preferredFontNames(): NSArray? + + /** + * Original signature : `void setPreferredFontNames(NSArray*)`

+ * *from NSFontDeprecated native declaration : :218* + */ + open fun setPreferredFontNames(fontNameArray: String?) + } + + /** + * Core font attribute ********

+ * Original signature : `NSString* fontName()`

+ * *native declaration : :109* + */ + abstract fun fontName(): String? + + /** + * Original signature : `CGFloat pointSize()`

+ * *native declaration : :110* + */ + abstract fun pointSize(): CGFloat? + + /** + * Original signature : `const CGFloat* matrix()`

+ * *native declaration : :111* + */ + abstract fun matrix(): com.sun.jna.ptr.FloatByReference? + + /** + * Original signature : `NSString* familyName()`

+ * *native declaration : :112* + */ + abstract fun familyName(): String? + + /** + * Original signature : `NSString* displayName()`

+ * *native declaration : :113* + */ + abstract fun displayName(): String? + + /** + * Original signature : `NSFontDescriptor* fontDescriptor()`

+ * *native declaration : :115* + */ + abstract fun fontDescriptor(): com.sun.jna.Pointer? + + /** + * Original signature : `NSAffineTransform* textTransform()`

+ * *native declaration : :118* + */ + abstract fun textTransform(): com.sun.jna.Pointer? + + /** + * Glyph coverage ********

+ * Original signature : `NSUInteger numberOfGlyphs()`

+ * *native declaration : :122* + */ + abstract fun numberOfGlyphs(): NSUInteger? + + /** + * Original signature : `mostCompatibleStringEncoding()`

+ * *native declaration : :123* + */ + abstract fun mostCompatibleStringEncoding(): com.sun.jna.Pointer? + + /** + * Original signature : `NSGlyph glyphWithName(NSString*)`

+ * *native declaration : :124* + */ + abstract fun glyphWithName(aName: String?): Int + + /** + * Original signature : `NSCharacterSet* coveredCharacterSet()`

+ * *native declaration : :126* + */ + abstract fun coveredCharacterSet(): com.sun.jna.Pointer? + + /** + * These methods return scaled numbers. If the font was created with a matrix, the matrix is applied automatically; otherwise the coordinates are multiplied by size.

+ * Original signature : `boundingRectForFont()`

+ * *native declaration : :132* + */ + abstract fun boundingRectForFont(): com.sun.jna.Pointer? + + /** + * Original signature : `maximumAdvancement()`

+ * *native declaration : :133* + */ + abstract fun maximumAdvancement(): com.sun.jna.Pointer? + + /** + * Original signature : `CGFloat ascender()`

+ * *native declaration : :135* + */ + abstract fun ascender(): CGFloat? + + /** + * Original signature : `CGFloat descender()`

+ * *native declaration : :136* + */ + abstract fun descender(): CGFloat? + + /** + * Original signature : `CGFloat leading()`

+ * *native declaration : :138* + */ + abstract fun leading(): CGFloat? + + /** + * Original signature : `CGFloat underlinePosition()`

+ * *native declaration : :141* + */ + abstract fun underlinePosition(): CGFloat? + + /** + * Original signature : `CGFloat underlineThickness()`

+ * *native declaration : :142* + */ + abstract fun underlineThickness(): CGFloat? + + /** + * Original signature : `CGFloat italicAngle()`

+ * *native declaration : :143* + */ + abstract fun italicAngle(): CGFloat? + + /** + * Original signature : `CGFloat capHeight()`

+ * *native declaration : :144* + */ + abstract fun capHeight(): CGFloat? + + /** + * Original signature : `CGFloat xHeight()`

+ * *native declaration : :145* + */ + abstract fun xHeight(): CGFloat? + + /** + * Original signature : `BOOL isFixedPitch()`

+ * *native declaration : :146* + */ + abstract fun isFixedPitch(): Boolean + + /** + * Glyph metrics ********

+ * Original signature : `boundingRectForGlyph(NSGlyph)`

+ * *native declaration : :149* + */ + abstract fun boundingRectForGlyph(aGlyph: Int): com.sun.jna.Pointer? + + /** + * Original signature : `advancementForGlyph(NSGlyph)`

+ * *native declaration : :150* + */ + abstract fun advancementForGlyph(ag: Int): com.sun.jna.Pointer? + /** + * *native declaration : :154*

+ * Conversion Error : /// Original signature : `void getBoundingRects(null, const NSGlyph*, NSUInteger)`

+ * - (void)getBoundingRects:(null)bounds forGlyphs:(const NSGlyph*)glyphs count:(NSUInteger)glyphCount; (Argument bounds cannot be converted) + */ + /** + * *native declaration : :155*

+ * Conversion Error : /// Original signature : `void getAdvancements(null, const NSGlyph*, NSUInteger)`

+ * - (void)getAdvancements:(null)advancements forGlyphs:(const NSGlyph*)glyphs count:(NSUInteger)glyphCount; (Argument advancements cannot be converted) + */ + /** + * *native declaration : :156*

+ * Conversion Error : /// Original signature : `void getAdvancements(null, const void*, NSUInteger)`

+ * - (void)getAdvancements:(null)advancements forPackedGlyphs:(const void*)packedGlyphs length:(NSUInteger)length; // only supports NSNativeShortGlyphPacking

+ * (Argument advancements cannot be converted) + */ + /** + * NSGraphicsContext-related ********

+ * Original signature : `void set()`

+ * *native declaration : :160* + */ + abstract fun set() + + /** + * Original signature : `void setInContext(NSGraphicsContext*)`

+ * *native declaration : :162* + */ + abstract fun setInContext(graphicsContext: com.sun.jna.Pointer?) + + /** + * Rendering mode ********

+ * Original signature : `NSFont* printerFont()`

+ * *native declaration : :166* + */ + abstract fun printerFont(): NSFont? + + /** + * Original signature : `NSFont* screenFont()`

+ * Same as screenFontWithRenderingMode:NSFontDefaultRenderingMode

+ * *native declaration : :167* + */ + abstract fun screenFont(): NSFont? + + /** + * Original signature : `NSFont* screenFontWithRenderingMode(NSFontRenderingMode)`

+ * *native declaration : :169* + */ + abstract fun screenFontWithRenderingMode(renderingMode: Int): NSFont? + + /** + * Original signature : `NSFontRenderingMode renderingMode()`

+ * *native declaration : :170* + */ + abstract fun renderingMode(): Int + + /** + * Original signature : `CGFloat widthOfString(NSString*)`

+ * This API never returns correct value. Use NSStringDrawing API instead.

+ * *from NSFontDeprecated native declaration : :212* + */ + abstract fun widthOfString(string: com.sun.jna.Pointer?): CGFloat? + + /** + * Original signature : `BOOL isBaseFont()`

+ * *from NSFontDeprecated native declaration : :213* + */ + abstract fun isBaseFont(): Boolean + + /** + * Original signature : `NSDictionary* afmDictionary()`

+ * *from NSFontDeprecated native declaration : :214* + */ + abstract fun afmDictionary(): NSDictionary? + + /** + * Original signature : `BOOL glyphIsEncoded(NSGlyph)`

+ * Can be deduced by aGlyph < [NSFont numberOfGlyphs] since only NSNativeShortGlyphPacking is supported.

+ * *from NSFontDeprecated native declaration : :215* + */ + abstract fun glyphIsEncoded(aGlyph: Int): Boolean + + /** + * Original signature : `CGFloat defaultLineHeightForFont()`

+ * Use -[NSLayoutManager defaultLineHeightForFont:] instead.

+ * *from NSFontDeprecated native declaration : :216* + */ + abstract fun defaultLineHeightForFont(): CGFloat? + + /** + * Original signature : `NSString* encodingScheme()`

+ * *from NSFontDeprecated native declaration : :219* + */ + abstract fun encodingScheme(): String? + + /** + * Original signature : `NSMultibyteGlyphPacking glyphPacking()`

+ * *from NSFontDeprecated native declaration : :220* + */ + abstract fun glyphPacking(): Int + + /** + * The context-sensitive inter-glyph spacing is now performed at the typesetting stage.

+ * Original signature : `positionOfGlyph(NSGlyph, NSGlyph, BOOL*)`

+ * *from NSFontDeprecated native declaration : :223* + */ + abstract fun positionOfGlyph_precededByGlyph_isNominal( + curGlyph: Int, + prevGlyph: Int, + nominal: Boolean + ): com.sun.jna.Pointer? + /** + * *from NSFontDeprecated native declaration : :224*

+ * Conversion Error : /// Original signature : `NSInteger positionsForCompositeSequence(NSGlyph*, NSInteger, null)`

+ * - (NSInteger)positionsForCompositeSequence:(NSGlyph*)someGlyphs numberOfGlyphs:(NSInteger)numGlyphs pointArray:(null)points; (Argument points cannot be converted) + */ + /** + * Original signature : `positionOfGlyph(NSGlyph, NSGlyph, BOOL*)`

+ * *from NSFontDeprecated native declaration : :225* + */ + abstract fun positionOfGlyph_struckOverGlyph_metricsExist( + curGlyph: Int, + prevGlyph: Int, + exist: Boolean + ): com.sun.jna.Pointer? + /** + * *from NSFontDeprecated native declaration : :226*

+ * Conversion Error : /// Original signature : `positionOfGlyph(NSGlyph, null, BOOL*)`

+ * - (null)positionOfGlyph:(NSGlyph)aGlyph struckOverRect:(null)aRect metricsExist:(BOOL*)exist; (Argument aRect cannot be converted) + */ + /** + * *from NSFontDeprecated native declaration : :227*

+ * Conversion Error : /// Original signature : `positionOfGlyph(NSGlyph, unichar, null)`

+ * - (null)positionOfGlyph:(NSGlyph)aGlyph forCharacter:(unichar)aChar struckOverRect:(null)aRect; (Argument aRect cannot be converted) + */ + /** + * *from NSFontDeprecated native declaration : :228*

+ * Conversion Error : /// Original signature : `positionOfGlyph(NSGlyph, NSGlyphRelation, NSGlyph, null, BOOL*)`

+ * - (null)positionOfGlyph:(NSGlyph)thisGlyph withRelation:(NSGlyphRelation)rel toBaseGlyph:(NSGlyph)baseGlyph totalAdvancement:(null)adv metricsExist:(BOOL*)exist; (Argument adv cannot be converted) + */ + companion object { + private val CLASS: _Class = Rococoa.createClass("NSFont", _Class::class.java) + + const val NSFontWeightUltraLight: Double = -0.80 + const val NSFontWeightThin: Double = -0.60 + const val NSFontWeightLight: Double = -0.40 + const val NSFontWeightRegular: Double = 0.00 + const val NSFontWeightMedium: Double = 0.23 + const val NSFontWeightSemibold: Double = 0.30 + const val NSFontWeightBold: Double = 0.40 + const val NSFontWeightHeavy: Double = 0.56 + const val NSFontWeightBlack: Double = 0.62 + + /** + * User font settings

+ * Original signature : `NSFont* userFontOfSize(CGFloat)`

+ * Aqua Application font

+ * *native declaration : :77* + */ + fun userFontOfSize(fontSize: Double): NSFont? { + return CLASS.userFontOfSize(CGFloat(fontSize)) + } + + /** + * Original signature : `NSFont* userFixedPitchFontOfSize(CGFloat)`

+ * Aqua fixed-pitch font

+ * *native declaration : :78* + */ + fun userFixedPitchFontOfSize(fontSize: Double): NSFont? { + return CLASS.userFixedPitchFontOfSize(CGFloat(fontSize)) + } + + /** + * UI font settings

+ * Original signature : `NSFont* systemFontOfSize(CGFloat)`

+ * Aqua System font

+ * *native declaration : :84* + */ + fun systemFontOfSize(fontSize: Double): NSFont? { + return CLASS.systemFontOfSize(CGFloat(fontSize)) + } + + /** + * Original signature : `NSFont* boldSystemFontOfSize(CGFloat)`

+ * Aqua System font (emphasized)

+ * *native declaration : :85* + */ + fun boldSystemFontOfSize(fontSize: Double): NSFont? { + return CLASS.boldSystemFontOfSize(CGFloat(fontSize)) + } + + fun menuFontOfSize(fontSize: Double): NSFont? { + return CLASS.menuFontOfSize(CGFloat(fontSize)) + } + + fun monospacedDigitSystemFontOfSize(fontSize: Double): NSFont? { + if (Rococoa.cast(CLASS, NSObject::class.java).respondsToSelector( + Foundation.selector("monospacedDigitSystemFontOfSize:weight:") + ) + ) { + return CLASS.monospacedDigitSystemFontOfSize_weight(CGFloat(fontSize), CGFloat(NSFontWeightRegular)) + } + return systemFontOfSize(fontSize) + } + + fun smallSystemFontSize(): Double { + return CLASS.smallSystemFontSize().toDouble() + } + + fun systemFontSize(): Double { + return CLASS.systemFontSize().toDouble() + } + + fun labelFontSize(): Double { + return CLASS.labelFontSize().toDouble() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSFormatter.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSFormatter.kt new file mode 100644 index 00000000..e25a7a8b --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSFormatter.kt @@ -0,0 +1,46 @@ +package darwin + +import org.rococoa.ObjCObjectByReference + +abstract class NSFormatter : NSObject() { + /** + * *native declaration : :15*

+ * Conversion Error : /// Original signature : `NSString* stringForObjectValue(null)`

+ * - (NSString*)stringForObjectValue:(null)obj; (Argument obj cannot be converted) + */ + abstract fun stringForObjectValue(obj: NSObject?): String? + /** + * *native declaration : :17*

+ * Conversion Error : /// Original signature : `NSAttributedString* attributedStringForObjectValue(null, NSDictionary*)`

+ * - (NSAttributedString*)attributedStringForObjectValue:(null)obj withDefaultAttributes:(NSDictionary*)attrs; (Argument obj cannot be converted) + */ + /** + * *native declaration : :19*

+ * Conversion Error : /// Original signature : `NSString* editingStringForObjectValue(null)`

+ * - (NSString*)editingStringForObjectValue:(null)obj; (Argument obj cannot be converted) + */ + /** + * Original signature : `BOOL getObjectValue(id*, NSString*, NSString**)`

+ * *native declaration : :21* + */ + abstract fun getObjectValue_forString_errorDescription( + obj: NSObject?, + string: String?, + error: ObjCObjectByReference? + ): Boolean + + /** + * Original signature : `BOOL isPartialStringValid(NSString*, NSString**, NSString**)`

+ * *native declaration : :23* + */ + abstract fun isPartialStringValid_newEditingString_errorDescription( + partialString: String?, + newString: ObjCObjectByReference?, + error: ObjCObjectByReference? + ): Boolean + /** + * *native declaration : :26*

+ * Conversion Error : /// Original signature : `BOOL isPartialStringValid(NSString**, null, NSString*, null, NSString**)`

+ * - (BOOL)isPartialStringValid:(NSString**)partialStringPtr proposedSelectedRange:(null)proposedSelRangePtr originalString:(NSString*)origString originalSelectedRange:(null)origSelRange errorDescription:(NSString**)error; (Argument proposedSelRangePtr cannot be converted) + */ +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSGraphics.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSGraphics.kt new file mode 100644 index 00000000..5b4b3707 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSGraphics.kt @@ -0,0 +1,83 @@ +package darwin + +interface NSGraphics { + companion object { + /// native declaration : :17 + const val NSCompositeClear: Int = 0 + + /// native declaration : :18 + const val NSCompositeCopy: Int = 1 + + /// native declaration : :19 + const val NSCompositeSourceOver: Int = 2 + + /// native declaration : :20 + const val NSCompositeSourceIn: Int = 3 + + /// native declaration : :21 + const val NSCompositeSourceOut: Int = 4 + + /// native declaration : :22 + const val NSCompositeSourceAtop: Int = 5 + + /// native declaration : :23 + const val NSCompositeDestinationOver: Int = 6 + + /// native declaration : :24 + const val NSCompositeDestinationIn: Int = 7 + + /// native declaration : :25 + const val NSCompositeDestinationOut: Int = 8 + + /// native declaration : :26 + const val NSCompositeDestinationAtop: Int = 9 + + /// native declaration : :27 + const val NSCompositeXOR: Int = 10 + + /// native declaration : :28 + const val NSCompositePlusDarker: Int = 11 + + /// native declaration : :29 + const val NSCompositeHighlight: Int = 12 + + /// native declaration : :30 + const val NSCompositePlusLighter: Int = 13 + + /// native declaration : :36 + const val NSBackingStoreRetained: Int = 0 + + /// native declaration : :37 + const val NSBackingStoreNonretained: Int = 1 + + /// native declaration : :38 + const val NSBackingStoreBuffered: Int = 2 + + /// native declaration : :44 + const val NSWindowAbove: Int = 1 + + /// native declaration : :45 + const val NSWindowBelow: Int = -1 + + /// native declaration : :46 + const val NSWindowOut: Int = 0 + + /// native declaration : :52 + const val NSFocusRingOnly: Int = 0 + + /// native declaration : :53 + const val NSFocusRingBelow: Int = 1 + + /// native declaration : :54 + const val NSFocusRingAbove: Int = 2 + + /// native declaration : :61 + const val NSFocusRingTypeDefault: Int = 0 + + /// native declaration : :62 + const val NSFocusRingTypeNone: Int = 1 + + /// native declaration : :63 + const val NSFocusRingTypeExterior: Int = 2 + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSImage.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSImage.kt new file mode 100644 index 00000000..b7c990e0 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSImage.kt @@ -0,0 +1,460 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSRect +import org.rococoa.cocoa.foundation.NSSize + +/// native declaration : :41 +abstract class NSImage : NSObject(), NSCopying { + interface _Class : ObjCClass { + /** + * Original signature : `id imageNamed(NSString*)`

If this finds & creates the image, only name + * is saved when archived

+ * *native declaration : :73* + */ + open fun imageNamed(name: String?): NSImage? + + open fun imageWithSystemSymbolName_accessibilityDescription(symbolName: String?, description: String?): NSImage? + + /** + * These return union of all the types registered with NSImageRep.

Original signature : `NSArray* + * imageUnfilteredFileTypes()`

+ * *native declaration : :138* + */ + open fun imageUnfilteredFileTypes(): NSArray? + + /** + * Original signature : `NSArray* imageUnfilteredPasteboardTypes()`

+ * *native declaration : :139* + */ + open fun imageUnfilteredPasteboardTypes(): NSArray? + + /** + * Original signature : `NSArray* imageFileTypes()`

+ * *native declaration : :140* + */ + open fun imageFileTypes(): NSArray? + + /** + * Original signature : `NSArray* imagePasteboardTypes()`

+ * *native declaration : :141* + */ + open fun imagePasteboardTypes(): NSArray? + + /** + * Original signature : `NSArray* imageTypes()`

+ * *native declaration : :144* + */ + open fun imageTypes(): NSArray? + + /** + * Original signature : `NSArray* imageUnfilteredTypes()`

+ * *native declaration : :145* + */ + open fun imageUnfilteredTypes(): NSArray? + + /** + * Original signature : `BOOL canInitWithPasteboard(NSPasteboard*)`

+ * *native declaration : :148* + */ + open fun canInitWithPasteboard(pasteBoard: NSPasteboard?): Boolean + + open fun alloc(): NSImage + } + + /** + * *native declaration : :75*

+ */ + abstract fun initWithSize(aSize: NSSize?): NSImage? + + /** + * Original signature : `id initWithData(NSData*)`

When archived, saves contents

+ * *native declaration : :76* + */ + abstract fun initWithData(data: NSData?): NSImage? + + /** + * Original signature : `id initWithContentsOfFile(NSString*)`

When archived, saves contents

+ * *native declaration : :77* + */ + abstract fun initWithContentsOfFile(fileName: String?): NSImage? + + /** + * Original signature : `id initWithContentsOfURL(NSURL*)`

When archived, saves contents

+ * *native declaration : :78* + */ + abstract fun initWithContentsOfURL(url: NSURL?): NSImage? + + /** + * Original signature : `id initByReferencingFile(NSString*)`

When archived, saves fileName

+ * *native declaration : :79* + */ + abstract fun initByReferencingFile(fileName: String?): NSImage? + + /** + * Original signature : `id initByReferencingURL(NSURL*)`

When archived, saves url, supports + * progressive loading

+ * *native declaration : :81* + */ + abstract fun initByReferencingURL(url: NSURL?): NSImage? + + /** + * Original signature : `id initWithPasteboard(NSPasteboard*)`

+ * *native declaration : :86* + */ + abstract fun initWithPasteboard(pasteboard: NSPasteboard?): NSImage? + + /** + * @return Copy of original image + */ + abstract fun copy(): NSImage? + + /** + * *native declaration : :88*

+ */ + abstract fun setSize(aSize: NSSize?) + + /** + * *native declaration : :89*

+ */ + abstract fun size(): NSSize? + + /** + * Original signature : `BOOL setName(NSString*)`

+ * *native declaration : :90* + */ + abstract fun setName(string: String?): Boolean + + /** + * Original signature : `NSString* name()`

+ * *native declaration : :91* + */ + abstract fun name(): String? + + /** + * Original signature : `void setScalesWhenResized(BOOL)`

+ * *native declaration : :92* + */ + abstract fun setScalesWhenResized(flag: Boolean) + + /** + * Original signature : `BOOL scalesWhenResized()`

+ * *native declaration : :93* + */ + abstract fun scalesWhenResized(): Boolean + + /** + * Original signature : `void setDataRetained(BOOL)`

+ * *native declaration : :94* + */ + abstract fun setDataRetained(flag: Boolean) + + /** + * Original signature : `BOOL isDataRetained()`

+ * *native declaration : :95* + */ + abstract fun isDataRetained(): Boolean + + /** + * Original signature : `void setCachedSeparately(BOOL)`

+ * *native declaration : :96* + */ + abstract fun setCachedSeparately(flag: Boolean) + + /** + * Original signature : `BOOL isCachedSeparately()`

+ * *native declaration : :97* + */ + abstract fun isCachedSeparately(): Boolean + + /** + * Original signature : `void setCacheDepthMatchesImageDepth(BOOL)`

+ * *native declaration : :98* + */ + abstract fun setCacheDepthMatchesImageDepth(flag: Boolean) + + /** + * Original signature : `BOOL cacheDepthMatchesImageDepth()`

+ * *native declaration : :99* + */ + abstract fun cacheDepthMatchesImageDepth(): Boolean + + /** + * Original signature : `public abstract void setBackgroundColor(NSColor*)`

+ * *native declaration : :100* + */ + abstract fun setBackgroundColor(aColor: NSColor?) + + /** + * Original signature : `NSColor* backgroundColor()`

+ * *native declaration : :101* + */ + abstract fun backgroundColor(): NSColor? + + /** + * Original signature : `public abstract void setUsesEPSOnResolutionMismatch(BOOL)`

+ * *native declaration : :102* + */ + abstract fun setUsesEPSOnResolutionMismatch(flag: Boolean) + + /** + * Original signature : `BOOL usesEPSOnResolutionMismatch()`

+ * *native declaration : :103* + */ + abstract fun usesEPSOnResolutionMismatch(): Boolean + + /** + * Original signature : `public abstract void setPrefersColorMatch(BOOL)`

+ * *native declaration : :104* + */ + abstract fun setPrefersColorMatch(flag: Boolean) + + /** + * Original signature : `BOOL prefersColorMatch()`

+ * *native declaration : :105* + */ + abstract fun prefersColorMatch(): Boolean + + /** + * Original signature : `public abstract void setMatchesOnMultipleResolution(BOOL)`

+ * *native declaration : :106* + */ + abstract fun setMatchesOnMultipleResolution(flag: Boolean) + + /** + * Original signature : `BOOL matchesOnMultipleResolution()`

+ * *native declaration : :107* + */ + abstract fun matchesOnMultipleResolution(): Boolean + + /** + * *native declaration : :115*

+ * Conversion Error : /// Original signature : `public abstract void drawInRect(null, null, null, + * CGFloat)`

- (void)drawInRect:(null)rect fromRect:(null)fromRect operation:(null)op + * fraction:(CGFloat)delta; (Argument rect cannot be converted) + */ + abstract fun drawInRect_fromRect_operation_fraction( + rect: NSRect?, + fromRect: NSRect?, + operation: Int, + delta: CGFloat? + ) + + fun drawInRect(rect: NSRect?, fromRect: NSRect?, operation: Int, delta: Double) { + this.drawInRect_fromRect_operation_fraction(rect, fromRect, operation, CGFloat(delta)) + } + + /** + * Original signature : `public abstract void recache()`

+ * *native declaration : :117* + */ + abstract fun recache() + + /** + * Original signature : `NSData* TIFFRepresentation()`

+ * *native declaration : :118* + */ + abstract fun TIFFRepresentation(): NSData? + + /** + * Original signature : `NSArray* representations()`

+ * *native declaration : :121* + */ + abstract fun representations(): NSArray? + + /** + * Original signature : `public abstract void addRepresentations(NSArray*)`

+ * *native declaration : :122* + */ + abstract fun addRepresentations(imageReps: NSArray?) + + /** + * Original signature : `public abstract void addRepresentation(NSImageRep*)`

+ * *native declaration : :123* + */ + abstract fun addRepresentation(imageRep: com.sun.jna.Pointer?) + + /** + * Original signature : `public abstract void removeRepresentation(NSImageRep*)`

+ * *native declaration : :124* + */ + abstract fun removeRepresentation(imageRep: com.sun.jna.Pointer?) + + /** + * Original signature : `BOOL isValid()`

+ * *native declaration : :126* + */ + abstract fun isValid(): Boolean + + /** + * Original signature : `public abstract void lockFocus()`

+ * *native declaration : :127* + */ + abstract fun lockFocus() + + /** + * Original signature : `public abstract void lockFocusOnRepresentation(NSImageRep*)`

+ * *native declaration : :128* + */ + abstract fun lockFocusOnRepresentation(imageRepresentation: com.sun.jna.Pointer?) + + /** + * Original signature : `public abstract void unlockFocus()`

+ * *native declaration : :129* + */ + abstract fun unlockFocus() + + /** + * Original signature : `NSImageRep* bestRepresentationForDevice(NSDictionary*)`

+ * *native declaration : :131* + */ + abstract fun bestRepresentationForDevice(deviceDescription: NSDictionary?): com.sun.jna.Pointer? + + /** + * Original signature : `public abstract void setDelegate(id)`

+ * *native declaration : :133* + */ + abstract fun setDelegate(anObject: org.rococoa.ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :134* + */ + abstract fun delegate(): org.rococoa.ID? + + /** + * Original signature : `public abstract void setFlipped(BOOL)`

+ * *native declaration : :150* + */ + abstract fun setFlipped(flag: Boolean) + + /** + * Original signature : `BOOL isFlipped()`

+ * *native declaration : :151* + */ + abstract fun isFlipped(): Boolean + + /** + * Original signature : `public abstract void cancelIncrementalLoad()`

+ * *native declaration : :154* + */ + abstract fun cancelIncrementalLoad() + + /** + * Original signature : `public abstract void setCacheMode(NSImageCacheMode)`

+ * *native declaration : :156* + */ + abstract fun setCacheMode(mode: Int) + + /** + * Original signature : `NSImageCacheMode cacheMode()`

+ * *native declaration : :157* + */ + abstract fun cacheMode(): Int + + /** + * The alignmentRect of an image is metadata that a client may use to help determine layout. The bottom of the rect + * gives the baseline of the image. The other edges give similar information in other directions.

A 20x20 image + * of a phone icon with a glow might specify an alignmentRect of {{2,2},{16,16}} that excludes the glow. + * NSButtonCell can take advantage of the alignmentRect to place the image in the same visual location as an 16x16 + * phone icon without the glow. A 5x5 star that should render high when aligned with text might specify a rect of + * {{0,-7},{5,12}}.

The alignmentRect of an image has no effect on methods such as + * drawInRect:fromRect:operation:Fraction: or drawAtPoint:fromRect:operation:fraction:. It is the client's + * responsibility to take the alignmentRect into account where applicable.

The default alignmentRect of an image + * is {{0,0},imageSize}. The rect is adjusted when setSize: is called.

Original signature : + * `alignmentRect()`

+ * *native declaration : :169* + */ + abstract fun alignmentRect(): NSObject? + + /** + * The 'template' property is metadata that allows clients to be smarter about image processing. An image should be + * marked as a template if it is basic glpyh-like black and white art that is intended to be processed into derived + * images for use on screen.

NSButtonCell applies effects to images based on the state of the button. For + * example, images are shaded darker when the button is pressed. If a template image is set on a cell, the cell can + * apply more sophisticated effects. For example, it may be processed into an image that looks engraved when drawn + * into a cell whose interiorBackgroundStyle is NSBackgroundStyleRaised, like on a textured button.

Original + * signature : `BOOL isTemplate()`

+ * *native declaration : :176* + */ + abstract fun isTemplate(): Boolean + + /** + * Original signature : `public abstract void setTemplate(BOOL)`

+ * *native declaration : :177* + */ + abstract fun setTemplate(isTemplate: Boolean) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSImage", _Class::class.java) + + /// native declaration : :13 + const val NSImageLoadStatusCompleted: Int = 0 + + /// native declaration : :14 + const val NSImageLoadStatusCancelled: Int = 1 + + /// native declaration : :15 + const val NSImageLoadStatusInvalidData: Int = 2 + + /// native declaration : :16 + const val NSImageLoadStatusUnexpectedEOF: Int = 3 + + /// native declaration : :17 + const val NSImageLoadStatusReadError: Int = 4 + + /** + * unspecified. use image rep's default

+ * *native declaration : :22* + */ + const val NSImageCacheDefault: Int = 0 + + /** + * always generate a cache when drawing

+ * *native declaration : :23* + */ + const val NSImageCacheAlways: Int = 1 + + /** + * cache if cache size is smaller than original data

+ * *native declaration : :24* + */ + const val NSImageCacheBySize: Int = 2 + + /** + * never cache, always draw direct

+ * *native declaration : :25* + */ + const val NSImageCacheNever: Int = 3 + + fun imageNamed(name: String?): NSImage? { + return CLASS.imageNamed(name) + } + + /** + * Creates a symbol image with the system symbol name and accessibility description you specify. + * + * + * macOS 11.0+ + * + * @param symbolName The name of the system symbol image. + * @return A symbol image based on the name you specify; otherwise nil if the method couldn’t find a suitable image. + */ + fun imageWithSymbol(symbolName: String?): NSImage? { + return CLASS.imageWithSystemSymbolName_accessibilityDescription(symbolName, null) + } + + fun imageWithData(data: NSData?): NSImage? { + return CLASS.alloc().initWithData(data) + } + + fun imageWithSize(size: NSSize?): NSImage? { + return CLASS.alloc().initWithSize(size) + } + + fun imageWithContentsOfFile(filename: String?): NSImage? { + return CLASS.alloc().initWithContentsOfFile(filename) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSImageCell.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSImageCell.kt new file mode 100644 index 00000000..1ec514e3 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSImageCell.kt @@ -0,0 +1,55 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSUInteger + +abstract class NSImageCell : NSCell(), NSCopying { + interface _Class : ObjCClass { + open fun alloc(): NSImageCell + } + + abstract fun init(): NSImageCell? + + /** + * Original signature : `NSImageAlignment imageAlignment()`

+ * *native declaration : :51* + */ + abstract fun imageAlignment(): NSUInteger? + + /** + * Original signature : `void setImageAlignment(NSImageAlignment)`

+ * *native declaration : :52* + */ + abstract fun setImageAlignment(newAlign: NSUInteger?) + + /** + * Original signature : `imageScaling()`

+ * *native declaration : :53* + */ + abstract fun imageScaling(): NSUInteger? + /** + * *native declaration : :54*

+ * Conversion Error : /// Original signature : `void setImageScaling(null)`

+ * - (void)setImageScaling:(null)newScaling; (Argument newScaling cannot be converted) + */ + /** + * Original signature : `NSImageFrameStyle imageFrameStyle()`

+ * *native declaration : :55* + */ + abstract fun imageFrameStyle(): NSUInteger? + + /** + * Original signature : `void setImageFrameStyle(NSImageFrameStyle)`

+ * *native declaration : :56* + */ + abstract fun setImageFrameStyle(newStyle: NSUInteger?) + + companion object { + val CLASS: _Class = org.rococoa.Rococoa.createClass("NSImageCell", _Class::class.java) + + fun imageCell(): NSImageCell? { + return CLASS.alloc().init() + } + } +} + diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSImageView.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSImageView.kt new file mode 100644 index 00000000..81bec51e --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSImageView.kt @@ -0,0 +1,83 @@ +package darwin + +import org.rococoa.cocoa.foundation.NSUInteger + +abstract class NSImageView : NSObject() { + /** + * Original signature : `NSImage* image()`

+ * *native declaration : :26* + */ + abstract fun image(): NSImage? + + /** + * Original signature : `void setImage(NSImage*)`

+ * *native declaration : :27* + */ + abstract fun setImage(newImage: NSImage?) + + /** + * Original signature : `imageAlignment()`

+ * *native declaration : :29* + */ + abstract fun imageAlignment(): NSUInteger? + /** + * *native declaration : :30*

+ * Conversion Error : /// Original signature : `void setImageAlignment(null)`

+ * - (void)setImageAlignment:(null)newAlign; (Argument newAlign cannot be converted) + */ + /** + * Original signature : `imageScaling()`

+ * *native declaration : :31* + */ + abstract fun imageScaling(): NSUInteger? + /** + * *native declaration : :32*

+ * Conversion Error : /// Original signature : `void setImageScaling(null)`

+ * - (void)setImageScaling:(null)newScaling; (Argument newScaling cannot be converted) + */ + /** + * Original signature : `imageFrameStyle()`

+ * *native declaration : :33* + */ + abstract fun imageFrameStyle(): NSUInteger? + /** + * *native declaration : :34*

+ * Conversion Error : /// Original signature : `void setImageFrameStyle(null)`

+ * - (void)setImageFrameStyle:(null)newStyle; (Argument newStyle cannot be converted) + */ + /** + * Original signature : `void setEditable(BOOL)`

+ * *native declaration : :35* + */ + abstract fun setEditable(editable: Boolean) + + /** + * Original signature : `BOOL isEditable()`

+ * *native declaration : :36* + */ + abstract fun isEditable(): Boolean + + /** + * Original signature : `void setAnimates(BOOL)`

+ * *native declaration : :39* + */ + abstract fun setAnimates(flag: Boolean) + + /** + * Original signature : `BOOL animates()`

+ * *native declaration : :40* + */ + abstract fun animates(): Boolean + + /** + * Original signature : `BOOL allowsCutCopyPaste()`

+ * *native declaration : :44* + */ + abstract fun allowsCutCopyPaste(): Boolean + + /** + * Original signature : `void setAllowsCutCopyPaste(BOOL)`

+ * *native declaration : :45* + */ + abstract fun setAllowsCutCopyPaste(allow: Boolean) +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSIndexSet.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSIndexSet.kt new file mode 100644 index 00000000..92f27607 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSIndexSet.kt @@ -0,0 +1,158 @@ +package darwin + +import com.sun.jna.Native +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :28 +abstract class NSIndexSet : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `indexSet()`

+ * *native declaration : :30* + */ + open fun indexSet(): NSIndexSet? + + /** + * Original signature : `indexSetWithIndex(NSUInteger)`

+ * *native declaration : :31* + */ + open fun indexSetWithIndex(value: NSInteger?): NSIndexSet? + + /** + * *native declaration : :32*

+ * Conversion Error : /// Original signature : `indexSetWithIndexesInRange(null)`

+ * + (null)indexSetWithIndexesInRange:(null)range; (Argument range cannot be converted) + */ + open fun indexSetWithIndexesInRange(range: NSRange?): NSIndexSet? + } + + /** + * Original signature : `init()`

+ * *native declaration : :34* + */ + abstract fun init(): NSIndexSet? + + /** + * Original signature : `initWithIndex(NSUInteger)`

+ * *native declaration : :35* + */ + abstract fun initWithIndex(value: NSUInteger?): NSIndexSet? + /** + * *native declaration : :36*

+ * Conversion Error : /// Original signature : `initWithIndexesInRange(null)`

+ * - (null)initWithIndexesInRange:(null)range; // designated initializer

+ * (Argument range cannot be converted) + */ + /** + * Original signature : `initWithIndexSet(NSIndexSet*)`

+ * designated initializer

+ * *native declaration : :37* + */ + abstract fun initWithIndexSet(indexSet: NSIndexSet?): NSIndexSet? + + /** + * Original signature : `BOOL isEqualToIndexSet(NSIndexSet*)`

+ * *native declaration : :39* + */ + abstract fun isEqualToIndexSet(indexSet: NSIndexSet?): Boolean + + /** + * Original signature : `NSUInteger count()`

+ * *native declaration : :41* + */ + abstract fun count(): NSUInteger? + + /** + * The following six methods will return NSNotFound if there is no index in the set satisfying the query.

+ * Original signature : `NSUInteger firstIndex()`

+ * *native declaration : :45* + */ + abstract fun firstIndex(): NSUInteger? + + /** + * Original signature : `NSUInteger lastIndex()`

+ * *native declaration : :46* + */ + abstract fun lastIndex(): NSUInteger? + + /** + * Original signature : `NSUInteger indexGreaterThanIndex(NSUInteger)`

+ * *native declaration : :47* + */ + abstract fun indexGreaterThanIndex(value: NSUInteger?): NSUInteger? + + /** + * Original signature : `NSUInteger indexLessThanIndex(NSUInteger)`

+ * *native declaration : :48* + */ + abstract fun indexLessThanIndex(value: NSUInteger?): NSUInteger? + + /** + * Original signature : `NSUInteger indexGreaterThanOrEqualToIndex(NSUInteger)`

+ * *native declaration : :49* + */ + abstract fun indexGreaterThanOrEqualToIndex(value: NSUInteger?): NSUInteger? + + /** + * Original signature : `NSUInteger indexLessThanOrEqualToIndex(NSUInteger)`

+ * *native declaration : :50* + */ + abstract fun indexLessThanOrEqualToIndex(value: NSUInteger?): NSUInteger? + /** + * *native declaration : :54*

+ * Conversion Error : / **

+ * * Fills up to bufferSize indexes in the specified range into the buffer and returns the number of indexes actually placed in the buffer; also modifies the optional range passed in by pointer to be "positioned" after the last index filled into the buffer.Example: if the index set contains the indexes 0, 2, 4, ..., 98, 100, for a buffer of size 10 and the range (20, 80) the buffer would contain 20, 22, ..., 38 and the range would be modified to (40, 60).

+ * * Original signature : `NSUInteger getIndexes(NSUInteger*, NSUInteger, null)`

+ * * /

+ * - (NSUInteger)getIndexes:(NSUInteger*)indexBuffer maxCount:(NSUInteger)bufferSize inIndexRange:(null)range; (Argument range cannot be converted) + */ + /** + * *native declaration : :57*

+ * Conversion Error : /// Original signature : `NSUInteger countOfIndexesInRange(null)`

+ * - (NSUInteger)countOfIndexesInRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `BOOL containsIndex(NSUInteger)`

+ * *native declaration : :60* + */ + abstract fun containsIndex(value: NSUInteger?): Boolean + /** + * *native declaration : :61*

+ * Conversion Error : /// Original signature : `BOOL containsIndexesInRange(null)`

+ * - (BOOL)containsIndexesInRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `BOOL containsIndexes(NSIndexSet*)`

+ * *native declaration : :62* + */ + abstract fun containsIndexes(indexSet: NSIndexSet?): Boolean + + /** + * *native declaration : :64*

+ * Conversion Error : /// Original signature : `BOOL intersectsIndexesInRange(null)`

+ * - (BOOL)intersectsIndexesInRange:(null)range; (Argument range cannot be converted) + */ + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSIndexSet", _Class::class.java) + + fun indexSet(): NSIndexSet? { + return CLASS.indexSet() + } + + fun indexSetWithIndex(value: NSInteger?): NSIndexSet? { + return CLASS.indexSetWithIndex(value) + } + + fun indexSetWithIndexesInRange(range: NSRange?): NSIndexSet? { + return CLASS.indexSetWithIndexesInRange(range) + } + + /** + * NSNotFound is set to LONG_MAX in NSObjCRuntime.h, which has different values on 32-bit and 64-bit + */ + val NSNotFound: NSUInteger = + if (Native.LONG_SIZE === 4) NSUInteger(Integer.MAX_VALUE.toLong()) else NSUInteger(Long.MAX_VALUE) + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSLayoutManager.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSLayoutManager.kt new file mode 100644 index 00000000..6c8d47b0 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSLayoutManager.kt @@ -0,0 +1,765 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat +import java.nio.FloatBuffer +import java.nio.IntBuffer + +/// native declaration : :71 +abstract class NSLayoutManager : NSObject() { + interface Delegate { + open fun layoutManager_didCompleteLayoutForTextContainer_atEnd( + layoutManager: NSLayoutManager?, + textContainer: NSObject?, + finished: Boolean + ) + } + + interface _Class : ObjCClass { + open fun alloc(): NSLayoutManager + } + + /** + * Original signature : `id init()`

+ * *native declaration : :179* + */ + abstract fun init(): NSLayoutManager? + + /** + * Original signature : `NSTextStorage* textStorage()`

+ * *native declaration : :184* + */ + abstract fun textStorage(): NSTextStorage? + + /** + * Original signature : `void setTextStorage(NSTextStorage*)`

+ * *native declaration : :185* + */ + abstract fun setTextStorage(textStorage: NSTextStorage?) + + /** + * Original signature : `NSAttributedString* attributedString()`

+ * *native declaration : :188* + */ + abstract fun attributedString(): NSAttributedString? + + /** + * Original signature : `void replaceTextStorage(NSTextStorage*)`

+ * *native declaration : :191* + */ + abstract fun replaceTextStorage(newTextStorage: NSTextStorage?) + + /** + * Original signature : `NSGlyphGenerator* glyphGenerator()`

+ * *native declaration : :195* + */ + abstract fun glyphGenerator(): com.sun.jna.Pointer? + + /** + * Original signature : `void setGlyphGenerator(NSGlyphGenerator*)`

+ * *native declaration : :196* + */ + abstract fun setGlyphGenerator(glyphGenerator: com.sun.jna.Pointer?) + + /** + * Original signature : `NSTypesetter* typesetter()`

+ * *native declaration : :200* + */ + abstract fun typesetter(): com.sun.jna.Pointer? + + /** + * Original signature : `void setTypesetter(NSTypesetter*)`

+ * *native declaration : :201* + */ + abstract fun setTypesetter(typesetter: com.sun.jna.Pointer?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :204* + */ + abstract fun delegate(): org.rococoa.ID? + + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : :205* + */ + abstract fun setDelegate(delegate: org.rococoa.ID?) + + /** + * Original signature : `NSArray* textContainers()`

+ * *native declaration : :210* + */ + abstract fun textContainers(): NSArray? + + /** + * Original signature : `void addTextContainer(NSTextContainer*)`

+ * *native declaration : :212* + */ + abstract fun addTextContainer(container: com.sun.jna.Pointer?) + + /** + * Add a container to the end of the array. Must invalidate layout of all glyphs after the previous last container (i.e., glyphs that were not previously laid out because they would not fit anywhere).

+ * Original signature : `void insertTextContainer(NSTextContainer*, NSUInteger)`

+ * *native declaration : :214* + */ + abstract fun insertTextContainer_atIndex(container: com.sun.jna.Pointer?, index: Int) + + /** + * Insert a container into the array before the container at index. Must invalidate layout of all glyphs in the containers from the one previously at index to the last container.

+ * Original signature : `void removeTextContainerAtIndex(NSUInteger)`

+ * *native declaration : :216* + */ + abstract fun removeTextContainerAtIndex(index: Int) + + /** + * Original signature : `void textContainerChangedGeometry(NSTextContainer*)`

+ * *native declaration : :219* + */ + abstract fun textContainerChangedGeometry(container: com.sun.jna.Pointer?) + + /** + * Original signature : `void textContainerChangedTextView(NSTextContainer*)`

+ * *native declaration : :222* + */ + abstract fun textContainerChangedTextView(container: com.sun.jna.Pointer?) + + /** + * Original signature : `void setBackgroundLayoutEnabled(BOOL)`

+ * *native declaration : :227* + */ + abstract fun setBackgroundLayoutEnabled(flag: Boolean) + + /** + * Original signature : `BOOL backgroundLayoutEnabled()`

+ * *native declaration : :228* + */ + abstract fun backgroundLayoutEnabled(): Boolean + + /** + * Original signature : `void setUsesScreenFonts(BOOL)`

+ * *native declaration : :231* + */ + abstract fun setUsesScreenFonts(flag: Boolean) + + /** + * Original signature : `BOOL usesScreenFonts()`

+ * *native declaration : :232* + */ + abstract fun usesScreenFonts(): Boolean + + /** + * Original signature : `void setShowsInvisibleCharacters(BOOL)`

+ * *native declaration : :235* + */ + abstract fun setShowsInvisibleCharacters(flag: Boolean) + + /** + * Original signature : `BOOL showsInvisibleCharacters()`

+ * *native declaration : :236* + */ + abstract fun showsInvisibleCharacters(): Boolean + + /** + * Original signature : `void setShowsControlCharacters(BOOL)`

+ * *native declaration : :239* + */ + abstract fun setShowsControlCharacters(flag: Boolean) + + /** + * Original signature : `BOOL showsControlCharacters()`

+ * *native declaration : :240* + */ + abstract fun showsControlCharacters(): Boolean + + /** + * Original signature : `void setHyphenationFactor(float)`

+ * *native declaration : :243* + */ + abstract fun setHyphenationFactor(factor: Float) + + /** + * Original signature : `float hyphenationFactor()`

+ * *native declaration : :244* + */ + abstract fun hyphenationFactor(): Float + /** + * *native declaration : :247*

+ * Conversion Error : /// Original signature : `void setDefaultAttachmentScaling(null)`

+ * - (void)setDefaultAttachmentScaling:(null)scaling; (Argument scaling cannot be converted) + */ + /** + * Original signature : `defaultAttachmentScaling()`

+ * *native declaration : :248* + */ + abstract fun defaultAttachmentScaling(): NSObject? + + /** + * Original signature : `void setTypesetterBehavior(NSTypesetterBehavior)`

+ * *native declaration : :252* + */ + abstract fun setTypesetterBehavior(theBehavior: Int) + + /** + * Original signature : `NSTypesetterBehavior typesetterBehavior()`

+ * *native declaration : :253* + */ + abstract fun typesetterBehavior(): Int + + /** + * Original signature : `NSUInteger layoutOptions()`

+ * *native declaration : :258* + */ + abstract fun layoutOptions(): Int + + /** + * Original signature : `void setAllowsNonContiguousLayout(BOOL)`

+ * *native declaration : :263* + */ + abstract fun setAllowsNonContiguousLayout(flag: Boolean) + + /** + * Original signature : `BOOL allowsNonContiguousLayout()`

+ * *native declaration : :264* + */ + abstract fun allowsNonContiguousLayout(): Boolean + + /** + * If YES, then the layout manager may perform glyph generation and layout for a given portion of the text, without having glyphs or layout for preceding portions. The default is NO. Turning this setting on will significantly alter which portions of the text will have glyph generation or layout performed when a given generation-causing method is invoked. It also gives significant performance benefits, especially for large documents.

+ * Original signature : `BOOL hasNonContiguousLayout()`

+ * *native declaration : :266* + */ + abstract fun hasNonContiguousLayout(): Boolean + /** + * *native declaration : :272*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :276*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :278*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :281*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :282*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :285*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :291*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :292*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :293*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :294*

+ * Conversion Error : NSRange + */ + /** + * Original signature : `void ensureLayoutForTextContainer(NSTextContainer*)`

+ * *native declaration : :295* + */ + abstract fun ensureLayoutForTextContainer(container: com.sun.jna.Pointer?) + /** + * *native declaration : :296*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `void insertGlyphs(const NSGlyph*, NSUInteger, NSUInteger, NSUInteger)`

+ * *native declaration : :305* + */ + abstract fun insertGlyphs_length_forStartingGlyphAtIndex_characterIndex( + glyphs: com.sun.jna.Pointer?, + length: Int, + glyphIndex: Int, + charIndex: Int + ) + /** + * *native declaration : :309*

+ * Conversion Error : NSGlyph + */ + /** + * *native declaration : :312*

+ * Conversion Error : NSGlyph + */ + /** + * *native declaration : :315*

+ * Conversion Error : NSRange + */ + /** + * Original signature : `void setCharacterIndex(NSUInteger, NSUInteger)`

+ * *native declaration : :318* + */ + abstract fun setCharacterIndex_forGlyphAtIndex(charIndex: Int, glyphIndex: Int) + + /** + * Original signature : `void setIntAttribute(NSInteger, NSInteger, NSUInteger)`

+ * *native declaration : :321* + */ + abstract fun setIntAttribute_value_forGlyphAtIndex(attributeTag: Int, `val`: Int, glyphIndex: Int) + /** + * *native declaration : :325*

+ * Conversion Error : NSRange + */ + /** + * Original signature : `NSUInteger numberOfGlyphs()`

+ * *native declaration : :331* + */ + abstract fun numberOfGlyphs(): Int + /** + * *native declaration : :334*

+ * Conversion Error : NSGlyph + */ + /** + * *native declaration : :335*

+ * Conversion Error : NSGlyph + */ + /** + * Original signature : `BOOL isValidGlyphIndex(NSUInteger)`

+ * *native declaration : :336* + */ + abstract fun isValidGlyphIndex(glyphIndex: Int): Boolean + + /** + * Original signature : `NSUInteger characterIndexForGlyphAtIndex(NSUInteger)`

+ * *native declaration : :340* + */ + abstract fun characterIndexForGlyphAtIndex(glyphIndex: Int): Int + + /** + * Original signature : `NSUInteger glyphIndexForCharacterAtIndex(NSUInteger)`

+ * *native declaration : :344* + */ + abstract fun glyphIndexForCharacterAtIndex(charIndex: Int): Int + + /** + * Original signature : `NSInteger intAttribute(NSInteger, NSUInteger)`

+ * *native declaration : :348* + */ + abstract fun intAttribute_forGlyphAtIndex(attributeTag: Int, glyphIndex: Int): Int + /** + * *native declaration : :351*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :353*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :357*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :364*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :367*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :370*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :373*

+ * Conversion Error : NSPoint + */ + /** + * *native declaration : :377*

+ * Conversion Error : /// Original signature : `void setLocations(null, NSUInteger*, NSUInteger, NSRange)`

+ * - (void)setLocations:(null)locations startingGlyphIndexes:(NSUInteger*)glyphIndexes count:(NSUInteger)count forGlyphRange:(NSRange)glyphRange; (Argument locations cannot be converted) + */ + /** + * Original signature : `void setNotShownAttribute(BOOL, NSUInteger)`

+ * *native declaration : :381* + */ + abstract fun setNotShownAttribute_forGlyphAtIndex(flag: Boolean, glyphIndex: Int) + + /** + * Original signature : `void setDrawsOutsideLineFragment(BOOL, NSUInteger)`

+ * *native declaration : :384* + */ + abstract fun setDrawsOutsideLineFragment_forGlyphAtIndex(flag: Boolean, glyphIndex: Int) + + /** + * *native declaration : :387*

+ * Conversion Error : /// Original signature : `void setAttachmentSize(null, NSRange)`

+ * - (void)setAttachmentSize:(null)attachmentSize forGlyphRange:(NSRange)glyphRange; (Argument attachmentSize cannot be converted) + */ + /** + * Original signature : `void getFirstUnlaidCharacterIndex(NSUInteger*, NSUInteger*)`

+ * *native declaration : :394* + */ + abstract fun getFirstUnlaidCharacterIndex_glyphIndex(charIndex: IntBuffer?, glyphIndex: IntBuffer?) + + /** + * Original signature : `NSUInteger firstUnlaidCharacterIndex()`

+ * *native declaration : :395* + */ + abstract fun firstUnlaidCharacterIndex(): Int + + /** + * Original signature : `NSUInteger firstUnlaidGlyphIndex()`

+ * *native declaration : :396* + */ + abstract fun firstUnlaidGlyphIndex(): Int + /** + * *native declaration : :402*

+ * Conversion Error : /// Original signature : `NSTextContainer* textContainerForGlyphAtIndex(NSUInteger, null)`

+ * - (NSTextContainer*)textContainerForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(null)effectiveGlyphRange; (Argument effectiveGlyphRange cannot be converted) + */ + /** + * *native declaration : :405*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :408*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :411*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :415*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :416*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :417*

+ * Conversion Error : /// Original signature : `NSTextContainer* textContainerForGlyphAtIndex(NSUInteger, null, BOOL)`

+ * - (NSTextContainer*)textContainerForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(null)effectiveGlyphRange withoutAdditionalLayout:(BOOL)flag; (Argument effectiveGlyphRange cannot be converted) + */ + /** + * *native declaration : :421*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :422*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `NSTextContainer* extraLineFragmentTextContainer()`

+ * *native declaration : :423* + */ + abstract fun extraLineFragmentTextContainer(): com.sun.jna.Pointer? + /** + * *native declaration : :426*

+ * Conversion Error : NSPoint + */ + /** + * Original signature : `BOOL notShownAttributeForGlyphAtIndex(NSUInteger)`

+ * *native declaration : :429* + */ + abstract fun notShownAttributeForGlyphAtIndex(glyphIndex: Int): Boolean + + /** + * Original signature : `BOOL drawsOutsideLineFragmentForGlyphAtIndex(NSUInteger)`

+ * *native declaration : :432* + */ + abstract fun drawsOutsideLineFragmentForGlyphAtIndex(glyphIndex: Int): Boolean + + /** + * Original signature : `attachmentSizeForGlyphAtIndex(NSUInteger)`

+ * *native declaration : :435* + */ + abstract fun attachmentSizeForGlyphAtIndex(glyphIndex: Int): NSObject? + + /** + * *native declaration : :441*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :442*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :443*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :444*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :446*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :447*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :455*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :458*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :463*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :466*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :469*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :470*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :474*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :477*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :478*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :481*

+ * Conversion Error : NSPoint + */ + /** + * *native declaration : :482*

+ * Conversion Error : NSPoint + */ + /** + * *native declaration : :483*

+ * Conversion Error : NSPoint + */ + /** + * Original signature : `NSUInteger getLineFragmentInsertionPointsForCharacterAtIndex(NSUInteger, BOOL, BOOL, CGFloat*, NSUInteger*)`

+ * *native declaration : :488* + */ + abstract fun getLineFragmentInsertionPointsForCharacterAtIndex_alternatePositions_inDisplayOrder_positions_characterIndexes( + charIndex: Int, + aFlag: Boolean, + dFlag: Boolean, + positions: FloatBuffer?, + charIndexes: IntBuffer? + ): Int + /** + * *native declaration : :494*

+ * Conversion Error : /// Original signature : `NSDictionary* temporaryAttributesAtCharacterIndex(NSUInteger, null)`

+ * - (NSDictionary*)temporaryAttributesAtCharacterIndex:(NSUInteger)charIndex effectiveRange:(null)effectiveCharRange; (Argument effectiveCharRange cannot be converted) + */ + /** + * *native declaration : :495*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :496*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :497*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :501*

+ * Conversion Error : /// Original signature : `id temporaryAttribute(NSString*, NSUInteger, null)`

+ * - (id)temporaryAttribute:(NSString*)attrName atCharacterIndex:(NSUInteger)location effectiveRange:(null)range; (Argument range cannot be converted) + */ + /** + * *native declaration : :502*

+ * Conversion Error : /// Original signature : `id temporaryAttribute(NSString*, NSUInteger, null, NSRange)`

+ * - (id)temporaryAttribute:(NSString*)attrName atCharacterIndex:(NSUInteger)location longestEffectiveRange:(null)range inRange:(NSRange)rangeLimit; (Argument range cannot be converted) + */ + /** + * *native declaration : :503*

+ * Conversion Error : /// Original signature : `NSDictionary* temporaryAttributesAtCharacterIndex(NSUInteger, null, NSRange)`

+ * - (NSDictionary*)temporaryAttributesAtCharacterIndex:(NSUInteger)location longestEffectiveRange:(null)range inRange:(NSRange)rangeLimit; (Argument range cannot be converted) + */ + /** + * *native declaration : :504*

+ * Conversion Error : NSRange + */ + /** + * Original signature : `NSFont* substituteFontForFont(NSFont*)`

+ * *native declaration : :510* + */ + abstract fun substituteFontForFont(originalFont: com.sun.jna.Pointer?): com.sun.jna.Pointer? + + /** + * Original signature : `CGFloat defaultLineHeightForFont(NSFont*)`

+ * *native declaration : :514* + */ + abstract fun defaultLineHeightForFont(theFont: NSFont?): CGFloat? + + /** + * Returns the default line height specified by the layout manager's typesetter behavior for the given font.

+ * Original signature : `CGFloat defaultBaselineOffsetForFont(NSFont*)`

+ * *native declaration : :516* + */ + abstract fun defaultBaselineOffsetForFont(theFont: NSFont?): CGFloat? + + /** + * Returns the default baseline offset specified by the layout manager's typesetter behavior for the given font.

+ * Original signature : `BOOL usesFontLeading()`

+ * *native declaration : :518* + */ + abstract fun usesFontLeading(): Boolean + + /** + * Original signature : `void setUsesFontLeading(BOOL)`

+ * *native declaration : :519* + */ + abstract fun setUsesFontLeading(flag: Boolean) + + /** + * Original signature : `NSArray* rulerMarkersForTextView(NSTextView*, NSParagraphStyle*, NSRulerView*)`

+ * *from NSTextViewSupport native declaration : :529* + */ + abstract fun rulerMarkersForTextView_paragraphStyle_ruler( + view: com.sun.jna.Pointer?, + style: com.sun.jna.Pointer?, + ruler: com.sun.jna.Pointer? + ): NSArray? + + /** + * Original signature : `NSView* rulerAccessoryViewForTextView(NSTextView*, NSParagraphStyle*, NSRulerView*, BOOL)`

+ * *from NSTextViewSupport native declaration : :530* + */ + abstract fun rulerAccessoryViewForTextView_paragraphStyle_ruler_enabled( + view: com.sun.jna.Pointer?, + style: com.sun.jna.Pointer?, + ruler: com.sun.jna.Pointer?, + isEnabled: Boolean + ): NSView? + + /** + * Original signature : `BOOL layoutManagerOwnsFirstResponderInWindow(NSWindow*)`

+ * *from NSTextViewSupport native declaration : :535* + */ + abstract fun layoutManagerOwnsFirstResponderInWindow(window: com.sun.jna.Pointer?): Boolean + + /** + * Original signature : `NSTextView* firstTextView()`

+ * *from NSTextViewSupport native declaration : :538* + */ + abstract fun firstTextView(): NSTextView? + + /** + * Original signature : `NSTextView* textViewForBeginningOfSelection()`

+ * *from NSTextViewSupport native declaration : :540* + */ + abstract fun textViewForBeginningOfSelection(): NSTextView? + /** + * *from NSTextViewSupport native declaration : :545*

+ * Conversion Error : NSRange + */ + /** + * *from NSTextViewSupport native declaration : :546*

+ * Conversion Error : NSRange + */ + /** + * *from NSTextViewSupport native declaration : :549*

+ * Conversion Error : NSRange + */ + /** + * *from NSTextViewSupport native declaration : :552*

+ * Conversion Error : NSRect + */ + /** + * *from NSTextViewSupport native declaration : :555*

+ * Conversion Error : NSRange + */ + /** + * *from NSTextViewSupport native declaration : :556*

+ * Conversion Error : NSRange + */ + /** + * *from NSTextViewSupport native declaration : :560*

+ * Conversion Error : NSRange + */ + /** + * *from NSTextViewSupport native declaration : :561*

+ * Conversion Error : NSRange + */ + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSLayoutManager", _Class::class.java) + + fun layoutManager(): NSLayoutManager? { + return CLASS.alloc().init() + } + + /// native declaration : :36 + const val NSGlyphAttributeSoft: Int = 0 + + /// native declaration : :37 + const val NSGlyphAttributeElastic: Int = 1 + + /// native declaration : :39 + const val NSGlyphAttributeBidiLevel: Int = 2 + + /// native declaration : :41 + const val NSGlyphAttributeInscribe: Int = 5 + + /// native declaration : :46 + const val NSGlyphInscribeBase: Int = 0 + + /// native declaration : :47 + const val NSGlyphInscribeBelow: Int = 1 + + /// native declaration : :48 + const val NSGlyphInscribeAbove: Int = 2 + + /// native declaration : :49 + const val NSGlyphInscribeOverstrike: Int = 3 + + /// native declaration : :50 + const val NSGlyphInscribeOverBelow: Int = 4 + + /// native declaration : :57 + const val NSTypesetterLatestBehavior: Int = -1 + + /** + * Mac OS X versions 10.0 and 10.1 (uses NSSimpleHorizontalTypesetter)

+ * *native declaration : :58* + */ + const val NSTypesetterOriginalBehavior: Int = 0 + + /** + * 10.2 with backward compatibility layout (uses new ATS-based typestter)

+ * *native declaration : :59* + */ + const val NSTypesetterBehavior_10_2_WithCompatibility: Int = 1 + + /// native declaration : :60 + const val NSTypesetterBehavior_10_2: Int = 2 + + /// native declaration : :61 + const val NSTypesetterBehavior_10_3: Int = 3 + + /// native declaration : :64 + const val NSTypesetterBehavior_10_4: Int = 4 + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSLevelIndicator.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSLevelIndicator.kt new file mode 100644 index 00000000..189a63fe --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSLevelIndicator.kt @@ -0,0 +1,53 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSRect + +abstract class NSLevelIndicator : NSControl() { + interface _Class : ObjCClass { + open fun alloc(): NSLevelIndicator + } + + abstract override fun initWithFrame(frameRect: NSRect?): NSLevelIndicator + + abstract fun minValue(): Int + + abstract fun setMinValue(minValue: Int) + + abstract fun maxValue(): Int + + abstract fun setMaxValue(maxValue: Int) + + abstract fun warningValue(): Int + + abstract fun setWarningValue(warningValue: Int) + + abstract fun criticalValue(): Int + + abstract fun setCriticalValue(criticalValue: Int) + + abstract fun tickMarkPosition(): Int + + abstract fun setTickMarkPosition(tickMarkPosition: Int) + + abstract fun numberOfTickMarks(): Int + + abstract fun setNumberOfTickMarks(numberOfTickMarks: Int) + + abstract fun levelIndicatorStyle(): Int + + abstract fun setLevelIndicatorStyle(levelIndicatorStyle: Int) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSLevelIndicator", _Class::class.java) + + const val NSRelevancyLevelIndicatorStyle: Int = 0 + const val NSContinuousCapacityLevelIndicatorStyle: Int = 1 + const val NSDiscreteCapacityLevelIndicatorStyle: Int = 2 + const val NSRatingLevelIndicatorStyle: Int = 3 + + fun levelIndicatorWithFrame(frameRect: NSRect?): NSLevelIndicator? { + return CLASS.alloc().initWithFrame(frameRect) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSLocale.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSLocale.kt new file mode 100644 index 00000000..623063a6 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSLocale.kt @@ -0,0 +1,220 @@ +package darwin + +import org.rococoa.ObjCClass + +abstract class NSLocale : NSObject() { + interface _Class : ObjCClass { + /// native declaration : NSLocale.h + open fun alloc(): NSLocale + + /** + * Original signature : `NSArray* availableLocaleIdentifiers()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:40* + */ + open fun availableLocaleIdentifiers(): NSArray? + + /** + * Original signature : `NSArray* ISOLanguageCodes()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:41* + */ + open fun ISOLanguageCodes(): NSArray? + + /** + * Original signature : `NSArray* ISOCountryCodes()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:42* + */ + open fun ISOCountryCodes(): NSArray? + + /** + * Original signature : `NSArray* ISOCurrencyCodes()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:43* + */ + open fun ISOCurrencyCodes(): NSArray? + + /** + * Original signature : `NSArray* commonISOCurrencyCodes()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:44* + */ + open fun commonISOCurrencyCodes(): NSArray? + + /** + * Original signature : `NSArray* preferredLanguages()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:45* + */ + open fun preferredLanguages(): NSArray? + + /** + * Original signature : `NSDictionary* componentsFromLocaleIdentifier(NSString*)`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:47* + */ + open fun componentsFromLocaleIdentifier(string: String?): NSDictionary? + + /** + * Original signature : `NSString* localeIdentifierFromComponents(NSDictionary*)`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:48* + */ + open fun localeIdentifierFromComponents(dict: NSDictionary?): String? + + /** + * Original signature : `NSString* canonicalLocaleIdentifierFromString(NSString*)`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:50* + */ + open fun canonicalLocaleIdentifierFromString(string: String?): String? + + /** + * Original signature : `systemLocale()`

+ * From category NSLocale

+ * *from NSLocaleCreation native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:30* + */ + open fun systemLocale(): NSLocale? + + /** + * Original signature : `currentLocale()`

+ * From category NSLocale

+ * *from NSLocaleCreation native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:31* + */ + open fun currentLocale(): NSLocale? + } + + /** + * Original signature : `initWithLocaleIdentifier(NSString*)`

+ * From category NSLocale

+ * *from NSLocaleCreation native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:34* + */ + abstract fun initWithLocaleIdentifier(string: String?): NSLocale? + + /** + * Original signature : `NSString* localeIdentifier()`

+ * From category NSLocale

+ * same as NSLocaleIdentifier

+ * *from NSExtendedLocale native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:24* + */ + abstract fun localeIdentifier(): String? + + /** + * Original signature : `-(NSString*)displayNameForKey:(id) value:(id)`

+ * *native declaration : NSLocale.h:19* + */ + abstract fun displayNameForKey_value(key: String?, value: String?): String? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSLocale", _Class::class.java) + + /** + * Original signature : `NSArray* availableLocaleIdentifiers()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:40* + */ + fun availableLocaleIdentifiers(): NSArray? { + return CLASS.availableLocaleIdentifiers() + } + + /** + * Original signature : `NSArray* ISOLanguageCodes()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:41* + */ + fun ISOLanguageCodes(): NSArray? { + return CLASS.ISOLanguageCodes() + } + + /** + * Original signature : `NSArray* ISOCountryCodes()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:42* + */ + fun ISOCountryCodes(): NSArray? { + return CLASS.ISOCountryCodes() + } + + /** + * Original signature : `NSArray* ISOCurrencyCodes()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:43* + */ + fun ISOCurrencyCodes(): NSArray? { + return CLASS.ISOCurrencyCodes() + } + + /** + * Original signature : `NSArray* commonISOCurrencyCodes()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:44* + */ + fun commonISOCurrencyCodes(): NSArray? { + return CLASS.commonISOCurrencyCodes() + } + + /** + * Original signature : `NSArray* preferredLanguages()`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:45* + */ + fun preferredLanguages(): NSArray? { + return CLASS.preferredLanguages() + } + + /** + * Original signature : `NSDictionary* componentsFromLocaleIdentifier(NSString*)`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:47* + */ + fun componentsFromLocaleIdentifier(string: String?): NSDictionary? { + return CLASS.componentsFromLocaleIdentifier(string) + } + + /** + * Original signature : `NSString* localeIdentifierFromComponents(NSDictionary*)`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:48* + */ + fun localeIdentifierFromComponents(dict: NSDictionary?): String? { + return CLASS.localeIdentifierFromComponents(dict) + } + + /** + * Original signature : `NSString* canonicalLocaleIdentifierFromString(NSString*)`

+ * From category NSLocale

+ * *from NSLocaleGeneralInfo native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:50* + */ + fun canonicalLocaleIdentifierFromString(string: String?): String? { + return CLASS.canonicalLocaleIdentifierFromString(string) + } + + /** + * Original signature : `systemLocale()`

+ * From category NSLocale

+ * *from NSLocaleCreation native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:30* + */ + fun systemLocale(): NSLocale? { + return CLASS.systemLocale() + } + + /** + * Original signature : `currentLocale()`

+ * From category NSLocale

+ * *from NSLocaleCreation native declaration : /System/Library/Frameworks/framework/Headers/NSLocale.h:31* + */ + fun currentLocale(): NSLocale? { + return CLASS.currentLocale() + } + + /** + * Factory method

+ * + * @see .initWithLocaleIdentifier + */ + fun createWithLocaleIdentifier(string: String?): NSLocale? { + return CLASS.alloc().initWithLocaleIdentifier(string) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMenu.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMenu.kt new file mode 100644 index 00000000..eaab20a9 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMenu.kt @@ -0,0 +1,398 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Selector +import org.rococoa.cocoa.foundation.NSInteger + +abstract class NSMenu : NSObject(), NSCopying { + interface _Class : ObjCClass { + /** + * Original signature : `void popUpContextMenu(NSMenu*, NSEvent*, NSView*)`

+ * *native declaration : :44* + */ + open fun popUpContextMenu_withEvent_forView(menu: NSMenu?, event: NSEvent?, view: NSView?) + + /** + * Original signature : `void popUpContextMenu(NSMenu*, NSEvent*, NSView*, NSFont*)`

+ * *native declaration : :46* + */ + open fun popUpContextMenu_withEvent_forView_withFont( + menu: NSMenu?, + event: NSEvent?, + view: NSView?, + font: NSFont? + ) + + /** + * Original signature : `void setMenuBarVisible(BOOL)`

+ * *native declaration : :50* + */ + open fun setMenuBarVisible(visible: Boolean) + + /** + * Original signature : `BOOL menuBarVisible()`

+ * *native declaration : :51* + */ + open fun menuBarVisible(): Boolean + + open fun alloc(): NSMenu + } + + interface Validation { + open fun validateMenuItem(item: NSMenuItem?): Boolean + } + + interface Delegate { + /** + * @param menu + * @return If you return a positive value, the menu is resized by either removing or adding items. + * Newly created items are blank. After the menu is resized, your menu:updateItem:atIndex:shouldCancel: method + * is called for each item. If you return a negative value, the number of items is left unchanged + * and menu:updateItem:atIndex:shouldCancel: is not called. If you can populate the menu quickly, + * you can implement menuNeedsUpdate: instead of numberOfItemsInMenu: and menu:updateItem:atIndex:shouldCancel:. + */ + open fun numberOfItemsInMenu(menu: NSMenu?): NSInteger? + + open fun menu_updateItem_atIndex_shouldCancel( + menu: NSMenu?, + item: NSMenuItem?, + index: NSInteger?, + shouldCancel: Boolean + ): Boolean + } + + abstract fun init(): NSMenu? + + /** + * Original signature : `id initWithTitle(NSString*)`

+ * *native declaration : :54* + */ + abstract fun initWithTitle(aTitle: String?): NSMenu? + + /** + * Original signature : `void setTitle(NSString*)`

+ * *native declaration : :56* + */ + abstract fun setTitle(aString: String?) + + /** + * Original signature : `NSString* title()`

+ * *native declaration : :57* + */ + abstract fun title(): String? + + /** + * Original signature : `void setSupermenu(NSMenu*)`

+ * *native declaration : :59* + */ + abstract fun setSupermenu(supermenu: NSMenu?) + + /** + * Original signature : `NSMenu* supermenu()`

+ * *native declaration : :60* + */ + abstract fun supermenu(): NSMenu? + + /** + * Original signature : `void insertItem(NSMenuItem*, NSInteger)`

+ * *native declaration : :63* + */ + abstract fun insertItem_atIndex(newItem: NSMenuItem?, index: NSInteger?) + + /** + * Original signature : `void addItem(NSMenuItem*)`

+ * *native declaration : :64* + */ + abstract fun addItem(newItem: NSMenuItem?) + + /** + * *native declaration : :65*

+ * Conversion Error : /// Original signature : `NSMenuItem* insertItemWithTitle(NSString*, null, NSString*, NSInteger)`

+ * - (NSMenuItem*)insertItemWithTitle:(NSString*)aString action:(null)aSelector keyEquivalent:(NSString*)charCode atIndex:(NSInteger)index; (Argument aSelector cannot be converted) + */ + abstract fun insertItemWithTitle_action_keyEquivalent_atIndex( + title: String?, + action: Selector?, + charCode: String?, + index: NSInteger? + ): NSMenuItem? + + /** + * *native declaration : :66*

+ * Conversion Error : /// Original signature : `NSMenuItem* addItemWithTitle(NSString*, null, NSString*)`

+ * - (NSMenuItem*)addItemWithTitle:(NSString*)aString action:(null)aSelector keyEquivalent:(NSString*)charCode; (Argument aSelector cannot be converted) + */ + abstract fun addItemWithTitle_action_keyEquivalent( + title: String?, + action: Selector?, + charCode: String? + ): NSMenuItem? + + /** + * Original signature : `void removeItemAtIndex(NSInteger)`

+ * *native declaration : :67* + */ + abstract fun removeItemAtIndex(index: NSInteger?) + + /** + * Original signature : `void removeItem(NSMenuItem*)`

+ * *native declaration : :68* + */ + abstract fun removeItem(item: NSMenuItem?) + + abstract fun removeAllItems() + + /** + * Original signature : `void setSubmenu(NSMenu*, NSMenuItem*)`

+ * *native declaration : :69* + */ + abstract fun setSubmenu_forItem(aMenu: NSMenu?, anItem: NSMenuItem?) + + /** + * Original signature : `NSArray* itemArray()`

+ * *native declaration : :71* + */ + abstract fun itemArray(): NSArray? + + /** + * Original signature : `NSInteger numberOfItems()`

+ * *native declaration : :72* + */ + abstract fun numberOfItems(): NSInteger? + + /** + * Original signature : `NSInteger indexOfItem(NSMenuItem*)`

+ * *native declaration : :74* + */ + abstract fun indexOfItem(index: NSMenuItem?): NSInteger? + + /** + * Original signature : `NSInteger indexOfItemWithTitle(NSString*)`

+ * *native declaration : :75* + */ + abstract fun indexOfItemWithTitle(aTitle: String?): NSInteger? + + /** + * Original signature : `NSInteger indexOfItemWithTag(NSInteger)`

+ * *native declaration : :76* + */ + abstract fun indexOfItemWithTag(aTag: NSInteger?): NSInteger? + + /** + * Original signature : `NSInteger indexOfItemWithRepresentedObject(id)`

+ * *native declaration : :77* + */ + abstract fun indexOfItemWithRepresentedObject(`object`: String?): NSInteger? + + /** + * Original signature : `NSInteger indexOfItemWithSubmenu(NSMenu*)`

+ * *native declaration : :78* + */ + abstract fun indexOfItemWithSubmenu(submenu: NSMenu?): NSInteger? + /** + * *native declaration : :79*

+ * Conversion Error : /// Original signature : `NSInteger indexOfItemWithTarget(id, null)`

+ * - (NSInteger)indexOfItemWithTarget:(id)target andAction:(null)actionSelector; (Argument actionSelector cannot be converted) + */ + /** + * Original signature : `NSMenuItem* itemAtIndex(NSInteger)`

+ * *native declaration : :81* + */ + abstract fun itemAtIndex(index: NSInteger?): NSMenuItem? + + /** + * Original signature : `NSMenuItem* itemWithTitle(NSString*)`

+ * *native declaration : :82* + */ + abstract fun itemWithTitle(aTitle: String?): NSMenuItem? + + /** + * Original signature : `NSMenuItem* itemWithTag(NSInteger)`

+ * *native declaration : :83* + */ + abstract fun itemWithTag(tag: NSInteger?): NSMenuItem? + + /** + * Original signature : `void setAutoenablesItems(BOOL)`

+ * *native declaration : :85* + */ + abstract fun setAutoenablesItems(flag: Boolean) + + /** + * Original signature : `BOOL autoenablesItems()`

+ * *native declaration : :86* + */ + abstract fun autoenablesItems(): Boolean + + /** + * Original signature : `BOOL performKeyEquivalent(NSEvent*)`

+ * *native declaration : :88* + */ + abstract fun performKeyEquivalent(event: NSEvent?): Boolean + + /** + * Original signature : `void update()`

+ * *native declaration : :89* + */ + abstract fun update() + + /** + * Original signature : `void setMenuChangedMessagesEnabled(BOOL)`

+ * *native declaration : :91* + */ + abstract fun setMenuChangedMessagesEnabled(flag: Boolean) + + /** + * Original signature : `BOOL menuChangedMessagesEnabled()`

+ * *native declaration : :92* + */ + abstract fun menuChangedMessagesEnabled(): Boolean + + /** + * Original signature : `void itemChanged(NSMenuItem*)`

+ * *native declaration : :94* + */ + abstract fun itemChanged(item: NSMenuItem?) + + /** + * Original signature : `void helpRequested(NSEvent*)`

+ * *native declaration : :96* + */ + abstract fun helpRequested(eventPtr: NSEvent?) + + /** + * Original signature : `void setMenuRepresentation(id)`

+ * *native declaration : :98* + */ + abstract fun setMenuRepresentation(menuRep: ID?) + + /** + * Original signature : `id menuRepresentation()`

+ * *native declaration : :99* + */ + abstract fun menuRepresentation(): ID? + + /** + * Original signature : `void setContextMenuRepresentation(id)`

+ * *native declaration : :101* + */ + abstract fun setContextMenuRepresentation(menuRep: ID?) + + /** + * Original signature : `id contextMenuRepresentation()`

+ * *native declaration : :102* + */ + abstract fun contextMenuRepresentation(): ID? + + /** + * Original signature : `void setTearOffMenuRepresentation(id)`

+ * *native declaration : :104* + */ + abstract fun setTearOffMenuRepresentation(menuRep: ID?) + + /** + * Original signature : `id tearOffMenuRepresentation()`

+ * *native declaration : :105* + */ + abstract fun tearOffMenuRepresentation(): ID? + + /** + * Original signature : `BOOL isTornOff()`

+ * *native declaration : :107* + */ + abstract fun isTornOff(): Boolean + + /** + * These methods are platform specific. They really make little sense on Windows. Their use is discouraged.

+ * Original signature : `NSMenu* attachedMenu()`

+ * *native declaration : :110* + */ + abstract fun attachedMenu(): NSMenu? + + /** + * Original signature : `BOOL isAttached()`

+ * *native declaration : :111* + */ + abstract fun isAttached(): Boolean + + /** + * Original signature : `void sizeToFit()`

+ * *native declaration : :112* + */ + abstract fun sizeToFit() + + /** + * Original signature : `locationForSubmenu(NSMenu*)`

+ * *native declaration : :113* + */ + abstract fun locationForSubmenu(aSubmenu: NSMenu?): NSObject? + + /** + * Original signature : `void performActionForItemAtIndex(NSInteger)`

+ * *native declaration : :115* + */ + abstract fun performActionForItemAtIndex(index: NSInteger?) + + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : :118* + */ + abstract fun setDelegate(anObject: ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :119* + */ + abstract fun delegate(): ID? + + /** + * Original signature : `CGFloat menuBarHeight()`

+ * *native declaration : :123* + */ + abstract fun menuBarHeight(): Float + + /** + * Dismisses the menu and ends all menu tracking

+ * Original signature : `void cancelTracking()`

+ * *native declaration : :128* + */ + abstract fun cancelTracking() + + /** + * Returns the highlighted item in the menu, or nil if no item in the menu is highlighted

+ * Original signature : `NSMenuItem* highlightedItem()`

+ * *native declaration : :131* + */ + abstract fun highlightedItem(): NSMenuItem? + + /** + * Original signature : `void setShowsStateColumn(BOOL)`

+ * *native declaration : :133* + */ + abstract fun setShowsStateColumn(showsState: Boolean) + + /** + * Original signature : `BOOL showsStateColumn()`

+ * *native declaration : :134* + */ + abstract fun showsStateColumn(): Boolean + + /** + * Original signature : `void submenuAction(id)`

+ * *from NSSubmenuAction native declaration : :140* + */ + abstract fun submenuAction(sender: ID?) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSMenu", _Class::class.java) + + fun menu(): NSMenu? { + return CLASS.alloc().init() + } + + fun menuWithTitle(title: String?): NSMenu? { + return CLASS.alloc().initWithTitle(title) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMenuItem.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMenuItem.kt new file mode 100644 index 00000000..85797892 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMenuItem.kt @@ -0,0 +1,357 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.Selector + +/// native declaration : :14 +abstract class NSMenuItem : NSObject(), NSCopying, NSValidatedUserInterfaceItem { + interface _Class : ObjCClass { + /** + * Original signature : `void setUsesUserKeyEquivalents(BOOL)`

+ * *native declaration : :44* + */ + open fun setUsesUserKeyEquivalents(flag: Boolean) + + /** + * Original signature : `BOOL usesUserKeyEquivalents()`

+ * *native declaration : :45* + */ + open fun usesUserKeyEquivalents(): Boolean + + /** + * Original signature : `NSMenuItem* separatorItem()`

+ * *native declaration : :47* + */ + open fun separatorItem(): NSMenuItem? + + open fun alloc(): NSMenuItem + } + + /** + * Original signature : `id initWithTitle(NSString*, SEL, NSString*)`

+ * *native declaration : :49* + */ + abstract fun initWithTitle_action_keyEquivalent( + aString: String?, + aSelector: Selector?, + charCode: String? + ): NSMenuItem? + + /** + * Original signature : `void setMenu(NSMenu*)`

+ * *native declaration : :51* + */ + abstract fun setMenu(menu: NSMenu?) + + /** + * Original signature : `NSMenu* menu()`

+ * *native declaration : :52* + */ + abstract fun menu(): NSMenu? + + /** + * Original signature : `BOOL hasSubmenu()`

+ * *native declaration : :56* + */ + abstract fun hasSubmenu(): Boolean + + /** + * Original signature : `void setSubmenu(NSMenu*)`

+ * *native declaration : :57* + */ + abstract fun setSubmenu(submenu: NSMenu?) + + /** + * Original signature : `NSMenu* submenu()`

+ * *native declaration : :58* + */ + abstract fun submenu(): NSMenu? + + /** + * Original signature : `void setTitle(NSString*)`

+ * *native declaration : :60* + */ + abstract fun setTitle(aString: String?) + + /** + * Original signature : `NSString* title()`

+ * *native declaration : :61* + */ + abstract fun title(): String? + + /** + * Original signature : `void setAttributedTitle(NSAttributedString*)`

+ * *native declaration : :63* + */ + abstract fun setAttributedTitle(string: NSAttributedString?) + + /** + * Original signature : `NSAttributedString* attributedTitle()`

+ * *native declaration : :64* + */ + abstract fun attributedTitle(): NSAttributedString? + + /** + * Original signature : `BOOL isSeparatorItem()`

+ * *native declaration : :67* + */ + abstract fun isSeparatorItem(): Boolean + + /** + * Original signature : `void setKeyEquivalent(NSString*)`

+ * *native declaration : :69* + */ + abstract fun setKeyEquivalent(aKeyEquivalent: String?) + + /** + * Original signature : `NSString* keyEquivalent()`

+ * *native declaration : :70* + */ + abstract fun keyEquivalent(): String? + + /** + * Original signature : `void setKeyEquivalentModifierMask(NSUInteger)`

+ * *native declaration : :71* + */ + abstract fun setKeyEquivalentModifierMask(mask: Int) + + /** + * Original signature : `NSUInteger keyEquivalentModifierMask()`

+ * *native declaration : :72* + */ + abstract fun keyEquivalentModifierMask(): Int + + /** + * Original signature : `NSString* userKeyEquivalent()`

+ * *native declaration : :74* + */ + abstract fun userKeyEquivalent(): String? + + /** + * Original signature : `void setMnemonicLocation(NSUInteger)`

+ * *native declaration : :76* + */ + abstract fun setMnemonicLocation(location: Int) + + /** + * Original signature : `NSUInteger mnemonicLocation()`

+ * *native declaration : :77* + */ + abstract fun mnemonicLocation(): Int + + /** + * Original signature : `NSString* mnemonic()`

+ * *native declaration : :78* + */ + abstract fun mnemonic(): String? + + /** + * Original signature : `void setTitleWithMnemonic(NSString*)`

+ * *native declaration : :79* + */ + abstract fun setTitleWithMnemonic(stringWithAmpersand: String?) + + /** + * Original signature : `void setImage(NSImage*)`

+ * *native declaration : :81* + */ + abstract fun setImage(menuImage: NSImage?) + + /** + * Original signature : `NSImage* image()`

+ * *native declaration : :82* + */ + abstract fun image(): NSImage? + + /** + * Original signature : `void setState(NSInteger)`

+ * *native declaration : :84* + */ + abstract fun setState(state: Int) + + /** + * Original signature : `NSInteger state()`

+ * *native declaration : :85* + */ + abstract fun state(): Int + + /** + * Original signature : `void setOnStateImage(NSImage*)`

+ * checkmark by default

+ * *native declaration : :86* + */ + abstract fun setOnStateImage(image: NSImage?) + + /** + * Original signature : `NSImage* onStateImage()`

+ * *native declaration : :87* + */ + abstract fun onStateImage(): NSImage? + + /** + * Original signature : `void setOffStateImage(NSImage*)`

+ * none by default

+ * *native declaration : :88* + */ + abstract fun setOffStateImage(image: NSImage?) + + /** + * Original signature : `NSImage* offStateImage()`

+ * *native declaration : :89* + */ + abstract fun offStateImage(): NSImage? + + /** + * Original signature : `void setMixedStateImage(NSImage*)`

+ * horizontal line by default?

+ * *native declaration : :90* + */ + abstract fun setMixedStateImage(image: NSImage?) + + /** + * Original signature : `NSImage* mixedStateImage()`

+ * *native declaration : :91* + */ + abstract fun mixedStateImage(): NSImage? + + /** + * Original signature : `void setEnabled(BOOL)`

+ * *native declaration : :93* + */ + abstract fun setEnabled(flag: Boolean) + + /** + * Original signature : `BOOL isEnabled()`

+ * *native declaration : :94* + */ + abstract fun isEnabled(): Boolean + + /** + * Original signature : `void setAlternate(BOOL)`

+ * *native declaration : :98* + */ + abstract fun setAlternate(isAlternate: Boolean) + + /** + * Original signature : `BOOL isAlternate()`

+ * *native declaration : :99* + */ + abstract fun isAlternate(): Boolean + + /** + * Original signature : `void setIndentationLevel(NSInteger)`

+ * *native declaration : :101* + */ + abstract fun setIndentationLevel(indentationLevel: Int) + + /** + * Original signature : `NSInteger indentationLevel()`

+ * *native declaration : :102* + */ + abstract fun indentationLevel(): Int + + /** + * Original signature : `void setTarget(id)`

+ * *native declaration : :105* + */ + abstract fun setTarget(anObject: org.rococoa.ID?) + + /** + * Original signature : `id target()`

+ * *native declaration : :106* + */ + abstract fun target(): org.rococoa.ID? + + /** + * Original signature : `void setAction(SEL)`

+ * *native declaration : :107* + */ + abstract fun setAction(aSelector: Selector?) + + /** + * Original signature : `void setTag(NSInteger)`

+ * *native declaration : :110* + */ + abstract fun setTag(anInt: Int) + + /** + * Original signature : `void setRepresentedObject(id)`

+ * *native declaration : :113* + */ + abstract fun setRepresentedObject(anObject: String?) + + /** + * Original signature : `id representedObject()`

+ * *native declaration : :114* + */ + abstract fun representedObject(): String? + + /** + * Set (and get) the view for a menu item. By default, a menu item has a nil view.

+ * A menu item with a view does not draw its title, state, font, or other standard drawing attributes, and assigns drawing responsibility entirely to the view. Keyboard equivalents and type-select continue to use the key equivalent and title as normal.

+ * A menu item with a view sizes itself according to the view's frame, and the width of the other menu items. The menu item will always be at least as wide as its view, but it may be wider. If you want your view to auto-expand to fill the menu item, then make sure that its autoresizing mask has NSViewWidthSizable set; in that case, the view's width at the time setView: is called will be treated as the minimum width for the view. A menu will resize itself as its containing views change frame size. Changes to the view's frame during tracking are reflected immediately in the menu.

+ * A view in a menu item will receive mouse and keyboard events normally. During non-sticky menu tracking (manipulating menus with the mouse button held down), a view in a menu item will receive mouseDragged: events.

+ * Animation is possible via the usual mechanism (set a timer to call setNeedsDisplay: or display), but because menu tracking occurs in the NSEventTrackingRunLoopMode, you must add the timer to the run loop in that mode.

+ * When the menu is opened, the view is added to a window; when the menu is closed the view is removed from the window. Override viewDidMoveToWindow in your view for a convenient place to start/stop animations, reset tracking rects, etc., but do not attempt to move or otherwise modify the window.

+ * When a menu item is copied via NSCopying, any attached view is copied via archiving/unarchiving. Menu item views are not supported in the Dock menu.

+ * Original signature : `void setView(NSView*)`

+ * *native declaration : :124* + */ + abstract fun setView(view: NSView?) + + /** + * Original signature : `NSView* view()`

+ * *native declaration : :125* + */ + abstract fun view(): NSView? + + /** + * Indicates whether the menu item should be drawn highlighted or not.

+ * Original signature : `BOOL isHighlighted()`

+ * *native declaration : :128* + */ + abstract fun isHighlighted(): Boolean + + /** + * Set (and get) the visibility of a menu item. Hidden menu items (or items with a hidden superitem) do not appear in a menu and do not participate in command key matching. isHiddenOrHasHiddenAncestor returns YES if the item is hidden or any of its superitems are hidden.

+ * Original signature : `void setHidden(BOOL)`

+ * *native declaration : :131* + */ + abstract fun setHidden(hidden: Boolean) + + /** + * Original signature : `BOOL isHidden()`

+ * *native declaration : :132* + */ + abstract fun isHidden(): Boolean + + /** + * Original signature : `BOOL isHiddenOrHasHiddenAncestor()`

+ * *native declaration : :133* + */ + abstract fun isHiddenOrHasHiddenAncestor(): Boolean + + /** + * Original signature : `void setToolTip(NSString*)`

+ * *native declaration : :138* + */ + abstract fun setToolTip(toolTip: String?) + + /** + * Original signature : `NSString* toolTip()`

+ * *native declaration : :139* + */ + abstract fun toolTip(): String? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSMenuItem", _Class::class.java) + + fun separatorItem(): NSMenuItem? { + return CLASS.separatorItem() + } + + fun itemWithTitle(title: String?, selector: Selector?, charCode: String?): NSMenuItem? { + return CLASS.alloc().initWithTitle_action_keyEquivalent(title, selector, charCode) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableArray.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableArray.kt new file mode 100644 index 00000000..66e0f416 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableArray.kt @@ -0,0 +1,167 @@ +package darwin + +import com.sun.jna.PointerType +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSUInteger +import java.nio.IntBuffer + +/// native declaration : :80 +abstract class NSMutableArray : NSArray() { + interface _Class : ObjCClass { + /** + * Original signature : `id arrayWithCapacity(NSUInteger)`

+ * *from NSMutableArrayCreation native declaration : :118* + */ + open fun arrayWithCapacity(numItems: NSUInteger?): NSMutableArray? + + open fun array(): NSMutableArray? + } + + /** + * Original signature : `void addObject(id)`

+ * *native declaration : :82* + */ + abstract fun addObject(anObject: NSObject?) + + abstract fun addObject(pointerType: PointerType?) + + abstract fun addObject(anObject: String?) + + /** + * Original signature : `void insertObject(id, NSUInteger)`

+ * *native declaration : :83* + */ + abstract fun insertObject_atIndex(anObject: PointerType?, index: NSUInteger?) + + abstract fun insertObject_atIndex(anObject: NSObject?, index: NSUInteger?) + + abstract fun insertObject_atIndex(anObject: String?, index: NSUInteger?) + + /** + * Original signature : `void removeLastObject()`

+ * *native declaration : :84* + */ + abstract fun removeLastObject() + + /** + * Original signature : `void removeObjectAtIndex(NSUInteger)`

+ * *native declaration : :85* + */ + abstract fun removeObjectAtIndex(index: NSUInteger?) + + /** + * Original signature : `void replaceObjectAtIndex(NSUInteger, id)`

+ * *native declaration : :86* + */ + abstract fun replaceObjectAtIndex_withObject(index: NSUInteger?, anObject: NSObject?) + + /** + * Original signature : `void addObjectsFromArray(NSArray*)`

+ * *from NSExtendedMutableArray native declaration : :92* + */ + abstract fun addObjectsFromArray(otherArray: NSArray?) + + /** + * Original signature : `void exchangeObjectAtIndex(NSUInteger, NSUInteger)`

+ * *from NSExtendedMutableArray native declaration : :93* + */ + abstract fun exchangeObjectAtIndex_withObjectAtIndex(idx1: NSUInteger?, idx2: NSUInteger?) + + /** + * Original signature : `void removeAllObjects()`

+ * *from NSExtendedMutableArray native declaration : :94* + */ + abstract fun removeAllObjects() + /** + * *from NSExtendedMutableArray native declaration : :95*

+ * Conversion Error : /// Original signature : `void removeObject(id, null)`

+ * - (void)removeObject:(id)anObject inRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `void removeObject(id)`

+ * *from NSExtendedMutableArray native declaration : :96* + */ + abstract fun removeObject(anObject: NSObject?) + /** + * *from NSExtendedMutableArray native declaration : :97*

+ * Conversion Error : /// Original signature : `void removeObjectIdenticalTo(id, null)`

+ * - (void)removeObjectIdenticalTo:(id)anObject inRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `void removeObjectIdenticalTo(id)`

+ * *from NSExtendedMutableArray native declaration : :98* + */ + abstract fun removeObjectIdenticalTo(anObject: NSObject?) + + /** + * Original signature : `void removeObjectsFromIndices(NSUInteger*, NSUInteger)`

+ * *from NSExtendedMutableArray native declaration : :99* + */ + abstract fun removeObjectsFromIndices_numIndices(indices: IntBuffer?, cnt: NSUInteger?) + + /** + * Original signature : `void removeObjectsInArray(NSArray*)`

+ * *from NSExtendedMutableArray native declaration : :100* + */ + abstract fun removeObjectsInArray(otherArray: NSArray?) + /** + * *from NSExtendedMutableArray native declaration : :101*

+ * Conversion Error : /// Original signature : `void removeObjectsInRange(null)`

+ * - (void)removeObjectsInRange:(null)range; (Argument range cannot be converted) + */ + /** + * *from NSExtendedMutableArray native declaration : :102*

+ * Conversion Error : /// Original signature : `void replaceObjectsInRange(null, NSArray*, null)`

+ * - (void)replaceObjectsInRange:(null)range withObjectsFromArray:(NSArray*)otherArray range:(null)otherRange; (Argument range cannot be converted) + */ + /** + * *from NSExtendedMutableArray native declaration : :103*

+ * Conversion Error : /// Original signature : `void replaceObjectsInRange(null, NSArray*)`

+ * - (void)replaceObjectsInRange:(null)range withObjectsFromArray:(NSArray*)otherArray; (Argument range cannot be converted) + */ + /** + * Original signature : `void setArray(NSArray*)`

+ * *from NSExtendedMutableArray native declaration : :104* + */ + abstract fun setArray(otherArray: NSArray?) + /** + * *from NSExtendedMutableArray native declaration : :106*

+ * Conversion Error : /// Original signature : `void sortUsingSelector(null)`

+ * - (void)sortUsingSelector:(null)comparator; (Argument comparator cannot be converted) + */ + /** + * Original signature : `void insertObjects(NSArray*, NSIndexSet*)`

+ * *from NSExtendedMutableArray native declaration : :109* + */ + abstract fun insertObjects_atIndexes(objects: NSArray?, indexes: com.sun.jna.Pointer?) + + /** + * Original signature : `void removeObjectsAtIndexes(NSIndexSet*)`

+ * *from NSExtendedMutableArray native declaration : :110* + */ + abstract fun removeObjectsAtIndexes(indexes: com.sun.jna.Pointer?) + + /** + * Original signature : `void replaceObjectsAtIndexes(NSIndexSet*, NSArray*)`

+ * *from NSExtendedMutableArray native declaration : :111* + */ + abstract fun replaceObjectsAtIndexes_withObjects(indexes: com.sun.jna.Pointer?, objects: NSArray?) + + /** + * Original signature : `id initWithCapacity(NSUInteger)`

+ * *from NSMutableArrayCreation native declaration : :119* + */ + abstract fun initWithCapacity(numItems: NSUInteger?): NSMutableArray? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSMutableArray", _Class::class.java) + + fun array(): NSMutableArray? { + return CLASS.array() + } + + fun arrayWithCapacity(numItems: NSUInteger?): NSMutableArray? { + return CLASS.arrayWithCapacity(numItems) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableAttributedString.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableAttributedString.kt new file mode 100644 index 00000000..76c62b07 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableAttributedString.kt @@ -0,0 +1,138 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.cocoa.foundation.NSUInteger + +abstract class NSMutableAttributedString : NSAttributedString() { + interface _Class : ObjCClass { + open fun alloc(): NSMutableAttributedString + } + + /** + * *native declaration : :32*

+ * Conversion Error : /// Original signature : `void replaceCharactersInRange(null, NSString*)`

+ * - (void)replaceCharactersInRange:(null)range withString:(NSString*)str; (Argument range cannot be converted) + */ + abstract fun replaceCharactersInRange_withString(range: NSRange?, str: String?) + + fun replaceCharactersInRange(range: NSRange?, attrString: String?) { + this.replaceCharactersInRange_withString(range, attrString) + } + + /** + * *native declaration : :33*

+ * Conversion Error : /// Original signature : `void setAttributes(NSDictionary*, null)`

+ * - (void)setAttributes:(NSDictionary*)attrs range:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `NSMutableString* mutableString()`

+ * *from NSExtendedMutableAttributedString native declaration : :39* + */ + abstract fun mutableString(): com.sun.jna.Pointer? + + /** + * *from NSExtendedMutableAttributedString native declaration : :41*

+ * Conversion Error : /// Original signature : `void addAttribute(NSString*, null, null)`

+ * - (void)addAttribute:(NSString*)name value:(null)value range:(null)range; (Argument value cannot be converted) + */ + abstract fun addAttribute_value_range(name: String?, value: NSObject?, range: NSRange?) + + fun addAttributeInRange(name: String?, value: NSObject?, range: NSRange?) { + this.addAttribute_value_range(name, value, range) + } + + fun addAttributeInRange(name: String?, value: String?, range: NSRange?) { + this.addAttribute_value_range(name, NSString.stringWithString(value), range) + } + + /** + * *from NSExtendedMutableAttributedString native declaration : :42*

+ * Conversion Error : /// Original signature : `void addAttributes(NSDictionary*, null)`

+ * - (void)addAttributes:(NSDictionary*)attrs range:(null)range; (Argument range cannot be converted) + */ + abstract fun addAttributes_range(attrs: NSDictionary?, range: NSRange?) + + fun addAttributesInRange(attrs: NSDictionary?, range: NSRange?) { + this.addAttributes_range(attrs, range) + } + + /** + * *from NSExtendedMutableAttributedString native declaration : :43*

+ * Conversion Error : /// Original signature : `void removeAttribute(NSString*, null)`

+ * - (void)removeAttribute:(NSString*)name range:(null)range; (Argument range cannot be converted) + */ + abstract fun removeAttribute_range(name: String?, range: NSRange?) + + fun removeAttributeInRange(name: String?, range: NSRange?) { + this.removeAttribute_range(name, range) + } + + /** + * *from NSExtendedMutableAttributedString native declaration : :45*

+ * Conversion Error : /// Original signature : `void replaceCharactersInRange(null, NSAttributedString*)`

+ * - (void)replaceCharactersInRange:(null)range withAttributedString:(NSAttributedString*)attrString; (Argument range cannot be converted) + */ + abstract fun replaceCharactersInRange_withAttributedString(range: NSRange?, attrString: NSAttributedString?) + + fun replaceCharactersInRange(range: NSRange?, attrString: NSAttributedString?) { + this.replaceCharactersInRange_withAttributedString(range, attrString) + } + + /** + * Original signature : `void insertAttributedString(NSAttributedString*, NSUInteger)`

+ * *from NSExtendedMutableAttributedString native declaration : :46* + */ + abstract fun insertAttributedString_atIndex(attrString: NSAttributedString?, loc: NSUInteger?) + + /** + * Original signature : `void appendAttributedString(NSAttributedString*)`

+ * *from NSExtendedMutableAttributedString native declaration : :47* + */ + abstract fun appendAttributedString(attrString: NSAttributedString?) + /** + * *from NSExtendedMutableAttributedString native declaration : :48*

+ * Conversion Error : /// Original signature : `void deleteCharactersInRange(null)`

+ * - (void)deleteCharactersInRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `void setAttributedString(NSAttributedString*)`

+ * *from NSExtendedMutableAttributedString native declaration : :49* + */ + abstract fun setAttributedString(attrString: NSAttributedString?) + + /** + * Original signature : `void beginEditing()`

+ * *from NSExtendedMutableAttributedString native declaration : :51* + */ + abstract fun beginEditing() + + /** + * Original signature : `void endEditing()`

+ * *from NSExtendedMutableAttributedString native declaration : :52* + */ + abstract fun endEditing() + + companion object { + private val CLASS: _Class = Rococoa.createClass("NSMutableAttributedString", _Class::class.java) + + fun create(str: String?): NSMutableAttributedString? { + var str = str + if (null == str) { + str = "" + } + return Rococoa.cast(CLASS.alloc().initWithString(str), NSMutableAttributedString::class.java) + } + + fun create(str: String?, attrs: NSDictionary?): NSMutableAttributedString? { + var str = str + if (null == str) { + str = "" + } + return Rococoa.cast( + CLASS.alloc().initWithString_attributes(str, attrs), + NSMutableAttributedString::class.java + ) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableData.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableData.kt new file mode 100644 index 00000000..6d2ee517 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableData.kt @@ -0,0 +1,94 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :81 +abstract class NSMutableData : NSData() { + interface _Class : ObjCClass { + /** + * Original signature : `dataWithCapacity(NSUInteger)`

+ * *from NSMutableDataCreation native declaration : :104* + */ + open fun dataWithCapacity(aNumItems: NSUInteger?): NSMutableData? + + /** + * Original signature : `dataWithLength(NSUInteger)`

+ * *from NSMutableDataCreation native declaration : :105* + */ + open fun dataWithLength(length: NSUInteger?): NSMutableData? + } + + /** + * Original signature : `void* mutableBytes()`

+ * *native declaration : :83* + */ + abstract fun mutableBytes(): com.sun.jna.Pointer? + + /** + * Original signature : `void setLength(NSUInteger)`

+ * *native declaration : :84* + */ + abstract fun setLength(length: NSUInteger?) + + /** + * Original signature : `void appendBytes(const void*, NSUInteger)`

+ * *from NSExtendedMutableData native declaration : :90* + */ + abstract fun appendBytes_length(bytes: com.sun.jna.Pointer?, length: NSUInteger?) + + /** + * Original signature : `void appendData(NSData*)`

+ * *from NSExtendedMutableData native declaration : :91* + */ + abstract fun appendData(other: NSData?) + + /** + * Original signature : `void increaseLengthBy(NSUInteger)`

+ * *from NSExtendedMutableData native declaration : :92* + */ + abstract fun increaseLengthBy(extraLength: NSUInteger?) + /** + * *from NSExtendedMutableData native declaration : :93*

+ * Conversion Error : /// Original signature : `void replaceBytesInRange(null, const void*)`

+ * - (void)replaceBytesInRange:(null)range withBytes:(const void*)bytes; (Argument range cannot be converted) + */ + /** + * *from NSExtendedMutableData native declaration : :94*

+ * Conversion Error : /// Original signature : `void resetBytesInRange(null)`

+ * - (void)resetBytesInRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `void setData(NSData*)`

+ * *from NSExtendedMutableData native declaration : :95* + */ + abstract fun setData(data: NSData?) + /** + * *from NSExtendedMutableData native declaration : :97*

+ * Conversion Error : /// Original signature : `void replaceBytesInRange(null, const void*, NSUInteger)`

+ * - (void)replaceBytesInRange:(null)range withBytes:(const void*)replacementBytes length:(NSUInteger)replacementLength; (Argument range cannot be converted) + */ + /** + * Original signature : `initWithCapacity(NSUInteger)`

+ * *from NSMutableDataCreation native declaration : :106* + */ + abstract fun initWithCapacity(capacity: NSUInteger?): NSMutableData? + + /** + * Original signature : `initWithLength(NSUInteger)`

+ * *from NSMutableDataCreation native declaration : :107* + */ + abstract fun initWithLength(length: NSUInteger?): NSMutableData? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSMutableData", _Class::class.java) + + fun dataWithCapacity(aNumItems: NSUInteger?): NSMutableData? { + return CLASS.dataWithCapacity(aNumItems) + } + + fun dataWithLength(length: NSUInteger?): NSMutableData? { + return CLASS.dataWithLength(length) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableDictionary.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableDictionary.kt new file mode 100644 index 00000000..f77e6a40 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableDictionary.kt @@ -0,0 +1,91 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :62 +abstract class NSMutableDictionary : NSDictionary() { + interface _Class : ObjCClass { + /** + * Original signature : `id dictionaryWithCapacity(NSUInteger)`

+ * *from NSMutableDictionaryCreation native declaration : :80* + */ + open fun dictionaryWithCapacity(numItems: NSUInteger?): NSMutableDictionary? + + open fun dictionaryWithDictionary(dict: NSDictionary?): NSMutableDictionary? + } + + /** + * Original signature : `void removeObjectForKey(id)`

+ * *native declaration : :64* + */ + abstract fun removeObjectForKey(aKey: String?) + + /** + * If aKey already exists in the receiver, the receiver’s previous value + * object for that key is sent a release message and anObject takes its place. + * + * @param anObject The object receives a retain message before being added to + * the receiver. This value must not be nil. + * @param aKey The key is copied (using copyWithZone:; keys must conform to the NSCopying protocol). The key must not be nil. + */ + fun setObjectForKey(anObject: String?, aKey: String?) { + this.setObjectForKey(NSString.stringWithString(anObject), aKey) + } + + fun setObjectForKey(anObject: NSObject?, aKey: String?) { + this.setObject_forKey(anObject, NSString.stringWithString(aKey)) + } + + /** + * Original signature : `public abstract void setObject(id, id)`

+ * *native declaration : :65* + */ + abstract fun setObject_forKey(anObject: NSObject?, aKey: NSObject?) + + /** + * Original signature : `public abstract void addEntriesFromDictionary(NSDictionary*)`

+ * *from NSExtendedMutableDictionary native declaration : :71* + */ + abstract fun addEntriesFromDictionary(otherDictionary: NSDictionary?) + + /** + * Original signature : `public abstract void removeAllObjects()`

+ * *from NSExtendedMutableDictionary native declaration : :72* + */ + abstract fun removeAllObjects() + + /** + * Original signature : `public abstract void removeObjectsForKeys(NSArray*)`

+ * *from NSExtendedMutableDictionary native declaration : :73* + */ + abstract fun removeObjectsForKeys(keyArray: NSArray?) + + /** + * Original signature : `public abstract void setDictionary(NSDictionary*)`

+ * *from NSExtendedMutableDictionary native declaration : :74* + */ + abstract fun setDictionary(otherDictionary: NSDictionary?) + + /** + * Original signature : `id initWithCapacity(NSUInteger)`

+ * *from NSMutableDictionaryCreation native declaration : :81* + */ + abstract fun initWithCapacity(numItems: NSUInteger?): NSMutableDictionary? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSMutableDictionary", _Class::class.java) + + fun dictionary(): NSMutableDictionary? { + return CLASS.dictionaryWithCapacity(NSUInteger(0)) + } + + fun dictionaryWithCapacity(numItems: NSUInteger?): NSMutableDictionary? { + return CLASS.dictionaryWithCapacity(numItems) + } + + fun dictionaryWithDictionary(dictionary: NSDictionary?): NSMutableDictionary? { + return CLASS.dictionaryWithDictionary(dictionary) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableParagraphStyle.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableParagraphStyle.kt new file mode 100644 index 00000000..13f5ef1e --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSMutableParagraphStyle.kt @@ -0,0 +1,150 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSInteger + +/// native declaration : :150 +abstract class NSMutableParagraphStyle : NSParagraphStyle() { + interface _Class : ObjCClass { + open fun alloc(): NSMutableParagraphStyle + } + + abstract fun init(): NSMutableParagraphStyle? + + /** + * Original signature : `void setLineSpacing(CGFloat)`

+ * *native declaration : :152* + */ + abstract fun setLineSpacing(aFloat: CGFloat?) + + /** + * Original signature : `public abstract void setParagraphSpacing(CGFloat)`

+ * *native declaration : :153* + */ + abstract fun setParagraphSpacing(aFloat: CGFloat?) + + /** + * *native declaration : :154*

+ * Conversion Error : /// Original signature : `public abstract void setAlignment(null)`

+ * - (void)setAlignment:(null)alignment; (Argument alignment cannot be converted) + */ + abstract fun setAlignment(alignment: Int) + + /** + * Original signature : `public abstract void setFirstLineHeadIndent(CGFloat)`

+ * *native declaration : :155* + */ + abstract fun setFirstLineHeadIndent(aFloat: CGFloat?) + + /** + * Original signature : `public abstract void setHeadIndent(CGFloat)`

+ * *native declaration : :156* + */ + abstract fun setHeadIndent(aFloat: CGFloat?) + + /** + * Original signature : `public abstract void setTailIndent(CGFloat)`

+ * *native declaration : :157* + */ + abstract fun setTailIndent(aFloat: CGFloat?) + + /** + * Original signature : `public abstract void setLineBreakMode(NSLineBreakMode)`

+ * *native declaration : :158* + */ + abstract fun setLineBreakMode(mode: Int) + + /** + * Original signature : `public abstract void setMinimumLineHeight(CGFloat)`

+ * *native declaration : :159* + */ + abstract fun setMinimumLineHeight(aFloat: CGFloat?) + + /** + * Original signature : `public abstract void setMaximumLineHeight(CGFloat)`

+ * *native declaration : :160* + */ + abstract fun setMaximumLineHeight(aFloat: CGFloat?) + /** + * Original signature : `public abstract void addTabStop(NSTextTab*)`

+ * *native declaration : :161* + */ + // public abstract void addTabStop(NSTextTab anObject); + /** + * Original signature : `public abstract void removeTabStop(NSTextTab*)`

+ * *native declaration : :162* + */ + // public abstract void removeTabStop(NSTextTab anObject); + /** + * Original signature : `public abstract void setTabStops(NSArray*)`

+ * *native declaration : :163* + */ + abstract fun setTabStops(array: NSArray?) + + /** + * Original signature : `public abstract void setParagraphStyle(NSParagraphStyle*)`

+ * *native declaration : :164* + */ + abstract fun setParagraphStyle(obj: NSParagraphStyle?) + /** + * *native declaration : :166*

+ * Conversion Error : /// Original signature : `public abstract void setBaseWritingDirection(null)`

+ * - (void)setBaseWritingDirection:(null)writingDirection; (Argument writingDirection cannot be converted) + */ + /** + * Original signature : `public abstract void setLineHeightMultiple(CGFloat)`

+ * *native declaration : :169* + */ + abstract fun setLineHeightMultiple(aFloat: CGFloat?) + + /** + * Original signature : `public abstract void setParagraphSpacingBefore(CGFloat)`

+ * *native declaration : :170* + */ + abstract fun setParagraphSpacingBefore(aFloat: CGFloat?) + + /** + * Original signature : `public abstract void setDefaultTabInterval(CGFloat)`

+ * *native declaration : :171* + */ + abstract fun setDefaultTabInterval(aFloat: CGFloat?) + + /** + * Original signature : `public abstract void setTextBlocks(NSArray*)`

+ * *native declaration : :174* + */ + abstract fun setTextBlocks(array: NSArray?) + + /** + * Original signature : `public abstract void setTextLists(NSArray*)`

+ * *native declaration : :175* + */ + abstract fun setTextLists(array: NSArray?) + + /** + * Original signature : `public abstract void setHyphenationFactor(float)`

+ * *native declaration : :176* + */ + abstract fun setHyphenationFactor(aFactor: Float) + + /** + * Original signature : `public abstract void setTighteningFactorForTruncation(float)`

+ * *native declaration : :177* + */ + abstract fun setTighteningFactorForTruncation(aFactor: Float) + + /** + * Original signature : `public abstract void setHeaderLevel(NSInteger)`

+ * *native declaration : :178* + */ + abstract fun setHeaderLevel(level: NSInteger?) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSMutableParagraphStyle", _Class::class.java) + + fun paragraphStyle(): NSMutableParagraphStyle? { + return CLASS.alloc().init() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSNotification.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSNotification.kt new file mode 100644 index 00000000..3c6afa97 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSNotification.kt @@ -0,0 +1,52 @@ +package darwin + +import org.rococoa.ObjCClass + +/// native declaration : :12 +abstract class NSNotification : NSObject(), NSCopying { + interface _Class : ObjCClass { + /** + * *from NSNotificationCreation native declaration : :22*

+ * Conversion Error : /// Original signature : `notificationWithName(NSString*, null)`

+ * + (null)notificationWithName:(NSString*)aName object:(null)anObject; (Argument anObject cannot be converted) + */ + open fun notificationWithName_object(notificationName: String?, `object`: org.rococoa.ID?): NSNotification? + + /** + * *from NSNotificationCreation native declaration : :23*

+ * Conversion Error : /// Original signature : `notificationWithName(NSString*, null, NSDictionary*)`

+ * + (null)notificationWithName:(NSString*)aName object:(null)anObject userInfo:(NSDictionary*)aUserInfo; (Argument anObject cannot be converted) + */ + open fun alloc(): NSNotification? + } + + /** + * Original signature : `NSString* name()`

+ * *native declaration : :14* + */ + abstract fun name(): String? + + /** + * Original signature : `object()`

+ * *native declaration : :15* + */ + abstract fun `object`(): NSObject? + + /** + * Original signature : `NSDictionary* userInfo()`

+ * *native declaration : :16* + */ + abstract fun userInfo(): NSDictionary? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSNotification", _Class::class.java) + + fun notificationWithName(notificationName: String?, `object`: org.rococoa.ID?): NSNotification? { + return CLASS.notificationWithName_object(notificationName, `object`) + } + + fun notificationWithName(notificationName: String?, `object`: String?): NSNotification? { + return CLASS.notificationWithName_object(notificationName, NSString.stringWithString(`object`).id()) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSNotificationCenter.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSNotificationCenter.kt new file mode 100644 index 00000000..04dc9814 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSNotificationCenter.kt @@ -0,0 +1,77 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Selector + +/// native declaration : :29 +abstract class NSNotificationCenter : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `defaultCenter()`

+ * *native declaration : :36* + */ + open fun defaultCenter(): NSNotificationCenter? + } + + fun addObserver( + notificationObserver: ID?, + notificationSelector: Selector?, + notificationName: String?, + notificationSender: ID? + ) { + this.addObserver_selector_name_object( + notificationObserver, + notificationSelector, + notificationName, + notificationSender + ) + } + + /** + * *native declaration : :38*

+ * Conversion Error : /// Original signature : `void addObserver(null, null, NSString*, null)`

+ * - (void)addObserver:(null)observer selector:(null)aSelector name:(NSString*)aName object:(null)anObject; (Argument observer cannot be converted) + */ + abstract fun addObserver_selector_name_object( + notificationObserver: ID?, + notificationSelector: Selector?, + notificationName: String?, + notificationSender: ID? + ) + + /** + * Original signature : `void postNotification(NSNotification*)`

+ * *native declaration : :40* + */ + abstract fun postNotification(notification: NSNotification?) + /** + * *native declaration : :41*

+ * Conversion Error : /// Original signature : `void postNotificationName(NSString*, null)`

+ * - (void)postNotificationName:(NSString*)aName object:(null)anObject; (Argument anObject cannot be converted) + */ + /** + * *native declaration : :42*

+ * Conversion Error : /// Original signature : `void postNotificationName(NSString*, null, NSDictionary*)`

+ * - (void)postNotificationName:(NSString*)aName object:(null)anObject userInfo:(NSDictionary*)aUserInfo; (Argument anObject cannot be converted) + */ + /** + * *native declaration : :44*

+ * Conversion Error : /// Original signature : `void removeObserver(null)`

+ * - (void)removeObserver:(null)observer; (Argument observer cannot be converted) + */ + abstract fun removeObserver(notificationObserver: ID?) + + /** + * *native declaration : :45*

+ * Conversion Error : /// Original signature : `void removeObserver(null, NSString*, null)`

+ * - (void)removeObserver:(null)observer name:(NSString*)aName object:(null)anObject; (Argument observer cannot be converted) + */ + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSNotificationCenter", _Class::class.java) + + fun defaultCenter(): NSNotificationCenter? { + return CLASS.defaultCenter() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSNumber.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSNumber.kt new file mode 100644 index 00000000..ed0cdc8a --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSNumber.kt @@ -0,0 +1,316 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:37 +abstract class NSNumber : NSValue() { + interface _Class : ObjCClass { + /** + * Original signature : `NSNumber* numberWithChar(char)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:87* + */ + open fun numberWithChar(value: Byte): NSNumber? + + /** + * Original signature : `NSNumber* numberWithUnsignedChar(unsigned char)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:88* + */ + open fun numberWithUnsignedChar(value: Byte): NSNumber? + + /** + * Original signature : `NSNumber* numberWithShort(short)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:89* + */ + open fun numberWithShort(value: Short): NSNumber? + + /** + * Original signature : `NSNumber* numberWithUnsignedShort(unsigned short)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:90* + */ + open fun numberWithUnsignedShort(value: Short): NSNumber? + + /** + * Original signature : `NSNumber* numberWithInt(int)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:91* + */ + open fun numberWithInt(value: Int): NSNumber? + + /** + * Original signature : `NSNumber* numberWithUnsignedInt(unsigned int)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:92* + */ + open fun numberWithUnsignedInt(value: Int): NSNumber? + + /** + * Original signature : `NSNumber* numberWithLong(long)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:93* + */ + open fun numberWithLong(value: com.sun.jna.NativeLong?): NSNumber? + + /** + * Original signature : `NSNumber* numberWithUnsignedLong(unsigned long)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:94* + */ + open fun numberWithUnsignedLong(value: com.sun.jna.NativeLong?): NSNumber? + + /** + * Original signature : `NSNumber* numberWithLongLong(long long)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:95* + */ + open fun numberWithLongLong(value: Long): NSNumber? + + /** + * Original signature : `NSNumber* numberWithUnsignedLongLong(unsigned long long)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:96* + */ + open fun numberWithUnsignedLongLong(value: Long): NSNumber? + + /** + * Original signature : `NSNumber* numberWithFloat(float)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:97* + */ + open fun numberWithFloat(value: Float): NSNumber? + + /** + * Original signature : `NSNumber* numberWithDouble(double)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:98* + */ + open fun numberWithDouble(value: Double): NSNumber? + + /** + * Original signature : `NSNumber* numberWithBool(BOOL)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:99* + */ + open fun numberWithBool(value: Boolean): NSNumber? + + /** + * Original signature : `NSNumber* numberWithInteger(NSInteger)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:101* + */ + open fun numberWithInteger(value: NSNumber?): NSNumber? + + /** + * Original signature : `NSNumber* numberWithUnsignedInteger(NSUInteger)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:102* + */ + open fun numberWithUnsignedInteger(value: NSUInteger?): NSNumber? + } + + /** + * Original signature : `char charValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:39* + */ + abstract fun charValue(): Byte + + /** + * Original signature : `unsigned char unsignedCharValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:40* + */ + abstract fun unsignedCharValue(): Byte + + /** + * Original signature : `short shortValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:41* + */ + abstract fun shortValue(): Short + + /** + * Original signature : `unsigned short unsignedShortValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:42* + */ + abstract fun unsignedShortValue(): Short + + /** + * Original signature : `int intValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:43* + */ + abstract fun intValue(): Int + + /** + * Original signature : `unsigned int unsignedIntValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:44* + */ + abstract fun unsignedIntValue(): Int + + /** + * Original signature : `long longValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:45* + */ + abstract fun longValue(): Long + + /** + * Original signature : `unsigned long unsignedLongValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:46* + */ + abstract fun unsignedLongValue(): Long + + /** + * Original signature : `float floatValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:49* + */ + abstract fun floatValue(): Float + + /** + * Original signature : `double doubleValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:50* + */ + abstract fun doubleValue(): Double + + /** + * Original signature : `BOOL boolValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:51* + */ + abstract fun boolValue(): Boolean + + /** + * Original signature : `NSInteger integerValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:53* + */ + abstract fun integerValue(): NSInteger? + + /** + * Original signature : `NSUInteger unsignedIntegerValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:54* + */ + abstract fun unsignedIntegerValue(): Int + + /** + * Original signature : `NSString* stringValue()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:57* + */ + abstract fun stringValue(): String? + + /** + * Original signature : `compare(NSNumber*)`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:59* + */ + abstract fun compare(otherNumber: NSNumber?): NSObject? + + /** + * Original signature : `BOOL isEqualToNumber(NSNumber*)`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:61* + */ + abstract fun isEqualToNumber(number: NSNumber?): Byte + /** + * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:63*

+ * Conversion Error : /// Original signature : `NSString* descriptionWithLocale(null)`

+ * - (NSString*)descriptionWithLocale:(null)locale; (Argument locale cannot be converted) + */ + /** + * Original signature : `initWithChar(char)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:69* + */ + abstract fun initWithChar(value: Byte): NSNumber? + + /** + * Original signature : `initWithUnsignedChar(unsigned char)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:70* + */ + abstract fun initWithUnsignedChar(value: Byte): NSNumber? + + /** + * Original signature : `initWithShort(short)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:71* + */ + abstract fun initWithShort(value: Short): NSNumber? + + /** + * Original signature : `initWithUnsignedShort(unsigned short)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:72* + */ + abstract fun initWithUnsignedShort(value: Short): NSNumber? + + /** + * Original signature : `initWithInt(int)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:73* + */ + abstract fun initWithInt(value: Int): NSNumber? + + /** + * Original signature : `initWithUnsignedInt(unsigned int)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:74* + */ + abstract fun initWithUnsignedInt(value: Int): NSNumber? + + /** + * Original signature : `initWithLong(long)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:75* + */ + abstract fun initWithLong(value: com.sun.jna.NativeLong?): NSNumber? + + /** + * Original signature : `initWithUnsignedLong(unsigned long)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:76* + */ + abstract fun initWithUnsignedLong(value: com.sun.jna.NativeLong?): NSNumber? + + /** + * Original signature : `initWithLongLong(long long)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:77* + */ + abstract fun initWithLongLong(value: Long): NSNumber? + + /** + * Original signature : `initWithUnsignedLongLong(unsigned long long)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:78* + */ + abstract fun initWithUnsignedLongLong(value: Long): NSNumber? + + /** + * Original signature : `initWithFloat(float)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:79* + */ + abstract fun initWithFloat(value: Float): NSNumber? + + /** + * Original signature : `initWithDouble(double)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:80* + */ + abstract fun initWithDouble(value: Double): NSNumber? + + /** + * Original signature : `initWithBool(BOOL)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:81* + */ + abstract fun initWithBool(value: Boolean): NSNumber? + + /** + * Original signature : `initWithInteger(NSInteger)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:83* + */ + abstract fun initWithInteger(value: NSInteger?): NSNumber? + + /** + * Original signature : `initWithUnsignedInteger(NSUInteger)`

+ * *from NSNumberCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSValue.h:84* + */ + abstract fun initWithUnsignedInteger(value: Int): NSNumber? + + /** + * Original signature : `decimalValue()`

+ * *from NSDecimalNumberExtensions native declaration : :141* + */ + abstract fun decimalValue(): NSObject? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSNumber", _Class::class.java) + + fun numberWithInt(value: Int): NSNumber? { + return CLASS.numberWithInt(value) + } + + fun numberWithDouble(value: Double): NSNumber? { + return CLASS.numberWithDouble(value) + } + + fun numberWithFloat(value: Float): NSNumber? { + return CLASS.numberWithFloat(value) + } + + fun numberWithBoolean(value: Boolean): NSNumber? { + return CLASS.numberWithBool(value) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSObject.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSObject.kt new file mode 100644 index 00000000..09ab0a73 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSObject.kt @@ -0,0 +1,16 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.Selector +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :14 +abstract class NSObject : org.rococoa.cocoa.foundation.NSObject() { + abstract fun respondsToSelector(sel: Selector?): Boolean + + abstract fun performSelector(sel: Selector?): NSObject? + + abstract fun hash(): NSUInteger? + + abstract fun isEqual(anObject: ID?): Boolean +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSOpenPanel.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSOpenPanel.kt new file mode 100644 index 00000000..76f8ab26 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSOpenPanel.kt @@ -0,0 +1,118 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Selector + +/// native declaration : :14 +abstract class NSOpenPanel : NSSavePanel() { + interface _Class : ObjCClass { + /** + * Original signature : `NSOpenPanel* openPanel()`

+ * *native declaration : :19* + */ + open fun openPanel(): NSOpenPanel? + } + + /** + * Original signature : `NSArray* URLs()`

+ * *native declaration : :21* + */ + abstract fun URLs(): NSArray? + + /** + * Original signature : `BOOL resolvesAliases()`

+ * *native declaration : :24* + */ + abstract fun resolvesAliases(): Boolean + + /** + * Original signature : `void setResolvesAliases(BOOL)`

+ * *native declaration : :25* + */ + abstract fun setResolvesAliases(flag: Boolean) + + /** + * Original signature : `BOOL canChooseDirectories()`

+ * *native declaration : :27* + */ + abstract fun canChooseDirectories(): Boolean + + /** + * Original signature : `void setCanChooseDirectories(BOOL)`

+ * *native declaration : :28* + */ + abstract fun setCanChooseDirectories(flag: Boolean) + + /** + * Original signature : `BOOL allowsMultipleSelection()`

+ * *native declaration : :30* + */ + abstract fun allowsMultipleSelection(): Boolean + + /** + * Original signature : `void setAllowsMultipleSelection(BOOL)`

+ * *native declaration : :31* + */ + abstract fun setAllowsMultipleSelection(flag: Boolean) + + /** + * Original signature : `BOOL canChooseFiles()`

+ * *native declaration : :33* + */ + abstract fun canChooseFiles(): Boolean + + /** + * Original signature : `void setCanChooseFiles(BOOL)`

+ * *native declaration : :34* + */ + abstract fun setCanChooseFiles(flag: Boolean) + + /** + * Private + * + * @param show + */ + abstract fun setShowsHiddenFiles(show: Boolean) + + /** + * *from NSOpenPanelRuntime native declaration : :40*

+ * Conversion Error : /// Original signature : `void beginSheetForDirectory(NSString*, NSString*, NSArray*, NSWindow*, null, null, void*)`

+ * - (void)beginSheetForDirectory:(NSString*)path file:(NSString*)name types:(NSArray*)fileTypes + * modalForWindow:(NSWindow*)docWindow modalDelegate:(null)delegate + * didEndSelector:(null)didEndSelector contextInfo:(void*)contextInfo; (Argument delegate cannot be converted) + */ + abstract fun beginSheetForDirectory_file_types_modalForWindow_modalDelegate_didEndSelector_contextInfo( + path: String?, + name: String?, + fileTypes: NSArray?, + docWindow: NSWindow?, + delegate: NSObject?, + didEndSelector: Selector?, + contextInfo: ID? + ) + /** + * *from NSOpenPanelRuntime native declaration : :43*

+ * Conversion Error : /// Original signature : `void beginForDirectory(NSString*, NSString*, NSArray*, null, null, void*)`

+ * - (void)beginForDirectory:(NSString*)path file:(NSString*)name types:(NSArray*)fileTypes modelessDelegate:(null)delegate didEndSelector:(null)didEndSelector contextInfo:(void*)contextInfo; (Argument delegate cannot be converted) + */ + /** + * Original signature : `NSInteger runModalForDirectory(NSString*, NSString*, NSArray*)`

+ * *from NSOpenPanelRuntime native declaration : :46* + */ + abstract fun runModalForDirectory_file_types(path: String?, name: String?, fileTypes: NSArray?): Int + + /** + * Original signature : `NSInteger runModalForTypes(NSArray*)`

+ * *from NSOpenPanelRuntime native declaration : :47* + */ + abstract fun runModalForTypes(fileTypes: NSArray?): Int + + companion object { + val CLASS: _Class = org.rococoa.Rococoa.createClass("NSOpenPanel", _Class::class.java) + + fun openPanel(): NSOpenPanel? { + return CLASS.openPanel() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSOutlineView.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSOutlineView.kt new file mode 100644 index 00000000..8fe30886 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSOutlineView.kt @@ -0,0 +1,284 @@ +package darwin + +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :73 +abstract class NSOutlineView : NSTableView() { + interface DataSource { + open fun outlineView_numberOfChildrenOfItem(view: NSOutlineView?, item: NSObject?): NSInteger? + + open fun outlineView_child_ofItem(outlineView: NSOutlineView?, index: NSInteger?, item: NSObject?): NSObject? + + open fun outlineView_setObjectValue_forTableColumn_byItem( + outlineView: NSOutlineView?, value: NSObject?, + tableColumn: NSTableColumn?, item: NSObject? + ) + + open fun outlineView_objectValueForTableColumn_byItem( + outlineView: NSOutlineView?, + tableColumn: NSTableColumn?, + item: NSObject? + ): NSObject? + + open fun outlineView_isItemExpandable(view: NSOutlineView?, item: NSObject?): Boolean + + open fun outlineView_validateDrop_proposedItem_proposedChildIndex( + outlineView: NSOutlineView?, + info: NSDraggingInfo?, + item: NSObject?, + row: NSInteger? + ): NSUInteger? + + open fun outlineView_acceptDrop_item_childIndex( + outlineView: NSOutlineView?, + info: NSDraggingInfo?, + item: NSObject?, + row: NSInteger? + ): Boolean + + open fun outlineView_writeItems_toPasteboard( + outlineView: NSOutlineView?, + items: NSArray?, + pboard: NSPasteboard? + ): Boolean + + open fun outlineView_namesOfPromisedFilesDroppedAtDestination_forDraggedItems( + dropDestination: NSURL?, + items: NSArray? + ): NSArray? + } + + interface Delegate { + open fun outlineView_willDisplayCell_forTableColumn_item( + view: NSOutlineView?, + cell: NSTextFieldCell?, + tableColumn: NSTableColumn?, + item: NSObject? + ) + + open fun outlineView_shouldExpandItem(view: NSOutlineView?, item: NSObject?): Boolean + + open fun outlineViewItemWillExpand(notification: NSNotification?) + + open fun outlineViewItemDidExpand(notification: NSNotification?) + + open fun outlineViewItemWillCollapse(notification: NSNotification?) + + open fun outlineViewItemDidCollapse(notification: NSNotification?) + + open fun outlineView_isGroupItem(view: NSOutlineView?, item: NSObject?): Boolean + } + + /** + * The 'outlineTableColumn' is the column that displays data in a hierarchical fashion, indented one identationlevel + * per level, decorated with indentation marker (disclosure triangle) on rows that are expandable. On MacOS 10.5, + * this value is saved in encodeWithCoder: and restored in initWithCoder:;

Original signature : `void + * setOutlineTableColumn(NSTableColumn*)`

+ * *native declaration : :103* + */ + abstract fun setOutlineTableColumn(outlineTableColumn: NSTableColumn?) + + /** + * Original signature : `NSTableColumn* outlineTableColumn()`

+ * *native declaration : :104* + */ + abstract fun outlineTableColumn(): NSTableColumn? + + /** + * Returns YES if 'item' is expandable and can contain other items. May call out to the delegate, if required.

+ * Original signature : `BOOL isExpandable(id)`

+ * *native declaration : :108* + */ + abstract fun isExpandable(item: NSObject?): Boolean + + /** + * Expands 'item', if not already expanded, and all children if 'expandChildren' is YES. On 10.5 and higher, passing + * 'nil' for 'item' will expand each item under the root.

Original signature : `void expandItem(id, + * BOOL)`

+ * *native declaration : :112* + */ + abstract fun expandItem_expandChildren(item: NSObject?, expandChildren: Boolean) + + /** + * Calls expandItem:expandChildren with 'expandChildren == NO'

Original signature : `void + * expandItem(id)`

+ * *native declaration : :116* + */ + abstract fun expandItem(item: NSObject?) + + /** + * Collapses 'item' and all children if 'collapseChildren' is YES. On 10.5 and higher, passing 'nil' for 'item' will + * collapse each item under the root.

Original signature : `void collapseItem(id, BOOL)`

+ * *native declaration : :120* + */ + abstract fun collapseItem_collapseChildren(item: NSObject?, collapseChildren: Boolean) + + /** + * Calls collapseItem:collapseChildren with 'collapseChildren == NO'

Original signature : `void + * collapseItem(id)`

+ * *native declaration : :124* + */ + abstract fun collapseItem(item: NSObject?) + + /** + * Reloads 'item' and all children if 'reloadChildren' is YES. On 10.5 and higher, passing 'nil' for 'item' will + * reload everything under the root item.

Original signature : `void reloadItem(id, BOOL)`

+ * *native declaration : :128* + */ + abstract fun reloadItem_reloadChildren(item: NSObject?, reloadChildren: Boolean) + + /** + * Calls reloadItem:reloadChildren with 'reloadChildren == NO'

Original signature : `void + * reloadItem(id)`

+ * *native declaration : :132* + */ + abstract fun reloadItem(item: NSObject?) + + /** + * Returns the parent for 'item', or nil, if the parent is the root.

Original signature : `id + * parentForItem(id)`

+ * *native declaration : :138* + */ + abstract fun parentForItem(item: NSObject?): NSObject? + + /** + * Item/Row translation

Original signature : `id itemAtRow(NSInteger)`

+ * *native declaration : :144* + */ + abstract fun itemAtRow(row: NSInteger?): NSObject? + + /** + * Original signature : `NSInteger rowForItem(id)`

+ * *native declaration : :145* + */ + abstract fun rowForItem(item: NSObject?): NSInteger? + + /** + * Indentation

Original signature : `NSInteger levelForItem(id)`

+ * *native declaration : :149* + */ + abstract fun levelForItem(item: NSObject?): NSInteger? + + /** + * Original signature : `NSInteger levelForRow(NSInteger)`

+ * *native declaration : :150* + */ + abstract fun levelForRow(row: NSInteger?): NSInteger? + + /** + * Original signature : `BOOL isItemExpanded(id)`

+ * *native declaration : :151* + */ + abstract fun isItemExpanded(item: NSObject?): Boolean + + /** + * The indentation amount per level defaults to 16.0.

Original signature : `void + * setIndentationPerLevel(CGFloat)`

+ * *native declaration : :155* + */ + abstract fun setIndentationPerLevel(indentationPerLevel: CGFloat?) + + /** + * Original signature : `CGFloat indentationPerLevel()`

+ * *native declaration : :156* + */ + abstract fun indentationPerLevel(): CGFloat? + + /** + * The indentation marker is the visual indicator that shows an item is expandable (i.e. disclosure triangle). The + * default value is YES.

Original signature : `void setIndentationMarkerFollowsCell(BOOL)`

+ * *native declaration : :160* + */ + abstract fun setIndentationMarkerFollowsCell(drawInCell: Boolean) + + /** + * Original signature : `BOOL indentationMarkerFollowsCell()`

+ * *native declaration : :161* + */ + abstract fun indentationMarkerFollowsCell(): Boolean + + /** + * Original signature : `void setAutoresizesOutlineColumn(BOOL)`

+ * *native declaration : :163* + */ + abstract fun setAutoresizesOutlineColumn(resize: Boolean) + + /** + * Original signature : `BOOL autoresizesOutlineColumn()`

+ * *native declaration : :164* + */ + abstract fun autoresizesOutlineColumn(): Boolean + /** + * *native declaration : :170*

+ * Conversion Error : NSRect + */ + /** + * To be used from validateDrop: in order to "re-target" the proposed drop. To specify a drop on an item I, one + * would specify item=I, and index=NSOutlineViewDropOnItemIndex. To specify a drop between child 2 and 3 of an item + * I, on would specify item=I, and index=3 (children are zero-base indexed). To specify a drop on an un-expandable + * item I, one would specify item=I, and index=NSOutlineViewDropOnItemIndex.

Original signature : `void + * setDropItem(id, NSInteger)`

+ * *native declaration : :179* + */ + abstract fun setDropItem_dropChildIndex(item: NSObject?, index: NSInteger?) + + fun setDropItem(item: NSObject?, index: NSInteger?) { + this.setDropItem_dropChildIndex(item, index) + } + + /** + * This method returns YES to indicate that auto expanded items should return to their original collapsed state. + * Override this method to provide custom behavior. 'deposited' tells wether or not the drop terminated due to a + * successful drop (as indicated by the return value from acceptDrop:). Note that exiting the view will be treated + * the same as a failed drop.

Original signature : `BOOL shouldCollapseAutoExpandedItemsForDeposited(BOOL)`

+ * *native declaration : :183* + */ + abstract fun shouldCollapseAutoExpandedItemsForDeposited(deposited: Boolean): Boolean + + /** + * Persistence. The value for autosaveExpandedItems is saved out in the nib file on Mac OS 10.5 or higher. The + * default value is NO. Calling setAutosaveExpandedItems:YES requires you to implement + * outlineView:itemForPersistentObject: and outlineView:persistentObjectForItem:.

Original signature : + * `BOOL autosaveExpandedItems()`

+ * *native declaration : :187* + */ + abstract fun autosaveExpandedItems(): Boolean + + /** + * Original signature : `void setAutosaveExpandedItems(BOOL)`

+ * *native declaration : :188* + */ + abstract fun setAutosaveExpandedItems(save: Boolean) + + /** + * When the value of this property is YES, the outline view retains and releases the objects returned to it from + * dataSource. When the value is NO, the outline view treats the objects as opaque items and assumes that the client + * has a retain on them. The default value is YES for applications linked on macOS 10.12 and later, and NO for + * applications linked on earlier versions of macOS. If you require the legacy behavior and your app links in macOS + * 10.12 or later, the value of this property must be explicitly set toNO in code, because it is not encoded in the + * nib. In general, this is required if the items themselves create a retain cycle. + * + * @return A Boolean value that indicates whether the outline view retains and releases the objects returned from + * its data source. + */ + abstract fun stronglyReferencesItems(): Boolean + + /** + * When the value of this property is YES, the outline view retains and releases the objects returned to it from + * dataSource. When the value is NO, the outline view treats the objects as opaque items and assumes that the client + * has a retain on them. The default value is YES for applications linked on macOS 10.12 and later, and NO for + * applications linked on earlier versions of macOS. If you require the legacy behavior and your app links in macOS + * 10.12 or later, the value of this property must be explicitly set toNO in code, because it is not encoded in the + * nib. In general, this is required if the items themselves create a retain cycle. + * + * @param value A Boolean value that indicates whether the outline view retains and releases the objects returned + * from its data source. + */ + abstract fun setStronglyReferencesItems(value: Boolean) + + companion object { + val NSOutlineViewDropOnItemIndex: NSInteger? = NSInteger(-1) + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPanel.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPanel.kt new file mode 100644 index 00000000..4b26d98e --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPanel.kt @@ -0,0 +1,60 @@ +package darwin + +/// native declaration : :83 +abstract class NSPanel : NSWindow() { + /** + * Original signature : `BOOL isFloatingPanel()`

+ * *native declaration : :88* + */ + abstract fun isFloatingPanel(): Boolean + + /** + * Original signature : `void setFloatingPanel(BOOL)`

+ * *native declaration : :89* + */ + abstract fun setFloatingPanel(flag: Boolean) + + /** + * Original signature : `BOOL becomesKeyOnlyIfNeeded()`

+ * *native declaration : :90* + */ + abstract fun becomesKeyOnlyIfNeeded(): Boolean + + /** + * Original signature : `void setBecomesKeyOnlyIfNeeded(BOOL)`

+ * *native declaration : :91* + */ + abstract fun setBecomesKeyOnlyIfNeeded(flag: Boolean) + + /** + * Original signature : `void setWorksWhenModal(BOOL)`

+ * *native declaration : :93* + */ + abstract fun setWorksWhenModal(flag: Boolean) + + companion object { + /// native declaration : :61 + const val NSOKButton: Int = 1 + + /// native declaration : :62 + const val NSCancelButton: Int = 0 + + /// native declaration : :67 + const val NSUtilityWindowMask: Int = 1 shl 4 + + /// native declaration : :68 + const val NSDocModalWindowMask: Int = 1 shl 6 + + /** + * specify a panel that does not activate owning application

+ * *native declaration : :73* + */ + const val NSNonactivatingPanelMask: Int = 1 shl 7 + + /** + * specify a heads up display panel

+ * *native declaration : :79* + */ + const val NSHUDWindowMask: Int = 1 shl 13 + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSParagraphStyle.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSParagraphStyle.kt new file mode 100644 index 00000000..48912544 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSParagraphStyle.kt @@ -0,0 +1,208 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat + +/// native declaration : :74 +abstract class NSParagraphStyle : NSObject(), NSCopying { + interface _Class : ObjCClass { + /** + * Original signature : `NSParagraphStyle* defaultParagraphStyle()`

+ * *native declaration : :100* + */ + open fun defaultParagraphStyle(): NSParagraphStyle? + + /** + * Original signature : `defaultWritingDirectionForLanguage(NSString*)`

+ * languageName is in ISO lang region format

+ * *native declaration : :103* + */ + open fun defaultWritingDirectionForLanguage(languageName: com.sun.jna.Pointer?): com.sun.jna.Pointer? + } + + /** + * Original signature : `CGFloat lineSpacing()`

+ * "Leading": distance between the bottom of one line fragment and top of next (applied between lines in the same container). Can't be negative. This value is included in the line fragment heights in layout manager.

+ * *native declaration : :106* + */ + abstract fun lineSpacing(): CGFloat? + + /** + * Original signature : `CGpublic abstract float paragraphSpacing()`

+ * Distance between the bottom of this paragraph and top of next (or the beginning of its paragraphSpacingBefore, if any).

+ * *native declaration : :107* + */ + abstract fun paragraphSpacing(): Float + + /** + * Original signature : `alignment()`

+ * *native declaration : :108* + */ + abstract fun alignment(): com.sun.jna.Pointer? + + /** + * Original signature : `CGpublic abstract float headIndent()`

+ * Distance from margin to front edge of paragraph

+ * *native declaration : :112* + */ + abstract fun headIndent(): Float + + /** + * Original signature : `CGpublic abstract float tailIndent()`

+ * Distance from margin to back edge of paragraph; if negative or 0, from other margin

+ * *native declaration : :113* + */ + abstract fun tailIndent(): Float + + /** + * Original signature : `CGpublic abstract float firstLineHeadIndent()`

+ * Distance from margin to edge appropriate for text direction

+ * *native declaration : :114* + */ + abstract fun firstLineHeadIndent(): Float + + /** + * Original signature : `NSArray* tabStops()`

+ * Distance from margin to tab stops

+ * *native declaration : :115* + */ + abstract fun tabStops(): com.sun.jna.Pointer? + + /** + * Original signature : `CGpublic abstract float minimumLineHeight()`

+ * Line height is the distance from bottom of descenders to top of ascenders; basically the line fragment height. Does not include lineSpacing (which is added after this computation).

+ * *native declaration : :117* + */ + abstract fun minimumLineHeight(): Float + + /** + * Original signature : `CGpublic abstract float maximumLineHeight()`

+ * 0 implies no maximum.

+ * *native declaration : :118* + */ + abstract fun maximumLineHeight(): Float + + /** + * Original signature : `NSLineBreakMode lineBreakMode()`

+ * *native declaration : :120* + */ + abstract fun lineBreakMode(): Int + + /** + * Original signature : `baseWritingDirection()`

+ * *native declaration : :123* + */ + abstract fun baseWritingDirection(): com.sun.jna.Pointer? + + /** + * Original signature : `CGpublic abstract float lineHeightMultiple()`

+ * Natural line height is multiplied by this factor (if positive) before being constrained by minimum and maximum line height.

+ * *native declaration : :127* + */ + abstract fun lineHeightMultiple(): Float + + /** + * Original signature : `CGpublic abstract float paragraphSpacingBefore()`

+ * Distance between the bottom of the previous paragraph (or the end of its paragraphSpacing, if any) and the top of this paragraph.

+ * *native declaration : :128* + */ + abstract fun paragraphSpacingBefore(): Float + + /** + * Original signature : `CGpublic abstract float defaultTabInterval()`

+ * Tabs after the last specified in tabStops are placed at integral multiples of this distance (if positive).

+ * *native declaration : :129* + */ + abstract fun defaultTabInterval(): Float + + /** + * Original signature : `NSArray* textBlocks()`

+ * Array to specify the text blocks containing the paragraph, nested from outermost to innermost.

+ * *native declaration : :133* + */ + abstract fun textBlocks(): com.sun.jna.Pointer? + + /** + * Original signature : `NSArray* textLists()`

+ * Array to specify the text lists containing the paragraph, nested from outermost to innermost.

+ * *native declaration : :134* + */ + abstract fun textLists(): com.sun.jna.Pointer? + + /** + * Specifies the threshold for hyphenation. Valid values lie between 0.0 and 1.0 inclusive. Hyphenation will be attempted when the ratio of the text width as broken without hyphenation to the width of the line fragment is less than the hyphenation factor. When this takes on its default value of 0.0, the layout manager's hyphenation factor is used instead. When both are 0.0, hyphenation is disabled.

+ * Original signature : `public abstract float hyphenationFactor()`

+ * *native declaration : :138* + */ + abstract fun hyphenationFactor(): Float + + /** + * Specifies the threshold for using tightening as an alternative to truncation. When the line break mode specifies truncation, the text system will attempt to tighten inter-character spacing as an alternative to truncation, provided that the ratio of the text width to the line fragment width does not exceed 1.0 + tighteningFactorForTruncation. Otherwise the text will be truncated at a location determined by the line break mode. The default value is 0.05.

+ * Original signature : `public abstract float tighteningFactorForTruncation()`

+ * *native declaration : :142* + */ + abstract fun tighteningFactorForTruncation(): Float + + /** + * Specifies whether the paragraph is to be treated as a header for purposes of HTML generation. Should be set to 0 (the default value) if the paragraph is not a header, or from 1 through 6 if the paragraph is to be treated as a header.

+ * Original signature : `NSInteger headerLevel()`

+ * *native declaration : :145* + */ + abstract fun headerLevel(): Int + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSParagraphStyle", _Class::class.java) + + /// native declaration : :12 + const val NSLeftTabStopType: Int = 0 + + /// native declaration : :13 + const val NSRightTabStopType: Int = 1 + + /// native declaration : :14 + const val NSCenterTabStopType: Int = 2 + + /// native declaration : :15 + const val NSDecimalTabStopType: Int = 3 + + /** + * Wrap at word boundaries, default

+ * *native declaration : :20* + */ + const val NSLineBreakByWordWrapping: Int = 0 + + /** + * Wrap at character boundaries

+ * *native declaration : :21* + */ + const val NSLineBreakByCharWrapping: Int = 1 + + /** + * Simply clip

+ * *native declaration : :22* + */ + const val NSLineBreakByClipping: Int = 2 + + /** + * Truncate at head of line: "...wxyz"

+ * *native declaration : :23* + */ + const val NSLineBreakByTruncatingHead: Int = 3 + + /** + * Truncate at tail of line: "abcd..."

+ * *native declaration : :24* + */ + const val NSLineBreakByTruncatingTail: Int = 4 + + /** + * Truncate middle of line: "ab...yz"

+ * *native declaration : :25* + */ + const val NSLineBreakByTruncatingMiddle: Int = 5 + + fun defaultParagraphStyle(): NSParagraphStyle? { + return CLASS.defaultParagraphStyle() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPasteboard.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPasteboard.kt new file mode 100644 index 00000000..0b8aed12 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPasteboard.kt @@ -0,0 +1,204 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSInteger + +/// native declaration : :52 +abstract class NSPasteboard : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `NSPasteboard* generalPasteboard()`

+ * *native declaration : :65* + */ + open fun generalPasteboard(): NSPasteboard? + + /** + * Original signature : `NSPasteboard* pasteboardWithName(NSString*)`

+ * *native declaration : :66* + */ + open fun pasteboardWithName(name: String?): NSPasteboard? + + /** + * Original signature : `NSPasteboard* pasteboardWithUniqueName()`

+ * *native declaration : :67* + */ + open fun pasteboardWithUniqueName(): NSPasteboard? + + /** + * Original signature : `NSArray* typesFilterableTo(NSString*)`

+ * *native declaration : :69* + */ + open fun typesFilterableTo(type: String?): NSArray? + + /** + * Original signature : `NSPasteboard* pasteboardByFilteringFile(NSString*)`

+ * *native declaration : :71* + */ + open fun pasteboardByFilteringFile(filename: String?): NSPasteboard? + + /** + * Original signature : `NSPasteboard* pasteboardByFilteringData(NSData*, NSString*)`

+ * *native declaration : :72* + */ + open fun pasteboardByFilteringData_ofType(data: NSData?, type: String?): NSPasteboard? + + /** + * Original signature : `NSPasteboard* pasteboardByFilteringTypesInPasteboard(NSPasteboard*)`

+ * *native declaration : :73* + */ + open fun pasteboardByFilteringTypesInPasteboard(pboard: NSPasteboard?): NSPasteboard? + } + + /** + * Original signature : `NSString* name()`

+ * *native declaration : :75* + */ + abstract fun name(): String? + + /** + * Original signature : `void releaseGlobally()`

+ * *native declaration : :77* + */ + abstract fun releaseGlobally() + + fun declareTypes(newTypes: NSArray?, newOwner: org.rococoa.ID?): Int { + return this.declareTypes_owner(newTypes, newOwner) + } + + /** + * Original signature : `NSInteger declareTypes(NSArray*, id)`

+ * *native declaration : :79* + */ + abstract fun declareTypes_owner(newTypes: NSArray?, newOwner: org.rococoa.ID?): Int + + fun addTypes(newTypes: NSArray?, newOwner: org.rococoa.ID?): NSInteger? { + return this.addTypes_owner(newTypes, newOwner) + } + + /** + * Original signature : `NSInteger addTypes(NSArray*, id)`

+ * *native declaration : :80* + */ + abstract fun addTypes_owner(newTypes: NSArray?, newOwner: org.rococoa.ID?): NSInteger? + + /** + * Original signature : `NSInteger changeCount()`

+ * *native declaration : :81* + */ + abstract fun changeCount(): NSInteger? + + /** + * Original signature : `NSArray* types()`

+ * *native declaration : :83* + */ + abstract fun types(): NSArray? + + /** + * Original signature : `NSString* availableTypeFromArray(NSArray*)`

+ * *native declaration : :84* + */ + abstract fun availableTypeFromArray(types: NSArray?): String? + + /** + * Original signature : `BOOL setData(NSData*, NSString*)`

+ * *native declaration : :86* + */ + abstract fun setData_forType(data: NSData?, dataType: String?): Boolean + + /** + * Original signature : `NSData* dataForType(NSString*)`

+ * *native declaration : :87* + */ + abstract fun dataForType(dataType: String?): NSData? + + /** + * Original signature : `BOOL setPropertyList(id, NSString*)`

+ * *native declaration : :89* + */ + abstract fun setPropertyList_forType(plist: NSObject?, dataType: String?): Boolean + + fun setPropertyListForType(plist: NSObject?, dataType: String?): Boolean { + return this.setPropertyList_forType(plist, dataType) + } + + /** + * Original signature : `id propertyListForType(NSString*)`

+ * *native declaration : :90* + */ + abstract fun propertyListForType(dataType: String?): NSObject? + + fun setStringForType(string: String?, dataType: String?): Boolean { + return this.setString_forType(string, dataType) + } + + /** + * Original signature : `BOOL setString(NSString*, NSString*)`

+ * *native declaration : :92* + */ + abstract fun setString_forType(string: String?, dataType: String?): Boolean + + /** + * Original signature : `NSString* stringForType(NSString*)`

+ * *native declaration : :93* + */ + abstract fun stringForType(dataType: String?): String? + + /** + * Original signature : `BOOL writeFileContents(NSString*)`

+ * *from NSFileContents native declaration : :98* + */ + abstract fun writeFileContents(filename: String?): Boolean + + /** + * Original signature : `NSString* readFileContentsType(NSString*, NSString*)`

+ * *from NSFileContents native declaration : :99* + */ + abstract fun readFileContentsType_toFile(type: String?, filename: String?): String? + + /** + * Original signature : `BOOL writeFileWrapper(NSFileWrapper*)`

+ * *from NSFileContents native declaration : :101* + */ + abstract fun writeFileWrapper(wrapper: com.sun.jna.Pointer?): Boolean + + /** + * Original signature : `NSFileWrapper* readFileWrapper()`

+ * *from NSFileContents native declaration : :102* + */ + abstract fun readFileWrapper(): com.sun.jna.Pointer? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSPasteboard", _Class::class.java) + + fun generalPasteboard(): NSPasteboard? { + return CLASS.generalPasteboard() + } + + fun pasteboardWithName(name: String?): NSPasteboard? { + return CLASS.pasteboardWithName(name) + } + + val ColorPboardType: String? = "NSColor pasteboard type" + val FileContentsPboardType: String? = "NXFileContentsPboardType" + val FilenamesPboardType: String? = "NSFilenamesPboardType" + val FontPboardType: String? = "NeXT font pasteboard type" + val PostScriptPboardType: String? = "NeXT Encapsulated PostScript v1.2 pasteboard type" + val RulerPboardType: String? = "NeXT ruler pasteboard type" + val RTFPboardType: String? = "NeXT Rich Text Format v1.0 pasteboard type" + val RTFDPboardType: String? = "NeXT RTFD pasteboard type" + val PICTPboardType: String? = "Apple PICT pasteboard type" + val StringPboardType: String? = "NSStringPboardType" + val TabularTextPboardType: String? = "NeXT tabular text pasteboard type" + val TIFFPboardType: String? = "NeXT TIFF v4.0 pasteboard type" + val URLPboardType: String? = "Apple URL pasteboard type" + val PDFPboardType: String? = "Apple PDF pasteboard type" + val HTMLPboardType: String? = "Apple HTML pasteboard type" + val VCardPboardType: String? = "Apple VCard pasteboard type" + val FilesPromisePboardType: String? = "Apple files promise pasteboard type" + val GeneralPboard: String? = "Apple CFPasteboard general" + val FontPboard: String? = "Apple CFPasteboard font" + val RulerPboard: String? = "Apple CFPasteboard ruler" + val FindPboard: String? = "Apple CFPasteboard find" + val DragPboard: String? = "Apple CFPasteboard drag" + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPathControl.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPathControl.kt new file mode 100644 index 00000000..c304656b --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPathControl.kt @@ -0,0 +1,32 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSRect + +abstract class NSPathControl : NSControl() { + interface _Class : ObjCClass { + open fun alloc(): NSPathControl + } + + @Override + abstract override fun initWithFrame(frameRect: NSRect?): NSPathControl + + abstract fun URL(): NSURL? + + abstract fun setURL(aString: NSURL?) + + abstract fun setDelegate(delegate: ID?) + + interface Delegate { + open fun pathControl_willDisplayOpenPanel(control: NSPathControl?, panel: NSOpenPanel?) + } + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSPathControl", _Class::class.java) + + fun pathControlWithFrame(frameRect: NSRect?): NSPathControl? { + return CLASS.alloc().initWithFrame(frameRect) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPopUpButton.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPopUpButton.kt new file mode 100644 index 00000000..89d93c8e --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPopUpButton.kt @@ -0,0 +1,207 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSRect + +/// native declaration : :10 +abstract class NSPopUpButton : NSButton() { + interface _Class : ObjCClass { + open fun alloc(): NSPopUpButton + } + + abstract fun initWithFrame_pullsDown(frameRect: NSRect?, flag: Boolean): NSPopUpButton? + + /** + * Behavior settings

+ * Original signature : `void setPullsDown(BOOL)`

+ * *native declaration : :29* + */ + abstract fun setPullsDown(flag: Boolean) + + /** + * Original signature : `BOOL pullsDown()`

+ * *native declaration : :30* + */ + abstract fun pullsDown(): Boolean + + /** + * Original signature : `void setAutoenablesItems(BOOL)`

+ * *native declaration : :32* + */ + abstract fun setAutoenablesItems(flag: Boolean) + + /** + * Original signature : `BOOL autoenablesItems()`

+ * *native declaration : :33* + */ + abstract fun autoenablesItems(): Boolean + + /** + * Adding and removing items

+ * Original signature : `void addItemWithTitle(NSString*)`

+ * *native declaration : :40* + */ + abstract fun addItemWithTitle(title: String?) + + /** + * Original signature : `void addItemsWithTitles(NSArray*)`

+ * *native declaration : :41* + */ + abstract fun addItemsWithTitles(itemTitles: NSArray?) + + /** + * Original signature : `void insertItemWithTitle(NSString*, NSInteger)`

+ * *native declaration : :42* + */ + abstract fun insertItemWithTitle_atIndex(title: String?, index: NSInteger?) + + /** + * Original signature : `void removeItemWithTitle(NSString*)`

+ * *native declaration : :44* + */ + abstract fun removeItemWithTitle(title: String?) + + /** + * Original signature : `void removeItemAtIndex(NSInteger)`

+ * *native declaration : :45* + */ + abstract fun removeItemAtIndex(index: NSInteger?) + + /** + * Original signature : `void removeAllItems()`

+ * *native declaration : :46* + */ + abstract fun removeAllItems() + + /** + * Accessing the items

+ * Original signature : `NSArray* itemArray()`

+ * *native declaration : :50* + */ + abstract fun itemArray(): NSArray? + + /** + * Original signature : `NSInteger numberOfItems()`

+ * *native declaration : :51* + */ + abstract fun numberOfItems(): NSInteger? + + /** + * Original signature : `NSInteger indexOfItem(NSMenuItem*)`

+ * *native declaration : :53* + */ + abstract fun indexOfItem(item: NSMenuItem?): NSInteger? + + /** + * Original signature : `NSInteger indexOfItemWithTitle(NSString*)`

+ * *native declaration : :54* + */ + abstract fun indexOfItemWithTitle(title: String?): NSInteger? + + /** + * Original signature : `NSInteger indexOfItemWithTag(NSInteger)`

+ * *native declaration : :55* + */ + abstract fun indexOfItemWithTag(tag: NSInteger?): NSInteger? + + /** + * Original signature : `NSInteger indexOfItemWithRepresentedObject(null)`

+ * - (NSInteger)indexOfItemWithRepresentedObject:(null)obj; (Argument obj cannot be converted) + */ + abstract fun indexOfItemWithRepresentedObject(`object`: String?): NSInteger? + /** + * *native declaration : :57*

+ * Conversion Error : /// Original signature : `NSInteger indexOfItemWithTarget(null, null)`

+ * - (NSInteger)indexOfItemWithTarget:(null)target andAction:(null)actionSelector; (Argument target cannot be converted) + */ + /** + * Original signature : `NSMenuItem* itemAtIndex(NSInteger)`

+ * *native declaration : :59* + */ + abstract fun itemAtIndex(index: NSInteger?): NSMenuItem? + + /** + * Original signature : `NSMenuItem* itemWithTitle(NSString*)`

+ * *native declaration : :60* + */ + abstract fun itemWithTitle(title: String?): NSMenuItem? + + /** + * Original signature : `NSMenuItem* lastItem()`

+ * *native declaration : :61* + */ + abstract fun lastItem(): NSMenuItem? + + /** + * Dealing with selection

+ * Original signature : `void selectItem(NSMenuItem*)`

+ * *native declaration : :65* + */ + abstract fun selectItem(item: NSMenuItem?) + + /** + * Original signature : `void selectItemAtIndex(NSInteger)`

+ * *native declaration : :66* + */ + abstract fun selectItemAtIndex(index: NSInteger?) + + /** + * Original signature : `void selectItemWithTitle(NSString*)`

+ * *native declaration : :67* + */ + abstract fun selectItemWithTitle(title: String?) + + /** + * Original signature : `BOOL selectItemWithTag(NSInteger)`

+ * *native declaration : :69* + */ + abstract fun selectItemWithTag(tag: NSInteger?): Boolean + + /** + * Original signature : `NSMenuItem* selectedItem()`

+ * *native declaration : :73* + */ + abstract fun selectedItem(): NSMenuItem? + + /** + * Original signature : `NSInteger indexOfSelectedItem()`

+ * *native declaration : :74* + */ + abstract fun indexOfSelectedItem(): NSInteger? + + /** + * Original signature : `void synchronizeTitleAndSelectedItem()`

+ * *native declaration : :75* + */ + abstract fun synchronizeTitleAndSelectedItem() + + /** + * Title conveniences

+ * Original signature : `NSString* itemTitleAtIndex(NSInteger)`

+ * *native declaration : :78* + */ + abstract fun itemTitleAtIndex(index: NSInteger?): String? + + /** + * Original signature : `NSArray* itemTitles()`

+ * *native declaration : :79* + */ + abstract fun itemTitles(): NSArray? + + /** + * Original signature : `NSString* titleOfSelectedItem()`

+ * *native declaration : :80* + */ + abstract fun titleOfSelectedItem(): String? + + companion object { + val PopUpButtonWillPopUpNotification: String? = "NSPopUpButtonWillPopUpNotification" + + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSPopUpButton", _Class::class.java) + + fun buttonWithFrame(frameRect: NSRect?): NSPopUpButton? { + return CLASS.alloc().initWithFrame_pullsDown(frameRect, false) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPopUpButtonCell.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPopUpButtonCell.kt new file mode 100644 index 00000000..98b2f36a --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPopUpButtonCell.kt @@ -0,0 +1,276 @@ +package darwin + +import org.rococoa.ObjCObject +import org.rococoa.cocoa.foundation.NSInteger + + +/** + * This file was autogenerated by [JNAerator](http://jnaerator.googlecode.com/),

+ * a tool written by [Olivier Chafik](http://ochafik.free.fr/) that [uses a few opensource projects.](http://code.google.com/p/jnaerator/wiki/CreditsAndLicense).

+ * For help, please visit [NativeLibs4Java](http://nativelibs4java.googlecode.com/), [Rococoa](http://rococoa.dev.java.net/), or [JNA](http://jna.dev.java.net/). + */ +abstract class NSPopUpButtonCell : NSButtonCell() { + /** + * If usesItemFromMenu is true, then pull down popup buttons always show the first item in the menu. That menu item is hidden via [menuItem setHidden:YES]; if you wish to make it visible you can unhide it with setHidden:NO

+ * Original signature : `-(void)setPullsDown:(BOOL)`

+ * *native declaration : NSPopUpButtonCell.h:52* + */ + abstract fun setPullsDown(flag: Boolean) + + /** + * Original signature : `-(BOOL)pullsDown`

+ * *native declaration : NSPopUpButtonCell.h:53* + */ + abstract fun pullsDown(): Boolean + + /** + * Original signature : `-(void)setAutoenablesItems:(BOOL)`

+ * *native declaration : NSPopUpButtonCell.h:55* + */ + abstract fun setAutoenablesItems(flag: Boolean) + + /** + * Original signature : `-(BOOL)autoenablesItems`

+ * *native declaration : NSPopUpButtonCell.h:56* + */ + abstract fun autoenablesItems(): Boolean + /** + * *native declaration : NSPopUpButtonCell.h:58*

+ * Conversion Error : /// Original signature : `-(void)setPreferredEdge:()`

+ * - (void)setPreferredEdge:(null)edge; (Argument edge cannot be converted) + */ + /** + * Original signature : `-(id)preferredEdge`

+ * *native declaration : NSPopUpButtonCell.h:59* + */ + abstract fun preferredEdge(): NSObject? + + /** + * Original signature : `-(void)setUsesItemFromMenu:(BOOL)`

+ * *native declaration : NSPopUpButtonCell.h:62* + */ + abstract fun setUsesItemFromMenu(flag: Boolean) + + /** + * Original signature : `-(BOOL)usesItemFromMenu`

+ * *native declaration : NSPopUpButtonCell.h:63* + */ + abstract fun usesItemFromMenu(): Boolean + + /** + * Original signature : `-(void)setAltersStateOfSelectedItem:(BOOL)`

+ * *native declaration : NSPopUpButtonCell.h:66* + */ + abstract fun setAltersStateOfSelectedItem(flag: Boolean) + + /** + * Original signature : `-(BOOL)altersStateOfSelectedItem`

+ * *native declaration : NSPopUpButtonCell.h:67* + */ + abstract fun altersStateOfSelectedItem(): Boolean + + /** + * Adding and removing items

+ * Original signature : `-(void)addItemWithTitle:(NSString*)`

+ * *native declaration : NSPopUpButtonCell.h:71* + */ + abstract fun addItemWithTitle(title: NSString?) + + /** + * Original signature : `-(void)addItemsWithTitles:(NSArray*)`

+ * *native declaration : NSPopUpButtonCell.h:72* + */ + abstract fun addItemsWithTitles(itemTitles: NSArray?) + + /** + * Original signature : `-(void)insertItemWithTitle:(NSString*) atIndex:(NSInteger)`

+ * *native declaration : NSPopUpButtonCell.h:73* + */ + abstract fun insertItemWithTitle_atIndex(title: NSString?, index: NSInteger?) + + /** + * Original signature : `-(void)removeItemWithTitle:(NSString*)`

+ * *native declaration : NSPopUpButtonCell.h:75* + */ + abstract fun removeItemWithTitle(title: NSString?) + + /** + * Original signature : `-(void)removeItemAtIndex:(NSInteger)`

+ * *native declaration : NSPopUpButtonCell.h:76* + */ + abstract fun removeItemAtIndex(index: NSInteger?) + + /** + * Original signature : `-(void)removeAllItems`

+ * *native declaration : NSPopUpButtonCell.h:77* + */ + abstract fun removeAllItems() + + /** + * Accessing the items

+ * Original signature : `-(NSArray*)itemArray`

+ * *native declaration : NSPopUpButtonCell.h:81* + */ + abstract fun itemArray(): NSArray? + + /** + * Original signature : `-(NSInteger)numberOfItems`

+ * *native declaration : NSPopUpButtonCell.h:82* + */ + abstract fun numberOfItems(): NSInteger? + + /** + * Original signature : `-(NSInteger)indexOfItem:(NSMenuItem*)`

+ * *native declaration : NSPopUpButtonCell.h:84* + */ + abstract fun indexOfItem(item: NSMenuItem?): NSInteger? + + /** + * Original signature : `-(NSInteger)indexOfItemWithTitle:(NSString*)`

+ * *native declaration : NSPopUpButtonCell.h:85* + */ + abstract fun indexOfItemWithTitle(title: NSString?): NSInteger? + + /** + * Original signature : `-(NSInteger)indexOfItemWithTag:(NSInteger)`

+ * *native declaration : NSPopUpButtonCell.h:86* + */ + abstract fun indexOfItemWithTag(tag: NSInteger?): NSInteger? + + /** + * Original signature : `-(NSInteger)indexOfItemWithRepresentedObject:(id)`

+ * *native declaration : NSPopUpButtonCell.h:87* + */ + abstract fun indexOfItemWithRepresentedObject(obj: ObjCObject?): NSInteger? + + /** + * Original signature : `-(NSInteger)indexOfItemWithTarget:(id) andAction:(SEL)`

+ * *native declaration : NSPopUpButtonCell.h:88* + */ + abstract fun indexOfItemWithTarget_andAction(target: ObjCObject?, actionSelector: org.rococoa.Selector?): NSInteger? + + /** + * Original signature : `-(NSMenuItem*)itemAtIndex:(NSInteger)`

+ * *native declaration : NSPopUpButtonCell.h:90* + */ + abstract fun itemAtIndex(index: NSInteger?): NSMenuItem? + + /** + * Original signature : `-(NSMenuItem*)itemWithTitle:(NSString*)`

+ * *native declaration : NSPopUpButtonCell.h:91* + */ + abstract fun itemWithTitle(title: NSString?): NSMenuItem? + + /** + * Original signature : `-(NSMenuItem*)lastItem`

+ * *native declaration : NSPopUpButtonCell.h:92* + */ + abstract fun lastItem(): NSMenuItem? + + /** + * Dealing with selection

+ * Original signature : `-(void)selectItem:(NSMenuItem*)`

+ * *native declaration : NSPopUpButtonCell.h:96* + */ + abstract fun selectItem(item: NSMenuItem?) + + /** + * Original signature : `-(void)selectItemAtIndex:(NSInteger)`

+ * *native declaration : NSPopUpButtonCell.h:97* + */ + abstract fun selectItemAtIndex(index: NSInteger?) + + /** + * Original signature : `-(void)selectItemWithTitle:(NSString*)`

+ * *native declaration : NSPopUpButtonCell.h:98* + */ + abstract fun selectItemWithTitle(title: NSString?) + + /** + * Original signature : `-(BOOL)selectItemWithTag:(NSInteger)`

+ * *native declaration : NSPopUpButtonCell.h:100* + */ + abstract fun selectItemWithTag(tag: NSInteger?): Boolean + + /** + * Original signature : `-(void)setTitle:(NSString*)`

+ * *native declaration : NSPopUpButtonCell.h:102* + */ + abstract fun setTitle(aString: NSString?) + + /** + * Original signature : `-(NSMenuItem*)selectedItem`

+ * *native declaration : NSPopUpButtonCell.h:104* + */ + abstract fun selectedItem(): NSMenuItem? + + /** + * Original signature : `-(NSInteger)indexOfSelectedItem`

+ * *native declaration : NSPopUpButtonCell.h:105* + */ + abstract fun indexOfSelectedItem(): NSInteger? + + /** + * Original signature : `-(void)synchronizeTitleAndSelectedItem`

+ * *native declaration : NSPopUpButtonCell.h:106* + */ + abstract fun synchronizeTitleAndSelectedItem() + + /** + * Title conveniences

+ * Original signature : `-(NSString*)itemTitleAtIndex:(NSInteger)`

+ * *native declaration : NSPopUpButtonCell.h:110* + */ + abstract fun itemTitleAtIndex(index: NSInteger?): NSString? + + /** + * Original signature : `-(NSArray*)itemTitles`

+ * *native declaration : NSPopUpButtonCell.h:111* + */ + abstract fun itemTitles(): NSArray? + + /** + * Original signature : `-(NSString*)titleOfSelectedItem`

+ * *native declaration : NSPopUpButtonCell.h:112* + */ + abstract fun titleOfSelectedItem(): NSString? + /** + * *native declaration : NSPopUpButtonCell.h:114*

+ * Conversion Error : /// Original signature : `-(void)attachPopUpWithFrame:() inView:(NSView*)`

+ * - (void)attachPopUpWithFrame:(null)cellFrame inView:(NSView*)controlView; (Argument cellFrame cannot be converted) + */ + /** + * Original signature : `-(void)dismissPopUp`

+ * *native declaration : NSPopUpButtonCell.h:115* + */ + abstract fun dismissPopUp() + /** + * *native declaration : NSPopUpButtonCell.h:116*

+ * Conversion Error : /// Original signature : `-(void)performClickWithFrame:() inView:(NSView*)`

+ * - (void)performClickWithFrame:(null)frame inView:(NSView*)controlView; (Argument frame cannot be converted) + */ + /** + * Arrow position for bezel style and borderless popups.

+ * Original signature : `-(NSPopUpArrowPosition)arrowPosition`

+ * *native declaration : NSPopUpButtonCell.h:119* + */ + abstract + /** + * @see AppKitLibrary.NSPopUpArrowPosition + */ + fun arrowPosition(): Int + + /** + * Original signature : `-(void)setArrowPosition:(NSPopUpArrowPosition)`

+ * *native declaration : NSPopUpButtonCell.h:120*

+ * + * @param position @see AppKitLibrary#NSPopUpArrowPosition + */ + abstract fun setArrowPosition(position: Int) + + /** + * Original signature : `-(void)setObjectValue:(id)`

+ * *native declaration : NSPopUpButtonCell.h:124* + */ + abstract fun setObjectValue(obj: ObjCObject?) +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPrintInfo.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPrintInfo.kt new file mode 100644 index 00000000..447d8eb8 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPrintInfo.kt @@ -0,0 +1,327 @@ +package darwin + +import org.rococoa.ObjCClass + +/** + * This file was autogenerated by [JNAerator](http://jnaerator.googlecode.com/),

+ * a tool written by [Olivier Chafik](http://ochafik.free.fr/) that [uses a few opensource projects.](http://code.google.com/p/jnaerator/wiki/CreditsAndLicense).

+ * For help, please visit [NativeLibs4Java](http://nativelibs4java.googlecode.com/), [Rococoa](http://rococoa.dev.java.net/), or [JNA](http://jna.dev.java.net/). + */ +abstract class NSPrintInfo : NSObject() { + /** + * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/AppKitDefines.h*

+ * enum values + */ + interface NSPrintingOrientation { + companion object { + const val NSPortraitOrientation: Int = 0 + const val NSLandscapeOrientation: Int = 1 + } + } + + /** + * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/AppKitDefines.h*

+ * enum values + */ + interface NSPrintingPaginationMode { + companion object { + const val NSAutoPagination: Int = 0 + const val NSFitPagination: Int = 1 + const val NSClipPagination: Int = 2 + } + } + + interface _Class : ObjCClass { + /** + * Set or get the "shared" instance of NSPrintInfo. The shared print info object is the one that is used automatically by -[NSPageLayout runModal] and +[NSPrintOperation printOperationWithView:].

+ * Original signature : `+(void)setSharedPrintInfo:(NSPrintInfo*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:66* + */ + open fun setSharedPrintInfo(printInfo: NSPrintInfo?) + + /** + * Original signature : `+(NSPrintInfo*)sharedPrintInfo`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:67* + */ + open fun sharedPrintInfo(): NSPrintInfo? + + /** + * Return the default printer, if one has been selected by the user, nil otherwise.

+ * Original signature : `+(NSPrinter*)defaultPrinter`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:127* + */ + open fun defaultPrinter(): com.sun.jna.Pointer? + + /** + * A method that was deprecated in Mac OS 10.2. +[NSPrintInfo setDefaultPrinter:] does nothing.

+ * Original signature : `+(void)setDefaultPrinter:(NSPrinter*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:130* + */ + open fun setDefaultPrinter(printer: com.sun.jna.Pointer?) + + /** + * A method that was deprecated in Mac OS 10.2. NSPrintInfo's implementation of this method recognizes only a small fixed set of paper names, and does not take the details of any particular printer into account. You should use -[NSPrinter pageSizeForPaper:] instead.

+ * Original signature : `+(id)sizeForPaperName:(NSString*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:133* + */ + open fun sizeForPaperName(name: String?): NSObject? + + /// native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h + open fun alloc(): NSPrintInfo + } + + /** + * Given a dictionary that contains attribute entries, initialize. Attributes that are recognized by the NSPrintInfo class will be silently validated in the context of the printer selected by the attributes dictionary, or the default printer if the attributes dictionary selects no printer. Attributes that are not recognized by the NSPrintInfo class will be preserved, and returned in the dictionary returned by the -dictionary method, but otherwise ignored. This is the designated initializer for this class.

+ * Original signature : `-(id)initWithDictionary:(NSDictionary*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:70* + */ + abstract fun initWithDictionary(attributes: NSDictionary?): NSPrintInfo? + + /** + * Return a dictionary that contains attribute entries. This dictionary may contain attributes that were not specified in the dictionary originally passed to this object by -initWithDictionary. Changes to this dictionary will be reflected in the values returned by subsequent invocations of other of this class' methods.

+ * Original signature : `-(NSMutableDictionary*)dictionary`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:73* + */ + abstract fun dictionary(): com.sun.jna.Pointer? + + /** + * Set or get the values of the paper attributes. Because an NSPrintInfo's paper name, paper size, and orientation attributes must be kept consistent, invocation of any of the setting methods in this group may affect the values returned by subsequent invocations of any of the getting methods in this group. For example, paper name and paper size must always agree, and the value returned by -paperSize always takes orientation into account.

+ * Original signature : `-(void)setPaperName:(NSString*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:76* + */ + abstract fun setPaperName(name: com.sun.jna.Pointer?) + /** + * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:77*

+ * Conversion Error : /// Original signature : `-(void)setPaperSize:()`

+ * - (void)setPaperSize:(null)size; (Argument size cannot be converted) + */ + /** + * Original signature : `-(void)setOrientation:(NSPrintingOrientation)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:78*

+ * + * @param orientation @see AppKitLibrary#NSPrintingOrientation + */ + abstract fun setOrientation(orientation: Int) + + /** + * Original signature : `-(NSString*)paperName`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:79* + */ + abstract fun paperName(): com.sun.jna.Pointer? + + /** + * Original signature : `-(id)paperSize`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:80* + */ + abstract fun paperSize(): NSObject? + + /** + * Original signature : `-(NSPrintingOrientation)orientation`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:81* + */ + abstract + /** + * @see AppKitLibrary.NSPrintingOrientation + */ + fun orientation(): Int + + /** + * Set or get the values of the pagination attributes.

+ * Original signature : `-(void)setLeftMargin:(float)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:84* + */ + abstract fun setLeftMargin(margin: Float) + + /** + * Original signature : `-(void)setRightMargin:(float)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:85* + */ + abstract fun setRightMargin(margin: Float) + + /** + * Original signature : `-(void)setTopMargin:(float)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:86* + */ + abstract fun setTopMargin(margin: Float) + + /** + * Original signature : `-(void)setBottomMargin:(float)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:87* + */ + abstract fun setBottomMargin(margin: Float) + + /** + * Original signature : `-(float)leftMargin`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:88* + */ + abstract fun leftMargin(): Float + + /** + * Original signature : `-(float)rightMargin`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:89* + */ + abstract fun rightMargin(): Float + + /** + * Original signature : `-(float)topMargin`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:90* + */ + abstract fun topMargin(): Float + + /** + * Original signature : `-(float)bottomMargin`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:91* + */ + abstract fun bottomMargin(): Float + + /** + * Original signature : `-(void)setHorizontallyCentered:(BOOL)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:92* + */ + abstract fun setHorizontallyCentered(flag: Boolean) + + /** + * Original signature : `-(void)setVerticallyCentered:(BOOL)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:93* + */ + abstract fun setVerticallyCentered(flag: Boolean) + + /** + * Original signature : `-(BOOL)isHorizontallyCentered`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:94* + */ + abstract fun isHorizontallyCentered(): Boolean + + /** + * Original signature : `-(BOOL)isVerticallyCentered`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:95* + */ + abstract fun isVerticallyCentered(): Boolean + + /** + * Original signature : `-(void)setHorizontalPagination:(NSPrintingPaginationMode)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:96*

+ * + * @param mode @see AppKitLibrary#NSPrintingPaginationMode + */ + abstract fun setHorizontalPagination(mode: Int) + + /** + * Original signature : `-(void)setVerticalPagination:(NSPrintingPaginationMode)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:97*

+ * + * @param mode @see AppKitLibrary#NSPrintingPaginationMode + */ + abstract fun setVerticalPagination(mode: Int) + + /** + * Original signature : `-(NSPrintingPaginationMode)horizontalPagination`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:98* + */ + abstract + /** + * @see AppKitLibrary.NSPrintingPaginationMode + */ + fun horizontalPagination(): Int + + /** + * Original signature : `-(NSPrintingPaginationMode)verticalPagination`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:99* + */ + abstract + /** + * @see AppKitLibrary.NSPrintingPaginationMode + */ + fun verticalPagination(): Int + + /** + * Set or get the value of the job disposition attribute.

+ * Original signature : `-(void)setJobDisposition:(NSString*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:102* + */ + abstract fun setJobDisposition(disposition: com.sun.jna.Pointer?) + + /** + * Original signature : `-(NSString*)jobDisposition`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:103* + */ + abstract fun jobDisposition(): com.sun.jna.Pointer? + + /** + * Set or get the printer specified by this object.

+ * Original signature : `-(void)setPrinter:(NSPrinter*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:106* + */ + abstract fun setPrinter(printer: com.sun.jna.Pointer?) + + /** + * Original signature : `-(NSPrinter*)printer`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:107* + */ + abstract fun printer(): com.sun.jna.Pointer? + + /** + * Validate all of the attributes encapsulated by this object. This method is invoked automatically before the object is used by an NSPrintOperation. This method may be overridden to perform validation of attributes that are not recognized by the NSPrintInfo class.

+ * Original signature : `-(void)setUpPrintOperationDefaultValues`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:110* + */ + abstract fun setUpPrintOperationDefaultValues() + + /** + * Return the imageable area of a sheet of paper specified by this object, taking into account the current printer, paper size, and orientation settings, but not scaling. "Imageable area" is the maximum area that can possibly be marked on by the printer hardware, not the area defined by the current margin settings. The rectangle is in a coordinate space measured by points, with (0, 0) being the lower-left corner of the oriented sheet and (paperWidth, paperHeight) being the upper-right corner of the oriented sheet. The imageable bounds may extend past the edges of the sheet when, for example, a printer driver specifies it so that borderless printing can be done reliably.

+ * Original signature : `-(id)imageablePageBounds`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:115* + */ + abstract fun imageablePageBounds(): NSObject? + + /** + * Return the human-readable name of the currently selected paper size, suitable for presentation in user interfaces. This will typically be different from the name returned by -paperName, which is almost never suitable for presentation to to the user.

+ * Original signature : `-(NSString*)localizedPaperName`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:122* + */ + abstract fun localizedPaperName(): com.sun.jna.Pointer? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSPrintInfo", _Class::class.java) + + /** + * Set or get the "shared" instance of NSPrintInfo. The shared print info object is the one that is used automatically by -[NSPageLayout runModal] and +[NSPrintOperation printOperationWithView:].

+ * Original signature : `+(void)setSharedPrintInfo:(NSPrintInfo*)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/AppKitDefines.h:66* + */ + fun setSharedPrintInfo(printInfo: NSPrintInfo?) { + CLASS.setSharedPrintInfo(printInfo) + } + + /** + * Original signature : `+(NSPrintInfo*)sharedPrintInfo`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:67* + */ + fun sharedPrintInfo(): NSPrintInfo? { + return CLASS.sharedPrintInfo() + } + + /** + * Factory method

+ * + * @see .initWithDictionary + */ + fun createWithDictionary(attributes: NSDictionary?): NSPrintInfo? { + return CLASS.alloc().initWithDictionary(attributes) + } + + /** + * Return the default printer, if one has been selected by the user, nil otherwise.

+ * Original signature : `+(NSPrinter*)defaultPrinter`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:127* + */ + fun defaultPrinter(): com.sun.jna.Pointer? { + return CLASS.defaultPrinter() + } + + /// native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h + fun alloc(): NSPrintInfo? { + return CLASS.alloc() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPrintOperation.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPrintOperation.kt new file mode 100644 index 00000000..58ac8c33 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPrintOperation.kt @@ -0,0 +1,287 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSInteger + +/** + * This file was autogenerated by [JNAerator](http://jnaerator.googlecode.com/),

+ * a tool written by [Olivier Chafik](http://ochafik.free.fr/) that [uses a few opensource projects.](http://code.google.com/p/jnaerator/wiki/CreditsAndLicense).

+ * For help, please visit [NativeLibs4Java](http://nativelibs4java.googlecode.com/), [Rococoa](http://rococoa.dev.java.net/), or [JNA](http://jna.dev.java.net/). + */ +abstract class NSPrintOperation : NSObject() { + interface _Class : ObjCClass { + /** + * Factory methods that create a new NSPrintOperation for printing, copying to Portable Document Format, or copying to Encapsulated PostScript. The passed-in NSPrintInfo is copied, and the copy is retained by the new NSPrintOperation. (So, no need to copy the NSPrintInfo you pass to these.) You can get the copy with -printInfo.

+ * Original signature : `+(NSPrintOperation*)printOperationWithView:(NSView*) printInfo:(NSPrintInfo*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:90* + */ + open fun printOperationWithView_printInfo(view: NSView?, printInfo: NSPrintInfo?): NSPrintOperation? + /** + * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:91*

+ * Conversion Error : /// Original signature : `+(NSPrintOperation*)PDFOperationWithView:(NSView*) insideRect:() toData:(NSMutableData*) printInfo:(NSPrintInfo*)`

+ * + (NSPrintOperation*)PDFOperationWithView:(NSView*)view insideRect:(null)rect toData:(NSMutableData*)data printInfo:(NSPrintInfo*)printInfo; (Argument rect cannot be converted) + */ + /** + * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:92*

+ * Conversion Error : /// Original signature : `+(NSPrintOperation*)PDFOperationWithView:(NSView*) insideRect:() toPath:(NSString*) printInfo:(NSPrintInfo*)`

+ * + (NSPrintOperation*)PDFOperationWithView:(NSView*)view insideRect:(null)rect toPath:(NSString*)path printInfo:(NSPrintInfo*)printInfo; (Argument rect cannot be converted) + */ + /** + * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:93*

+ * Conversion Error : /// Original signature : `+(NSPrintOperation*)EPSOperationWithView:(NSView*) insideRect:() toData:(NSMutableData*) printInfo:(NSPrintInfo*)`

+ * + (NSPrintOperation*)EPSOperationWithView:(NSView*)view insideRect:(null)rect toData:(NSMutableData*)data printInfo:(NSPrintInfo*)printInfo; (Argument rect cannot be converted) + */ + /** + * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:94*

+ * Conversion Error : /// Original signature : `+(NSPrintOperation*)EPSOperationWithView:(NSView*) insideRect:() toPath:(NSString*) printInfo:(NSPrintInfo*)`

+ * + (NSPrintOperation*)EPSOperationWithView:(NSView*)view insideRect:(null)rect toPath:(NSString*)path printInfo:(NSPrintInfo*)printInfo; (Argument rect cannot be converted) + */ + /** + * Slight conveniences, for use when the application's global NSPrintInfo is appropriate. Each of these methods invokes [NSPrintInfo sharedPrintInfo] and then invokes the like-named method listed above.

+ * Original signature : `+(NSPrintOperation*)printOperationWithView:(NSView*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:98* + */ + open fun printOperationWithView(view: NSView?): NSPrintOperation? + /** + * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:99*

+ * Conversion Error : /// Original signature : `+(NSPrintOperation*)PDFOperationWithView:(NSView*) insideRect:() toData:(NSMutableData*)`

+ * + (NSPrintOperation*)PDFOperationWithView:(NSView*)view insideRect:(null)rect toData:(NSMutableData*)data; (Argument rect cannot be converted) + */ + /** + * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:100*

+ * Conversion Error : /// Original signature : `+(NSPrintOperation*)EPSOperationWithView:(NSView*) insideRect:() toData:(NSMutableData*)`

+ * + (NSPrintOperation*)EPSOperationWithView:(NSView*)view insideRect:(null)rect toData:(NSMutableData*)data; (Argument rect cannot be converted) + */ + /** + * The current print operation for this thread. If this is nil, there is no current operation for the current thread.

+ * Original signature : `+(NSPrintOperation*)currentOperation`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:104* + */ + open fun currentOperation(): NSPrintOperation? + + /** + * Original signature : `+(void)setCurrentOperation:(NSPrintOperation*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:105* + */ + open fun setCurrentOperation(operation: NSPrintOperation?) + + /// native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h + open fun alloc(): NSPrintOperation? + } + + /** + * Return YES if the operation for copying to PDF or EPS, NO if it's for printing.

+ * Original signature : `-(BOOL)isCopyingOperation`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:109* + */ + abstract fun isCopyingOperation(): Boolean + + /** + * The title of the print job. If a job title is set it overrides anything that might be gotten by sending the printed view an [NSView(NSPrinting) printJobTitle] message.

+ * Original signature : `-(void)setJobTitle:(NSString*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:115* + */ + abstract fun setJobTitle(jobTitle: com.sun.jna.Pointer?) + + /** + * Original signature : `-(NSString*)jobTitle`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:116* + */ + abstract fun jobTitle(): com.sun.jna.Pointer? + + /** + * Whether the print and progress panels are shown during the operation.

+ * Original signature : `-(void)setShowsPrintPanel:(BOOL)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:124* + */ + abstract fun setShowsPrintPanel(flag: Boolean) + + /** + * Original signature : `-(BOOL)showsPrintPanel`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:125* + */ + abstract fun showsPrintPanel(): Boolean + + /** + * Original signature : `-(void)setShowsProgressPanel:(BOOL)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:126* + */ + abstract fun setShowsProgressPanel(flag: Boolean) + + /** + * Original signature : `-(BOOL)showsProgressPanel`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:127* + */ + abstract fun showsProgressPanel(): Boolean + + /** + * The print panel to be presented by the operation when it is run, if showsProgressPanel is YES and isCopyingOperation is NO. -printPanel will create a new NSPrintPanel if one hasn't been set yet.

+ * Original signature : `-(void)setPrintPanel:(NSPrintPanel*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:133* + */ + abstract fun setPrintPanel(panel: NSPrintPanel?) + + /** + * Original signature : `-(NSPrintPanel*)printPanel`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:134* + */ + abstract fun printPanel(): NSPrintPanel? + + /** + * Whether the print operation should spawn a separate thread in which to run itself.

+ * Original signature : `-(void)setCanSpawnSeparateThread:(BOOL)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:138* + */ + abstract fun setCanSpawnSeparateThread(canSpawnSeparateThread: Boolean) + + /** + * Original signature : `-(BOOL)canSpawnSeparateThread`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:139* + */ + abstract fun canSpawnSeparateThread(): Boolean + + /** + * The page order that will be used to generate the pages in this job. This is the physical page order of the pages. It depends on the stacking order of the printer, the capability of the app to reverse page order, etc.

+ * Original signature : `-(void)setPageOrder:(NSPrintingPageOrder)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:143*

+ * + * @param pageOrder @see AppKitLibrary#NSPrintingPageOrder + */ + abstract fun setPageOrder(pageOrder: Int) + + /** + * Original signature : `-(NSPrintingPageOrder)pageOrder`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:144* + */ + abstract + /** + * @see AppKitLibrary.NSPrintingPageOrder + */ + fun pageOrder(): Int + + /** + * Do the print operation, with panels that are document-modal to a specific window. When the operation has been completed, send the message selected by didRunSelector to the delegate, with the contextInfo as the last argument. The method selected by didRunSelector must have the same signature as:

+ * - (void)printOperationDidRun:(NSPrintOperation *)printOperation success:(BOOL)success contextInfo:(void *)contextInfo;

+ * This can only be invoked once. Create a new NSPrintOperation instance for each operation. When this method completes, the object is removed from being the current operation if it is the current operation.

+ * Original signature : `-(void)runOperationModalForWindow:(NSWindow*) delegate:(id) didRunSelector:(SEL) contextInfo:(void*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:152* + */ + abstract fun runOperationModalForWindow_delegate_didRunSelector_contextInfo( + docWindow: NSWindow?, + delegate: org.rococoa.ID?, + didRunSelector: org.rococoa.Selector?, + contextInfo: NSObject? + ) + + /** + * Do the print operation, with application-modal panels. Return YES if the operation completed successfully, NO if there was an error or the user cancelled the operation. This can only be invoked once. Create a new NSPrintOperation instance for each operation. When this method completes, the object is removed from being the current operation if it is the current operation.

+ * Original signature : `-(BOOL)runOperation`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:156* + */ + abstract fun runOperation(): Boolean + + /** + * The view being printed.

+ * Original signature : `-(NSView*)view`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:160* + */ + abstract fun view(): NSView? + + /** + * The print info of the operation. -printInfo always returns a copy of the NSPrintInfo passed into the factory method used to create the print operation, unless -setPrintInfo: has been invoked, in which case it returns the exact same object passed into -setPrintInfo:. So, the factory methods listed above copy the passed-in NSPrintInfo, but -setPrintInfo: doesn't.

+ * Original signature : `-(NSPrintInfo*)printInfo`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:164* + */ + abstract fun printInfo(): NSPrintInfo? + + /** + * Original signature : `-(void)setPrintInfo:(NSPrintInfo*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:165* + */ + abstract fun setPrintInfo(printInfo: NSPrintInfo?) + + /** + * The context for the output of this operation.

+ * Original signature : `-(NSGraphicsContext*)context`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:169* + */ + abstract fun context(): com.sun.jna.Pointer? + + /** + * The first through last one-based page numbers of the operation as it's being previewed or printed. The first page number might not be 1, and the page count might be NSIntegerMax to indicate that the number of pages is not known, depending on what the printed view returned when sent an [NSView(NSPrinting) knowsPageRange:] message.

+ * Original signature : `-(id)pageRange`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:175* + */ + abstract fun pageRange(): org.rococoa.ID? + + /** + * The current one-based page number of the operation as it's being previewed or printed.

+ * Original signature : `-(NSInteger)currentPage`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:181* + */ + abstract fun currentPage(): NSInteger? + + /** + * Methods that are invoked by the print operation itself as it proceeds. You should not invoke them.

+ * Original signature : `-(NSGraphicsContext*)createContext`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:185* + */ + abstract fun createContext(): com.sun.jna.Pointer? + + /** + * Original signature : `-(void)destroyContext`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:186* + */ + abstract fun destroyContext() + + /** + * Original signature : `-(BOOL)deliverResult`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:187* + */ + abstract fun deliverResult(): Boolean + + /** + * Original signature : `-(void)cleanUpOperation`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:188* + */ + abstract fun cleanUpOperation() + + companion object { + val CLASS: _Class = org.rococoa.Rococoa.createClass("NSPrintOperation", _Class::class.java) + + /** + * Factory methods that create a new NSPrintOperation for printing, copying to Portable Document Format, or copying to Encapsulated PostScript. The passed-in NSPrintInfo is copied, and the copy is retained by the new NSPrintOperation. (So, no need to copy the NSPrintInfo you pass to these.) You can get the copy with -printInfo.

+ * Original signature : `+(NSPrintOperation*)printOperationWithView:(NSView*) printInfo:(NSPrintInfo*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:90* + */ + fun printOperationWithView_printInfo(view: NSView?, printInfo: NSPrintInfo?): NSPrintOperation? { + return CLASS.printOperationWithView_printInfo(view, printInfo) + } + + /** + * Slight conveniences, for use when the application's global NSPrintInfo is appropriate. Each of these methods invokes [NSPrintInfo sharedPrintInfo] and then invokes the like-named method listed above.

+ * Original signature : `+(NSPrintOperation*)printOperationWithView:(NSView*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:98* + */ + fun printOperationWithView(view: NSView?): NSPrintOperation? { + return CLASS.printOperationWithView(view) + } + + /** + * The current print operation for this thread. If this is nil, there is no current operation for the current thread.

+ * Original signature : `+(NSPrintOperation*)currentOperation`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:104* + */ + fun currentOperation(): NSPrintOperation? { + return CLASS.currentOperation() + } + + /** + * Original signature : `+(void)setCurrentOperation:(NSPrintOperation*)`

+ * *native declaration : /System/Library/Frameworks/framework/Headers/AppKitDefines.h:105* + */ + fun setCurrentOperation(operation: NSPrintOperation?) { + CLASS.setCurrentOperation(operation) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPrintPanel.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPrintPanel.kt new file mode 100644 index 00000000..87915c3a --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSPrintPanel.kt @@ -0,0 +1,154 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.ObjCObject +import org.rococoa.cocoa.foundation.NSInteger + +/** + * This file was autogenerated by [JNAerator](http://jnaerator.googlecode.com/),

+ * a tool written by [Olivier Chafik](http://ochafik.free.fr/) that [uses a few opensource projects.](http://code.google.com/p/jnaerator/wiki/CreditsAndLicense).

+ * For help, please visit [NativeLibs4Java](http://nativelibs4java.googlecode.com/), [Rococoa](http://rococoa.dev.java.net/), or [JNA](http://jna.dev.java.net/). + */ +abstract class NSPrintPanel : NSObject(), ObjCObject { + interface _Class : ObjCClass { + /** + * Create a new NSPrintPanel.

+ * Original signature : `+(NSPrintPanel*)printPanel`

+ * *native declaration : NSPrintPanel.h:102* + */ + open fun printPanel(): NSPrintPanel? + + /// native declaration : NSPrintPanel.h + open fun alloc(): NSPrintPanel? + + /// native declaration : NSPrintPanel.h + open fun new_(): NSPrintPanel? + } + + /** + * Original signature : `-(NSArray*)accessoryControllers`

+ * *native declaration : NSPrintPanel.h:110* + */ + abstract fun accessoryControllers(): NSArray? + + /** + * The options described above. In Mac OS 10.5 an -options message sent to a freshly-created NSPrintPanel will return (NSPrintPanelShowsCopies | NSPrintPanelShowsPageRange) unless it was created by an NSPrintOperation, in which case it will also return NSPrintPanelShowsPreview. (See the release notes for backward binary compatibility information though.) To allow your application to take advantage of controls that may be added by default in future versions of Mac OS X, get the options from the print panel you've just created, turn on and off the flags you care about, and then set the options.

+ * Original signature : `-(void)setOptions:(NSPrintPanelOptions)`

+ * *native declaration : NSPrintPanel.h:114*

+ * + * @param options @see AppKitLibrary#NSPrintPanelOptions + */ + abstract fun setOptions(options: Int) + + /** + * Original signature : `-(NSPrintPanelOptions)options`

+ * *native declaration : NSPrintPanel.h:115* + */ + abstract fun options(): Int + + /** + * The title of the default button in the print panel. You can override the standard button title, "Print," when you're using an NSPrintPanel in such a way that printing isn't actually going to happen when the user presses that button.

+ * Original signature : `-(void)setDefaultButtonTitle:(NSString*)`

+ * *native declaration : NSPrintPanel.h:119* + */ + abstract fun setDefaultButtonTitle(defaultButtonTitle: NSString?) + + /** + * Original signature : `-(NSString*)defaultButtonTitle`

+ * *native declaration : NSPrintPanel.h:120* + */ + abstract fun defaultButtonTitle(): NSString? + + /** + * The HTML help anchor for the print panel. You can override the standard anchor of the print panel's help button.

+ * Original signature : `-(void)setHelpAnchor:(NSString*)`

+ * *native declaration : NSPrintPanel.h:124* + */ + abstract fun setHelpAnchor(helpAnchor: NSString?) + + /** + * Original signature : `-(NSString*)helpAnchor`

+ * *native declaration : NSPrintPanel.h:125* + */ + abstract fun helpAnchor(): NSString? + + /** + * Set or get a string that provides a hint about the type of print job in which this print panel is being used. This controls the set of items that appear in the Presets menu. The string must be one of the job style hint strings declared above, or nil to show general presets.

+ * Original signature : `-(void)setJobStyleHint:(NSString*)`

+ * *native declaration : NSPrintPanel.h:132* + */ + abstract fun setJobStyleHint(hint: NSString?) + + /** + * Original signature : `-(NSString*)jobStyleHint`

+ * *native declaration : NSPrintPanel.h:133* + */ + abstract fun jobStyleHint(): NSString? + + /** + * Present a print panel to the user, document-modally. When the user has dismissed it, send the message selected by didEndSelector to the delegate, with the contextInfo as the last argument. The method selected by didEndSelector must have the same signature as:

+ * - (void)printPanelDidEnd:(NSPrintPanel *)printPanel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;

+ * Original signature : `-(void)beginSheetWithPrintInfo:(NSPrintInfo*) modalForWindow:(NSWindow*) delegate:(id) didEndSelector:(SEL) contextInfo:(void*)`

+ * *native declaration : NSPrintPanel.h:141* + */ + abstract fun beginSheetWithPrintInfo_modalForWindow_delegate_didEndSelector_contextInfo( + printInfo: NSPrintInfo?, + docWindow: NSWindow?, + delegate: ObjCObject?, + didEndSelector: org.rococoa.Selector?, + contextInfo: com.sun.jna.Pointer? + ) + + /** + * Original signature : `-(NSInteger)runModalWithPrintInfo:(NSPrintInfo*)`

+ * *native declaration : NSPrintPanel.h:146* + */ + abstract fun runModalWithPrintInfo(printInfo: NSPrintInfo?): NSInteger? + + /** + * Original signature : `-(NSInteger)runModal`

+ * *native declaration : NSPrintPanel.h:148* + */ + abstract fun runModal(): NSInteger? + + /** + * A simple accessor. Your -beginSheetWithPrintInfo:... delegate can use this so it doesn't have to keep a pointer to the NSPrintInfo elsewhere while waiting for the user to dismiss the print panel.

+ * Original signature : `-(NSPrintInfo*)printInfo`

+ * *native declaration : NSPrintPanel.h:154* + */ + abstract fun printInfo(): NSPrintInfo? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSPrintPanel", _Class::class.java) + + + /// Whether the print panel has separate controls (not in any accessory view) that allow the user to change the number of copies to print, which pages to print, paper size, orientation, and scaling, respectively. + const val NSPrintPanelShowsCopies: Int = 1 shl 0 + const val NSPrintPanelShowsPageRange: Int = 1 shl 1 + const val NSPrintPanelShowsPaperSize: Int = 1 shl 2 + const val NSPrintPanelShowsOrientation: Int = 1 shl 3 + const val NSPrintPanelShowsScaling: Int = 1 shl 4 + + /// Whether the print panel has an additional "Selection" option for the paper range. + const val NSPrintPanelShowsPrintSelection: Int = 1 shl 5 + + /// Whether the print panel has a page setup accessory view with controls that allow the user to change paper size, orientation, and scaling. Any control that appear in the main part of the panel because one of the previous options is used does not also appear in the page setup accessory view. + const val NSPrintPanelShowsPageSetupAccessory: Int = 1 shl 8 + + /** + * Whether the print panel has a built-in preview. Setting this option in a print panel that's not being presented by an NSPrintOperation is not useful. Two things you need to be aware of when this option is set:

+ * 1) the NSPrintInfo passed into -beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo: or -runModalWithPrintInfo: will be retained instead of copied. This is so that the NSPrintOperation that is presenting the panel can respond to -printInfo messages by returning the NSPrintInfo that the user is actually looking at and manipulating, which is the most useful thing for it to return. The result is that the passed-in NSPrintInfo can be mutated even when the user cancels the print panel, but that's OK; the factory methods that you use to create NSPrintOperations do the copying that's appropriate in that case.

+ * 2) The presenting NSPrintOperation will send the printing view more messages that it would otherwise, so that it can do pagination right away, draw the preview on screen, etc. + */ + const val NSPrintPanelShowsPreview: Int = 1 shl 17 + + /** + * Create a new NSPrintPanel.

+ * Original signature : `+(NSPrintPanel*)printPanel`

+ * *native declaration : NSPrintPanel.h:102* + */ + fun printPanel(): NSPrintPanel? { + return CLASS.printPanel() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSProgressIndicator.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSProgressIndicator.kt new file mode 100644 index 00000000..6a06bbaa --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSProgressIndicator.kt @@ -0,0 +1,201 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSRect + +/// native declaration : :42 +abstract class NSProgressIndicator : NSView() { + interface _Class : ObjCClass { + open fun alloc(): NSProgressIndicator + } + + @Override + abstract override fun initWithFrame(frameRect: NSRect?): NSProgressIndicator + + /** + * Original signature : `BOOL isIndeterminate()`

+ * *native declaration : :86* + */ + abstract fun isIndeterminate(): Boolean + + /** + * Original signature : `void setIndeterminate(BOOL)`

+ * *native declaration : :87* + */ + abstract fun setIndeterminate(flag: Boolean) + + /** + * Original signature : `BOOL isBezeled()`

+ * *native declaration : :89* + */ + abstract fun isBezeled(): Boolean + + /** + * Original signature : `void setBezeled(BOOL)`

+ * *native declaration : :90* + */ + abstract fun setBezeled(flag: Boolean) + + /** + * Original signature : `controlTint()`

+ * *native declaration : :92* + */ + abstract fun controlTint(): Int + /** + * *native declaration : :93*

+ * Conversion Error : /// Original signature : `void setControlTint(null)`

+ * - (void)setControlTint:(null)tint; (Argument tint cannot be converted) + */ + /** + * Original signature : `controlSize()`

+ * *native declaration : :95* + */ + abstract fun controlSize(): Int + + /** + * *native declaration : :96*

+ * Conversion Error : /// Original signature : `void setControlSize(null)`

+ * - (void)setControlSize:(null)size; (Argument size cannot be converted) + */ + abstract fun setControlSize(size: Int) + + /** + * Original signature : `double doubleValue()`

+ * *native declaration : :100* + */ + abstract fun doubleValue(): Double + + /** + * Original signature : `void setDoubleValue(double)`

+ * *native declaration : :101* + */ + abstract fun setDoubleValue(doubleValue: Double) + + /** + * Original signature : `void incrementBy(double)`

+ * equivalent to [self setDoubleValue:[self doubleValue] + delta]

+ * *native declaration : :103* + */ + abstract fun incrementBy(delta: Double) + + /** + * Original signature : `double minValue()`

+ * *native declaration : :105* + */ + abstract fun minValue(): Double + + /** + * Original signature : `double maxValue()`

+ * *native declaration : :106* + */ + abstract fun maxValue(): Double + + /** + * Original signature : `void setMinValue(double)`

+ * *native declaration : :107* + */ + abstract fun setMinValue(newMinimum: Double) + + /** + * Original signature : `void setMaxValue(double)`

+ * *native declaration : :108* + */ + abstract fun setMaxValue(newMaximum: Double) + /** + * *native declaration : :112*

+ * Conversion Error : NSTimeInterval + */ + /** + * *native declaration : :113*

+ * Conversion Error : NSTimeInterval + */ + /** + * Original signature : `BOOL usesThreadedAnimation()`

+ * returns YES if the PI uses a thread instead of a timer (default in NO)

+ * *native declaration : :115* + */ + abstract fun usesThreadedAnimation(): Boolean + + /** + * Original signature : `void setUsesThreadedAnimation(BOOL)`

+ * *native declaration : :116* + */ + abstract fun setUsesThreadedAnimation(threadedAnimation: Boolean) + + /** + * Original signature : `void startAnimation(id)`

+ * *native declaration : :118* + */ + abstract fun startAnimation(sender: ID?) + + /** + * Original signature : `void stopAnimation(id)`

+ * *native declaration : :119* + */ + abstract fun stopAnimation(sender: ID?) + + /** + * Original signature : `void animate(id)`

+ * manual animation

+ * *native declaration : :121* + */ + abstract fun animate(sender: ID?) + + /** + * Original signature : `void setStyle(NSProgressIndicatorStyle)`

+ * *native declaration : :125* + */ + abstract fun setStyle(style: Int) + + /** + * Original signature : `NSProgressIndicatorStyle style()`

+ * *native declaration : :126* + */ + abstract fun style(): Int + + /** + * For the bar style, the height will be set to the recommended height.

+ * Original signature : `void sizeToFit()`

+ * *native declaration : :130* + */ + abstract fun sizeToFit() + + /** + * Original signature : `BOOL isDisplayedWhenStopped()`

+ * *native declaration : :132* + */ + abstract fun isDisplayedWhenStopped(): Boolean + + /** + * Original signature : `void setDisplayedWhenStopped(BOOL)`

+ * *native declaration : :133* + */ + abstract fun setDisplayedWhenStopped(isDisplayed: Boolean) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSProgressIndicator", _Class::class.java) + + fun progressIndicatorWithFrame(frameRect: NSRect?): NSProgressIndicator? { + return CLASS.alloc().initWithFrame(frameRect) + } + + /// native declaration : :22 + const val NSProgressIndicatorPreferredThickness: Int = 14 + + /// native declaration : :23 + const val NSProgressIndicatorPreferredSmallThickness: Int = 10 + + /// native declaration : :24 + const val NSProgressIndicatorPreferredLargeThickness: Int = 18 + + /// native declaration : :25 + const val NSProgressIndicatorPreferredAquaThickness: Int = 12 + + /// native declaration : :32 + const val NSProgressIndicatorBarStyle: Int = 0 + + /// native declaration : :33 + const val NSProgressIndicatorSpinningStyle: Int = 1 + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSRange.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSRange.kt new file mode 100644 index 00000000..0f712de2 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSRange.kt @@ -0,0 +1,21 @@ +package darwin + +import org.rococoa.cocoa.CFIndex +import org.rococoa.cocoa.CFRange +import org.rococoa.cocoa.foundation.NSUInteger + +class NSRange : CFRange { + constructor() + + constructor(location: CFIndex?, length: CFIndex?) : super(location, length) + + companion object { + fun NSMakeRange(loc: NSUInteger, len: NSUInteger): NSRange? { + val cfLocation: CFIndex = CFIndex() + cfLocation.setValue(loc.toLong()) + val cfLength: CFIndex = CFIndex() + cfLength.setValue(len.toLong()) + return NSRange(cfLocation, cfLength) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSResponder.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSResponder.kt new file mode 100644 index 00000000..25157354 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSResponder.kt @@ -0,0 +1,680 @@ +package darwin + +import com.sun.jna.Pointer +import org.rococoa.ID +import org.rococoa.cocoa.foundation.NSError + +/// native declaration : :11 +abstract class NSResponder : NSObject() { + /** + * Original signature : `NSResponder* nextResponder()`

+ * *native declaration : :17* + */ + abstract fun NSResponder_nextResponder(): NSResponder? + + /** + * Original signature : `void setNextResponder(NSResponder*)`

+ * *native declaration : :18* + */ + abstract fun setNextResponder(aResponder: NSResponder?) + /** + * *native declaration : :19*

+ * Conversion Error : /// Original signature : `BOOL tryToPerform(null, id)`

+ * - (BOOL)tryToPerform:(null)anAction with:(id)anObject; (Argument anAction cannot be converted) + */ + /** + * Original signature : `BOOL performKeyEquivalent(NSEvent*)`

+ * *native declaration : :20* + */ + abstract fun performKeyEquivalent(event: NSEvent?): Boolean + + /** + * Original signature : `id validRequestorForSendType(NSString*, NSString*)`

+ * *native declaration : :21* + */ + abstract fun validRequestorForSendType_returnType(sendType: String?, returnType: String?): ID? + + /** + * Original signature : `void mouseDown(NSEvent*)`

+ * *native declaration : :22* + */ + abstract fun mouseDown(event: NSEvent?) + + /** + * Original signature : `void rightMouseDown(NSEvent*)`

+ * *native declaration : :23* + */ + abstract fun rightMouseDown(event: NSEvent?) + + /** + * Original signature : `void otherMouseDown(NSEvent*)`

+ * *native declaration : :24* + */ + abstract fun otherMouseDown(event: NSEvent?) + + /** + * Original signature : `void mouseUp(NSEvent*)`

+ * *native declaration : :25* + */ + abstract fun mouseUp(event: NSEvent?) + + /** + * Original signature : `void rightMouseUp(NSEvent*)`

+ * *native declaration : :26* + */ + abstract fun rightMouseUp(event: NSEvent?) + + /** + * Original signature : `void otherMouseUp(NSEvent*)`

+ * *native declaration : :27* + */ + abstract fun otherMouseUp(event: NSEvent?) + + /** + * Original signature : `void mouseMoved(NSEvent*)`

+ * *native declaration : :28* + */ + abstract fun mouseMoved(event: NSEvent?) + + /** + * Original signature : `void mouseDragged(NSEvent*)`

+ * *native declaration : :29* + */ + abstract fun mouseDragged(event: NSEvent?) + + /** + * Original signature : `void scrollWheel(NSEvent*)`

+ * *native declaration : :30* + */ + abstract fun scrollWheel(event: NSEvent?) + + /** + * Original signature : `void rightMouseDragged(NSEvent*)`

+ * *native declaration : :31* + */ + abstract fun rightMouseDragged(event: NSEvent?) + + /** + * Original signature : `void otherMouseDragged(NSEvent*)`

+ * *native declaration : :32* + */ + abstract fun otherMouseDragged(event: NSEvent?) + + /** + * Original signature : `void mouseEntered(NSEvent*)`

+ * *native declaration : :33* + */ + abstract fun mouseEntered(event: NSEvent?) + + /** + * Original signature : `void mouseExited(NSEvent*)`

+ * *native declaration : :34* + */ + abstract fun mouseExited(event: NSEvent?) + + /** + * Original signature : `void keyDown(NSEvent*)`

+ * *native declaration : :35* + */ + abstract fun keyDown(event: NSEvent?) + + /** + * Original signature : `void keyUp(NSEvent*)`

+ * *native declaration : :36* + */ + abstract fun keyUp(event: NSEvent?) + + /** + * Original signature : `void flagsChanged(NSEvent*)`

+ * *native declaration : :37* + */ + abstract fun flagsChanged(event: NSEvent?) + + /** + * Original signature : `void tabletPoint(NSEvent*)`

+ * *native declaration : :39* + */ + abstract fun tabletPoint(event: NSEvent?) + + /** + * Original signature : `void tabletProximity(NSEvent*)`

+ * *native declaration : :40* + */ + abstract fun tabletProximity(event: NSEvent?) + + /** + * Original signature : `void cursorUpdate(NSEvent*)`

+ * *native declaration : :43* + */ + abstract fun cursorUpdate(event: NSEvent?) + /** + * *native declaration : :45*

+ * Conversion Error : /// Original signature : `void noResponderFor(null)`

+ * - (void)noResponderFor:(null)eventSelector; (Argument eventSelector cannot be converted) + */ + /** + * Original signature : `BOOL acceptsFirstResponder()`

+ * *native declaration : :46* + */ + abstract fun acceptsFirstResponder(): Boolean + + /** + * Original signature : `BOOL becomeFirstResponder()`

+ * *native declaration : :47* + */ + abstract fun becomeFirstResponder(): Boolean + + /** + * Original signature : `BOOL resignFirstResponder()`

+ * *native declaration : :48* + */ + abstract fun resignFirstResponder(): Boolean + + /** + * Original signature : `void interpretKeyEvents(NSArray*)`

+ * *native declaration : :50* + */ + abstract fun interpretKeyEvents(eventArray: NSEvent?) + + /** + * Original signature : `void flushBufferedKeyEvents()`

+ * *native declaration : :51* + */ + abstract fun flushBufferedKeyEvents() + + /** + * Original signature : `void setMenu(NSMenu*)`

+ * *native declaration : :53* + */ + abstract fun setMenu(menu: NSMenu?) + + /** + * Original signature : `NSMenu* menu()`

+ * *native declaration : :54* + */ + abstract fun menu(): NSMenu? + + /** + * Original signature : `void showContextHelp(id)`

+ * *native declaration : :56* + */ + abstract fun showContextHelp(sender: ID?) + + /** + * Original signature : `void helpRequested(NSEvent*)`

+ * *native declaration : :58* + */ + abstract fun helpRequested(eventPtr: NSEvent?) + + /** + * Original signature : `BOOL shouldBeTreatedAsInkEvent(NSEvent*)`

+ * *native declaration : :61* + */ + abstract fun shouldBeTreatedAsInkEvent(event: NSEvent?): Boolean + + /** + * Original signature : `BOOL performMnemonic(NSString*)`

+ * *from NSKeyboardUI native declaration : :66* + */ + abstract fun performMnemonic(theString: String?): Boolean + + /** + * Original signature : `void insertText(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :75* + */ + abstract fun insertText(insertString: NSObject?) + /** + * *from NSStandardKeyBindingMethods native declaration : :78*

+ * Conversion Error : /// Original signature : `void doCommandBySelector(null)`

+ * - (void)doCommandBySelector:(null)aSelector; (Argument aSelector cannot be converted) + */ + /** + * Original signature : `void moveForward(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :85* + */ + abstract fun moveForward(sender: ID?) + + /** + * Original signature : `void moveRight(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :86* + */ + abstract fun moveRight(sender: ID?) + + /** + * Original signature : `void moveBackward(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :87* + */ + abstract fun moveBackward(sender: ID?) + + /** + * Original signature : `void moveLeft(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :88* + */ + abstract fun moveLeft(sender: ID?) + + /** + * Original signature : `void moveUp(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :89* + */ + abstract fun moveUp(sender: ID?) + + /** + * Original signature : `void moveDown(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :90* + */ + abstract fun moveDown(sender: ID?) + + /** + * Original signature : `void moveWordForward(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :91* + */ + abstract fun moveWordForward(sender: ID?) + + /** + * Original signature : `void moveWordBackward(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :92* + */ + abstract fun moveWordBackward(sender: ID?) + + /** + * Original signature : `void moveToBeginningOfLine(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :93* + */ + abstract fun moveToBeginningOfLine(sender: ID?) + + /** + * Original signature : `void moveToEndOfLine(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :94* + */ + abstract fun moveToEndOfLine(sender: ID?) + + /** + * Original signature : `void moveToBeginningOfParagraph(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :95* + */ + abstract fun moveToBeginningOfParagraph(sender: ID?) + + /** + * Original signature : `void moveToEndOfParagraph(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :96* + */ + abstract fun moveToEndOfParagraph(sender: ID?) + + /** + * Original signature : `void moveToEndOfDocument(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :97* + */ + abstract fun moveToEndOfDocument(sender: ID?) + + /** + * Original signature : `void moveToBeginningOfDocument(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :98* + */ + abstract fun moveToBeginningOfDocument(sender: ID?) + + /** + * Original signature : `void pageDown(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :99* + */ + abstract fun pageDown(sender: ID?) + + /** + * Original signature : `void pageUp(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :100* + */ + abstract fun pageUp(sender: ID?) + + /** + * Original signature : `void centerSelectionInVisibleArea(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :101* + */ + abstract fun centerSelectionInVisibleArea(sender: ID?) + + /** + * Original signature : `void moveBackwardAndModifySelection(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :103* + */ + abstract fun moveBackwardAndModifySelection(sender: ID?) + + /** + * Original signature : `void moveForwardAndModifySelection(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :104* + */ + abstract fun moveForwardAndModifySelection(sender: ID?) + + /** + * Original signature : `void moveWordForwardAndModifySelection(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :105* + */ + abstract fun moveWordForwardAndModifySelection(sender: ID?) + + /** + * Original signature : `void moveWordBackwardAndModifySelection(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :106* + */ + abstract fun moveWordBackwardAndModifySelection(sender: ID?) + + /** + * Original signature : `void moveUpAndModifySelection(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :107* + */ + abstract fun moveUpAndModifySelection(sender: ID?) + + /** + * Original signature : `void moveDownAndModifySelection(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :108* + */ + abstract fun moveDownAndModifySelection(sender: ID?) + + /** + * Original signature : `void moveWordRight(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :111* + */ + abstract fun moveWordRight(sender: ID?) + + /** + * Original signature : `void moveWordLeft(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :112* + */ + abstract fun moveWordLeft(sender: ID?) + + /** + * Original signature : `void moveRightAndModifySelection(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :113* + */ + abstract fun moveRightAndModifySelection(sender: ID?) + + /** + * Original signature : `void moveLeftAndModifySelection(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :114* + */ + abstract fun moveLeftAndModifySelection(sender: ID?) + + /** + * Original signature : `void moveWordRightAndModifySelection(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :115* + */ + abstract fun moveWordRightAndModifySelection(sender: ID?) + + /** + * Original signature : `void moveWordLeftAndModifySelection(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :116* + */ + abstract fun moveWordLeftAndModifySelection(sender: ID?) + + /** + * Original signature : `void scrollPageUp(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :119* + */ + abstract fun scrollPageUp(sender: ID?) + + /** + * Original signature : `void scrollPageDown(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :120* + */ + abstract fun scrollPageDown(sender: ID?) + + /** + * Original signature : `void scrollLineUp(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :121* + */ + abstract fun scrollLineUp(sender: ID?) + + /** + * Original signature : `void scrollLineDown(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :122* + */ + abstract fun scrollLineDown(sender: ID?) + + /** + * Original signature : `void transpose(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :126* + */ + abstract fun transpose(sender: ID?) + + /** + * Original signature : `void transposeWords(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :127* + */ + abstract fun transposeWords(sender: ID?) + + /** + * Original signature : `void selectAll(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :131* + */ + abstract fun selectAll(sender: ID?) + + /** + * Original signature : `void selectParagraph(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :132* + */ + abstract fun selectParagraph(sender: ID?) + + /** + * Original signature : `void selectLine(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :133* + */ + abstract fun selectLine(sender: ID?) + + /** + * Original signature : `void selectWord(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :134* + */ + abstract fun selectWord(sender: ID?) + + /** + * Original signature : `void indent(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :138* + */ + abstract fun indent(sender: ID?) + + /** + * Original signature : `void insertTab(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :139* + */ + abstract fun insertTab(sender: ID?) + + /** + * Original signature : `void insertBacktab(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :140* + */ + abstract fun insertBacktab(sender: ID?) + + /** + * Original signature : `void insertNewline(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :141* + */ + abstract fun insertNewline(sender: ID?) + + /** + * Original signature : `void insertParagraphSeparator(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :142* + */ + abstract fun insertParagraphSeparator(sender: ID?) + + /** + * Original signature : `void insertNewlineIgnoringFieldEditor(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :143* + */ + abstract fun insertNewlineIgnoringFieldEditor(sender: ID?) + + /** + * Original signature : `void insertTabIgnoringFieldEditor(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :144* + */ + abstract fun insertTabIgnoringFieldEditor(sender: ID?) + + /** + * Original signature : `void insertLineBreak(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :146* + */ + abstract fun insertLineBreak(sender: ID?) + + /** + * Original signature : `void insertContainerBreak(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :147* + */ + abstract fun insertContainerBreak(sender: ID?) + + /** + * Original signature : `void changeCaseOfLetter(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :152* + */ + abstract fun changeCaseOfLetter(sender: ID?) + + /** + * Original signature : `void uppercaseWord(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :153* + */ + abstract fun uppercaseWord(sender: ID?) + + /** + * Original signature : `void lowercaseWord(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :154* + */ + abstract fun lowercaseWord(sender: ID?) + + /** + * Original signature : `void capitalizeWord(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :155* + */ + abstract fun capitalizeWord(sender: ID?) + + /** + * Original signature : `void deleteForward(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :159* + */ + abstract fun deleteForward(sender: ID?) + + /** + * Original signature : `void deleteBackward(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :160* + */ + abstract fun deleteBackward(sender: ID?) + + /** + * Original signature : `void deleteBackwardByDecomposingPreviousCharacter(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :162* + */ + abstract fun deleteBackwardByDecomposingPreviousCharacter(sender: ID?) + + /** + * Original signature : `void deleteWordForward(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :164* + */ + abstract fun deleteWordForward(sender: ID?) + + /** + * Original signature : `void deleteWordBackward(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :165* + */ + abstract fun deleteWordBackward(sender: ID?) + + /** + * Original signature : `void deleteToBeginningOfLine(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :166* + */ + abstract fun deleteToBeginningOfLine(sender: ID?) + + /** + * Original signature : `void deleteToEndOfLine(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :167* + */ + abstract fun deleteToEndOfLine(sender: ID?) + + /** + * Original signature : `void deleteToBeginningOfParagraph(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :168* + */ + abstract fun deleteToBeginningOfParagraph(sender: ID?) + + /** + * Original signature : `void deleteToEndOfParagraph(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :169* + */ + abstract fun deleteToEndOfParagraph(sender: ID?) + + /** + * Original signature : `void yank(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :171* + */ + abstract fun yank(sender: ID?) + + /** + * Original signature : `void complete(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :175* + */ + abstract fun complete(sender: ID?) + + /** + * Original signature : `void setMark(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :179* + */ + abstract fun setMark(sender: ID?) + + /** + * Original signature : `void deleteToMark(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :180* + */ + abstract fun deleteToMark(sender: ID?) + + /** + * Original signature : `void selectToMark(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :181* + */ + abstract fun selectToMark(sender: ID?) + + /** + * Original signature : `void swapWithMark(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :182* + */ + abstract fun swapWithMark(sender: ID?) + + /** + * Original signature : `void cancelOperation(id)`

+ * *from NSStandardKeyBindingMethods native declaration : :187* + */ + abstract fun cancelOperation(sender: ID?) + + /** + * Original signature : `NSUndoManager* undoManager()`

+ * *from NSUndoSupport native declaration : :192* + */ + abstract fun undoManager(): Pointer? + /** + * *from NSErrorPresentation native declaration : :222*

+ * Conversion Error : / **

+ * * Present an error alert to the user, as a document-modal panel. When the user has dismissed the alert and any recovery possible for the error and chosen by the user has been attempted, send the selected message to the specified delegate. The method selected by didPresentSelector must have the same signature as:

+ * * - (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo;

+ * * The default implementation of this method always invokes [self willPresentError:error] to give subclassers an opportunity to customize error presentation. It then forwards the message, passing the customized error, to the next responder or, if there is no next responder, NSApp. NSApplication's override of this method invokes [[NSAlert alertWithError:theErrorToPresent] beginSheetModalForWindow:window modalDelegate:self didEndSelector:selectorForAPrivateMethod contextInfo:privateContextInfo]. When the user has dismissed the alert, the error's recovery attempter is sent an -attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo: message, if the error had recovery options and a recovery delegate.

+ * * Errors for which ([[error domain] isEqualToString:NSCocoaErrorDomain] && [error code]==NSUserCancelledError) are a special case, because they do not actually represent errors and should not be presented as such to the user. NSApplication's override of this method does not present an alert to the user for these kinds of errors. Instead it merely invokes the delegate specifying didRecover==NO.

+ * * Between the responder chain in a typical application and various overrides of this method in AppKit classes, objects are given the opportunity to present errors in orders like these:

+ * * For windows owned by documents:

+ * * view -> superviews -> window -> window controller -> document -> document controller -> application

+ * * For windows that have window controllers but aren't associated with documents:

+ * * view -> superviews -> window -> window controller -> application

+ * * For windows that have no window controller at all:

+ * * view -> superviews -> window -> application

+ * * You can invoke this method to present error alert sheets. For example, Cocoa's own -[NSDocument saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:] invokes this method when it's just invoked -saveToURL:ofType:forSaveOperation:error: and that method has returned NO.

+ * * You probably shouldn't override this method, because you have no way of reliably predicting whether this method vs. -presentError will be invoked for any particular error. You should instead override the -willPresentError: method described below.

+ * * Original signature : `void presentError(NSError*, NSWindow*, id, null, void*)`

+ * * /

+ * - (void)presentError:(NSError*)error modalForWindow:(NSWindow*)window delegate:(id)delegate didPresentSelector:(null)didPresentSelector contextInfo:(void*)contextInfo; (Argument didPresentSelector cannot be converted) + */ + /** + * Present an error alert to the user, as an application-modal panel, and return YES if error recovery was done, NO otherwise. This method behaves much like the previous one except it does not return until the user has dismissed the alert and, if the error had recovery options and a recovery delegate, the error's recovery delegate has been sent an -attemptRecoveryFromError:optionIndex: message.

+ * You can invoke this method to present error alert dialog boxes. For example, Cocoa's own [NSDocumentController openDocument:] invokes this method when it's just invoked -openDocumentWithContentsOfURL:display:error: and that method has returned nil.

+ * You probably shouldn't override this method, because you have no way of reliably predicting whether this method vs. -presentError:modalForWindow:delegate:didPresentSelector:contextInfo: will be invoked for any particular error. You should instead override the -willPresentError: method described below.

+ * Original signature : `BOOL presentError(NSError*)`

+ * *from NSErrorPresentation native declaration : :230* + */ + abstract fun presentError(error: NSError?): Boolean + + /** + * Given that the receiver is about to present an error (perhaps by just forwarding it to the next responder), return the error that should actually be presented. The default implementation of this method merely returns the passed-in error.

+ * You can override this method to customize the presentation of errors by examining the passed-in error and if, for example, its localized description or recovery information is unsuitably generic, returning a more specific one. When you override this method always check the NSError's domain and code to discriminate between errors whose presentation you want to customize and those you don't. For those you don't just return [super willPresentError:error]. Don't make decisions based on the NSError's localized description, recovery suggestion, or recovery options because it's usually not a good idea to try to parse localized text.

+ * Original signature : `NSError* willPresentError(NSError*)`

+ * *from NSErrorPresentation native declaration : :236* + */ + abstract fun willPresentError(error: NSError?): NSError? +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSavePanel.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSavePanel.kt new file mode 100644 index 00000000..3e04e2a0 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSavePanel.kt @@ -0,0 +1,255 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSInteger + +/// native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:30 +abstract class NSSavePanel : NSPanel() { + interface _Class : ObjCClass { + /** + * Original signature : `NSSavePanel* savePanel()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:67* + */ + open fun savePanel(): NSSavePanel? + } + + /** + * Original signature : `NSURL* URL()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:69* + */ + abstract fun URL(): NSURL? + + + abstract fun directoryURL(): NSURL? + + + abstract fun setDirectoryURL(path: NSURL?) + + /** + * A file specified in the save panel is saved with the designated filename and this file type as an extension. This method is equivalent to calling allowedFileTypes and returning the first element of the list of allowed types, or nil if there are none. It is preferred to use 'allowedFileTypes' over this method.

+ * Original signature : `NSString* requiredFileType()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:78* + */ + abstract fun requiredFileType(): String? + + /** + * Original signature : `void setRequiredFileType(NSString*)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:79* + */ + abstract fun setRequiredFileType(type: String?) + + /** + * An array NSStrings specifying the file types the user can save the file as. The fil type can be a common file extension, or a UTI. A nil value indicates that any file type can be used. If the array is not nil and the array contains no items, an exception will be raised. If the user specifies a type not in the array, and 'allowsOtherFileTypes' is YES, they will be presented with another dialog when prompted to save. The default value is 'nil'.

+ * Original signature : `NSArray* allowedFileTypes()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:84* + */ + abstract fun allowedFileTypes(): NSArray? + + /** + * Original signature : `void setAllowedFileTypes(NSArray*)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:85* + */ + abstract fun setAllowedFileTypes(types: NSArray?) + + /** + * Returns a BOOL value that indicates whether the receiver allows the user to save files with an extension that’s not in the list of 'allowedFileTypes'.

+ * Original signature : `BOOL allowsOtherFileTypes()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:89* + */ + abstract fun allowsOtherFileTypes(): Boolean + + /** + * Original signature : `void setAllowsOtherFileTypes(BOOL)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:90* + */ + abstract fun setAllowsOtherFileTypes(flag: Boolean) + + /** + * Original signature : `NSView* accessoryView()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:93* + */ + abstract fun accessoryView(): NSView? + + /** + * Original signature : `void setAccessoryView(NSView*)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:94* + */ + abstract fun setAccessoryView(view: NSView?) + + /** + * Original signature : `BOOL isExpanded()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:101* + */ + abstract fun isExpanded(): Boolean + + /** + * Original signature : `BOOL canCreateDirectories()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:104* + */ + abstract fun canCreateDirectories(): Boolean + + /** + * Original signature : `void setCanCreateDirectories(BOOL)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:105* + */ + abstract fun setCanCreateDirectories(flag: Boolean) + + /** + * Original signature : `BOOL canSelectHiddenExtension()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:109* + */ + abstract fun canSelectHiddenExtension(): Boolean + + /** + * Original signature : `void setCanSelectHiddenExtension(BOOL)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:111* + */ + abstract fun setCanSelectHiddenExtension(flag: Boolean) + + /** + * Original signature : `BOOL isExtensionHidden()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:112* + */ + abstract fun isExtensionHidden(): Boolean + + /** + * Original signature : `void setExtensionHidden(BOOL)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:113* + */ + abstract fun setExtensionHidden(flag: Boolean) + + /** + * Original signature : `BOOL treatsFilePackagesAsDirectories()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:115* + */ + abstract fun treatsFilePackagesAsDirectories(): Boolean + + /** + * Original signature : `void setTreatsFilePackagesAsDirectories(BOOL)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:116* + */ + abstract fun setTreatsFilePackagesAsDirectories(flag: Boolean) + + /** + * Original signature : `NSString* prompt()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:118* + */ + abstract fun prompt(): String? + + /** + * Original signature : `void setPrompt(NSString*)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:119* + */ + abstract fun setPrompt(prompt: String?) + + /** + * Original signature : `NSString* nameFieldLabel()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:125* + */ + abstract fun nameFieldLabel(): String? + + /** + * Original signature : `void setNameFieldLabel(NSString*)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:126* + */ + abstract fun setNameFieldLabel(label: String?) + + /** + * Original signature : `NSString* message()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:130* + */ + abstract fun message(): String? + + /** + * Original signature : `void setMessage(NSString*)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:131* + */ + abstract fun setMessage(message: String?) + + /** + * Original signature : `void validateVisibleColumns()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:134* + */ + abstract fun validateVisibleColumns() + + /** + * A method that was deprecated in Mac OS 10.3. -[NSSavePanel selectText:] does nothing.

+ * Original signature : `void selectText(id)`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:138* + */ + abstract fun selectText(sender: ID?) + + /** + * Original signature : `void ok(id)`

+ * *from NSSavePanelRuntime native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:145* + */ + abstract fun ok(sender: ID?) + + /** + * Original signature : `void cancel(id)`

+ * *from NSSavePanelRuntime native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:146* + */ + abstract fun cancel(sender: ID?) + + /** + * *from NSSavePanelRuntime native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:152*

+ * Conversion Error : / **

+ * * didEndSelector should have the signature:

+ * * - (void)savePanelDidEnd:(NSSavePanel *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;

+ * * The value passed as returnCode will be either NSCancelButton or NSOKButton.

+ * * Original signature : `void beginSheetForDirectory(NSString*, NSString*, NSWindow*, id, null, void*)`

+ * * /

+ * - (void)beginSheetForDirectory:(NSString*)path file:(NSString*)name modalForWindow:(NSWindow*)docWindow modalDelegate:(id)delegate didEndSelector:(null)didEndSelector contextInfo:(void*)contextInfo; (Argument didEndSelector cannot be converted) + */ + abstract fun beginSheetForDirectory_file_modalForWindow_modalDelegate_didEndSelector_contextInfo( + path: String?, + name: String?, + docWindow: NSWindow?, + delegate: ID?, + didEndSelector: org.rococoa.Selector?, + contextInfo: ID? + ) + + fun beginSheetForDirectory( + path: String?, + name: String?, + docWindow: NSWindow?, + delegate: ID?, + didEndSelector: org.rococoa.Selector?, + contextInfo: ID? + ) { + this.beginSheetForDirectory_file_modalForWindow_modalDelegate_didEndSelector_contextInfo( + path, + name, + docWindow, + delegate, + didEndSelector, + contextInfo + ) + } + + /** + * Original signature : `NSInteger runModalForDirectory(NSString*, NSString*)`

+ * *from NSSavePanelRuntime native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:154* + */ + abstract fun runModalForDirectory_file(path: String?, name: String?): NSInteger? + + fun runModal(directory: String?, file: String?): NSInteger? { + return this.runModalForDirectory_file(directory, file) + } + + /** + * Original signature : `NSInteger runModal()`

+ * *from NSSavePanelRuntime native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:155* + */ + abstract fun runModal(): NSInteger? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSSavePanel", _Class::class.java) + + fun savePanel(): NSSavePanel? { + return CLASS.savePanel() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSScreen.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSScreen.kt new file mode 100644 index 00000000..380edb7c --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSScreen.kt @@ -0,0 +1,96 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSRect + +/** + * This file was autogenerated by [JNAerator](http://jnaerator.googlecode.com/),

+ * a tool written by [Olivier Chafik](http://ochafik.free.fr/) that [uses a few opensource projects.](http://code.google.com/p/jnaerator/wiki/CreditsAndLicense).

+ * For help, please visit [NativeLibs4Java](http://nativelibs4java.googlecode.com/), [Rococoa](http://rococoa.dev.java.net/), or [JNA](http://jna.dev.java.net/). + * + */ +abstract class NSScreen : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `+(NSArray*)screens`

+ * All screens; first one is "zero" screen

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:235* + */ + open fun screens(): NSArray? + + /** + * Original signature : `+(NSScreen*)mainScreen`

+ * Screen with key window

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:236* + */ + open fun mainScreen(): NSScreen? + + /** + * Original signature : `+(NSScreen*)deepestScreen`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:237* + */ + open fun deepestScreen(): NSScreen? + } + + /** + * Original signature : `-(NSWindowDepth)depth`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:239* + */ + abstract fun depth(): Int + + /** + * Original signature : `-(NSRect)frame`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:240* + */ + abstract fun frame(): NSRect? + + /** + * Original signature : `-(NSRect)visibleFrame`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:241* + */ + abstract fun visibleFrame(): NSRect? + + /** + * Original signature : `-(NSDictionary*)deviceDescription`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:242* + */ + abstract fun deviceDescription(): NSDictionary? + + /** + * Returns scale factor applied by default to windows created on this screen

+ * Original signature : `-(CGFloat)userSpaceScaleFactor`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:249* + */ + abstract fun userSpaceScaleFactor(): CGFloat? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSScreen", _Class::class.java) + + /** + * Original signature : `+(NSArray*)screens`

+ * All screens; first one is "zero" screen

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:235* + */ + fun screens(): NSArray? { + return CLASS.screens() + } + + /** + * Original signature : `+(NSScreen*)mainScreen`

+ * Screen with key window

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:236* + */ + fun mainScreen(): NSScreen? { + return CLASS.mainScreen() + } + + /** + * Original signature : `+(NSScreen*)deepestScreen`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:237* + */ + fun deepestScreen(): NSScreen? { + return CLASS.deepestScreen() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSearchField.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSearchField.kt new file mode 100644 index 00000000..59868803 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSearchField.kt @@ -0,0 +1,51 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSRect + +abstract class NSSearchField : NSTextField() { + interface _Class : ObjCClass { + open fun alloc(): NSSearchField + } + + abstract override fun init(): NSSearchField + + abstract override fun initWithFrame(frameRect: NSRect?): NSSearchField + + /** + * When the value of this property is YES, the cell calls its action method immediately upon notification of any + * changes to the search field. When the value is NO, the cell pauses briefly after receiving a notification and + * then calls its action method. Pausing gives the user an opportunity to type more text into the search field + * and minimize the number of searches that are performed. + * + * @param flag A Boolean value indicating whether the cell calls its action method immediately when an + * appropriate action occurs. + */ + abstract fun setSendsSearchStringImmediately(flag: Boolean) + + abstract fun sendsSearchStringImmediately(): Boolean + + /** + * When the value of this property is YES, the cell calls its action method when the user clicks the search button + * or presses Return. When the value is NO, the cell calls the action method after each keystroke. + * The default value of this property is NO. + * + * @param flag A Boolean value indicating whether the cell calls its search action method + * when the user clicks the search button (or presses Return) or after each keystroke. + */ + abstract fun setSendsWholeSearchString(flag: Boolean) + + abstract fun sendsWholeSearchString(): Boolean + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSSearchField", _Class::class.java) + + fun searchField(): NSSearchField? { + return CLASS.alloc().init() + } + + fun searchFieldWithFrame(frameRect: NSRect?): NSSearchField? { + return CLASS.alloc().initWithFrame(frameRect) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSecureTextField.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSecureTextField.kt new file mode 100644 index 00000000..be9fdf01 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSecureTextField.kt @@ -0,0 +1,21 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSRect + +abstract class NSSecureTextField : NSTextField() { + interface _Class : ObjCClass { + open fun alloc(): NSSecureTextField + } + + @Override + abstract override fun initWithFrame(frameRect: NSRect?): NSSecureTextField + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSSecureTextField", _Class::class.java) + + fun textfieldWithFrame(frameRect: NSRect?): NSSecureTextField? { + return CLASS.alloc().initWithFrame(frameRect) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSegmentedCell.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSegmentedCell.kt new file mode 100644 index 00000000..7b4d85c2 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSegmentedCell.kt @@ -0,0 +1,213 @@ +package darwin + +import org.rococoa.cocoa.CGFloat + +/// native declaration : :20 +abstract class NSSegmentedCell : NSActionCell() { + /** + * Number of segments

+ * Original signature : `void setSegmentCount(NSInteger)`

+ * *native declaration : :46* + */ + abstract fun setSegmentCount(count: Int) + + /** + * Original signature : `NSInteger segmentCount()`

+ * *native declaration : :47* + */ + abstract fun segmentCount(): Int + + /** + * Which button is active. May turn off other segments depending on mode.

+ * Original signature : `void setSelectedSegment(NSInteger)`

+ * *native declaration : :51* + */ + abstract fun setSelectedSegment(selectedSegment: Int) + + /** + * Original signature : `NSInteger selectedSegment()`

+ * *native declaration : :52* + */ + abstract fun selectedSegment(): Int + + /** + * Original signature : `BOOL selectSegmentWithTag(NSInteger)`

+ * *native declaration : :55* + */ + abstract fun selectSegmentWithTag(tag: Int): Boolean + + /** + * For keyboard UI. Wraps.

+ * Original signature : `void makeNextSegmentKey()`

+ * *native declaration : :60* + */ + abstract fun makeNextSegmentKey() + + /** + * Original signature : `void makePreviousSegmentKey()`

+ * *native declaration : :61* + */ + abstract fun makePreviousSegmentKey() + + /** + * Original signature : `void setTrackingMode(NSSegmentSwitchTracking)`

+ * *native declaration : :63* + */ + abstract fun setTrackingMode(trackingMode: Int) + + /** + * Original signature : `NSSegmentSwitchTracking trackingMode()`

+ * *native declaration : :64* + */ + abstract fun trackingMode(): Int + + /** + * Width of 0 means autosize to fit

+ * Original signature : `void setWidth(CGFloat, NSInteger)`

+ * *native declaration : :71* + */ + abstract fun setWidth_forSegment(width: CGFloat?, segment: Int) + + /** + * Original signature : `CGFloat widthForSegment(NSInteger)`

+ * *native declaration : :72* + */ + abstract fun widthForSegment(segment: Int): CGFloat? + + /** + * Original signature : `void setImage(NSImage*, NSInteger)`

+ * *native declaration : :74* + */ + abstract fun setImage_forSegment(image: NSImage?, segment: Int) + + /** + * Original signature : `NSImage* imageForSegment(NSInteger)`

+ * *native declaration : :75* + */ + abstract fun imageForSegment(segment: Int): NSImage? + /** + * *native declaration : :79*

+ * Conversion Error : /// Original signature : `void setImageScaling(null, NSInteger)`

+ * - (void)setImageScaling:(null)scaling forSegment:(NSInteger)segment; (Argument scaling cannot be converted) + */ + /** + * Original signature : `imageScalingForSegment(NSInteger)`

+ * *native declaration : :80* + */ + abstract fun imageScalingForSegment(segment: Int): com.sun.jna.Pointer? + + /** + * Original signature : `void setLabel(NSString*, NSInteger)`

+ * *native declaration : :84* + */ + abstract fun setLabel_forSegment(label: String?, segment: Int) + + /** + * Original signature : `NSString* labelForSegment(NSInteger)`

+ * *native declaration : :85* + */ + abstract fun labelForSegment(segment: Int): String? + + /** + * Original signature : `void setSelected(BOOL, NSInteger)`

+ * *native declaration : :87* + */ + abstract fun setSelected_forSegment(selected: Boolean, segment: Int) + + /** + * Original signature : `BOOL isSelectedForSegment(NSInteger)`

+ * *native declaration : :88* + */ + abstract fun isSelectedForSegment(segment: Int): Boolean + + /** + * Original signature : `void setEnabled(BOOL, NSInteger)`

+ * *native declaration : :90* + */ + abstract fun setEnabled_forSegment(enabled: Boolean, segment: Int) + + /** + * Original signature : `BOOL isEnabledForSegment(NSInteger)`

+ * *native declaration : :91* + */ + abstract fun isEnabledForSegment(segment: Int): Boolean + + /** + * Original signature : `void setMenu(NSMenu*, NSInteger)`

+ * *native declaration : :93* + */ + abstract fun setMenu_forSegment(menu: NSMenu?, segment: Int) + + /** + * Original signature : `NSMenu* menuForSegment(NSInteger)`

+ * *native declaration : :94* + */ + abstract fun menuForSegment(segment: Int): NSMenu? + + /** + * Original signature : `void setToolTip(NSString*, NSInteger)`

+ * *native declaration : :96* + */ + abstract fun setToolTip_forSegment(toolTip: String?, segment: Int) + + /** + * Original signature : `NSString* toolTipForSegment(NSInteger)`

+ * *native declaration : :97* + */ + abstract fun toolTipForSegment(segment: Int): String? + + /** + * Original signature : `void setTag(NSInteger, NSInteger)`

+ * *native declaration : :99* + */ + abstract fun setTag_forSegment(tag: Int, segment: Int) + + /** + * Original signature : `NSInteger tagForSegment(NSInteger)`

+ * *native declaration : :100* + */ + abstract fun tagForSegment(segment: Int): Int + /** + * *native declaration : :104*

+ * Conversion Error : / **

+ * * see NSSegmentedControl.h for segment style names and values

+ * * Original signature : `void setSegmentStyle(null)`

+ * * /

+ * - (void)setSegmentStyle:(null)segmentStyle; (Argument segmentStyle cannot be converted) + */ + /** + * Original signature : `segmentStyle()`

+ * *native declaration : :105* + */ + abstract fun segmentStyle(): Int + /** + * *native declaration : :110*

+ * Conversion Error : NSRect + */ + /** + * Describes the surface drawn onto in -[NSCell drawSegment:inFrame:withView:]. That method draws a segment interior, not the segment bezel. This is both an override point and a useful method to call. A segmented cell that draws a custom bezel would override this to describe that surface. A cell that has custom segment drawing might query this method to help pick an image that looks good on the cell. Calling this method gives you some independence from changes in framework art style.

+ * Original signature : `interiorBackgroundStyleForSegment(NSInteger)`

+ * *from NSSegmentBackgroundStyle native declaration : :119* + */ + abstract fun interiorBackgroundStyleForSegment(segment: Int): Int + + companion object { + /** + * only one button can be selected

+ * *native declaration : :12* + */ + const val NSSegmentSwitchTrackingSelectOne: Int = 0 + + /** + * any button can be selected

+ * *native declaration : :13* + */ + const val NSSegmentSwitchTrackingSelectAny: Int = 1 + + /** + * only selected while tracking

+ * *native declaration : :14* + */ + const val NSSegmentSwitchTrackingMomentary: Int = 2 + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSegmentedControl.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSegmentedControl.kt new file mode 100644 index 00000000..51e39a59 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSegmentedControl.kt @@ -0,0 +1,156 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSInteger + +/// native declaration : :26 +abstract class NSSegmentedControl : NSControl() { + interface _Class : ObjCClass { + open fun alloc(): NSSegmentedControl + } + + abstract override fun init(): NSSegmentedControl + + /** + * Original signature : `void setSegmentCount(NSInteger)`

+ * *native declaration : :34* + */ + abstract fun setSegmentCount(count: Int) + + /** + * Original signature : `NSInteger segmentCount()`

+ * *native declaration : :35* + */ + abstract fun segmentCount(): Int + + /** + * Original signature : `public abstract void setSelectedSegment(NSInteger)`

+ * *native declaration : :37* + */ + abstract fun setSelectedSegment(selectedSegment: Int) + + /** + * Original signature : `NSInteger selectedSegment()`

+ * *native declaration : :38* + */ + abstract fun selectedSegment(): Int + + /** + * Original signature : `BOOL selectSegmentWithTag(NSInteger)`

+ * *native declaration : :41* + */ + abstract fun selectSegmentWithTag(tag: NSInteger?): Boolean + + /** + * Original signature : `public abstract void setWidth(CGFloat, NSInteger)`

+ * *native declaration : :44* + */ + abstract fun setWidth_forSegment(width: CGFloat?, segment: Int) + + /** + * Original signature : `CGFloat widthForSegment(NSInteger)`

+ * *native declaration : :45* + */ + abstract fun widthForSegment(segment: Int): CGFloat? + + /** + * Original signature : `public abstract void setImage(NSImage*, NSInteger)`

+ * *native declaration : :47* + */ + abstract fun setImage_forSegment(image: NSImage?, segment: Int) + + /** + * Original signature : `NSImage* imageForSegment(NSInteger)`

+ * *native declaration : :48* + */ + abstract fun imageForSegment(segment: Int): NSImage? + /** + * *native declaration : :52*

+ * Conversion Error : /// Original signature : `public abstract void setImageScaling(null, NSInteger)`

+ * - (public abstract void)setImageScaling:(null)scaling forSegment:(NSInteger)segment; (Argument scaling cannot be converted) + */ + /** + * Original signature : `imageScalingForSegment(NSInteger)`

+ * *native declaration : :53* + */ + abstract fun imageScalingForSegment(segment: Int): com.sun.jna.Pointer? + + /** + * Original signature : `public abstract void setLabel(NSString*, NSInteger)`

+ * *native declaration : :57* + */ + abstract fun setLabel_forSegment(label: String?, segment: Int) + + /** + * Original signature : `NSString* labelForSegment(NSInteger)`

+ * *native declaration : :58* + */ + abstract fun labelForSegment(segment: Int): String? + + /** + * Original signature : `public abstract void setMenu(NSMenu*, NSInteger)`

+ * *native declaration : :60* + */ + abstract fun setMenu_forSegment(menu: NSMenu?, segment: Int) + + /** + * Original signature : `NSMenu* menuForSegment(NSInteger)`

+ * *native declaration : :61* + */ + abstract fun menuForSegment(segment: Int): NSMenu? + + /** + * Original signature : `public abstract void setSelected(BOOL, NSInteger)`

+ * *native declaration : :63* + */ + abstract fun setSelected_forSegment(selected: Boolean, segment: Int) + + /** + * Original signature : `BOOL isSelectedForSegment(NSInteger)`

+ * *native declaration : :64* + */ + abstract fun isSelectedForSegment(segment: Int): Boolean + + /** + * Original signature : `public abstract void setEnabled(BOOL, NSInteger)`

+ * *native declaration : :66* + */ + abstract fun setEnabled_forSegment(enabled: Boolean, segment: Int) + + /** + * Original signature : `BOOL isEnabledForSegment(NSInteger)`

+ * *native declaration : :67* + */ + abstract fun isEnabledForSegment(segment: Int): Boolean + + /** + * Original signature : `public abstract void setSegmentStyle(NSSegmentStyle)`

+ * *native declaration : :70* + */ + abstract fun setSegmentStyle(segmentStyle: NSInteger?) + + /** + * Original signature : `NSSegmentStyle segmentStyle()`

+ * *native declaration : :71* + */ + abstract fun segmentStyle(): NSInteger? + + companion object { + private val CLASS: _Class = Rococoa.createClass("NSSegmentedControl", _Class::class.java) + + val NSSegmentStyleAutomatic: NSInteger? = NSInteger(0) + val NSSegmentStyleRounded: NSInteger? = NSInteger(1) + val NSSegmentStyleTexturedRounded: NSInteger? = NSInteger(2) + val NSSegmentStyleRoundRect: NSInteger? = NSInteger(3) + val NSSegmentStyleTexturedSquare: NSInteger? = NSInteger(4) + val NSSegmentStyleCapsule: NSInteger? = NSInteger(5) + val NSSegmentStyleSmallSquare: NSInteger? = NSInteger(6) + val NSSegmentStyleSeparated: NSInteger? = NSInteger(8) + + fun segmentedControl(): NSSegmentedControl? { + return CLASS.alloc().init() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSet.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSet.kt new file mode 100644 index 00000000..8428432b --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSet.kt @@ -0,0 +1,173 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:13 +abstract class NSSet : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `set()`

+ * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:43* + */ + open fun set(): NSSet? + /** + * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:44*

+ * Conversion Error : /// Original signature : `setWithObject(null)`

+ * + (null)setWithObject:(null)object; (Argument object cannot be converted) + */ + /** + * Original signature : `setWithObjects(id*, NSUInteger)`

+ * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:45* + */ + open fun setWithObjects_count(objects: NSObject?, cnt: NSUInteger?): NSSet? + + /** + * Original signature : `id setWithObjects(id, null)`

+ * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:46* + */ + open fun setWithObjects(firstObj: NSObject?, vararg varargs: NSObject?): NSSet? + + /** + * Original signature : `id setWithSet(NSSet*)`

+ * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:47* + */ + open fun setWithSet(set: NSSet?): NSSet? + + /** + * Original signature : `id setWithArray(NSArray*)`

+ * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:48* + */ + open fun setWithArray(array: NSArray?): NSSet? + } + + /** + * Original signature : `NSUInteger count()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:15* + */ + abstract fun count(): NSUInteger? + /** + * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:16*

+ * Conversion Error : /// Original signature : `member(null)`

+ * - (null)member:(null)object; (Argument object cannot be converted) + */ + /** + * Original signature : `NSEnumerator* objectEnumerator()`

+ * *native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:17* + */ + abstract fun objectEnumerator(): NSEnumerator? + + /** + * Original signature : `NSArray* allObjects()`

+ * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:23* + */ + abstract fun allObjects(): NSArray? + + /** + * Original signature : `anyObject()`

+ * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:24* + */ + abstract fun anyObject(): NSObject? + /** + * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:25*

+ * Conversion Error : /// Original signature : `BOOL containsObject(null)`

+ * - (BOOL)containsObject:(null)anObject; (Argument anObject cannot be converted) + */ + /** + * Original signature : `NSString* description()`

+ * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:26* + */ + abstract override fun description(): String? + /** + * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:27*

+ * Conversion Error : /// Original signature : `NSString* descriptionWithLocale(null)`

+ * - (NSString*)descriptionWithLocale:(null)locale; (Argument locale cannot be converted) + */ + /** + * Original signature : `BOOL intersectsSet(NSSet*)`

+ * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:28* + */ + abstract fun intersectsSet(otherSet: NSSet?): Boolean + + /** + * Original signature : `BOOL isEqualToSet(NSSet*)`

+ * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:29* + */ + abstract fun isEqualToSet(otherSet: NSSet?): Boolean + + /** + * Original signature : `BOOL isSubsetOfSet(NSSet*)`

+ * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:30* + */ + abstract fun isSubsetOfSet(otherSet: NSSet?): Boolean + /** + * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:32*

+ * Conversion Error : /// Original signature : `void makeObjectsPerformSelector(null)`

+ * - (void)makeObjectsPerformSelector:(null)aSelector; (Argument aSelector cannot be converted) + */ + /** + * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:33*

+ * Conversion Error : /// Original signature : `void makeObjectsPerformSelector(null, null)`

+ * - (void)makeObjectsPerformSelector:(null)aSelector withObject:(null)argument; (Argument aSelector cannot be converted) + */ + /** + * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:35*

+ * Conversion Error : /// Original signature : `NSSet* setByAddingObject(null)`

+ * - (NSSet*)setByAddingObject:(null)anObject; (Argument anObject cannot be converted) + */ + /** + * Original signature : `NSSet* setByAddingObjectsFromSet(NSSet*)`

+ * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:36* + */ + abstract fun setByAddingObjectsFromSet(other: NSSet?): NSSet? + + /** + * Original signature : `NSSet* setByAddingObjectsFromArray(NSArray*)`

+ * *from NSExtendedSet native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:37* + */ + abstract fun setByAddingObjectsFromArray(other: NSArray?): NSSet? + + /** + * Original signature : `id initWithObjects(id*, NSUInteger)`

+ * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:50* + */ + abstract fun initWithObjects_count(objects: NSObject?, cnt: NSUInteger?): NSSet? + + /** + * Original signature : `id initWithObjects(id, null)`

+ * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:51* + */ + abstract fun initWithObjects(firstObj: NSObject?, vararg varargs: NSObject?): NSSet? + + /** + * Original signature : `id initWithSet(NSSet*)`

+ * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:52* + */ + abstract fun initWithSet(set: NSSet?): NSSet? + + /** + * Original signature : `id initWithSet(NSSet*, BOOL)`

+ * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:53* + */ + abstract fun initWithSet_copyItems(set: NSSet?, flag: Boolean): NSSet? + + /** + * Original signature : `id initWithArray(NSArray*)`

+ * *from NSSetCreation native declaration : /System/Library/Frameworks/Foundation.framework/Headers/NSSet.h:54* + */ + abstract fun initWithArray(array: NSArray?): NSSet? + + /** + * Return a set containing the results of invoking -valueForKey: on each of the receiver's members. The returned set might not have the same number of members as the receiver. The returned set will not contain any elements corresponding to instances of -valueForKey: returning nil (in contrast with -[NSArray(NSKeyValueCoding) valueForKey:], which may put NSNulls in the arrays it returns).

+ * Original signature : `id valueForKey(NSString*)`

+ * *from NSKeyValueCoding native declaration : :191* + */ + abstract fun valueForKey(key: String?): NSObject? + + /** + * Invoke -setValue:forKey: on each of the receiver's members.

+ * Original signature : `void setValue(id, NSString*)`

+ * *from NSKeyValueCoding native declaration : :195* + */ + abstract fun setValue_forKey(value: NSObject?, key: String?) +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSlider.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSlider.kt new file mode 100644 index 00000000..9784637e --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSSlider.kt @@ -0,0 +1,3 @@ +package darwin + +abstract class NSSlider : NSControl() diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStatusBar.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStatusBar.kt new file mode 100644 index 00000000..c91df86d --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStatusBar.kt @@ -0,0 +1,35 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat + +abstract class NSStatusBar : NSObject() { + interface _Class : ObjCClass { + open fun systemStatusBar(): NSStatusBar? + } + + /** + * @param length A constant that specifies whether the status item is of fixed width, or variable width. + * The valid constants are described in Status Bar Item Length. + * @return An NSStatusItem object or nil if the item could not be created. + */ + abstract fun statusItemWithLength(length: CGFloat?): NSStatusItem? + + /** + * Removes the specified status item from the receiver + * + * @param item The NSStatusItem object to remove. + */ + abstract fun removeStatusItem(item: NSStatusItem?) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSStatusBar", _Class::class.java) + + val NSVariableStatusItemLength: CGFloat? = CGFloat(-1.0) + val NSSquareStatusItemLength: CGFloat? = CGFloat(-2.0) + + fun systemStatusBar(): NSStatusBar? { + return CLASS.systemStatusBar() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStatusBarButton.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStatusBarButton.kt new file mode 100644 index 00000000..b0bef245 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStatusBarButton.kt @@ -0,0 +1,7 @@ +package darwin + +abstract class NSStatusBarButton : NSButton() { + abstract fun appearsDisabled(): Boolean + + abstract fun setAppearsDisabled(appearsDisabled: Boolean) +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStatusItem.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStatusItem.kt new file mode 100644 index 00000000..b79e0eaf --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStatusItem.kt @@ -0,0 +1,39 @@ +package darwin + +import org.rococoa.cocoa.CGFloat + +abstract class NSStatusItem : NSObject() { + /** + * @return The status bar in which the status item is displayed. + */ + abstract fun statusBar(): NSStatusBar? + + /** + * If the status bar is horizontal, the value of this property is the width of the status item. + * In addition to a fixed length, this value can be NSSquareStatusItemLength or NSVariableStatusItemLength + * (see NSStatusBar Constants) to allow the status bar to allocate (and adjust) the space according to either + * the status bar’s thickness or the status item’s true size. + * + * @return The amount of space in the status bar that should be allocated to the status item. + */ + abstract fun length(): CGFloat? + + /** + * @param length The amount of space in the status bar that should be allocated to the status item. + */ + abstract fun setLength(length: CGFloat?) + + /** + * The pull-down menu that is displayed when the status item is clicked. + */ + abstract fun menu(): NSMenu? + + abstract fun setMenu(menu: NSMenu?) + + /** + * This button is created automatically on the creation of the status item. Behavior customization for the + * button, such as image, target, action, tooltip, and so on can be set with this property. + */ + abstract fun button(): NSStatusBarButton? + +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStepper.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStepper.kt new file mode 100644 index 00000000..4e77c377 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSStepper.kt @@ -0,0 +1,64 @@ +package darwin + +/// native declaration : :10 +abstract class NSStepper : NSControl() { + /** + * Original signature : `double minValue()`

+ * *native declaration : :18* + */ + abstract fun minValue(): Double + + /** + * Original signature : `void setMinValue(double)`

+ * *native declaration : :19* + */ + abstract fun setMinValue(minValue: Double) + + /** + * Original signature : `double maxValue()`

+ * *native declaration : :21* + */ + abstract fun maxValue(): Double + + /** + * Original signature : `void setMaxValue(double)`

+ * *native declaration : :22* + */ + abstract fun setMaxValue(maxValue: Double) + + /** + * Original signature : `double increment()`

+ * *native declaration : :24* + */ + abstract fun increment(): Double + + /** + * Original signature : `void setIncrement(double)`

+ * *native declaration : :25* + */ + abstract fun setIncrement(increment: Double) + + /** + * Original signature : `BOOL valueWraps()`

+ * *native declaration : :27* + */ + abstract fun valueWraps(): Boolean + + /** + * Original signature : `void setValueWraps(BOOL)`

+ * *native declaration : :28* + */ + abstract fun setValueWraps(valueWraps: Boolean) + + /** + * Original signature : `BOOL autorepeat()`

+ * *native declaration : :30* + */ + abstract fun autorepeat(): Boolean + + /** + * Original signature : `void setAutorepeat(BOOL)`

+ * *native declaration : :31* + */ + abstract fun setAutorepeat(autorepeat: Boolean) +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSString.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSString.kt new file mode 100644 index 00000000..a8ec79c4 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSString.kt @@ -0,0 +1,948 @@ +package darwin + +import org.rococoa.Foundation +import org.rococoa.ObjCClass +import org.rococoa.ObjCObjectByReference +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSUInteger +import java.nio.IntBuffer + +/// native declaration : :85 +abstract class NSString : NSObject(), NSCopying { + @Override + override fun hashCode(): Int { + return this.toString().hashCode() + } + + + override fun equals(other: Any?): Boolean { + if (null == other) { + return false + } + if (other is NSString) { + return this.toString().equals(other.toString()) + } + return false + } + + @Override + override fun toString(): String { + return Foundation.toString(this.id()) + } + + interface _Class : ObjCClass { + open fun alloc(): NSString + + /** + * User-dependent encoding who value is derived from user's default language and potentially other factors. The use of this encoding might sometimes be needed when interpreting user documents with unknown encodings, in the absence of other hints. This encoding should be used rarely, if at all. Note that some potential values here might result in unexpected encoding conversions of even fairly straightforward NSString content --- for instance, punctuation characters with a bidirectional encoding.

+ * Original signature : `NSStringEncoding defaultCStringEncoding()`

+ * Should be rarely used

+ * *from NSStringExtensionMethods native declaration : :242* + */ + open fun defaultCStringEncoding(): NSUInteger? + + /** + * Original signature : `const NSStringEncoding* availableStringEncodings()`

+ * *from NSStringExtensionMethods native declaration : :244* + */ + open fun availableStringEncodings(): com.sun.jna.ptr.IntByReference? + + /** + * Original signature : `NSString* localizedNameOfStringEncoding(NSStringEncoding)`

+ * *from NSStringExtensionMethods native declaration : :245* + */ + open fun localizedNameOfStringEncoding(encoding: NSUInteger?): NSString? + + /** + * Original signature : `string()`

+ * *from NSStringExtensionMethods native declaration : :266* + */ + open fun string(): String? + + /** + * Original signature : `stringWithString(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :267* + */ + open fun stringWithString(string: String?): NSString + + /** + * Original signature : `stringWithCharacters(const unichar*, NSUInteger)`

+ * *from NSStringExtensionMethods native declaration : :268* + */ + open fun stringWithCharacters_length(characters: CharArray?, length: NSUInteger?): NSString? + + /** + * Original signature : `stringWithUTF8String(const char*)`

+ * *from NSStringExtensionMethods native declaration : :269* + */ + open fun stringWithUTF8String(nullTerminatedCString: String?): NSString? + + /** + * Original signature : `stringWithFormat(NSString*, null)`

+ * *from NSStringExtensionMethods native declaration : :270* + */ + open fun stringWithFormat(format: NSString?, vararg varargs: NSObject?): NSString? + + /** + * Original signature : `localizedStringWithFormat(NSString*, null)`

+ * *from NSStringExtensionMethods native declaration : :271* + */ + open fun localizedStringWithFormat(format: NSString?, vararg varargs: NSObject?): NSString? + + /** + * Original signature : `stringWithCString(const char*, NSStringEncoding)`

+ * *from NSStringExtensionMethods native declaration : :275* + */ + open fun stringWithCString_encoding(cString: String?, enc: NSUInteger?): NSString? + + /** + * Original signature : `stringWithContentsOfURL(NSURL*, NSStringEncoding, NSError**)`

+ * *from NSStringExtensionMethods native declaration : :281* + */ + open fun stringWithContentsOfURL_encoding_error( + url: NSURL?, + enc: NSUInteger?, + error: ObjCObjectByReference? + ): NSString? + + /** + * Original signature : `stringWithContentsOfFile(NSString*, NSStringEncoding, NSError**)`

+ * *from NSStringExtensionMethods native declaration : :282* + */ + open fun stringWithContentsOfFile_encoding_error( + path: NSString?, + enc: NSUInteger?, + error: ObjCObjectByReference? + ): NSString? + + /** + * Original signature : `stringWithContentsOfURL(NSURL*, NSStringEncoding*, NSError**)`

+ * *from NSStringExtensionMethods native declaration : :288* + */ + open fun stringWithContentsOfURL_usedEncoding_error( + url: NSURL?, + enc: IntBuffer?, + error: ObjCObjectByReference? + ): NSString? + + /** + * Original signature : `stringWithContentsOfFile(NSString*, NSStringEncoding*, NSError**)`

+ * *from NSStringExtensionMethods native declaration : :289* + */ + open fun stringWithContentsOfFile_usedEncoding_error( + path: NSString?, + enc: IntBuffer?, + error: ObjCObjectByReference? + ): NSString? + + /** + * Original signature : `stringWithContentsOfFile(NSString*)`

+ * *from NSStringDeprecated native declaration : :358* + */ + open fun stringWithContentsOfFile(path: NSString?): NSString? + + /** + * Original signature : `stringWithContentsOfURL(NSURL*)`

+ * *from NSStringDeprecated native declaration : :359* + */ + open fun stringWithContentsOfURL(url: NSURL?): NSString? + + /** + * Original signature : `stringWithCString(const char*, NSUInteger)`

+ * *from NSStringDeprecated native declaration : :364* + */ + open fun stringWithCString_length(bytes: String?, length: NSUInteger?): NSString? + + /** + * Original signature : `stringWithCString(const char*)`

+ * *from NSStringDeprecated native declaration : :365* + */ + open fun stringWithCString(bytes: String?): NSString? + } + + /** + * NSString primitive (funnel) methods. A minimal subclass of NSString just needs to implement these, although we also recommend getCharacters:range:. See below for the other methods.

+ * Original signature : `NSUInteger length()`

+ * *native declaration : :89* + */ + abstract fun length(): NSUInteger? + + /** + * Original signature : `unichar characterAtIndex(NSUInteger)`

+ * *native declaration : :90* + */ + abstract fun characterAtIndex(index: NSUInteger?): Char + + /** + * Original signature : `void getCharacters(unichar*)`

+ * *from NSStringExtensionMethods native declaration : :96* + */ + abstract fun getCharacters(buffer: Char) + /** + * *from NSStringExtensionMethods native declaration : :97*

+ * Conversion Error : /// Original signature : `void getCharacters(unichar*, null)`

+ * - (void)getCharacters:(unichar*)buffer range:(null)aRange; (Argument aRange cannot be converted) + */ + /** + * Original signature : `NSString* substringFromIndex(NSUInteger)`

+ * *from NSStringExtensionMethods native declaration : :99* + */ + abstract fun substringFromIndex(from: NSUInteger?): NSString? + + /** + * Original signature : `NSString* substringToIndex(NSUInteger)`

+ * *from NSStringExtensionMethods native declaration : :100* + */ + abstract fun substringToIndex(to: NSUInteger?): NSString? + /** + * *from NSStringExtensionMethods native declaration : :101*

+ * Conversion Error : /// Original signature : `NSString* substringWithRange(null)`

+ * - (NSString*)substringWithRange:(null)range; // Hint: Use with rangeOfComposedCharacterSequencesForRange: to avoid breaking up composed characters

+ * (Argument range cannot be converted) + */ + /** + * Original signature : `compare(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :103* + */ + abstract fun compare(string: NSString?): com.sun.jna.Pointer? + + /** + * Original signature : `compare(NSString*, NSStringCompareOptions)`

+ * *from NSStringExtensionMethods native declaration : :104* + */ + abstract fun compare_options(string: NSString?, mask: Int): com.sun.jna.Pointer? + /** + * *from NSStringExtensionMethods native declaration : :105*

+ * Conversion Error : /// Original signature : `compare(NSString*, NSStringCompareOptions, null)`

+ * - (null)compare:(NSString*)string options:(NSStringCompareOptions)mask range:(null)compareRange; (Argument compareRange cannot be converted) + */ + /** + * *from NSStringExtensionMethods native declaration : :106*

+ * Conversion Error : /// Original signature : `compare(NSString*, NSStringCompareOptions, null, null)`

+ * - (null)compare:(NSString*)string options:(NSStringCompareOptions)mask range:(null)compareRange locale:(null)locale; // locale arg used to be a dictionary pre-Leopard. We now accepts NSLocale. Assumes the current locale if non-nil and non-NSLocale.

+ * (Argument compareRange cannot be converted) + */ + /** + * Original signature : `caseInsensitiveCompare(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :107* + */ + abstract fun caseInsensitiveCompare(string: NSString?): com.sun.jna.Pointer? + + /** + * Original signature : `localizedCompare(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :108* + */ + abstract fun localizedCompare(string: NSString?): com.sun.jna.Pointer? + + /** + * Original signature : `localizedCaseInsensitiveCompare(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :109* + */ + abstract fun localizedCaseInsensitiveCompare(string: NSString?): com.sun.jna.Pointer? + + /** + * Original signature : `BOOL isEqualToString(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :111* + */ + abstract fun isEqualToString(aString: String?): Boolean + + /** + * Original signature : `BOOL hasPrefix(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :113* + */ + abstract fun hasPrefix(aString: NSString?): Boolean + + /** + * Original signature : `BOOL hasSuffix(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :114* + */ + abstract fun hasSuffix(aString: NSString?): Boolean + + /** + * These methods return length==0 if the target string is not found. So, to check for containment: ([str rangeOfString:@"target"].length > 0). Note that the length of the range returned by these methods might be different than the length of the target string, due composed characters and such.

+ * Original signature : `rangeOfString(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :118* + */ + abstract fun rangeOfString(aString: NSString?): NSRange? + + /** + * Original signature : `rangeOfString(NSString*, NSStringCompareOptions)`

+ * *from NSStringExtensionMethods native declaration : :119* + */ + abstract fun rangeOfString_options(aString: NSString?, mask: Int): NSRange? + /** + * *from NSStringExtensionMethods native declaration : :120*

+ * Conversion Error : /// Original signature : `rangeOfString(NSString*, NSStringCompareOptions, null)`

+ * - (null)rangeOfString:(NSString*)aString options:(NSStringCompareOptions)mask range:(null)searchRange; (Argument searchRange cannot be converted) + */ + /** + * *from NSStringExtensionMethods native declaration : :122*

+ * Conversion Error : /// Original signature : `rangeOfString(NSString*, NSStringCompareOptions, null, NSLocale*)`

+ * - (null)rangeOfString:(NSString*)aString options:(NSStringCompareOptions)mask range:(null)searchRange locale:(NSLocale*)locale; (Argument searchRange cannot be converted) + */ + /** + * These return the range of the first character from the set in the string, not the range of a sequence of characters.

+ * Original signature : `rangeOfCharacterFromSet(NSCharacterSet*)`

+ * *from NSStringExtensionMethods native declaration : :127* + */ + abstract fun rangeOfCharacterFromSet(aSet: com.sun.jna.Pointer?): NSRange? + + /** + * Original signature : `rangeOfCharacterFromSet(NSCharacterSet*, NSStringCompareOptions)`

+ * *from NSStringExtensionMethods native declaration : :128* + */ + abstract fun rangeOfCharacterFromSet_options(aSet: com.sun.jna.Pointer?, mask: Int): NSRange? + /** + * *from NSStringExtensionMethods native declaration : :129*

+ * Conversion Error : /// Original signature : `rangeOfCharacterFromSet(NSCharacterSet*, NSStringCompareOptions, null)`

+ * - (null)rangeOfCharacterFromSet:(NSCharacterSet*)aSet options:(NSStringCompareOptions)mask range:(null)searchRange; (Argument searchRange cannot be converted) + */ + /** + * Original signature : `rangeOfComposedCharacterSequenceAtIndex(NSUInteger)`

+ * *from NSStringExtensionMethods native declaration : :131* + */ + abstract fun rangeOfComposedCharacterSequenceAtIndex(index: NSUInteger?): NSRange? + /** + * *from NSStringExtensionMethods native declaration : :133*

+ * Conversion Error : /// Original signature : `rangeOfComposedCharacterSequencesForRange(null)`

+ * - (null)rangeOfComposedCharacterSequencesForRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `NSString* stringByAppendingString(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :136* + */ + abstract fun stringByAppendingString(aString: NSString?): NSString? + + /** + * Original signature : `NSString* stringByAppendingFormat(NSString*, null)`

+ * *from NSStringExtensionMethods native declaration : :137* + */ + abstract fun stringByAppendingFormat(format: NSString?, vararg varargs: NSObject?): NSString? + + /** + * The following convenience methods all skip initial space characters (whitespaceSet) and ignore trailing characters. NSScanner can be used for more "exact" parsing of numbers.

+ * Original signature : `double doubleValue()`

+ * *from NSStringExtensionMethods native declaration : :141* + */ + abstract fun doubleValue(): Double + + /** + * Original signature : `float floatValue()`

+ * *from NSStringExtensionMethods native declaration : :142* + */ + abstract fun floatValue(): Float + + /** + * Original signature : `int intValue()`

+ * *from NSStringExtensionMethods native declaration : :143* + */ + abstract fun intValue(): Int + + /** + * Original signature : `NSInteger integerValue()`

+ * *from NSStringExtensionMethods native declaration : :145* + */ + abstract fun integerValue(): NSInteger? + + /** + * Original signature : `long long longLongValue()`

+ * *from NSStringExtensionMethods native declaration : :146* + */ + abstract fun longLongValue(): Long + + /** + * Original signature : `BOOL boolValue()`

+ * Skips initial space characters (whitespaceSet), or optional -/+ sign followed by zeroes. Returns YES on encountering one of "Y", "y", "T", "t", or a digit 1-9. It ignores any trailing characters.

+ * *from NSStringExtensionMethods native declaration : :147* + */ + abstract fun boolValue(): Boolean + + /** + * Original signature : `NSArray* componentsSeparatedByString(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :150* + */ + abstract fun componentsSeparatedByString(separator: NSString?): NSArray? + + /** + * Original signature : `NSArray* componentsSeparatedByCharactersInSet(NSCharacterSet*)`

+ * *from NSStringExtensionMethods native declaration : :152* + */ + abstract fun componentsSeparatedByCharactersInSet(separator: com.sun.jna.Pointer?): NSArray? + + /** + * Original signature : `NSString* commonPrefixWithString(NSString*, NSStringCompareOptions)`

+ * *from NSStringExtensionMethods native declaration : :155* + */ + abstract fun commonPrefixWithString_options(aString: NSString?, mask: Int): NSString? + + /** + * Original signature : `NSString* uppercaseString()`

+ * *from NSStringExtensionMethods native declaration : :157* + */ + abstract fun uppercaseString(): NSString? + + /** + * Original signature : `NSString* lowercaseString()`

+ * *from NSStringExtensionMethods native declaration : :158* + */ + abstract fun lowercaseString(): NSString? + + /** + * Original signature : `NSString* capitalizedString()`

+ * *from NSStringExtensionMethods native declaration : :159* + */ + abstract fun capitalizedString(): NSString? + + /** + * Original signature : `NSString* stringByTrimmingCharactersInSet(NSCharacterSet*)`

+ * *from NSStringExtensionMethods native declaration : :162* + */ + abstract fun stringByTrimmingCharactersInSet(set: com.sun.jna.Pointer?): NSString? + + /** + * Original signature : `NSString* stringByPaddingToLength(NSUInteger, NSString*, NSUInteger)`

+ * *from NSStringExtensionMethods native declaration : :163* + */ + abstract fun stringByPaddingToLength_withString_startingAtIndex( + newLength: NSUInteger?, + padString: NSString?, + padIndex: NSUInteger? + ): NSString? + /** + * *from NSStringExtensionMethods native declaration : :166*

+ * Conversion Error : /// Original signature : `void getLineStart(NSUInteger*, NSUInteger*, NSUInteger*, null)`

+ * - (void)getLineStart:(NSUInteger*)startPtr end:(NSUInteger*)lineEndPtr contentsEnd:(NSUInteger*)contentsEndPtr forRange:(null)range; (Argument range cannot be converted) + */ + /** + * *from NSStringExtensionMethods native declaration : :167*

+ * Conversion Error : /// Original signature : `lineRangeForRange(null)`

+ * - (null)lineRangeForRange:(null)range; (Argument range cannot be converted) + */ + /** + * *from NSStringExtensionMethods native declaration : :170*

+ * Conversion Error : /// Original signature : `void getParagraphStart(NSUInteger*, NSUInteger*, NSUInteger*, null)`

+ * - (void)getParagraphStart:(NSUInteger*)startPtr end:(NSUInteger*)parEndPtr contentsEnd:(NSUInteger*)contentsEndPtr forRange:(null)range; (Argument range cannot be converted) + */ + /** + * *from NSStringExtensionMethods native declaration : :171*

+ * Conversion Error : /// Original signature : `paragraphRangeForRange(null)`

+ * - (null)paragraphRangeForRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `NSString* description()`

+ * *from NSStringExtensionMethods native declaration : :174* + */ + abstract override fun description(): String? + + /** + * If two objects are equal (as determined by the isEqual: method), they must have the same hash value. This + * last point is particularly important if you define hash in a subclass and intend to put + * instances of that subclass into a collection. + * + * + * If a mutable object is added to a collection that uses hash values to determine the object’s + * position in the collection, the value returned by the hash method of the object must not change + * while the object is in the collection. Therefore, either the hash method must not rely on any of + * the object’s internal state information or you must make sure the object’s internal state information + * does not change while the object is in the collection. Thus, for example, a mutable dictionary can be + * put in a hash table but you must not change it while it is in there. (Note that it can be difficult to + * know whether or not a given object is in a collection.) + * + * + * Original signature : `NSUInteger hash()`

+ * *from NSStringExtensionMethods native declaration : :176* + * + * @return An integer that can be used as a table address in a hash table structure. + */ + abstract override fun hash(): NSUInteger? + + /** + * Original signature : `NSStringEncoding fastestEncoding()`

+ * Result in O(1) time; a rough estimate

+ * *from NSStringExtensionMethods native declaration : :180* + */ + abstract fun fastestEncoding(): NSUInteger? + + /** + * Original signature : `NSStringEncoding smallestEncoding()`

+ * Result in O(n) time; the encoding in which the string is most compact

+ * *from NSStringExtensionMethods native declaration : :181* + */ + abstract fun smallestEncoding(): NSUInteger? + + /** + * Original signature : `NSData* dataUsingEncoding(NSStringEncoding, BOOL)`

+ * External representation

+ * *from NSStringExtensionMethods native declaration : :183* + */ + abstract fun dataUsingEncoding_allowLossyConversion(encoding: NSUInteger?, lossy: Boolean): NSData? + + /** + * Original signature : `NSData* dataUsingEncoding(NSStringEncoding)`

+ * External representation

+ * *from NSStringExtensionMethods native declaration : :184* + */ + abstract fun dataUsingEncoding(encoding: NSUInteger?): NSData? + + /** + * Original signature : `BOOL canBeConvertedToEncoding(NSStringEncoding)`

+ * *from NSStringExtensionMethods native declaration : :186* + */ + abstract fun canBeConvertedToEncoding(encoding: NSUInteger?): Boolean + + /** + * Methods to convert NSString to a NULL-terminated cString using the specified encoding. Note, these are the "new" cString methods, and are not deprecated like the older cString methods which do not take encoding arguments.

+ * Original signature : `const char* cStringUsingEncoding(NSStringEncoding)`

+ * "Autoreleased"; NULL return if encoding conversion not possible; for performance reasons, lifetime of this should not be considered longer than the lifetime of the receiving string (if the receiver string is freed, this might go invalid then, before the end of the autorelease scope)

+ * *from NSStringExtensionMethods native declaration : :191* + */ + abstract fun cStringUsingEncoding(encoding: NSUInteger?): com.sun.jna.ptr.ByteByReference? + + /** + * Original signature : `BOOL getCString(char*, NSUInteger, NSStringEncoding)`

+ * NO return if conversion not possible due to encoding errors or too small of a buffer. The buffer should include room for maxBufferCount bytes; this number should accomodate the expected size of the return value plus the NULL termination character, which this method adds. (So note that the maxLength passed to this method is one more than the one you would have passed to the deprecated getCString:maxLength:.)

+ * *from NSStringExtensionMethods native declaration : :192* + */ + abstract fun getCString_maxLength_encoding( + buffer: java.nio.ByteBuffer?, + maxBufferCount: NSUInteger?, + encoding: NSUInteger? + ): Boolean + /** + * *from NSStringExtensionMethods native declaration : :205*

+ * Conversion Error : / **

+ * * Use this to convert string section at a time into a fixed-size buffer, without any allocations. Does not NULL-terminate.

+ * * buffer is the buffer to write to; if NULL, this method can be used to computed size of needed buffer.

+ * * maxBufferCount is the length of the buffer in bytes. It's a good idea to make sure this is at least enough to hold one character's worth of conversion.

+ * * usedBufferCount is the length of the buffer used up by the current conversion. Can be NULL.

+ * * encoding is the encoding to convert to.

+ * * options specifies the options to apply.

+ * * range is the range to convert.

+ * * leftOver is the remaining range. Can be NULL.

+ * * YES return indicates some characters were converted. Conversion might usually stop when the buffer fills,

+ * * but it might also stop when the conversion isn't possible due to the chosen encoding.

+ * * Original signature : `BOOL getBytes(void*, NSUInteger, NSUInteger*, NSStringEncoding, NSStringEncodingConversionOptions, null, null)`

+ * * /

+ * - (BOOL)getBytes:(void*)buffer maxLength:(NSUInteger)maxBufferCount usedLength:(NSUInteger*)usedBufferCount encoding:(NSStringEncoding)encoding options:(NSStringEncodingConversionOptions)options range:(null)range remainingRange:(null)leftover; (Argument range cannot be converted) + */ + /** + * These return the maximum and exact number of bytes needed to store the receiver in the specified encoding in non-external representation. The first one is O(1), while the second one is O(n). These do not include space for a terminating null.

+ * Original signature : `NSUInteger maximumLengthOfBytesUsingEncoding(NSStringEncoding)`

+ * Result in O(1) time; the estimate may be way over what's needed

+ * *from NSStringExtensionMethods native declaration : :209* + */ + abstract fun maximumLengthOfBytesUsingEncoding(enc: Int): NSUInteger? + + /** + * Original signature : `NSUInteger lengthOfBytesUsingEncoding(NSStringEncoding)`

+ * Result in O(n) time; the result is exact

+ * *from NSStringExtensionMethods native declaration : :210* + */ + abstract fun lengthOfBytesUsingEncoding(enc: Int): NSUInteger? + + /** + * Original signature : `NSString* decomposedStringWithCanonicalMapping()`

+ * *from NSStringExtensionMethods native declaration : :214* + */ + abstract fun decomposedStringWithCanonicalMapping(): NSString? + + /** + * Original signature : `NSString* precomposedStringWithCanonicalMapping()`

+ * *from NSStringExtensionMethods native declaration : :215* + */ + abstract fun precomposedStringWithCanonicalMapping(): NSString? + + /** + * Original signature : `NSString* decomposedStringWithCompatibilityMapping()`

+ * *from NSStringExtensionMethods native declaration : :216* + */ + abstract fun decomposedStringWithCompatibilityMapping(): NSString? + + /** + * Original signature : `NSString* precomposedStringWithCompatibilityMapping()`

+ * *from NSStringExtensionMethods native declaration : :217* + */ + abstract fun precomposedStringWithCompatibilityMapping(): NSString? + + /** + * Returns a string with the character folding options applied. theOptions is a mask of compare flags with *InsensitiveSearch suffix.

+ * Original signature : `NSString* stringByFoldingWithOptions(NSStringCompareOptions, NSLocale*)`

+ * *from NSStringExtensionMethods native declaration : :223* + */ + abstract fun stringByFoldingWithOptions_locale(options: Int, locale: com.sun.jna.Pointer?): NSString? + /** + * *from NSStringExtensionMethods native declaration : :227*

+ * Conversion Error : / **

+ * * Replace all occurrences of the target string in the specified range with replacement. Specified compare options are used for matching target.

+ * * Original signature : `NSString* stringByReplacingOccurrencesOfString(NSString*, NSString*, NSStringCompareOptions, null)`

+ * * /

+ * - (NSString*)stringByReplacingOccurrencesOfString:(NSString*)target withString:(NSString*)replacement options:(NSStringCompareOptions)options range:(null)searchRange; (Argument searchRange cannot be converted) + */ + /** + * Replace all occurrences of the target string with replacement. Invokes the above method with 0 options and range of the whole string.

+ * Original signature : `NSString* stringByReplacingOccurrencesOfString(NSString*, NSString*)`

+ * *from NSStringExtensionMethods native declaration : :231* + */ + abstract fun stringByReplacingOccurrencesOfString_withString(target: NSString?, replacement: NSString?): NSString? + /** + * *from NSStringExtensionMethods native declaration : :235*

+ * Conversion Error : / **

+ * * Replace characters in range with the specified string, returning new string.

+ * * Original signature : `NSString* stringByReplacingCharactersInRange(null, NSString*)`

+ * * /

+ * - (NSString*)stringByReplacingCharactersInRange:(null)range withString:(NSString*)replacement; (Argument range cannot be converted) + */ + /** + * Original signature : `const char* UTF8String()`

+ * Convenience to return null-terminated UTF8 representation

+ * *from NSStringExtensionMethods native declaration : :238* + */ + abstract fun UTF8String(): com.sun.jna.ptr.ByteByReference? + + /** + * In general creation methods in NSString do not apply to subclassers, as subclassers are assumed to provide their own init methods which create the string in the way the subclass wishes. Designated initializers of NSString are thus init and initWithCoder:.

+ * Original signature : `init()`

+ * *from NSStringExtensionMethods native declaration : :251* + */ + abstract fun init(): NSString? + + /** + * Original signature : `initWithCharactersNoCopy(unichar*, NSUInteger, BOOL)`

+ * "NoCopy" is a hint

+ * *from NSStringExtensionMethods native declaration : :252* + */ + abstract fun initWithCharactersNoCopy_length_freeWhenDone( + characters: Char, + length: NSUInteger?, + freeBuffer: Boolean + ): NSString? + + /** + * Original signature : `initWithCharacters(const unichar*, NSUInteger)`

+ * *from NSStringExtensionMethods native declaration : :253* + */ + abstract fun initWithCharacters_length(characters: CharArray?, length: NSUInteger?): NSString? + + /** + * Original signature : `initWithUTF8String(const char*)`

+ * *from NSStringExtensionMethods native declaration : :254* + */ + abstract fun initWithUTF8String(nullTerminatedCString: String?): NSString? + + /** + * Original signature : `initWithString(NSString*)`

+ * *from NSStringExtensionMethods native declaration : :255* + */ + abstract fun initWithString(aString: String?): NSString + + /** + * Original signature : `initWithFormat(NSString*, null)`

+ * *from NSStringExtensionMethods native declaration : :256* + */ + abstract fun initWithFormat(format: String?, vararg varargs: NSObject?): NSString? + /** + * *from NSStringExtensionMethods native declaration : :257*

+ * Conversion Error : /// Original signature : `initWithFormat(NSString*, null)`

+ * - (null)initWithFormat:(NSString*)format arguments:(null)argList; (Argument argList cannot be converted) + */ + /** + * *from NSStringExtensionMethods native declaration : :258*

+ * Conversion Error : /// Original signature : `initWithFormat(NSString*, null, null)`

+ * - (null)initWithFormat:(NSString*)format locale:(null)locale, ...; (Argument locale cannot be converted) + */ + /** + * *from NSStringExtensionMethods native declaration : :259*

+ * Conversion Error : /// Original signature : `initWithFormat(NSString*, null, null)`

+ * - (null)initWithFormat:(NSString*)format locale:(null)locale arguments:(null)argList; (Argument locale cannot be converted) + */ + /** + * Original signature : `initWithData(NSData*, NSStringEncoding)`

+ * *from NSStringExtensionMethods native declaration : :260* + */ + abstract fun initWithData_encoding(data: NSData?, encoding: NSUInteger?): NSString? + + /** + * Original signature : `initWithBytes(const void*, NSUInteger, NSStringEncoding)`

+ * *from NSStringExtensionMethods native declaration : :261* + */ + abstract fun initWithBytes_length_encoding( + bytes: com.sun.jna.Pointer?, + len: NSUInteger?, + encoding: NSUInteger? + ): NSString? + + /** + * Original signature : `initWithBytesNoCopy(void*, NSUInteger, NSStringEncoding, BOOL)`

+ * "NoCopy" is a hint

+ * *from NSStringExtensionMethods native declaration : :263* + */ + abstract fun initWithBytesNoCopy_length_encoding_freeWhenDone( + bytes: com.sun.jna.Pointer?, + len: NSUInteger?, + encoding: NSUInteger?, + freeBuffer: Boolean + ): NSString? + + /** + * Original signature : `initWithCString(const char*, NSStringEncoding)`

+ * *from NSStringExtensionMethods native declaration : :274* + */ + abstract fun initWithCString_encoding(nullTerminatedCString: String?, encoding: NSUInteger?): NSString? + + /** + * These use the specified encoding. If nil is returned, the optional error return indicates problem that was encountered (for instance, file system or encoding errors).

+ * Original signature : `initWithContentsOfURL(NSURL*, NSStringEncoding, NSError**)`

+ * *from NSStringExtensionMethods native declaration : :279* + */ + abstract fun initWithContentsOfURL_encoding_error( + url: NSURL?, + enc: NSUInteger?, + error: ObjCObjectByReference? + ): NSString? + + /** + * Original signature : `initWithContentsOfFile(NSString*, NSStringEncoding, NSError**)`

+ * *from NSStringExtensionMethods native declaration : :280* + */ + abstract fun initWithContentsOfFile_encoding_error( + path: NSString?, + enc: NSUInteger?, + error: ObjCObjectByReference? + ): NSString? + + /** + * These try to determine the encoding, and return the encoding which was used. Note that these methods might get "smarter" in subsequent releases of the system, and use additional techniques for recognizing encodings. If nil is returned, the optional error return indicates problem that was encountered (for instance, file system or encoding errors).

+ * Original signature : `initWithContentsOfURL(NSURL*, NSStringEncoding*, NSError**)`

+ * *from NSStringExtensionMethods native declaration : :286* + */ + abstract fun initWithContentsOfURL_usedEncoding_error( + url: NSURL?, + enc: IntBuffer?, + error: ObjCObjectByReference? + ): NSString? + + /** + * Original signature : `initWithContentsOfFile(NSString*, NSStringEncoding*, NSError**)`

+ * *from NSStringExtensionMethods native declaration : :287* + */ + abstract fun initWithContentsOfFile_usedEncoding_error( + path: NSString?, + enc: IntBuffer?, + error: ObjCObjectByReference? + ): NSString? + + /** + * Write to specified url or path using the specified encoding. The optional error return is to indicate file system or encoding errors.

+ * Original signature : `BOOL writeToURL(NSURL*, BOOL, NSStringEncoding, NSError**)`

+ * *from NSStringExtensionMethods native declaration : :293* + */ + abstract fun writeToURL_atomically_encoding_error( + url: NSURL?, + useAuxiliaryFile: Boolean, + enc: NSUInteger?, + error: ObjCObjectByReference? + ): Boolean + + /** + * Original signature : `BOOL writeToFile(NSString*, BOOL, NSStringEncoding, NSError**)`

+ * *from NSStringExtensionMethods native declaration : :294* + */ + abstract fun writeToFile_atomically_encoding_error( + path: NSString?, + useAuxiliaryFile: Boolean, + enc: NSUInteger?, + error: ObjCObjectByReference? + ): Boolean + + /** + * Original signature : `propertyList()`

+ * *from NSExtendedStringPropertyListParsing native declaration : :335* + */ + abstract fun propertyList(): com.sun.jna.Pointer? + + /** + * Original signature : `NSDictionary* propertyListFromStringsFileFormat()`

+ * *from NSExtendedStringPropertyListParsing native declaration : :336* + */ + abstract fun propertyListFromStringsFileFormat(): NSDictionary? + + /** + * The methods in this category are deprecated and will be removed from this header file in the near future. These methods use [NSString defaultCStringEncoding] as the encoding to convert to, which means the results depend on the user's language and potentially other settings. This might be appropriate in some cases, but often these methods are misused, resulting in issues when running in languages other then English. UTF8String in general is a much better choice when converting arbitrary NSStrings into 8-bit representations. Additional potential replacement methods are being introduced in NSString as appropriate.

+ * Original signature : `const char* cString()`

+ * *from NSStringDeprecated native declaration : :346* + */ + abstract fun cString(): com.sun.jna.ptr.ByteByReference? + + /** + * Original signature : `const char* lossyCString()`

+ * *from NSStringDeprecated native declaration : :347* + */ + abstract fun lossyCString(): com.sun.jna.ptr.ByteByReference? + + /** + * Original signature : `NSUInteger cStringLength()`

+ * *from NSStringDeprecated native declaration : :348* + */ + abstract fun cStringLength(): NSUInteger? + + /** + * Original signature : `void getCString(char*)`

+ * *from NSStringDeprecated native declaration : :349* + */ + abstract fun getCString(bytes: java.nio.ByteBuffer?) + + /** + * Original signature : `void getCString(char*, NSUInteger)`

+ * *from NSStringDeprecated native declaration : :350* + */ + abstract fun getCString_maxLength(bytes: java.nio.ByteBuffer?, maxLength: NSUInteger?) + /** + * *from NSStringDeprecated native declaration : :351*

+ * Conversion Error : /// Original signature : `void getCString(char*, NSUInteger, null, null)`

+ * - (void)getCString:(char*)bytes maxLength:(NSUInteger)maxLength range:(null)aRange remainingRange:(null)leftoverRange; (Argument aRange cannot be converted) + */ + /** + * Original signature : `BOOL writeToFile(NSString*, BOOL)`

+ * *from NSStringDeprecated native declaration : :353* + */ + abstract fun writeToFile_atomically(path: NSString?, useAuxiliaryFile: Boolean): Boolean + + /** + * Original signature : `BOOL writeToURL(NSURL*, BOOL)`

+ * *from NSStringDeprecated native declaration : :354* + */ + abstract fun writeToURL_atomically(url: NSURL?, atomically: Boolean): Boolean + + /** + * Original signature : `initWithContentsOfFile(NSString*)`

+ * *from NSStringDeprecated native declaration : :356* + */ + abstract fun initWithContentsOfFile(path: NSString?): NSString? + + /** + * Original signature : `initWithContentsOfURL(NSURL*)`

+ * *from NSStringDeprecated native declaration : :357* + */ + abstract fun initWithContentsOfURL(url: NSURL?): NSString? + + /** + * Original signature : `initWithCStringNoCopy(char*, NSUInteger, BOOL)`

+ * *from NSStringDeprecated native declaration : :361* + */ + abstract fun initWithCStringNoCopy_length_freeWhenDone( + bytes: java.nio.ByteBuffer?, + length: NSUInteger?, + freeBuffer: Boolean + ): NSString? + + /** + * Original signature : `initWithCString(const char*, NSUInteger)`

+ * *from NSStringDeprecated native declaration : :362* + */ + abstract fun initWithCString_length(bytes: String?, length: NSUInteger?): NSString? + + /** + * Original signature : `initWithCString(const char*)`

+ * *from NSStringDeprecated native declaration : :363* + */ + abstract fun initWithCString(bytes: String?): NSString? + + /** + * Original signature : `NSArray* pathComponents()`

+ * *native declaration : :20* + */ + abstract fun pathComponents(): NSArray? + + /** + * Original signature : `BOOL isAbsolutePath()`

+ * *native declaration : :22* + */ + abstract fun isAbsolutePath(): Boolean + + /** + * Original signature : `NSString* lastPathComponent()`

+ * *native declaration : :24* + */ + abstract fun lastPathComponent(): NSString? + + /** + * Original signature : `NSString* stringByDeletingLastPathComponent()`

+ * *native declaration : :25* + */ + abstract fun stringByDeletingLastPathComponent(): NSString? + + /** + * Original signature : `NSString* stringByAppendingPathComponent(NSString*)`

+ * *native declaration : :26* + */ + abstract fun stringByAppendingPathComponent(str: NSString?): NSString? + + /** + * Original signature : `NSString* pathExtension()`

+ * *native declaration : :28* + */ + abstract fun pathExtension(): NSString? + + /** + * Original signature : `NSString* stringByDeletingPathExtension()`

+ * *native declaration : :29* + */ + abstract fun stringByDeletingPathExtension(): NSString? + + /** + * Original signature : `NSString* stringByAppendingPathExtension(NSString*)`

+ * *native declaration : :30* + */ + abstract fun stringByAppendingPathExtension(str: NSString?): NSString? + + /** + * Original signature : `NSString* stringByAbbreviatingWithTildeInPath()`

+ * *native declaration : :32* + */ + abstract fun stringByAbbreviatingWithTildeInPath(): NSString? + + /** + * Original signature : `NSString* stringByExpandingTildeInPath()`

+ * *native declaration : :33* + */ + abstract fun stringByExpandingTildeInPath(): NSString? + + /** + * Original signature : `NSString* stringByStandardizingPath()`

+ * *native declaration : :35* + */ + abstract fun stringByStandardizingPath(): NSString? + + /** + * Original signature : `NSString* stringByResolvingSymlinksInPath()`

+ * *native declaration : :37* + */ + abstract fun stringByResolvingSymlinksInPath(): NSString? + + /** + * Original signature : `NSArray* stringsByAppendingPaths(NSArray*)`

+ * *native declaration : :39* + */ + abstract fun stringsByAppendingPaths(paths: NSArray?): NSArray? + + /** + * Original signature : `NSUInteger completePathIntoString(NSString**, BOOL, NSArray**, NSArray*)`

+ * *native declaration : :41* + */ + companion object { + val CLASS: _Class = org.rococoa.Rococoa.createClass("NSString", _Class::class.java) + + fun stringWithString(string: String?): NSString { + return CLASS.stringWithString(string) + } + + fun stringByAbbreviatingWithTildeInPath(string: String?): String? { + return CLASS.alloc().initWithString(string).stringByAbbreviatingWithTildeInPath().toString() + } + + fun stringByExpandingTildeInPath(string: String?): String? { + return CLASS.alloc().initWithString(string).stringByExpandingTildeInPath().toString() + } + } +} + diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTabView.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTabView.kt new file mode 100644 index 00000000..006fdf36 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTabView.kt @@ -0,0 +1,226 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :23 +abstract class NSTabView : NSView() { + interface Delegate { + open fun tabView_didSelectTabViewItem(tabView: NSTabView?, tabViewItem: NSTabViewItem?) + } + + /** + * Original signature : `void selectTabViewItem(NSTabViewItem*)`

+ * *native declaration : :74* + */ + abstract fun selectTabViewItem(tabViewItem: NSTabViewItem?) + + /** + * Original signature : `void selectTabViewItemAtIndex(NSInteger)`

+ * May raise an NSRangeException

+ * *native declaration : :75* + */ + abstract fun selectTabViewItemAtIndex(index: Int) + + /** + * Original signature : `void selectTabViewItemWithIdentifier(id)`

+ * May raise an NSRangeException if identifier not found

+ * *native declaration : :76* + */ + abstract fun selectTabViewItemWithIdentifier(identifier: String?) + + /** + * Original signature : `void takeSelectedTabViewItemFromSender(id)`

+ * May raise an NSRangeException

+ * *native declaration : :77* + */ + abstract fun takeSelectedTabViewItemFromSender(sender: ID?) + + /** + * Original signature : `void selectFirstTabViewItem(id)`

+ * *native declaration : :81* + */ + abstract fun selectFirstTabViewItem(sender: NSTabViewItem?) + + /** + * Original signature : `void selectLastTabViewItem(id)`

+ * *native declaration : :82* + */ + abstract fun selectLastTabViewItem(sender: NSTabViewItem?) + + /** + * Original signature : `void selectNextTabViewItem(id)`

+ * *native declaration : :83* + */ + abstract fun selectNextTabViewItem(sender: NSTabViewItem?) + + /** + * Original signature : `void selectPreviousTabViewItem(id)`

+ * *native declaration : :84* + */ + abstract fun selectPreviousTabViewItem(sender: NSTabViewItem?) + + /** + * Original signature : `NSTabViewItem* selectedTabViewItem()`

+ * return nil if none are selected

+ * *native declaration : :88* + */ + abstract fun selectedTabViewItem(): NSTabViewItem? + + /** + * Original signature : `NSFont* font()`

+ * returns font used for all tab labels.

+ * *native declaration : :89* + */ + abstract fun font(): NSFont? + + /** + * Original signature : `NSTabViewType tabViewType()`

+ * *native declaration : :90* + */ + abstract fun tabViewType(): NSUInteger? + + /** + * Original signature : `NSArray* tabViewItems()`

+ * *native declaration : :91* + */ + abstract fun tabViewItems(): NSArray? + + /** + * Original signature : `BOOL allowsTruncatedLabels()`

+ * *native declaration : :92* + */ + abstract fun allowsTruncatedLabels(): Boolean + + /** + * Original signature : `minimumSize()`

+ * returns the minimum size of the tab view

+ * *native declaration : :93* + */ + abstract fun minimumSize(): NSObject? + + /** + * Original signature : `BOOL drawsBackground()`

+ * only relevant for borderless tab view type

+ * *native declaration : :94* + */ + abstract fun drawsBackground(): Boolean + + /** + * Original signature : `controlTint()`

+ * *native declaration : :95* + */ + abstract fun controlTint(): NSUInteger? + + /** + * Original signature : `controlSize()`

+ * *native declaration : :96* + */ + abstract fun controlSize(): NSUInteger? + + /** + * Original signature : `void setFont(NSFont*)`

+ * *native declaration : :100* + */ + abstract fun setFont(font: NSFont?) + + /** + * Original signature : `void setTabViewType(NSTabViewType)`

+ * *native declaration : :101* + */ + abstract fun setTabViewType(tabViewType: NSUInteger?) + + /** + * Original signature : `void setAllowsTruncatedLabels(BOOL)`

+ * *native declaration : :102* + */ + abstract fun setAllowsTruncatedLabels(allowTruncatedLabels: Boolean) + + /** + * Original signature : `void setDrawsBackground(BOOL)`

+ * only relevant for borderless tab view type

+ * *native declaration : :103* + */ + abstract fun setDrawsBackground(flag: Boolean) + /** + * *native declaration : :104*

+ * Conversion Error : /// Original signature : `void setControlTint(null)`

+ * - (void)setControlTint:(null)controlTint; (Argument controlTint cannot be converted) + */ + /** + * *native declaration : :105*

+ * Conversion Error : /// Original signature : `void setControlSize(null)`

+ * - (void)setControlSize:(null)controlSize; (Argument controlSize cannot be converted) + */ + /** + * Original signature : `void addTabViewItem(NSTabViewItem*)`

+ * Add tab at the end.

+ * *native declaration : :109* + */ + abstract fun addTabViewItem(tabViewItem: NSTabViewItem?) + + /** + * Original signature : `void insertTabViewItem(NSTabViewItem*, NSInteger)`

+ * May raise an NSRangeException

+ * *native declaration : :110* + */ + abstract fun insertTabViewItem_atIndex(tabViewItem: NSTabViewItem?, index: Int) + + /** + * Original signature : `void removeTabViewItem(NSTabViewItem*)`

+ * tabViewItem must be an existing tabViewItem

+ * *native declaration : :111* + */ + abstract fun removeTabViewItem(tabViewItem: NSTabViewItem?) + + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : :115* + */ + abstract fun setDelegate(anObject: ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :116* + */ + abstract fun delegate(): ID? + /** + * *native declaration : :120*

+ * Conversion Error : /// Original signature : `NSTabViewItem* tabViewItemAtPoint(null)`

+ * - (NSTabViewItem*)tabViewItemAtPoint:(null)point; // point in local coordinates. returns nil if none.

+ * (Argument point cannot be converted) + */ + /** + * Original signature : `contentRect()`

+ * Return the rect available for a "page".

+ * *native declaration : :124* + */ + abstract fun contentRect(): NSObject? + + /** + * Original signature : `NSInteger numberOfTabViewItems()`

+ * *native declaration : :128* + */ + abstract fun numberOfTabViewItems(): Int + + /** + * Original signature : `NSInteger indexOfTabViewItem(NSTabViewItem*)`

+ * NSNotFound if not found

+ * *native declaration : :129* + */ + abstract fun indexOfTabViewItem(tabViewItem: NSTabViewItem?): Int + + /** + * Original signature : `NSTabViewItem* tabViewItemAtIndex(NSInteger)`

+ * May raise an NSRangeException

+ * *native declaration : :130* + */ + abstract fun tabViewItemAtIndex(index: Int): NSTabViewItem? + + /** + * Original signature : `NSInteger indexOfTabViewItemWithIdentifier(id)`

+ * NSNotFound if not found

+ * *native declaration : :131* + */ + abstract fun indexOfTabViewItemWithIdentifier(identifier: String?): Int +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTabViewItem.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTabViewItem.kt new file mode 100644 index 00000000..2e8a9d05 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTabViewItem.kt @@ -0,0 +1,103 @@ +package darwin + +import org.rococoa.ObjCClass + +/// native declaration : :18 +abstract class NSTabViewItem : NSObject() { + interface _Class : ObjCClass { + open fun alloc(): NSTabViewItem + } + + /** + * Original signature : `id initWithIdentifier(id)`

+ * *native declaration : :52* + */ + abstract fun initWithIdentifier(identifier: String?): NSTabViewItem? + + /** + * Original signature : `id identifier()`

+ * *native declaration : :56* + */ + abstract fun identifier(): String? + + /** + * Original signature : `id view()`

+ * *native declaration : :57* + */ + abstract fun view(): NSView? + + /** + * Original signature : `id initialFirstResponder()`

+ * *native declaration : :58* + */ + abstract fun initialFirstResponder(): NSView? + + /** + * Original signature : `NSString* label()`

+ * *native declaration : :59* + */ + abstract fun label(): String? + + /** + * Original signature : `NSColor* color()`

+ * *native declaration : :60* + */ + abstract fun color(): NSColor? + + /** + * Original signature : `NSTabState tabState()`

+ * *native declaration : :61* + */ + abstract fun tabState(): Int + + /** + * Original signature : `NSTabView* tabView()`

+ * *native declaration : :62* + */ + abstract fun tabView(): NSTabView? + + /** + * Original signature : `void setIdentifier(id)`

+ * *native declaration : :66* + */ + abstract fun setIdentifier(identifier: String?) + + /** + * Original signature : `void setLabel(NSString*)`

+ * *native declaration : :67* + */ + abstract fun setLabel(label: String?) + + /** + * Original signature : `void setColor(NSColor*)`

+ * *native declaration : :68* + */ + abstract fun setColor(color: NSColor?) + + /** + * Original signature : `void setView(NSView*)`

+ * *native declaration : :69* + */ + abstract fun setView(view: NSView?) + + /** + * Original signature : `void setInitialFirstResponder(NSView*)`

+ * *native declaration : :70* + */ + abstract fun setInitialFirstResponder(view: NSView?) + /** + * *native declaration : :76*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :80*

+ * Conversion Error : NSSize + */ + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSTabViewItem", _Class::class.java) + + fun itemWithIdentifier(identifier: String?): NSTabViewItem? { + return CLASS.alloc().initWithIdentifier(identifier) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableCellView.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableCellView.kt new file mode 100644 index 00000000..5b0ac109 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableCellView.kt @@ -0,0 +1,9 @@ +package darwin + +abstract class NSTableCellView : NSView() { + abstract fun objectValue(): NSObject? + + abstract fun imageView(): NSImageView? + + abstract fun textField(): NSTextField? +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableColumn.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableColumn.kt new file mode 100644 index 00000000..cd4e1072 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableColumn.kt @@ -0,0 +1,190 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSInteger + +/// native declaration : :17 +abstract class NSTableColumn : NSObject() { + interface _Class : ObjCClass { + open fun alloc(): NSTableColumn + } + + /** + * Original signature : `id initWithIdentifier(id)`

+ * *native declaration : :40* + */ + abstract fun initWithIdentifier(identifier: String?): NSTableColumn? + + /** + * Original signature : `void setIdentifier(id)`

+ * *native declaration : :42* + */ + abstract fun setIdentifier(identifier: String?) + + /** + * Original signature : `id identifier()`

+ * *native declaration : :43* + */ + abstract fun identifier(): String? + + /** + * Original signature : `void setTableView(NSTableView*)`

+ * *native declaration : :44* + */ + abstract fun setTableView(tableView: NSTableView?) + + /** + * Original signature : `NSTableView* tableView()`

+ * *native declaration : :45* + */ + abstract fun tableView(): NSTableView? + + /** + * Original signature : `void setWidth(CGFloat)`

+ * *native declaration : :46* + */ + abstract fun setWidth(width: CGFloat?) + + fun setWidth(width: Double) { + this.setWidth(CGFloat(width)) + } + + /** + * Original signature : `CGFloat width()`

+ * *native declaration : :47* + */ + abstract fun width(): CGFloat? + + /** + * Original signature : `void setMinWidth(CGFloat)`

+ * *native declaration : :48* + */ + abstract fun setMinWidth(width: CGFloat?) + + fun setMinWidth(width: Double) { + this.setMinWidth(CGFloat(width)) + } + + /** + * Original signature : `CGFloat minWidth()`

+ * *native declaration : :49* + */ + abstract fun minWidth(): CGFloat? + + /** + * Original signature : `void setMaxWidth(CGFloat)`

+ * *native declaration : :50* + */ + abstract fun setMaxWidth(maxWidth: CGFloat?) + + fun setMaxWidth(width: Double) { + this.setMaxWidth(CGFloat(width)) + } + + /** + * Original signature : `CGFloat maxWidth()`

+ * *native declaration : :51* + */ + abstract fun maxWidth(): CGFloat? + + /** + * Original signature : `void setHeaderCell(NSCell*)`

+ * Manage the cell used to draw the header for this column

+ * *native declaration : :53* + */ + abstract fun setHeaderCell(cell: NSCell?) + + /** + * Original signature : `id headerCell()`

+ * *native declaration : :54* + */ + abstract fun headerCell(): NSCell? + + /** + * Manage the cell used to draw the actual values in the column. NSTableView will call -dataCellForRow:. By default, -dataCellForRow: just calls -dataCell. Subclassers can override -dataCellForRow: if they need to potentially use different cells for different rows. The returned cell should properly implement copyWithZone:, since NSTableView may make copies of the cells.

+ * Original signature : `void setDataCell(NSCell*)`

+ * *native declaration : :58* + */ + abstract fun setDataCell(cell: NSCell?) + + /** + * Original signature : `id dataCell()`

+ * *native declaration : :59* + */ + abstract fun dataCell(): NSCell? + + /** + * Original signature : `id dataCellForRow(NSInteger)`

+ * *native declaration : :60* + */ + abstract fun dataCellForRow(row: NSInteger?): NSCell? + + /** + * Original signature : `void setEditable(BOOL)`

+ * *native declaration : :62* + */ + abstract fun setEditable(flag: Boolean) + + /** + * Original signature : `BOOL isEditable()`

+ * *native declaration : :63* + */ + abstract fun isEditable(): Boolean + + /** + * Original signature : `void setHidden(BOOL)`

+ * *native declaration : :62* + */ + abstract fun setHidden(flag: Boolean) + + /** + * Original signature : `BOOL isHidden()`

+ * *native declaration : :63* + */ + abstract fun isHidden(): Boolean + + /** + * Original signature : `void sizeToFit()`

+ * *native declaration : :64* + */ + abstract fun sizeToFit() + + /** + * A column is considered sortable if it has a sortDescriptorPrototype. This prototype defines several things about the columns sorting. The prototype's ascending value defines the default sorting direction. Its key defines an arbitrary attribute which helps clients identify what to sort, while the selector defines how to sort. Note that, it is not required that the key be the same as the identifier. However, the key must be unique from the key used by other columns. The sortDescriptor is archived.

+ * Original signature : `void setSortDescriptorPrototype(NSSortDescriptor*)`

+ * *native declaration : :70* + */ + abstract fun setSortDescriptorPrototype(sortDescriptor: com.sun.jna.Pointer?) + + /** + * Original signature : `NSSortDescriptor* sortDescriptorPrototype()`

+ * *native declaration : :71* + */ + abstract fun sortDescriptorPrototype(): com.sun.jna.Pointer? + + /** + * The resizing mask controls the resizability of a table column. Compatability Note: This method replaces setResizable.

+ * Original signature : `void setResizingMask(NSUInteger)`

+ * *native declaration : :78* + */ + abstract fun setResizingMask(resizingMask: Int) + + /** + * Original signature : `NSUInteger resizingMask()`

+ * *native declaration : :79* + */ + abstract fun resizingMask(): Int + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSTableColumn", _Class::class.java) + + const val NSTableColumnNoResizing: Int = 0 // Disallow any kind of resizing. + const val NSTableColumnAutoresizingMask: Int = (1 shl 0) // This column can be resized as the table is resized. + const val NSTableColumnUserResizingMask: Int = (1 shl 1) // The user can resize this column manually. + + fun tableColumnWithIdentifier(identifier: String?): NSTableColumn? { + return CLASS.alloc().initWithIdentifier(identifier) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableRowView.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableRowView.kt new file mode 100644 index 00000000..ba5cef28 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableRowView.kt @@ -0,0 +1,3 @@ +package darwin + +abstract class NSTableRowView : NSView() diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableView.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableView.kt new file mode 100644 index 00000000..6b008ee4 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTableView.kt @@ -0,0 +1,856 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSPoint +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :69 +abstract class NSTableView : NSControl() { + interface DataSource { + open fun numberOfRowsInTableView(view: NSTableView?): NSInteger? + + open fun tableView_objectValueForTableColumn_row( + view: NSTableView?, + tableColumn: NSTableColumn?, + row: NSInteger? + ): NSObject? + + open fun tableView_setObjectValue_forTableColumn_row( + view: NSTableView?, + value: NSObject?, + tableColumn: NSTableColumn?, + row: NSInteger? + ) + + open fun tableView_writeRowsWithIndexes_toPasteboard( + view: NSTableView?, + rowIndexes: NSIndexSet?, + pboard: NSPasteboard? + ): Boolean + + open fun tableView_validateDrop_proposedRow_proposedDropOperation( + view: NSTableView?, + info: NSDraggingInfo?, + row: NSInteger?, + operation: NSUInteger? + ): NSUInteger? + + open fun tableView_acceptDrop_row_dropOperation( + view: NSTableView?, + draggingInfo: NSDraggingInfo?, + row: NSInteger?, + operation: NSUInteger? + ): Boolean + + open fun tableView_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes( + view: NSTableView?, + dropDestination: NSURL?, + rowIndexes: NSIndexSet? + ): NSArray? + } + + interface Delegate { + open fun tableView_willDisplayCell_forTableColumn_row( + view: NSTableView?, + cell: NSTextFieldCell?, + tableColumn: NSTableColumn?, + row: NSInteger? + ) + } + + /** + * Original signature : `void addTableColumn(NSTableColumn*)`

+ * *native declaration : :98* + */ + abstract fun addTableColumn(column: NSTableColumn?) + + /** + * Original signature : `void setDataSource(id)`

+ * *native declaration : :100* + */ + abstract fun setDataSource(aSource: ID?) + + /** + * Original signature : `id dataSource()`

+ * *native declaration : :101* + */ + abstract fun dataSource(): NSObject? + + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : :102* + */ + abstract fun setDelegate(delegate: ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :103* + */ + abstract fun delegate(): ID? + + /** + * Original signature : `void setHeaderView(NSTableHeaderView*)`

+ * *native declaration : :104* + */ + abstract fun setHeaderView(headerView: NSView?) + + /** + * Original signature : `NSTableHeaderView* headerView()`

+ * *native declaration : :105* + */ + abstract fun headerView(): NSView? + + /** + * Original signature : `void setCornerView(NSView*)`

+ * *native declaration : :107* + */ + abstract fun setCornerView(cornerView: NSView?) + + /** + * Original signature : `NSView* cornerView()`

+ * *native declaration : :108* + */ + abstract fun cornerView(): NSView? + + /** + * Original signature : `void setAllowsColumnReordering(BOOL)`

+ * *native declaration : :110* + */ + abstract fun setAllowsColumnReordering(flag: Boolean) + + /** + * Original signature : `BOOL allowsColumnReordering()`

+ * *native declaration : :111* + */ + abstract fun allowsColumnReordering(): Boolean + + /** + * Controls whether the user can attemp to resize columns by dragging between headers. If flag is YES the user can + * resize columns; if flag is NO the user can't. The default is YES. Columns can only be resized if a column allows + * user resizing. See NSTableColumn setResizingMask: for more details. You can always change columns + * programmatically regardless of this setting.

Original signature : `void + * setAllowsColumnResizing(BOOL)`

+ * *native declaration : :115* + */ + abstract fun setAllowsColumnResizing(flag: Boolean) + + /** + * Original signature : `BOOL allowsColumnResizing()`

+ * *native declaration : :116* + */ + abstract fun allowsColumnResizing(): Boolean + + /** + * *native declaration : :120*

+ * Conversion Error : /// Original signature : `void setColumnAutoresizingStyle(null)`

- + * (void)setColumnAutoresizingStyle:(null)style; (Argument style cannot be converted) + */ + abstract fun setColumnAutoresizingStyle(style: NSUInteger?) + + /** + * Original signature : `columnAutoresizingStyle()`

+ * *native declaration : :121* + */ + abstract fun columnAutoresizingStyle(): NSUInteger? + + /** + * Original signature : `void setGridStyleMask(NSUInteger)`

+ * *native declaration : :125* + */ + abstract fun setGridStyleMask(gridType: NSUInteger?) + + /** + * Original signature : `NSUInteger gridStyleMask()`

+ * *native declaration : :126* + */ + abstract fun gridStyleMask(): NSUInteger? + /** + * *native declaration : :128*

+ * Conversion Error : NSSize + */ + /** + * *native declaration : :129*

+ * Conversion Error : NSSize + */ + /** + * Configures the table to use either the standard alternating row colors, or a solid color for its background.

+ * Original signature : `void setUsesAlternatingRowBackgroundColors(BOOL)`

+ * *native declaration : :133* + */ + abstract fun setUsesAlternatingRowBackgroundColors(useAlternatingRowColors: Boolean) + + /** + * Original signature : `BOOL usesAlternatingRowBackgroundColors()`

+ * *native declaration : :134* + */ + abstract fun usesAlternatingRowBackgroundColors(): Boolean + + /** + * The backgroundColor defaults to [NSColor controlBackgroundColor]. On Mac OS 10.5 and higher, the alpha portion of + * 'color' is properly used when drawing the backgroundColor. To have a transparent tableView, set the + * backgroundColor to [NSColor clearColor], and set the enclosing NSScrollView to not draw its background with: + * [[tableView enclosingScrollView] setDrawsBackground:NO]. NSTableView uses NSCompositeSourceOver when drawing the + * background color.

Original signature : `void setBackgroundColor(NSColor*)`

+ * *native declaration : :138* + */ + abstract fun setBackgroundColor(color: NSColor?) + + /** + * Original signature : `NSColor* backgroundColor()`

+ * *native declaration : :139* + */ + abstract fun backgroundColor(): NSColor? + + /** + * Original signature : `void setGridColor(NSColor*)`

+ * *native declaration : :141* + */ + abstract fun setGridColor(color: NSColor?) + + /** + * Original signature : `NSColor* gridColor()`

+ * *native declaration : :142* + */ + abstract fun gridColor(): NSColor? + + /** + * Original signature : `void setRowHeight(CGFloat)`

+ * *native declaration : :144* + */ + abstract fun setRowHeight(rowHeight: CGFloat?) + + /** + * Original signature : `CGFloat rowHeight()`

+ * *native declaration : :145* + */ + abstract fun rowHeight(): CGFloat? + + /** + * If the delegate implements -tableView:heightOfRow:, this method immediately re-tiles the table view using row + * heights it provides.

Original signature : `void noteHeightOfRowsWithIndexesChanged(NSIndexSet*)`

+ * *native declaration : :149* + */ + abstract fun noteHeightOfRowsWithIndexesChanged(indexSet: NSIndexSet?) + + /** + * Original signature : `NSArray* tableColumns()`

+ * *native declaration : :151* + */ + abstract fun tableColumns(): NSArray? + + /** + * Original signature : `NSInteger numberOfColumns()`

+ * *native declaration : :152* + */ + abstract fun numberOfColumns(): NSInteger? + + /** + * Original signature : `NSInteger numberOfRows()`

+ * *native declaration : :153* + */ + abstract fun numberOfRows(): NSInteger? + + /** + * Original signature : `void removeTableColumn(NSTableColumn*)`

+ * *native declaration : :156* + */ + abstract fun removeTableColumn(column: NSTableColumn?) + + /** + * Original signature : `NSInteger columnWithIdentifier(id)`

+ * *native declaration : :157* + */ + abstract fun columnWithIdentifier(identifier: String?): NSInteger? + + /** + * Original signature : `NSTableColumn* tableColumnWithIdentifier(id)`

+ * *native declaration : :158* + */ + abstract fun tableColumnWithIdentifier(identifier: String?): NSTableColumn? + + /** + * Original signature : `void tile()`

+ * *native declaration : :160* + */ + abstract fun tile() + + /** + * Original signature : `void sizeLastColumnToFit()`

+ * *native declaration : :162* + */ + abstract fun sizeLastColumnToFit() + + /** + * Original signature : `void scrollRowToVisible(NSInteger)`

+ * *native declaration : :163* + */ + abstract fun scrollRowToVisible(row: NSInteger?) + + /** + * Original signature : `void scrollColumnToVisible(NSInteger)`

+ * *native declaration : :164* + */ + abstract fun scrollColumnToVisible(column: NSInteger?) + + /** + * Original signature : `void moveColumn(NSInteger, NSInteger)`

+ * *native declaration : :165* + */ + abstract fun moveColumn_toColumn(column: NSInteger?, newIndex: NSInteger?) + + /** + * Original signature : `void reloadData()`

+ * *native declaration : :167* + */ + abstract fun reloadData() + + /** + * Original signature : `- (void)reloadDataForRowIndexes:(NSIndexSet *)rowIndexes columnIndexes:(NSIndexSet + * *)columnIndexes`

+ * *native declaration : :167* + */ + abstract fun reloadDataForRowIndexes_columnIndexes(rowIndexes: NSIndexSet?, columnIndexes: NSIndexSet?) + + /** + * Typically, identifier is associated with a cell view that’s contained in a table’s Nib file. When this method is + * called, the table view automatically instantiates the cell view with the specified owner, which is usually the + * table view’s delegate. (The owner is useful in setting up outlets and target/actions from the view.) Note that a + * cell view’s identifier must be the same as its table column’s identifier for bindings to work. If you’re using + * bindings, it’s recommended that you use the Automatic identifier setting in Interface Builder. + * + * @param identifier The view identifier. Must not be nil. + * @param owner The owner of the NIB that may be loaded and instantiated to create a new view with the + * specified identifier. + * @return A view for the row. + */ + abstract fun makeViewWithIdentifier_owner(identifier: String?, owner: ID?): NSTableCellView? + + /** + * Original signature : `void noteNumberOfRowsChanged()`

+ * *native declaration : :168* + */ + abstract fun noteNumberOfRowsChanged() + + /** + * Original signature : `NSInteger editedColumn()`

+ * *native declaration : :170* + */ + abstract fun editedColumn(): NSInteger? + + /** + * Original signature : `NSInteger editedRow()`

+ * *native declaration : :171* + */ + abstract fun editedRow(): NSInteger? + + /** + * Original signature : `NSInteger clickedColumn()`

+ * *native declaration : :172* + */ + abstract fun clickedColumn(): NSInteger? + + /** + * Original signature : `NSInteger clickedRow()`

+ * *native declaration : :173* + */ + abstract fun clickedRow(): NSInteger? + + /** + * Original signature : `void setDoubleAction(SEL)`

+ * *native declaration : :175* + */ + abstract fun setDoubleAction(aSelector: org.rococoa.Selector?) + + /** + * Original signature : `SEL doubleAction()`

+ * *native declaration : :176* + */ + abstract fun doubleAction(): org.rococoa.Selector? + + /** + * Sorting Support

The array of sort descriptors is archived. Sort descriptors will persist along with other + * column information if an autosave name is set.

Original signature : `void + * setSortDescriptors(NSArray*)`

+ * *native declaration : :182* + */ + abstract fun setSortDescriptors(array: NSArray?) + + /** + * Original signature : `NSArray* sortDescriptors()`

+ * *native declaration : :183* + */ + abstract fun sortDescriptors(): NSArray? + + /** + * Support for little "indicator" images in table header cells.

Original signature : `void + * setIndicatorImage(NSImage*, NSTableColumn*)`

+ * *native declaration : :187* + */ + abstract fun setIndicatorImage_inTableColumn(anImage: NSImage?, tc: NSTableColumn?) + + /** + * Original signature : `NSImage* indicatorImageInTableColumn(NSTableColumn*)`

+ * *native declaration : :188* + */ + abstract fun indicatorImageInTableColumn(tc: NSTableColumn?): NSImage? + + /** + * Support for highlightable column header, for use with row selection.

Original signature : `void + * setHighlightedTableColumn(NSTableColumn*)`

+ * *native declaration : :192* + */ + abstract fun setHighlightedTableColumn(tc: NSTableColumn?) + + /** + * Original signature : `NSTableColumn* highlightedTableColumn()`

+ * *native declaration : :193* + */ + abstract fun highlightedTableColumn(): NSTableColumn? + + /** + * Original signature : `void setVerticalMotionCanBeginDrag(BOOL)`

+ * *native declaration : :199* + */ + abstract fun setVerticalMotionCanBeginDrag(flag: Boolean) + + /** + * Original signature : `BOOL verticalMotionCanBeginDrag()`

+ * *native declaration : :200* + */ + abstract fun verticalMotionCanBeginDrag(): Boolean + /** + * *native declaration : :206*

+ * Conversion Error : / **

+ * * The return value indicates whether the receiver can attempt to initiate a row drag at 'mouseDownPoint'. Return NO to disallow initiating drags at the given location.

+ * * For applications linked on and after Leopard, NSCell hit testing will determine if a row can be dragged or not. Custom cells should properly implement [NSCell(NSCellHitTest) hitTestForEvent:inRect:ofView]; see NSCell.h for more information. NSTableView will not begin a drag if cell returns NSCellHitTrackableArea.

+ * * Original signature : `BOOL canDragRowsWithIndexes(NSIndexSet*, null)`

+ * * /

+ * - (BOOL)canDragRowsWithIndexes:(NSIndexSet*)rowIndexes atPoint:(null)mouseDownPoint; (Argument mouseDownPoint cannot be converted) + */ + /** + * *native declaration : :212*

+ * Conversion Error : / **

+ * * This method computes and returns an image to use for dragging. Override this to return a custom image. 'dragRows' represents the rows participating in the drag. 'tableColumns' represent the columns that should be in the output image. Note that drawing may be clipped to the visible rows, and columns. 'dragEvent' is a reference to the mouse down event that began the drag. 'dragImageOffset' is an in/out parameter. This method will be called with dragImageOffset set to NSZeroPoint, but it can be modified to re-position the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the mouse.

+ * * Compatability Note: This method replaces dragImageForRows:event:dragImageOffset:. If present, this is used instead of the deprecated method.

+ * * Original signature : `NSImage* dragImageForRowsWithIndexes(NSIndexSet*, NSArray*, NSEvent*, null)`

+ * * /

+ * - (NSImage*)dragImageForRowsWithIndexes:(NSIndexSet*)dragRows tableColumns:(NSArray*)tableColumns event:(NSEvent*)dragEvent offset:(null)dragImageOffset; (Argument dragImageOffset cannot be converted) + */ + /** + * *native declaration : :216*

+ * Conversion Error : / **

+ * * Configures the default value returned from -draggingSourceOperationMaskForLocal:. An isLocal value of YES indicates that 'mask' applies when the destination object is in the same application. A isLocal value of NO indicates that 'mask' applies when the destination object in an application outside the receiver's application. NSTableView will archive the values you set for each isLocal setting.

+ * * Original signature : `void setDraggingSourceOperationMask(null, BOOL)`

+ * * /

+ * - (void)setDraggingSourceOperationMask:(null)mask forLocal:(BOOL)isLocal; (Argument mask cannot be converted) + */ + /** + * To be used from validateDrop: if you wish to "re-target" the proposed drop. To specify a drop on the second row, + * one would specify row=2, and op=NSTableViewDropOn. To specify a drop below the last row, one would specify + * row=[tv numberOfRows], and op=NSTableViewDropAbove. To specify a drop on the entire tableview, one would specify + * row=-1 and op=NSTableViewDropOn.

Original signature : `void setDropRow(NSInteger, + * NSTableViewDropOperation)`

+ * *native declaration : :220* + */ + abstract fun setDropRow_dropOperation(row: NSInteger?, op: NSUInteger?) + + /** + * @param row + * @param op operation + */ + fun setDropRow(row: NSInteger?, op: NSUInteger?) { + this.setDropRow_dropOperation(row, op) + } + + /** + * Selection

Original signature : `void setAllowsMultipleSelection(BOOL)`

+ * *native declaration : :226* + */ + abstract fun setAllowsMultipleSelection(flag: Boolean) + + /** + * Original signature : `BOOL allowsMultipleSelection()`

+ * *native declaration : :227* + */ + abstract fun allowsMultipleSelection(): Boolean + + /** + * Original signature : `void setAllowsEmptySelection(BOOL)`

+ * *native declaration : :228* + */ + abstract fun setAllowsEmptySelection(flag: Boolean) + + /** + * Original signature : `BOOL allowsEmptySelection()`

+ * *native declaration : :229* + */ + abstract fun allowsEmptySelection(): Boolean + + /** + * Original signature : `void setAllowsColumnSelection(BOOL)`

+ * *native declaration : :230* + */ + abstract fun setAllowsColumnSelection(flag: Boolean) + + /** + * Original signature : `BOOL allowsColumnSelection()`

+ * *native declaration : :231* + */ + abstract fun allowsColumnSelection(): Boolean + + /** + * Original signature : `void deselectAll(id)`

+ * *native declaration : :233* + */ + abstract fun deselectAll(sender: ID?) + + /** + * Sets the column selection using the indexes. Selection is set/extended based on the extend flag.

+ * Compatability Note: This method replaces selectColumn:byExtendingSelection:

If a subclasser implements only + * the deprecated single-index method (selectColumn:byExtendingSelection:), the single-index method will be invoked + * for each index. If a subclasser implements the multi-index method (selectColumnIndexes:byExtendingSelection:), + * the deprecated single-index version method will not be used. This allows subclassers already overriding the + * single-index method to still receive a selection message. Note: to avoid cycles, subclassers of this method and + * single-index method should not call each other.

Original signature : `void + * selectColumnIndexes(NSIndexSet*, BOOL)`

+ * *native declaration : :241* + */ + abstract fun selectColumnIndexes_byExtendingSelection(indexes: NSIndexSet?, extend: Boolean) + + /** + * Sets the row selection using 'indexes'. Selection is set/extended based on the extend flag. On 10.5 and greater, + * selectRowIndexes:byExtendingSelection: will allow you to progrmatically select more than one index, regardless of + * the allowsMultipleSelection and allowsEmptySelection options set on the table.

Compatability Note: This + * method replaces selectRow:byExtendingSelection:

If a subclasser implements only the deprecated single-index + * method (selectRow:byExtendingSelection:), the single-index method will be invoked for each index. If a + * subclasser implements the multi-index method (selectRowIndexes:byExtendingSelection:), the deprecated + * single-index version method will not be used. This allows subclassers already overriding the single-index method + * to still receive a selection message. Note: to avoid cycles, subclassers of this method and single-index method + * should not call each other.

Original signature : `void selectRowIndexes(NSIndexSet*, BOOL)`

+ * *native declaration : :248* + */ + abstract fun selectRowIndexes_byExtendingSelection(indexes: NSIndexSet?, extend: Boolean) + + fun selectRowIndexes(indexes: NSIndexSet?, extend: Boolean) { + this.selectRowIndexes_byExtendingSelection(indexes, extend) + } + + /** + * Original signature : `NSIndexSet* selectedColumnIndexes()`

+ * *native declaration : :250* + */ + abstract fun selectedColumnIndexes(): NSIndexSet? + + /** + * Original signature : `NSIndexSet* selectedRowIndexes()`

+ * *native declaration : :251* + */ + abstract fun selectedRowIndexes(): NSIndexSet? + + /** + * Original signature : `void deselectColumn(NSInteger)`

+ * *native declaration : :254* + */ + abstract fun deselectColumn(column: NSInteger?) + + /** + * Original signature : `void deselectRow(NSInteger)`

+ * *native declaration : :255* + */ + abstract fun deselectRow(row: NSInteger?) + + /** + * Original signature : `NSInteger selectedColumn()`

+ * *native declaration : :256* + */ + abstract fun selectedColumn(): NSInteger? + + /** + * Original signature : `NSInteger selectedRow()`

+ * *native declaration : :257* + */ + abstract fun selectedRow(): NSInteger? + + /** + * Original signature : `BOOL isColumnSelected(NSInteger)`

+ * *native declaration : :258* + */ + abstract fun isColumnSelected(column: NSInteger?): Boolean + + /** + * Original signature : `BOOL isRowSelected(NSInteger)`

+ * *native declaration : :259* + */ + abstract fun isRowSelected(row: NSInteger?): Boolean + + /** + * Original signature : `NSInteger numberOfSelectedColumns()`

+ * *native declaration : :260* + */ + abstract fun numberOfSelectedColumns(): NSInteger? + + /** + * Original signature : `NSInteger numberOfSelectedRows()`

+ * *native declaration : :261* + */ + abstract fun numberOfSelectedRows(): NSInteger? + + /** + * Original signature : `BOOL allowsTypeSelect()`

+ * *native declaration : :269* + */ + abstract fun allowsTypeSelect(): Boolean + + /** + * Original signature : `void setAllowsTypeSelect(BOOL)`

+ * *native declaration : :270* + */ + abstract fun setAllowsTypeSelect(value: Boolean) + + /** + * Gets and sets the current selection highlight style. Defaults to NSTableViewSelectionHighlightStyleRegular.

+ * Original signature : `selectionHighlightStyle()`

+ * *native declaration : :288* + */ + abstract fun selectionHighlightStyle(): NSObject? + + /** + * *native declaration : :289*

+ * Conversion Error : /// Original signature : `void setSelectionHighlightStyle(null)`

- + * (void)setSelectionHighlightStyle:(null)selectionHighlightStyle; (Argument selectionHighlightStyle cannot be + * converted) + */ + abstract fun setSelectionHighlightStyle(selectionHighlightStyle: NSInteger?) + /** + * *native declaration : :295*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :297*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :302*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :305*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :307*

+ * Conversion Error : /// Original signature : `NSInteger columnAtPoint(null)`

- + * (NSInteger)columnAtPoint:(null)point; (Argument point cannot be converted) + */ + abstract fun columnAtPoint(point: NSPoint?): NSInteger? + + /** + * *native declaration : :309*

+ * Conversion Error : /// Original signature : `NSInteger rowAtPoint(null)`

- + * (NSInteger)rowAtPoint:(null)point; (Argument point cannot be converted) + */ + abstract fun rowAtPoint(point: NSPoint?): NSInteger? + /** + * *native declaration : :313*

+ * Conversion Error : NSRect + */ + /** + * Returns the fully prepared cell that the view will normally use for drawing or any processing. The value for the + * cell will be correctly set, and the delegate method 'willDisplayCell:' will have be called. You can override this + * method to do any additional setting up of the cell that is required, or call it to retrieve a cell that will have + * its contents properly set for the particular column and row.

Original signature : `NSCell* + * preparedCellAtColumn(NSInteger, NSInteger)`

+ * *native declaration : :319* + */ + abstract fun preparedCellAtColumn_row(column: NSInteger?, row: NSInteger?): NSCell? + + /** + * Text delegate methods

Original signature : `BOOL textShouldBeginEditing(NSText*)`

+ * *native declaration : :326* + */ + abstract fun textShouldBeginEditing(textObject: NSText?): Boolean + + /** + * Original signature : `BOOL textShouldEndEditing(NSText*)`

+ * *native declaration : :327* + */ + abstract fun textShouldEndEditing(textObject: NSText?): Boolean + + /** + * Original signature : `void textDidBeginEditing(NSNotification*)`

+ * *native declaration : :328* + */ + abstract fun textDidBeginEditing(notification: NSNotification?) + + /** + * Original signature : `void textDidEndEditing(NSNotification*)`

+ * *native declaration : :329* + */ + abstract fun textDidEndEditing(notification: NSNotification?) + + /** + * Original signature : `void textDidChange(NSNotification*)`

+ * *native declaration : :330* + */ + abstract fun textDidChange(notification: NSNotification?) + + /** + * Persistence methods

Original signature : `void setAutosaveName(NSString*)`

+ * *native declaration : :335* + */ + abstract fun setAutosaveName(name: String?) + + /** + * Original signature : `NSString* autosaveName()`

+ * *native declaration : :336* + */ + abstract fun autosaveName(): String? + + /** + * On Mac OS 10.4 and higher, the NSTableColumn width and location is saved. On Mac OS 10.5 and higher, the + * NSTableColumn 'isHidden' state is also saved. The 'autosaveName' must be set for 'autosaveTableColumns' to take + * effect.

Original signature : `void setAutosaveTableColumns(BOOL)`

+ * *native declaration : :340* + */ + abstract fun setAutosaveTableColumns(save: Boolean) + + /** + * Original signature : `BOOL autosaveTableColumns()`

+ * *native declaration : :341* + */ + abstract fun autosaveTableColumns(): Boolean + + /** + * For subclassers

Original signature : `void editColumn(NSInteger, NSInteger, NSEvent*, BOOL)`

+ * *native declaration : :346* + */ + abstract fun editColumn_row_withEvent_select( + column: NSInteger?, + row: NSInteger?, + theEvent: NSEvent?, + select: Boolean + ) + + fun editRow(column: NSInteger?, row: NSInteger?, select: Boolean) { + this.editColumn_row_withEvent_select(column, row, NSApplication.sharedApplication().currentEvent(), select) + } + + /** + * *native declaration : :347*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :348*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :349*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :351*

+ * Conversion Error : NSRect + */ + /** + * Deprecated in Mac OS 10.3. Calls setGridStyleMask:, setting grid style to either None, or vertical and horizonal + * solid grid lines as appropriate.

Original signature : `void setDrawsGrid(BOOL)`

+ * *from NSDeprecated native declaration : :506* + */ + abstract fun setDrawsGrid(flag: Boolean) + + /** + * Deprecated in Mac OS 10.3. Returns YES if gridStyleMask returns anything other than NSTableViewGridNone.

+ * Original signature : `BOOL drawsGrid()`

+ * *from NSDeprecated native declaration : :508* + */ + abstract fun drawsGrid(): Boolean + + /** + * Deprecated in Mac OS 10.3. You should use selectColumnIndexes:byExtendingSelection: instead. See that method + * for more details.

Original signature : `void selectColumn(NSInteger, BOOL)`

+ * *from NSDeprecated native declaration : :511* + */ + abstract fun selectColumn_byExtendingSelection(column: NSInteger?, extend: Boolean) + + /** + * Deprecated in Mac OS 10.3. You should use selectedColumnIndexes instead.

Original signature : + * `NSEnumerator* selectedColumnEnumerator()`

+ * *from NSDeprecated native declaration : :515* + */ + abstract fun selectedColumnEnumerator(): NSEnumerator? + + /** + * Deprecated in Mac OS 10.3. You should use selectedRowIndexes instead.

Original signature : + * `NSEnumerator* selectedRowEnumerator()`

+ * *from NSDeprecated native declaration : :517* + */ + abstract fun selectedRowEnumerator(): NSEnumerator? + /** + * *from NSDeprecated native declaration : :520*

+ * Conversion Error : / **

+ * * Deprecated in Mac OS 10.4. You should use / override dragImageForRowsWithIndexes:tableColumns:event:dragImageOffset: instead.

+ * * Original signature : `NSImage* dragImageForRows(NSArray*, NSEvent*, null)`

+ * * /

+ * - (NSImage*)dragImageForRows:(NSArray*)dragRows event:(NSEvent*)dragEvent dragImageOffset:(null)dragImageOffset; (Argument dragImageOffset cannot be converted) + */ + /** + * Deprecated in Mac OS 10.4. You should use setColumnAutoresizingStyle: instead. To preserve compatibility, if + * flag is YES, This method calls setColumnAutoresizingStyle:NSTableViewUniformColumnAutoresizingStyle. If flag is + * NO, this method calls setColumnAutoresizingStyle:NSTableViewLastColumnOnlyAutoresizingStyle.

Original + * signature : `void setAutoresizesAllColumnsToFit(BOOL)`

+ * *from NSDeprecated native declaration : :523* + */ + abstract fun setAutoresizesAllColumnsToFit(flag: Boolean) + + /** + * Original signature : `BOOL autoresizesAllColumnsToFit()`

+ * *from NSDeprecated native declaration : :524* + */ + abstract fun autoresizesAllColumnsToFit(): Boolean + + /** + * *from NSDeprecated native declaration : :528*

+ * Conversion Error : NSRect + */ + companion object { + /// native declaration : :60 + val NSTableViewDropOn: NSUInteger? = NSUInteger(0) + + /// native declaration : :60 + val NSTableViewDropAbove: NSUInteger? = NSUInteger(1) + + val NSTableViewSelectionDidChangeNotification: String? = "NSTableViewSelectionDidChangeNotification" + val NSTableViewColumnDidMoveNotification: String? = "NSTableViewColumnDidMoveNotification" + val NSTableViewColumnDidResizeNotification: String? = "NSTableViewColumnDidResizeNotification" + val NSTableViewSelectionIsChangingNotification: String? = "NSTableViewSelectionIsChangingNotification" + + val NSTableViewGridNone: NSUInteger? = NSUInteger(0) + val NSTableViewSolidVerticalGridLineMask: NSUInteger? = NSUInteger(1) + val NSTableViewSolidHorizontalGridLineMask: NSUInteger? = NSUInteger(2) + + val NSTableViewNoColumnAutoresizing: NSUInteger? = NSUInteger(0) + val NSTableViewUniformColumnAutoresizingStyle: NSUInteger? = NSUInteger(1) + val NSTableViewSequentialColumnAutoresizingStyle: NSUInteger? = NSUInteger(2) + val NSTableViewReverseSequentialColumnAutoresizingStyle: NSUInteger? = NSUInteger(3) + val NSTableViewLastColumnOnlyAutoresizingStyle: NSUInteger? = NSUInteger(4) + val NSTableViewFirstColumnOnlyAutoresizingStyle: NSUInteger? = NSUInteger(5) + + /** + * The regular highlight style of NSTableView. On 10.5, a light blue ([NSColor alternateSelectedControlColor]) or + * light gray color ([NSColor secondarySelectedControlColor]) is used to highlight selected rows. + */ + val NSTableViewSelectionHighlightStyleRegular: NSInteger? = NSInteger(0) + + /** + * The source list style of NSTableView. On 10.5, a light blue gradient is used to highlight selected rows. Note: + * Cells that have a drawsBackground property should have it set to NO. Otherwise, they will draw over the + * highlighting that NSTableView does. Setting this style will have the side effect of setting the background color + * to the "source list" background color. Additionally in NSOutlineView, the following properties are changed to get + * the standard "source list" look: indentationPerLevel, rowHeight and intercellSpacing. After calling + * setSelectionHighlightStyle: one can change any of the other properties as required. + */ + val NSTableViewSelectionHighlightStyleSourceList: NSInteger? = NSInteger(1) + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSText.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSText.kt new file mode 100644 index 00000000..7fe58770 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSText.kt @@ -0,0 +1,536 @@ +package darwin + + +import org.rococoa.ID +import org.rococoa.cocoa.foundation.NSSize + +// BridgeSupport v 0.017 +abstract class NSText : NSView() { + /** + * Original signature : `NSString* string()`

+ * *native declaration : /Users/dkocher/null:70* + */ + abstract fun string(): String? + + /** + * Original signature : `void setString(NSString*)`

+ * *native declaration : /Users/dkocher/null:71* + */ + abstract fun setString(string: String?) + /** + * *native declaration : /Users/dkocher/null:73*

+ * Conversion Error : /// Original signature : `void replaceCharactersInRange(null, NSString*)`

+ * - (void)replaceCharactersInRange:(null)range withString:(NSString*)aString; (Argument range cannot be converted) + */ + /** + * *native declaration : /Users/dkocher/null:74*

+ * Conversion Error : /// Original signature : `void replaceCharactersInRange(null, NSData*)`

+ * - (void)replaceCharactersInRange:(null)range withRTF:(NSData*)rtfData; (Argument range cannot be converted) + */ + /** + * *native declaration : /Users/dkocher/null:75*

+ * Conversion Error : /// Original signature : `void replaceCharactersInRange(null, NSData*)`

+ * - (void)replaceCharactersInRange:(null)range withRTFD:(NSData*)rtfdData; (Argument range cannot be converted) + */ + /** + * *native declaration : /Users/dkocher/null:77*

+ * Conversion Error : /// Original signature : `NSData* RTFFromRange(null)`

+ * - (NSData*)RTFFromRange:(null)range; (Argument range cannot be converted) + */ + /** + * *native declaration : /Users/dkocher/null:78*

+ * Conversion Error : /// Original signature : `NSData* RTFDFromRange(null)`

+ * - (NSData*)RTFDFromRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `BOOL writeRTFDToFile(NSString*, BOOL)`

+ * *native declaration : /Users/dkocher/null:80* + */ + abstract fun writeRTFDToFile_atomically(path: String?, flag: Boolean): Boolean + + /** + * Original signature : `BOOL readRTFDFromFile(NSString*)`

+ * *native declaration : /Users/dkocher/null:81* + */ + abstract fun readRTFDFromFile(path: String?): Boolean + + /** + * Original signature : `id delegate()`

+ * *native declaration : /Users/dkocher/null:83* + */ + abstract fun delegate(): ID? + + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : /Users/dkocher/null:84* + */ + abstract fun setDelegate(anObject: ID?) + + /** + * Original signature : `BOOL isEditable()`

+ * *native declaration : /Users/dkocher/null:86* + */ + abstract fun isEditable(): Boolean + + /** + * Original signature : `void setEditable(BOOL)`

+ * *native declaration : /Users/dkocher/null:87* + */ + abstract fun setEditable(flag: Boolean) + + /** + * Original signature : `BOOL isSelectable()`

+ * *native declaration : /Users/dkocher/null:88* + */ + abstract fun isSelectable(): Boolean + + /** + * Original signature : `void setSelectable(BOOL)`

+ * *native declaration : /Users/dkocher/null:89* + */ + abstract fun setSelectable(flag: Boolean) + + /** + * Original signature : `BOOL isRichText()`

+ * *native declaration : /Users/dkocher/null:90* + */ + abstract fun isRichText(): Boolean + + /** + * Original signature : `void setRichText(BOOL)`

+ * If NO, also clears setImportsGraphics:

+ * *native declaration : /Users/dkocher/null:91* + */ + abstract fun setRichText(flag: Boolean) + + /** + * Original signature : `BOOL importsGraphics()`

+ * *native declaration : /Users/dkocher/null:92* + */ + abstract fun importsGraphics(): Boolean + + /** + * Original signature : `void setImportsGraphics(BOOL)`

+ * If YES, also sets setRichText:

+ * *native declaration : /Users/dkocher/null:93* + */ + abstract fun setImportsGraphics(flag: Boolean) + + /** + * Original signature : `BOOL isFieldEditor()`

+ * *native declaration : /Users/dkocher/null:94* + */ + abstract fun isFieldEditor(): Boolean + + /** + * Original signature : `void setFieldEditor(BOOL)`

+ * Indicates whether to end editing on CR, TAB, etc.

+ * *native declaration : /Users/dkocher/null:95* + */ + abstract fun setFieldEditor(flag: Boolean) + + /** + * Original signature : `BOOL usesFontPanel()`

+ * *native declaration : /Users/dkocher/null:96* + */ + abstract fun usesFontPanel(): Boolean + + /** + * Original signature : `void setUsesFontPanel(BOOL)`

+ * *native declaration : /Users/dkocher/null:97* + */ + abstract fun setUsesFontPanel(flag: Boolean) + + /** + * Original signature : `BOOL drawsBackground()`

+ * *native declaration : /Users/dkocher/null:98* + */ + abstract fun drawsBackground(): Boolean + + /** + * Original signature : `void setDrawsBackground(BOOL)`

+ * *native declaration : /Users/dkocher/null:99* + */ + abstract fun setDrawsBackground(flag: Boolean) + + /** + * Original signature : `NSColor* backgroundColor()`

+ * *native declaration : /Users/dkocher/null:100* + */ + abstract fun backgroundColor(): NSColor? + + /** + * Original signature : `void setBackgroundColor(NSColor*)`

+ * *native declaration : /Users/dkocher/null:101* + */ + abstract fun setBackgroundColor(color: NSColor?) + + /** + * Original signature : `BOOL isRulerVisible()`

+ * *native declaration : /Users/dkocher/null:103* + */ + abstract fun isRulerVisible(): Boolean + + /** + * Original signature : `selectedRange()`

+ * *native declaration : /Users/dkocher/null:105* + */ + abstract fun selectedRange(): NSRange? + + /** + * *native declaration : /Users/dkocher/null:106*

+ * Conversion Error : /// Original signature : `void setSelectedRange(null)`

- + * (void)setSelectedRange:(null)range; (Argument range cannot be converted) + */ + abstract fun setSelectedRange(range: NSRange?) + + /** + * *native declaration : /Users/dkocher/null:108*

+ * Conversion Error : /// Original signature : `void scrollRangeToVisible(null)`

+ * - (void)scrollRangeToVisible:(null)range; (Argument range cannot be converted) + */ + abstract fun scrollRangeToVisible(range: NSRange?) + + /** + * Original signature : `void setFont(NSFont*)`

+ * *native declaration : /Users/dkocher/null:110* + */ + abstract fun setFont(obj: NSFont?) + + /** + * Original signature : `NSFont* font()`

+ * *native declaration : /Users/dkocher/null:111* + */ + abstract fun font(): NSFont? + + /** + * Original signature : `void setTextColor(NSColor*)`

+ * *native declaration : /Users/dkocher/null:112* + */ + abstract fun setTextColor(color: NSColor?) + + /** + * Original signature : `NSColor* textColor()`

+ * *native declaration : /Users/dkocher/null:113* + */ + abstract fun textColor(): NSColor? + + /** + * Original signature : `NSTextAlignment alignment()`

+ * *native declaration : /Users/dkocher/null:114* + */ + abstract fun alignment(): Int + + /** + * Original signature : `void setAlignment(NSTextAlignment)`

+ * *native declaration : /Users/dkocher/null:115* + */ + abstract fun setAlignment(mode: Int) + + /** + * Original signature : `NSWritingDirection baseWritingDirection()`

+ * *native declaration : /Users/dkocher/null:117* + */ + abstract fun baseWritingDirection(): Int + + /** + * Original signature : `void setBaseWritingDirection(NSWritingDirection)`

+ * *native declaration : /Users/dkocher/null:118* + */ + abstract fun setBaseWritingDirection(writingDirection: Int) + /** + * *native declaration : /Users/dkocher/null:121*

+ * Conversion Error : /// Original signature : `void setTextColor(NSColor*, null)`

+ * - (void)setTextColor:(NSColor*)color range:(null)range; (Argument range cannot be converted) + */ + /** + * *native declaration : /Users/dkocher/null:122*

+ * Conversion Error : /// Original signature : `void setFont(NSFont*, null)`

+ * - (void)setFont:(NSFont*)font range:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `maxSize()`

+ * *native declaration : /Users/dkocher/null:124* + */ + abstract fun maxSize(): NSSize? + /** + * *native declaration : /Users/dkocher/null:125*

+ * Conversion Error : /// Original signature : `void setMaxSize(null)`

+ * - (void)setMaxSize:(null)newMaxSize; (Argument newMaxSize cannot be converted) + */ + /** + * Original signature : `minSize()`

+ * *native declaration : /Users/dkocher/null:126* + */ + abstract fun minSize(): NSSize? + /** + * *native declaration : /Users/dkocher/null:127*

+ * Conversion Error : /// Original signature : `void setMinSize(null)`

+ * - (void)setMinSize:(null)newMinSize; (Argument newMinSize cannot be converted) + */ + /** + * Original signature : `BOOL isHorizontallyResizable()`

+ * *native declaration : /Users/dkocher/null:129* + */ + abstract fun isHorizontallyResizable(): Boolean + + /** + * Original signature : `void setHorizontallyResizable(BOOL)`

+ * *native declaration : /Users/dkocher/null:130* + */ + abstract fun setHorizontallyResizable(flag: Boolean) + + /** + * Original signature : `BOOL isVerticallyResizable()`

+ * *native declaration : /Users/dkocher/null:131* + */ + abstract fun isVerticallyResizable(): Boolean + + /** + * Original signature : `void setVerticallyResizable(BOOL)`

+ * *native declaration : /Users/dkocher/null:132* + */ + abstract fun setVerticallyResizable(flag: Boolean) + + /** + * Original signature : `void sizeToFit()`

+ * *native declaration : /Users/dkocher/null:134* + */ + abstract fun sizeToFit() + + /** + * Original signature : `void copy(id)`

+ * *native declaration : /Users/dkocher/null:136* + */ + abstract fun copy(sender: ID?) + + /** + * Original signature : `void copyFont(id)`

+ * *native declaration : /Users/dkocher/null:137* + */ + abstract fun copyFont(sender: ID?) + + /** + * Original signature : `void copyRuler(id)`

+ * *native declaration : /Users/dkocher/null:138* + */ + abstract fun copyRuler(sender: ID?) + + /** + * Original signature : `void cut(id)`

+ * *native declaration : /Users/dkocher/null:139* + */ + abstract fun cut(sender: ID?) + + /** + * Original signature : `void delete(id)`

+ * *native declaration : /Users/dkocher/null:140* + */ + abstract fun delete(sender: ID?) + + /** + * Original signature : `void paste(id)`

+ * *native declaration : /Users/dkocher/null:141* + */ + abstract fun paste(sender: ID?) + + /** + * Original signature : `void pasteFont(id)`

+ * *native declaration : /Users/dkocher/null:142* + */ + abstract fun pasteFont(sender: ID?) + + /** + * Original signature : `void pasteRuler(id)`

+ * *native declaration : /Users/dkocher/null:143* + */ + abstract fun pasteRuler(sender: ID?) + + /** + * Original signature : `void selectAll(id)`

+ * *native declaration : /Users/dkocher/null:144* + */ + abstract override fun selectAll(sender: ID?) + + /** + * Original signature : `void changeFont(id)`

+ * *native declaration : /Users/dkocher/null:145* + */ + abstract fun changeFont(sender: ID?) + + /** + * Original signature : `void alignLeft(id)`

+ * *native declaration : /Users/dkocher/null:146* + */ + abstract fun alignLeft(sender: ID?) + + /** + * Original signature : `void alignRight(id)`

+ * *native declaration : /Users/dkocher/null:147* + */ + abstract fun alignRight(sender: ID?) + + /** + * Original signature : `void alignCenter(id)`

+ * *native declaration : /Users/dkocher/null:148* + */ + abstract fun alignCenter(sender: ID?) + + /** + * Original signature : `void subscript(id)`

+ * *native declaration : /Users/dkocher/null:149* + */ + abstract fun subscript(sender: ID?) + + /** + * Original signature : `void superscript(id)`

+ * *native declaration : /Users/dkocher/null:150* + */ + abstract fun superscript(sender: ID?) + + /** + * Original signature : `void underline(id)`

+ * *native declaration : /Users/dkocher/null:151* + */ + abstract fun underline(sender: ID?) + + /** + * Original signature : `void unscript(id)`

+ * *native declaration : /Users/dkocher/null:152* + */ + abstract fun unscript(sender: ID?) + + /** + * Original signature : `void showGuessPanel(id)`

+ * *native declaration : /Users/dkocher/null:153* + */ + abstract fun showGuessPanel(sender: ID?) + + /** + * Original signature : `void checkSpelling(id)`

+ * *native declaration : /Users/dkocher/null:154* + */ + abstract fun checkSpelling(sender: ID?) + + /** + * Original signature : `void toggleRuler(id)`

+ * *native declaration : /Users/dkocher/null:155* + */ + abstract fun toggleRuler(sender: ID?) + + companion object { + /// native declaration : /Users/dkocher/null:15 + const val NSEnterCharacter: Int = 3 + + /// native declaration : /Users/dkocher/null:16 + const val NSBackspaceCharacter: Int = 8 + + /// native declaration : /Users/dkocher/null:17 + const val NSTabCharacter: Int = 9 + + /// native declaration : /Users/dkocher/null:18 + const val NSNewlineCharacter: Int = 10 + + /// native declaration : /Users/dkocher/null:19 + const val NSFormFeedCharacter: Int = 12 + + /// native declaration : /Users/dkocher/null:20 + const val NSCarriageReturnCharacter: Int = 13 + + /// native declaration : /Users/dkocher/null:21 + const val NSBackTabCharacter: Int = 25 + + /// native declaration : /Users/dkocher/null:22 + const val NSDeleteCharacter: Int = 127 + + /// native declaration : /Users/dkocher/null:23 + const val NSLineSeparatorCharacter: Int = 8232 + + /// native declaration : /Users/dkocher/null:24 + const val NSParagraphSeparatorCharacter: Int = 8233 + + /** + * Visually left aligned

+ * *native declaration : /Users/dkocher/null:29* + */ + const val NSTextAlignmentLeft: Int = 0 + + /** + * Visually right aligned

+ * *native declaration : /Users/dkocher/null:30* + */ + const val NSRightTextAlignment: Int = 1 + const val NSTextAlignmentRight: Int = 2 + + /** + * Visually centered

+ * *native declaration : /Users/dkocher/null:31* + */ + const val NSCenterTextAlignment: Int = 2 + const val NSTextAlignmentCenter: Int = 1 + + /** + * Fully-justified. The last line in a paragraph is natural-aligned.

+ * *native declaration : /Users/dkocher/null:32* + */ + const val NSTextAlignmentJustified: Int = 3 + + /** + * Indicates the default alignment for script

+ * *native declaration : /Users/dkocher/null:33* + */ + const val NSTextAlignmentNatural: Int = 4 + + /** + * Determines direction using the Unicode Bidi Algorithm rules P2 and P3

+ * *native declaration : /Users/dkocher/null:40* + */ + const val NSWritingDirectionNatural: Int = -1 + + /** + * Left to right writing direction

+ * *native declaration : /Users/dkocher/null:42* + */ + const val NSWritingDirectionLeftToRight: Int = 0 + + /** + * Right to left writing direction

+ * *native declaration : /Users/dkocher/null:43* + */ + const val NSWritingDirectionRightToLeft: Int = 1 + + /// native declaration : /Users/dkocher/null:50 + const val NSIllegalTextMovement: Int = 0 + + /// native declaration : /Users/dkocher/null:51 + const val NSReturnTextMovement: Int = 16 + + /// native declaration : /Users/dkocher/null:52 + const val NSTabTextMovement: Int = 17 + + /// native declaration : /Users/dkocher/null:53 + const val NSBacktabTextMovement: Int = 18 + + /// native declaration : /Users/dkocher/null:54 + const val NSLeftTextMovement: Int = 19 + + /// native declaration : /Users/dkocher/null:55 + const val NSRightTextMovement: Int = 20 + + /// native declaration : /Users/dkocher/null:56 + const val NSUpTextMovement: Int = 21 + + /// native declaration : /Users/dkocher/null:57 + const val NSDownTextMovement: Int = 22 + + /// native declaration : /Users/dkocher/null:60 + const val NSCancelTextMovement: Int = 23 + + /// native declaration : /Users/dkocher/null:61 + const val NSOtherTextMovement: Int = 0 + + val TextDidBeginEditingNotification: String? = "NSTextDidBeginEditingNotification" + val TextDidEndEditingNotification: String? = "NSTextDidEndEditingNotification" + val TextDidChangeNotification: String? = "NSTextDidChangeNotification" + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextField.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextField.kt new file mode 100644 index 00000000..96215180 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextField.kt @@ -0,0 +1,201 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSRect +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :8 +abstract class NSTextField : NSControl() { + interface _Class : ObjCClass { + open fun alloc(): NSTextField + } + + @Override + abstract override fun initWithFrame(frameRect: NSRect?): NSTextField + + /** + * Original signature : `void setBackgroundColor(NSColor*)`

+ * *native declaration : :15* + */ + abstract fun setBackgroundColor(color: NSColor?) + + /** + * Original signature : `NSColor* backgroundColor()`

+ * *native declaration : :16* + */ + abstract fun backgroundColor(): NSColor? + + /** + * Original signature : `void setDrawsBackground(BOOL)`

+ * *native declaration : :17* + */ + abstract fun setDrawsBackground(flag: Boolean) + + /** + * Original signature : `BOOL drawsBackground()`

+ * *native declaration : :18* + */ + abstract fun drawsBackground(): Boolean + + /** + * Original signature : `void setTextColor(NSColor*)`

+ * *native declaration : :19* + */ + abstract fun setTextColor(color: NSColor?) + + /** + * Original signature : `NSColor* textColor()`

+ * *native declaration : :20* + */ + abstract fun textColor(): NSColor? + + /** + * Original signature : `BOOL isBordered()`

+ * *native declaration : :21* + */ + abstract fun isBordered(): Boolean + + /** + * Original signature : `void setBordered(BOOL)`

+ * *native declaration : :22* + */ + abstract fun setBordered(flag: Boolean) + + /** + * Original signature : `BOOL isBezeled()`

+ * *native declaration : :23* + */ + abstract fun isBezeled(): Boolean + + /** + * Original signature : `void setBezeled(BOOL)`

+ * *native declaration : :24* + */ + abstract fun setBezeled(flag: Boolean) + + /** + * Original signature : `BOOL isEditable()`

+ * *native declaration : :25* + */ + abstract fun isEditable(): Boolean + + /** + * Original signature : `void setEditable(BOOL)`

+ * *native declaration : :26* + */ + abstract fun setEditable(flag: Boolean) + + /** + * Original signature : `BOOL isSelectable()`

+ * *native declaration : :27* + */ + abstract fun isSelectable(): Boolean + + /** + * Original signature : `void setSelectable(BOOL)`

+ * *native declaration : :28* + */ + abstract fun setSelectable(flag: Boolean) + + /** + * Original signature : `void selectText(id)`

+ * *native declaration : :29* + */ + abstract fun selectText(sender: ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :30* + */ + abstract fun delegate(): ID? + + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : :31* + */ + abstract fun setDelegate(id: ID?) + + /** + * Original signature : `BOOL textShouldBeginEditing(NSText*)`

+ * *native declaration : :32* + */ + abstract fun textShouldBeginEditing(textObject: NSText?): Boolean + + /** + * Original signature : `BOOL textShouldEndEditing(NSText*)`

+ * *native declaration : :33* + */ + abstract fun textShouldEndEditing(textObject: NSText?): Boolean + + /** + * Original signature : `void textDidBeginEditing(NSNotification*)`

+ * *native declaration : :34* + */ + abstract fun textDidBeginEditing(notification: NSNotification?) + + /** + * Original signature : `void textDidEndEditing(NSNotification*)`

+ * *native declaration : :35* + */ + abstract fun textDidEndEditing(notification: NSNotification?) + + /** + * Original signature : `void textDidChange(NSNotification*)`

+ * *native declaration : :36* + */ + abstract fun textDidChange(notification: NSNotification?) + + /** + * *native declaration : :40*

+ * Conversion Error : /// Original signature : `void setBezelStyle(null)`

+ * - (void)setBezelStyle:(null)style; (Argument style cannot be converted) + */ + abstract fun setBezelStyle(style: NSUInteger?) + + /** + * Original signature : `bezelStyle()`

+ * *native declaration : :41* + */ + abstract fun bezelStyle(): NSUInteger? + + /** + * Original signature : `void setTitleWithMnemonic(NSString*)`

+ * *from NSKeyboardUI native declaration : :46* + */ + abstract fun setTitleWithMnemonic(stringWithAmpersand: String?) + + /** + * Original signature : `BOOL allowsEditingTextAttributes()`

+ * *from NSTextFieldAttributedStringMethods native declaration : :50* + */ + abstract fun allowsEditingTextAttributes(): Boolean + + /** + * Original signature : `void setAllowsEditingTextAttributes(BOOL)`

+ * *from NSTextFieldAttributedStringMethods native declaration : :51* + */ + abstract fun setAllowsEditingTextAttributes(flag: Boolean) + + /** + * Original signature : `BOOL importsGraphics()`

+ * *from NSTextFieldAttributedStringMethods native declaration : :52* + */ + abstract fun importsGraphics(): Boolean + + /** + * Original signature : `void setImportsGraphics(BOOL)`

+ * *from NSTextFieldAttributedStringMethods native declaration : :53* + */ + abstract fun setImportsGraphics(flag: Boolean) + + abstract override fun cell(): NSTextFieldCell? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSTextField", _Class::class.java) + + fun textfieldWithFrame(frameRect: NSRect?): NSTextField? { + return CLASS.alloc().initWithFrame(frameRect) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextFieldCell.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextFieldCell.kt new file mode 100644 index 00000000..51386d9e --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextFieldCell.kt @@ -0,0 +1,117 @@ +package darwin + +import org.rococoa.ObjCClass + +/// native declaration : :21 +abstract class NSTextFieldCell : NSActionCell() { + interface _Class : ObjCClass { + open fun alloc(): NSTextFieldCell + } + + abstract fun init(): NSTextFieldCell? + + /** + * Original signature : `void setBackgroundColor(NSColor*)`

+ * *native declaration : :40* + */ + abstract fun setBackgroundColor(color: NSColor?) + + /** + * Original signature : `NSColor* backgroundColor()`

+ * *native declaration : :41* + */ + abstract fun backgroundColor(): NSColor? + + /** + * Original signature : `void setDrawsBackground(BOOL)`

+ * *native declaration : :42* + */ + abstract fun setDrawsBackground(flag: Boolean) + + /** + * Original signature : `BOOL drawsBackground()`

+ * *native declaration : :43* + */ + abstract fun drawsBackground(): Boolean + + /** + * Original signature : `void setTextColor(NSColor*)`

+ * *native declaration : :44* + */ + abstract fun setTextColor(color: NSColor?) + + /** + * Original signature : `NSColor* textColor()`

+ * *native declaration : :45* + */ + abstract fun textColor(): NSColor? + + /** + * Original signature : `NSText* setUpFieldEditorAttributes(NSText*)`

+ * *native declaration : :46* + */ + abstract fun setUpFieldEditorAttributes(textObj: NSText?): NSText? + + /** + * Original signature : `void setBezelStyle(NSTextFieldBezelStyle)`

+ * *native declaration : :49* + */ + abstract fun setBezelStyle(style: Int) + + /** + * Original signature : `NSTextFieldBezelStyle bezelStyle()`

+ * *native declaration : :50* + */ + abstract fun bezelStyle(): Int + + /** + * Original signature : `void setPlaceholderString(NSString*)`

+ * *native declaration : :54* + */ + abstract fun setPlaceholderString(string: String?) + + /** + * Original signature : `NSString* placeholderString()`

+ * *native declaration : :55* + */ + abstract fun placeholderString(): String? + + /** + * Original signature : `void setPlaceholderAttributedString(NSAttributedString*)`

+ * *native declaration : :56* + */ + abstract fun setPlaceholderAttributedString(string: NSAttributedString?) + + /** + * Original signature : `NSAttributedString* placeholderAttributedString()`

+ * *native declaration : :57* + */ + abstract fun placeholderAttributedString(): NSAttributedString? + + /** + * Original signature : `void setWantsNotificationForMarkedText(BOOL)`

+ * *native declaration : :61* + */ + abstract fun setWantsNotificationForMarkedText(flag: Boolean) + + /** + * Returns an array of locale identifiers representing input sources allowed to be enabled when the receiver has the keyboard focus.

+ * Original signature : `NSArray* allowedInputSourceLocales()`

+ * *native declaration : :65* + */ + abstract fun allowedInputSourceLocales(): NSArray? + + /** + * Original signature : `void setAllowedInputSourceLocales(NSArray*)`

+ * *native declaration : :66* + */ + abstract fun setAllowedInputSourceLocales(localeIdentifiers: NSArray?) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSTextFieldCell", _Class::class.java) + + fun textFieldCell(): NSTextFieldCell? { + return CLASS.alloc().init() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextStorage.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextStorage.kt new file mode 100644 index 00000000..4fa6cc40 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextStorage.kt @@ -0,0 +1,78 @@ +package darwin + +import org.rococoa.cocoa.foundation.NSInteger + +abstract class NSTextStorage : NSMutableAttributedString() { + /** + * These methods manage the list of layout managers.

+ * Original signature : `void addLayoutManager(NSLayoutManager*)`

+ * Retains & calls setTextStorage: on the item

+ * *native declaration : :45* + */ + abstract fun addLayoutManager(obj: NSLayoutManager?) + + /** + * Original signature : `void removeLayoutManager(NSLayoutManager*)`

+ * *native declaration : :46* + */ + abstract fun removeLayoutManager(obj: NSLayoutManager?) + + /** + * Original signature : `NSArray* layoutManagers()`

+ * *native declaration : :47* + */ + abstract fun layoutManagers(): NSArray? + /** + * *native declaration : :51*

+ * Conversion Error : NSRange + */ + /** + * This is called from edited:range:changeInLength: or endEditing. This method sends out NSTextStorageWillProcessEditing, then fixes the attributes, then sends out NSTextStorageDidProcessEditing, and finally notifies the layout managers of change with the textStorage:edited:range:changeInLength:invalidatedRange: method.

+ * Original signature : `void processEditing()`

+ * *native declaration : :55* + */ + abstract fun processEditing() + /** + * *native declaration : :58*

+ * Conversion Error : NSRange + */ + /** + * *native declaration : :61*

+ * Conversion Error : NSRange + */ + /** + * Original signature : `BOOL fixesAttributesLazily()`

+ * *native declaration : :65* + */ + abstract fun fixesAttributesLazily(): Boolean + + /** + * These methods return information about the editing status. Especially useful when there are outstanding beginEditing calls or during processEditing... editedRange.location will be NSNotFound if nothing has been edited.

+ * Original signature : `NSUInteger editedMask()`

+ * *native declaration : :69* + */ + abstract fun editedMask(): Int + /** + * *native declaration : :70*

+ * Conversion Error : NSRange + */ + /** + * Original signature : `NSInteger changeInLength()`

+ * *native declaration : :71* + */ + abstract fun changeInLength(): NSInteger? + + /** + * Set/get the delegate

+ * Original signature : `void setDelegate(id)`

+ * *native declaration : :75* + */ + abstract fun setDelegate(delegate: org.rococoa.ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :76* + */ + abstract fun delegate(): org.rococoa.ID? /// native declaration : :30 +} + diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextView.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextView.kt new file mode 100644 index 00000000..1606d61e --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTextView.kt @@ -0,0 +1,844 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.CGFloat + +/// native declaration : :72 +abstract class NSTextView : NSText() { + interface _Class : ObjCClass { + open fun alloc(): NSTextView + } + + abstract override fun init(): NSTextView + + /** + * *native declaration : :80*

+ * Conversion Error : /// Original signature : `initWithFrame(null, NSTextContainer*)`

+ * - (null)initWithFrame:(null)frameRect textContainer:(NSTextContainer*)container; (Argument frameRect cannot be converted) + */ + /** + * *native declaration : :83*

+ * Conversion Error : /// Original signature : `initWithFrame(null)`

+ * - (null)initWithFrame:(null)frameRect; (Argument frameRect cannot be converted) + */ + /** + * Original signature : `NSTextContainer* textContainer()`

+ * *native declaration : :88* + */ + abstract fun textContainer(): com.sun.jna.Pointer? + + /** + * Original signature : `void setTextContainer(NSTextContainer*)`

+ * *native declaration : :89* + */ + abstract fun setTextContainer(container: com.sun.jna.Pointer?) + + /** + * Original signature : `void replaceTextContainer(NSTextContainer*)`

+ * *native declaration : :92* + */ + abstract fun replaceTextContainer(newContainer: com.sun.jna.Pointer?) + /** + * *native declaration : :95*

+ * Conversion Error : /// Original signature : `void setTextContainerInset(null)`

+ * - (void)setTextContainerInset:(null)inset; (Argument inset cannot be converted) + */ + /** + * Original signature : `textContainerInset()`

+ * *native declaration : :96* + */ + abstract fun textContainerInset(): NSObject? + + /** + * Original signature : `textContainerOrigin()`

+ * *native declaration : :99* + */ + abstract fun textContainerOrigin(): NSObject? + + /** + * Original signature : `void invalidateTextContainerOrigin()`

+ * *native declaration : :100* + */ + abstract fun invalidateTextContainerOrigin() + + /** + * Original signature : `NSLayoutManager* layoutManager()`

+ * *native declaration : :103* + */ + abstract fun layoutManager(): NSLayoutManager? + + /** + * Original signature : `NSTextStorage* textStorage()`

+ * *native declaration : :104* + */ + abstract fun textStorage(): NSTextStorage? + /** + * *native declaration : :109*

+ * Conversion Error : /// Original signature : `void insertText(null)`

+ * - (void)insertText:(null)insertString; (Argument insertString cannot be converted) + */ + /** + * *native declaration : :114*

+ * Conversion Error : /// Original signature : `void setConstrainedFrameSize(null)`

+ * - (void)setConstrainedFrameSize:(null)desiredSize; (Argument desiredSize cannot be converted) + */ + /** + * *native declaration : :120*

+ * Conversion Error : / **

+ * * These two complete the set of range: type set methods. to be equivalent to the set of non-range taking varieties.

+ * * Original signature : `void setAlignment(null, null)`

+ * * /

+ * - (void)setAlignment:(null)alignment range:(null)range; (Argument alignment cannot be converted) + */ + /** + * *native declaration : :122*

+ * Conversion Error : /// Original signature : `void setBaseWritingDirection(null, null)`

+ * - (void)setBaseWritingDirection:(null)writingDirection range:(null)range; (Argument writingDirection cannot be converted) + */ + /** + * *native declaration : :127*

+ * Conversion Error : /// Original signature : `void turnOffKerning(null)`

+ * - (void)turnOffKerning:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :128*

+ * Conversion Error : /// Original signature : `void tightenKerning(null)`

+ * - (void)tightenKerning:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :129*

+ * Conversion Error : /// Original signature : `void loosenKerning(null)`

+ * - (void)loosenKerning:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :130*

+ * Conversion Error : /// Original signature : `void useStandardKerning(null)`

+ * - (void)useStandardKerning:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :131*

+ * Conversion Error : /// Original signature : `void turnOffLigatures(null)`

+ * - (void)turnOffLigatures:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :132*

+ * Conversion Error : /// Original signature : `void useStandardLigatures(null)`

+ * - (void)useStandardLigatures:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :133*

+ * Conversion Error : /// Original signature : `void useAllLigatures(null)`

+ * - (void)useAllLigatures:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :134*

+ * Conversion Error : /// Original signature : `void raiseBaseline(null)`

+ * - (void)raiseBaseline:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :135*

+ * Conversion Error : /// Original signature : `void lowerBaseline(null)`

+ * - (void)lowerBaseline:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :136*

+ * Conversion Error : /// Original signature : `void toggleTraditionalCharacterShape(null)`

+ * - (void)toggleTraditionalCharacterShape:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :138*

+ * Conversion Error : /// Original signature : `void outline(null)`

+ * - (void)outline:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :144*

+ * Conversion Error : /// Original signature : `void performFindPanelAction(null)`

+ * - (void)performFindPanelAction:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :150*

+ * Conversion Error : /// Original signature : `void alignJustified(null)`

+ * - (void)alignJustified:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :151*

+ * Conversion Error : /// Original signature : `void changeColor(null)`

+ * - (void)changeColor:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :153*

+ * Conversion Error : /// Original signature : `void changeAttributes(null)`

+ * - (void)changeAttributes:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :154*

+ * Conversion Error : /// Original signature : `void changeDocumentBackgroundColor(null)`

+ * - (void)changeDocumentBackgroundColor:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :155*

+ * Conversion Error : /// Original signature : `void toggleBaseWritingDirection(null)`

+ * - (void)toggleBaseWritingDirection:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :158*

+ * Conversion Error : /// Original signature : `void orderFrontSpacingPanel(null)`

+ * - (void)orderFrontSpacingPanel:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :159*

+ * Conversion Error : /// Original signature : `void orderFrontLinkPanel(null)`

+ * - (void)orderFrontLinkPanel:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :160*

+ * Conversion Error : /// Original signature : `void orderFrontListPanel(null)`

+ * - (void)orderFrontListPanel:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :161*

+ * Conversion Error : /// Original signature : `void orderFrontTablePanel(null)`

+ * - (void)orderFrontTablePanel:(null)sender; (Argument sender cannot be converted) + */ + /** + * Original signature : `void rulerView(NSRulerView*, NSRulerMarker*)`

+ * *native declaration : :166* + */ + abstract fun rulerView_didMoveMarker(ruler: com.sun.jna.Pointer?, marker: com.sun.jna.Pointer?) + + /** + * Original signature : `void rulerView(NSRulerView*, NSRulerMarker*)`

+ * *native declaration : :167* + */ + abstract fun rulerView_didRemoveMarker(ruler: com.sun.jna.Pointer?, marker: com.sun.jna.Pointer?) + + /** + * Original signature : `void rulerView(NSRulerView*, NSRulerMarker*)`

+ * *native declaration : :168* + */ + abstract fun rulerView_didAddMarker(ruler: com.sun.jna.Pointer?, marker: com.sun.jna.Pointer?) + + /** + * Original signature : `BOOL rulerView(NSRulerView*, NSRulerMarker*)`

+ * *native declaration : :169* + */ + abstract fun rulerView_shouldMoveMarker(ruler: com.sun.jna.Pointer?, marker: com.sun.jna.Pointer?): Boolean + + /** + * Original signature : `BOOL rulerView(NSRulerView*, NSRulerMarker*)`

+ * *native declaration : :170* + */ + abstract fun rulerView_shouldAddMarker(ruler: com.sun.jna.Pointer?, marker: com.sun.jna.Pointer?): Boolean + + /** + * Original signature : `CGFloat rulerView(NSRulerView*, NSRulerMarker*, CGFloat)`

+ * *native declaration : :171* + */ + abstract fun rulerView_willMoveMarker_toLocation( + ruler: com.sun.jna.Pointer?, + marker: com.sun.jna.Pointer?, + location: CGFloat? + ): CGFloat? + + /** + * Original signature : `BOOL rulerView(NSRulerView*, NSRulerMarker*)`

+ * *native declaration : :172* + */ + abstract fun rulerView_shouldRemoveMarker(ruler: com.sun.jna.Pointer?, marker: com.sun.jna.Pointer?): Boolean + + /** + * Original signature : `CGFloat rulerView(NSRulerView*, NSRulerMarker*, CGFloat)`

+ * *native declaration : :173* + */ + abstract fun rulerView_willAddMarker_atLocation( + ruler: com.sun.jna.Pointer?, + marker: com.sun.jna.Pointer?, + location: CGFloat? + ): CGFloat? + + /** + * Original signature : `void rulerView(NSRulerView*, NSEvent*)`

+ * *native declaration : :174* + */ + abstract fun rulerView_handleMouseDown(ruler: com.sun.jna.Pointer?, event: NSEvent?) + /** + * *native declaration : :178*

+ * Conversion Error : /// Original signature : `void setNeedsDisplayInRect(null, BOOL)`

+ * - (void)setNeedsDisplayInRect:(null)rect avoidAdditionalLayout:(BOOL)flag; (Argument rect cannot be converted) + */ + /** + * Original signature : `BOOL shouldDrawInsertionPoint()`

+ * *native declaration : :181* + */ + abstract fun shouldDrawInsertionPoint(): Boolean + /** + * *native declaration : :182*

+ * Conversion Error : /// Original signature : `void drawInsertionPointInRect(null, NSColor*, BOOL)`

+ * - (void)drawInsertionPointInRect:(null)rect color:(NSColor*)color turnedOn:(BOOL)flag; (Argument rect cannot be converted) + */ + /** + * *native declaration : :185*

+ * Conversion Error : /// Original signature : `void drawViewBackgroundInRect(null)`

+ * - (void)drawViewBackgroundInRect:(null)rect; (Argument rect cannot be converted) + */ + /** + * Original signature : `void updateRuler()`

+ * *native declaration : :191* + */ + abstract fun updateRuler() + + /** + * Original signature : `void updateFontPanel()`

+ * *native declaration : :192* + */ + abstract fun updateFontPanel() + + /** + * Original signature : `void updateDragTypeRegistration()`

+ * *native declaration : :194* + */ + abstract fun updateDragTypeRegistration() + /** + * *native declaration : :196*

+ * Conversion Error : /// Original signature : `selectionRangeForProposedRange(null, NSSelectionGranularity)`

+ * - (null)selectionRangeForProposedRange:(null)proposedCharRange granularity:(NSSelectionGranularity)granularity; (Argument proposedCharRange cannot be converted) + */ + /** + * *native declaration : :200*

+ * Conversion Error : /// Original signature : `void clickedOnLink(null, NSUInteger)`

+ * - (void)clickedOnLink:(null)link atIndex:(NSUInteger)charIndex; (Argument link cannot be converted) + */ + /** + * *native declaration : :205*

+ * Conversion Error : /// Original signature : `void startSpeaking(null)`

+ * - (void)startSpeaking:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :206*

+ * Conversion Error : /// Original signature : `void stopSpeaking(null)`

+ * - (void)stopSpeaking:(null)sender; (Argument sender cannot be converted) + */ + /** + * *native declaration : :211*

+ * Conversion Error : /// Original signature : `NSUInteger characterIndexForInsertionAtPoint(null)`

+ * - (NSUInteger)characterIndexForInsertionAtPoint:(null)point; (Argument point cannot be converted) + */ + /** + * *from NSCompletion native declaration : :222*

+ * Conversion Error : /// Original signature : `void complete(null)`

+ * - (void)complete:(null)sender; (Argument sender cannot be converted) + */ + /** + * Original signature : `rangeForUserCompletion()`

+ * *from NSCompletion native declaration : :225* + */ + abstract fun rangeForUserCompletion(): NSObject? + /** + * *from NSCompletion native declaration : :228*

+ * Conversion Error : /// Original signature : `NSArray* completionsForPartialWordRange(null, NSInteger*)`

+ * - (NSArray*)completionsForPartialWordRange:(null)charRange indexOfSelectedItem:(NSInteger*)index; (Argument charRange cannot be converted) + */ + /** + * *from NSCompletion native declaration : :231*

+ * Conversion Error : /// Original signature : `void insertCompletion(NSString*, null, NSInteger, BOOL)`

+ * - (void)insertCompletion:(NSString*)word forPartialWordRange:(null)charRange movement:(NSInteger)movement isFinal:(BOOL)flag; (Argument charRange cannot be converted) + */ + /** + * Original signature : `NSArray* writablePasteboardTypes()`

+ * *from NSPasteboard native declaration : :248* + */ + abstract fun writablePasteboardTypes(): com.sun.jna.Pointer? + + /** + * Original signature : `BOOL writeSelectionToPasteboard(NSPasteboard*, NSString*)`

+ * *from NSPasteboard native declaration : :251* + */ + abstract fun writeSelectionToPasteboard_type(pboard: com.sun.jna.Pointer?, type: com.sun.jna.Pointer?): Boolean + + /** + * Original signature : `BOOL writeSelectionToPasteboard(NSPasteboard*, NSArray*)`

+ * *from NSPasteboard native declaration : :254* + */ + abstract fun writeSelectionToPasteboard_types(pboard: com.sun.jna.Pointer?, types: com.sun.jna.Pointer?): Boolean + + /** + * Original signature : `NSArray* readablePasteboardTypes()`

+ * *from NSPasteboard native declaration : :258* + */ + abstract fun readablePasteboardTypes(): NSArray? + + /** + * Original signature : `NSString* preferredPasteboardTypeFromArray(NSArray*, NSArray*)`

+ * *from NSPasteboard native declaration : :261* + */ + abstract fun preferredPasteboardTypeFromArray_restrictedToTypesFromArray( + availableTypes: NSArray?, + allowedTypes: NSArray? + ): String? + + /** + * Original signature : `BOOL readSelectionFromPasteboard(NSPasteboard*, NSString*)`

+ * *from NSPasteboard native declaration : :264* + */ + abstract fun readSelectionFromPasteboard_type(pboard: NSPasteboard?, type: String?): Boolean + + /** + * Original signature : `BOOL readSelectionFromPasteboard(NSPasteboard*)`

+ * *from NSPasteboard native declaration : :267* + */ + abstract fun readSelectionFromPasteboard(pboard: com.sun.jna.Pointer?): Boolean + + /** + * Original signature : `validRequestorForSendType(NSString*, NSString*)`

+ * *from NSPasteboard native declaration : :273* + */ + /** + * *from NSPasteboard native declaration : :276*

+ * Conversion Error : /// Original signature : `void pasteAsPlainText(null)`

+ * - (void)pasteAsPlainText:(null)sender; (Argument sender cannot be converted) + */ + /** + * *from NSPasteboard native declaration : :277*

+ * Conversion Error : /// Original signature : `void pasteAsRichText(null)`

+ * - (void)pasteAsRichText:(null)sender; (Argument sender cannot be converted) + */ + /** + * *from NSDragging native declaration : :284*

+ * Conversion Error : /// Original signature : `BOOL dragSelectionWithEvent(NSEvent*, null, BOOL)`

+ * - (BOOL)dragSelectionWithEvent:(NSEvent*)event offset:(null)mouseOffset slideBack:(BOOL)slideBack; (Argument mouseOffset cannot be converted) + */ + /** + * *from NSDragging native declaration : :287*

+ * Conversion Error : /// Original signature : `NSImage* dragImageForSelectionWithEvent(NSEvent*, null)`

+ * - (NSImage*)dragImageForSelectionWithEvent:(NSEvent*)event origin:(null)origin; (Argument origin cannot be converted) + */ + /** + * Original signature : `NSArray* acceptableDragTypes()`

+ * *from NSDragging native declaration : :290* + */ + abstract fun acceptableDragTypes(): NSArray? + /** + * *from NSDragging native declaration : :293*

+ * Conversion Error : id + */ + /** + * Original signature : `void cleanUpAfterDragOperation()`

+ * *from NSDragging native declaration : :296* + */ + abstract fun cleanUpAfterDragOperation() + + /** + * Original signature : `NSArray* selectedRanges()`

+ * *from NSSharing native declaration : :308* + */ + abstract fun selectedRanges(): NSArray? + + /** + * Original signature : `void setSelectedRanges(NSArray*, NSSelectionAffinity, BOOL)`

+ * *from NSSharing native declaration : :309* + */ + abstract fun setSelectedRanges_affinity_stillSelecting( + ranges: com.sun.jna.Pointer?, + affinity: Int, + stillSelectingFlag: Boolean + ) + + /** + * Original signature : `void setSelectedRanges(NSArray*)`

+ * *from NSSharing native declaration : :310* + */ + abstract fun setSelectedRanges(ranges: NSArray?) + /** + * *from NSSharing native declaration : :314*

+ * Conversion Error : /// Original signature : `void setSelectedRange(null, NSSelectionAffinity, BOOL)`

+ * - (void)setSelectedRange:(null)charRange affinity:(NSSelectionAffinity)affinity stillSelecting:(BOOL)stillSelectingFlag; (Argument charRange cannot be converted) + */ + /** + * Original signature : `NSSelectionAffinity selectionAffinity()`

+ * *from NSSharing native declaration : :315* + */ + abstract fun selectionAffinity(): Int + + /** + * Original signature : `NSSelectionGranularity selectionGranularity()`

+ * *from NSSharing native declaration : :316* + */ + abstract fun selectionGranularity(): Int + + /** + * Original signature : `void setSelectionGranularity(NSSelectionGranularity)`

+ * *from NSSharing native declaration : :317* + */ + abstract fun setSelectionGranularity(granularity: Int) + + /** + * Original signature : `void setSelectedTextAttributes(NSDictionary*)`

+ * *from NSSharing native declaration : :319* + */ + abstract fun setSelectedTextAttributes(attributeDictionary: NSDictionary?) + + /** + * Original signature : `NSDictionary* selectedTextAttributes()`

+ * *from NSSharing native declaration : :320* + */ + abstract fun selectedTextAttributes(): com.sun.jna.Pointer? + + /** + * Original signature : `void setInsertionPointColor(NSColor*)`

+ * *from NSSharing native declaration : :323* + */ + abstract fun setInsertionPointColor(color: com.sun.jna.Pointer?) + + /** + * Original signature : `NSColor* insertionPointColor()`

+ * *from NSSharing native declaration : :324* + */ + abstract fun insertionPointColor(): com.sun.jna.Pointer? + + /** + * Original signature : `void updateInsertionPointStateAndRestartTimer(BOOL)`

+ * *from NSSharing native declaration : :326* + */ + abstract fun updateInsertionPointStateAndRestartTimer(restartFlag: Boolean) + + /** + * Original signature : `void setMarkedTextAttributes(NSDictionary*)`

+ * *from NSSharing native declaration : :328* + */ + abstract fun setMarkedTextAttributes(attributeDictionary: com.sun.jna.Pointer?) + + /** + * Original signature : `NSDictionary* markedTextAttributes()`

+ * *from NSSharing native declaration : :329* + */ + abstract fun markedTextAttributes(): com.sun.jna.Pointer? + + /** + * Original signature : `void setLinkTextAttributes(NSDictionary*)`

+ * *from NSSharing native declaration : :333* + */ + abstract fun setLinkTextAttributes(attributeDictionary: com.sun.jna.Pointer?) + + /** + * Original signature : `NSDictionary* linkTextAttributes()`

+ * *from NSSharing native declaration : :334* + */ + abstract fun linkTextAttributes(): com.sun.jna.Pointer? + + /** + * Original signature : `BOOL displaysLinkToolTips()`

+ * *from NSSharing native declaration : :339* + */ + abstract fun displaysLinkToolTips(): Boolean + + /** + * Original signature : `void setDisplaysLinkToolTips(BOOL)`

+ * *from NSSharing native declaration : :340* + */ + abstract fun setDisplaysLinkToolTips(flag: Boolean) + + /** + * Original signature : `BOOL acceptsGlyphInfo()`

+ * *from NSSharing native declaration : :347* + */ + abstract fun acceptsGlyphInfo(): Boolean + + /** + * Original signature : `void setAcceptsGlyphInfo(BOOL)`

+ * *from NSSharing native declaration : :348* + */ + abstract fun setAcceptsGlyphInfo(flag: Boolean) + + /** + * Original signature : `void setRulerVisible(BOOL)`

+ * *from NSSharing native declaration : :353* + */ + abstract fun setRulerVisible(flag: Boolean) + + /** + * Original signature : `BOOL usesRuler()`

+ * *from NSSharing native declaration : :354* + */ + abstract fun usesRuler(): Boolean + + /** + * Original signature : `void setUsesRuler(BOOL)`

+ * *from NSSharing native declaration : :355* + */ + abstract fun setUsesRuler(flag: Boolean) + + /** + * Original signature : `void setContinuousSpellCheckingEnabled(BOOL)`

+ * *from NSSharing native declaration : :357* + */ + abstract fun setContinuousSpellCheckingEnabled(flag: Boolean) + + /** + * Original signature : `BOOL isContinuousSpellCheckingEnabled()`

+ * *from NSSharing native declaration : :358* + */ + abstract fun isContinuousSpellCheckingEnabled(): Boolean + /** + * *from NSSharing native declaration : :359*

+ * Conversion Error : /// Original signature : `void toggleContinuousSpellChecking(null)`

+ * - (void)toggleContinuousSpellChecking:(null)sender; (Argument sender cannot be converted) + */ + /** + * Original signature : `NSInteger spellCheckerDocumentTag()`

+ * *from NSSharing native declaration : :361* + */ + abstract fun spellCheckerDocumentTag(): Int + + /** + * Original signature : `void setGrammarCheckingEnabled(BOOL)`

+ * *from NSSharing native declaration : :364* + */ + abstract fun setGrammarCheckingEnabled(flag: Boolean) + + /** + * Original signature : `BOOL isGrammarCheckingEnabled()`

+ * *from NSSharing native declaration : :365* + */ + abstract fun isGrammarCheckingEnabled(): Boolean + /** + * *from NSSharing native declaration : :366*

+ * Conversion Error : /// Original signature : `void toggleGrammarChecking(null)`

+ * - (void)toggleGrammarChecking:(null)sender; (Argument sender cannot be converted) + */ + /** + * *from NSSharing native declaration : :369*

+ * Conversion Error : /// Original signature : `void setSpellingState(NSInteger, null)`

+ * - (void)setSpellingState:(NSInteger)value range:(null)charRange; (Argument charRange cannot be converted) + */ + /** + * Original signature : `NSDictionary* typingAttributes()`

+ * *from NSSharing native declaration : :373* + */ + abstract fun typingAttributes(): com.sun.jna.Pointer? + + /** + * Original signature : `void setTypingAttributes(NSDictionary*)`

+ * *from NSSharing native declaration : :374* + */ + abstract fun setTypingAttributes(attrs: com.sun.jna.Pointer?) + + /** + * These multiple-range methods supersede the corresponding single-range methods. For the first method, the affectedRanges argument obeys the same restrictions as the argument to setSelectedRanges:, and the replacementStrings array should either be nil (for attribute-only changes) or have the same number of elements as affectedRanges. For the remaining three methods, the return values obey the same restrictions as that for selectedRanges, except that they will be nil if the corresponding change is not permitted, where the corresponding single-range methods return (NSNotFound, 0).

+ * Original signature : `BOOL shouldChangeTextInRanges(NSArray*, NSArray*)`

+ * *from NSSharing native declaration : :378* + */ + abstract fun shouldChangeTextInRanges_replacementStrings( + affectedRanges: com.sun.jna.Pointer?, + replacementStrings: com.sun.jna.Pointer? + ): Boolean + + /** + * Original signature : `NSArray* rangesForUserTextChange()`

+ * *from NSSharing native declaration : :379* + */ + abstract fun rangesForUserTextChange(): com.sun.jna.Pointer? + + /** + * Original signature : `NSArray* rangesForUserCharacterAttributeChange()`

+ * *from NSSharing native declaration : :380* + */ + abstract fun rangesForUserCharacterAttributeChange(): com.sun.jna.Pointer? + + /** + * Original signature : `NSArray* rangesForUserParagraphAttributeChange()`

+ * *from NSSharing native declaration : :381* + */ + abstract fun rangesForUserParagraphAttributeChange(): com.sun.jna.Pointer? + /** + * *from NSSharing native declaration : :384*

+ * Conversion Error : /// Original signature : `BOOL shouldChangeTextInRange(null, NSString*)`

+ * - (BOOL)shouldChangeTextInRange:(null)affectedCharRange replacementString:(NSString*)replacementString; (Argument affectedCharRange cannot be converted) + */ + /** + * Original signature : `void didChangeText()`

+ * *from NSSharing native declaration : :385* + */ + abstract fun didChangeText() + + /** + * Original signature : `rangeForUserTextChange()`

+ * *from NSSharing native declaration : :387* + */ + abstract fun rangeForUserTextChange(): NSObject? + + /** + * Original signature : `rangeForUserCharacterAttributeChange()`

+ * *from NSSharing native declaration : :388* + */ + abstract fun rangeForUserCharacterAttributeChange(): NSObject? + + /** + * Original signature : `rangeForUserParagraphAttributeChange()`

+ * *from NSSharing native declaration : :389* + */ + abstract fun rangeForUserParagraphAttributeChange(): NSObject? + + /** + * Original signature : `void setUsesFindPanel(BOOL)`

+ * *from NSSharing native declaration : :392* + */ + abstract fun setUsesFindPanel(flag: Boolean) + + /** + * Original signature : `BOOL usesFindPanel()`

+ * *from NSSharing native declaration : :393* + */ + abstract fun usesFindPanel(): Boolean + + /** + * Original signature : `void setAllowsDocumentBackgroundColorChange(BOOL)`

+ * *from NSSharing native declaration : :395* + */ + abstract fun setAllowsDocumentBackgroundColorChange(flag: Boolean) + + /** + * Original signature : `BOOL allowsDocumentBackgroundColorChange()`

+ * *from NSSharing native declaration : :396* + */ + abstract fun allowsDocumentBackgroundColorChange(): Boolean + + /** + * Original signature : `void setDefaultParagraphStyle(NSParagraphStyle*)`

+ * *from NSSharing native declaration : :398* + */ + abstract fun setDefaultParagraphStyle(paragraphStyle: com.sun.jna.Pointer?) + + /** + * Original signature : `NSParagraphStyle* defaultParagraphStyle()`

+ * *from NSSharing native declaration : :399* + */ + abstract fun defaultParagraphStyle(): com.sun.jna.Pointer? + + /** + * Original signature : `void setAllowsUndo(BOOL)`

+ * *from NSSharing native declaration : :402* + */ + abstract fun setAllowsUndo(flag: Boolean) + + /** + * Original signature : `BOOL allowsUndo()`

+ * *from NSSharing native declaration : :403* + */ + abstract fun allowsUndo(): Boolean + + /** + * Original signature : `void breakUndoCoalescing()`

+ * *from NSSharing native declaration : :406* + */ + abstract fun breakUndoCoalescing() + + /** + * Original signature : `BOOL allowsImageEditing()`

+ * *from NSSharing native declaration : :411* + */ + abstract fun allowsImageEditing(): Boolean + + /** + * Original signature : `void setAllowsImageEditing(BOOL)`

+ * *from NSSharing native declaration : :412* + */ + abstract fun setAllowsImageEditing(flag: Boolean) + /** + * *from NSSharing native declaration : :415*

+ * Conversion Error : /// Original signature : `void showFindIndicatorForRange(null)`

+ * - (void)showFindIndicatorForRange:(null)charRange; (Argument charRange cannot be converted) + */ + /** + * *from NSSharing native declaration : :440*

+ * Conversion Error : /// Original signature : `void setSelectedRange(null)`

+ * - (void)setSelectedRange:(null)charRange; (Argument charRange cannot be converted) + */ + /** + * Original signature : `BOOL smartInsertDeleteEnabled()`

+ * *from NSSharing native declaration : :445* + */ + abstract fun smartInsertDeleteEnabled(): Boolean + + /** + * Original signature : `void setSmartInsertDeleteEnabled(BOOL)`

+ * *from NSSharing native declaration : :446* + */ + abstract fun setSmartInsertDeleteEnabled(flag: Boolean) + /** + * *from NSSharing native declaration : :447*

+ * Conversion Error : /// Original signature : `smartDeleteRangeForProposedRange(null)`

+ * - (null)smartDeleteRangeForProposedRange:(null)proposedCharRange; (Argument proposedCharRange cannot be converted) + */ + /** + * *from NSSharing native declaration : :449*

+ * Conversion Error : /// Original signature : `void toggleSmartInsertDelete(null)`

+ * - (void)toggleSmartInsertDelete:(null)sender; (Argument sender cannot be converted) + */ + /** + * *from NSSharing native declaration : :452*

+ * Conversion Error : /// Original signature : `void smartInsertForString(NSString*, null, NSString**, NSString**)`

+ * - (void)smartInsertForString:(NSString*)pasteString replacingRange:(null)charRangeToReplace beforeString:(NSString**)beforeString afterString:(NSString**)afterString; (Argument charRangeToReplace cannot be converted) + */ + /** + * *from NSSharing native declaration : :453*

+ * Conversion Error : /// Original signature : `NSString* smartInsertBeforeStringForString(NSString*, null)`

+ * - (NSString*)smartInsertBeforeStringForString:(NSString*)pasteString replacingRange:(null)charRangeToReplace; (Argument charRangeToReplace cannot be converted) + */ + /** + * *from NSSharing native declaration : :454*

+ * Conversion Error : /// Original signature : `NSString* smartInsertAfterStringForString(NSString*, null)`

+ * - (NSString*)smartInsertAfterStringForString:(NSString*)pasteString replacingRange:(null)charRangeToReplace; (Argument charRangeToReplace cannot be converted) + */ + /** + * Original signature : `void setAutomaticQuoteSubstitutionEnabled(BOOL)`

+ * *from NSSharing native declaration : :458* + */ + abstract fun setAutomaticQuoteSubstitutionEnabled(flag: Boolean) + + /** + * Original signature : `BOOL isAutomaticQuoteSubstitutionEnabled()`

+ * *from NSSharing native declaration : :459* + */ + abstract fun isAutomaticQuoteSubstitutionEnabled(): Boolean + /** + * *from NSSharing native declaration : :460*

+ * Conversion Error : /// Original signature : `void toggleAutomaticQuoteSubstitution(null)`

+ * - (void)toggleAutomaticQuoteSubstitution:(null)sender; (Argument sender cannot be converted) + */ + /** + * Original signature : `void setAutomaticLinkDetectionEnabled(BOOL)`

+ * *from NSSharing native declaration : :461* + */ + abstract fun setAutomaticLinkDetectionEnabled(flag: Boolean) + + /** + * Original signature : `BOOL isAutomaticLinkDetectionEnabled()`

+ * *from NSSharing native declaration : :462* + */ + abstract fun isAutomaticLinkDetectionEnabled(): Boolean + /** + * *from NSSharing native declaration : :463*

+ * Conversion Error : /// Original signature : `void toggleAutomaticLinkDetection(null)`

+ * - (void)toggleAutomaticLinkDetection:(null)sender; (Argument sender cannot be converted) + */ + /** + * Returns an array of locale identifiers representing input sources allowed to be enabled when the receiver has the keyboard focus.

+ * Original signature : `NSArray* allowedInputSourceLocales()`

+ * *from NSSharing native declaration : :470* + */ + abstract fun allowedInputSourceLocales(): NSArray? + + /** + * Original signature : `void setAllowedInputSourceLocales(NSArray*)`

+ * *from NSSharing native declaration : :471* + */ + abstract fun setAllowedInputSourceLocales(localeIdentifiers: NSArray?) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSTextView", _Class::class.java) + + fun create(): NSTextView? { + return CLASS.alloc().init() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSThread.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSThread.kt new file mode 100644 index 00000000..05b20c08 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSThread.kt @@ -0,0 +1,67 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Selector +import org.rococoa.cocoa.foundation.NSUInteger + +object NSThread : NSObject() { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSThread", _Class::class.java) + + fun isMainThread(): Boolean { + return CLASS.isMainThread() + } + + interface _Class : ObjCClass { + /** + * Returns a Boolean value that indicates whether the current thread is the main thread. + * + * @return + */ + open fun isMainThread(): Boolean + } + + override fun respondsToSelector(sel: Selector?): Boolean { + TODO("Not yet implemented") + } + + override fun performSelector(sel: Selector?): NSObject? { + TODO("Not yet implemented") + } + + override fun hash(): NSUInteger? { + TODO("Not yet implemented") + } + + override fun isEqual(anObject: ID?): Boolean { + TODO("Not yet implemented") + } + + override fun id(): ID { + TODO("Not yet implemented") + } + + override fun retain(): org.rococoa.cocoa.foundation.NSObject { + TODO("Not yet implemented") + } + + override fun release() { + TODO("Not yet implemented") + } + + override fun retainCount(): NSUInteger { + TODO("Not yet implemented") + } + + override fun isKindOfClass(p0: ObjCClass?): Boolean { + TODO("Not yet implemented") + } + + override fun isKindOfClass(p0: ID?): Boolean { + TODO("Not yet implemented") + } + + override fun description(): String { + TODO("Not yet implemented") + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTimeZone.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTimeZone.kt new file mode 100644 index 00000000..942a3e95 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTimeZone.kt @@ -0,0 +1,148 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSInteger + +abstract class NSTimeZone : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `NSTimeZone* systemTimeZone()`

+ * *from NSExtendedTimeZone native declaration : :22* + */ + open fun systemTimeZone(): NSTimeZone? + + /** + * Original signature : `void resetSystemTimeZone()`

+ * *from NSExtendedTimeZone native declaration : :23* + */ + open fun resetSystemTimeZone() + + /** + * Original signature : `NSTimeZone* defaultTimeZone()`

+ * *from NSExtendedTimeZone native declaration : :25* + */ + open fun defaultTimeZone(): NSTimeZone? + + open fun timeZoneWithName(tzName: String?): NSTimeZone? + + /** + * Original signature : `void setDefaultTimeZone(NSTimeZone*)`

+ * *from NSExtendedTimeZone native declaration : :26* + */ + open fun setDefaultTimeZone(aTimeZone: NSTimeZone?) + + /** + * Original signature : `NSTimeZone* localTimeZone()`

+ * *from NSExtendedTimeZone native declaration : :28* + */ + open fun localTimeZone(): NSTimeZone? + + /** + * Original signature : `NSArray* knownTimeZoneNames()`

+ * *from NSExtendedTimeZone native declaration : :30* + */ + open fun knownTimeZoneNames(): NSArray? + + /** + * Original signature : `NSDictionary* abbreviationDictionary()`

+ * *from NSExtendedTimeZone native declaration : :32* + */ + open fun abbreviationDictionary(): NSDictionary? + } + + /** + * Original signature : `NSString* name()`

+ * *native declaration : :9* + */ + abstract fun name(): String? + + /** + * Original signature : `NSData* data()`

+ * *native declaration : :10* + */ + abstract fun data(): NSData? + + /** + * Original signature : `NSInteger secondsFromGMTForDate(NSDate*)`

+ * *native declaration : :12* + */ + abstract fun secondsFromGMTForDate(aDate: NSDate?): NSInteger? + + /** + * Original signature : `NSString* abbreviationForDate(NSDate*)`

+ * *native declaration : :13* + */ + abstract fun abbreviationForDate(aDate: NSDate?): String? + + /** + * Original signature : `BOOL isDaylightSavingTimeForDate(NSDate*)`

+ * *native declaration : :14* + */ + abstract fun isDaylightSavingTimeForDate(aDate: NSDate?): Boolean + + /** + * Original signature : `daylightSavingTimeOffsetForDate(NSDate*)`

+ * *native declaration : :15* + */ + abstract fun daylightSavingTimeOffsetForDate(aDate: com.sun.jna.Pointer?): com.sun.jna.Pointer? + + /** + * Original signature : `NSDate* nextDaylightSavingTimeTransitionAfterDate(NSDate*)`

+ * *native declaration : :16* + */ + abstract fun nextDaylightSavingTimeTransitionAfterDate(aDate: NSDate?): NSDate? + + /** + * Original signature : `NSInteger secondsFromGMT()`

+ * *from NSExtendedTimeZone native declaration : :34* + */ + abstract fun secondsFromGMT(): NSInteger? + + /** + * Original signature : `NSString* abbreviation()`

+ * *from NSExtendedTimeZone native declaration : :35* + */ + abstract fun abbreviation(): String? + + /** + * Original signature : `BOOL isDaylightSavingTime()`

+ * *from NSExtendedTimeZone native declaration : :36* + */ + abstract fun isDaylightSavingTime(): Boolean + + /** + * Original signature : `daylightSavingTimeOffset()`

+ * for current instant

+ * *from NSExtendedTimeZone native declaration : :37* + */ + abstract fun daylightSavingTimeOffset(): com.sun.jna.Pointer? + + /** + * Original signature : `NSDate* nextDaylightSavingTimeTransition()`

+ * after current instant

+ * *from NSExtendedTimeZone native declaration : :38* + */ + abstract fun nextDaylightSavingTimeTransition(): NSDate? + + /** + * Original signature : `BOOL isEqualToTimeZone(NSTimeZone*)`

+ * *from NSExtendedTimeZone native declaration : :42* + */ + abstract fun isEqualToTimeZone(aTimeZone: NSTimeZone?): Boolean + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSTimeZone", _Class::class.java) + + fun defaultTimeZone(): NSTimeZone? { + return CLASS.defaultTimeZone() + } + + fun systemTimeZone(): NSTimeZone? { + return CLASS.systemTimeZone() + } + + fun timeZoneWithName(tzName: String?): NSTimeZone? { + return CLASS.timeZoneWithName(tzName) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTitlebarAccessoryViewController.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTitlebarAccessoryViewController.kt new file mode 100644 index 00000000..22a99654 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTitlebarAccessoryViewController.kt @@ -0,0 +1,33 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSInteger + +abstract class NSTitlebarAccessoryViewController : NSResponder() { + interface _Class : ObjCClass { + open fun alloc(): NSTitlebarAccessoryViewController + } + + abstract fun init(): NSTitlebarAccessoryViewController + + abstract fun removeFromParentViewController() + + abstract fun setLayoutAttribute(layout: NSInteger?) + + abstract fun setAutomaticallyAdjustsSize(value: Boolean) + + abstract fun setView(view: NSView?) + + companion object { + private val CLASS: _Class = + org.rococoa.Rococoa.createClass("NSTitlebarAccessoryViewController", _Class::class.java) + + val NSLayoutAttributeLeft: NSInteger? = NSInteger(1) + val NSLayoutAttributeRight: NSInteger? = NSInteger(2) + val NSLayoutAttributeBottom: NSInteger? = NSInteger(4) + + fun create(): NSTitlebarAccessoryViewController? { + return CLASS.alloc().init() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTokenField.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTokenField.kt new file mode 100644 index 00000000..e287e98a --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSTokenField.kt @@ -0,0 +1,23 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSRect + +abstract class NSTokenField : NSTextField() { + interface _Class : ObjCClass { + open fun alloc(): NSTokenField + } + + @Override + abstract override fun initWithFrame(frameRect: NSRect?): NSTokenField + + abstract fun setObjectValue(value: NSObject?) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSTokenField", _Class::class.java) + + fun textfieldWithFrame(frameRect: NSRect?): NSTokenField? { + return CLASS.alloc().initWithFrame(frameRect) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSToolbar.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSToolbar.kt new file mode 100644 index 00000000..2cbe9501 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSToolbar.kt @@ -0,0 +1,236 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :17 +abstract class NSToolbar : NSObject() { + interface _Class : ObjCClass { + fun alloc(): NSToolbar + } + + interface Delegate { + fun validateToolbarItem(item: NSToolbarItem?): Boolean + + /** + * Original signature : `NSToolbarItem* toolbar(NSToolbar*, NSString*, BOOL)`

+ * *native declaration : :149* + */ + fun toolbar_itemForItemIdentifier_willBeInsertedIntoToolbar( + toolbar: NSToolbar?, + itemIdentifier: String?, + flag: Boolean + ): NSToolbarItem? + + /** + * Original signature : `NSArray* toolbarDefaultItemIdentifiers(NSToolbar*)`

+ * *native declaration : :152* + */ + fun toolbarDefaultItemIdentifiers(toolbar: NSToolbar?): NSArray? + + /** + * Original signature : `NSArray* toolbarAllowedItemIdentifiers(NSToolbar*)`

+ * *native declaration : :155* + */ + fun toolbarAllowedItemIdentifiers(toolbar: NSToolbar?): NSArray? + + /** + * Original signature : `NSArray* toolbarSelectableItemIdentifiers(NSToolbar*)`

+ * *native declaration : :159* + */ + fun toolbarSelectableItemIdentifiers(toolbar: NSToolbar?): NSArray? + } + + /** + * Original signature : `id initWithIdentifier(NSString*)`

+ * *native declaration : :68* + */ + abstract fun initWithIdentifier(identifier: String?): NSToolbar + + /** + * Original signature : `void insertItemWithItemIdentifier(NSString*, NSInteger)`

+ * *native declaration : :71* + */ + abstract fun insertItemWithItemIdentifier_atIndex(itemIdentifier: String?, index: NSInteger?) + + /** + * Original signature : `void removeItemAtIndex(NSInteger)`

+ * *native declaration : :72* + */ + abstract fun removeItemAtIndex(index: NSInteger?) + + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : :75* + */ + abstract fun setDelegate(delegate: ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :76* + */ + abstract fun delegate(): ID? + + /** + * Original signature : `BOOL isVisible()`

+ * *native declaration : :80* + */ + /** + * Original signature : `void setVisible(BOOL)`

+ * *native declaration : :79* + */ + abstract var isVisible: Boolean + + /** + * Original signature : `void runCustomizationPalette(id)`

+ * *native declaration : :83* + */ + abstract fun runCustomizationPalette(sender: ID?) + + /** + * Original signature : `BOOL customizationPaletteIsRunning()`

+ * *native declaration : :84* + */ + abstract fun customizationPaletteIsRunning(): Boolean + + /** + * Original signature : `void setDisplayMode(NSToolbarDisplayMode)`

+ * *native declaration : :90* + */ + abstract fun setDisplayMode(displayMode: NSUInteger?) + + /** + * Original signature : `NSToolbarDisplayMode displayMode()`

+ * *native declaration : :91* + */ + abstract fun displayMode(): NSUInteger? + + /** + * Original signature : `void setSelectedItemIdentifier(NSString*)`

+ * *native declaration : :94* + */ + abstract fun setSelectedItemIdentifier(itemIdentifier: String?) + + /** + * Original signature : `NSString* selectedItemIdentifier()`

+ * *native declaration : :95* + */ + abstract fun selectedItemIdentifier(): String? + + /** + * Original signature : `void setSizeMode(NSToolbarSizeMode)`

+ * *native declaration : :100* + */ + abstract fun setSizeMode(sizeMode: NSUInteger?) + + /** + * Original signature : `NSToolbarSizeMode sizeMode()`

+ * *native declaration : :101* + */ + abstract fun sizeMode(): NSUInteger? + + /** + * Use this API to hide the baseline NSToolbar draws between itself and the main window contents. The default is YES. This method should only be used before the toolbar is attached to its window (-[NSWindow setToolbar:]).

+ * Original signature : `void setShowsBaselineSeparator(BOOL)`

+ * *native declaration : :107* + */ + abstract fun setShowsBaselineSeparator(flag: Boolean) + + /** + * Original signature : `BOOL showsBaselineSeparator()`

+ * *native declaration : :108* + */ + abstract fun showsBaselineSeparator(): Boolean + + /** + * Original signature : `void setAllowsUserCustomization(BOOL)`

+ * *native declaration : :111* + */ + abstract fun setAllowsUserCustomization(allowCustomization: Boolean) + + /** + * Original signature : `BOOL allowsUserCustomization()`

+ * *native declaration : :112* + */ + abstract fun allowsUserCustomization(): Boolean + + /** + * Original signature : `NSString* identifier()`

+ * *native declaration : :118* + */ + abstract fun identifier(): String? + + /** + * Original signature : `NSArray* items()`

+ * *native declaration : :121* + */ + abstract fun items(): NSArray? + + /** + * Original signature : `NSArray* visibleItems()`

+ * *native declaration : :124* + */ + abstract fun visibleItems(): NSArray? + + /** + * Original signature : `void setAutosavesConfiguration(BOOL)`

+ * *native declaration : :130* + */ + abstract fun setAutosavesConfiguration(flag: Boolean) + + /** + * Original signature : `BOOL autosavesConfiguration()`

+ * *native declaration : :131* + */ + abstract fun autosavesConfiguration(): Boolean + + /** + * Original signature : `void setConfigurationFromDictionary(NSDictionary*)`

+ * *native declaration : :134* + */ + abstract fun setConfigurationFromDictionary(configDict: NSDictionary?) + + /** + * Original signature : `NSDictionary* configurationDictionary()`

+ * *native declaration : :135* + */ + abstract fun configurationDictionary(): NSDictionary? + + /** + * Original signature : `void validateVisibleItems()`

+ * *native declaration : :141* + */ + abstract fun validateVisibleItems() + + companion object { + private val CLASS: _Class = Rococoa.createClass("NSToolbar", _Class::class.java) + + /// native declaration : :12 + val NSToolbarDisplayModeDefault: NSUInteger = NSUInteger(0) + + /// native declaration : :12 + val NSToolbarDisplayModeIconAndLabel: NSUInteger = NSUInteger(1) + + /// native declaration : :12 + val NSToolbarDisplayModeIconOnly: NSUInteger = NSUInteger(2) + + /// native declaration : :12 + val NSToolbarDisplayModeLabelOnly: NSUInteger = NSUInteger(3) + + /// native declaration : :15 + val NSToolbarSizeModeDefault: NSUInteger = NSUInteger(0) + + /// native declaration : :15 + val NSToolbarSizeModeRegular: NSUInteger = NSUInteger(1) + + /// native declaration : :15 + val NSToolbarSizeModeSmall: NSUInteger = NSUInteger(2) + + fun toolbarWithIdentifier(identifier: String?): NSToolbar { + return CLASS.alloc().initWithIdentifier(identifier) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSToolbarItem.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSToolbarItem.kt new file mode 100644 index 00000000..d6f67087 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSToolbarItem.kt @@ -0,0 +1,245 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Selector +import org.rococoa.cocoa.foundation.NSSize + +/// native declaration : :10 +abstract class NSToolbarItem : NSObject(), NSCopying, NSValidatedUserInterfaceItem { + interface _Class : ObjCClass { + open fun alloc(): NSToolbarItem + } + + /** + * Original signature : `id initWithItemIdentifier(NSString*)`

+ * *native declaration : :62* + */ + abstract fun initWithItemIdentifier(itemIdentifier: String?): NSToolbarItem? + + /** + * Original signature : `NSString* itemIdentifier()`

+ * *native declaration : :65* + */ + abstract fun itemIdentifier(): String? + + /** + * Original signature : `NSToolbar* toolbar()`

+ * *native declaration : :66* + */ + abstract fun toolbar(): NSToolbar? + + /** + * Original signature : `void setLabel(NSString*)`

+ * *native declaration : :71* + */ + abstract fun setLabel(label: String?) + + /** + * Original signature : `NSString* label()`

+ * *native declaration : :72* + */ + abstract fun label(): String? + + /** + * Original signature : `void setPaletteLabel(NSString*)`

+ * *native declaration : :75* + */ + abstract fun setPaletteLabel(paletteLabel: String?) + + /** + * Original signature : `NSString* paletteLabel()`

+ * *native declaration : :76* + */ + abstract fun paletteLabel(): String? + + /** + * Original signature : `void setToolTip(NSString*)`

+ * *native declaration : :79* + */ + abstract fun setToolTip(toolTip: String?) + + /** + * Original signature : `NSString* toolTip()`

+ * *native declaration : :80* + */ + abstract fun toolTip(): String? + + /** + * Original signature : `void setMenuFormRepresentation(NSMenuItem*)`

+ * *native declaration : :83* + */ + abstract fun setMenuFormRepresentation(menuItem: NSMenuItem?) + + /** + * Original signature : `NSMenuItem* menuFormRepresentation()`

+ * *native declaration : :84* + */ + abstract fun menuFormRepresentation(): NSMenuItem? + + /** + * Original signature : `void setTag(NSInteger)`

+ * *native declaration : :87* + */ + abstract fun setTag(tag: Int) + + /** + * Original signature : `void setTarget(id)`

+ * *native declaration : :91* + */ + abstract fun setTarget(target: ID?) + + /** + * Original signature : `id target()`

+ * *native declaration : :92* + */ + abstract fun target(): ID? + + /** + * *native declaration : :95*

+ */ + abstract fun setAction(action: Selector?) + + /** + * Original signature : `void setEnabled(BOOL)`

+ * *native declaration : :99* + */ + abstract fun setEnabled(enabled: Boolean) + + /** + * Original signature : `BOOL isEnabled()`

+ * *native declaration : :100* + */ + abstract fun isEnabled(): Boolean + + /** + * Original signature : `void setImage(NSImage*)`

+ * *native declaration : :103* + */ + abstract fun setImage(image: NSImage?) + + /** + * Original signature : `NSImage* image()`

+ * *native declaration : :104* + */ + abstract fun image(): NSImage? + + /** + * Original signature : `void setView(NSView*)`

+ * *native declaration : :107* + */ + abstract fun setView(view: NSView?) + + /** + * Original signature : `NSView* view()`

+ * *native declaration : :108* + */ + abstract fun view(): NSView? + + /** + * *native declaration : :111*

+ */ + abstract fun setMinSize(size: NSSize?) + + /** + * *native declaration : :112*

+ */ + abstract fun minSize(): NSSize? + + /** + * *native declaration : :115*

+ */ + abstract fun setMaxSize(size: NSSize?) + + /** + * *native declaration : :116*

+ */ + abstract fun maxSize(): NSSize? + + /** + * Original signature : `void setVisibilityPriority(NSInteger)`

+ * *native declaration : :123* + */ + abstract fun setVisibilityPriority(visibilityPriority: Int) + + /** + * Original signature : `NSInteger visibilityPriority()`

+ * *native declaration : :124* + */ + abstract fun visibilityPriority(): Int + + /** + * Original signature : `void validate()`

+ * *native declaration : :131* + */ + abstract fun validate() + + /** + * Original signature : `void setAutovalidates(BOOL)`

+ * *native declaration : :136* + */ + abstract fun setAutovalidates(resistance: Boolean) + + /** + * Original signature : `BOOL autovalidates()`

+ * *native declaration : :137* + */ + abstract fun autovalidates(): Boolean + + /** + * Original signature : `BOOL allowsDuplicatesInToolbar()`

+ * *native declaration : :145* + */ + abstract fun allowsDuplicatesInToolbar(): Boolean + + /** + * The system can position navigation items outside of the normal list of items in the toolbar. You specify the + * order of the items using toolbarDefaultItemIdentifiers:. + * + * @return A Boolean value that indicates whether the item behaves as a navigation item in the toolbar. + */ + abstract fun isNavigational(): Boolean + + /** + * The system can position navigation items outside of the normal list of items in the toolbar. You specify the + * order of the items using toolbarDefaultItemIdentifiers:. + * + * @param value A Boolean value that indicates whether the item behaves as a navigation item in the toolbar. + */ + abstract fun setNavigational(value: Boolean) + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSToolbarItem", _Class::class.java) + + val NSToolbarFlexibleItemIdentifier: String? = "NSToolbarFlexibleSpaceItem" + + /** + * In macOS 10.7 and later the separator icon has been removed from the toolbar and customization palettes. This + * constant is ignored. + */ + val NSToolbarSeparatorItemIdentifier: String? = "NSToolbarSeparatorItem" + + /** + * Creates a new NSTrackingSeparatorToolbarItem and automatically configures it to track the divider of the sidebar + * if one is discovered. + */ + val NSToolbarSidebarTrackingSeparatorItemIdentifier: String? = "NSToolbarSidebarTrackingSeparatorItem" + val NSToolbarSpaceItemIdentifier: String? = "NSToolbarSpaceItem" + val NSToolbarFlexibleSpaceItemIdentifier: String? = "NSToolbarFlexibleSpaceItem" + val NSToolbarShowColorsItemIdentifier: String? = "NSToolbarShowColorsItem" + val NSToolbarShowFontsItemIdentifier: String? = "NSToolbarShowFontsItem" + val NSToolbarCustomizeToolbarItemIdentifier: String? = "NSToolbarCustomizeToolbarItem" + val NSToolbarPrintItemIdentifier: String? = "NSToolbarPrintItem" + val NSToolbarToggleSidebarItemIdentifier: String? = "NSToolbarToggleSidebarItem" + val NSToolbarCloudSharingItemIdentifier: String? = "NSToolbarCloudSharingItem" + + const val VisibilityPriorityStandard: Int = 0 + const val VisibilityPriorityLow: Int = -1000 + const val VisibilityPriorityHigh: Int = 1000 + const val VisibilityPriorityUser: Int = 2000 + + fun itemWithIdentifier(itemIdentifier: String?): NSToolbarItem? { + return CLASS.alloc().initWithItemIdentifier(itemIdentifier) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSURL.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSURL.kt new file mode 100644 index 00000000..e2523d54 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSURL.kt @@ -0,0 +1,360 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.ObjCObjectByReference + +/// native declaration : :15 +abstract class NSURL : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `fileURLWithPath(NSString*, BOOL)`

+ * *native declaration : :28* + */ + fun fileURLWithPath_isDirectory(path: String?, isDir: Boolean): NSURL? + + /** + * Original signature : `fileURLWithPath(String*)`

Better to use fileURLWithPath:isDirectory: if + * you know if the path is a file vs directory, as it saves an i/o.

+ * *native declaration : :29* + */ + fun fileURLWithPath(path: String?): NSURL + + /** + * Original signature : `URLWithString(String*)`

+ * *native declaration : :34* + */ + fun URLWithString(URLString: String?): NSURL + + /** + * Original signature : `URLWithString(String*, NSURL*)`

+ * *native declaration : :35* + */ + fun URLWithString_relativeToURL(URLString: String?, baseURL: NSURL?): NSURL? + + /** + * Returns a new URL made by resolving bookmark data. + * + * @param bookmarkData The bookmark data the URL is derived from. + * @param options Options taken into account when resolving the bookmark data. To resolve a security-scoped + * bookmark to support App Sandbox, you must include (by way of bitwise OR operators with + * any other options in this parameter) the NSURLBookmarkResolutionWithSecurityScope + * option. + * @param relativeURL The base URL that the bookmark data is relative to. To resolve an app-scoped bookmark, + * use a value of nil. To resolve a document-scoped bookmark, use the absolute path (despite + * this parameter’s name) to the document from which you retrieved the bookmark. + * @param isStale On return, if YES, the bookmark data is stale. Your app should create a new bookmark + * using the returned URL and use it in place of any stored copies of the existing + * bookmark. + * @param error The error that occurred in the case that the URL cannot be created. + * @return A new URL made by resolving bookmarkData. + */ + fun URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error( + bookmarkData: NSData?, options: Int, relativeURL: NSURL?, isStale: Boolean, error: ObjCObjectByReference? + ): NSURL + } + + /** + * Convenience initializers

Original signature : `initWithScheme(String*, String*, String*)`

+ * *native declaration : :24* + */ + abstract fun initWithScheme_host_path(scheme: String?, host: String?, path: String?): NSURL? + + /** + * Original signature : `initFileURLWithPath(String*, BOOL)`

+ * *native declaration : :25* + */ + abstract fun initFileURLWithPath_isDirectory(path: String?, isDir: Boolean): NSURL? + + /** + * Original signature : `initFileURLWithPath(String*)`

Better to use initFileURLWithPath:isDirectory: + * if you know if the path is a file vs directory, as it saves an i/o.

+ * *native declaration : :26* + */ + abstract fun initFileURLWithPath(path: String?): NSURL? + + /** + * These methods expect their string arguments to contain any percent escape codes that are necessary

Original + * signature : `initWithString(String*)`

+ * *native declaration : :32* + */ + abstract fun initWithString(URLString: String?): NSURL? + + /** + * Original signature : `initWithString(String*, NSURL*)`

It is an error for URLString to be nil

+ * *native declaration : :33* + */ + abstract fun initWithString_relativeToURL(URLString: String?, baseURL: NSURL?): NSURL? + + /** + * Original signature : `String* absoluteString()`

+ * *native declaration : :37* + */ + abstract fun absoluteString(): String? + + /** + * Original signature : `String* relativeString()`

The relative portion of a URL. If baseURL is nil, + * or if the receiver is itself absolute, this is the same as absoluteString

+ * *native declaration : :38* + */ + abstract fun relativeString(): String? + + /** + * Original signature : `NSURL* baseURL()`

may be nil.

+ * *native declaration : :39* + */ + abstract fun baseURL(): NSURL? + + /** + * Original signature : `NSURL* absoluteURL()`

if the receiver is itself absolute, this will return + * self.

+ * *native declaration : :40* + */ + abstract fun absoluteURL(): NSURL? + + /** + * Any URL is composed of these two basic pieces. The full URL would be the concatenation of [myURL scheme], ':', + * [myURL resourceSpecifier]

Original signature : `String* scheme()`

+ * *native declaration : :43* + */ + abstract fun scheme(): String? + + /** + * Original signature : `String* resourceSpecifier()`

+ * *native declaration : :44* + */ + abstract fun resourceSpecifier(): String? + + /** + * If the URL conforms to rfc 1808 (the most common form of URL), the following accessors will return the various + * components; otherwise they return nil. The litmus test for conformance is as recommended in RFC 1808 - whether + * the first two characters of resourceSpecifier is @"//". In all cases, they return the component's value after + * resolving the receiver against its base URL.

Original signature : `String* host()`

+ * *native declaration : :47* + */ + abstract fun host(): String? + + /** + * Original signature : `NSNumber* port()`

+ * *native declaration : :48* + */ + abstract fun port(): NSNumber? + + /** + * Original signature : `String* user()`

+ * *native declaration : :49* + */ + abstract fun user(): String? + + /** + * Original signature : `String* password()`

+ * *native declaration : :50* + */ + abstract fun password(): String? + + /** + * Original signature : `String* path()`

+ * *native declaration : :51* + */ + abstract fun path(): String? + + /** + * Original signature : `String* fragment()`

+ * *native declaration : :52* + */ + abstract fun fragment(): String? + + /** + * Original signature : `String* parameterString()`

+ * *native declaration : :53* + */ + abstract fun parameterString(): String? + + /** + * Original signature : `String* query()`

+ * *native declaration : :54* + */ + abstract fun query(): String? + + /** + * Original signature : `String* relativePath()`

The same as path if baseURL is nil

+ * *native declaration : :55* + */ + abstract fun relativePath(): String? + + /** + * Original signature : `BOOL isFileURL()`

Whether the scheme is file:; if [myURL isFileURL] is YES, + * then [myURL path] is suitable for input into NSFileManager or NSPathUtilities.

+ * *native declaration : :57* + */ + abstract val isFileURL: Boolean + + /** + * Original signature : `NSURL* standardizedURL()`

+ * *native declaration : :59* + */ + abstract fun standardizedURL(): NSURL? + + /** + * File reference URLs use a URL path syntax that identifies a file system object by reference, not by path. This + * form of file URL remains valid when the file system path of the URL’s underlying resource changes. + * + * + * If the original URL is a file path URL, this method converts it to a file reference URL. If the original URL is a + * file reference URL, the returned URL is identical. If the original URL is not a file URL, this method returns + * nil. + * + * + * File reference URLs cannot be created to file system objects which do not exist or are not reachable. + * + * + * In some areas of the file system hierarchy, file reference URLs cannot be generated to the leaf node of the URL + * path. + * + * @return Returns a new file reference URL that points to the same resource as the original URL. + */ + abstract fun fileReferenceURL(): NSURL? + + /** + * @return Returns whether the URL is a file reference URL. + */ + abstract val isFileReferenceURL: Boolean + + /** + * Original signature : `NSData* resourceDataUsingCache(BOOL)`

Blocks to load the data if necessary. + * If shouldUseCache is YES, then if an equivalent URL has already been loaded and cached, its resource data will be + * returned immediately. If shouldUseCache is NO, a new load will be started

+ * *from NSURLLoading native declaration : :84* + */ + abstract fun resourceDataUsingCache(shouldUseCache: Boolean): NSData? + /** + * *from NSURLLoading native declaration : :85*

+ * Conversion Error : /// Original signature : `void loadResourceDataNotifyingClient(null, BOOL)`

+ * - (void)loadResourceDataNotifyingClient:(null)client usingCache:(BOOL)shouldUseCache; // Starts an asynchronous load of the data, registering delegate to receive notification. Only one such background load can proceed at a time.

+ * (Argument client cannot be converted) + */ + /** + * Original signature : `propertyForKey(String*)`

+ * *from NSURLLoading native declaration : :86* + */ + abstract fun propertyForKey(propertyKey: String?): NSObject? + + /** + * These attempt to write the given arguments for the resource specified by the URL; they return success or + * failure

Original signature : `BOOL setResourceData(NSData*)`

+ * *from NSURLLoading native declaration : :89* + */ + abstract fun setResourceData(data: NSData?): Boolean + + /** + * In an app that has adopted App Sandbox, makes the resource pointed to by a security-scoped URL available to the + * app. + * + * @return YES if the request to access the resource succeeded; otherwise, NO. + */ + abstract fun startAccessingSecurityScopedResource(): Boolean + + /** + * In an app that adopts App Sandbox, revokes access to the resource pointed to by a security-scoped URL. + */ + abstract fun stopAccessingSecurityScopedResource() + + /** + * This method returns bookmark data that can later be resolved into a URL object for a file even if the user moves + * or renames it (if the volume format on which the file resides supports doing so). + * + * @param options Options taken into account when creating the bookmark for the URL. To create a security-scoped + * bookmark to support App Sandbox, include the NSURLBookmarkCreationWithSecurityScope flag. + * @param keys An array of names of URL resource properties. + * @param relativeURL The URL that the bookmark data will be relative to. To create an app-scoped bookmark, use a + * value of nil. To create a document-scoped bookmark, use the absolute path (despite this + * parameter’s name) to the document file that is to own the new security-scoped bookmark. + * @param error The error that occurred in the case that the bookmark data cannot be created. + * @return Returns a bookmark for the URL, created with specified options and resource values + */ + abstract fun bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error( + options: Int, keys: NSArray?, relativeURL: NSURL?, error: ObjCObjectByReference? + ): NSData? + + interface NSURLBookmarkCreationOptions { + companion object { + /** + * Specifies that the bookmark data should include properties required to create Finder alias files + */ + const val NSURLBookmarkCreationSuitableForBookmarkFile: Int = (1 shl 10) + + /** + * Specifies that you want to create a security-scoped bookmark that, when resolved, provides a security-scoped + * URL allowing read/write access to a file-system resource; for use in an app that adopts App Sandbox. For more + * information, see App Sandbox Design Guide. Note that this flag cannot be used in conjunction with either + * NSURLBookmarkCreationMinimalBookmark or NSURLBookmarkCreationSuitableForBookmarkFile. + * + * + * Available in OS X v10.7 and later. + */ + const val NSURLBookmarkCreationWithSecurityScope: Int = (1 shl 11) + + /** + * When combined with the NSURLBookmarkCreationWithSecurityScope option, specifies that you want to create a + * security-scoped bookmark that, when resolved, provides a security-scoped URL allowing read-only access to a + * file-system resource; for use in an app that adopts App Sandbox. For more information, see App Sandbox Design + * Guide. + * + * + * Available in OS X v10.7 and later. + */ + const val NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess: Int = (1 shl 12) + } + } + + interface NSURLBookmarkResolutionOptions { + companion object { + /** + * Specifies that the security scope, applied to the bookmark when it was created, should be used during + * resolution of the bookmark data. Available in OS X v10.7 and later. + */ + const val NSURLBookmarkResolutionWithSecurityScope: Int = (1 shl 10) + } + } + + /** + * This method first checks if the URL object already caches the specified resource values. If so, it returns the + * cached resource values to the caller. If not, then this method synchronously obtains the resource values from the + * backing store, adds the resource values to the URL object's cache, and returns the resource values to the + * caller. + * + * + * The type of the returned resource value varies by resource property; for details, see the documentation for the + * key you want to access. + * + * + * If the result dictionary does not contain a resource value for one or more of the requested resource keys, it + * means those resource properties are not available for the URL, and no errors occurred when determining those + * resource properties were not available. + * + * @param keys An array of property keys for the desired resource properties. + * @param error The error that occurred if one or more resource values could not be retrieved. This parameter is + * optional. If you are not interested in receiving error information, you can pass nil. + * @return If an error occurs, this method returns nil and populates the object pointer referenced by error with + * additional information. + */ + abstract fun resourceValuesForKeys_error(keys: NSArray?, error: ObjCObjectByReference?): NSDictionary? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSURL", _Class::class.java) + + fun URLWithString(URLString: String?): NSURL { + return CLASS.URLWithString(URLString) + } + + fun fileURLWithPath(URLString: String?): NSURL { + return CLASS.fileURLWithPath(URLString) + } + + fun URLByResolvingBookmarkData(bookmark: NSData?, options: Int, error: ObjCObjectByReference?): NSURL { + return CLASS.URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error( + bookmark, + options, null, false, error + ) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserDefaults.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserDefaults.kt new file mode 100644 index 00000000..d925efed --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserDefaults.kt @@ -0,0 +1,246 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSInteger + +/// native declaration : :14 +abstract class NSUserDefaults : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `NSUserDefaults* standardUserDefaults()`

+ * *native declaration : :20* + */ + open fun standardUserDefaults(): NSUserDefaults? + + /** + * Original signature : `void resetStandardUserDefaults()`

+ * *native declaration : :21* + */ + open fun resetStandardUserDefaults() + + open fun alloc(): NSUserDefaults + } + + /** + * Original signature : `id init()`

+ * *native declaration : :23* + */ + abstract fun init(): NSUserDefaults? + + /** + * Original signature : `id initWithUser(NSString*)`

+ * *native declaration : :24* + */ + abstract fun initWithUser(username: String?): NSUserDefaults? + + /** + * Returns an NSUserDefaults object initialized with the defaults for the specified app group. + */ + abstract fun initWithSuiteName(group: String?): NSUserDefaults? + + /** + * Original signature : `id objectForKey(NSString*)`

+ * *native declaration : :26* + */ + abstract fun objectForKey(defaultName: String?): NSObject? + + fun setObjectForKey(value: NSObject?, defaultName: String?) { + this.setObject_forKey(value, defaultName) + } + + /** + * Original signature : `void setObject(id, NSString*)`

+ * *native declaration : :27* + */ + abstract fun setObject_forKey(value: NSObject?, defaultName: String?) + + /** + * Original signature : `void removeObjectForKey(NSString*)`

+ * *native declaration : :28* + */ + abstract fun removeObjectForKey(defaultName: String?) + + /** + * Original signature : `NSString* stringForKey(NSString*)`

+ * *native declaration : :30* + */ + abstract fun stringForKey(defaultName: String?): String? + + /** + * Original signature : `NSArray* arrayForKey(NSString*)`

+ * *native declaration : :31* + */ + abstract fun arrayForKey(defaultName: String?): NSArray? + + /** + * Original signature : `NSDictionary* dictionaryForKey(NSString*)`

+ * *native declaration : :32* + */ + abstract fun dictionaryForKey(defaultName: String?): NSDictionary? + + /** + * Original signature : `NSData* dataForKey(NSString*)`

+ * *native declaration : :33* + */ + abstract fun dataForKey(defaultName: String?): NSData? + + /** + * Original signature : `NSArray* stringArrayForKey(NSString*)`

+ * *native declaration : :34* + */ + abstract fun stringArrayForKey(defaultName: String?): NSArray? + + /** + * Original signature : `NSInteger integerForKey(NSString*)`

+ * *native declaration : :35* + */ + abstract fun integerForKey(defaultName: String?): NSInteger? + + /** + * Original signature : `float floatForKey(NSString*)`

+ * *native declaration : :36* + */ + abstract fun floatForKey(defaultName: String?): Float + + /** + * Original signature : `double doubleForKey(NSString*)`

+ * *native declaration : :37* + */ + abstract fun doubleForKey(defaultName: String?): Double + + /** + * Original signature : `BOOL boolForKey(NSString*)`

+ * *native declaration : :38* + */ + abstract fun boolForKey(defaultName: String?): Boolean + + /** + * Original signature : `void setInteger(NSInteger, NSString*)`

+ * *native declaration : :40* + */ + abstract fun setInteger_forKey(value: NSInteger?, defaultName: String?) + + /** + * Original signature : `void setFloat(float, NSString*)`

+ * *native declaration : :41* + */ + abstract fun setFloat_forKey(value: Float, defaultName: String?) + + /** + * Original signature : `void setDouble(double, NSString*)`

+ * *native declaration : :42* + */ + abstract fun setDouble_forKey(value: Double, defaultName: String?) + + /** + * Original signature : `void setBool(BOOL, NSString*)`

+ * *native declaration : :43* + */ + abstract fun setBool_forKey(value: Boolean, defaultName: String?) + + /** + * Original signature : `void registerDefaults(NSDictionary*)`

+ * *native declaration : :45* + */ + abstract fun registerDefaults(registrationDictionary: NSDictionary?) + + /** + * Original signature : `void addSuiteNamed(NSString*)`

+ * *native declaration : :47* + */ + abstract fun addSuiteNamed(suiteName: String?) + + /** + * Original signature : `void removeSuiteNamed(NSString*)`

+ * *native declaration : :48* + */ + abstract fun removeSuiteNamed(suiteName: String?) + + /** + * Original signature : `NSDictionary* dictionaryRepresentation()`

+ * *native declaration : :50* + */ + abstract fun dictionaryRepresentation(): NSDictionary? + + /** + * Original signature : `NSArray* volatileDomainNames()`

+ * *native declaration : :52* + */ + abstract fun volatileDomainNames(): NSArray? + + /** + * Original signature : `NSDictionary* volatileDomainForName(NSString*)`

+ * *native declaration : :53* + */ + abstract fun volatileDomainForName(domainName: String?): NSDictionary? + + /** + * Original signature : `void setVolatileDomain(NSDictionary*, NSString*)`

+ * *native declaration : :54* + */ + abstract fun setVolatileDomain_forName(domain: NSDictionary?, domainName: String?) + + /** + * Original signature : `void removeVolatileDomainForName(NSString*)`

+ * *native declaration : :55* + */ + abstract fun removeVolatileDomainForName(domainName: String?) + + /** + * Original signature : `NSArray* persistentDomainNames()`

+ * *native declaration : :57* + */ + abstract fun persistentDomainNames(): NSArray? + + /** + * Original signature : `NSDictionary* persistentDomainForName(NSString*)`

+ * *native declaration : :58* + */ + abstract fun persistentDomainForName(domainName: String?): NSDictionary? + + /** + * Original signature : `void setPersistentDomain(NSDictionary*, NSString*)`

+ * *native declaration : :59* + */ + abstract fun setPersistentDomain_forName(domain: NSDictionary?, domainName: String?) + + /** + * Original signature : `void removePersistentDomainForName(NSString*)`

+ * *native declaration : :60* + */ + abstract fun removePersistentDomainForName(domainName: String?) + + /** + * Original signature : `BOOL synchronize()`

+ * *native declaration : :62* + */ + abstract fun synchronize(): Boolean + + /** + * Original signature : `BOOL objectIsForcedForKey(NSString*)`

+ * *native declaration : :65* + */ + abstract fun objectIsForcedForKey(key: String?): Boolean + + /** + * Original signature : `BOOL objectIsForcedForKey(NSString*, NSString*)`

+ * *native declaration : :66* + */ + abstract fun objectIsForcedForKey_inDomain(key: String?, domain: String?): Boolean + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSUserDefaults", _Class::class.java) + + fun standardUserDefaults(): NSUserDefaults? { + return CLASS.standardUserDefaults() + } + + fun sharedUserDefaults(group: String?): NSUserDefaults? { + return CLASS.alloc().initWithSuiteName(group) + } + + fun resetStandardUserDefaults() { + CLASS.resetStandardUserDefaults() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserInterfaceValidations.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserInterfaceValidations.kt new file mode 100644 index 00000000..97d5e279 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserInterfaceValidations.kt @@ -0,0 +1,5 @@ +package darwin + +interface NSUserInterfaceValidations { + open fun validateUserInterfaceItem(item: NSValidatedUserInterfaceItem?): Boolean +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserNotification.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserNotification.kt new file mode 100644 index 00000000..11b85857 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserNotification.kt @@ -0,0 +1,78 @@ +package darwin + +import org.rococoa.ObjCClass + +abstract class NSUserNotification : NSObject() { + interface _Class : ObjCClass { + open fun alloc(): NSUserNotification + } + + abstract fun init(): NSUserNotification? + + abstract fun getTitle(): String? + + abstract fun setTitle(title: String?) + + abstract fun getSubtitle(): String? + + abstract fun setSubtitle(subtitle: String?) + + abstract fun getInformativeText(): String? + + abstract fun setInformativeText(informativeText: String?) + + /** + * Available in OS X v10.9 and later. + */ + abstract fun getContentImage(): NSImage? + + /** + * Available in OS X v10.9 and later. + */ + abstract fun setContentImage(contentImage: NSImage?) + + /** + * Available in OS X v10.9 and later. + */ + abstract fun identifier(): String? + + /** + * This identifier is unique to a notification. A notification delivered with the same identifier + * as an existing notification will replace that notification, rather then display a new one. + * + * + * Available in OS X v10.9 and later. + */ + abstract fun setIdentifier(identifier: String?) + + /** + * Application-specific user info that can be attached to the notification. + */ + abstract fun setUserInfo(userInfo: NSDictionary?) + + abstract fun userInfo(): NSDictionary? + + abstract fun setHasActionButton(flag: Boolean) + + abstract fun setActionButtonTitle(title: String?) + + abstract fun setOtherButtonTitle(title: String?) + + abstract fun activationType(): Int + + enum class ActivationType { + NSUserNotificationActivationTypeNone, + NSUserNotificationActivationTypeContentsClicked, + NSUserNotificationActivationTypeActionButtonClicked, + NSUserNotificationActivationTypeReplied, + NSUserNotificationActivationTypeAdditionalActionClicked + } + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSUserNotification", _Class::class.java) + + fun notification(): NSUserNotification? { + return CLASS.alloc().init() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserNotificationCenter.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserNotificationCenter.kt new file mode 100644 index 00000000..eb186e06 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSUserNotificationCenter.kt @@ -0,0 +1,51 @@ +package darwin + +import org.rococoa.ID +import org.rococoa.ObjCClass + +abstract class NSUserNotificationCenter : NSObject() { + interface _Class : ObjCClass { + /** + * Get a singleton user notification center that posts notifications for this process.

Original signature : + * `+(NSUserNotificationCenter*)defaultUserNotificationCenter`

+ * *native declaration : line 8* + */ + open fun defaultUserNotificationCenter(): NSUserNotificationCenter? + } + + // Add a notification to the center for scheduling. + abstract fun scheduleNotification(notification: NSUserNotification?) + + // Cancels a notification. If the deliveryDate occurs before the cancellation finishes, the notification + // may still be delivered. If the notification is not in the scheduled list, nothing happens. + abstract fun removeScheduledNotification(notification: NSUserNotification?) + + abstract fun removeAllDeliveredNotifications() + + abstract fun setDelegate(delegate: ID?) + + interface Delegate { + open fun userNotificationCenter_didActivateNotification( + center: NSUserNotificationCenter?, + notification: NSUserNotification? + ) + + open fun userNotificationCenter_shouldPresentNotification( + center: NSUserNotificationCenter?, + notification: NSUserNotification? + ): Boolean + } + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSUserNotificationCenter", _Class::class.java) + + /** + * Get a singleton user notification center that posts notifications for this process.

Original signature : + * `+(NSUserNotificationCenter*)defaultUserNotificationCenter`

+ * *native declaration : line 8* + */ + fun defaultUserNotificationCenter(): NSUserNotificationCenter? { + return CLASS.defaultUserNotificationCenter() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSValidatedUserInterfaceItem.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSValidatedUserInterfaceItem.kt new file mode 100644 index 00000000..c1edb7c5 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSValidatedUserInterfaceItem.kt @@ -0,0 +1,18 @@ +package darwin + +import org.rococoa.Selector + +/// native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSUserInterfaceValidation.h:69 +interface NSValidatedUserInterfaceItem { + /** + * Original signature : `action()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSUserInterfaceValidation.h:70* + */ + open fun action(): Selector? + + /** + * Original signature : `NSInteger tag()`

+ * *native declaration : /System/Library/Frameworks/AppKit.framework/Headers/NSUserInterfaceValidation.h:71* + */ + open fun tag(): Int +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSValue.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSValue.kt new file mode 100644 index 00000000..d5534241 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSValue.kt @@ -0,0 +1,25 @@ +package darwin + +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSSize + +/// native declaration : /Users/dkocher/null:10 +abstract class NSValue : NSObject() { + interface _Class : ObjCClass { + open fun valueWithSize(size: NSSize?): NSValue? + } + + /** + * Original signature : `BOOL isEqualToValue(NSValue*)`

+ * *from NSValueExtensionMethods native declaration : /Users/dkocher/null:33* + */ + abstract fun isEqualToValue(value: NSValue?): Byte + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSValue", _Class::class.java) + + fun valueWithSize(size: NSSize?): NSValue? { + return CLASS.valueWithSize(size) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSView.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSView.kt new file mode 100644 index 00000000..917ee06a --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSView.kt @@ -0,0 +1,1154 @@ +package darwin + +import com.sun.jna.Pointer +import com.sun.jna.ptr.PointerByReference +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.NSPoint +import org.rococoa.cocoa.foundation.NSRect +import org.rococoa.cocoa.foundation.NSSize +import org.rococoa.cocoa.foundation.NSUInteger +import java.nio.FloatBuffer +import java.nio.IntBuffer + +abstract class NSView : NSResponder() { + enum class NSFocusRingType { + NSFocusRingTypeDefault, + NSFocusRingTypeNone, + NSFocusRingTypeExterior + } + + interface _Class : ObjCClass { + fun alloc(): NSView + + /** + * Original signature : `NSView* focusView()`

+ * *native declaration : :213* + */ + fun focusView(): NSView? + + /** + * Original signature : `NSMenu* defaultMenu()`

+ * *native declaration : :311* + */ + fun defaultMenu(): NSMenu? + + /** + * Original signature : `defaultFocusRingType()`

+ * *from NSKeyboardUI native declaration : :357* + */ + fun defaultFocusRingType(): NSObject? + } + + abstract fun init(): NSView + + abstract fun initWithFrame(frameRect: NSRect?): NSView + + /** + * *native declaration : :115*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `NSWindow* window()`

+ * *native declaration : :117* + */ + abstract fun window(): NSWindow? + + /** + * Original signature : `NSView* superview()`

+ * *native declaration : :118* + */ + abstract fun superview(): NSView? + + /** + * Original signature : `NSArray* subviews()`

+ * *native declaration : :119* + */ + abstract fun subviews(): NSArray? + + /** + * Original signature : `BOOL isDescendantOf(NSView*)`

+ * *native declaration : :120* + */ + abstract fun isDescendantOf(aView: NSView?): Boolean + + /** + * Original signature : `NSView* ancestorSharedWithView(NSView*)`

+ * *native declaration : :121* + */ + abstract fun ancestorSharedWithView(aView: NSView?): NSView? + + /** + * Original signature : `NSView* opaqueAncestor()`

+ * *native declaration : :122* + */ + abstract fun opaqueAncestor(): NSView? + + /** + * Original signature : `BOOL isHidden()`

+ * *native declaration : :125* + */ + /** + * Original signature : `void setHidden(BOOL)`

+ * *native declaration : :124* + */ + abstract var isHidden: Boolean + + /** + * Original signature : `BOOL isHiddenOrHasHiddenAncestor()`

+ * *native declaration : :126* + */ + abstract val isHiddenOrHasHiddenAncestor: Boolean + + /** + * Original signature : `void getRectsBeingDrawn(const NSRect**, NSInteger*)`

+ * *native declaration : :128* + */ + abstract fun getRectsBeingDrawn_count(rects: PointerByReference?, count: IntBuffer?) + /** + * *native declaration : :129*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `BOOL wantsDefaultClipping()`

+ * *native declaration : :130* + */ + abstract fun wantsDefaultClipping(): Boolean + + /** + * Original signature : `void viewDidHide()`

+ * *native declaration : :133* + */ + abstract fun viewDidHide() + + /** + * Original signature : `void viewDidUnhide()`

+ * *native declaration : :134* + */ + abstract fun viewDidUnhide() + + /** + * Original signature : `void setSubviews(NSArray*)`

+ * *native declaration : :136* + */ + abstract fun setSubviews(newSubviews: NSArray?) + + /** + * Original signature : `void addSubview(NSView*)`

+ * *native declaration : :138* + */ + abstract fun addSubview(aView: NSView?) + + /** + * *native declaration : :139*

+ * Conversion Error : /// Original signature : `void addSubview(NSView*, null, NSView*)`

+ * - (void)addSubview:(NSView*)aView positioned:(null)place relativeTo:(NSView*)otherView; (Argument place cannot be converted) + */ + abstract fun addSubview_positioned_relativeTo(aView: NSView?, place: Int, otherView: NSView?) + + /** + * Original signature : `void viewWillMoveToWindow(NSWindow*)`

+ * *native declaration : :141* + */ + abstract fun viewWillMoveToWindow(newWindow: NSWindow?) + + /** + * Original signature : `void viewDidMoveToWindow()`

+ * *native declaration : :142* + */ + abstract fun viewDidMoveToWindow() + + /** + * Original signature : `void viewWillMoveToSuperview(NSView*)`

+ * *native declaration : :143* + */ + abstract fun viewWillMoveToSuperview(newSuperview: NSView?) + + /** + * Original signature : `void viewDidMoveToSuperview()`

+ * *native declaration : :144* + */ + abstract fun viewDidMoveToSuperview() + + /** + * Original signature : `void didAddSubview(NSView*)`

+ * *native declaration : :145* + */ + abstract fun didAddSubview(subview: NSView?) + + /** + * Original signature : `void willRemoveSubview(NSView*)`

+ * *native declaration : :146* + */ + abstract fun willRemoveSubview(subview: NSView?) + + /** + * Original signature : `void removeFromSuperview()`

+ * *native declaration : :147* + */ + abstract fun removeFromSuperview() + + /** + * Original signature : `void replaceSubview(NSView*, NSView*)`

+ * *native declaration : :148* + */ + abstract fun replaceSubview_with(oldView: NSView?, newView: NSView?) + + /** + * Original signature : `void removeFromSuperviewWithoutNeedingDisplay()`

+ * *native declaration : :149* + */ + abstract fun removeFromSuperviewWithoutNeedingDisplay() + + /** + * Original signature : `void setPostsFrameChangedNotifications(BOOL)`

+ * *native declaration : :151* + */ + abstract fun setPostsFrameChangedNotifications(flag: Boolean) + + /** + * Original signature : `BOOL postsFrameChangedNotifications()`

+ * *native declaration : :152* + */ + abstract fun postsFrameChangedNotifications(): Boolean + /** + * *native declaration : :153*

+ * Conversion Error : /// Original signature : `void resizeSubviewsWithOldSize(null)`

+ * - (void)resizeSubviewsWithOldSize:(null)oldSize; (Argument oldSize cannot be converted) + */ + /** + * *native declaration : :154*

+ * Conversion Error : /// Original signature : `void resizeWithOldSuperviewSize(null)`

+ * - (void)resizeWithOldSuperviewSize:(null)oldSize; (Argument oldSize cannot be converted) + */ + /** + * Original signature : `void setAutoresizesSubviews(BOOL)`

+ * *native declaration : :155* + */ + abstract fun setAutoresizesSubviews(flag: Boolean) + + /** + * Original signature : `BOOL autoresizesSubviews()`

+ * *native declaration : :156* + */ + abstract fun autoresizesSubviews(): Boolean + + /** + * Original signature : `void setAutoresizingMask(NSUInteger)`

+ * *native declaration : :157* + */ + abstract fun setAutoresizingMask(mask: NSUInteger?) + + /** + * Original signature : `NSUInteger autoresizingMask()`

+ * *native declaration : :158* + */ + abstract fun autoresizingMask(): NSUInteger? + + /** + * *native declaration : :160*

+ * Conversion Error : /// Original signature : `void setFrameOrigin(null)`

+ * - (void)setFrameOrigin:(null)newOrigin; (Argument newOrigin cannot be converted) + */ + abstract fun setFrameOrigin(origin: NSPoint?) + + /** + * *native declaration : :161*

+ * Conversion Error : /// Original signature : `void setFrameSize(null)`

+ * - (void)setFrameSize:(null)newSize; (Argument newSize cannot be converted) + */ + abstract fun setFrameSize(size: NSSize?) + + /** + * *native declaration : :162*

+ * Conversion Error : NSRect + */ + abstract fun setFrame(frame: NSRect?) + + /** + * *native declaration : :163*

+ * Conversion Error : NSRect + */ + abstract fun frame(): NSRect? + + /** + * Original signature : `void setFrameRotation(CGFloat)`

+ * *native declaration : :164* + */ + abstract fun setFrameRotation(angle: CGFloat?) + + /** + * Original signature : `CGFloat frameRotation()`

+ * *native declaration : :165* + */ + abstract fun frameRotation(): CGFloat? + + /** + * Original signature : `void setFrameCenterRotation(CGFloat)`

+ * *native declaration : :167* + */ + abstract fun setFrameCenterRotation(angle: CGFloat?) + + /** + * Original signature : `CGFloat frameCenterRotation()`

+ * *native declaration : :168* + */ + abstract fun frameCenterRotation(): CGFloat? + /** + * *native declaration : :171*

+ * Conversion Error : /// Original signature : `void setBoundsOrigin(null)`

+ * - (void)setBoundsOrigin:(null)newOrigin; (Argument newOrigin cannot be converted) + */ + /** + * *native declaration : :172*

+ * Conversion Error : /// Original signature : `void setBoundsSize(null)`

+ * - (void)setBoundsSize:(null)newSize; (Argument newSize cannot be converted) + */ + /** + * Original signature : `void setBoundsRotation(CGFloat)`

+ * *native declaration : :173* + */ + abstract fun setBoundsRotation(angle: CGFloat?) + + /** + * Original signature : `CGFloat boundsRotation()`

+ * *native declaration : :174* + */ + abstract fun boundsRotation(): CGFloat? + /** + * *native declaration : :175*

+ * Conversion Error : /// Original signature : `void translateOriginToPoint(null)`

+ * - (void)translateOriginToPoint:(null)translation; (Argument translation cannot be converted) + */ + /** + * *native declaration : :176*

+ * Conversion Error : /// Original signature : `void scaleUnitSquareToSize(null)`

+ * - (void)scaleUnitSquareToSize:(null)newUnitSize; (Argument newUnitSize cannot be converted) + */ + /** + * Original signature : `void rotateByAngle(CGFloat)`

+ * *native declaration : :177* + */ + abstract fun rotateByAngle(angle: CGFloat?) + /** + * *native declaration : :178*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :179*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `BOOL isFlipped()`

+ * *native declaration : :181* + */ + abstract val isFlipped: Boolean + + /** + * Original signature : `BOOL isRotatedFromBase()`

+ * *native declaration : :182* + */ + abstract val isRotatedFromBase: Boolean + + /** + * Original signature : `BOOL isRotatedOrScaledFromBase()`

+ * *native declaration : :183* + */ + abstract val isRotatedOrScaledFromBase: Boolean + + /** + * Original signature : `BOOL isOpaque()`

+ * *native declaration : :184* + */ + abstract val isOpaque: Boolean + + /** + * *native declaration : :186*

+ * Conversion Error : /// Original signature : `convertPoint(null, NSView*)`

+ * - (null)convertPoint:(null)aPoint fromView:(NSView*)aView; (Argument aPoint cannot be converted) + */ + abstract fun convertPoint_fromView(aPoint: NSPoint?, aView: NSView?): NSPoint? + + /** + * *native declaration : :187*

+ * Conversion Error : /// Original signature : `convertPoint(null, NSView*)`

+ * - (null)convertPoint:(null)aPoint toView:(NSView*)aView; (Argument aPoint cannot be converted) + */ + abstract fun convertPoint_toView(aPoint: NSPoint?, aView: NSView?): NSPoint? + /** + * *native declaration : :188*

+ * Conversion Error : /// Original signature : `convertSize(null, NSView*)`

+ * - (null)convertSize:(null)aSize fromView:(NSView*)aView; (Argument aSize cannot be converted) + */ + /** + * *native declaration : :189*

+ * Conversion Error : /// Original signature : `convertSize(null, NSView*)`

+ * - (null)convertSize:(null)aSize toView:(NSView*)aView; (Argument aSize cannot be converted) + */ + /** + * *native declaration : :190*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :191*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :192*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :195*

+ * Conversion Error : /// Original signature : `convertPointToBase(null)`

+ * - (null)convertPointToBase:(null)aPoint; (Argument aPoint cannot be converted) + */ + abstract fun convertPointToBase(aPoint: NSPoint?): NSPoint? + + /** + * *native declaration : :196*

+ * Conversion Error : /// Original signature : `convertPointFromBase(null)`

+ * - (null)convertPointFromBase:(null)aPoint; (Argument aPoint cannot be converted) + */ + abstract fun convertPointFromBase(aPoint: NSPoint?): NSPoint? + + /** + * *native declaration : :197*

+ * Conversion Error : /// Original signature : `convertSizeToBase(null)`

+ * - (null)convertSizeToBase:(null)aSize; (Argument aSize cannot be converted) + */ + abstract fun convertSizeToBase(aSize: NSSize?): NSSize? + + /** + * *native declaration : :198*

+ * Conversion Error : /// Original signature : `convertSizeFromBase(null)`

+ * - (null)convertSizeFromBase:(null)aSize; (Argument aSize cannot be converted) + */ + abstract fun convertSizeFromBase(aSize: NSSize?): NSSize? + /** + * *native declaration : :199*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :200*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `BOOL canDraw()`

+ * *native declaration : :203* + */ + abstract fun canDraw(): Boolean + + /** + * Original signature : `void setNeedsDisplay(BOOL)`

+ * *native declaration : :204* + */ + abstract fun setNeedsDisplay(flag: Boolean) + /** + * *native declaration : :205*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `BOOL needsDisplay()`

+ * *native declaration : :206* + */ + abstract fun needsDisplay(): Boolean + + /** + * Original signature : `void lockFocus()`

+ * *native declaration : :207* + */ + abstract fun lockFocus() + + /** + * Original signature : `void unlockFocus()`

+ * *native declaration : :208* + */ + abstract fun unlockFocus() + + /** + * Original signature : `BOOL lockFocusIfCanDraw()`

+ * *native declaration : :209* + */ + abstract fun lockFocusIfCanDraw(): Boolean + + /** + * Original signature : `BOOL lockFocusIfCanDrawInContext(NSGraphicsContext*)`

+ * *native declaration : :211* + */ + abstract fun lockFocusIfCanDrawInContext(context: Pointer?): Boolean + /** + * *native declaration : :214*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `void display()`

+ * *native declaration : :216* + */ + abstract fun display() + + /** + * Original signature : `void displayIfNeeded()`

+ * *native declaration : :217* + */ + abstract fun displayIfNeeded() + + /** + * Original signature : `void displayIfNeededIgnoringOpacity()`

+ * *native declaration : :218* + */ + abstract fun displayIfNeededIgnoringOpacity() + /** + * *native declaration : :219*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :220*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :221*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :222*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :223*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :225*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :227*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :228*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `void viewWillDraw()`

+ * *native declaration : :231* + */ + abstract fun viewWillDraw() + + /** + * Original signature : `NSInteger gState()`

+ * *native declaration : :234* + */ + abstract fun gState(): Int + + /** + * Original signature : `void allocateGState()`

+ * *native declaration : :235* + */ + abstract fun allocateGState() + + /** + * Original signature : `void releaseGState()`

+ * *native declaration : :236* + */ + abstract fun releaseGState() + + /** + * Original signature : `void setUpGState()`

+ * *native declaration : :237* + */ + abstract fun setUpGState() + + /** + * Original signature : `void renewGState()`

+ * *native declaration : :238* + */ + abstract fun renewGState() + /** + * *native declaration : :240*

+ * Conversion Error : /// Original signature : `void scrollPoint(null)`

+ * - (void)scrollPoint:(null)aPoint; (Argument aPoint cannot be converted) + */ + /** + * *native declaration : :241*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `BOOL autoscroll(NSEvent*)`

+ * *native declaration : :242* + */ + abstract fun autoscroll(event: NSEvent?): Boolean + /** + * *native declaration : :243*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :244*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :246*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :249*

+ */ + abstract fun hitTest(point: NSPoint?): NSView? + + /** + * *native declaration : :250*

+ * Conversion Error : /// Original signature : `BOOL mouse(null, NSRect)`

+ * - (BOOL)mouse:(null)aPoint inRect:(NSRect)aRect; (Argument aPoint cannot be converted) + */ + /** + * Original signature : `id viewWithTag(NSInteger)`

+ * *native declaration : :251* + */ + abstract fun viewWithTag(aTag: Int): NSView? + + /** + * Original signature : `NSInteger tag()`

+ * *native declaration : :252* + */ + abstract fun tag(): Int + + /** + * Original signature : `BOOL acceptsFirstMouse(NSEvent*)`

+ * *native declaration : :254* + */ + abstract fun acceptsFirstMouse(event: NSEvent?): Boolean + + /** + * Original signature : `BOOL shouldDelayWindowOrderingForEvent(NSEvent*)`

+ * *native declaration : :255* + */ + abstract fun shouldDelayWindowOrderingForEvent(event: NSEvent?): Boolean + + /** + * Original signature : `BOOL needsPanelToBecomeKey()`

+ * *native declaration : :256* + */ + abstract fun needsPanelToBecomeKey(): Boolean + + /** + * Original signature : `BOOL mouseDownCanMoveWindow()`

+ * *native declaration : :258* + */ + abstract fun mouseDownCanMoveWindow(): Boolean + /** + * *native declaration : :261*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :262*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `void discardCursorRects()`

+ * *native declaration : :263* + */ + abstract fun discardCursorRects() + + /** + * Original signature : `void resetCursorRects()`

+ * *native declaration : :264* + */ + abstract fun resetCursorRects() + /** + * *native declaration : :266*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `void removeTrackingRect(NSTrackingRectTag)`

+ * *native declaration : :267* + */ + abstract fun removeTrackingRect(tag: Int) + + /** + * Original signature : `void setWantsLayer(BOOL)`

+ * *native declaration : :270* + */ + abstract fun setWantsLayer(flag: Boolean) + + /** + * Original signature : `BOOL wantsLayer()`

+ * *native declaration : :271* + */ + abstract fun wantsLayer(): Boolean + + /** + * Original signature : `void setLayer(CALayer*)`

+ * *native declaration : :273* + */ + abstract fun setLayer(newLayer: Pointer?) + + /** + * Original signature : `CALayer* layer()`

+ * *native declaration : :274* + */ + abstract fun layer(): CALayer? + + abstract fun setLayerContentsRedrawPolicy(policy: Int) + + abstract fun layerContentsRedrawPolicy(): Int + + /** + * Original signature : `void setAlphaValue(CGFloat)`

+ * *native declaration : :276* + */ + abstract fun setAlphaValue(viewAlpha: CGFloat?) + + /** + * Original signature : `CGFloat alphaValue()`

+ * *native declaration : :277* + */ + abstract fun alphaValue(): CGFloat? + + /** + * Original signature : `void setBackgroundFilters(NSArray*)`

+ * *native declaration : :279* + */ + abstract fun setBackgroundFilters(filters: NSArray?) + + /** + * Original signature : `NSArray* backgroundFilters()`

+ * *native declaration : :280* + */ + abstract fun backgroundFilters(): NSArray? + + /** + * Original signature : `void setCompositingFilter(CIFilter*)`

+ * *native declaration : :282* + */ + abstract fun setCompositingFilter(filter: Pointer?) + + /** + * Original signature : `CIFilter* compositingFilter()`

+ * *native declaration : :283* + */ + abstract fun compositingFilter(): Pointer? + + /** + * Original signature : `void setContentFilters(NSArray*)`

+ * *native declaration : :285* + */ + abstract fun setContentFilters(filters: Pointer?) + + /** + * Original signature : `NSArray* contentFilters()`

+ * *native declaration : :286* + */ + abstract fun contentFilters(): Pointer? + + /** + * Original signature : `void setShadow(NSShadow*)`

+ * *native declaration : :288* + */ + abstract fun setShadow(shadow: Pointer?) + + /** + * Original signature : `NSShadow* shadow()`

+ * *native declaration : :289* + */ + abstract fun shadow(): Pointer? + + /** + * The following methods are meant to be invoked, and probably don't need to be overridden

+ * Original signature : `void addTrackingArea(NSTrackingArea*)`

+ * *native declaration : :293* + */ + abstract fun addTrackingArea(trackingArea: Pointer?) + + /** + * Original signature : `void removeTrackingArea(NSTrackingArea*)`

+ * *native declaration : :294* + */ + abstract fun removeTrackingArea(trackingArea: Pointer?) + + /** + * Original signature : `NSArray* trackingAreas()`

+ * *native declaration : :295* + */ + abstract fun trackingAreas(): NSArray? + + /** + * updateTrackingAreas should be overridden to remove out of date tracking areas and add recomputed tracking areas, and should call super.

+ * Original signature : `void updateTrackingAreas()`

+ * *native declaration : :299* + */ + abstract fun updateTrackingAreas() + + /** + * Original signature : `BOOL shouldDrawColor()`

+ * *native declaration : :303* + */ + abstract fun shouldDrawColor(): Boolean + + /** + * Original signature : `void setPostsBoundsChangedNotifications(BOOL)`

+ * *native declaration : :305* + */ + abstract fun setPostsBoundsChangedNotifications(flag: Boolean) + + /** + * Original signature : `BOOL postsBoundsChangedNotifications()`

+ * *native declaration : :306* + */ + abstract fun postsBoundsChangedNotifications(): Boolean + + /** + * Original signature : `NSScrollView* enclosingScrollView()`

+ * *native declaration : :308* + */ + abstract fun enclosingScrollView(): NSView? + + /** + * Original signature : `NSMenu* menuForEvent(NSEvent*)`

+ * *native declaration : :310* + */ + abstract fun menuForEvent(event: NSEvent?): NSMenu? + + /** + * Original signature : `void setToolTip(NSString*)`

+ * *native declaration : :313* + */ + abstract fun setToolTip(string: String?) + + /** + * Original signature : `NSString* toolTip()`

+ * *native declaration : :314* + */ + abstract fun toolTip(): String? + /** + * *native declaration : :315*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `void removeToolTip(NSToolTipTag)`

+ * *native declaration : :316* + */ + abstract fun removeToolTip(tag: Int) + + /** + * Original signature : `void removeAllToolTips()`

+ * *native declaration : :317* + */ + abstract fun removeAllToolTips() + + /** + * a view receives viewWillStartLiveResize before the frame is first changed for a live resize

+ * Original signature : `void viewWillStartLiveResize()`

+ * *native declaration : :321* + */ + abstract fun viewWillStartLiveResize() + + /** + * a view receives viewWillEndLiveResize after the frame is last changed for a live resize

+ * Original signature : `void viewDidEndLiveResize()`

+ * *native declaration : :323* + */ + abstract fun viewDidEndLiveResize() + + /** + * inLiveResize can be called from drawRect: to decide between cheap and full drawing

+ * Original signature : `BOOL inLiveResize()`

+ * *native declaration : :325* + */ + abstract fun inLiveResize(): Boolean + + /** + * A view that returns YES for -preservesContentDuringLiveResize is responsible for invalidating its own dirty rects during live resize

+ * Original signature : `BOOL preservesContentDuringLiveResize()`

+ * *native declaration : :328* + */ + abstract fun preservesContentDuringLiveResize(): Boolean + + /** + * *native declaration : :330*

+ * Conversion Error : NSRect + */ + /** + * On return from -getRectsExposedDuringLiveResize, exposedRects indicates the parts of the view that are newly exposed (at most 4 rects). *count indicates how many rects are in the exposedRects list

+ * Original signature : `void getRectsExposedDuringLiveResize(NSRect[], NSInteger*)`

+ * *native declaration : :332* + */ + abstract fun getRectsExposedDuringLiveResize_count(exposedRects: Pointer?, count: IntBuffer?) + + /** + * Original signature : `BOOL performMnemonic(NSString*)`

+ * *from NSKeyboardUI native declaration : :341* + */ + abstract fun performMnemonic(theString: Pointer?): Boolean + + /** + * Original signature : `void setNextKeyView(NSView*)`

+ * *from NSKeyboardUI native declaration : :342* + */ + abstract fun setNextKeyView(next: NSView?) + + /** + * Original signature : `NSView* nextKeyView()`

+ * *from NSKeyboardUI native declaration : :343* + */ + abstract fun nextKeyView(): NSView? + + /** + * Original signature : `NSView* previousKeyView()`

+ * *from NSKeyboardUI native declaration : :344* + */ + abstract fun previousKeyView(): NSView? + + /** + * Original signature : `NSView* nextValidKeyView()`

+ * *from NSKeyboardUI native declaration : :345* + */ + abstract fun nextValidKeyView(): NSView? + + /** + * Original signature : `NSView* previousValidKeyView()`

+ * *from NSKeyboardUI native declaration : :346* + */ + abstract fun previousValidKeyView(): NSView? + + /** + * Original signature : `BOOL canBecomeKeyView()`

+ * *from NSKeyboardUI native declaration : :349* + */ + abstract fun canBecomeKeyView(): Boolean + /** + * *from NSKeyboardUI native declaration : :352*

+ * Conversion Error : NSRect + */ + /** + * *from NSKeyboardUI native declaration : :355*

+ * Conversion Error : /// Original signature : `void setFocusRingType(null)`

+ */ + abstract fun setFocusRingType(focusRingType: Int) + + /** + * Original signature : `focusRingType()`

+ * *from NSKeyboardUI native declaration : :356* + */ + abstract fun focusRingType(): Int + /** + * *from NSPrinting native declaration : :364*

+ * Conversion Error : NSRect + */ + /** + * *from NSPrinting native declaration : :365*

+ * Conversion Error : NSRect + */ + /** + * *from NSPrinting native declaration : :366*

+ * Conversion Error : NSRect + */ + /** + * *from NSPrinting native declaration : :367*

+ * Conversion Error : NSRect + */ + /** + * Printing action method (Note fax: is obsolete)

+ * Original signature : `void print(id)`

+ * *from NSPrinting native declaration : :370* + */ + abstract fun print(sender: ID?) + /** + * *from NSPrinting native declaration : :373*

+ * Conversion Error : / **

+ * * Pagination

+ * * Original signature : `BOOL knowsPageRange(null)`

+ * * /

+ * - (BOOL)knowsPageRange:(null)range; (Argument range cannot be converted) + */ + /** + * Original signature : `CGFloat heightAdjustLimit()`

+ * *from NSPrinting native declaration : :374* + */ + abstract fun heightAdjustLimit(): CGFloat? + + /** + * Original signature : `CGFloat widthAdjustLimit()`

+ * *from NSPrinting native declaration : :375* + */ + abstract fun widthAdjustLimit(): CGFloat? + + /** + * Original signature : `void adjustPageWidthNew(CGFloat*, CGFloat, CGFloat, CGFloat)`

+ * *from NSPrinting native declaration : :376* + */ + abstract fun adjustPageWidthNew_left_right_limit( + newRight: FloatBuffer?, + oldLeft: CGFloat?, + oldRight: CGFloat?, + rightLimit: CGFloat? + ) + + /** + * Original signature : `void adjustPageHeightNew(CGFloat*, CGFloat, CGFloat, CGFloat)`

+ * *from NSPrinting native declaration : :377* + */ + abstract fun adjustPageHeightNew_top_bottom_limit( + newBottom: FloatBuffer?, + oldTop: CGFloat?, + oldBottom: CGFloat?, + bottomLimit: CGFloat? + ) + /** + * *from NSPrinting native declaration : :378*

+ * Conversion Error : NSRect + */ + /** + * *from NSPrinting native declaration : :379*

+ * Conversion Error : NSRect + */ + /** + * *from NSPrinting native declaration : :380*

+ * Conversion Error : /// Original signature : `void drawPageBorderWithSize(null)`

+ * - (void)drawPageBorderWithSize:(null)borderSize; (Argument borderSize cannot be converted) + */ + /** + * Original signature : `NSAttributedString* pageHeader()`

+ * *from NSPrinting native declaration : :382* + */ + abstract fun pageHeader(): NSAttributedString? + + /** + * Original signature : `NSAttributedString* pageFooter()`

+ * *from NSPrinting native declaration : :383* + */ + abstract fun pageFooter(): NSAttributedString? + /** + * *from NSPrinting native declaration : :387*

+ * Conversion Error : / **

+ * * This method is obsolete. It will never be invoked from within AppKit, and NSView's implementation of it does nothing. **

+ * * Original signature : `void drawSheetBorderWithSize(null)`

+ * * /

+ * - (void)drawSheetBorderWithSize:(null)borderSize; (Argument borderSize cannot be converted) + */ + /** + * Returns print job title. Default implementation first tries its window's NSDocument (displayName), then window's title

+ * Original signature : `NSString* printJobTitle()`

+ * *from NSPrinting native declaration : :391* + */ + abstract fun printJobTitle(): String? + + /** + * Original signature : `void beginDocument()`

+ * *from NSPrinting native declaration : :392* + */ + abstract fun beginDocument() + + /** + * Original signature : `void endDocument()`

+ * *from NSPrinting native declaration : :393* + */ + abstract fun endDocument() + /** + * *from NSPrinting native declaration : :395*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `void endPage()`

+ * *from NSPrinting native declaration : :396* + */ + abstract fun endPage() + /** + * *from NSDrag native declaration : :401*

+ * Conversion Error : /// Original signature : `void dragImage(NSImage*, null, null, NSEvent*, NSPasteboard*, id, BOOL)`

+ * - (void)dragImage:(NSImage*)anImage at:(null)viewLocation offset:(null)initialOffset event:(NSEvent*)event pasteboard:(NSPasteboard*)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag; (Argument viewLocation cannot be converted) + */ + /** + * Original signature : `NSArray* registeredDraggedTypes()`

+ * *from NSDrag native declaration : :404* + */ + abstract fun registeredDraggedTypes(): NSArray? + + /** + * Original signature : `void registerForDraggedTypes(NSArray*)`

+ * *from NSDrag native declaration : :406* + */ + abstract fun registerForDraggedTypes(types: NSArray?) + + /** + * Original signature : `void unregisterDraggedTypes()`

+ * *from NSDrag native declaration : :407* + */ + abstract fun unregisterDraggedTypes() + + /** + * *from NSDrag native declaration : :409*

+ * Conversion Error : NSRect + */ + abstract fun dragFile_fromRect_slideBack_event( + filename: String?, + rect: NSRect?, + slideBack: Boolean, + event: NSEvent? + ): Boolean + + /** + * *from NSDrag native declaration : :411*

+ * Conversion Error : NSRect + */ + abstract fun dragPromisedFilesOfTypes_fromRect_source_slideBack_event( + typeArray: NSArray?, rect: NSRect?, sourceObject: ID?, slideBack: Boolean, event: NSEvent? + ): Boolean + + fun dragPromisedFilesOfTypes( + typeArray: NSArray?, rect: NSRect?, sourceObject: ID?, slideBack: Boolean, event: NSEvent? + ): Boolean { + return this.dragPromisedFilesOfTypes_fromRect_source_slideBack_event( + typeArray, + rect, + sourceObject, + slideBack, + event + ) + } + + /** + * Original signature : `BOOL enterFullScreenMode(NSScreen*, NSDictionary*)`

+ * *from NSFullScreenMode native declaration : :417* + */ + abstract fun enterFullScreenMode_withOptions(screen: Pointer?, options: Pointer?): Boolean + + /** + * Original signature : `void exitFullScreenModeWithOptions(NSDictionary*)`

+ * *from NSFullScreenMode native declaration : :418* + */ + abstract fun exitFullScreenModeWithOptions(options: NSDictionary?) + + /** + * Original signature : `BOOL isInFullScreenMode()`

+ * *from NSFullScreenMode native declaration : :419* + */ + abstract val isInFullScreenMode: Boolean + + companion object { + private val CLASS: _Class = Rococoa.createClass("NSView", _Class::class.java) + + const val NSViewNotSizable: Int = 0 + const val NSViewMinXMargin: Int = 1 + const val NSViewWidthSizable: Int = 2 + const val NSViewMaxXMargin: Int = 4 + const val NSViewMinYMargin: Int = 8 + const val NSViewHeightSizable: Int = 16 + const val NSViewMaxYMargin: Int = 32 + + const val NSViewLayerContentsRedrawNever: Int = 0 + const val NSViewLayerContentsRedrawOnSetNeedsDisplay: Int = 1 + const val NSViewLayerContentsRedrawDuringViewResize: Int = 2 + const val NSViewLayerContentsRedrawBeforeViewResize: Int = 3 + const val NSViewLayerContentsRedrawCrossfade: Int = 4 + + fun create(): NSView { + return CLASS.alloc().init() + } + + fun create(frameRect: NSRect?): NSView { + return CLASS.alloc().initWithFrame(frameRect) + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSWindow.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSWindow.kt new file mode 100644 index 00000000..95f31414 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSWindow.kt @@ -0,0 +1,1752 @@ +package darwin + +import com.sun.jna.Pointer +import org.rococoa.Foundation +import org.rococoa.ID +import org.rococoa.ObjCClass +import org.rococoa.Rococoa +import org.rococoa.cocoa.CGFloat +import org.rococoa.cocoa.foundation.* + +/// native declaration : :119 +abstract class NSWindow : NSResponder() { + /// enum values + interface NSWindowLevel { + companion object { + const val NSNormalWindowLevel: Int = 0 + const val NSFloatingWindowLevel: Int = 3 + const val NSSubmenuWindowLevel: Int = 3 + const val NSTornOffMenuWindowLevel: Int = 3 + const val NSMainMenuWindowLevel: Int = 24 + const val NSStatusWindowLevel: Int = 25 + const val NSModalPanelWindowLevel: Int = 8 + const val NSPopUpMenuWindowLevel: Int = 101 + const val NSScreenSaverWindowLevel: Int = 1000 + } + } + + /// enum values + interface NSWindowCollectionBehavior { + companion object { + const val NSWindowCollectionBehaviorManaged: Int = + 1 shl 2 // participates in spaces, exposé. Default behavior if windowLevel == NSNormalWindowLevel + const val NSWindowCollectionBehaviorTransient: Int = + 1 shl 3 // floats in spaces, hidden by exposé. Default behavior if windowLevel != NSNormalWindowLevel + const val NSWindowCollectionBehaviorStationary: Int = + 1 shl 4 // unaffected by exposé. Stays visible and stationary, like desktop window + + const val NSWindowCollectionBehaviorParticipatesInCycle: Int = + 1 shl 5 // default behavior if windowLevel == NSNormalWindowLevel + const val NSWindowCollectionBehaviorIgnoresCycle: Int = + 1 shl 6 // default behavior if windowLevel != NSNormalWindowLevel + + const val NSWindowNumberListAllApplications: Int = 1 shl 0 + const val NSWindowNumberListAllSpaces: Int = 1 shl 4 + + const val NSWindowCollectionBehaviorFullScreenPrimary: Int = + 1 shl 7 // the frontmost window with this collection behavior will be the fullscreen window. + const val NSWindowCollectionBehaviorFullScreenAuxiliary: Int = + 1 shl 8 // windows with this collection behavior can be shown with the fullscreen window. + } + } + + /// enum values + interface NSSelectionDirection { + companion object { + const val NSDirectSelection: Int = 0 + const val NSSelectingNext: Int = 1 + const val NSSelectingPrevious: Int = 2 + } + } + + /// enum values + interface NSWindowButton { + companion object { + const val NSWindowCloseButton: Int = 0 + const val NSWindowMiniaturizeButton: Int = 1 + const val NSWindowZoomButton: Int = 2 + const val NSWindowToolbarButton: Int = 3 + const val NSWindowDocumentIconButton: Int = 4 + } + } + + /// enum values + interface NSWindowToolbarStyle { + companion object { + // The default value. The style will be determined by the window's given configuration + const val NSWindowToolbarStyleAutomatic: Int = 0 + + // The toolbar will appear below the window title + const val NSWindowToolbarStyleExpanded: Int = 1 + + // The toolbar will appear below the window title and the items in the toolbar will attempt to have equal widths when possible + const val NSWindowToolbarStylePreference: Int = 2 + + // The window title will appear inline with the toolbar when visible + const val NSWindowToolbarStyleUnified: Int = 3 + + // Same as NSWindowToolbarStyleUnified, but with reduced margins in the toolbar allowing more focus to be on the contents of the window + const val NSWindowToolbarStyleUnifiedCompact: Int = 4 + } + } + + /// enum values + interface NSTitlebarSeparatorStyle { + companion object { + const val NSTitlebarSeparatorStyleAutomatic: Int = 0 + const val NSTitlebarSeparatorStyleNone: Int = 1 + const val NSTitlebarSeparatorStyleLine: Int = 2 + const val NSTitlebarSeparatorStyleShadow: Int = 3 + } + } + + interface _Class : ObjCClass { + /** + * *native declaration : :217*

+ * Conversion Error : NSRect + */ + fun contentRectForFrameRect_styleMask(windowFrame: NSRect?, windowStyle: NSUInteger?): NSRect + + /** + * *native declaration : :218*

+ * Conversion Error : NSRect + */ + fun frameRectForContentRect_styleMask(cRect: NSRect?, aStyle: NSUInteger?): NSRect + + /** + * Original signature : `CGFloat minFrameWidthWithTitle(NSString*, NSUInteger)`

+ * *native declaration : :219* + */ + fun minFrameWidthWithTitle_styleMask(aTitle: String?, aStyle: NSUInteger?): CGFloat + + /** + * Original signature : `defaultDepthLimit()`

+ * *native declaration : :220* + */ + fun defaultDepthLimit(): NSObject? + + /** + * Original signature : `void removeFrameUsingName(NSString*)`

+ * *native declaration : :473* + */ + fun removeFrameUsingName(name: String?) + + /** + * Original signature : `void menuChanged(NSMenu*)`

+ * *native declaration : :504* + */ + fun menuChanged(menu: NSMenu?) + + /** + * Original signature : `NSButton* standardWindowButton(NSWindowButton, NSUInteger)`

+ * *native declaration : :513* + */ + fun standardWindowButton_forStyleMask(b: Int, styleMask: Int): NSButton? + + /** + * @param automatic A Boolean value that indicates whether the app can automatically organize windows into + * tabs. + */ + fun setAllowsAutomaticWindowTabbing(automatic: Boolean) + + /** + * @return A Boolean value that indicates whether the app can automatically organize windows into tabs. + */ + fun allowsAutomaticWindowTabbing(): Boolean + } + + interface Delegate { + /** + * Tells the delegate that the user has attempted to close a window or the window has received a performClose: + * message. This method is optional. + * + * + * This method may not always be called during window closing. Specifically, this method is not called when a + * user quits an application. You can find additional information on application termination in Graceful + * Application Termination. + * + * @param sender + * @return + */ + fun windowShouldClose(sender: NSWindow?): Boolean + + /** + * Tells the delegate that the user has attempted to close a window or the window has received a performClose: + * message. This method is optional. + * + * + * You can retrieve the NSWindow object in question by sending object to notification. + * + * @param notification + */ + fun windowWillClose(notification: NSNotification?) + + /** + * Notifies the delegate that the window is about to open a sheet. + * + * @param notification + */ + fun windowWillBeginSheet(notification: NSNotification?) + + /** + * Informs the delegate that the window has become the key window. This method is optional. + * + * + * You can retrieve the window object in question by sending object to notification. + * + * @param notification + */ + fun windowDidBecomeKey(notification: NSNotification?) + + fun windowDidBecomeMain(notification: NSNotification?) + + /** + * Informs the delegate that the window has resigned key window status. This method is optional. + * + * + * You can retrieve the window object in question by sending object to notification. + * + * @param notification + */ + fun windowDidResignKey(notification: NSNotification?) + + fun windowDidResignMain(notification: NSNotification?) + } + + /** + * *native declaration : :227*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :228*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `NSString* title()`

+ * *native declaration : :230* + */ + abstract fun title(): String? + + /** + * Original signature : `void setTitle(NSString*)`

+ * *native declaration : :231* + */ + abstract fun setTitle(aString: String?) + + /** + * @return A secondary line of text that appears in the title bar of the window. + */ + abstract fun subtitle(): String? + + /** + * When this property is the empty string, the system removes the subtitle from the window layout. + * + * @param aString A secondary line of text that appears in the title bar of the window. + */ + abstract fun setSubtitle(aString: String?) + + /** + * The default value is NSTitlebarSeparatorStyleAutomatic. Changing this value overrides any preference by + * NSSplitViewItem. + * + * @param style The type of separator that the UI displays between the window’s titlebar and its content. + */ + abstract fun setTitlebarSeparatorStyle(style: Int) + + /** + * setRepresentedURL:

If url is not nil and its path is not empty, the window will show a document icon in the + * titlebar.

If the url represents a filename or other resource with a known icon, that icon will be used as + * the document icon. Otherwise the default document icon will be used. The icon can be customized using + * [[NSWindow standardWindowButton:NSWindowDocumentIconButton] setImage:customImage]. If url is not nil and its + * path is not empty, the window will have a pop-up menu which can be shown via command-click on the area containing + * the document icon and title. By default, this menu will display the path components of the url. The presence + * and contents of this menu can be controlled by the delegate method window:shouldPopUpDocumentPathMenu:If the url + * is nil or has an empty path, the window will not show a document icon and will not have a pop-up menu available + * via command-click.

Original signature : `void setRepresentedURL(NSURL*)`

+ * *native declaration : :237* + */ + abstract fun setRepresentedURL(url: NSURL?) + + /** + * Original signature : `NSURL* representedURL()`

+ * *native declaration : :238* + */ + abstract fun representedURL(): NSURL? + + /** + * Original signature : `NSString* representedFilename()`

+ * *native declaration : :240* + */ + abstract fun representedFilename(): String? + + /** + * Original signature : `void setRepresentedFilename(NSString*)`

+ * *native declaration : :241* + */ + abstract fun setRepresentedFilename(aString: String?) + + /** + * Original signature : `void setTitleWithRepresentedFilename(NSString*)`

+ * *native declaration : :242* + */ + abstract fun setTitleWithRepresentedFilename(filename: String?) + + /** + * Original signature : `BOOL isExcludedFromWindowsMenu()`

+ * *native declaration : :244* + */ + /** + * Original signature : `void setExcludedFromWindowsMenu(BOOL)`

+ * *native declaration : :243* + */ + abstract var isExcludedFromWindowsMenu: Boolean + + /** + * Original signature : `void setContentView(NSView*)`

+ * *native declaration : :245* + */ + abstract fun setContentView(aView: NSView?) + + /** + * Original signature : `id contentView()`

+ * *native declaration : :246* + */ + abstract fun contentView(): NSView? + + /** + * Original signature : `void setDelegate(id)`

+ * *native declaration : :247* + */ + abstract fun setDelegate(anObject: ID?) + + /** + * Original signature : `id delegate()`

+ * *native declaration : :248* + */ + abstract fun delegate(): ID? + + /** + * Original signature : `NSInteger windowNumber()`

+ * *native declaration : :249* + */ + abstract fun windowNumber(): NSInteger? + + /** + * Original signature : `NSUInteger styleMask()`

+ * *native declaration : :250* + */ + abstract fun styleMask(): NSUInteger? + + abstract fun setStyleMask(mask: NSUInteger?) + + /** + * Original signature : `NSText* fieldEditor(BOOL, id)`

+ * *native declaration : :251* + */ + abstract fun fieldEditor_forObject(createFlag: Boolean, anObject: NSObject?): NSText? + + /** + * Original signature : `void endEditingFor(id)`

+ * *native declaration : :252* + */ + abstract fun endEditingFor(anObject: NSObject?) + /** + * *native declaration : :254*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :255*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :256*

+ * Conversion Error : NSSize + */ + /** + * *native declaration : :257*

+ * Conversion Error : /// Original signature : `void setFrameOrigin(null)`

- + * (void)setFrameOrigin:(null)aPoint; (Argument aPoint cannot be converted) + */ + abstract fun setFrameOrigin(aPoint: NSPoint?) + + /** + * *native declaration : :258*

+ * Conversion Error : /// Original signature : `void setFrameTopLeftPoint(null)`

- + * (void)setFrameTopLeftPoint:(null)aPoint; (Argument aPoint cannot be converted) + */ + abstract fun setFrameTopLeftPoint(aPoint: NSPoint?) + + /** + * *native declaration : :259*

+ * Conversion Error : /// Original signature : `cascadeTopLeftFromPoint(null)`

- + * (null)cascadeTopLeftFromPoint:(null)topLeftPoint; (Argument topLeftPoint cannot be converted) + */ + abstract fun cascadeTopLeftFromPoint(topLeftPoint: NSPoint?): NSPoint? + + /** + * *native declaration : :260*

+ * Conversion Error : NSRect + */ + abstract fun frame(): NSRect + + /** + * *native declaration : :265*

+ * Conversion Error : NSRect + */ + abstract fun setFrame_display_animate(frameRect: NSRect?, displayFlag: Boolean, animateFlag: Boolean) + /** + * *native declaration : :268*

+ * Conversion Error : NSRect + */ + /** + * show/hide resize corner (does not affect whether window is resizable)

Original signature : `void + * setShowsResizeIndicator(BOOL)`

+ * *native declaration : :271* + */ + abstract fun setShowsResizeIndicator(show: Boolean) + + /** + * Original signature : `BOOL showsResizeIndicator()`

+ * *native declaration : :272* + */ + abstract fun showsResizeIndicator(): Boolean + /** + * *native declaration : :274*

+ * Conversion Error : NSSize + */ + /** + * *native declaration : :275*

+ * Conversion Error : NSSize + */ + /** + * *native declaration : :276*

+ * Conversion Error : NSSize + */ + /** + * *native declaration : :277*

+ * Conversion Error : NSSize + */ + /** + * *native declaration : :280*

+ * Conversion Error : NSSize + */ + /** + * *native declaration : :281*

+ * Conversion Error : NSSize + */ + /** + * *native declaration : :282*

+ * Conversion Error : NSSize + */ + /** + * *native declaration : :283*

+ * Conversion Error : NSSize + */ + /** + * Original signature : `void useOptimizedDrawing(BOOL)`

+ * *native declaration : :286* + */ + abstract fun useOptimizedDrawing(flag: Boolean) + + /** + * Original signature : `void disableFlushWindow()`

+ * *native declaration : :287* + */ + abstract fun disableFlushWindow() + + /** + * Original signature : `void enableFlushWindow()`

+ * *native declaration : :288* + */ + abstract fun enableFlushWindow() + + /** + * Original signature : `BOOL isFlushWindowDisabled()`

+ * *native declaration : :289* + */ + abstract val isFlushWindowDisabled: Boolean + + /** + * Original signature : `void flushWindow()`

+ * *native declaration : :290* + */ + abstract fun flushWindow() + + /** + * Original signature : `void flushWindowIfNeeded()`

+ * *native declaration : :291* + */ + abstract fun flushWindowIfNeeded() + + /** + * Original signature : `void setViewsNeedDisplay(BOOL)`

+ * *native declaration : :292* + */ + abstract fun setViewsNeedDisplay(flag: Boolean) + + /** + * Original signature : `BOOL viewsNeedDisplay()`

+ * *native declaration : :293* + */ + abstract fun viewsNeedDisplay(): Boolean + + /** + * Original signature : `void displayIfNeeded()`

+ * *native declaration : :294* + */ + abstract fun displayIfNeeded() + + /** + * Original signature : `void display()`

+ * *native declaration : :295* + */ + abstract fun display() + + /** + * Original signature : `BOOL isAutodisplay()`

+ * *native declaration : :297* + */ + /** + * Original signature : `void setAutodisplay(BOOL)`

+ * *native declaration : :296* + */ + abstract var isAutodisplay: Boolean + + /** + * Original signature : `BOOL preservesContentDuringLiveResize()`

+ * *native declaration : :300* + */ + abstract fun preservesContentDuringLiveResize(): Boolean + + /** + * Original signature : `void setPreservesContentDuringLiveResize(BOOL)`

+ * *native declaration : :301* + */ + abstract fun setPreservesContentDuringLiveResize(flag: Boolean) + + /** + * Original signature : `void update()`

+ * *native declaration : :304* + */ + abstract fun update() + + /** + * Original signature : `BOOL makeFirstResponder(NSResponder*)`

+ * *native declaration : :305* + */ + abstract fun makeFirstResponder(aResponder: NSResponder?): Boolean + + /** + * Original signature : `NSResponder* firstResponder()`

+ * *native declaration : :306* + */ + abstract fun firstResponder(): NSResponder? + + /** + * Original signature : `NSInteger resizeFlags()`

+ * *native declaration : :307* + */ + abstract fun resizeFlags(): Int + + /** + * Original signature : `void close()`

+ * *native declaration : :309* + */ + abstract fun close() + + /** + * Original signature : `BOOL isReleasedWhenClosed()`

+ * *native declaration : :311* + */ + /** + * Original signature : `void setReleasedWhenClosed(BOOL)`

+ * *native declaration : :310* + */ + abstract var isReleasedWhenClosed: Boolean + + /** + * Original signature : `void miniaturize(id)`

+ * *native declaration : :312* + */ + abstract fun miniaturize(sender: ID?) + + /** + * Original signature : `void deminiaturize(id)`

+ * *native declaration : :313* + */ + abstract fun deminiaturize(sender: ID?) + + /** + * Original signature : `BOOL isZoomed()`

+ * *native declaration : :314* + */ + abstract val isZoomed: Boolean + + /** + * Original signature : `void zoom(id)`

+ * *native declaration : :315* + */ + abstract fun zoom(sender: ID?) + + /** + * Original signature : `BOOL isMiniaturized()`

+ * *native declaration : :316* + */ + abstract val isMiniaturized: Boolean + /** + * *native declaration : :317*

+ * Conversion Error : /// Original signature : `BOOL tryToPerform(null, id)`

+ * - (BOOL)tryToPerform:(null)anAction with:(id)anObject; (Argument anAction cannot be converted) + */ + /** + * Original signature : `id validRequestorForSendType(NSString*, NSString*)`

+ * *native declaration : :318* + */ + abstract fun validRequestorForSendType_returnType(sendType: Pointer?, returnType: Pointer?): NSObject? + + /** + * Original signature : `void setBackgroundColor(NSColor*)`

+ * *native declaration : :319* + */ + abstract fun setBackgroundColor(color: NSColor?) + + /** + * Original signature : `NSColor* backgroundColor()`

+ * *native declaration : :320* + */ + abstract fun backgroundColor(): NSColor? + /** + * *native declaration : :323*

+ * Conversion Error : /// Original signature : `void setContentBorderThickness(CGFloat, null)`

+ * - (void)setContentBorderThickness:(CGFloat)thickness forEdge:(null)edge; (Argument edge cannot be converted) + */ + /** + * *native declaration : :324*

+ * Conversion Error : /// Original signature : `CGFloat contentBorderThicknessForEdge(null)`

+ * - (CGFloat)contentBorderThicknessForEdge:(null)edge; (Argument edge cannot be converted) + */ + /** + * *native declaration : :326*

+ * Conversion Error : /// Original signature : `void setAutorecalculatesContentBorderThickness(BOOL, null)`

+ * - (void)setAutorecalculatesContentBorderThickness:(BOOL)flag forEdge:(null)edge; (Argument edge cannot be converted) + */ + /** + * *native declaration : :327*

+ * Conversion Error : /// Original signature : `BOOL autorecalculatesContentBorderThicknessForEdge(null)`

+ * - (BOOL)autorecalculatesContentBorderThicknessForEdge:(null)edge; (Argument edge cannot be converted) + */ + + /** + * Original signature : `BOOL isMovableByWindowBackground()`

+ * *native declaration : :332* + */ + /** + * Original signature : `void setMovableByWindowBackground(BOOL)`

+ * *native declaration : :331* + */ + abstract var isMovableByWindowBackground: Boolean + + /** + * Original signature : `void setHidesOnDeactivate(BOOL)`

+ * *native declaration : :335* + */ + abstract fun setHidesOnDeactivate(flag: Boolean) + + /** + * Original signature : `BOOL hidesOnDeactivate()`

+ * *native declaration : :336* + */ + abstract fun hidesOnDeactivate(): Boolean + + /** + * indicate whether a window can be hidden during -[NSApplication hide:]. Default is YES

Original signature : + * `void setCanHide(BOOL)`

+ * *native declaration : :339* + */ + abstract fun setCanHide(flag: Boolean) + + /** + * Original signature : `BOOL canHide()`

+ * *native declaration : :340* + */ + abstract fun canHide(): Boolean + + /** + * Original signature : `void center()`

+ * *native declaration : :342* + */ + abstract fun center() + + /** + * Original signature : `void makeKeyAndOrderFront(id)`

+ * *native declaration : :343* + */ + abstract fun makeKeyAndOrderFront(sender: ID?) + + /** + * Original signature : `void orderFront(id)`

+ * *native declaration : :344* + */ + abstract fun orderFront(sender: ID?) + + /** + * Original signature : `void orderBack(id)`

+ * *native declaration : :345* + */ + abstract fun orderBack(sender: ID?) + + /** + * Original signature : `void orderOut(id)`

+ * *native declaration : :346* + */ + abstract fun orderOut(sender: ID?) + /** + * *native declaration : :347*

+ * Conversion Error : /// Original signature : `void orderWindow(null, NSInteger)`

+ * - (void)orderWindow:(null)place relativeTo:(NSInteger)otherWin; (Argument place cannot be converted) + */ + /** + * Original signature : `void orderFrontRegardless()`

+ * *native declaration : :348* + */ + abstract fun orderFrontRegardless() + + /** + * Original signature : `void setMiniwindowImage(NSImage*)`

+ * *native declaration : :350* + */ + abstract fun setMiniwindowImage(image: NSImage?) + + /** + * Original signature : `void setMiniwindowTitle(NSString*)`

+ * *native declaration : :351* + */ + abstract fun setMiniwindowTitle(title: String?) + + /** + * Original signature : `NSImage* miniwindowImage()`

+ * *native declaration : :352* + */ + abstract fun miniwindowImage(): NSImage? + + /** + * Original signature : `NSString* miniwindowTitle()`

+ * *native declaration : :353* + */ + abstract fun miniwindowTitle(): String? + + /** + * Original signature : `NSDockTile* dockTile()`

+ * *native declaration : :356* + */ + abstract fun dockTile(): NSDockTile? + + /** + * Original signature : `BOOL isDocumentEdited()`

+ * *native declaration : :360* + */ + /** + * Original signature : `void setDocumentEdited(BOOL)`

+ * *native declaration : :359* + */ + abstract var isDocumentEdited: Boolean + + /** + * Original signature : `BOOL isVisible()`

+ * *native declaration : :361* + */ + abstract val isVisible: Boolean + + /** + * Original signature : `BOOL isKeyWindow()`

+ * *native declaration : :362* + */ + abstract val isKeyWindow: Boolean + + /** + * Original signature : `BOOL isMainWindow()`

+ * *native declaration : :363* + */ + abstract val isMainWindow: Boolean + + /** + * Original signature : `BOOL canBecomeKeyWindow()`

+ * *native declaration : :364* + */ + abstract fun canBecomeKeyWindow(): Boolean + + /** + * Original signature : `BOOL canBecomeMainWindow()`

+ * *native declaration : :365* + */ + abstract fun canBecomeMainWindow(): Boolean + + /** + * Original signature : `void makeKeyWindow()`

+ * *native declaration : :366* + */ + abstract fun makeKeyWindow() + + /** + * Original signature : `void makeMainWindow()`

+ * *native declaration : :367* + */ + abstract fun makeMainWindow() + + /** + * Original signature : `void becomeKeyWindow()`

+ * *native declaration : :368* + */ + abstract fun becomeKeyWindow() + + /** + * Original signature : `void resignKeyWindow()`

+ * *native declaration : :369* + */ + abstract fun resignKeyWindow() + + /** + * Original signature : `void becomeMainWindow()`

+ * *native declaration : :370* + */ + abstract fun becomeMainWindow() + + /** + * Original signature : `void resignMainWindow()`

+ * *native declaration : :371* + */ + abstract fun resignMainWindow() + + /** + * Original signature : `BOOL worksWhenModal()`

+ * *native declaration : :373* + */ + abstract fun worksWhenModal(): Boolean + /** + * *native declaration : :374*

+ * Conversion Error : /// Original signature : `convertBaseToScreen(null)`

+ * - (null)convertBaseToScreen:(null)aPoint; (Argument aPoint cannot be converted) + */ + /** + * *native declaration : :375*

+ * Conversion Error : /// Original signature : `convertScreenToBase(null)`

+ * - (null)convertScreenToBase:(null)aPoint; (Argument aPoint cannot be converted) + */ + /** + * Original signature : `void performClose(id)`

+ * *native declaration : :376* + */ + abstract fun performClose(sender: ID?) + + /** + * Original signature : `void performMiniaturize(id)`

+ * *native declaration : :377* + */ + abstract fun performMiniaturize(sender: ID?) + + /** + * Original signature : `void performZoom(id)`

+ * *native declaration : :378* + */ + abstract fun performZoom(sender: ID?) + + /** + * Original signature : `NSInteger gState()`

+ * *native declaration : :379* + */ + abstract fun gState(): Int + + /** + * Original signature : `BOOL isOneShot()`

+ * *native declaration : :381* + */ + /** + * Original signature : `void setOneShot(BOOL)`

+ * *native declaration : :380* + */ + abstract var isOneShot: Boolean + /** + * *native declaration : :382*

+ * Conversion Error : NSRect + */ + /** + * *native declaration : :383*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `void print(id)`

+ * *native declaration : :384* + */ + abstract fun print(sender: ID?) + + /** + * Original signature : `void disableCursorRects()`

+ * *native declaration : :386* + */ + abstract fun disableCursorRects() + + /** + * Original signature : `void enableCursorRects()`

+ * *native declaration : :387* + */ + abstract fun enableCursorRects() + + /** + * Original signature : `void discardCursorRects()`

+ * *native declaration : :388* + */ + abstract fun discardCursorRects() + + /** + * Original signature : `BOOL areCursorRectsEnabled()`

+ * *native declaration : :389* + */ + abstract fun areCursorRectsEnabled(): Boolean + + /** + * Original signature : `void invalidateCursorRectsForView(NSView*)`

+ * *native declaration : :390* + */ + abstract fun invalidateCursorRectsForView(aView: Pointer?) + + /** + * Original signature : `void resetCursorRects()`

+ * *native declaration : :391* + */ + abstract fun resetCursorRects() + + /** + * Original signature : `void setAllowsToolTipsWhenApplicationIsInactive(BOOL)`

+ * *native declaration : :394* + */ + abstract fun setAllowsToolTipsWhenApplicationIsInactive(allowWhenInactive: Boolean) + + /** + * Original signature : `BOOL allowsToolTipsWhenApplicationIsInactive()`

+ * *native declaration : :397* + */ + abstract fun allowsToolTipsWhenApplicationIsInactive(): Boolean + /** + * *native declaration : :401*

+ * Conversion Error : /// Original signature : `void setBackingType(null)`

+ * - (void)setBackingType:(null)bufferingType; (Argument bufferingType cannot be converted) + */ + /** + * Original signature : `backingType()`

+ * *native declaration : :402* + */ + abstract fun backingType(): NSObject? + + /** + * Original signature : `void setLevel(NSInteger)`

+ * *native declaration : :403* + */ + abstract fun setLevel(newLevel: Int) + + /** + * Original signature : `NSInteger level()`

+ * *native declaration : :404* + */ + abstract fun level(): Int + /** + * *native declaration : :405*

+ * Conversion Error : /// Original signature : `void setDepthLimit(null)`

+ * - (void)setDepthLimit:(null)limit; (Argument limit cannot be converted) + */ + /** + * Original signature : `depthLimit()`

+ * *native declaration : :406* + */ + abstract fun depthLimit(): NSObject? + + /** + * Original signature : `void setDynamicDepthLimit(BOOL)`

+ * *native declaration : :407* + */ + abstract fun setDynamicDepthLimit(flag: Boolean) + + /** + * Original signature : `BOOL hasDynamicDepthLimit()`

+ * *native declaration : :408* + */ + abstract fun hasDynamicDepthLimit(): Boolean + + /** + * Original signature : `NSScreen* screen()`

+ * *native declaration : :409* + */ + abstract fun screen(): Pointer? + + /** + * Original signature : `NSScreen* deepestScreen()`

+ * *native declaration : :410* + */ + abstract fun deepestScreen(): Pointer? + + /** + * Original signature : `BOOL canStoreColor()`

+ * *native declaration : :411* + */ + abstract fun canStoreColor(): Boolean + + /** + * Original signature : `void setHasShadow(BOOL)`

+ * *native declaration : :412* + */ + abstract fun setHasShadow(hasShadow: Boolean) + + /** + * Original signature : `BOOL hasShadow()`

+ * *native declaration : :413* + */ + abstract fun hasShadow(): Boolean + + /** + * Original signature : `void invalidateShadow()`

+ * *native declaration : :415* + */ + abstract fun invalidateShadow() + + /** + * Original signature : `void setAlphaValue(CGFloat)`

+ * *native declaration : :417* + */ + abstract fun setAlphaValue(windowAlpha: CGFloat?) + + /** + * Original signature : `CGFloat alphaValue()`

+ * *native declaration : :418* + */ + abstract fun alphaValue(): CGFloat? + + /** + * Original signature : `BOOL isOpaque()`

+ * *native declaration : :420* + */ + /** + * Original signature : `void setOpaque(BOOL)`

+ * *native declaration : :419* + */ + abstract var isOpaque: Boolean + + /** + * -setSharingType: specifies whether the window content can be read and/or written from another process. The + * default sharing type is NSWindowSharingReadOnly, which means other processes can read the window content (eg. for + * window capture) but cannot modify it. If you set your window sharing type to NSWindowSharingNone, so that the + * content cannot be captured, your window will also not be able to participate in a number of system services, so + * this setting should be used with caution. If you set your window sharing type to NSWindowSharingReadWrite, other + * processes can both read and modify the window content.

Original signature : `void + * setSharingType(NSWindowSharingType)`

+ * *native declaration : :426* + */ + abstract fun setSharingType(type: Int) + + /** + * Original signature : `NSWindowSharingType sharingType()`

+ * *native declaration : :427* + */ + abstract fun sharingType(): Int + + /** + * -setPreferredBackingLocation: sets the preferred location for the window backing store. In general, you should + * not use this API unless indicated by performance measurement.

Original signature : `void + * setPreferredBackingLocation(NSWindowBackingLocation)`

+ * *native declaration : :431* + */ + abstract fun setPreferredBackingLocation(backingLocation: Int) + + /** + * -preferredBackingLocation gets the preferred location for the window backing store. This may be different from + * the actual location.

Original signature : `NSWindowBackingLocation preferredBackingLocation()`

+ * *native declaration : :434* + */ + abstract fun preferredBackingLocation(): Int + + /** + * -backingLocation gets the current location of the window backing store.

Original signature : + * `NSWindowBackingLocation backingLocation()`

+ * *native declaration : :437* + */ + abstract fun backingLocation(): Int + + /** + * Original signature : `BOOL displaysWhenScreenProfileChanges()`

+ * *native declaration : :442* + */ + abstract fun displaysWhenScreenProfileChanges(): Boolean + + /** + * Original signature : `void setDisplaysWhenScreenProfileChanges(BOOL)`

+ * *native declaration : :443* + */ + abstract fun setDisplaysWhenScreenProfileChanges(flag: Boolean) + + /** + * Original signature : `void disableScreenUpdatesUntilFlush()`

+ * *native declaration : :445* + */ + abstract fun disableScreenUpdatesUntilFlush() + + /** + * This API controls whether the receiver is permitted onscreen before the user has logged in. This property is off + * by default. Alert panels and windows presented by input managers are examples of windows which should have this + * property set.

Original signature : `BOOL canBecomeVisibleWithoutLogin()`

+ * *native declaration : :451* + */ + abstract fun canBecomeVisibleWithoutLogin(): Boolean + + /** + * Original signature : `void setCanBecomeVisibleWithoutLogin(BOOL)`

+ * *native declaration : :452* + */ + abstract fun setCanBecomeVisibleWithoutLogin(flag: Boolean) + + /** + * Original signature : `void setCollectionBehavior(NSWindowCollectionBehavior)`

+ * *native declaration : :455* + */ + abstract fun setCollectionBehavior(behavior: Int) + + /** + * Original signature : `NSWindowCollectionBehavior collectionBehavior()`

+ * *native declaration : :456* + */ + abstract fun collectionBehavior(): Int + + /** + * -setCanBeVisibleOnAllSpaces: controls whether a window can be visible on all spaces (YES) or is associated with + * one space at a time (NO). The default setting is NO.

Original signature : `BOOL + * canBeVisibleOnAllSpaces()`

+ * *native declaration : :462* + */ + abstract fun canBeVisibleOnAllSpaces(): Boolean + + /** + * Original signature : `void setCanBeVisibleOnAllSpaces(BOOL)`

+ * *native declaration : :463* + */ + abstract fun setCanBeVisibleOnAllSpaces(flag: Boolean) + + /** + * Original signature : `NSString* stringWithSavedFrame()`

+ * *native declaration : :465* + */ + abstract fun stringWithSavedFrame(): String? + + /** + * Original signature : `void setFrameFromString(NSString*)`

+ * *native declaration : :466* + */ + abstract fun setFrameFromString(string: String?) + + /** + * Original signature : `void saveFrameUsingName(NSString*)`

+ * *native declaration : :467* + */ + abstract fun saveFrameUsingName(name: String?) + + /** + * Set force=YES to use setFrameUsingName on a non-resizable window

Original signature : `BOOL + * setFrameUsingName(NSString*, BOOL)`

+ * *native declaration : :469* + */ + abstract fun setFrameUsingName_force(name: String?, force: Boolean): Boolean + + /** + * Original signature : `BOOL setFrameUsingName(NSString*)`

+ * *native declaration : :470* + */ + abstract fun setFrameUsingName(name: String?): Boolean + + /** + * Original signature : `BOOL setFrameAutosaveName(NSString*)`

+ * *native declaration : :471* + */ + abstract fun setFrameAutosaveName(name: String?): Boolean + + /** + * Original signature : `NSString* frameAutosaveName()`

+ * *native declaration : :472* + */ + abstract fun frameAutosaveName(): String? + /** + * *native declaration : :476*

+ * Conversion Error : NSRect + */ + /** + * Original signature : `void restoreCachedImage()`

+ * *native declaration : :477* + */ + abstract fun restoreCachedImage() + + /** + * Original signature : `void discardCachedImage()`

+ * *native declaration : :478* + */ + abstract fun discardCachedImage() + + /** + * *native declaration : :480*

+ * Conversion Error : NSSize + */ + abstract fun minSize(): NSSize? + + /** + * *native declaration : :481*

+ * Conversion Error : NSSize + */ + abstract fun maxSize(): NSSize? + + /** + * *native declaration : :482*

+ * Conversion Error : NSSize + */ + abstract fun setMinSize(size: NSSize?) + + /** + * *native declaration : :483*

+ * Conversion Error : NSSize + */ + abstract fun setMaxSize(size: NSSize?) + + /** + * *native declaration : :485*

+ * Conversion Error : NSSize + */ + abstract fun setContentMinSize(size: NSSize?) + + /** + * *native declaration : :486*

+ * Conversion Error : NSSize + */ + abstract fun setContentMaxSize(size: NSSize?) + /** + * *native declaration : :487*

+ * Conversion Error : NSSize + */ + /** + * *native declaration : :488*

+ * Conversion Error : NSSize + */ + /** + * Original signature : `NSEvent* nextEventMatchingMask(NSUInteger)`

+ * *native declaration : :490* + */ + abstract fun nextEventMatchingMask(mask: Int): NSEvent? + + /** + * Original signature : `NSEvent* nextEventMatchingMask(NSUInteger, NSDate*, NSString*, BOOL)`

+ * *native declaration : :491* + */ + abstract fun nextEventMatchingMask_untilDate_inMode_dequeue( + mask: Int, + expiration: NSDate?, + mode: String?, + deqFlag: Boolean + ): NSEvent? + + /** + * Original signature : `void discardEventsMatchingMask(NSUInteger, NSEvent*)`

+ * *native declaration : :492* + */ + abstract fun discardEventsMatchingMask_beforeEvent(mask: Int, lastEvent: Pointer?) + + /** + * Original signature : `void postEvent(NSEvent*, BOOL)`

+ * *native declaration : :493* + */ + abstract fun postEvent_atStart(event: NSEvent?, flag: Boolean) + + /** + * Original signature : `NSEvent* currentEvent()`

+ * *native declaration : :494* + */ + abstract fun currentEvent(): NSEvent? + + /** + * Original signature : `void setAcceptsMouseMovedEvents(BOOL)`

+ * *native declaration : :495* + */ + abstract fun setAcceptsMouseMovedEvents(flag: Boolean) + + /** + * Original signature : `BOOL acceptsMouseMovedEvents()`

+ * *native declaration : :496* + */ + abstract fun acceptsMouseMovedEvents(): Boolean + + /** + * Original signature : `void setIgnoresMouseEvents(BOOL)`

+ * *native declaration : :498* + */ + abstract fun setIgnoresMouseEvents(flag: Boolean) + + /** + * Original signature : `BOOL ignoresMouseEvents()`

+ * *native declaration : :499* + */ + abstract fun ignoresMouseEvents(): Boolean + + /** + * Original signature : `NSDictionary* deviceDescription()`

+ * *native declaration : :501* + */ + abstract fun deviceDescription(): NSDictionary? + + /** + * Original signature : `void sendEvent(NSEvent*)`

+ * *native declaration : :502* + */ + abstract fun sendEvent(theEvent: NSEvent?) + + /** + * Original signature : `mouseLocationOutsideOfEventStream()`

+ * *native declaration : :503* + */ + abstract fun mouseLocationOutsideOfEventStream(): NSObject? + + /** + * Original signature : `id windowController()`

+ * *native declaration : :506* + */ + abstract fun windowController(): NSObject? + + /** + * Original signature : `void setWindowController(NSWindowController*)`

+ * *native declaration : :507* + */ + abstract fun setWindowController(windowController: NSObject?) + + /** + * Original signature : `BOOL isSheet()`

+ * *native declaration : :509* + */ + abstract val isSheet: Boolean + + /** + * Original signature : `NSWindow* attachedSheet()`

+ * *native declaration : :510* + */ + abstract fun attachedSheet(): NSWindow? + + /** + * Original signature : `NSButton* standardWindowButton(NSWindowButton)`

+ * *native declaration : :514* + */ + abstract fun standardWindowButton(b: Int): NSButton? + /** + * *native declaration : :518*

+ * Conversion Error : /// Original signature : `void addChildWindow(NSWindow*, null)`

+ * - (void)addChildWindow:(NSWindow*)childWin ordered:(null)place; (Argument place cannot be converted) + */ + /** + * Original signature : `void removeChildWindow(NSWindow*)`

+ * *native declaration : :519* + */ + abstract fun removeChildWindow(childWin: NSWindow?) + + /** + * Original signature : `NSArray* childWindows()`

+ * *native declaration : :520* + */ + abstract fun childWindows(): NSArray? + + /** + * Original signature : `NSWindow* parentWindow()`

+ * *native declaration : :522* + */ + abstract fun parentWindow(): NSWindow? + + /** + * Original signature : `void setParentWindow(NSWindow*)`

+ * *native declaration : :523* + */ + abstract fun setParentWindow(window: NSWindow?) + + /** + * Returns NSGraphicsContext used to render the receiver's content on the screen for the calling thread.

+ * Original signature : `NSGraphicsContext* graphicsContext()`

+ * *native declaration : :529* + */ + abstract fun graphicsContext(): Pointer? + + /** + * Returns scale factor applied to view coordinate system to get to base coordinate system of window

Original + * signature : `CGFloat userSpaceScaleFactor()`

+ * *native declaration : :533* + */ + abstract fun userSpaceScaleFactor(): CGFloat? + + /** + * Original signature : `void setInitialFirstResponder(NSView*)`

+ * *from NSKeyboardUI native declaration : :539* + */ + abstract fun setInitialFirstResponder(view: NSView?) + + /** + * Original signature : `NSView* initialFirstResponder()`

+ * *from NSKeyboardUI native declaration : :540* + */ + abstract fun initialFirstResponder(): NSView? + + /** + * Original signature : `void selectNextKeyView(id)`

+ * *from NSKeyboardUI native declaration : :541* + */ + abstract fun selectNextKeyView(sender: ID?) + + /** + * Original signature : `void selectPreviousKeyView(id)`

+ * *from NSKeyboardUI native declaration : :542* + */ + abstract fun selectPreviousKeyView(sender: ID?) + + /** + * Original signature : `void selectKeyViewFollowingView(NSView*)`

+ * *from NSKeyboardUI native declaration : :543* + */ + abstract fun selectKeyViewFollowingView(aView: NSView?) + + /** + * Original signature : `void selectKeyViewPrecedingView(NSView*)`

+ * *from NSKeyboardUI native declaration : :544* + */ + abstract fun selectKeyViewPrecedingView(aView: NSView?) + + /** + * Original signature : `NSSelectionDirection keyViewSelectionDirection()`

+ * *from NSKeyboardUI native declaration : :545* + */ + abstract fun keyViewSelectionDirection(): Int + + /** + * Original signature : `void setDefaultButtonCell(NSButtonCell*)`

+ * *from NSKeyboardUI native declaration : :546* + */ + abstract fun setDefaultButtonCell(defButt: NSButtonCell?) + + /** + * Original signature : `NSButtonCell* defaultButtonCell()`

+ * *from NSKeyboardUI native declaration : :547* + */ + abstract fun defaultButtonCell(): NSButtonCell? + + /** + * Original signature : `void disableKeyEquivalentForDefaultButtonCell()`

+ * *from NSKeyboardUI native declaration : :548* + */ + abstract fun disableKeyEquivalentForDefaultButtonCell() + + /** + * Original signature : `void enableKeyEquivalentForDefaultButtonCell()`

+ * *from NSKeyboardUI native declaration : :549* + */ + abstract fun enableKeyEquivalentForDefaultButtonCell() + + /** + * Original signature : `void setAutorecalculatesKeyViewLoop(BOOL)`

+ * *from NSKeyboardUI native declaration : :551* + */ + abstract fun setAutorecalculatesKeyViewLoop(flag: Boolean) + + /** + * Original signature : `BOOL autorecalculatesKeyViewLoop()`

+ * *from NSKeyboardUI native declaration : :552* + */ + abstract fun autorecalculatesKeyViewLoop(): Boolean + + /** + * Original signature : `void recalculateKeyViewLoop()`

+ * *from NSKeyboardUI native declaration : :553* + */ + abstract fun recalculateKeyViewLoop() + + /** + * Original signature : `void setToolbar(NSToolbar*)`

+ * *from NSToolbarSupport native declaration : :558* + */ + abstract fun setToolbar(toolbar: NSToolbar?) + + /** + * The style of the titlebar area when the window displays a toolbar. + * + * @param toolbarStyle [NSWindowToolbarStyle] + */ + abstract fun setToolbarStyle(toolbarStyle: Int) + + /** + * Original signature : `NSToolbar* toolbar()`

+ * *from NSToolbarSupport native declaration : :559* + */ + abstract fun toolbar(): NSToolbar? + + /** + * Original signature : `void toggleToolbarShown(id)`

+ * *from NSToolbarSupport native declaration : :560* + */ + abstract fun toggleToolbarShown(sender: ID?) + + /** + * Original signature : `void runToolbarCustomizationPalette(id)`

+ * *from NSToolbarSupport native declaration : :561* + */ + abstract fun runToolbarCustomizationPalette(sender: ID?) + + /** + * Original signature : `void setShowsToolbarButton(BOOL)`

+ * *from NSToolbarSupport native declaration : :563* + */ + abstract fun setShowsToolbarButton(show: Boolean) + + /** + * Original signature : `BOOL showsToolbarButton()`

+ * *from NSToolbarSupport native declaration : :564* + */ + abstract fun showsToolbarButton(): Boolean + /** + * *from NSDrag native declaration : :569*

+ * Conversion Error : /// Original signature : `void dragImage(NSImage*, null, NSSize, NSEvent*, NSPasteboard*, id, BOOL)`

+ * - (void)dragImage:(NSImage*)anImage at:(null)baseLocation offset:(NSSize)initialOffset event:(NSEvent*)event pasteboard:(NSPasteboard*)pboard source:(id)sourceObj slideBack:(BOOL)slideFlag; (Argument baseLocation cannot be converted) + */ + /** + * Original signature : `void registerForDraggedTypes(NSArray*)`

+ * *from NSDrag native declaration : :571* + */ + abstract fun registerForDraggedTypes(types: NSArray?) + + /** + * Original signature : `void unregisterDraggedTypes()`

+ * *from NSDrag native declaration : :572* + */ + abstract fun unregisterDraggedTypes() + + abstract fun addTitlebarAccessoryViewController(controller: NSTitlebarAccessoryViewController?) + + /** + * @return A value that allows a group of related windows. + */ + abstract fun tabbingIdentifier(): String? + + /** + * By default, a window generates a tabbing identifier from inherent window properties, such as the window class + * name, the delegate class name, the window controller class name, and some additional state. Group windows + * together by using the same tabbing identifier. + * + * @param identifier A value that allows a group of related windows. + */ + abstract fun setTabbingIdentifier(identifier: String?) + + /** + * @return A Boolean value that indicates whether the window prevents application termination when modal. The value + * of this property is YES if the window prevents application termination when modal; otherwise, NO. The default + * value is YES. + */ + abstract fun preventsApplicationTerminationWhenModal(): Boolean + + /** + * Usually, application termination is prevented when a modal window or sheet is open, without consulting the + * application delegate. Some windows may wish not to prevent termination, however. Setting this property to NO + * overrides the default behavior and allows termination to proceed even if the window is open, either through the + * sudden termination path if enabled, or after consulting the application delegate. + * + * @param value A Boolean value that indicates whether the window prevents application termination when modal. + */ + abstract fun setPreventsApplicationTerminationWhenModal(value: Boolean) + + /** + * When the value of this property is true, the title bar does not draw its background, which allows all content + * underneath it to show through. It only makes sense to set this property to true when + * NSFullSizeContentViewWindowMask is also set. + * + * @param value A Boolean value that indicates whether the title bar draws its background. + */ + abstract fun setTitlebarAppearsTransparent(value: Boolean) + + companion object { + private val CLASS: _Class = Rococoa.createClass("NSWindow", _Class::class.java) + + /// native declaration : line 22 + const val NSBorderlessWindowMask: Int = 0 + + /// native declaration : line 23 + const val NSTitledWindowMask: Int = 1 shl 0 + + /// native declaration : line 24 + const val NSClosableWindowMask: Int = 1 shl 1 + + /// native declaration : line 25 + const val NSMiniaturizableWindowMask: Int = 1 shl 2 + + /// native declaration : line 26 + const val NSResizableWindowMask: Int = 1 shl 3 + + /** + * Specifies a window with textured background (eg. metal)

+ * *native declaration : line 34* + */ + const val NSTexturedBackgroundWindowMask: Int = 1 shl 8 + + /** + * Specifies a window that ignores the userSpaceScaleFactor of the NSScreen on which it is created. Currently + * restricted to borderless windows (NSBorderlessWindowMask)

+ * *native declaration : line 42* + */ + const val NSUnscaledWindowMask: Int = 1 shl 11 + + /** + * Specifies a window whose titlebar and toolbar have a unified look - that is, a continuous background

+ * *native declaration : line 48* + */ + const val NSUnifiedTitleAndToolbarWindowMask: Int = 1 shl 12 + + /** + * used with NSRunLoop's performSelector:target:argument:order:modes:

+ * *native declaration : line 55* + */ + const val NSDisplayWindowRunLoopOrdering: Int = 600000 + + /** + * used with NSRunLoop's performSelector:target:argument:order:modes:

+ * *native declaration : line 56* + */ + const val NSResetCursorRectsRunLoopOrdering: Int = 700000 + + /** + * Window contents may not be read by another process

+ * *native declaration : line 62* + */ + const val NSWindowSharingNone: Int = 0 + + /** + * Window contents may be read but not modified by another process

+ * *native declaration : line 63* + */ + const val NSWindowSharingReadOnly: Int = 1 + + /** + * Window contents may be read or modified by another process

+ * *native declaration : line 64* + */ + const val NSWindowSharingReadWrite: Int = 2 + + /** + * System determines if window backing store is in VRAM or main memory

+ * *native declaration : line 70* + */ + const val NSWindowBackingLocationDefault: Int = 0 + + /** + * Window backing store is in VRAM

+ * *native declaration : line 71* + */ + const val NSWindowBackingLocationVideoMemory: Int = 1 + + /** + * Window backing store is in main memory

+ * *native declaration : line 72* + */ + const val NSWindowBackingLocationMainMemory: Int = 2 + + /// native declaration : line 78 + const val NSWindowCollectionBehaviorDefault: Int = 0 + + /// native declaration : line 79 + const val NSWindowCollectionBehaviorCanJoinAllSpaces: Int = 1 shl 0 + + /// native declaration : line 80 + const val NSWindowCollectionBehaviorMoveToActiveSpace: Int = 1 shl 1 + + /** + * You may specify at most one of NSWindowCollectionBehaviorManaged, NSWindowCollectionBehaviorTransient, or + * NSWindowCollectionBehaviorStationary. If unspecified, the window gets the default behavior determined by its + * window level

participates in spaces, expos\u00e9. Default behavior if windowLevel == + * NSNormalWindowLevel

+ * *native declaration : line 86* + */ + const val NSWindowCollectionBehaviorManaged: Int = 1 shl 2 + + /** + * You may specify at most one of NSWindowCollectionBehaviorManaged, NSWindowCollectionBehaviorTransient, or + * NSWindowCollectionBehaviorStationary. If unspecified, the window gets the default behavior determined by its + * window level

floats in spaces, hidden by expos\u00e9. Default behavior if windowLevel != + * NSNormalWindowLevel

+ * *native declaration : line 87* + */ + const val NSWindowCollectionBehaviorTransient: Int = 1 shl 3 + + /** + * You may specify at most one of NSWindowCollectionBehaviorManaged, NSWindowCollectionBehaviorTransient, or + * NSWindowCollectionBehaviorStationary. If unspecified, the window gets the default behavior determined by its + * window level

unaffected by expos\u00e9. Stays visible and stationary, like desktop window

+ * *native declaration : line 88* + */ + const val NSWindowCollectionBehaviorStationary: Int = 1 shl 4 + + /** + * You may specify at most one of NSWindowCollectionBehaviorParticipatesInCycle or + * NSWindowCollectionBehaviorIgnoresCycle. If unspecified, the window gets the default behavior determined by its + * window level

default behavior if windowLevel == NSNormalWindowLevel

+ * *native declaration : line 93* + */ + const val NSWindowCollectionBehaviorParticipatesInCycle: Int = 1 shl 5 + + /** + * You may specify at most one of NSWindowCollectionBehaviorParticipatesInCycle or + * NSWindowCollectionBehaviorIgnoresCycle. If unspecified, the window gets the default behavior determined by its + * window level

default behavior if windowLevel != NSNormalWindowLevel

+ * *native declaration : line 94* + */ + const val NSWindowCollectionBehaviorIgnoresCycle: Int = 1 shl 6 + + fun setAllowsAutomaticWindowTabbing(automatic: Boolean) { + if (Rococoa.cast(CLASS, NSObject::class.java).respondsToSelector( + Foundation.selector("setAllowsAutomaticWindowTabbing:") + ) + ) { + CLASS.setAllowsAutomaticWindowTabbing(automatic) + } + } + + /** + * *native declaration : :223*

+ * Conversion Error : NSRect + */ + fun minFrameWidthWithTitle_styleMask(aTitle: String?, aStyle: NSUInteger?): CGFloat { + return CLASS.minFrameWidthWithTitle_styleMask(aTitle, aStyle) + } + + /** + * Original signature : `+(CGFloat)minFrameWidthWithTitle:(NSString*) styleMask:(NSUInteger)`

+ * *native declaration : line 248* + */ + fun contentRectForFrameRect_styleMask(windowFrame: NSRect?, windowStyle: NSUInteger?): NSRect { + return CLASS.contentRectForFrameRect_styleMask(windowFrame, windowStyle) + } + + /** + * *native declaration : :224*

+ * Conversion Error : NSRect + */ + fun frameRectForContentRect_styleMask(cRect: NSRect?, aStyle: NSUInteger?): NSRect { + return CLASS.frameRectForContentRect_styleMask(cRect, aStyle) + } + + const val WindowDidBecomeKeyNotification: String = "NSWindowDidBecomeKeyNotification" + const val WindowDidBecomeMainNotification: String = "NSWindowDidBecomeMainNotification" + const val WindowDidChangeScreenNotification: String = "NSWindowDidChangeScreenNotification" + const val WindowDidChangeScreenProfileNotification: String = "NSWindowDidChangeScreenProfileNotification" + const val WindowDidDeminiaturizeNotification: String = "NSWindowDidDeminiaturizeNotification" + const val WindowDidEndSheetNotification: String = "NSWindowDidEndSheetNotification" + const val WindowDidExposeNotification: String = "NSWindowDidExposeNotification" + const val WindowDidMiniaturizeNotification: String = "NSWindowDidMiniaturizeNotification" + const val WindowDidMoveNotification: String = "NSWindowDidMoveNotification" + const val WindowDidResignKeyNotification: String = "NSWindowDidResignKeyNotification" + const val WindowDidResignMainNotification: String = "NSWindowDidResignMainNotification" + const val WindowDidResizeNotification: String = "NSWindowDidResizeNotification" + const val WindowDidUpdateNotification: String = "NSWindowDidUpdateNotification" + const val WindowWillBeginSheetNotification: String = "NSWindowWillBeginSheetNotification" + const val WindowWillCloseNotification: String = "NSWindowWillCloseNotification" + const val WindowWillMiniaturizeNotification: String = "NSWindowWillMiniaturizeNotification" + const val WindowWillMoveNotification: String = "NSWindowWillMoveNotification" + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSWorkspace.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSWorkspace.kt new file mode 100644 index 00000000..aa016bc4 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/NSWorkspace.kt @@ -0,0 +1,444 @@ +package darwin + +import com.sun.jna.Pointer +import org.rococoa.ObjCClass +import org.rococoa.cocoa.foundation.NSInteger +import org.rococoa.cocoa.foundation.NSUInteger + +/// native declaration : :43 +abstract class NSWorkspace : NSObject() { + interface _Class : ObjCClass { + /** + * Original signature : `NSWorkspace* sharedWorkspace)`

+ * *native declaration : :54* + */ + open fun sharedWorkspace(): NSWorkspace? + } + + /** + * Original signature : `NSNotificationCenter* notificationCenter)`

+ * *native declaration : :56* + */ + abstract fun notificationCenter(): NSNotificationCenter? + + /** + * Original signature : `BOOL openFile(NSString*)`

+ * *native declaration : :58* + */ + abstract fun openFile(fullPath1: String?): Boolean + + /** + * Original signature : `BOOL openFile(NSString*, NSString*)`

+ * *native declaration : :59* + */ + abstract fun openFile_withApplication(fullPath1: String?, appName2: String?): Boolean + + fun openFile(fullPath1: String?, appName2: String?): Boolean { + return this.openFile_withApplication(fullPath1, appName2) + } + + /** + * Original signature : `BOOL openFile(NSString*, NSString*, BOOL)`

+ * *native declaration : :60* + */ + abstract fun openFile_withApplication_andDeactivate(appName2: String?, flag3: Boolean): Boolean + + /** + * Original signature : `BOOL openTempFile(NSString*)`

+ * *native declaration : :62* + */ + abstract fun openTempFile(fullPath1: String?): Boolean + /** + * *native declaration : :64*

+ * Conversion Error : NSPoint + */ + /** + * Original signature : `BOOL openURL(NSURL*)`

+ * *native declaration : :66* + */ + abstract fun openURL(url1: NSURL?): Boolean + + /** + * Original signature : `BOOL launchApplication(NSString*)`

+ * *native declaration : :68* + */ + abstract fun launchApplication(appName1: String?): Boolean + + /** + * Original signature : `BOOL launchApplication(NSString*, BOOL, BOOL)`

+ * *native declaration : :69* + */ + abstract fun launchApplication_showIcon_autolaunch( + appName1: String?, + showIcon2: Boolean, + autolaunch3: Boolean + ): Boolean + + /** + * Original signature : `NSString* fullPathForApplication(NSString*)`

+ * *native declaration : :70* + */ + abstract fun fullPathForApplication(appName1: String?): String? + + /** + * Original signature : `BOOL selectFile(NSString*, NSString*)`

+ * *native declaration : :72* + */ + abstract fun selectFile_inFileViewerRootedAtPath(fullpath: String?, rootpath: String?): Boolean + + /** + * @param fullpath The full path of the file to select. + * @param rootpath If a path is specified, a new file viewer is opened. If you specify an + * empty string (@"") for this parameter, the file is selected in the main viewer. + * @return YES if the file was successfully selected; otherwise, NO. + */ + fun selectFile(fullpath: String?, rootpath: String?): Boolean { + return selectFile_inFileViewerRootedAtPath(fullpath, rootpath) + } + + /** + * Original signature : `void findApplications)`

+ * *native declaration : :74* + */ + abstract fun findApplications() + + /** + * Original signature : `public abstract void noteFileSystemChanged)`

+ * *native declaration : :76* + */ + abstract fun noteFileSystemChanged() + + /** + * Original signature : `public abstract void noteFileSystemChanged(NSString*)`

+ * *native declaration : :77* + */ + abstract fun noteFileSystemChanged(path1: String?) + + /** + * Original signature : `BOOL fileSystemChanged)`

+ * *native declaration : :78* + */ + abstract fun fileSystemChanged(): Boolean + + /** + * Original signature : `public abstract void noteUserDefaultsChanged)`

+ * *native declaration : :79* + */ + abstract fun noteUserDefaultsChanged() + + /** + * Original signature : `BOOL userDefaultsChanged)`

+ * *native declaration : :80* + */ + abstract fun userDefaultsChanged(): Boolean + + /** + * Original signature : `BOOL getInfoForFile(NSString*, NSString**, NSString**)`

+ * *native declaration : :82* + */ + abstract fun getInfoForFile_application_type( + fullPath1: String?, + appName2: com.sun.jna.ptr.PointerByReference?, + type3: com.sun.jna.ptr.PointerByReference? + ): Boolean + + /** + * Original signature : `BOOL isFilePackageAtPath(NSString*)`

+ * *native declaration : :83* + */ + abstract fun isFilePackageAtPath(fullPath1: String?): Boolean + + /** + * Original signature : `NSImage* iconForFile(NSString*)`

+ * *native declaration : :85* + */ + abstract fun iconForFile(fullPath1: String?): NSImage? + + /** + * Original signature : `NSImage* iconForFiles(NSArray*)`

+ * *native declaration : :86* + */ + abstract fun iconForFiles(fullPaths1: NSArray?): NSImage? + + /** + * Original signature : `NSImage* iconForFileType(NSString*)`

+ * *native declaration : :87* + */ + abstract fun iconForFileType(fileType1: String?): NSImage? + + /** + * Original signature : `BOOL setIcon(NSImage*, NSString*, NSWorkspaceIconCreationOptions)`

+ * *native declaration : :89* + */ + abstract fun setIcon_forFile_options(image1: NSImage?, fullPath2: String?, options3: NSUInteger?): Boolean + + /** + * Original signature : `BOOL getFileSystemInfoForPath(NSString*, BOOL*, BOOL*, BOOL*, NSString**, NSString**)`

+ * *native declaration : :92* + */ + abstract fun getFileSystemInfoForPath_isRemovable_isWritable_isUnmountable_description_type( + fullPath1: String?, + removableFlag2: Boolean, + writableFlag3: Boolean, + unmountableFlag4: Boolean, + description5: com.sun.jna.ptr.PointerByReference?, + fileSystemType6: com.sun.jna.ptr.PointerByReference? + ): Boolean + + /** + * Original signature : `BOOL performFileOperation(NSString*, NSString*, NSString*, NSArray*, NSInteger*)`

+ * Returned tag < 0 on failure, 0 if sync, > 0 if async

+ * *native declaration : :94* + */ + abstract fun performFileOperation_source_destination_files_tag( + operation1: String?, + source2: String?, + destination3: String?, + files4: NSArray?, + tag5: NSInteger? + ): Boolean + + fun performFileOperation(operation: String?, source: String?, destination: String?, files: NSArray?): Boolean { + return this.performFileOperation_source_destination_files_tag( + operation, + source, + destination, + files, + NSInteger(0) + ) + } + + /** + * Original signature : `BOOL unmountAndEjectDeviceAtPath(NSString*)`

+ * *native declaration : :96* + */ + abstract fun unmountAndEjectDeviceAtPath(path1: String?): Boolean + + /** + * Original signature : `NSInteger extendPowerOffBy(NSInteger)`

+ * *native declaration : :97* + */ + abstract fun extendPowerOffBy(requested1: NSInteger?): NSInteger? + /** + * *native declaration : :99*

+ * Conversion Error : NSPoint + */ + /** + * Original signature : `public abstract void hideOtherApplications)`

+ * *native declaration : :101* + */ + abstract fun hideOtherApplications() + + /** + * Original signature : `NSArray* mountedLocalVolumePaths)`

+ * *native declaration : :103* + */ + abstract fun mountedLocalVolumePaths(): NSArray? + + /** + * Original signature : `NSArray* mountedRemovableMedia)`

+ * *native declaration : :104* + */ + abstract fun mountedRemovableMedia(): NSArray? + + /** + * Original signature : `NSArray* mountNewRemovableMedia)`

+ * *native declaration : :105* + */ + abstract fun mountNewRemovableMedia(): NSArray? + + /** + * Original signature : `public abstract void checkForRemovableMedia)`

+ * *native declaration : :106* + */ + abstract fun checkForRemovableMedia() + + /** + * Original signature : `NSString* absolutePathForAppBundleWithIdentifier(NSString*)`

+ * *native declaration : :110* + */ + abstract fun absolutePathForAppBundleWithIdentifier(bundleIdentifier1: String?): String? + + /** + * Original signature : `BOOL launchAppWithBundleIdentifier(NSString*, NSWorkspaceLaunchOptions, NSAppleEventDescriptor*, NSNumber**)`

+ * *native declaration : :111* + */ + abstract fun launchAppWithBundleIdentifier_options_additionalEventParamDescriptor_launchIdentifier( + bundleIdentifier1: String?, + options2: Int, + descriptor3: Pointer?, + identifier4: com.sun.jna.ptr.PointerByReference? + ): Boolean + + /** + * Original signature : `BOOL openURLs(NSArray*, NSString*, NSWorkspaceLaunchOptions, NSAppleEventDescriptor*, NSArray**)`

+ * *native declaration : :112* + */ + abstract fun openURLs_withAppBundleIdentifier_options_additionalEventParamDescriptor_launchIdentifiers( + urls1: NSArray?, + bundleIdentifier2: String?, + options3: Int, + descriptor4: Pointer?, + identifiers5: com.sun.jna.ptr.PointerByReference? + ): Boolean + + /** + * Original signature : `NSArray* launchedApplications)`

+ * Returns an array of dictionaries, one for each running application.

+ * *native declaration : :127* + */ + abstract fun launchedApplications(): NSArray? + + /** + * Original signature : `NSDictionary* activeApplication)`

+ * Returns a dictionary with information about the current active application.

+ * *native declaration : :128* + */ + abstract fun activeApplication(): NSArray? + + /** + * Given an absolute file path, return the uniform type identifier (UTI) of the file, if one can be determined. Otherwise, return nil after setting *outError to an NSError that encapsulates the reason why the file's type could not be determined. If the file at the end of the path is a symbolic link the type of the symbolic link will be returned.

+ * You can invoke this method to get the UTI of an existing file.

+ * Original signature : `NSString* typeOfFile(NSString*, NSError**)`

+ * *native declaration : :138* + */ + abstract fun typeOfFile_error(absoluteFilePath1: String?, outError2: com.sun.jna.ptr.PointerByReference?): String? + + /** + * Given a UTI, return a string that describes the document type and is fit to present to the user, or nil for failure.

+ * You can invoke this method to get the name of a type that must be shown to the user, in an alert about your application's inability to handle the type, for instance.

+ * Original signature : `NSString* localizedDescriptionForType(NSString*)`

+ * *native declaration : :144* + */ + abstract fun localizedDescriptionForType(typeName1: String?): String? + + /** + * Given a UTI, return the best file name extension to use when creating a file of that type, or nil for failure.

+ * You can invoke this method when your application has only the base name of a file that's being written and it has to append a file name extension so that the file's type can be reliably identified later on.

+ * Original signature : `NSString* preferredFilenameExtensionForType(NSString*)`

+ * *native declaration : :150* + */ + abstract fun preferredFilenameExtensionForType(typeName1: String?): String? + + /** + * Given a file name extension and a UTI, return YES if the file name extension is a valid tag for the identified type, NO otherwise.

+ * You can invoke this method when your application needs to check if a file name extension can be used to reliably identify the type later on. For example, NSSavePanel uses this method to validate any extension that the user types in the panel's file name field.

+ * Original signature : `BOOL filenameExtension(NSString*, NSString*)`

+ * *native declaration : :156* + */ + abstract fun filenameExtension_isValidForType(filenameExtension1: String?, typeName2: String?): Boolean + + /** + * Given two UTIs, return YES if the first "conforms to" to the second in the uniform type identifier hierarchy, NO otherwise. This method will always return YES if the two strings are equal, so you can also use it with other kinds of type name, including those declared in CFBundleTypeName Info.plist entries in apps that don't take advantage of the support for UTIs that was added to Cocoa in Mac OS 10.5.

+ * You can invoke this method when your application must determine whether it can handle a file of a known type, returned by -typeOfFile:error: for instance.

+ * Use this method instead of merely comparing UTIs for equality.

+ * Original signature : `BOOL type(NSString*, NSString*)`

+ * *native declaration : :164* + */ + abstract fun type_conformsToType(firstTypeName1: String?, secondTypeName2: String?): Boolean + + /** + * macOS 12.0+ + */ + abstract fun setDefaultApplicationAtURL_toOpenURLsWithScheme_completionHandler( + applicationURL: NSURL?, + urlScheme: String?, + completionHandler: Pointer? + ) + + /** + * macOS 12.0+ + */ + abstract fun URLsForApplicationsToOpenURL(url: NSURL?): NSArray? + + /** + * Returns the URL to the default app that would be opened. + * macOS 10.6+ + * + * @param url The URL of the file to open. + * @return The URL of the default app that would open the specified url. Returns nil if no app is able to open the URL, or if the file URL does not exist. + */ + abstract fun URLForApplicationToOpenURL(url: NSURL?): NSURL? + + companion object { + private val CLASS: _Class = org.rococoa.Rococoa.createClass("NSWorkspace", _Class::class.java) + + val WorkspaceDidLaunchApplicationNotification: String? = "NSWorkspaceDidLaunchApplicationNotification" + val WorkspaceDidMountNotification: String? = "NSWorkspaceDidMountNotification" + val WorkspaceDidPerformFileOperationNotification: String? = "NSWorkspaceDidPerformFileOperationNotification" + val WorkspaceDidTerminateApplicationNotification: String? = "NSWorkspaceDidTerminateApplicationNotification" + val WorkspaceDidUnmountNotification: String? = "NSWorkspaceDidUnmountNotification" + val WorkspaceDidWakeNotification: String? = "NSWorkspaceDidWakeNotification" + val WorkspaceWillLaunchApplicationNotification: String? = "NSWorkspaceWillLaunchApplicationNotification" + val WorkspaceWillPowerOffNotification: String? = "NSWorkspaceWillPowerOffNotification" + val WorkspaceWillSleepNotification: String? = "NSWorkspaceWillSleepNotification" + val WorkspaceWillUnmountNotification: String? = "NSWorkspaceWillUnmountNotification" + val WorkspaceSessionDidBecomeActiveNotification: String? = "NSWorkspaceSessionDidBecomeActiveNotification" + val WorkspaceSessionDidResignActiveNotification: String? = "NSWorkspaceSessionDidResignActiveNotification" + + /// native declaration : :13 + const val NSWorkspaceLaunchAndPrint: Int = 2 + + /// native declaration : :14 + const val NSWorkspaceLaunchInhibitingBackgroundOnly: Int = 128 + + /// native declaration : :15 + const val NSWorkspaceLaunchWithoutAddingToRecents: Int = 256 + + /// native declaration : :16 + const val NSWorkspaceLaunchWithoutActivation: Int = 512 + + /// native declaration : :17 + const val NSWorkspaceLaunchAsync: Int = 65536 + + /// native declaration : :18 + const val NSWorkspaceLaunchAllowingClassicStartup: Int = 131072 + + /// native declaration : :19 + const val NSWorkspaceLaunchPreferringClassic: Int = 262144 + + /// native declaration : :20 + const val NSWorkspaceLaunchNewInstance: Int = 524288 + + /// native declaration : :21 + const val NSWorkspaceLaunchAndHide: Int = 1048576 + + /// native declaration : :22 + const val NSWorkspaceLaunchAndHideOthers: Int = 2097152 + + /** + * NSWorkspaceLaunchAndDisplayFailures

+ * *native declaration : :24* + */ + const val NSWorkspaceLaunchDefault: Int = NSWorkspaceLaunchAsync or NSWorkspaceLaunchAllowingClassicStartup + + /// native declaration : :32 + const val NSExcludeQuickDrawElementsIconCreationOption: Int = 1 shl 1 + + /// native declaration : :33 + const val NSExclude10_4ElementsIconCreationOption: Int = 1 shl 2 + + val ApplicationName: String? = "NSApplicationName" + val DevicePath: String? = "NSDevicePath" + val OperationNumber: String? = "NSOperationNumber" + val PlainFileType: String? = "" + val DirectoryFileType: String? = "NXDirectoryFileType" + val ApplicationFileType: String? = "app" + val FilesystemFileType: String? = "NXFilesystemFileType" + val ShellCommandFileType: String? = "NXShellCommandFileType" + val MoveOperation: String? = "move" + val CopyOperation: String? = "copy" + val LinkOperation: String? = "link" + val CompressOperation: String? = "compress" + val DecompressOperation: String? = "decompress" + val EncryptOperation: String? = "encrypt" + val DecryptOperation: String? = "decrypt" + val DestroyOperation: String? = "destroy" + val RecycleOperation: String? = "recycle" + val DuplicateOperation: String? = "duplicate" + + fun sharedWorkspace(): NSWorkspace? { + return CLASS.sharedWorkspace() + } + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/SheetCallback.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/SheetCallback.kt new file mode 100644 index 00000000..00b570e4 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/SheetCallback.kt @@ -0,0 +1,27 @@ +package darwin + +interface SheetCallback { + /** + * Called after the sheet has been dismissed by the user. + * + * @param returncode Selected button + */ + open fun callback(returncode: Int) + + companion object { + /** + * Use default option; 'OK' + */ + val DEFAULT_OPTION: Int = NSAlert.NSAlertDefaultReturn + + /** + * Cancel option + */ + val CANCEL_OPTION: Int = NSAlert.NSAlertOtherReturn + + /** + * Alternate action + */ + val ALTERNATE_OPTION: Int = NSAlert.NSAlertAlternateReturn + } +} diff --git a/bindings/wgpu/librococoa/src/main/kotlin/darwin/WindowListener.kt b/bindings/wgpu/librococoa/src/main/kotlin/darwin/WindowListener.kt new file mode 100644 index 00000000..bd8a4137 --- /dev/null +++ b/bindings/wgpu/librococoa/src/main/kotlin/darwin/WindowListener.kt @@ -0,0 +1,8 @@ +package darwin + +interface WindowListener { + /** + * Sent after NSWindow.WindowWillCloseNotification is fired for this window + */ + open fun windowWillClose() +} diff --git a/bindings/wgpu/settings.gradle.kts b/bindings/wgpu/settings.gradle.kts new file mode 100644 index 00000000..685145d7 --- /dev/null +++ b/bindings/wgpu/settings.gradle.kts @@ -0,0 +1,20 @@ +rootProject.name = "wgpu" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + mavenLocal() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + } +} + +include("wgpu4k") +include("librococoa") +//include("examples") +include("examples:common") +//include("examples:compose") +include("examples:web-js") +//include("examples:SDL2") +include("examples:glfw") +include("webgpu-samples-ts") diff --git a/bindings/wgpu/webgpu-samples-ts/.eslintrc.cjs b/bindings/wgpu/webgpu-samples-ts/.eslintrc.cjs new file mode 100644 index 00000000..95a7be09 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/.eslintrc.cjs @@ -0,0 +1,14 @@ +module.exports = { + parser: '@typescript-eslint/parser', + extends: [ + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', + ], + plugins: ['@typescript-eslint', 'eslint-plugin-html', 'prettier'], + rules: { + '@typescript-eslint/no-unused-vars': [ + 'error', + {vars: 'all', args: 'after-used', ignoreRestSiblings: true}, + ], + }, +}; diff --git a/bindings/wgpu/webgpu-samples-ts/.github/workflows/build-and-deploy.yml b/bindings/wgpu/webgpu-samples-ts/.github/workflows/build-and-deploy.yml new file mode 100644 index 00000000..ca587f16 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/.github/workflows/build-and-deploy.yml @@ -0,0 +1,40 @@ +name: Build and Deploy +on: + push: + branches: + - main +jobs: + build-and-deploy: + runs-on: ubuntu-latest + env: + BASE_PATH: /webgpu-samples + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2.3.1 + with: + persist-credentials: false + + - uses: actions/setup-node@v2-beta + with: + node-version: "18.x" + + - uses: actions/cache@v2 + with: + path: ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }} + + - name: Install and Build 🔧 + run: | + export REPOSITORY_NAME=${{ github.repository }} + npm ci + npm run-script lint + npm run-script build + touch out/.nojekyll + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@3.6.2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: out + CLEAN: true diff --git a/bindings/wgpu/webgpu-samples-ts/.github/workflows/build.yml b/bindings/wgpu/webgpu-samples-ts/.github/workflows/build.yml new file mode 100644 index 00000000..030e6f86 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Build +on: + pull_request: + branches: + - main + push: + branches: + - nextjs # Testing the workflow on this branch. +jobs: + build: + runs-on: ubuntu-latest + env: + BASE_PATH: /webgpu-samples + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2.3.1 + with: + persist-credentials: false + + - uses: actions/setup-node@v2-beta + with: + node-version: "18.x" + + - uses: actions/cache@v2 + with: + path: ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }} + + - name: Install and Build 🔧 + run: | + export REPOSITORY_NAME=${{ github.repository }} + npm ci + npm run-script lint + npm run-script build diff --git a/bindings/wgpu/webgpu-samples-ts/.gitignore b/bindings/wgpu/webgpu-samples-ts/.gitignore new file mode 100644 index 00000000..4d5a5a8a --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +.next/ +out/ +id_rsa_deploy_key +id_rsa_deploy_key.pub +github_token +pnpm-lock.yaml +.DS_Store diff --git a/bindings/wgpu/webgpu-samples-ts/.prettierrc.cjs b/bindings/wgpu/webgpu-samples-ts/.prettierrc.cjs new file mode 100644 index 00000000..522cec99 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/.prettierrc.cjs @@ -0,0 +1,7 @@ +module.exports = { + printWidth: 80, + tabWidth: 2, + useTabs: false, + semi: true, + singleQuote: true, +}; diff --git a/bindings/wgpu/webgpu-samples-ts/LICENSE.txt b/bindings/wgpu/webgpu-samples-ts/LICENSE.txt new file mode 100644 index 00000000..e7a21bee --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/LICENSE.txt @@ -0,0 +1,26 @@ +Copyright 2019 WebGPU Samples Contributors + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/bindings/wgpu/webgpu-samples-ts/README.md b/bindings/wgpu/webgpu-samples-ts/README.md new file mode 100644 index 00000000..d309d040 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/README.md @@ -0,0 +1,20 @@ +# WebGPU Samples + +**Please visit the [WebGPU Samples website](//webgpu.github.io/webgpu-samples/) to run the samples!** + +The WebGPU Samples are a set of samples and demos +demonstrating the use of the [WebGPU API](//webgpu.dev). Please see the current +implementation status and how to run WebGPU in your browser at +[webgpu.io](//webgpu.io). + +## Building + +`webgpu-samples` is built with [Typescript](https://www.typescriptlang.org/) +and compiled using [Next.js](https://nextjs.org/). Building the project +requires an installation of [Node.js](https://nodejs.org/en/). + +- Install dependencies: `npm install`. +- For development, start the dev server which will watch and recompile + sources: `npm start`. You can navigate to http://localhost:3000 to view the project. +- For production, compile the project: `npm run build`. +- To run a production server to serve the built assets, do `npm run serve`. diff --git a/bindings/wgpu/webgpu-samples-ts/build-scripts/lib/copyAndWatch.js b/bindings/wgpu/webgpu-samples-ts/build-scripts/lib/copyAndWatch.js new file mode 100644 index 00000000..0b5b1347 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/build-scripts/lib/copyAndWatch.js @@ -0,0 +1,62 @@ +import chokidar from 'chokidar'; +import fs from 'fs'; +import path from 'path'; + +const debug = console.log; //() => {}; +const removeLeadingSlash = (s) => s.replace(/^\//, ''); + +/** + * Recursively copies files and watches for changes. + * + * Example: + * + * copyAndWatch([ + * {src: "src\/**\/*.js", srcPrefix: "src", dst: "out"}, // would copy src/bar/moo.js -> out/bar/moo.js + * {src: "index.html", dst: "out"}, // copies index.html -> out/index.html + * ]); + * + * @param {*} paths [{src: glob, srcPrefix: string, dst: string }] + * @param {*} options { watch: true/false } // watch: false = just copy and exit. + */ +export function copyAndWatch(paths, {watch} = {watch: true}) { + for (const {src, srcPrefix, dst} of paths) { + const watcher = chokidar.watch(src, { + ignored: /(^|[\/\\])\../, // ignore dot files + persistent: watch, + }); + + const makeDstPath = (path, dst) => + `${dst}/${removeLeadingSlash( + path.startsWith(srcPrefix) ? path.substring(srcPrefix.length) : path + )}`; + + watcher + .on('addDir', (srcPath) => { + const dstPath = makeDstPath(srcPath, dst); + debug('addDir:', srcPath, dstPath); + fs.mkdirSync(dstPath, {recursive: true}); + }) + .on('add', (srcPath) => { + const dstPath = makeDstPath(srcPath, dst); + const dir = path.dirname(dstPath); + fs.mkdirSync(dir, {recursive: true}); + debug('add:', srcPath, dstPath); + fs.copyFileSync(srcPath, dstPath); + }) + .on('change', (srcPath) => { + const dstPath = makeDstPath(srcPath, dst); + debug('change:', srcPath, dstPath); + fs.copyFileSync(srcPath, dstPath); + }) + .on('unlink', (srcPath) => { + const dstPath = makeDstPath(srcPath, dst); + debug('unlink:', srcPath, dstPath); + fs.unlinkSync(dstPath); + }) + .on('ready', () => { + if (!watch) { + watcher.close(); + } + }); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/build-scripts/lib/readdir.js b/bindings/wgpu/webgpu-samples-ts/build-scripts/lib/readdir.js new file mode 100644 index 00000000..049d0a41 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/build-scripts/lib/readdir.js @@ -0,0 +1,16 @@ +import fs from 'fs'; +import path from 'path'; + +// not needed in node v20+ +export function readDirSyncRecursive(dir) { + const basename = path.basename(dir); + const entries = fs.readdirSync(dir, {withFileTypes: true}); + return entries + .map((entry) => + entry.isDirectory() + ? readDirSyncRecursive(`${dir}/${entry.name}`) + : entry.name + ) + .flat() + .map((name) => `${basename}/${name}`); +} diff --git a/bindings/wgpu/webgpu-samples-ts/build-scripts/tools/build.js b/bindings/wgpu/webgpu-samples-ts/build-scripts/tools/build.js new file mode 100644 index 00000000..c372fd64 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/build-scripts/tools/build.js @@ -0,0 +1,14 @@ +import {spawn} from 'child_process'; +import {mkdirSync} from 'fs'; + +mkdirSync('out', {recursive: true}); + +spawn('node', ['build/tools/copy.js'], { + shell: true, + stdio: 'inherit', +}); + +spawn('./node_modules/.bin/rollup', ['-c'], { + shell: true, + stdio: 'inherit', +}); diff --git a/bindings/wgpu/webgpu-samples-ts/build-scripts/tools/copy.js b/bindings/wgpu/webgpu-samples-ts/build-scripts/tools/copy.js new file mode 100644 index 00000000..42545c3d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/build-scripts/tools/copy.js @@ -0,0 +1,22 @@ +import {copyAndWatch} from '../lib/copyAndWatch.js'; + +const watch = !!process.argv[2]; + +copyAndWatch( + [ + {src: 'public/**/*', srcPrefix: 'public', dst: 'out'}, + {src: 'meshes/**/*', dst: 'out'}, + {src: 'sample/**/*', dst: 'out'}, + {src: 'samples/**/*', dst: 'out'}, + {src: 'shaders/**/*', dst: 'out'}, + {src: 'other/**/*', dst: 'out'}, + { + src: 'build/compileSync/js/main/developmentExecutable/kotlin/*', + srcPrefix: 'build/compileSync/js/main/developmentExecutable/kotlin/', + dst: 'out/kotlin-libs' + } + , + {src: 'index.html', dst: 'out'}, + ], + {watch} +); diff --git a/bindings/wgpu/webgpu-samples-ts/build-scripts/tools/serve.js b/bindings/wgpu/webgpu-samples-ts/build-scripts/tools/serve.js new file mode 100644 index 00000000..815620d8 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/build-scripts/tools/serve.js @@ -0,0 +1,19 @@ +import {spawn} from 'child_process'; +import {mkdirSync} from 'fs'; + +mkdirSync('out', {recursive: true}); + +spawn('npm', ['run', 'watch'], { + shell: true, + stdio: 'inherit', +}); + +spawn('node', ['build-scripts/tools/copy.js', '1'], { + shell: true, + stdio: 'inherit', +}); + +spawn('npm', ['run', 'server'], { + shell: true, + stdio: 'inherit', +}); diff --git a/bindings/wgpu/webgpu-samples-ts/build.gradle.kts b/bindings/wgpu/webgpu-samples-ts/build.gradle.kts new file mode 100644 index 00000000..0b3e5dc9 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + alias(libs.plugins.kotlinMultiplatform) +} + +kotlin { + js { + binaries.executable() + browser() + nodejs() + generateTypeScriptDefinitions() + } + + sourceSets { + val commonMain by getting { + dependencies { + implementation(project(":examples:web-js")) + } + } + + } +} + diff --git a/bindings/wgpu/webgpu-samples-ts/index.html b/bindings/wgpu/webgpu-samples-ts/index.html new file mode 100644 index 00000000..b5925f07 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/index.html @@ -0,0 +1,107 @@ + + + + + + WebGPU Samples + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+

+ The WebGPU Samples are a set of samples and demos demonstrating the use + of the WebGPU API. Please see the current + implementation status and how to run WebGPU in your browser at + webgpu.io. +

+
+ + +
+
+
+ + diff --git a/bindings/wgpu/webgpu-samples-ts/meshes/box.ts b/bindings/wgpu/webgpu-samples-ts/meshes/box.ts new file mode 100644 index 00000000..25050a76 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/meshes/box.ts @@ -0,0 +1,105 @@ +import {Mesh} from './mesh'; + +/** + * Constructs a box mesh with the given dimensions. + * The vertex buffer will have the following vertex fields (in the given order): + * position : float32x3 + * normal : float32x3 + * uv : float32x2 + * tangent : float32x3 + * bitangent : float32x3 + * @param width the width of the box + * @param height the height of the box + * @param depth the depth of the box + * @returns the box mesh with tangent and bitangents. + */ +export function createBoxMeshWithTangents( + width: number, + height: number, + depth: number +): Mesh { + // __________ + // / /| y + // / +y / | ^ + // /_________/ | | + // | |+x| +---> x + // | +z | | / + // | | / z + // |_________|/ + // + const pX = 0; // +x + const nX = 1; // -x + const pY = 2; // +y + const nY = 3; // -y + const pZ = 4; // +z + const nZ = 5; // -z + const faces = [ + {tangent: nZ, bitangent: pY, normal: pX}, + {tangent: pZ, bitangent: pY, normal: nX}, + {tangent: pX, bitangent: nZ, normal: pY}, + {tangent: pX, bitangent: pZ, normal: nY}, + {tangent: pX, bitangent: pY, normal: pZ}, + {tangent: nX, bitangent: pY, normal: nZ}, + ]; + const verticesPerSide = 4; + const indicesPerSize = 6; + const f32sPerVertex = 14; // position : vec3f, tangent : vec3f, bitangent : vec3f, normal : vec3f, uv :vec2f + const vertexStride = f32sPerVertex * 4; + const vertices = new Float32Array( + faces.length * verticesPerSide * f32sPerVertex + ); + const indices = new Uint16Array(faces.length * indicesPerSize); + const halfVecs = [ + [+width / 2, 0, 0], // +x + [-width / 2, 0, 0], // -x + [0, +height / 2, 0], // +y + [0, -height / 2, 0], // -y + [0, 0, +depth / 2], // +z + [0, 0, -depth / 2], // -z + ]; + + let vertexOffset = 0; + let indexOffset = 0; + for (let faceIndex = 0; faceIndex < faces.length; faceIndex++) { + const face = faces[faceIndex]; + const tangent = halfVecs[face.tangent]; + const bitangent = halfVecs[face.bitangent]; + const normal = halfVecs[face.normal]; + + for (let u = 0; u < 2; u++) { + for (let v = 0; v < 2; v++) { + for (let i = 0; i < 3; i++) { + vertices[vertexOffset++] = + normal[i] + + (u == 0 ? -1 : 1) * tangent[i] + + (v == 0 ? -1 : 1) * bitangent[i]; + } + for (let i = 0; i < 3; i++) { + vertices[vertexOffset++] = normal[i]; + } + vertices[vertexOffset++] = u; + vertices[vertexOffset++] = v; + for (let i = 0; i < 3; i++) { + vertices[vertexOffset++] = tangent[i]; + } + for (let i = 0; i < 3; i++) { + vertices[vertexOffset++] = bitangent[i]; + } + } + } + + indices[indexOffset++] = faceIndex * verticesPerSide + 0; + indices[indexOffset++] = faceIndex * verticesPerSide + 2; + indices[indexOffset++] = faceIndex * verticesPerSide + 1; + + indices[indexOffset++] = faceIndex * verticesPerSide + 2; + indices[indexOffset++] = faceIndex * verticesPerSide + 3; + indices[indexOffset++] = faceIndex * verticesPerSide + 1; + } + + return { + vertices, + indices, + vertexStride, + }; +} diff --git a/bindings/wgpu/webgpu-samples-ts/meshes/cube.ts b/bindings/wgpu/webgpu-samples-ts/meshes/cube.ts new file mode 100644 index 00000000..6abbd67d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/meshes/cube.ts @@ -0,0 +1,51 @@ +export const cubeVertexSize = 4 * 10; // Byte size of one cube vertex. +export const cubePositionOffset = 0; +export const cubeColorOffset = 4 * 4; // Byte offset of cube vertex color attribute. +export const cubeUVOffset = 4 * 8; +export const cubeVertexCount = 36; + +// prettier-ignore +export const cubeVertexArray = new Float32Array([ + // float4 position, float4 color, float2 uv, + 1, -1, 1, 1, 1, 0, 1, 1, 0, 1, + -1, -1, 1, 1, 0, 0, 1, 1, 1, 1, + -1, -1, -1, 1, 0, 0, 0, 1, 1, 0, + 1, -1, -1, 1, 1, 0, 0, 1, 0, 0, + 1, -1, 1, 1, 1, 0, 1, 1, 0, 1, + -1, -1, -1, 1, 0, 0, 0, 1, 1, 0, + + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, -1, 1, 1, 1, 0, 1, 1, 1, 1, + 1, -1, -1, 1, 1, 0, 0, 1, 1, 0, + 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, -1, -1, 1, 1, 0, 0, 1, 1, 0, + + -1, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, -1, 1, 1, 1, 0, 1, 1, 0, + -1, 1, -1, 1, 0, 1, 0, 1, 0, 0, + -1, 1, 1, 1, 0, 1, 1, 1, 0, 1, + 1, 1, -1, 1, 1, 1, 0, 1, 1, 0, + + -1, -1, 1, 1, 0, 0, 1, 1, 0, 1, + -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, + -1, -1, -1, 1, 0, 0, 0, 1, 0, 0, + -1, -1, 1, 1, 0, 0, 1, 1, 0, 1, + -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, + + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, + -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + -1, -1, 1, 1, 0, 0, 1, 1, 1, 0, + -1, -1, 1, 1, 0, 0, 1, 1, 1, 0, + 1, -1, 1, 1, 1, 0, 1, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, + + 1, -1, -1, 1, 1, 0, 0, 1, 0, 1, + -1, -1, -1, 1, 0, 0, 0, 1, 1, 1, + -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, + 1, 1, -1, 1, 1, 1, 0, 1, 0, 0, + 1, -1, -1, 1, 1, 0, 0, 1, 0, 1, + -1, 1, -1, 1, 0, 1, 0, 1, 1, 0, +]); diff --git a/bindings/wgpu/webgpu-samples-ts/meshes/mesh.ts b/bindings/wgpu/webgpu-samples-ts/meshes/mesh.ts new file mode 100644 index 00000000..eec79539 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/meshes/mesh.ts @@ -0,0 +1,96 @@ +import {vec3, vec2} from 'wgpu-matrix'; + +// Defines what to pass to pipeline to render mesh +export interface Renderable { + vertexBuffer: GPUBuffer; + indexBuffer: GPUBuffer; + indexCount: number; + bindGroup?: GPUBindGroup; +} + +export interface Mesh { + vertices: Float32Array; + indices: Uint16Array | Uint32Array; + vertexStride: number; +} + +/** + * @param {GPUDevice} device - A valid GPUDevice. + * @param {Mesh} mesh - An indexed triangle-list mesh, containing its vertices, indices, and vertexStride (number of elements per vertex). + * @param {boolean} storeVertices - A boolean flag indicating whether the vertexBuffer should be available to use as a storage buffer. + * @returns {boolean} An object containing an array of bindGroups and the bindGroupLayout they implement. + */ +export const createMeshRenderable = ( + device: GPUDevice, + mesh: Mesh, + storeVertices = false, + storeIndices = false +): Renderable => { + // Define buffer usage + const vertexBufferUsage = storeVertices + ? GPUBufferUsage.VERTEX | GPUBufferUsage.STORAGE + : GPUBufferUsage.VERTEX; + const indexBufferUsage = storeIndices + ? GPUBufferUsage.INDEX | GPUBufferUsage.STORAGE + : GPUBufferUsage.INDEX; + + // Create vertex and index buffers + const vertexBuffer = device.createBuffer({ + size: mesh.vertices.byteLength, + usage: vertexBufferUsage, + mappedAtCreation: true, + }); + new Float32Array(vertexBuffer.getMappedRange()).set(mesh.vertices); + vertexBuffer.unmap(); + + const indexBuffer = device.createBuffer({ + size: mesh.indices.byteLength, + usage: indexBufferUsage, + mappedAtCreation: true, + }); + + // Determine whether index buffer is indices are in uint16 or uint32 format + if ( + mesh.indices.byteLength === + mesh.indices.length * Uint16Array.BYTES_PER_ELEMENT + ) { + new Uint16Array(indexBuffer.getMappedRange()).set(mesh.indices); + } else { + new Uint32Array(indexBuffer.getMappedRange()).set(mesh.indices); + } + + indexBuffer.unmap(); + + return { + vertexBuffer, + indexBuffer, + indexCount: mesh.indices.length, + }; +}; + +export const getMeshPosAtIndex = (mesh: Mesh, index: number) => { + const arr = new Float32Array( + mesh.vertices.buffer, + index * mesh.vertexStride + 0, + 3 + ); + return vec3.fromValues(arr[0], arr[1], arr[2]); +}; + +export const getMeshNormalAtIndex = (mesh: Mesh, index: number) => { + const arr = new Float32Array( + mesh.vertices.buffer, + index * mesh.vertexStride + 3 * Float32Array.BYTES_PER_ELEMENT, + 3 + ); + return vec3.fromValues(arr[0], arr[1], arr[2]); +}; + +export const getMeshUVAtIndex = (mesh: Mesh, index: number) => { + const arr = new Float32Array( + mesh.vertices.buffer, + index * mesh.vertexStride + 6 * Float32Array.BYTES_PER_ELEMENT, + 2 + ); + return vec2.fromValues(arr[0], arr[1]); +}; diff --git a/bindings/wgpu/webgpu-samples-ts/meshes/sphere.ts b/bindings/wgpu/webgpu-samples-ts/meshes/sphere.ts new file mode 100644 index 00000000..500950a1 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/meshes/sphere.ts @@ -0,0 +1,99 @@ +import {vec3} from 'wgpu-matrix'; + +export interface SphereMesh { + vertices: Float32Array; + indices: Uint16Array; +} + +export const SphereLayout = { + vertexStride: 8 * 4, + positionsOffset: 0, + normalOffset: 3 * 4, + uvOffset: 6 * 4, +}; + +// Borrowed and simplified from https://github.com/mrdoob/three.js/blob/master/src/geometries/SphereGeometry.js +export function createSphereMesh( + radius: number, + widthSegments = 32, + heightSegments = 16, + randomness = 0 +): SphereMesh { + const vertices = []; + const indices = []; + + widthSegments = Math.max(3, Math.floor(widthSegments)); + heightSegments = Math.max(2, Math.floor(heightSegments)); + + const firstVertex = vec3.create(); + const vertex = vec3.create(); + const normal = vec3.create(); + + let index = 0; + const grid = []; + + // generate vertices, normals and uvs + for (let iy = 0; iy <= heightSegments; iy++) { + const verticesRow = []; + const v = iy / heightSegments; + + // special case for the poles + let uOffset = 0; + if (iy === 0) { + uOffset = 0.5 / widthSegments; + } else if (iy === heightSegments) { + uOffset = -0.5 / widthSegments; + } + + for (let ix = 0; ix <= widthSegments; ix++) { + const u = ix / widthSegments; + + // Poles should just use the same position all the way around. + if (ix == widthSegments) { + vec3.copy(firstVertex, vertex); + } else if (ix == 0 || (iy != 0 && iy !== heightSegments)) { + const rr = radius + (Math.random() - 0.5) * 2 * randomness * radius; + + // vertex + vertex[0] = -rr * Math.cos(u * Math.PI * 2) * Math.sin(v * Math.PI); + vertex[1] = rr * Math.cos(v * Math.PI); + vertex[2] = rr * Math.sin(u * Math.PI * 2) * Math.sin(v * Math.PI); + + if (ix == 0) { + vec3.copy(vertex, firstVertex); + } + } + + vertices.push(...vertex); + + // normal + vec3.copy(vertex, normal); + vec3.normalize(normal, normal); + vertices.push(...normal); + + // uv + vertices.push(u + uOffset, 1 - v); + verticesRow.push(index++); + } + + grid.push(verticesRow); + } + + // indices + for (let iy = 0; iy < heightSegments; iy++) { + for (let ix = 0; ix < widthSegments; ix++) { + const a = grid[iy][ix + 1]; + const b = grid[iy][ix]; + const c = grid[iy + 1][ix]; + const d = grid[iy + 1][ix + 1]; + + if (iy !== 0) indices.push(a, b, d); + if (iy !== heightSegments - 1) indices.push(b, c, d); + } + } + + return { + vertices: new Float32Array(vertices), + indices: new Uint16Array(indices), + }; +} diff --git a/bindings/wgpu/webgpu-samples-ts/meshes/stanfordDragon.ts b/bindings/wgpu/webgpu-samples-ts/meshes/stanfordDragon.ts new file mode 100644 index 00000000..f25e5fcf --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/meshes/stanfordDragon.ts @@ -0,0 +1,42 @@ +import dragonRawData from './stanfordDragonData'; +import {computeSurfaceNormals, computeProjectedPlaneUVs} from './utils'; + +export const mesh = { + positions: dragonRawData.positions as [number, number, number][], + triangles: dragonRawData.cells as [number, number, number][], + normals: [] as [number, number, number][], + uvs: [] as [number, number][], +}; + +// Compute surface normals +mesh.normals = computeSurfaceNormals(mesh.positions, mesh.triangles); + +// Compute some easy uvs for testing +mesh.uvs = computeProjectedPlaneUVs(mesh.positions, 'xy'); + +// Push indices for an additional ground plane +mesh.triangles.push( + [mesh.positions.length, mesh.positions.length + 2, mesh.positions.length + 1], + [mesh.positions.length, mesh.positions.length + 1, mesh.positions.length + 3] +); + +// Push vertex attributes for an additional ground plane +// prettier-ignore +mesh.positions.push( + [-100, 20, -100], // + [100, 20, 100], // + [-100, 20, 100], // + [100, 20, -100] +); +mesh.normals.push( + [0, 1, 0], // + [0, 1, 0], // + [0, 1, 0], // + [0, 1, 0] +); +mesh.uvs.push( + [0, 0], // + [1, 1], // + [0, 1], // + [1, 0] +); diff --git a/bindings/wgpu/webgpu-samples-ts/meshes/stanfordDragonData.ts b/bindings/wgpu/webgpu-samples-ts/meshes/stanfordDragonData.ts new file mode 100644 index 00000000..7e7dbb10 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/meshes/stanfordDragonData.ts @@ -0,0 +1,5 @@ +// from github.com/hughsk/stanford-dragon +export default { + cells: [[5, 0, 2], [0, 1, 2], [0, 3, 1], [10, 2, 9], [10, 11, 2], [11, 8, 2], [4, 0, 5], [1, 3, 6], [4, 5, 2], [8, 7, 2], [13, 12, 8], [11, 13, 8], [10, 13, 11], [3, 0, 4], [2, 7, 4], [10, 9, 13], [12, 7, 8], [6, 7, 1], [1, 7, 2], [7, 9, 2], [4, 7, 14], [12, 14, 7], [9, 7, 6], [4, 6, 3], [18, 17, 16], [15, 9, 6], [20, 21, 18], [18, 21, 22], [16, 15, 18], [15, 20, 18], [19, 15, 16], [15, 19, 9], [23, 17, 18], [25, 21, 20], [6, 4, 24], [12, 26, 14], [15, 29, 30], [33, 16, 17], [26, 14, 12], [26, 12, 14], [27, 6, 24], [28, 12, 13], [15, 27, 29], [6, 27, 15], [15, 30, 20], [9, 28, 13], [9, 31, 28], [32, 21, 25], [22, 21, 32], [33, 9, 19], [16, 33, 19], [34, 35, 23], [18, 34, 23], [36, 17, 23], [36, 23, 35], [26, 12, 28], [25, 20, 30], [31, 9, 33], [32, 18, 22], [18, 32, 34], [17, 36, 33], [24, 14, 26], [24, 4, 14], [37, 28, 31], [38, 39, 40], [43, 26, 28], [43, 28, 37], [40, 39, 45], [41, 46, 42], [27, 24, 29], [30, 32, 25], [33, 37, 31], [36, 44, 33], [32, 30, 34], [36, 35, 52], [52, 35, 51], [85, 49, 48], [45, 39, 53], [24, 26, 55], [43, 55, 26], [30, 29, 58], [30, 60, 34], [37, 59, 43], [59, 57, 43], [32, 60, 34], [32, 34, 60], [60, 32, 34], [61, 37, 33], [60, 35, 34], [61, 33, 44], [52, 51, 62], [64, 63, 48], [65, 63, 48], [63, 64, 48], [65, 48, 49], [69, 68, 38], [38, 68, 39], [39, 50, 53], [45, 70, 40], [45, 71, 70], [74, 73, 41], [42, 74, 41], [47, 74, 41], [74, 42, 46], [74, 46, 41], [77, 76, 79], [79, 76, 78], [78, 82, 81], [79, 78, 81], [80, 79, 81], [24, 55, 54], [43, 57, 55], [60, 30, 58], [60, 34, 32], [33, 98, 37], [44, 36, 61], [36, 52, 83], [84, 48, 63], [85, 48, 84], [63, 65, 64], [86, 50, 66], [50, 86, 67], [50, 39, 87], [53, 50, 88], [53, 88, 89], [71, 45, 53], [89, 90, 53], [53, 90, 72], [47, 73, 72], [47, 41, 73], [74, 47, 75], [78, 76, 91], [91, 92, 78], [82, 92, 93], [78, 92, 82], [77, 79, 80], [81, 82, 95], [95, 82, 93], [94, 96, 97], [94, 80, 96], [81, 95, 104], [56, 29, 24], [33, 37, 98], [109, 110, 51], [85, 84, 99], [100, 49, 99], [99, 49, 85], [66, 101, 86], [87, 66, 50], [67, 88, 50], [69, 40, 70], [38, 40, 69], [88, 102, 89], [93, 82, 95], [82, 93, 95], [104, 95, 93], [97, 96, 105], [81, 105, 80], [96, 80, 105], [97, 105, 106], [105, 81, 104], [94, 97, 106], [56, 58, 29], [98, 37, 61], [35, 108, 109], [109, 51, 35], [62, 51, 110], [64, 65, 63], [65, 49, 100], [67, 86, 101], [68, 87, 39], [89, 102, 90], [90, 47, 72], [47, 111, 75], [91, 76, 115], [103, 92, 91], [92, 103, 93], [112, 77, 80], [112, 80, 94], [104, 93, 113], [60, 58, 120], [98, 59, 37], [122, 36, 83], [47, 90, 111], [116, 94, 106], [107, 106, 105], [107, 105, 118], [107, 119, 106], [60, 108, 35], [121, 98, 61], [36, 122, 61], [62, 83, 52], [65, 100, 63], [73, 71, 72], [72, 71, 53], [123, 93, 103], [56, 24, 54], [125, 117, 124], [107, 126, 119], [107, 127, 126], [109, 128, 110], [130, 101, 66], [102, 67, 132], [102, 88, 67], [102, 114, 133], [102, 133, 90], [135, 125, 124], [56, 54, 55], [123, 137, 93], [124, 117, 136], [116, 106, 119], [59, 98, 121], [118, 127, 107], [128, 109, 138], [122, 83, 61], [99, 84, 129], [99, 129, 130], [131, 101, 130], [101, 131, 132], [115, 76, 139], [139, 76, 77], [123, 140, 134], [123, 103, 140], [136, 141, 124], [134, 142, 137], [123, 134, 137], [137, 113, 93], [117, 143, 144], [117, 125, 143], [66, 99, 130], [132, 131, 146], [67, 101, 132], [146, 114, 132], [69, 71, 68], [70, 71, 69], [114, 102, 132], [159, 56, 55], [118, 105, 147], [145, 59, 121], [214, 115, 186], [482, 186, 611], [186, 115, 139], [134, 149, 150], [158, 94, 116], [55, 57, 160], [142, 134, 150], [104, 147, 105], [164, 144, 143], [148, 127, 147], [127, 118, 147], [61, 83, 151], [177, 66, 87], [112, 154, 77], [140, 157, 134], [160, 159, 55], [136, 161, 141], [136, 141, 161], [194, 117, 144], [59, 166, 165], [147, 168, 148], [138, 172, 128], [171, 61, 151], [110, 173, 62], [129, 84, 236], [176, 63, 100], [100, 99, 176], [209, 180, 152], [133, 111, 90], [183, 182, 181], [186, 139, 153], [153, 139, 77], [155, 157, 103], [157, 140, 103], [154, 112, 156], [134, 157, 149], [135, 190, 188], [188, 190, 189], [136, 191, 141], [162, 160, 57], [193, 58, 56], [193, 197, 58], [162, 57, 59], [117, 194, 136], [142, 224, 195], [196, 113, 137], [104, 113, 196], [104, 196, 147], [119, 220, 116], [120, 58, 197], [125, 163, 143], [163, 164, 143], [120, 167, 60], [200, 227, 145], [200, 229, 227], [169, 145, 121], [168, 127, 148], [151, 83, 201], [110, 232, 173], [62, 201, 83], [205, 131, 204], [99, 66, 87], [114, 178, 179], [133, 209, 152], [208, 209, 133], [133, 152, 111], [209, 208, 180], [213, 183, 184], [185, 213, 184], [214, 155, 91], [77, 154, 153], [77, 156, 154], [154, 156, 77], [215, 149, 157], [156, 94, 187], [156, 112, 94], [216, 124, 191], [191, 124, 141], [135, 188, 125], [125, 188, 192], [161, 191, 136], [219, 116, 220], [158, 116, 219], [159, 160, 56], [136, 221, 161], [162, 57, 222], [222, 57, 162], [166, 222, 162], [136, 194, 223], [136, 223, 221], [166, 162, 59], [137, 142, 195], [137, 195, 196], [164, 194, 144], [59, 165, 166], [225, 168, 147], [226, 119, 126], [167, 199, 60], [59, 145, 227], [60, 199, 108], [145, 227, 200], [145, 200, 227], [145, 200, 227], [145, 227, 200], [230, 198, 126], [228, 170, 138], [228, 138, 109], [145, 229, 200], [126, 127, 231], [231, 127, 168], [138, 170, 172], [171, 121, 61], [110, 128, 232], [234, 129, 233], [235, 129, 234], [175, 233, 129], [129, 233, 175], [84, 174, 236], [174, 84, 63], [130, 129, 175], [130, 175, 202], [100, 174, 63], [202, 235, 203], [130, 202, 203], [176, 100, 63], [131, 203, 204], [131, 130, 203], [87, 176, 99], [87, 66, 177], [178, 131, 205], [177, 87, 68], [178, 114, 146], [247, 68, 71], [114, 179, 206], [206, 239, 114], [239, 133, 114], [71, 73, 207], [133, 240, 208], [241, 207, 73], [208, 240, 180], [241, 74, 75], [241, 73, 74], [210, 111, 152], [211, 111, 210], [211, 242, 111], [242, 75, 111], [243, 212, 181], [181, 243, 182], [243, 181, 182], [181, 212, 183], [183, 185, 184], [155, 103, 91], [135, 124, 216], [187, 94, 158], [218, 150, 244], [246, 150, 218], [142, 150, 246], [224, 142, 246], [163, 125, 192], [59, 227, 166], [226, 126, 198], [108, 199, 109], [227, 229, 200], [229, 145, 169], [121, 171, 169], [175, 233, 129], [175, 129, 236], [235, 202, 175], [205, 237, 178], [238, 68, 247], [152, 180, 210], [183, 212, 182], [183, 182, 185], [149, 244, 150], [149, 217, 244], [244, 245, 218], [245, 254, 248], [248, 218, 245], [246, 218, 248], [196, 195, 249], [196, 249, 250], [196, 225, 147], [126, 231, 230], [232, 128, 172], [129, 235, 175], [205, 204, 237], [177, 68, 238], [178, 206, 179], [213, 182, 183], [214, 91, 115], [149, 215, 217], [254, 255, 248], [195, 224, 249], [250, 225, 196], [226, 256, 119], [224, 257, 258], [249, 224, 258], [199, 228, 109], [198, 230, 226], [229, 227, 200], [259, 260, 257], [257, 260, 261], [230, 262, 251], [251, 226, 230], [252, 262, 268], [263, 264, 266], [260, 263, 267], [264, 265, 266], [251, 262, 252], [267, 263, 266], [252, 268, 269], [270, 252, 269], [269, 271, 270], [204, 203, 235], [237, 204, 272], [176, 87, 177], [146, 131, 178], [206, 273, 240], [240, 239, 206], [240, 133, 239], [275, 182, 213], [275, 213, 274], [245, 244, 254], [120, 197, 167], [259, 276, 263], [260, 259, 263], [171, 151, 201], [201, 171, 83], [171, 201, 83], [201, 62, 173], [265, 277, 266], [178, 373, 280], [310, 247, 71], [206, 280, 273], [212, 243, 253], [182, 243, 181], [244, 217, 215], [254, 244, 281], [191, 161, 221], [189, 192, 188], [223, 282, 221], [220, 119, 256], [250, 168, 225], [226, 283, 256], [249, 284, 250], [257, 246, 259], [258, 284, 249], [283, 226, 285], [261, 258, 257], [226, 286, 285], [170, 232, 172], [169, 171, 287], [263, 276, 264], [286, 226, 251], [265, 289, 277], [291, 317, 293], [278, 277, 289], [292, 291, 293], [277, 290, 266], [294, 271, 269], [298, 300, 295], [300, 298, 295], [296, 300, 299], [304, 299, 300], [299, 304, 301], [301, 305, 302], [304, 305, 301], [306, 302, 305], [300, 303, 304], [234, 279, 235], [204, 307, 272], [204, 235, 307], [178, 237, 308], [206, 178, 280], [241, 75, 242], [180, 240, 273], [243, 311, 253], [275, 243, 182], [213, 185, 182], [135, 216, 190], [187, 158, 219], [56, 160, 193], [312, 221, 282], [254, 313, 255], [246, 257, 224], [264, 276, 315], [169, 287, 229], [265, 264, 289], [286, 251, 252], [267, 316, 260], [316, 261, 260], [319, 266, 290], [266, 319, 267], [292, 322, 323], [292, 293, 322], [329, 327, 326], [329, 326, 328], [327, 329, 330], [295, 330, 329], [296, 331, 330], [329, 297, 295], [332, 296, 299], [295, 335, 298], [295, 297, 335], [295, 298, 296], [334, 332, 299], [334, 299, 301], [369, 337, 338], [296, 298, 300], [298, 339, 300], [302, 306, 337], [306, 340, 337], [341, 305, 304], [306, 305, 341], [342, 306, 341], [235, 279, 307], [236, 174, 100], [238, 247, 309], [247, 310, 309], [310, 71, 207], [310, 207, 241], [210, 180, 275], [482, 214, 186], [186, 153, 483], [190, 192, 189], [255, 313, 314], [346, 289, 264], [286, 252, 288], [292, 318, 291], [270, 288, 252], [293, 317, 347], [318, 292, 348], [349, 320, 278], [277, 278, 320], [277, 320, 321], [352, 350, 351], [353, 352, 351], [352, 353, 324], [352, 324, 322], [355, 324, 353], [359, 357, 355], [355, 358, 359], [325, 363, 364], [327, 397, 325], [326, 325, 364], [325, 326, 327], [365, 327, 330], [326, 366, 328], [295, 296, 330], [329, 328, 367], [297, 329, 367], [368, 331, 296], [368, 296, 332], [334, 302, 336], [369, 333, 337], [334, 301, 302], [333, 302, 337], [298, 335, 339], [337, 340, 370], [303, 300, 339], [372, 306, 342], [371, 304, 303], [371, 343, 304], [341, 304, 343], [236, 100, 176], [478, 236, 176], [484, 486, 155], [193, 344, 197], [248, 259, 246], [248, 276, 259], [170, 228, 232], [258, 261, 345], [375, 201, 173], [375, 347, 201], [171, 291, 287], [317, 171, 347], [289, 349, 278], [347, 375, 376], [375, 350, 376], [376, 350, 352], [290, 277, 321], [413, 348, 323], [323, 348, 292], [320, 349, 377], [322, 376, 352], [351, 378, 353], [355, 379, 324], [356, 355, 353], [359, 358, 381], [359, 381, 382], [359, 382, 380], [384, 383, 382], [383, 384, 385], [360, 388, 386], [387, 389, 386], [386, 389, 390], [360, 386, 390], [361, 360, 362], [360, 390, 362], [391, 428, 361], [426, 427, 392], [426, 392, 393], [325, 361, 363], [391, 361, 325], [361, 362, 394], [363, 361, 394], [397, 391, 325], [396, 395, 399], [395, 398, 399], [394, 400, 364], [364, 363, 394], [366, 326, 364], [331, 401, 330], [398, 430, 402], [367, 328, 366], [403, 333, 369], [402, 369, 405], [367, 366, 404], [302, 333, 336], [369, 338, 405], [297, 367, 407], [406, 405, 338], [337, 370, 338], [339, 335, 408], [371, 303, 339], [340, 306, 372], [178, 308, 373], [409, 180, 273], [212, 253, 243], [611, 186, 483], [244, 215, 410], [374, 191, 221], [493, 374, 221], [313, 312, 314], [168, 250, 284], [171, 317, 291], [171, 201, 347], [411, 291, 318], [287, 291, 411], [289, 412, 349], [293, 347, 376], [376, 322, 293], [379, 355, 357], [355, 356, 414], [355, 414, 358], [383, 380, 382], [418, 415, 416], [416, 417, 419], [418, 416, 420], [386, 418, 420], [386, 420, 387], [422, 418, 386], [388, 422, 386], [424, 385, 423], [384, 423, 385], [425, 424, 426], [426, 424, 427], [360, 361, 428], [390, 389, 362], [396, 392, 395], [396, 393, 392], [466, 396, 399], [366, 400, 468], [401, 365, 330], [402, 430, 403], [366, 364, 400], [399, 398, 402], [399, 402, 431], [403, 369, 402], [432, 333, 403], [368, 332, 334], [297, 407, 335], [370, 406, 338], [370, 340, 372], [557, 177, 238], [155, 214, 569], [487, 410, 215], [190, 216, 490], [490, 216, 492], [191, 374, 492], [493, 492, 374], [494, 192, 190], [496, 221, 312], [222, 499, 162], [437, 500, 222], [192, 436, 163], [312, 282, 314], [222, 166, 437], [194, 507, 223], [276, 248, 255], [276, 255, 315], [508, 228, 199], [440, 284, 258], [258, 345, 512], [510, 229, 411], [375, 173, 232], [514, 289, 346], [350, 375, 442], [442, 443, 350], [350, 443, 445], [351, 350, 445], [294, 520, 271], [413, 323, 446], [378, 351, 445], [356, 353, 378], [359, 380, 357], [530, 529, 451], [450, 530, 451], [450, 451, 416], [381, 358, 452], [453, 380, 383], [451, 417, 416], [453, 380, 383], [384, 382, 381], [415, 422, 455], [384, 381, 454], [421, 383, 385], [453, 383, 421], [416, 419, 420], [415, 418, 422], [387, 420, 419], [456, 387, 419], [421, 385, 424], [421, 424, 425], [389, 387, 456], [457, 424, 423], [458, 425, 426], [424, 457, 427], [458, 426, 393], [362, 389, 429], [392, 427, 457], [459, 458, 393], [391, 397, 460], [429, 462, 362], [394, 362, 462], [397, 365, 465], [396, 466, 464], [397, 327, 365], [430, 395, 463], [395, 430, 398], [432, 403, 467], [430, 467, 403], [432, 471, 336], [432, 336, 333], [402, 405, 433], [402, 433, 431], [470, 334, 336], [367, 404, 407], [433, 405, 406], [406, 370, 473], [279, 475, 307], [477, 474, 175], [548, 372, 603], [236, 477, 175], [551, 343, 550], [555, 434, 272], [557, 238, 309], [309, 238, 557], [480, 273, 280], [480, 280, 479], [562, 242, 211], [275, 180, 409], [409, 311, 243], [275, 409, 243], [212, 568, 182], [483, 153, 154], [156, 485, 154], [486, 157, 155], [488, 244, 410], [489, 187, 491], [491, 187, 219], [254, 281, 313], [219, 220, 495], [498, 160, 162], [498, 435, 160], [499, 222, 500], [222, 501, 500], [435, 193, 160], [160, 193, 435], [222, 500, 501], [503, 501, 500], [256, 495, 220], [160, 502, 193], [502, 344, 193], [503, 500, 437], [504, 256, 283], [197, 344, 438], [163, 436, 164], [504, 256, 283], [504, 283, 256], [197, 438, 167], [506, 507, 194], [314, 282, 511], [439, 504, 283], [439, 283, 285], [505, 199, 167], [168, 441, 231], [227, 229, 510], [509, 227, 510], [511, 346, 315], [346, 264, 315], [262, 230, 441], [231, 441, 230], [229, 287, 411], [513, 411, 318], [375, 232, 442], [412, 289, 514], [267, 316, 515], [316, 267, 515], [288, 270, 444], [517, 444, 270], [444, 271, 521], [290, 518, 519], [516, 520, 269], [321, 518, 290], [520, 294, 269], [520, 294, 271], [320, 524, 321], [525, 271, 294], [323, 322, 324], [378, 445, 527], [525, 354, 271], [323, 324, 379], [271, 354, 447], [448, 356, 378], [379, 357, 449], [449, 357, 380], [529, 528, 531], [451, 529, 531], [532, 414, 356], [533, 450, 415], [452, 358, 414], [380, 453, 579], [417, 531, 534], [417, 451, 531], [415, 450, 416], [383, 380, 453], [453, 383, 380], [383, 453, 380], [384, 454, 423], [537, 535, 428], [388, 360, 537], [535, 537, 428], [360, 428, 537], [425, 458, 536], [456, 538, 389], [460, 428, 391], [392, 457, 461], [393, 396, 459], [395, 392, 461], [395, 461, 463], [459, 396, 464], [541, 465, 365], [399, 431, 469], [399, 469, 466], [542, 368, 470], [544, 545, 433], [544, 433, 406], [407, 472, 335], [335, 472, 408], [234, 233, 474], [408, 476, 339], [602, 476, 408], [307, 475, 279], [474, 233, 175], [370, 372, 548], [371, 339, 476], [371, 476, 339], [307, 279, 549], [476, 371, 339], [339, 476, 371], [476, 339, 371], [434, 555, 272], [176, 556, 478], [556, 176, 177], [177, 557, 556], [309, 557, 238], [309, 310, 558], [559, 479, 280], [560, 273, 480], [241, 481, 561], [481, 241, 242], [211, 242, 562], [564, 311, 563], [565, 311, 564], [253, 311, 565], [243, 253, 566], [182, 275, 213], [274, 213, 275], [567, 568, 212], [156, 187, 489], [612, 281, 244], [216, 191, 492], [499, 498, 162], [497, 312, 313], [438, 505, 167], [511, 282, 614], [613, 614, 282], [613, 282, 223], [284, 440, 168], [512, 345, 261], [570, 571, 346], [616, 286, 288], [346, 571, 514], [516, 269, 268], [515, 267, 319], [517, 270, 444], [444, 270, 271], [348, 413, 573], [523, 518, 321], [351, 445, 526], [445, 351, 526], [445, 526, 527], [529, 574, 528], [356, 448, 576], [533, 578, 450], [578, 530, 450], [414, 582, 452], [533, 415, 581], [531, 580, 534], [455, 584, 415], [453, 421, 583], [534, 585, 417], [454, 381, 587], [585, 419, 417], [455, 422, 586], [585, 588, 419], [456, 419, 590], [423, 454, 591], [425, 536, 421], [589, 421, 536], [535, 388, 537], [590, 592, 456], [592, 538, 456], [593, 457, 423], [535, 537, 428], [389, 538, 592], [428, 460, 594], [389, 595, 429], [457, 593, 539], [461, 457, 539], [462, 429, 597], [463, 461, 540], [394, 462, 400], [598, 401, 331], [599, 466, 469], [643, 471, 432], [470, 368, 334], [470, 336, 471], [404, 366, 468], [469, 431, 600], [601, 404, 468], [600, 431, 433], [407, 404, 546], [544, 406, 473], [408, 472, 547], [279, 234, 475], [370, 548, 603], [604, 371, 476], [343, 371, 606], [341, 552, 342], [372, 342, 554], [607, 372, 554], [651, 236, 478], [343, 606, 550], [341, 343, 551], [341, 551, 552], [554, 342, 553], [272, 307, 434], [308, 272, 434], [308, 237, 272], [608, 373, 308], [557, 309, 652], [481, 242, 211], [563, 609, 564], [569, 214, 482], [569, 482, 610], [154, 485, 483], [215, 157, 487], [157, 486, 487], [495, 256, 504], [166, 503, 437], [505, 508, 199], [315, 255, 314], [315, 314, 511], [285, 286, 616], [615, 232, 228], [615, 618, 232], [268, 262, 617], [349, 412, 514], [516, 268, 617], [443, 442, 572], [517, 444, 521], [413, 446, 573], [621, 377, 349], [621, 522, 377], [623, 518, 523], [320, 377, 627], [524, 523, 321], [521, 271, 626], [622, 521, 626], [447, 626, 271], [575, 624, 622], [575, 622, 626], [378, 526, 628], [378, 527, 526], [379, 625, 323], [629, 574, 529], [574, 629, 575], [574, 575, 631], [629, 529, 630], [530, 630, 529], [379, 449, 577], [448, 378, 576], [660, 530, 578], [449, 380, 577], [581, 632, 533], [583, 579, 453], [581, 415, 584], [381, 452, 582], [455, 586, 584], [580, 588, 534], [583, 421, 589], [588, 585, 534], [419, 588, 664], [634, 423, 591], [536, 458, 633], [635, 633, 458], [458, 459, 636], [595, 389, 592], [461, 539, 540], [636, 459, 464], [400, 462, 640], [638, 541, 365], [639, 637, 464], [430, 540, 641], [401, 638, 365], [639, 464, 466], [430, 641, 467], [598, 331, 368], [432, 467, 641], [640, 642, 400], [642, 468, 400], [643, 542, 470], [468, 644, 601], [543, 404, 601], [546, 404, 543], [407, 546, 645], [407, 646, 472], [545, 544, 647], [544, 473, 647], [650, 473, 370], [683, 372, 607], [434, 307, 605], [371, 670, 606], [608, 559, 373], [559, 280, 373], [560, 480, 273], [409, 273, 653], [562, 481, 211], [655, 654, 275], [212, 243, 566], [275, 182, 655], [488, 410, 487], [312, 497, 496], [500, 501, 499], [508, 505, 656], [570, 346, 511], [615, 228, 657], [513, 510, 411], [618, 442, 232], [316, 512, 261], [444, 619, 288], [318, 348, 659], [675, 267, 515], [316, 267, 675], [526, 445, 443], [526, 443, 572], [517, 521, 622], [377, 522, 627], [320, 627, 524], [676, 575, 629], [575, 626, 631], [528, 574, 631], [660, 630, 530], [631, 661, 531], [528, 631, 531], [356, 576, 532], [577, 380, 579], [580, 531, 662], [586, 422, 663], [590, 419, 664], [422, 388, 663], [388, 535, 663], [635, 458, 665], [594, 460, 596], [665, 458, 636], [460, 397, 666], [397, 465, 666], [636, 464, 637], [597, 640, 462], [430, 463, 540], [639, 599, 680], [598, 368, 542], [643, 470, 471], [644, 468, 642], [599, 469, 600], [645, 546, 543], [433, 545, 600], [669, 649, 475], [669, 668, 649], [407, 645, 646], [473, 648, 647], [646, 547, 472], [279, 475, 649], [602, 408, 547], [650, 370, 603], [549, 605, 307], [476, 602, 604], [670, 371, 671], [555, 434, 605], [684, 434, 555], [309, 558, 652], [310, 241, 561], [563, 653, 480], [653, 273, 480], [563, 311, 653], [409, 653, 311], [672, 562, 211], [210, 672, 211], [654, 210, 275], [182, 568, 655], [156, 689, 485], [503, 227, 509], [440, 258, 512], [439, 285, 616], [657, 697, 615], [619, 616, 288], [442, 618, 674], [442, 674, 572], [620, 349, 514], [572, 674, 704], [621, 349, 620], [519, 319, 290], [624, 705, 517], [624, 517, 622], [518, 623, 519], [625, 446, 323], [676, 624, 575], [676, 629, 630], [677, 379, 577], [576, 378, 628], [631, 626, 447], [448, 713, 576], [533, 632, 578], [678, 632, 581], [581, 584, 678], [414, 532, 582], [587, 381, 582], [718, 588, 580], [454, 587, 591], [589, 536, 633], [633, 665, 719], [590, 664, 592], [635, 665, 633], [593, 722, 539], [429, 595, 597], [679, 597, 595], [541, 666, 465], [667, 401, 598], [639, 466, 599], [725, 598, 542], [432, 641, 643], [681, 600, 545], [605, 549, 649], [649, 549, 279], [648, 473, 650], [651, 477, 236], [549, 307, 605], [603, 372, 683], [608, 308, 684], [562, 731, 481], [612, 244, 488], [740, 497, 313], [491, 219, 495], [690, 494, 190], [192, 494, 436], [160, 435, 502], [436, 693, 164], [502, 438, 344], [164, 506, 194], [223, 507, 694], [166, 227, 503], [613, 223, 694], [613, 694, 614], [656, 657, 508], [440, 695, 168], [508, 657, 228], [441, 168, 695], [440, 512, 733], [571, 570, 511], [441, 696, 262], [698, 262, 696], [262, 698, 617], [700, 616, 619], [316, 658, 512], [699, 617, 698], [673, 513, 318], [673, 318, 659], [699, 701, 617], [316, 675, 703], [517, 700, 619], [515, 703, 675], [516, 617, 701], [619, 444, 517], [659, 348, 702], [702, 348, 573], [515, 319, 519], [572, 704, 526], [706, 526, 704], [446, 702, 573], [734, 705, 676], [705, 624, 676], [294, 520, 525], [709, 523, 524], [707, 676, 630], [526, 708, 628], [525, 520, 354], [520, 710, 354], [354, 710, 447], [447, 712, 631], [712, 447, 626], [631, 712, 626], [576, 628, 713], [631, 626, 712], [448, 576, 713], [577, 579, 714], [579, 583, 716], [662, 531, 661], [583, 589, 716], [580, 662, 718], [584, 586, 663], [717, 587, 582], [535, 428, 720], [428, 594, 720], [664, 721, 592], [423, 591, 722], [593, 423, 722], [460, 666, 596], [540, 723, 724], [638, 401, 667], [641, 726, 643], [545, 647, 681], [649, 668, 682], [474, 475, 234], [646, 728, 547], [647, 648, 650], [649, 682, 605], [474, 477, 651], [307, 549, 605], [604, 729, 670], [603, 683, 730], [371, 604, 670], [730, 683, 607], [671, 371, 670], [342, 552, 554], [308, 434, 684], [556, 557, 652], [561, 558, 310], [480, 479, 559], [731, 558, 561], [731, 561, 481], [732, 609, 480], [480, 609, 563], [654, 672, 210], [566, 253, 565], [567, 212, 566], [685, 687, 686], [688, 686, 687], [482, 611, 483], [484, 155, 569], [484, 569, 610], [689, 156, 489], [190, 490, 690], [740, 313, 281], [221, 496, 691], [435, 692, 502], [506, 164, 693], [674, 615, 697], [618, 615, 674], [658, 316, 703], [700, 517, 705], [519, 623, 515], [522, 621, 627], [625, 379, 677], [446, 625, 677], [626, 447, 712], [711, 660, 578], [711, 630, 660], [632, 678, 578], [532, 576, 715], [582, 532, 715], [750, 584, 663], [539, 722, 723], [540, 539, 723], [463, 540, 724], [540, 463, 724], [641, 540, 724], [542, 643, 725], [599, 600, 680], [680, 600, 735], [645, 601, 736], [543, 601, 645], [646, 645, 727], [602, 547, 728], [554, 553, 342], [565, 564, 609], [567, 655, 568], [687, 685, 738], [493, 221, 691], [501, 742, 741], [739, 494, 690], [741, 499, 501], [697, 657, 743], [571, 511, 614], [509, 510, 513], [509, 513, 673], [620, 514, 744], [745, 516, 701], [516, 745, 520], [708, 526, 706], [707, 630, 711], [747, 578, 678], [661, 631, 712], [589, 633, 719], [423, 634, 591], [592, 721, 595], [751, 640, 597], [751, 597, 679], [820, 640, 751], [725, 643, 726], [727, 645, 736], [681, 647, 752], [474, 651, 753], [754, 647, 650], [606, 670, 550], [552, 551, 550], [737, 559, 608], [559, 737, 762], [480, 559, 732], [566, 655, 567], [756, 757, 685], [756, 755, 757], [281, 612, 740], [491, 495, 489], [441, 759, 696], [699, 698, 696], [746, 627, 621], [708, 706, 628], [661, 712, 748], [579, 716, 749], [664, 588, 718], [761, 595, 721], [594, 596, 666], [638, 667, 598], [601, 644, 642], [669, 475, 474], [732, 559, 762], [686, 688, 758], [765, 764, 505], [438, 765, 505], [436, 779, 782], [512, 658, 789], [766, 700, 705], [767, 734, 707], [734, 676, 707], [623, 523, 799], [714, 677, 577], [715, 809, 582], [810, 582, 809], [587, 717, 812], [760, 589, 719], [816, 594, 666], [637, 639, 769], [818, 641, 724], [819, 598, 725], [681, 735, 600], [771, 669, 474], [772, 757, 755], [772, 755, 757], [756, 685, 686], [773, 482, 483], [485, 773, 483], [871, 485, 489], [488, 487, 763], [776, 493, 691], [844, 489, 495], [501, 777, 742], [764, 656, 505], [501, 503, 777], [436, 494, 779], [439, 783, 504], [693, 785, 506], [657, 784, 743], [694, 507, 506], [733, 786, 440], [733, 440, 786], [695, 759, 441], [512, 786, 733], [514, 571, 848], [787, 616, 700], [704, 674, 791], [705, 734, 766], [704, 794, 706], [796, 446, 798], [523, 709, 799], [707, 711, 800], [708, 628, 706], [447, 710, 804], [708, 805, 628], [524, 627, 806], [712, 447, 804], [579, 749, 807], [808, 678, 584], [808, 584, 750], [809, 812, 717], [750, 663, 811], [720, 594, 815], [636, 637, 768], [768, 637, 769], [858, 638, 598], [640, 820, 642], [770, 680, 821], [770, 639, 680], [601, 642, 822], [824, 669, 771], [825, 824, 771], [682, 668, 827], [861, 771, 474], [828, 605, 682], [650, 830, 754], [829, 555, 605], [831, 604, 602], [729, 604, 831], [603, 730, 832], [835, 478, 556], [835, 834, 478], [555, 836, 684], [608, 684, 836], [837, 556, 652], [654, 655, 841], [772, 757, 755], [686, 758, 687], [687, 758, 688], [777, 843, 742], [740, 612, 497], [780, 498, 499], [765, 502, 781], [765, 438, 502], [845, 656, 764], [692, 435, 502], [502, 435, 781], [656, 846, 784], [657, 656, 784], [440, 733, 786], [571, 614, 788], [514, 848, 744], [759, 790, 696], [699, 696, 790], [674, 697, 791], [759, 786, 790], [701, 699, 790], [790, 792, 701], [703, 515, 793], [792, 745, 701], [702, 446, 796], [795, 515, 797], [797, 515, 623], [446, 677, 801], [746, 802, 627], [804, 710, 850], [713, 628, 851], [715, 576, 713], [714, 749, 807], [807, 749, 579], [662, 661, 748], [809, 582, 810], [809, 717, 582], [589, 854, 716], [589, 760, 854], [587, 812, 717], [664, 718, 813], [587, 717, 814], [719, 855, 760], [591, 587, 814], [856, 664, 813], [925, 665, 857], [882, 679, 761], [638, 666, 541], [595, 761, 679], [881, 666, 638], [679, 820, 751], [639, 770, 769], [818, 726, 641], [826, 735, 681], [605, 828, 829], [728, 863, 602], [555, 829, 833], [832, 864, 650], [862, 651, 834], [651, 478, 834], [650, 603, 832], [832, 730, 865], [555, 833, 836], [762, 737, 838], [652, 558, 839], [609, 840, 565], [772, 755, 842], [757, 772, 868], [487, 486, 774], [870, 488, 763], [775, 490, 492], [892, 497, 612], [494, 739, 779], [844, 495, 504], [495, 504, 844], [504, 495, 844], [874, 777, 503], [785, 694, 506], [440, 759, 695], [439, 616, 787], [759, 440, 786], [877, 766, 734], [658, 703, 793], [878, 767, 707], [708, 706, 910], [520, 745, 710], [524, 806, 849], [803, 524, 849], [801, 677, 714], [915, 801, 714], [711, 578, 747], [628, 805, 851], [748, 712, 852], [715, 713, 879], [714, 579, 749], [662, 748, 853], [809, 715, 810], [663, 535, 720], [665, 636, 857], [859, 726, 818], [819, 725, 884], [725, 726, 859], [885, 642, 820], [642, 860, 822], [771, 861, 825], [753, 861, 474], [754, 752, 647], [650, 864, 942], [941, 831, 602], [670, 729, 944], [866, 550, 670], [836, 737, 608], [950, 655, 566], [888, 755, 756], [738, 685, 955], [610, 482, 869], [889, 484, 610], [485, 689, 489], [890, 742, 843], [891, 890, 843], [779, 739, 873], [691, 496, 778], [893, 764, 894], [765, 894, 764], [1037, 977, 781], [895, 656, 845], [846, 656, 784], [783, 439, 897], [509, 898, 503], [614, 694, 982], [697, 743, 847], [899, 439, 787], [848, 571, 788], [789, 902, 512], [700, 766, 903], [790, 786, 876], [658, 902, 789], [790, 876, 904], [904, 905, 790], [790, 905, 792], [877, 734, 878], [734, 767, 878], [907, 621, 620], [797, 623, 908], [912, 707, 800], [446, 801, 989], [745, 850, 710], [800, 711, 913], [916, 802, 746], [806, 627, 802], [917, 711, 747], [917, 747, 678], [712, 804, 918], [715, 919, 810], [920, 678, 808], [807, 749, 716], [921, 662, 853], [663, 720, 922], [721, 664, 856], [722, 591, 924], [856, 926, 721], [927, 761, 721], [857, 636, 768], [818, 724, 883], [928, 824, 930], [963, 930, 825], [928, 929, 824], [930, 824, 825], [932, 931, 825], [669, 824, 933], [933, 668, 669], [932, 825, 861], [931, 932, 861], [826, 681, 935], [736, 934, 727], [861, 753, 936], [937, 828, 682], [753, 651, 936], [829, 828, 939], [752, 754, 940], [727, 938, 728], [728, 646, 727], [650, 942, 830], [670, 945, 866], [607, 554, 867], [607, 867, 946], [966, 886, 833], [836, 833, 886], [737, 836, 886], [762, 838, 948], [950, 566, 565], [952, 887, 951], [772, 951, 887], [842, 951, 772], [772, 887, 953], [954, 868, 772], [955, 756, 686], [757, 868, 954], [482, 773, 957], [890, 741, 742], [497, 892, 972], [499, 741, 974], [871, 489, 844], [764, 893, 895], [845, 764, 895], [765, 781, 894], [873, 782, 779], [896, 693, 436], [785, 693, 980], [981, 694, 785], [982, 694, 981], [697, 847, 984], [786, 512, 904], [673, 659, 901], [876, 786, 904], [700, 903, 787], [904, 512, 902], [958, 744, 848], [959, 877, 878], [792, 906, 745], [621, 907, 911], [746, 621, 911], [524, 803, 914], [805, 708, 1046], [852, 712, 918], [715, 879, 919], [716, 999, 807], [853, 748, 852], [921, 853, 662], [718, 662, 880], [812, 809, 1000], [811, 663, 922], [813, 718, 880], [923, 717, 812], [814, 717, 923], [816, 666, 962], [666, 817, 962], [817, 666, 881], [1002, 1004, 723], [883, 724, 1002], [1006, 818, 883], [679, 882, 1005], [859, 884, 725], [930, 929, 928], [931, 963, 825], [824, 929, 933], [735, 826, 823], [935, 681, 752], [939, 828, 937], [1017, 754, 830], [829, 939, 833], [943, 966, 833], [864, 832, 865], [1029, 609, 732], [1028, 562, 672], [1032, 950, 565], [952, 953, 887], [955, 685, 757], [869, 889, 610], [1035, 485, 871], [1035, 773, 485], [967, 872, 739], [968, 739, 690], [969, 612, 488], [892, 612, 972], [974, 741, 971], [1036, 893, 894], [891, 843, 777], [975, 891, 777], [978, 782, 873], [895, 1038, 784], [656, 895, 784], [896, 436, 782], [503, 898, 979], [875, 980, 693], [982, 983, 614], [899, 897, 439], [614, 983, 788], [899, 787, 900], [898, 509, 673], [898, 673, 901], [620, 744, 958], [704, 791, 985], [902, 658, 793], [659, 702, 796], [792, 905, 906], [795, 908, 515], [908, 795, 515], [515, 795, 793], [989, 798, 446], [909, 745, 1044], [990, 746, 911], [990, 911, 746], [801, 915, 989], [914, 709, 524], [916, 993, 746], [993, 916, 746], [714, 807, 997], [879, 715, 919], [879, 919, 715], [808, 811, 750], [750, 811, 808], [814, 923, 591], [719, 665, 960], [925, 960, 665], [961, 594, 816], [721, 926, 1001], [1001, 926, 721], [721, 926, 927], [723, 1004, 1002], [1005, 761, 927], [761, 1005, 882], [724, 723, 1002], [1049, 638, 858], [1008, 769, 770], [1006, 859, 818], [1009, 1050, 929], [930, 1009, 929], [1009, 930, 963], [933, 929, 1052], [821, 680, 735], [821, 735, 1011], [601, 822, 860], [668, 933, 964], [935, 823, 826], [931, 861, 965], [601, 860, 736], [827, 668, 1012], [1013, 937, 1012], [1012, 937, 682], [965, 861, 936], [727, 934, 1058], [1015, 936, 651], [939, 937, 1016], [938, 1018, 728], [938, 728, 1018], [863, 728, 938], [1017, 940, 754], [833, 939, 943], [1015, 862, 1020], [830, 942, 1019], [941, 602, 863], [670, 944, 945], [1021, 670, 945], [1021, 945, 670], [946, 730, 607], [1022, 550, 866], [835, 1024, 834], [835, 556, 1024], [762, 948, 732], [949, 732, 948], [1029, 732, 949], [731, 562, 1028], [1031, 654, 841], [1031, 841, 654], [1031, 841, 655], [565, 840, 1032], [950, 1031, 655], [888, 842, 755], [772, 953, 1033], [955, 757, 1034], [686, 687, 956], [869, 482, 957], [486, 484, 774], [763, 487, 870], [775, 690, 490], [968, 967, 739], [775, 492, 970], [971, 741, 890], [691, 778, 776], [893, 973, 895], [974, 780, 499], [873, 739, 967], [973, 893, 1036], [894, 781, 977], [1037, 781, 435], [780, 435, 498], [1037, 435, 780], [975, 777, 874], [978, 896, 782], [896, 875, 693], [743, 784, 847], [900, 903, 899], [697, 984, 1039], [903, 900, 787], [791, 697, 985], [902, 1041, 904], [1043, 620, 958], [905, 904, 1041], [620, 1043, 987], [792, 906, 905], [906, 792, 905], [1044, 906, 905], [792, 906, 1044], [792, 1044, 906], [878, 707, 988], [1045, 794, 1042], [706, 794, 1045], [906, 1044, 745], [707, 912, 988], [796, 798, 989], [745, 1044, 991], [745, 909, 1044], [909, 745, 991], [911, 990, 746], [800, 913, 912], [745, 909, 991], [850, 745, 991], [1046, 708, 910], [992, 711, 917], [992, 913, 711], [914, 803, 849], [996, 851, 805], [996, 805, 1046], [804, 850, 994], [714, 997, 995], [852, 918, 998], [810, 919, 879], [750, 811, 808], [880, 662, 853], [760, 855, 854], [1066, 718, 880], [813, 880, 856], [594, 1047, 815], [1048, 924, 591], [1047, 594, 961], [961, 816, 962], [723, 722, 924], [883, 1002, 1004], [881, 638, 1049], [1007, 768, 769], [1005, 820, 679], [1008, 1007, 769], [1079, 884, 819], [963, 1051, 1009], [860, 642, 1010], [1053, 963, 931], [933, 1054, 964], [682, 827, 1012], [935, 752, 1056], [752, 940, 1056], [727, 1058, 938], [1014, 1016, 937], [727, 1018, 938], [651, 862, 1015], [943, 939, 1016], [862, 834, 1020], [941, 863, 831], [831, 944, 729], [552, 550, 1022], [554, 552, 1023], [554, 1060, 867], [737, 886, 838], [1025, 556, 837], [837, 652, 839], [947, 948, 838], [1026, 558, 731], [672, 654, 1030], [952, 1062, 1063], [952, 1063, 953], [888, 756, 955], [954, 772, 1033], [738, 955, 956], [687, 738, 956], [492, 776, 970], [492, 493, 776], [1073, 894, 977], [778, 497, 976], [778, 496, 497], [844, 504, 783], [874, 503, 979], [1042, 704, 985], [794, 704, 1042], [1041, 902, 793], [1043, 620, 987], [907, 620, 1043], [793, 795, 908], [912, 878, 988], [908, 795, 797], [910, 706, 1045], [907, 990, 911], [799, 709, 1064], [994, 850, 991], [802, 993, 1076], [802, 916, 993], [879, 713, 851], [998, 918, 994], [1065, 917, 678], [1065, 678, 920], [854, 999, 716], [720, 815, 922], [855, 719, 960], [1001, 926, 856], [925, 857, 768], [1002, 723, 924], [1003, 925, 768], [858, 598, 819], [1067, 1068, 1069], [1067, 1069, 1050], [1009, 1067, 1050], [1079, 819, 884], [1079, 819, 884], [821, 1008, 770], [929, 1050, 1052], [1050, 1069, 1052], [1010, 642, 885], [933, 1052, 1054], [735, 823, 1011], [964, 1054, 1012], [965, 1055, 931], [937, 1057, 1014], [937, 1013, 1057], [965, 936, 1055], [936, 1015, 1059], [938, 1018, 727], [966, 943, 1016], [865, 730, 946], [1060, 1070, 867], [834, 1024, 1020], [947, 838, 886], [556, 1025, 1024], [731, 1027, 1026], [840, 609, 1029], [956, 955, 686], [484, 889, 774], [487, 774, 870], [968, 690, 775], [488, 870, 969], [967, 739, 872], [1074, 972, 612], [1073, 1036, 894], [975, 1071, 891], [976, 497, 972], [976, 972, 1074], [1037, 1090, 977], [783, 897, 899], [785, 980, 981], [981, 980, 982], [982, 980, 1075], [985, 697, 1039], [903, 766, 877], [1040, 901, 659], [986, 1040, 659], [796, 986, 659], [878, 912, 988], [799, 908, 623], [746, 990, 916], [1064, 709, 914], [992, 912, 913], [915, 714, 995], [849, 806, 1076], [918, 804, 994], [917, 1065, 920], [1000, 809, 810], [1066, 880, 853], [1077, 855, 960], [962, 1047, 961], [883, 1004, 1006], [768, 1007, 1003], [1078, 1067, 1009], [1078, 1009, 1080], [1081, 736, 860], [934, 736, 1081], [668, 964, 1012], [863, 938, 1018], [1019, 942, 864], [1070, 865, 946], [1022, 866, 945], [946, 867, 1070], [1023, 552, 1022], [839, 558, 1026], [949, 948, 1102], [1028, 672, 1030], [1030, 654, 841], [612, 972, 1074], [1072, 895, 973], [780, 974, 971], [1107, 844, 783], [1092, 783, 899], [806, 802, 1076], [1048, 591, 923], [858, 819, 1079], [1006, 884, 859], [860, 1010, 885], [931, 1055, 1099], [1011, 823, 935], [1055, 936, 1059], [1060, 554, 1023], [886, 1083, 947], [1027, 731, 1028], [1103, 1032, 840], [1104, 1063, 1086], [1063, 1062, 1086], [757, 954, 1034], [890, 891, 1088], [1071, 1088, 891], [774, 1087, 870], [870, 1087, 774], [612, 969, 972], [1089, 871, 844], [1071, 975, 1091], [895, 1072, 1038], [899, 903, 1093], [877, 959, 903], [959, 877, 903], [1041, 793, 1132], [808, 811, 922], [880, 718, 1066], [1068, 1097, 1069], [1006, 1079, 884], [1097, 1085, 1069], [1051, 963, 1053], [1052, 1069, 1085], [1014, 1057, 1100], [966, 1016, 1082], [1016, 1117, 1082], [1118, 831, 863], [1022, 945, 1021], [1102, 947, 1061], [1102, 948, 947], [949, 1102, 1084], [1105, 1088, 1071], [1073, 977, 1090], [847, 784, 1127], [903, 877, 1128], [1128, 877, 959], [912, 1130, 988], [912, 992, 1109], [807, 999, 854], [852, 853, 1136], [853, 852, 1136], [812, 1000, 1241], [1095, 1067, 1078], [1110, 1096, 1112], [1110, 1068, 1095], [1111, 1095, 1078], [1068, 1112, 1096], [1068, 1110, 1112], [1067, 1095, 1068], [1097, 1068, 1096], [884, 1079, 1203], [1080, 1009, 1051], [1085, 1054, 1052], [860, 885, 1098], [1054, 1085, 1114], [1057, 1116, 1100], [1016, 1014, 1117], [865, 1120, 864], [1122, 1020, 1024], [1020, 1122, 1119], [1121, 865, 1070], [1101, 1061, 947], [1029, 949, 1084], [1062, 1086, 1124], [1106, 890, 1088], [780, 971, 1165], [873, 967, 1126], [1164, 1037, 780], [1038, 895, 1169], [1171, 874, 979], [984, 847, 1127], [1174, 788, 983], [796, 1040, 986], [1045, 1042, 1129], [1041, 1108, 905], [1131, 1132, 793], [793, 908, 1131], [1044, 905, 1108], [910, 1045, 1133], [1179, 989, 915], [799, 1064, 1181], [1046, 910, 1133], [1044, 1094, 1134], [991, 1135, 994], [1183, 915, 995], [995, 997, 1183], [1186, 917, 920], [1187, 997, 807], [1188, 998, 994], [852, 1136, 853], [1193, 1077, 855], [1193, 855, 1077], [923, 812, 1241], [856, 1195, 1001], [1110, 1095, 1197], [927, 926, 1001], [1110, 1112, 1096], [1051, 1113, 1206], [1113, 1051, 1053], [1053, 931, 1141], [821, 1011, 1209], [1054, 1114, 1013], [1012, 1054, 1013], [1099, 1055, 1210], [1142, 1011, 935], [1014, 1100, 1117], [1143, 1059, 1144], [1059, 1015, 1144], [1015, 1119, 1144], [1019, 864, 1215], [1145, 1119, 1146], [1216, 944, 831], [1119, 1122, 1146], [945, 1219, 1021], [1083, 947, 1101], [947, 1083, 1101], [1025, 837, 1123], [837, 839, 1123], [1222, 1029, 1084], [1029, 1149, 840], [1124, 1086, 1062], [952, 1150, 1062], [1124, 1086, 1062], [954, 1153, 1034], [1155, 773, 871], [1071, 1154, 1105], [1071, 1105, 1154], [1157, 1087, 870], [1157, 870, 1087], [967, 968, 1160], [1163, 972, 969], [1167, 1074, 972], [1163, 1167, 972], [1090, 1037, 1164], [1166, 778, 976], [1107, 1168, 844], [1038, 1169, 784], [978, 873, 1126], [875, 1172, 980], [983, 982, 1173], [1175, 848, 788], [1128, 1234, 1233], [958, 1176, 1043], [1177, 959, 878], [1178, 1043, 1176], [1108, 1041, 1132], [1044, 1108, 1236], [1094, 1044, 1180], [1064, 914, 1182], [1044, 1134, 991], [998, 1136, 852], [1137, 810, 879], [1066, 853, 1192], [1066, 856, 880], [1242, 815, 1047], [927, 1001, 1138], [881, 962, 817], [1110, 1196, 1112], [1002, 1048, 1004], [1002, 924, 1048], [1198, 1196, 1110], [1199, 1095, 1111], [1003, 1007, 1200], [1049, 858, 881], [1079, 884, 1203], [1113, 1205, 1051], [1140, 820, 1139], [1051, 1206, 1113], [1206, 1113, 1053], [1098, 885, 1284], [1099, 1141, 931], [1211, 1100, 1116], [934, 1081, 1058], [1055, 1059, 1143], [1056, 940, 1017], [1288, 1082, 1117], [1119, 1015, 1020], [1118, 1214, 831], [1147, 1145, 1146], [1217, 1120, 865], [944, 1021, 945], [1146, 1122, 1147], [1219, 1022, 1021], [1023, 1248, 1249], [1070, 1060, 1220], [1121, 1070, 1220], [1101, 947, 1083], [1101, 1148, 1061], [1122, 1024, 1221], [1221, 1024, 1025], [1030, 841, 1031], [1103, 840, 1149], [1032, 1225, 950], [1124, 1152, 1086], [1086, 1227, 1104], [955, 1034, 888], [1033, 1228, 1229], [773, 1035, 871], [1231, 973, 1036], [1231, 1230, 973], [1071, 1156, 1105], [774, 1157, 870], [971, 890, 1158], [1166, 776, 778], [1126, 967, 1160], [1169, 895, 1038], [783, 1168, 1107], [978, 1126, 896], [1170, 783, 1092], [982, 1075, 1173], [983, 1173, 1174], [1303, 1093, 903], [1128, 1233, 903], [988, 1177, 878], [796, 989, 1179], [1264, 912, 1109], [993, 916, 990], [994, 1135, 1238], [1184, 849, 1076], [996, 1185, 851], [1190, 807, 854], [879, 1191, 1137], [1239, 808, 922], [1243, 1198, 1197], [1198, 1110, 1197], [1112, 1196, 1244], [1096, 1244, 1202], [1112, 1244, 1096], [1201, 1200, 1007], [1097, 1096, 1202], [820, 1005, 1139], [1201, 1007, 1008], [1085, 1207, 1283], [1314, 1141, 1099], [860, 1098, 1284], [1115, 1055, 1143], [1021, 944, 1218], [1147, 1122, 1146], [1219, 945, 1021], [1023, 1022, 1248], [1061, 1148, 1250], [1025, 1251, 1221], [1252, 1025, 1123], [839, 1252, 1123], [1026, 1027, 1028], [1222, 1084, 1294], [1030, 1031, 1223], [1223, 1031, 1224], [1031, 950, 1224], [1124, 1062, 1150], [1124, 1254, 1152], [1151, 952, 951], [842, 888, 1034], [1033, 953, 1228], [954, 1033, 1229], [871, 1255, 1155], [1105, 1156, 1154], [969, 870, 1302], [1090, 1162, 1073], [1164, 780, 1165], [1257, 844, 1168], [1258, 1071, 1091], [1258, 1156, 1071], [1091, 975, 1258], [1259, 1260, 896], [875, 896, 1260], [959, 1234, 1128], [1265, 1131, 908], [990, 907, 1235], [908, 799, 1181], [1179, 915, 989], [1237, 1180, 1044], [1182, 1267, 1064], [1046, 1268, 996], [992, 917, 1269], [917, 1186, 1269], [1076, 1270, 1184], [1137, 1191, 879], [1193, 854, 1077], [854, 855, 1077], [1000, 810, 1273], [1194, 960, 925], [1196, 1309, 1274], [1244, 1196, 1274], [1277, 1202, 1244], [1078, 1199, 1111], [1079, 1006, 1279], [1051, 1281, 1080], [1051, 1205, 1281], [1008, 1204, 1201], [1097, 1202, 1245], [885, 820, 1140], [885, 1140, 1396], [885, 1208, 1284], [1085, 1283, 1114], [1142, 1209, 1011], [1210, 1055, 1285], [1285, 1055, 1115], [1142, 935, 1286], [1013, 1318, 1057], [1320, 1144, 1247], [1017, 1287, 1056], [1100, 1288, 1117], [938, 1212, 1018], [863, 1018, 1213], [864, 1120, 1406], [1217, 865, 1121], [1219, 1021, 1218], [1220, 1217, 1121], [1291, 1101, 1083], [1060, 1023, 1249], [1250, 1102, 1061], [1102, 1250, 1292], [1293, 1252, 839], [1293, 839, 1026], [1253, 1325, 1294], [1222, 1326, 1029], [1296, 1030, 1223], [1326, 1149, 1029], [1298, 1254, 1297], [1124, 1297, 1254], [1152, 1254, 1298], [1151, 951, 1226], [842, 1300, 951], [1086, 1152, 1227], [1328, 1063, 1104], [1155, 957, 773], [889, 1329, 774], [774, 1330, 1157], [973, 1256, 1230], [1230, 1256, 973], [1036, 1073, 1231], [1073, 1301, 1231], [970, 1159, 775], [970, 776, 1161], [1089, 844, 1257], [1167, 1163, 1074], [1163, 1167, 1074], [1357, 1168, 783], [1357, 783, 1170], [1092, 899, 1170], [984, 1127, 1361], [1173, 1075, 1261], [1171, 979, 898], [1232, 1171, 898], [899, 1093, 1303], [1133, 1045, 1266], [1094, 1180, 1134], [994, 1238, 1306], [1307, 1309, 1196], [1308, 1307, 1196], [1333, 1309, 1307], [1198, 1308, 1196], [1308, 1198, 1243], [1243, 1197, 1275], [1386, 1047, 962], [1275, 1197, 1095], [1311, 1275, 1095], [1311, 1095, 1199], [1244, 1274, 1277], [1276, 927, 1138], [1312, 1006, 1004], [1005, 927, 1276], [1078, 1080, 1199], [1202, 1277, 1278], [1280, 1005, 1139], [1097, 1245, 1085], [1085, 1245, 1313], [1314, 1053, 1141], [1285, 1115, 1315], [1211, 1316, 1100], [1100, 1316, 1317], [1143, 1320, 1115], [1115, 1320, 1315], [1321, 1058, 1081], [935, 1056, 1286], [1319, 1318, 1013], [1320, 1143, 1144], [1056, 1287, 1017], [938, 1058, 1212], [1119, 1145, 1147], [1119, 1147, 1145], [1218, 1322, 1219], [1323, 1060, 1249], [1251, 1025, 1252], [1252, 1293, 1324], [1084, 1253, 1294], [1028, 1295, 1026], [1298, 1296, 1327], [1150, 952, 1151], [1152, 1298, 1299], [1299, 1298, 1327], [1152, 1299, 1227], [842, 1034, 1300], [869, 957, 1125], [1344, 957, 1155], [1329, 889, 1345], [973, 1256, 1230], [1073, 1162, 1301], [1255, 871, 1089], [1157, 1302, 870], [1169, 1072, 1354], [1169, 1038, 1072], [1163, 1074, 1167], [874, 1258, 975], [1127, 784, 1359], [899, 1303, 1170], [901, 1040, 1362], [907, 1043, 1235], [1132, 1131, 1365], [1180, 1237, 1044], [908, 1181, 1332], [1135, 991, 1238], [996, 1268, 1185], [1305, 1076, 993], [994, 1306, 1238], [1269, 1186, 920], [1373, 807, 1190], [1272, 854, 1377], [856, 1066, 1381], [1381, 1384, 856], [1309, 1333, 1274], [1392, 1111, 1199], [1334, 1278, 1277], [1391, 881, 1393], [881, 858, 1393], [1334, 1335, 1278], [1394, 858, 1079], [1395, 1080, 1281], [1139, 1005, 1280], [1202, 1278, 1245], [1205, 1113, 1206], [1008, 821, 1282], [1053, 1246, 1206], [1204, 1008, 1282], [1314, 1099, 1210], [1318, 1319, 1398], [1212, 1058, 1321], [1017, 1287, 1056], [1400, 1056, 1287], [1082, 1288, 1290], [1288, 1401, 1290], [1017, 830, 1289], [863, 1213, 1402], [1214, 1118, 863], [830, 1019, 1215], [1322, 944, 1407], [1122, 1147, 1146], [1322, 1218, 944], [1291, 1410, 1101], [1252, 1341, 1251], [1292, 1084, 1102], [1252, 1324, 1342], [1252, 1342, 1341], [1253, 1084, 1292], [1028, 1296, 1298], [1028, 1030, 1296], [1227, 1299, 1327], [1420, 1063, 1328], [1344, 1125, 957], [869, 1345, 889], [1154, 1346, 1105], [1330, 774, 1329], [1256, 973, 1230], [1106, 1347, 890], [1156, 1350, 1154], [1154, 1350, 1348], [1072, 973, 1349], [775, 1352, 968], [1158, 890, 1351], [1160, 968, 1352], [1164, 1162, 1090], [1163, 969, 1302], [1354, 1072, 1349], [1158, 1165, 971], [1436, 776, 1166], [1160, 1355, 1126], [976, 1074, 1356], [1126, 1259, 896], [1171, 1258, 874], [875, 1260, 1172], [1075, 980, 1261], [1360, 1170, 1303], [1361, 1127, 1359], [1174, 1175, 788], [1039, 984, 1304], [1303, 903, 1233], [1262, 901, 1362], [848, 1175, 958], [1175, 1363, 958], [1362, 1040, 1364], [1363, 1178, 1176], [1040, 796, 1364], [985, 1129, 1042], [1364, 796, 1263], [1045, 1129, 1266], [1263, 796, 1179], [1265, 1365, 1131], [1365, 1236, 1108], [1181, 1267, 1332], [1268, 1133, 1366], [915, 1183, 989], [1133, 1268, 1046], [914, 1369, 1182], [993, 990, 1368], [1370, 1183, 997], [1305, 993, 1368], [1369, 914, 849], [1371, 1370, 997], [1076, 1305, 1270], [997, 1187, 1371], [1269, 920, 1271], [1373, 1187, 807], [1371, 1187, 1373], [1374, 998, 1188], [1136, 998, 1374], [1192, 853, 1136], [1240, 1239, 922], [1378, 1380, 1333], [922, 1242, 1383], [1378, 1307, 1379], [1378, 1333, 1307], [1240, 922, 1383], [1380, 1382, 1333], [1242, 1047, 1383], [1387, 1333, 1382], [1333, 1387, 1274], [1310, 923, 1241], [1310, 1048, 923], [1423, 1194, 925], [1388, 1275, 1311], [1388, 1311, 1199], [1138, 1001, 1195], [1312, 1004, 1310], [1274, 1387, 1334], [1138, 1195, 1390], [1389, 962, 881], [881, 1391, 1389], [1200, 925, 1003], [1277, 1274, 1334], [1111, 1392, 1199], [1276, 1138, 1390], [1199, 1080, 1392], [1392, 1080, 1281], [1394, 1393, 858], [1203, 1394, 1079], [1079, 1279, 1203], [1005, 1280, 1140], [1278, 1335, 1425], [1206, 1395, 1281], [1206, 1281, 1205], [1140, 1139, 1005], [1246, 1314, 1206], [1207, 1085, 1313], [1282, 821, 1209], [1283, 1207, 1313], [1314, 1210, 1285], [1319, 1114, 1283], [1284, 1336, 860], [1284, 1427, 1336], [1142, 1286, 1209], [860, 1336, 1081], [1013, 1337, 1319], [1319, 1337, 1013], [1336, 1321, 1081], [1398, 1319, 1337], [1056, 1400, 1287], [1288, 1100, 1317], [1399, 1058, 1212], [1399, 1212, 1058], [1399, 1018, 1212], [1119, 1247, 1144], [1404, 1247, 1119], [1402, 1018, 1213], [1018, 1402, 1213], [1403, 1289, 1017], [830, 1403, 1289], [1017, 1289, 1403], [1402, 1214, 863], [1145, 1404, 1119], [1147, 1404, 1145], [1082, 1290, 1405], [831, 1214, 1216], [944, 1216, 1407], [966, 1408, 886], [1404, 1122, 1409], [1404, 1147, 1122], [1406, 1120, 1217], [1338, 1083, 1408], [1083, 886, 1408], [1122, 1251, 1409], [1023, 1249, 1248], [1411, 1023, 1248], [1023, 1411, 1249], [1220, 1070, 1412], [1410, 1148, 1101], [1060, 1323, 1339], [1323, 1060, 1339], [1070, 1220, 1412], [1410, 1250, 1148], [1022, 1340, 1248], [1022, 1219, 1340], [1340, 1219, 1248], [1323, 1249, 1339], [1339, 1249, 1411], [1410, 1413, 1250], [1219, 1340, 1248], [1414, 1250, 1413], [1122, 1221, 1251], [1342, 1324, 1341], [1415, 1293, 1026], [1295, 1415, 1026], [1415, 1295, 1028], [1295, 1028, 1298], [1032, 1431, 1225], [1224, 950, 1225], [1224, 1296, 1223], [1150, 1343, 1124], [1343, 1150, 1151], [1296, 1432, 1327], [1419, 951, 1300], [1227, 1327, 1418], [1104, 1227, 1328], [1153, 1419, 1034], [1419, 1300, 1034], [1345, 869, 1125], [1088, 1105, 1346], [1106, 1088, 1347], [1255, 1089, 1257], [973, 1230, 1349], [1162, 1164, 1301], [1454, 1255, 1257], [970, 1161, 1159], [1257, 1168, 1353], [1074, 1163, 1356], [976, 1356, 1166], [1126, 1355, 1259], [980, 1172, 1261], [1304, 984, 1361], [1174, 1173, 1175], [901, 1232, 898], [1437, 1303, 1233], [1232, 901, 1262], [1331, 1039, 1304], [985, 1039, 1331], [1176, 958, 1363], [1234, 959, 1177], [1129, 985, 1331], [1177, 988, 1130], [1235, 1043, 1178], [1108, 1132, 1365], [1265, 908, 1332], [1180, 1044, 1236], [1366, 1133, 1266], [1183, 1179, 989], [1368, 990, 1235], [1181, 1064, 1267], [1264, 1109, 992], [1134, 1180, 1238], [991, 1134, 1238], [1369, 849, 1184], [879, 851, 1372], [1188, 994, 1238], [920, 808, 1375], [1239, 1375, 808], [810, 1137, 1376], [1377, 854, 1193], [1381, 1066, 1192], [1194, 1193, 1077], [1379, 1307, 1308], [960, 1194, 1077], [922, 815, 1242], [1385, 1308, 1243], [1385, 1243, 1275], [1047, 1386, 1383], [856, 1384, 1195], [1004, 1048, 1310], [1005, 1276, 1390], [1005, 1390, 1280], [1279, 1006, 1312], [1281, 1080, 1395], [1245, 1278, 1425], [1314, 1246, 1053], [885, 1396, 1208], [1426, 1314, 1285], [1319, 1013, 1114], [1211, 1057, 1398], [1211, 1116, 1057], [1057, 1318, 1398], [1056, 1287, 1286], [1428, 1212, 1321], [1212, 1428, 1399], [1287, 1017, 1400], [1401, 1288, 1317], [1400, 1017, 1289], [1018, 1399, 1213], [1215, 864, 1406], [966, 1082, 1405], [1405, 1408, 966], [1220, 1060, 1323], [1412, 1220, 1323], [1323, 1411, 1339], [1323, 1339, 1411], [1325, 1253, 1429], [1430, 1325, 1429], [1415, 1028, 1295], [1294, 1326, 1222], [1149, 1326, 1416], [1343, 1297, 1124], [951, 1419, 1226], [1418, 1327, 1433], [1063, 1420, 1228], [953, 1063, 1228], [1153, 954, 1229], [1347, 1088, 1346], [1421, 1349, 1230], [1453, 1157, 1330], [1351, 890, 1347], [1352, 775, 1159], [1258, 1350, 1156], [1161, 776, 1436], [1355, 1160, 1422], [784, 1169, 1358], [1258, 1171, 1456], [1130, 912, 1264], [1367, 1264, 992], [1134, 1238, 1180], [1367, 992, 1269], [851, 1185, 1372], [879, 1372, 1189], [1271, 920, 1375], [1375, 1271, 1239], [1271, 1375, 1239], [1190, 854, 1373], [879, 1189, 1137], [1273, 810, 1376], [1379, 1463, 1378], [1379, 1308, 1441], [1241, 1000, 1273], [1382, 1442, 1443], [1382, 1443, 1387], [1423, 925, 1424], [1386, 962, 1389], [925, 1423, 1424], [1424, 925, 1200], [1314, 1444, 1206], [1397, 1283, 1313], [1316, 1445, 1446], [1317, 1316, 1446], [1403, 830, 1215], [1407, 1216, 1214], [1407, 1214, 1447], [1219, 1322, 1448], [1032, 1103, 1417], [1032, 1417, 1431], [1149, 1416, 1417], [1103, 1149, 1417], [1432, 1296, 1224], [1450, 1451, 1434], [1450, 1449, 1451], [1453, 1302, 1157], [1452, 1301, 1164], [1455, 1356, 1163], [1359, 784, 1358], [1264, 1457, 1130], [1470, 1267, 1182], [1270, 1305, 1458], [1184, 1270, 1438], [1439, 1184, 1438], [1270, 1458, 1438], [1439, 1438, 1462], [1439, 1462, 1459], [1462, 1438, 1460], [1461, 1459, 1462], [1373, 854, 1272], [1378, 1463, 1461], [1461, 1462, 1380], [1378, 1461, 1380], [1380, 1462, 1440], [1380, 1440, 1442], [1380, 1442, 1382], [1209, 1465, 1282], [1290, 1401, 1477], [1408, 1405, 1338], [1291, 1083, 1338], [1219, 1448, 1466], [1219, 1466, 1340], [1411, 1248, 1340], [1467, 1220, 1412], [1217, 1220, 1467], [1433, 1327, 1432], [1153, 1229, 1228], [1419, 1153, 1228], [1434, 1451, 1435], [1454, 1257, 1522], [1356, 1436, 1166], [1175, 1468, 1363], [1366, 1266, 1268], [1469, 1367, 1269], [1369, 1439, 1459], [1369, 1184, 1439], [1239, 1489, 1375], [1460, 1458, 1488], [1463, 1459, 1461], [1462, 1460, 1440], [1374, 1192, 1136], [1463, 1379, 1471], [1440, 1460, 1472], [1440, 1472, 1473], [1442, 1440, 1473], [1385, 1275, 1388], [1423, 925, 1424], [1334, 1443, 1464], [1335, 1334, 1474], [1475, 1314, 1426], [1396, 1496, 1208], [1286, 1287, 1476], [1402, 1213, 1399], [1402, 1399, 1478], [1324, 1252, 1341], [1298, 1297, 1295], [1418, 1433, 1449], [1453, 1163, 1302], [1452, 1164, 1165], [1356, 1455, 1436], [1479, 1355, 1422], [1353, 1168, 1357], [1172, 1173, 1261], [1233, 1234, 1177], [1235, 1178, 1481], [1483, 1332, 1267], [1134, 1180, 1485], [1485, 1238, 1134], [1470, 1182, 1369], [1305, 1486, 1458], [1470, 1369, 1459], [1458, 1515, 1555], [1463, 1487, 1459], [1460, 1438, 1458], [1242, 1240, 1383], [1443, 1442, 1473], [1381, 1492, 1195], [1381, 1195, 1384], [1334, 1387, 1443], [1388, 1199, 1392], [1334, 1464, 1474], [1206, 1444, 1395], [1314, 1475, 1444], [1313, 1245, 1425], [1313, 1425, 1495], [1496, 1284, 1208], [1283, 1397, 1319], [1209, 1497, 1465], [1497, 1209, 1286], [1498, 1320, 1247], [1401, 1317, 1477], [1498, 1247, 1404], [1501, 1400, 1289], [1403, 1501, 1289], [1290, 1477, 1500], [1399, 1428, 1478], [1502, 1403, 1215], [1402, 1478, 1503], [1504, 1215, 1406], [1505, 1504, 1406], [1467, 1406, 1217], [1467, 1505, 1406], [1322, 1407, 1448], [1414, 1413, 1506], [1339, 1412, 1323], [1509, 1292, 1414], [1292, 1250, 1414], [1521, 1251, 1341], [1521, 1341, 1252], [1415, 1324, 1293], [1225, 1511, 1224], [1151, 1510, 1343], [1419, 1151, 1226], [1449, 1433, 1512], [1450, 1227, 1418], [1449, 1450, 1418], [1451, 1449, 1512], [1347, 1346, 1623], [1453, 1513, 1163], [1480, 1350, 1258], [1361, 1359, 1523], [1175, 1173, 1468], [1177, 1130, 1525], [1482, 1235, 1481], [1265, 1332, 1483], [1484, 1180, 1236], [1235, 1482, 1514], [1268, 1266, 1366], [1305, 1368, 1486], [1470, 1459, 1487], [1271, 1375, 1489], [1472, 1460, 1517], [1471, 1379, 1441], [1241, 1273, 1490], [1443, 1473, 1491], [1280, 1390, 1493], [1531, 1204, 1282], [1465, 1497, 1286], [1321, 1427, 1519], [1427, 1321, 1336], [1477, 1317, 1446], [1499, 1476, 1287], [1287, 1400, 1499], [1215, 1504, 1502], [1466, 1508, 1340], [1297, 1415, 1295], [1432, 1224, 1511], [1419, 1228, 1151], [1536, 1231, 1301], [1257, 1353, 1522], [1468, 1173, 1524], [1468, 1543, 1363], [1368, 1235, 1514], [1188, 1238, 1526], [1486, 1515, 1458], [1189, 1372, 1185], [1460, 1488, 1517], [1527, 1471, 1441], [1239, 1240, 1682], [1441, 1308, 1385], [1240, 1242, 1383], [1194, 1423, 1424], [1528, 1386, 1389], [1564, 1388, 1392], [1443, 1491, 1464], [1529, 1389, 1391], [1569, 1280, 1493], [1496, 1427, 1284], [1465, 1286, 1497], [1316, 1211, 1573], [1577, 1576, 1315], [1577, 1315, 1320], [1211, 1398, 1518], [1477, 1579, 1580], [1534, 1344, 1155], [1535, 1155, 1255], [1616, 1536, 1301], [1538, 1453, 1330], [1301, 1452, 1537], [1349, 1421, 1540], [1452, 1165, 1541], [1171, 1232, 1456], [1172, 1542, 1173], [1542, 1524, 1173], [1544, 1233, 1177], [1363, 1543, 1545], [1362, 1364, 1594], [1363, 1545, 1178], [1178, 1545, 1481], [1263, 1546, 1364], [1236, 1365, 1548], [1368, 1514, 1549], [1486, 1368, 1549], [1550, 1485, 1180], [1486, 1552, 1515], [1487, 1463, 1471], [1553, 1487, 1471], [1555, 1488, 1458], [1557, 1273, 1376], [1517, 1488, 1558], [1473, 1472, 1517], [1441, 1385, 1559], [1517, 1560, 1473], [1689, 1775, 1385], [1381, 1686, 1692], [1194, 1424, 1561], [1473, 1562, 1491], [1528, 1389, 1529], [1464, 1491, 1565], [1474, 1464, 1567], [1281, 1566, 1392], [1281, 1395, 1566], [1200, 1201, 1568], [1444, 1494, 1395], [1444, 1530, 1494], [1474, 1425, 1335], [1569, 1140, 1280], [1282, 1465, 1571], [1571, 1465, 1497], [1427, 1572, 1574], [1575, 1446, 1445], [1573, 1211, 1518], [1578, 1321, 1519], [1477, 1446, 1579], [1320, 1498, 1612], [1499, 1400, 1520], [1477, 1580, 1500], [1520, 1400, 1501], [1581, 1501, 1403], [1410, 1291, 1583], [1409, 1251, 1585], [1251, 1588, 1585], [1251, 1521, 1588], [1508, 1411, 1340], [1252, 1324, 1589], [1533, 1343, 1510], [1591, 1151, 1228], [1765, 1512, 1760], [1592, 1434, 1435], [1615, 1231, 1536], [1615, 1230, 1231], [1623, 1346, 1154], [1453, 1593, 1513], [1593, 1163, 1513], [1635, 1634, 1161], [1354, 1628, 1169], [1627, 1353, 1357], [1170, 1360, 1643], [1646, 1172, 1260], [1360, 1303, 1643], [1650, 1262, 1652], [1546, 1594, 1364], [1481, 1595, 1547], [1481, 1547, 1482], [1656, 1264, 1658], [1236, 1664, 1484], [1483, 1267, 1596], [1671, 1185, 1268], [1675, 1672, 1373], [1598, 1271, 1489], [1272, 1679, 1675], [1516, 1553, 1471], [1516, 1471, 1527], [1557, 1376, 1273], [1517, 1558, 1560], [1562, 1473, 1560], [1563, 1195, 1492], [1600, 1386, 1528], [1493, 1390, 1700], [1702, 1279, 1312], [1604, 1602, 1603], [1567, 1705, 1474], [1602, 1604, 1605], [1605, 1604, 1603], [1425, 1570, 1495], [1605, 1603, 1607], [1606, 1605, 1607], [1315, 1576, 1285], [1397, 1610, 1319], [1427, 1496, 1572], [1497, 1709, 1571], [1446, 1575, 1713], [1573, 1518, 1611], [1580, 1446, 1579], [1612, 1498, 1404], [1582, 1403, 1502], [1405, 1729, 1338], [1412, 1339, 1745], [1745, 1467, 1412], [1509, 1747, 1292], [1324, 1415, 1753], [1324, 1753, 1752], [1325, 1326, 1294], [1325, 1590, 1326], [1326, 1755, 1416], [1151, 1613, 1510], [1760, 1433, 1432], [1420, 1591, 1228], [1345, 1125, 1767], [1539, 1230, 1615], [1301, 1619, 1616], [1623, 1154, 1804], [1522, 1618, 1255], [1421, 1230, 1539], [1453, 1538, 1593], [1626, 1348, 1350], [1455, 1163, 1625], [1627, 1522, 1353], [1354, 1349, 1628], [1630, 1158, 1351], [1630, 1351, 1624], [1630, 1165, 1158], [1160, 1352, 1633], [1633, 1632, 1160], [1625, 1436, 1455], [1436, 1636, 1161], [1636, 1635, 1161], [1626, 1350, 1480], [1638, 1627, 1357], [1480, 1637, 1626], [1355, 1479, 1640], [1639, 1358, 1169], [1480, 1258, 1641], [1480, 1258, 1637], [1637, 1258, 1641], [1480, 1641, 1258], [1638, 1357, 1170], [1642, 1355, 1640], [1799, 1638, 1643], [1259, 1645, 1260], [1259, 1642, 1645], [1260, 1645, 1646], [1647, 1361, 1523], [1456, 1232, 1648], [1648, 1232, 1650], [1643, 1303, 1649], [1649, 1303, 1437], [1649, 1437, 1233], [1524, 1543, 1468], [1232, 1262, 1650], [1545, 1543, 1653], [1652, 1262, 1362], [1652, 1594, 1546], [1525, 1457, 1656], [1655, 1546, 1263], [1656, 1457, 1264], [1661, 1265, 1660], [1265, 1596, 1660], [1514, 1482, 1666], [1266, 1663, 1366], [1550, 1180, 1484], [1267, 1470, 1596], [1596, 1470, 1669], [1485, 1668, 1670], [1470, 1551, 1669], [1551, 1470, 1669], [1673, 1526, 1670], [1238, 1670, 1526], [1671, 1674, 1189], [1185, 1671, 1189], [1526, 1673, 1188], [1771, 1271, 1598], [1598, 1489, 1677], [1374, 1188, 1678], [1239, 1677, 1489], [1239, 1556, 1677], [1599, 1272, 1377], [1488, 1555, 1558], [1192, 1374, 1684], [1377, 1193, 1599], [1441, 1559, 1681], [1687, 1240, 1383], [1687, 1682, 1240], [1683, 1193, 1194], [1690, 1194, 1561], [1691, 1562, 1560], [1690, 1561, 1424], [1563, 1692, 1195], [1200, 1694, 1424], [1564, 1392, 1695], [1566, 1695, 1392], [1697, 1312, 1693], [1491, 1562, 1565], [1195, 1563, 1390], [1696, 1694, 1200], [1312, 1310, 1693], [1698, 1392, 1566], [1698, 1566, 1395], [1601, 1698, 1395], [1390, 1699, 1700], [1697, 1702, 1312], [1696, 1200, 1568], [1703, 1203, 1702], [1530, 1601, 1395], [1395, 1601, 1530], [1203, 1703, 1394], [1530, 1601, 1395], [1494, 1530, 1395], [1779, 1602, 1605], [1474, 1705, 1425], [1444, 1704, 1530], [1493, 1700, 1569], [1782, 1204, 1531], [1786, 1784, 1426], [1140, 1569, 1608], [1396, 1140, 1608], [1706, 1531, 1282], [1786, 1426, 1285], [1396, 1608, 1783], [1496, 1396, 1609], [1708, 1285, 1576], [1572, 1496, 1609], [1575, 1445, 1710], [1316, 1710, 1445], [1711, 1319, 1610], [1497, 1286, 1709], [1574, 1578, 1427], [1519, 1427, 1578], [1709, 1286, 1476], [1476, 1712, 1709], [1716, 1321, 1578], [1446, 1713, 1579], [1476, 1499, 1714], [1577, 1320, 1612], [1428, 1321, 1717], [1477, 1579, 1580], [1477, 1580, 1579], [1718, 1714, 1499], [1499, 1520, 1718], [1720, 1612, 1404], [1580, 1719, 1500], [1721, 1478, 1428], [1501, 1581, 1520], [1582, 1725, 1403], [1403, 1725, 1582], [1402, 1727, 1214], [1503, 1402, 1726], [1726, 1402, 1503], [1214, 1727, 1447], [1584, 1413, 1410], [1583, 1584, 1410], [1582, 1502, 1725], [1731, 1725, 1502], [1504, 1731, 1502], [1506, 1733, 1586], [1447, 1732, 1407], [1505, 1731, 1504], [1467, 1737, 1505], [1735, 1466, 1587], [1508, 1741, 1411], [1588, 1742, 1734], [1585, 1588, 1734], [1587, 1466, 1740], [1740, 1466, 1448], [1741, 1744, 1411], [1737, 1467, 1743], [1735, 1508, 1466], [1744, 1411, 1507], [1745, 1743, 1467], [1746, 1506, 1586], [1506, 1746, 1414], [1742, 1588, 1521], [1339, 1411, 1507], [1509, 1414, 1747], [1742, 1252, 1589], [1521, 1252, 1742], [1748, 1253, 1292], [1748, 1749, 1253], [1751, 1429, 1253], [1430, 1429, 1751], [1430, 1532, 1325], [1754, 1415, 1297], [1754, 1753, 1415], [1756, 1757, 1417], [1416, 1756, 1417], [1431, 1417, 1797], [1225, 1431, 1758], [1759, 1511, 1225], [1533, 1613, 1510], [1533, 1510, 1613], [1533, 1510, 1613], [1511, 1759, 1432], [1613, 1151, 1591], [1762, 1227, 1763], [1227, 1762, 1328], [1420, 1328, 1762], [1764, 1763, 1227], [1227, 1450, 1764], [1765, 1766, 1512], [1434, 1764, 1450], [1766, 1451, 1512], [1592, 1451, 1766], [1592, 1435, 1451], [1534, 1155, 1614], [1614, 1155, 1535], [1614, 1535, 1255], [1620, 1329, 1767], [1619, 1301, 1537], [1804, 1154, 1348], [1804, 1348, 1621], [1329, 1622, 1330], [1522, 1255, 1454], [1539, 1540, 1421], [1541, 1537, 1452], [1624, 1347, 1623], [1625, 1163, 1593], [1165, 1629, 1541], [1628, 1349, 1540], [1624, 1351, 1347], [1629, 1165, 1630], [1160, 1632, 1422], [1633, 1352, 1634], [1631, 1422, 1632], [1634, 1159, 1161], [1436, 1625, 1636], [1422, 1631, 1479], [1631, 1640, 1479], [1638, 1170, 1643], [1359, 1639, 1523], [1258, 1456, 1644], [1644, 1641, 1258], [1642, 1259, 1355], [1524, 1542, 1543], [1543, 1542, 1800], [1304, 1361, 1647], [1769, 1304, 1647], [1653, 1543, 1800], [1651, 1233, 1544], [1525, 1544, 1177], [1652, 1362, 1594], [1654, 1129, 1331], [1595, 1481, 1545], [1654, 1770, 1129], [1525, 1130, 1457], [1129, 1659, 1266], [1263, 1179, 1657], [1365, 1265, 1662], [1265, 1661, 1662], [1265, 1483, 1596], [1665, 1657, 1179], [1484, 1664, 1550], [1658, 1367, 1597], [1179, 1183, 1665], [1549, 1514, 1666], [1667, 1370, 1371], [1771, 1597, 1469], [1238, 1485, 1670], [1771, 1469, 1269], [1486, 1549, 1552], [1470, 1487, 1669], [1371, 1373, 1672], [1549, 1772, 1552], [1669, 1487, 1553], [1271, 1771, 1269], [1674, 1554, 1189], [1188, 1673, 1676], [1188, 1676, 1678], [1373, 1272, 1675], [1189, 1680, 1137], [1599, 1679, 1272], [1137, 1680, 1376], [1773, 1558, 1555], [1527, 1441, 1681], [1683, 1599, 1193], [1376, 1680, 1557], [1273, 1376, 1557], [1685, 1192, 1684], [1560, 1558, 1773], [1385, 1775, 1559], [1688, 1683, 1194], [1686, 1381, 1192], [1490, 1273, 1774], [1241, 1490, 1774], [1687, 1383, 1600], [1385, 1388, 1689], [1600, 1383, 1386], [1492, 1381, 1692], [1310, 1241, 1693], [1563, 1492, 1692], [1564, 1388, 1695], [1695, 1388, 1564], [1692, 1563, 1195], [1390, 1692, 1776], [1390, 1563, 1692], [1698, 1566, 1392], [1391, 1393, 1529], [1464, 1565, 1777], [1567, 1464, 1777], [1601, 1530, 1698], [1393, 1394, 1701], [1778, 1394, 1703], [1203, 1279, 1702], [1802, 1568, 1204], [1570, 1425, 1705], [1475, 1704, 1444], [1780, 1782, 1706], [1781, 1605, 1606], [1606, 1785, 1781], [1784, 1704, 1475], [1706, 1782, 1531], [1784, 1475, 1426], [1569, 1783, 1608], [1607, 1788, 1606], [1787, 1706, 1571], [1606, 1790, 1785], [1803, 1786, 1285], [1706, 1282, 1571], [1397, 1313, 1707], [1803, 1285, 1708], [1397, 1707, 1610], [1710, 1316, 1573], [1319, 1711, 1792], [1319, 1792, 1337], [1712, 1476, 1714], [1579, 1446, 1580], [1579, 1580, 1793], [1721, 1428, 1717], [1478, 1721, 1722], [1290, 1719, 1723], [1290, 1500, 1719], [1581, 1403, 1582], [1290, 1723, 1405], [1503, 1478, 1722], [1727, 1402, 1726], [1726, 1503, 1722], [1402, 1503, 1726], [1728, 1583, 1291], [1409, 1720, 1404], [1724, 1729, 1405], [1720, 1409, 1585], [1291, 1338, 1728], [1506, 1413, 1733], [1448, 1732, 1736], [1448, 1407, 1732], [1733, 1739, 1586], [1505, 1737, 1738], [1731, 1505, 1738], [1740, 1735, 1587], [1736, 1735, 1740], [1448, 1736, 1740], [1745, 1507, 1795], [1745, 1339, 1507], [1744, 1507, 1411], [1411, 1744, 1507], [1414, 1746, 1747], [1292, 1747, 1748], [1589, 1324, 1750], [1749, 1751, 1253], [1532, 1811, 1590], [1326, 1590, 1755], [1754, 1297, 1343], [1756, 1416, 1755], [1758, 1431, 1797], [1754, 1343, 1533], [1225, 1758, 1759], [1533, 1591, 1761], [1760, 1432, 1759], [1533, 1613, 1591], [1420, 1761, 1591], [1420, 1762, 1761], [1512, 1433, 1760], [1764, 1434, 1592], [1615, 1536, 1616], [1767, 1125, 1617], [1617, 1344, 1534], [1617, 1125, 1344], [1255, 1618, 1614], [1329, 1345, 1767], [1622, 1329, 1620], [1622, 1538, 1330], [1768, 1621, 1348], [1625, 1593, 1798], [1621, 1348, 1626], [1630, 1541, 1629], [1352, 1159, 1634], [1631, 1632, 1640], [1359, 1358, 1639], [1456, 1648, 1644], [1651, 1649, 1233], [1331, 1304, 1769], [1654, 1331, 1769], [1236, 1548, 1664], [1666, 1482, 1547], [1469, 1597, 1367], [1665, 1183, 1667], [1672, 1667, 1371], [1554, 1680, 1189], [1515, 1552, 1555], [1374, 1678, 1684], [1239, 1682, 1556], [1192, 1685, 1686], [1273, 1557, 1774], [1689, 1388, 1564], [1424, 1694, 1690], [1776, 1699, 1390], [1393, 1701, 1529], [1700, 1699, 1776], [1701, 1394, 1778], [1801, 1602, 1779], [1568, 1201, 1204], [1802, 1204, 1780], [1204, 1782, 1780], [1784, 1786, 1426], [1784, 1426, 1786], [1784, 1786, 1803], [1396, 1783, 1609], [1789, 1606, 1788], [1790, 1606, 1789], [1398, 1337, 1792], [1611, 1791, 1573], [1715, 1398, 1792], [1611, 1398, 1715], [1716, 1717, 1321], [1580, 1579, 1793], [1579, 1713, 1793], [1580, 1579, 1793], [1724, 1405, 1723], [1447, 1727, 1730], [1733, 1413, 1584], [1447, 1730, 1732], [1508, 1794, 1741], [1794, 1508, 1735], [1750, 1324, 1752], [1532, 1430, 1751], [1590, 1325, 1532], [1417, 1757, 1797], [1348, 1621, 1768], [1627, 1805, 1522], [1806, 1541, 1630], [1639, 1169, 1628], [1172, 1646, 1542], [1264, 1367, 1658], [1548, 1365, 1662], [1830, 1658, 1597], [1183, 1370, 1667], [1268, 1366, 1663], [1550, 1670, 1485], [1485, 1670, 1668], [1688, 1194, 1690], [1566, 1698, 1695], [1813, 1602, 1801], [1813, 1802, 1602], [1700, 1776, 1809], [1808, 1801, 1779], [1603, 1602, 1780], [1707, 1313, 1495], [1787, 1571, 1709], [1611, 1518, 1398], [1793, 1719, 1580], [1718, 1520, 1581], [1793, 1580, 1719], [1745, 1795, 1810], [1743, 1745, 1737], [1751, 1748, 1747], [1754, 1533, 1812], [1768, 1621, 1626], [1807, 1627, 1638], [1542, 1646, 1800], [1643, 1649, 1824], [1646, 1645, 1800], [1663, 1266, 1659], [1671, 1268, 1663], [1677, 1598, 1771], [1553, 1516, 1527], [1527, 1681, 1559], [1693, 1241, 1774], [1696, 1568, 1802], [1780, 1602, 1802], [1779, 1605, 1781], [1607, 1603, 1706], [1573, 1791, 1710], [1727, 1732, 1730], [1728, 1338, 1729], [1854, 1728, 1729], [1744, 1795, 1507], [1810, 1737, 1745], [1814, 1746, 1586], [1751, 1749, 1748], [1761, 1762, 1533], [1815, 1768, 1626], [1637, 1641, 1644], [1659, 1129, 1770], [1655, 1263, 1657], [1678, 1676, 1673], [1555, 1552, 1772], [1681, 1527, 1559], [1560, 1773, 1837], [1564, 1689, 1695], [1696, 1802, 1813], [1842, 1779, 1781], [1603, 1780, 1706], [1706, 1788, 1607], [1787, 1788, 1706], [1789, 1818, 1790], [1818, 1788, 1789], [1818, 1789, 1788], [1581, 1520, 1718], [1793, 1719, 1580], [1899, 1734, 1742], [1746, 1814, 1747], [1757, 1756, 1860], [1758, 1797, 1757], [1861, 1766, 1765], [1820, 1619, 1537], [1624, 1821, 1630], [1822, 1632, 1633], [1640, 1632, 1822], [1645, 1642, 1640], [1645, 1640, 1822], [1637, 1644, 1823], [2066, 1648, 1650], [1769, 1647, 1825], [1652, 1546, 1826], [1595, 1545, 1828], [1548, 1662, 1831], [1662, 1661, 1660], [1831, 1662, 1660], [1550, 1668, 1670], [1673, 1670, 1668], [1771, 1598, 1677], [1772, 1835, 1555], [1865, 1555, 1835], [1681, 1559, 1836], [1690, 1866, 1688], [1686, 1685, 1838], [1560, 1837, 1691], [1693, 1774, 1816], [1689, 1564, 1695], [1839, 1564, 1695], [1562, 1691, 1565], [1817, 1801, 1808], [1817, 1808, 1868], [1813, 1841, 1694], [1813, 1694, 1696], [1843, 1781, 1785], [1608, 1609, 1783], [1576, 1803, 1708], [1788, 1845, 1789], [1845, 1818, 1789], [1847, 1578, 1574], [1847, 1716, 1578], [1848, 1721, 1717], [1721, 1726, 1722], [1726, 1721, 1849], [1849, 1727, 1726], [1727, 1850, 1732], [1736, 1732, 1850], [1725, 1731, 1582], [1739, 1733, 1853], [1795, 1744, 1741], [1754, 1859, 1753], [1753, 1859, 1858], [1757, 1819, 1758], [1533, 1762, 1812], [1764, 1861, 1763], [1764, 1592, 1766], [1861, 1764, 1766], [1535, 1534, 1614], [1820, 1537, 1541], [1621, 1768, 1948], [2122, 1623, 2165], [1636, 1625, 1862], [1625, 1798, 1862], [1628, 1540, 1875], [1633, 1634, 1822], [1827, 1828, 1545], [1655, 1657, 1880], [1829, 1595, 1828], [1829, 1547, 1595], [1666, 1547, 1829], [1664, 1548, 1831], [1666, 1829, 1832], [1832, 1549, 1666], [1596, 1669, 1660], [1771, 1905, 1597], [1833, 1672, 1675], [1834, 1553, 1527], [1836, 1527, 1681], [1773, 1555, 1865], [1685, 1684, 1838], [1559, 1775, 1689], [1689, 1564, 1839], [1692, 1686, 1867], [1813, 1801, 1817], [1817, 1841, 1813], [1565, 1691, 1869], [1695, 1698, 1840], [1778, 1529, 1701], [1785, 1790, 1843], [1843, 1790, 1870], [1707, 1495, 1844], [1845, 1788, 1787], [1572, 1609, 1574], [1818, 1871, 1790], [1575, 1710, 1892], [1872, 1575, 1846], [1711, 1610, 1792], [1716, 1848, 1717], [1731, 1738, 1851], [1852, 1731, 1851], [1852, 1851, 1895], [1731, 1852, 1582], [1854, 1729, 1855], [1814, 1586, 1857], [1586, 1739, 1857], [1752, 1589, 1750], [1539, 1615, 1873], [1619, 1820, 1616], [1821, 1806, 1630], [1806, 1821, 1624], [1903, 1768, 1815], [1628, 1876, 1639], [1649, 1651, 1544], [1832, 1829, 1881], [1671, 1663, 1864], [1670, 1673, 1668], [1677, 1771, 1598], [1679, 1599, 1675], [1866, 1683, 1688], [1689, 1839, 1885], [1686, 1838, 1867], [1694, 1886, 1690], [1692, 1867, 1776], [1565, 1888, 1777], [1608, 1783, 1609], [1870, 1790, 1891], [1871, 1891, 1790], [1579, 1710, 1791], [1713, 1575, 1872], [1579, 1791, 1917], [1894, 1582, 1895], [1852, 1895, 1582], [1919, 1851, 1737], [1738, 1737, 1851], [1583, 1728, 1897], [1739, 1853, 1898], [1739, 1898, 1856], [1811, 1532, 1796], [1819, 1757, 1860], [1762, 1901, 1812], [2053, 1539, 1873], [1622, 1620, 2060], [1804, 1621, 2063], [1902, 1541, 1806], [1815, 1626, 1904], [1626, 1637, 1904], [1649, 1544, 1651], [1658, 1830, 1966], [1549, 1832, 1882], [1669, 1883, 1660], [1668, 1974, 1670], [1883, 1669, 1553], [1678, 1981, 1984], [1599, 1683, 1884], [1839, 1689, 1885], [1885, 1689, 1839], [1817, 1868, 1908], [1868, 1808, 1908], [1781, 1843, 1910], [1609, 1783, 1608], [1911, 1574, 1609], [1709, 1912, 1787], [1787, 1913, 1845], [1847, 1574, 1931], [1818, 1914, 1932], [1916, 1872, 1846], [1933, 1715, 1792], [1718, 1520, 1918], [1727, 1849, 2025], [1739, 1856, 1857], [1941, 1754, 1812], [1941, 1812, 1901], [1765, 1921, 1861], [2119, 1820, 1943], [2117, 1618, 2061], [1943, 1820, 1541], [1954, 1876, 1628], [1922, 1822, 1634], [1863, 1654, 1769], [1545, 1653, 1879], [1667, 1973, 1665], [1883, 1553, 1834], [1924, 1527, 1836], [1865, 1835, 1985], [1986, 1836, 1559], [1885, 1559, 1689], [2084, 1682, 1687], [1695, 1993, 1839], [1926, 1817, 1997], [1691, 1837, 1992], [1841, 1886, 1694], [1841, 1996, 1995], [1808, 1887, 1908], [1927, 1776, 1867], [2004, 2002, 1778], [2005, 1842, 2007], [1702, 1929, 1703], [1890, 1787, 1912], [1891, 1930, 1870], [1891, 1871, 1915], [1818, 1845, 1914], [1709, 1712, 2021], [2101, 1577, 1612], [1581, 1582, 1520], [1851, 1938, 1895], [1795, 2035, 1810], [1854, 1728, 1920], [1590, 1811, 2046], [1859, 1754, 1941], [1762, 1763, 1901], [2118, 1614, 1618], [2059, 1538, 1622], [1614, 1874, 1535], [1945, 1540, 1539], [1943, 1541, 1902], [1807, 1952, 1627], [1807, 1638, 1952], [1807, 1952, 1638], [1799, 1957, 1638], [1904, 1637, 1956], [1957, 1799, 1643], [1637, 1823, 2064], [1800, 1645, 1960], [1960, 1877, 1800], [1644, 1648, 1961], [1877, 1653, 1800], [1652, 1962, 2068], [1652, 1826, 1962], [1654, 1863, 2072], [1663, 1659, 1923], [1969, 1831, 1968], [1881, 1967, 1832], [1831, 1660, 1968], [1970, 1550, 1664], [1864, 1663, 1971], [1975, 1864, 1971], [1668, 1550, 1974], [1772, 1549, 1978], [1673, 1670, 1979], [1554, 1674, 2079], [1924, 2080, 1834], [2081, 1675, 1980], [1924, 1834, 1527], [1678, 1673, 1979], [1675, 1599, 1980], [1981, 1673, 1678], [1678, 1673, 1981], [2082, 1527, 1924], [2082, 1924, 1527], [1599, 1884, 1980], [1865, 1925, 1773], [1987, 1683, 1866], [1885, 1689, 1989], [1689, 1885, 1989], [1838, 1684, 1907], [1839, 1993, 1695], [1867, 1907, 1994], [1838, 1907, 1867], [1886, 1996, 1995], [1886, 1841, 1996], [1817, 1908, 1997], [1817, 1926, 1841], [1999, 1600, 1528], [1840, 1698, 1998], [1528, 1529, 1999], [1565, 1869, 2000], [1927, 1809, 1776], [2002, 1529, 1778], [1702, 1697, 2001], [2005, 1779, 1842], [2007, 1842, 1781], [1569, 1700, 2008], [1567, 2009, 1705], [1530, 1704, 2010], [1704, 1909, 2010], [2012, 1781, 1910], [1784, 1909, 1704], [1705, 1495, 1570], [1843, 1870, 2013], [1844, 1495, 1889], [1608, 2015, 1609], [2016, 1784, 1803], [2017, 1911, 1609], [2018, 1870, 2019], [1911, 1931, 1574], [1847, 1931, 2097], [1714, 2021, 1712], [1818, 1932, 1871], [1932, 1915, 1871], [1710, 1579, 1917], [2021, 1714, 2022], [1716, 2023, 1848], [1793, 1713, 1935], [1713, 1872, 1935], [1793, 1935, 1936], [2026, 1918, 1520], [1582, 2026, 1520], [1582, 1894, 2026], [2029, 1894, 1895], [1793, 1936, 1719], [2030, 1719, 2104], [1723, 1719, 2030], [1724, 2032, 1729], [1810, 1919, 1737], [1584, 1583, 1897], [1897, 1728, 1920], [1856, 1898, 2111], [1920, 1728, 1854], [2037, 1920, 1854], [2037, 1854, 1855], [1920, 1728, 1854], [2037, 1855, 1729], [1856, 2039, 2040], [1856, 1939, 2039], [1940, 1856, 2040], [1857, 1940, 2041], [1857, 2041, 1814], [1814, 2041, 1747], [2041, 1751, 1747], [2041, 2042, 1751], [1751, 2042, 2043], [2042, 2043, 1751], [2045, 1796, 1532], [1796, 2045, 1811], [2044, 1858, 1859], [1590, 2046, 1755], [1755, 2046, 1900], [1900, 1756, 1755], [1860, 1756, 2048], [1760, 1759, 2050], [1763, 1941, 1901], [1861, 2052, 1763], [1921, 1765, 1760], [1945, 1539, 2053], [1873, 1615, 2054], [2054, 1615, 2055], [2055, 1616, 2056], [2060, 1620, 1944], [1593, 1538, 2059], [1767, 1944, 1620], [2117, 1874, 1614], [2165, 1804, 2063], [1623, 1804, 2165], [1947, 1949, 1798], [1617, 1534, 2120], [2126, 1624, 2122], [1636, 1862, 1950], [1768, 1903, 1948], [1954, 1628, 1953], [1956, 1903, 1815], [1815, 1904, 1956], [1807, 1638, 1955], [1639, 1876, 1954], [1922, 2129, 1822], [1961, 2064, 1823], [2130, 1643, 2131], [2066, 1650, 2067], [1647, 2132, 2134], [1649, 1651, 1878], [1545, 1879, 2071], [2073, 1544, 1525], [1863, 1769, 2072], [2071, 1827, 1545], [1828, 1827, 1963], [1880, 1546, 1655], [1657, 1665, 1965], [1905, 1966, 1597], [1966, 1830, 1597], [1973, 1965, 1665], [2076, 1660, 1883], [1671, 1864, 1975], [1672, 1833, 1977], [2078, 1833, 1675], [2139, 1978, 1549], [1674, 1671, 2079], [1982, 1677, 1556], [1835, 1978, 1983], [1554, 2079, 1680], [2082, 1924, 1836], [1985, 1835, 1983], [1981, 1678, 1984], [2082, 1986, 1559], [2083, 1678, 1981], [2161, 1559, 1986], [1559, 1989, 1986], [1885, 1989, 1559], [1773, 1925, 1985], [2084, 1990, 1682], [2085, 1774, 1557], [1690, 1987, 1866], [1684, 2083, 1907], [2086, 1774, 2085], [2087, 1926, 1908], [1926, 1995, 1996], [1992, 1837, 1991], [1926, 1996, 1841], [2088, 1687, 1600], [1996, 1841, 1995], [1994, 1927, 1867], [1869, 1691, 2000], [1887, 1808, 1779], [2006, 1698, 1530], [2003, 1809, 1927], [2008, 1700, 2003], [1809, 2003, 1700], [2004, 1778, 1929], [1929, 1778, 1703], [2006, 1530, 2010], [2011, 1569, 2008], [2007, 1781, 2012], [2007, 2012, 1910], [2015, 1569, 2091], [2015, 1783, 1569], [2013, 1910, 1843], [2015, 1608, 1783], [1890, 1912, 2092], [1890, 2092, 2093], [2146, 2013, 2018], [2018, 2013, 1870], [1844, 2094, 1707], [1912, 1709, 2020], [1870, 1930, 2019], [1930, 2095, 2019], [2096, 1846, 1575], [2020, 1709, 2021], [1930, 1891, 1915], [1893, 1576, 1577], [1871, 1915, 2099], [1915, 1871, 2099], [1792, 1610, 1933], [2097, 2152, 1847], [2152, 1716, 1847], [1932, 1914, 2098], [1932, 2098, 2100], [1611, 1715, 1933], [2102, 1714, 1918], [1918, 1714, 1718], [1872, 1916, 1935], [1721, 1848, 2023], [1849, 1721, 2023], [1727, 2025, 2027], [1850, 2154, 2031], [1736, 1850, 2031], [1736, 2033, 1896], [2034, 1733, 1584], [2156, 1585, 2158], [1794, 1735, 2106], [2034, 1853, 1733], [2034, 2036, 1853], [2109, 1584, 1897], [2110, 1897, 1583], [2032, 2157, 1729], [2038, 1856, 2111], [2158, 1734, 1899], [1751, 2043, 2042], [2043, 1532, 1751], [1859, 1941, 2047], [1756, 1900, 2048], [2051, 1760, 2050], [1941, 1763, 1942], [1942, 1763, 2052], [2052, 1760, 2051], [2052, 1921, 1760], [1861, 1921, 2052], [2053, 1873, 2054], [2055, 1615, 1616], [2056, 1616, 2057], [2058, 1616, 1820], [2059, 1622, 2060], [1540, 2062, 1945], [2062, 1540, 1945], [1946, 1767, 1617], [1798, 1593, 1947], [2123, 1948, 1768], [1768, 1948, 2123], [2062, 2125, 1540], [1624, 1623, 2122], [2125, 1875, 1540], [2126, 1806, 1624], [1902, 1806, 2126], [1635, 1636, 1950], [1627, 2124, 1805], [1628, 1875, 2125], [1634, 1635, 2128], [1955, 1952, 1807], [1922, 1634, 2128], [1639, 1954, 1958], [1956, 1637, 1959], [1645, 1822, 2129], [1959, 1637, 2064], [2129, 1960, 1645], [1639, 1958, 1523], [2131, 1643, 1824], [1647, 2065, 2132], [1824, 1649, 2131], [1647, 1523, 2065], [2067, 1650, 1652], [2067, 1652, 2135], [1651, 1544, 2069], [1879, 1653, 2136], [2071, 1879, 2136], [2137, 1962, 1546], [1826, 1546, 1962], [1770, 1654, 2074], [2073, 1525, 2075], [1880, 2137, 1546], [1829, 1963, 1881], [2075, 1658, 1964], [1656, 1658, 2075], [1829, 1828, 1963], [1965, 1880, 1657], [1966, 1964, 1658], [1923, 1971, 1663], [1660, 1968, 1969], [1970, 1972, 1550], [1832, 1967, 1882], [2076, 1968, 1660], [1976, 1905, 1771], [2077, 1882, 1967], [1973, 1667, 1977], [1550, 1972, 1974], [2078, 1977, 1833], [1549, 1882, 2077], [2139, 1549, 2077], [1906, 2078, 1675], [1670, 1974, 1979], [2140, 1771, 1677], [2140, 1976, 1771], [1671, 2138, 2079], [1883, 1834, 2080], [1772, 1978, 2139], [1982, 2140, 1677], [1978, 1772, 2139], [1835, 1772, 1978], [1678, 1979, 1981], [1836, 1986, 2082], [1557, 1680, 2141], [1982, 1556, 1990], [1884, 1683, 1980], [1990, 1556, 1682], [1683, 1884, 1980], [1985, 1925, 1865], [1684, 1678, 2083], [2161, 1986, 1989], [1683, 1987, 1884], [1886, 1987, 1690], [2142, 1989, 1885], [1557, 1988, 2085], [1990, 2084, 1687], [2084, 1990, 1687], [1816, 1774, 2086], [1687, 2088, 2084], [1926, 1997, 1908], [2142, 1839, 1695], [1695, 1993, 2142], [1816, 2086, 2143], [1693, 1816, 2143], [1998, 1993, 1840], [1840, 1993, 1695], [1999, 1529, 2090], [1928, 1698, 2006], [2090, 1529, 2002], [1887, 1779, 2005], [1702, 2001, 1929], [2162, 1777, 1888], [1777, 2009, 1567], [2145, 2007, 1910], [2091, 1569, 2011], [2009, 2172, 1889], [2015, 2147, 1609], [1889, 2148, 1844], [2147, 2017, 1609], [1844, 2148, 2094], [1913, 1787, 1890], [1610, 1707, 2094], [1803, 1576, 2150], [2018, 2019, 2095], [1575, 1892, 2096], [1914, 1845, 1913], [1893, 2150, 1576], [1846, 2096, 2151], [1846, 2096, 2151], [1933, 1610, 2149], [1846, 2151, 1916], [2153, 1916, 2151], [1915, 2099, 1930], [1710, 1917, 1892], [1915, 1932, 2100], [2099, 1915, 2100], [2023, 1716, 2152], [1611, 1933, 1715], [1933, 1611, 1715], [2102, 2022, 1714], [1849, 2023, 2025], [2102, 1918, 2026], [2029, 2026, 1894], [1936, 2028, 1719], [1719, 2028, 2104], [2105, 1612, 1720], [1850, 1727, 2154], [1937, 2032, 1724], [1736, 2031, 2033], [2156, 1720, 1585], [2156, 2105, 1720], [2106, 1735, 1736], [2108, 1794, 2106], [1810, 2035, 2107], [1734, 2158, 1585], [1898, 1853, 2036], [1583, 1897, 2110], [2110, 1897, 1920], [1857, 1856, 1940], [1589, 2112, 1742], [1752, 2113, 1589], [2045, 1532, 2043], [2159, 1753, 1858], [2159, 1858, 2044], [2114, 1811, 2045], [2047, 2044, 1859], [1811, 2114, 2046], [1819, 1860, 2048], [2049, 1759, 1758], [2050, 1759, 2049], [2117, 1614, 2118], [2058, 2057, 1616], [2058, 1820, 2119], [2062, 1540, 1945], [1767, 1946, 1944], [1618, 1522, 2061], [1943, 1902, 2119], [2120, 1946, 1617], [1534, 1535, 2121], [1535, 1874, 2121], [2061, 1522, 2124], [1862, 1798, 1950], [1798, 1949, 1950], [2124, 1522, 1805], [1948, 2127, 2123], [2124, 1627, 1952], [1903, 2127, 1948], [1951, 1635, 1950], [1953, 1628, 2125], [1635, 1951, 2128], [1638, 1957, 1955], [1957, 1643, 2130], [1958, 2065, 1523], [1961, 1823, 1644], [1825, 1647, 2134], [2133, 1653, 1877], [1653, 2133, 2136], [2135, 1652, 2068], [2069, 1544, 2073], [2072, 1769, 2070], [1963, 1827, 2071], [1659, 1770, 1923], [1664, 1831, 1969], [1970, 1664, 1969], [1968, 1660, 1969], [1977, 1667, 1672], [1906, 1675, 2081], [2160, 2080, 1924], [1924, 2082, 2160], [1988, 1557, 2141], [2161, 2082, 1559], [1991, 1837, 1773], [2142, 1885, 1839], [1992, 2089, 1691], [1928, 1998, 1698], [1888, 1565, 2000], [1697, 2144, 2001], [1777, 2162, 2009], [1705, 2009, 1889], [1784, 2014, 1909], [1495, 1705, 1889], [1784, 2016, 2014], [1912, 2020, 2021], [2096, 1846, 2151], [1930, 2099, 2163], [1934, 1917, 1791], [1611, 2024, 1934], [1791, 1611, 1934], [1933, 2024, 1611], [2101, 1612, 2103], [1612, 2105, 2103], [2154, 1727, 2027], [1724, 1723, 1937], [1938, 1851, 1919], [1938, 1919, 2155], [1896, 2106, 1736], [1919, 1810, 2107], [2035, 1795, 1741], [2034, 1584, 2109], [2111, 1898, 2036], [2109, 1897, 2110], [2037, 1729, 2157], [2112, 1899, 1742], [2113, 2112, 1589], [2113, 1752, 2159], [1752, 1753, 2159], [1758, 1819, 2116], [2164, 1941, 1942], [2052, 2164, 1942], [1618, 2117, 2118], [1534, 2121, 2120], [2131, 1649, 1878], [1961, 1648, 2066], [1769, 1825, 2134], [1878, 1651, 2069], [1769, 2134, 2070], [2074, 1654, 2166], [1654, 2072, 2166], [2075, 1525, 1656], [1770, 2074, 1923], [2138, 1671, 1975], [2076, 1883, 2080], [2141, 1680, 2079], [1991, 1773, 1985], [2088, 1600, 1999], [1697, 2143, 2144], [2000, 1691, 2089], [2169, 1927, 1994], [1697, 1693, 2143], [1910, 2007, 2145], [2145, 2007, 1910], [2092, 2170, 2093], [2092, 2171, 2170], [1931, 1911, 2017], [2021, 2178, 1912], [2016, 1803, 2150], [2149, 1610, 2094], [1893, 1577, 2101], [1937, 1723, 2030], [2035, 1741, 2173], [1939, 1856, 2038], [1819, 2048, 2115], [2049, 1758, 2116], [1947, 1593, 2059], [2073, 2075, 2167], [1968, 2076, 1969], [1974, 1972, 1970], [2183, 1974, 1970], [1983, 1978, 2139], [1987, 1980, 1884], [1926, 2087, 2168], [2175, 1999, 2090], [2176, 2008, 1927], [2008, 2003, 1927], [2013, 2146, 1910], [2146, 2177, 1910], [2017, 2147, 2015], [2092, 1912, 2178], [1931, 2017, 2097], [2095, 1930, 2163], [1741, 1794, 2108], [2037, 2157, 2180], [2157, 2037, 2180], [1621, 1948, 2063], [1877, 1960, 2133], [2185, 1976, 2140], [1988, 2141, 2207], [1995, 1926, 2168], [2170, 2189, 2188], [2170, 2171, 2189], [2147, 2017, 2015], [2190, 2018, 2095], [2191, 2095, 2163], [2153, 1935, 1916], [1741, 2108, 2173], [2109, 2179, 2193], [2034, 2109, 2193], [1941, 2164, 2196], [1941, 2196, 2047], [2048, 1900, 2181], [1819, 2115, 2116], [2052, 2051, 2050], [2050, 2164, 2052], [2058, 2119, 2174], [2119, 2058, 2174], [2118, 2117, 2061], [2057, 2058, 2056], [1961, 2066, 2067], [2070, 2134, 2132], [1975, 1971, 2197], [2198, 1969, 2076], [2205, 2138, 1975], [2160, 2076, 2080], [1979, 1974, 2184], [2138, 2205, 2079], [1983, 2139, 2206], [1995, 2168, 2199], [2168, 2087, 2186], [1991, 1985, 2200], [2169, 1994, 1907], [1992, 2000, 2089], [1928, 1993, 1998], [1928, 2187, 1993], [2006, 2187, 1928], [2010, 1909, 2014], [2209, 2092, 2178], [2190, 2146, 2018], [2201, 2190, 2095], [2030, 2104, 2028], [1919, 2107, 2192], [2037, 2157, 2180], [2216, 2039, 2194], [2216, 2194, 2039], [2195, 2039, 2194], [1902, 2182, 2119], [2412, 2165, 2269], [1951, 1950, 2203], [2070, 2166, 2072], [1905, 1964, 1966], [2078, 1973, 1977], [2198, 2076, 2160], [1906, 2081, 2078], [2321, 1982, 1990], [2199, 1987, 1995], [2000, 2219, 1888], [2097, 2017, 2210], [2021, 2022, 2102], [2220, 2021, 2102], [2202, 1892, 1917], [2163, 2099, 2213], [2100, 2098, 2212], [1938, 1919, 2155], [1938, 2155, 1919], [2106, 1896, 2033], [1899, 2156, 2158], [2109, 2110, 2179], [2039, 2194, 2216], [2216, 2194, 2039], [2194, 2216, 2195], [2217, 2112, 2113], [2062, 1945, 2053], [2053, 2054, 2055], [2174, 2058, 2224], [2225, 2123, 2127], [2204, 1878, 2069], [2074, 2228, 1923], [1970, 1969, 2183], [1969, 2198, 2183], [2083, 2218, 1907], [1987, 1886, 1995], [2236, 2169, 1907], [1908, 1887, 2240], [2240, 1887, 2005], [2011, 2008, 2091], [2244, 2092, 2209], [2249, 1913, 1890], [2151, 2221, 2153], [2023, 2152, 2097], [1893, 2101, 2211], [2100, 2213, 2099], [2257, 2102, 2026], [2261, 2105, 2156], [1919, 2192, 2155], [2194, 2039, 1939], [2222, 1899, 2112], [2041, 1940, 2215], [2292, 2061, 2411], [2058, 2119, 2224], [2223, 2182, 1902], [2056, 2058, 2174], [1944, 1946, 2270], [2128, 2129, 1922], [1903, 1956, 2226], [2127, 1903, 2226], [1959, 2227, 1956], [1976, 2229, 1905], [2205, 1975, 2231], [2083, 2233, 2276], [1907, 2279, 2236], [2142, 1993, 2237], [2188, 2189, 2208], [2241, 1929, 2001], [1910, 2242, 2145], [2250, 2190, 2201], [1914, 1913, 2249], [2097, 2210, 2248], [2096, 2251, 2151], [2151, 2252, 2221], [1914, 2253, 2098], [2021, 2220, 2492], [2496, 2202, 1917], [2221, 2255, 2153], [1917, 1934, 2254], [2367, 1935, 2153], [2260, 1895, 1938], [2106, 2033, 2214], [2034, 2193, 2263], [2179, 2263, 2193], [2156, 1899, 2264], [2222, 2264, 1899], [2265, 2039, 2195], [2040, 2039, 2266], [2267, 2112, 2217], [2291, 2043, 2042], [2045, 2043, 2291], [2114, 2268, 2046], [2050, 2196, 2164], [2404, 2182, 2223], [2404, 2223, 2182], [1948, 2269, 2063], [2224, 2056, 2174], [2269, 2165, 2063], [2296, 2055, 2056], [2415, 2121, 2406], [2203, 1950, 2413], [2301, 1953, 2125], [1955, 1957, 2305], [2424, 2130, 2131], [2068, 1962, 2436], [1965, 1973, 2271], [2197, 2230, 1975], [2077, 1967, 2314], [2272, 2183, 2198], [2315, 2185, 2140], [2082, 2316, 2160], [1983, 2206, 2234], [2083, 1981, 2233], [1988, 2207, 2275], [2320, 2168, 2186], [1985, 1983, 2319], [2276, 2218, 2083], [2325, 2199, 2324], [2464, 1990, 2281], [2142, 2278, 1989], [2237, 2330, 2142], [1992, 1991, 2466], [2237, 1993, 2187], [2245, 2177, 2146], [2172, 2348, 1889], [2283, 2177, 2245], [2190, 2245, 2146], [2017, 2248, 2210], [2150, 1893, 2211], [2258, 2371, 2026], [2285, 1937, 2030], [2376, 2214, 2033], [2173, 2262, 2035], [2381, 2261, 2156], [2515, 2037, 2385], [2286, 2264, 2287], [2287, 2264, 2288], [2288, 2264, 2289], [2287, 2288, 2289], [2289, 2264, 2222], [2222, 2290, 2289], [2290, 2222, 2112], [2266, 2039, 2265], [2394, 2113, 2159], [2394, 2159, 2044], [2293, 2062, 2053], [2412, 2122, 2165], [2297, 2056, 2224], [2414, 2122, 2412], [2120, 2121, 2415], [2127, 2226, 2421], [1960, 2129, 2423], [2227, 1959, 2064], [2426, 1961, 2427], [2428, 2133, 1960], [2430, 2067, 2135], [2430, 2135, 2431], [2307, 2070, 2132], [2431, 2135, 2435], [2436, 1962, 2137], [1975, 2452, 2231], [1974, 2183, 2454], [2452, 2205, 2231], [2456, 2078, 2081], [2315, 2451, 2185], [2139, 2314, 2274], [2184, 2273, 1979], [2206, 2139, 2274], [2459, 2317, 2079], [2273, 1981, 1979], [2460, 2081, 1980], [2462, 2207, 2141], [2186, 2277, 2320], [2322, 2168, 2235], [2207, 2462, 2275], [2325, 1987, 2199], [2277, 2465, 2186], [2327, 1907, 2218], [2279, 1907, 2327], [2186, 2087, 2277], [2087, 2280, 2277], [2085, 2275, 2329], [2328, 1991, 2200], [2280, 2087, 2331], [2084, 2088, 2281], [2278, 2142, 2330], [2331, 2087, 1908], [2282, 2088, 1999], [2332, 2143, 2086], [2239, 2237, 2187], [2334, 2144, 2143], [1992, 2335, 2000], [1927, 2337, 2176], [2238, 2336, 2208], [2334, 2241, 2001], [2006, 2473, 2187], [2008, 2176, 2337], [2340, 2005, 2007], [2219, 2477, 1888], [2004, 1929, 2341], [1888, 2477, 2162], [2008, 2343, 2091], [2344, 2189, 2171], [2482, 2162, 2477], [2345, 2010, 2014], [2015, 2091, 2483], [2092, 2244, 2171], [2093, 2350, 2485], [2352, 2147, 2015], [2356, 2246, 2016], [2148, 2486, 2094], [2284, 2355, 2190], [2356, 2016, 2357], [2250, 2284, 2190], [2353, 2178, 2021], [2252, 2151, 2358], [2201, 2095, 2359], [2360, 2221, 2252], [1892, 2251, 2096], [2362, 2191, 2256], [2221, 2361, 2255], [2364, 2024, 1933], [2023, 2365, 2500], [2255, 2361, 2153], [2023, 2500, 2025], [2363, 2102, 2257], [2501, 2101, 2103], [2255, 2367, 2153], [2212, 2368, 2100], [2027, 2025, 2259], [2507, 2372, 2028], [2371, 2026, 2029], [2375, 2155, 2511], [2214, 2033, 2376], [2214, 2376, 2106], [2108, 2106, 2377], [2173, 2108, 2378], [2173, 2378, 2379], [2038, 2111, 2382], [2036, 2383, 2111], [2509, 2381, 2287], [2156, 2264, 2286], [2381, 2156, 2286], [2385, 2037, 2180], [2194, 1939, 2389], [2287, 2289, 2386], [2386, 2289, 2390], [2289, 2290, 2391], [2040, 2266, 1940], [2518, 2215, 2392], [2267, 2290, 2112], [2194, 2517, 2216], [2290, 2267, 2391], [2195, 2216, 2265], [2291, 2521, 2045], [2524, 2394, 2044], [2395, 2044, 2047], [2395, 2047, 2196], [1900, 2046, 2181], [2181, 2396, 2048], [2116, 2115, 2398], [2404, 2182, 2223], [1874, 2117, 2406], [2118, 2292, 2117], [2292, 2118, 2061], [2296, 2053, 2055], [2402, 2053, 2296], [2408, 1949, 1947], [2059, 2060, 2295], [2223, 1902, 2407], [1902, 2126, 2407], [2409, 2269, 1948], [1949, 2413, 1950], [2408, 2413, 1949], [2060, 1944, 2295], [2406, 2121, 1874], [2297, 2296, 2056], [2295, 1944, 2270], [2414, 2126, 2122], [2416, 2062, 2293], [2416, 2125, 2062], [1946, 2298, 2270], [1951, 2203, 2417], [2300, 1952, 2303], [1952, 2300, 2124], [2301, 2125, 2416], [2418, 1951, 2302], [1954, 1953, 2419], [1955, 2303, 1952], [1955, 2305, 2303], [2421, 2225, 2127], [1954, 2422, 1958], [2419, 2422, 1954], [1956, 2421, 2226], [1956, 2226, 2421], [2129, 2304, 2423], [1957, 2130, 2305], [2227, 2226, 1956], [2424, 2305, 2130], [2426, 2227, 2064], [2426, 2064, 1961], [2307, 2132, 2425], [2065, 2425, 2132], [1878, 2204, 2432], [2136, 2133, 2308], [2204, 2069, 2434], [2309, 2070, 2307], [2135, 2068, 2435], [2434, 2432, 2204], [2437, 2434, 2073], [2434, 2069, 2073], [2438, 2071, 2310], [2167, 2437, 2073], [2437, 2167, 2439], [1963, 2071, 2438], [2167, 2441, 2439], [2167, 2075, 2441], [2312, 2311, 2137], [2228, 2443, 1923], [1880, 1965, 2312], [2444, 2312, 1965], [2444, 1965, 2271], [2443, 2313, 1923], [1905, 2447, 1964], [2445, 1964, 2447], [1923, 2313, 1971], [2448, 1881, 2446], [1971, 2313, 2197], [2448, 2314, 1967], [1973, 2450, 2449], [2449, 2450, 2232], [2450, 1973, 2232], [2452, 1975, 2230], [2183, 2453, 2454], [2453, 2183, 2272], [2453, 2272, 2198], [1974, 2454, 2455], [2078, 2456, 2232], [2453, 2198, 2457], [2139, 2077, 2314], [2457, 2198, 2160], [2455, 2184, 1974], [2455, 2458, 2184], [2079, 2205, 2452], [2317, 2079, 2452], [2458, 2273, 2184], [2079, 2317, 2459], [2317, 2141, 2079], [2160, 2316, 2457], [2457, 2316, 2082], [2315, 2140, 1982], [2460, 2456, 2081], [2317, 2459, 2141], [2457, 2082, 2318], [1981, 2273, 2461], [2233, 1981, 2461], [2319, 2234, 2206], [2322, 2168, 2320], [2082, 2161, 2318], [2322, 2235, 2168], [1983, 2234, 2319], [1989, 2318, 2161], [1987, 2325, 2460], [1987, 2460, 1980], [2322, 2463, 2199], [1989, 2323, 2318], [2462, 1988, 2275], [2168, 2322, 2199], [2319, 2326, 1985], [2327, 2218, 2276], [2465, 2277, 2186], [2323, 1989, 2278], [2281, 1990, 2084], [2275, 2085, 1988], [2277, 2331, 2465], [2277, 2280, 2331], [2086, 2085, 2329], [2469, 2169, 2468], [2332, 2334, 2143], [2337, 1927, 2469], [1927, 2169, 2469], [2282, 1999, 2470], [1999, 2175, 2470], [2334, 2001, 2144], [2471, 2219, 2000], [2473, 2239, 2187], [2090, 2002, 2472], [2188, 2208, 2338], [2336, 2338, 2208], [2238, 2208, 2189], [2340, 2240, 2005], [2340, 2007, 2342], [2242, 2007, 2145], [2002, 2004, 2341], [2475, 2002, 2341], [2342, 2007, 2242], [2479, 1929, 2480], [2478, 2006, 2010], [2189, 2344, 2476], [2170, 2188, 2338], [1910, 2481, 2242], [2091, 2343, 2483], [2347, 2009, 2482], [2009, 2162, 2482], [2344, 2171, 2484], [2346, 1910, 2177], [2481, 1910, 2346], [2177, 2283, 2346], [2093, 2170, 2243], [2350, 2093, 2243], [2484, 2171, 2244], [2009, 2348, 2172], [2485, 2093, 2350], [2015, 2349, 2352], [2350, 2093, 2485], [1889, 2486, 2148], [2352, 2017, 2147], [2244, 2209, 2178], [1890, 2093, 2485], [2017, 2352, 2247], [1890, 2485, 2354], [2486, 2487, 2094], [2094, 2487, 2149], [2248, 2488, 2097], [2249, 2354, 1914], [2016, 2150, 2357], [2491, 1914, 2354], [2358, 2151, 2251], [2492, 2489, 2021], [2201, 2359, 2250], [2362, 2359, 2095], [2360, 2361, 2221], [2191, 2362, 2095], [2490, 2493, 2149], [1914, 2491, 2253], [2251, 1892, 2495], [2023, 2097, 2494], [2202, 2495, 1892], [2495, 2202, 2496], [2357, 2211, 2497], [2498, 2496, 1917], [2363, 2492, 2102], [2364, 1933, 2493], [1933, 2149, 2493], [1934, 2024, 2499], [2499, 2024, 2364], [2211, 2101, 2497], [2163, 2366, 2191], [2256, 2191, 2366], [2153, 2367, 2255], [2259, 2025, 2500], [2098, 2253, 2212], [2163, 2369, 2366], [2258, 2257, 2026], [2213, 2100, 2502], [2212, 2253, 2503], [2368, 2212, 2503], [1935, 2367, 2504], [2370, 2501, 2103], [2368, 2505, 2213], [2163, 2213, 2369], [2259, 2373, 2027], [2504, 2506, 1935], [2371, 2258, 2026], [2506, 2507, 1936], [2507, 2028, 1936], [2371, 2029, 1895], [2507, 2028, 2372], [2372, 2028, 2507], [2370, 2103, 2105], [2031, 2154, 2373], [2371, 1895, 2260], [2285, 2030, 2372], [2030, 2028, 2372], [2370, 2105, 2261], [2031, 2373, 2374], [2155, 2260, 1938], [2033, 2374, 2510], [2155, 2192, 2511], [2508, 2261, 2509], [2033, 2214, 2376], [2106, 2376, 2377], [2035, 2511, 2107], [2378, 2108, 2377], [2035, 2262, 2379], [2261, 2381, 2509], [2384, 2157, 2032], [2382, 2111, 2383], [2381, 2286, 2287], [2382, 1939, 2038], [2512, 1939, 2382], [2263, 2036, 2034], [2036, 2263, 2383], [2157, 2385, 2180], [2385, 2157, 2384], [2386, 2509, 2287], [2513, 2179, 2110], [2513, 2110, 2514], [2387, 2110, 1920], [1920, 2037, 2387], [1939, 2512, 2389], [2386, 2390, 2388], [2388, 2390, 2516], [2391, 2290, 2289], [2391, 2289, 2290], [2215, 1940, 2392], [2518, 2041, 2215], [2042, 2041, 2518], [2289, 2391, 2519], [2216, 2517, 2393], [2267, 2217, 2113], [2394, 2267, 2113], [2520, 2519, 2522], [2523, 2520, 2522], [2525, 2114, 2521], [2114, 2045, 2521], [2524, 2044, 2395], [2114, 2525, 2268], [2268, 2046, 2525], [2268, 2525, 2046], [2196, 2050, 2527], [2196, 2527, 2526], [2527, 2050, 2528], [2528, 2049, 2399], [2115, 2048, 2397], [2049, 2116, 2529], [2399, 2049, 2529], [2402, 2401, 2053], [2403, 2119, 2182], [1947, 2059, 2294], [2406, 2117, 2292], [2404, 2223, 2407], [1947, 2405, 2408], [2409, 1948, 2123], [2409, 2123, 2410], [2294, 2059, 2295], [2411, 2061, 2300], [2061, 2124, 2300], [2414, 2407, 2126], [2417, 2203, 2413], [2299, 1946, 2120], [2299, 2298, 1946], [2299, 2120, 2415], [2302, 1951, 2417], [2410, 2123, 2225], [2128, 1951, 2418], [2419, 1953, 2301], [2129, 2128, 2420], [2065, 1958, 2425], [2424, 2131, 2429], [2423, 2428, 1960], [1961, 2067, 2530], [2308, 2133, 2428], [2136, 2308, 2433], [2068, 2436, 2435], [2311, 2436, 2137], [2228, 2074, 2166], [2166, 2440, 2228], [2137, 1880, 2312], [1963, 2438, 2442], [2445, 2441, 1964], [2441, 2075, 1964], [2448, 1967, 1881], [2230, 2197, 2313], [2449, 2271, 1973], [1973, 2078, 2232], [1976, 2451, 2229], [2458, 2455, 2273], [2451, 1976, 2185], [2459, 2462, 2141], [2275, 1988, 2462], [2277, 2531, 2320], [2277, 2465, 2531], [2321, 1990, 2464], [2200, 1985, 2326], [1991, 2328, 2466], [1908, 2467, 2331], [2279, 2169, 2236], [2088, 2282, 2281], [2538, 2333, 2238], [1908, 2240, 2467], [1992, 2466, 2335], [2000, 2335, 2471], [2090, 2472, 2470], [2470, 2175, 2090], [2539, 2208, 2238], [2475, 2472, 2002], [2219, 2471, 2339], [2337, 2474, 2008], [2238, 2189, 2476], [2477, 2219, 2339], [2008, 2474, 2343], [2473, 2006, 2478], [2540, 2476, 2189], [2189, 2476, 2540], [2341, 1929, 2479], [1929, 2241, 2480], [2170, 2338, 2243], [2345, 2478, 2010], [2483, 2349, 2015], [2350, 2243, 2485], [2485, 2243, 2532], [2345, 2014, 2533], [1889, 2351, 2486], [2244, 2178, 2353], [2245, 2190, 2355], [2247, 2248, 2017], [2353, 2021, 2489], [2284, 2250, 2355], [2360, 2252, 2358], [2357, 2150, 2211], [2488, 2494, 2097], [2498, 1917, 2254], [2023, 2494, 2365], [2497, 2101, 2501], [2153, 2361, 2367], [2368, 2213, 2502], [2506, 1936, 1935], [2369, 2213, 2505], [2258, 2026, 2371], [2154, 2027, 2373], [2260, 2155, 2375], [2033, 2031, 2374], [2033, 2510, 2376], [2192, 2107, 2511], [2032, 1937, 2380], [2384, 2032, 2380], [2263, 2179, 2513], [2194, 2389, 2517], [1940, 2266, 2392], [2042, 2518, 2291], [2216, 2393, 2265], [2549, 2391, 2267], [2519, 2391, 2535], [2535, 2391, 2534], [2522, 2519, 2535], [2181, 2046, 2396], [2046, 2268, 2396], [2050, 2049, 2528], [2116, 2398, 2529], [2053, 2401, 2400], [2182, 2404, 2403], [1947, 2294, 2405], [2224, 2119, 2403], [2922, 2635, 2269], [2418, 2420, 2128], [2304, 2129, 2420], [2429, 2131, 1878], [2427, 1961, 2530], [2530, 2067, 2430], [1878, 2432, 2306], [2071, 2136, 2433], [2071, 2433, 2310], [2437, 2439, 2441], [1881, 2442, 2446], [2447, 1905, 2229], [2319, 2206, 2274], [1982, 2321, 2315], [2462, 2459, 2568], [2324, 2199, 2463], [2200, 2326, 2328], [2086, 2329, 2332], [2536, 2537, 2333], [2536, 2333, 2538], [2468, 2169, 2279], [2330, 2237, 2239], [2208, 2539, 2238], [2238, 2540, 2539], [2238, 2476, 2540], [2340, 2342, 2541], [2551, 2340, 2541], [2348, 2009, 2347], [2351, 1889, 2348], [2533, 2014, 2246], [2014, 2016, 2246], [2249, 1890, 2354], [2250, 2284, 2355], [2149, 2487, 2490], [2492, 2220, 2102], [2360, 2542, 2361], [2361, 2542, 2543], [2100, 2368, 2502], [1937, 2285, 2380], [2511, 2035, 2379], [2262, 2173, 2379], [2517, 2547, 2393], [2393, 2547, 2548], [2394, 2549, 2267], [2534, 2391, 2549], [2395, 2196, 2526], [2046, 2268, 2550], [2268, 2046, 2550], [2398, 2115, 2397], [2293, 2053, 2400], [2402, 2400, 2401], [2635, 2412, 2269], [2425, 1958, 2422], [2429, 1878, 2306], [2440, 2166, 2309], [1881, 1963, 2442], [2459, 2317, 2568], [2273, 2233, 2461], [2538, 2238, 2539], [2540, 2476, 2344], [2481, 2342, 2242], [2342, 2481, 2541], [1934, 2499, 2254], [2546, 2545, 2508], [2544, 2261, 2508], [2544, 2370, 2261], [2545, 2544, 2508], [2387, 2037, 2515], [2396, 2268, 2550], [2048, 2396, 2397], [2423, 2304, 2428], [2166, 2070, 2309], [2231, 2230, 2452], [2452, 2230, 2231], [2456, 2552, 2232], [2565, 2566, 2273], [2570, 2569, 2320], [2316, 2457, 2318], [2325, 2554, 2460], [2573, 2325, 2324], [2554, 2325, 2536], [2325, 2537, 2536], [2540, 2344, 2484], [2541, 2481, 2555], [2582, 2541, 2555], [2353, 2489, 2583], [2514, 2110, 2387], [2401, 2400, 2402], [2298, 2299, 2647], [2300, 2303, 2557], [2418, 2302, 2417], [2426, 2558, 2227], [2310, 2433, 2438], [2228, 2313, 2443], [2560, 2313, 2228], [2448, 2562, 2314], [2232, 2563, 2449], [2564, 2452, 2230], [2231, 2452, 2564], [2231, 2564, 2452], [2455, 2565, 2273], [2567, 2563, 2232], [2552, 2567, 2232], [2454, 2453, 2457], [2273, 2566, 2565], [2233, 2273, 2566], [2322, 2320, 2569], [2571, 2315, 2321], [2460, 2552, 2456], [2553, 2552, 2460], [2276, 2233, 2572], [2324, 2463, 2573], [2323, 2574, 2318], [2318, 2574, 2316], [2327, 2276, 2572], [2575, 2553, 2554], [2553, 2460, 2554], [2323, 2278, 2574], [2275, 2576, 2329], [2334, 2332, 2577], [2475, 2470, 2472], [2577, 2578, 2334], [2241, 2334, 2578], [2341, 2479, 2475], [2480, 2241, 2579], [2594, 2340, 2551], [2338, 2532, 2243], [2485, 2532, 2580], [2483, 2352, 2349], [2532, 2551, 2580], [2580, 2551, 2541], [2555, 2481, 2581], [2481, 2346, 2581], [2284, 2245, 2355], [2492, 2583, 2489], [2584, 2493, 2490], [2250, 2359, 2362], [2495, 2496, 2498], [2492, 2363, 2257], [2362, 2256, 2585], [2585, 2256, 2587], [2361, 2586, 2367], [2368, 2503, 2502], [2502, 2505, 2368], [2507, 2506, 2588], [2507, 2588, 2372], [2378, 2377, 2591], [2378, 2591, 2379], [2518, 2521, 2291], [2522, 2520, 2523], [2404, 2407, 2556], [2403, 2404, 2223], [2300, 2303, 2557], [2419, 2301, 2422], [2421, 2226, 2227], [2558, 2559, 2227], [2447, 2561, 2445], [2449, 2593, 2592], [2593, 2449, 2563], [2553, 2567, 2552], [2570, 2320, 2531], [2599, 2281, 2282], [2594, 2551, 2532], [2601, 2352, 2483], [2580, 2541, 2582], [2533, 2246, 2356], [2603, 2581, 2245], [2486, 2351, 2487], [2373, 2259, 2500], [2589, 2374, 2373], [2371, 2260, 2590], [2528, 2595, 2527], [2891, 2408, 2405], [2631, 2409, 2632], [2300, 2557, 2303], [2435, 2436, 2311], [2561, 2447, 2229], [2553, 2598, 2567], [2597, 2570, 2531], [2609, 2238, 2333], [2610, 2470, 2475], [2474, 2337, 2343], [2532, 2338, 2594], [2485, 2580, 2354], [2284, 2603, 2245], [2354, 2580, 2602], [2542, 2604, 2543], [2257, 2258, 2371], [2502, 2368, 2505], [2528, 2399, 2595], [2627, 2404, 2556], [2293, 2625, 2644], [2300, 2557, 2637], [2647, 2299, 2415], [2301, 2416, 2649], [2445, 2561, 2229], [2592, 2444, 2449], [2593, 2616, 2592], [2570, 2597, 2607], [2726, 2715, 2321], [2608, 2574, 2278], [2469, 2468, 2279], [2905, 2279, 2735], [2741, 2599, 2282], [2479, 2600, 2475], [2245, 2581, 2346], [2245, 2346, 2283], [2582, 2555, 2612], [2582, 2611, 2602], [2612, 2555, 2581], [2611, 2582, 2612], [2584, 2806, 2493], [2365, 2793, 2500], [2543, 2605, 2361], [2369, 2505, 2824], [2606, 2521, 2518], [2626, 2402, 2634], [2412, 2642, 2414], [2636, 2294, 2295], [2893, 2270, 2614], [2656, 2225, 2421], [2658, 2656, 2421], [2421, 2227, 2596], [2530, 2430, 2427], [2530, 2615, 2427], [2666, 2530, 2430], [2430, 2530, 2427], [2306, 2432, 2434], [2306, 2434, 2670], [2677, 2438, 2674], [2675, 2434, 2437], [2442, 2438, 2677], [2681, 2560, 2228], [2684, 2441, 2686], [2442, 2685, 2446], [2444, 2271, 2449], [2692, 2445, 2229], [2699, 2565, 2455], [2563, 2567, 2706], [2899, 2570, 2704], [2319, 2274, 2710], [2573, 2463, 2719], [2723, 2573, 2719], [2275, 2462, 2722], [2717, 2531, 2465], [2727, 2575, 2554], [2328, 2326, 2731], [2734, 2574, 2608], [2735, 2327, 2725], [2739, 2278, 2330], [2743, 2331, 2467], [2336, 2238, 2609], [2750, 2239, 2757], [2776, 2479, 2480], [2777, 2601, 2483], [2533, 2356, 2782], [2602, 2580, 2582], [2612, 2581, 2603], [2284, 2787, 2355], [2792, 2357, 2800], [2793, 2494, 2488], [2490, 2799, 2584], [2365, 2494, 2793], [2250, 2362, 2807], [2373, 2500, 2819], [2605, 2543, 2618], [2828, 2586, 2827], [2504, 2367, 2830], [2510, 2374, 2838], [2511, 2845, 2842], [2377, 2844, 2591], [2508, 2509, 2846], [2853, 2509, 2386], [2913, 2515, 2854], [2851, 2389, 2512], [2263, 2513, 2859], [2856, 2517, 2389], [2289, 2519, 2864], [2875, 2535, 2534], [2875, 2876, 2535], [2395, 2879, 2524], [2396, 2550, 2885], [2629, 2406, 2292], [2625, 2293, 2400], [2628, 2556, 2407], [2633, 2413, 2408], [2404, 2627, 2223], [2628, 2407, 2414], [2409, 2410, 2632], [2402, 2296, 2634], [2627, 2403, 2223], [2294, 2636, 2295], [2640, 2296, 2297], [2224, 2645, 2297], [2646, 2224, 2403], [2416, 2293, 2644], [2418, 2638, 2648], [2418, 2417, 2638], [2298, 2614, 2270], [2649, 2416, 2644], [2410, 2225, 2632], [2225, 2650, 2632], [2653, 2418, 2651], [2420, 2418, 2653], [2304, 2420, 2654], [2305, 2655, 2303], [2301, 2657, 2422], [2657, 2659, 2422], [2422, 2660, 2425], [2659, 2660, 2422], [2596, 2662, 2421], [2424, 2429, 2663], [2662, 2596, 2227], [2427, 2615, 2426], [2429, 2665, 2663], [2615, 2530, 2666], [2227, 2559, 2662], [2668, 2308, 2428], [2558, 2426, 2664], [2558, 2669, 2559], [2675, 2670, 2434], [2673, 2440, 2309], [2435, 2311, 2676], [2671, 2435, 2676], [2678, 2679, 2440], [2440, 2681, 2228], [2679, 2681, 2440], [2683, 2442, 2677], [2683, 2685, 2442], [2560, 2681, 2313], [2312, 2444, 2687], [2686, 2441, 2445], [2444, 2688, 2687], [2448, 2446, 2685], [2448, 2685, 2691], [2693, 2230, 2690], [2592, 2616, 2444], [2230, 2313, 2690], [2616, 2898, 2688], [2693, 2564, 2230], [2694, 2692, 2229], [2451, 2694, 2229], [2448, 2691, 2562], [2616, 2593, 2695], [2564, 2693, 2452], [2696, 2452, 2693], [2616, 2695, 2593], [2314, 2562, 2697], [2570, 2703, 2704], [2454, 2457, 2702], [2451, 2315, 2705], [2711, 2566, 2700], [2695, 2563, 2706], [2570, 2899, 2569], [2316, 2709, 2457], [2316, 2712, 2709], [2322, 2569, 2463], [2567, 2598, 2713], [2607, 2597, 2531], [2319, 2710, 2716], [2315, 2571, 2715], [2572, 2714, 2720], [2572, 2233, 2714], [2716, 2721, 2319], [2325, 2723, 2724], [2723, 2325, 2573], [2464, 2726, 2321], [2727, 2553, 2575], [2728, 2717, 2465], [2275, 2722, 2576], [2329, 2576, 2722], [2729, 2574, 2734], [2329, 2722, 2736], [2727, 2554, 2737], [2732, 2537, 2325], [2536, 2737, 2554], [2278, 2734, 2608], [2734, 2278, 2739], [2743, 2740, 2331], [2736, 2332, 2329], [2536, 2538, 2742], [2745, 2332, 2736], [2328, 2733, 2466], [2281, 2599, 2741], [2333, 2537, 2748], [2239, 2744, 2330], [2752, 2336, 2748], [2466, 2749, 2335], [2469, 2747, 2337], [2751, 2282, 2470], [2336, 2609, 2748], [2240, 2743, 2467], [2749, 2471, 2335], [2749, 2756, 2471], [2754, 2758, 2337], [2755, 2240, 2340], [2337, 2758, 2343], [2471, 2763, 2339], [2336, 2752, 2338], [2470, 2610, 2761], [2610, 2475, 2761], [2340, 2594, 2766], [2339, 2767, 2477], [2241, 2578, 2768], [2594, 2338, 2762], [2760, 2483, 2343], [2769, 2579, 2241], [2540, 2484, 2771], [2477, 2772, 2482], [2479, 2773, 2600], [2774, 2347, 2482], [2774, 2482, 2772], [2779, 2480, 2579], [2779, 2579, 2778], [2348, 2347, 2774], [2352, 2601, 2777], [2777, 2780, 2352], [2244, 2771, 2484], [2781, 2351, 2348], [2356, 2783, 2782], [2352, 2780, 2247], [2907, 2244, 2353], [2780, 2785, 2247], [2487, 2351, 2784], [2785, 2248, 2247], [2603, 2284, 2787], [2602, 2790, 2617], [2602, 2611, 2790], [2793, 2488, 2248], [2583, 2492, 2791], [2354, 2602, 2617], [2784, 2490, 2487], [2248, 2785, 2793], [2354, 2617, 2491], [2792, 2356, 2357], [2787, 2284, 2250], [2794, 2797, 2542], [2794, 2542, 2360], [2799, 2490, 2784], [2250, 2359, 2786], [2250, 2786, 2796], [2798, 2360, 2358], [2250, 2802, 2359], [2800, 2357, 2792], [2804, 2251, 2495], [2795, 2492, 2805], [2543, 2604, 2797], [2805, 2492, 2257], [2802, 2250, 2807], [2973, 2804, 2808], [2497, 2810, 2809], [2500, 2793, 2814], [2254, 2812, 2498], [2254, 2816, 2812], [2499, 2816, 2254], [2807, 2362, 2585], [2253, 2815, 2503], [2820, 2256, 2366], [2821, 2807, 2585], [2810, 2497, 2501], [2370, 2810, 2501], [2820, 2366, 2369], [2370, 2620, 2619], [2502, 2503, 2815], [2368, 2502, 2823], [2820, 2369, 2824], [2256, 2820, 2825], [2256, 2825, 2587], [2827, 2586, 2361], [2827, 2361, 2605], [2586, 2828, 2367], [2827, 2605, 2618], [2832, 2620, 2370], [2831, 2585, 2587], [2832, 2370, 2544], [2368, 2823, 2505], [2831, 2821, 2585], [2504, 2830, 2506], [2826, 2589, 2373], [2504, 2506, 2830], [2830, 2506, 2504], [2836, 2506, 2830], [2833, 2374, 2589], [2824, 2505, 2823], [2621, 2588, 2506], [2260, 2837, 2590], [2836, 2588, 2621], [2260, 2375, 2837], [2376, 2510, 2839], [2836, 2372, 2588], [2379, 2591, 2845], [2840, 2546, 2846], [2546, 2508, 2846], [2849, 2384, 2380], [2512, 2622, 2851], [2852, 2512, 2382], [2622, 2512, 2852], [2850, 2509, 2853], [2849, 2385, 2384], [2854, 2384, 2385], [2854, 2385, 2384], [2854, 2385, 2849], [2853, 2386, 2388], [2515, 2385, 2854], [2851, 2856, 2389], [2382, 2383, 2852], [2858, 2914, 2263], [2860, 2513, 2514], [2861, 2517, 2856], [2390, 2862, 2516], [2861, 2547, 2517], [2863, 2547, 2861], [2390, 2289, 2864], [2547, 2865, 2548], [2519, 2866, 2864], [2548, 2865, 2867], [2392, 2266, 2868], [2518, 2392, 2868], [2519, 2520, 2866], [2869, 2266, 2265], [2870, 2393, 2548], [2265, 2393, 2870], [2624, 2548, 2867], [2606, 2518, 2872], [2522, 2873, 2520], [2548, 2624, 2874], [2606, 2872, 2521], [2875, 2549, 2921], [2873, 2522, 2876], [2878, 2394, 2524], [2522, 2535, 2876], [2877, 2525, 2521], [2877, 2880, 2525], [2526, 2879, 2395], [2527, 2881, 2526], [2527, 2882, 2881], [2268, 2525, 2883], [2882, 2527, 2884], [2527, 2595, 2884], [2550, 2268, 2883], [2885, 2886, 2396], [2887, 2888, 2399], [2884, 2399, 2888], [2889, 2396, 2886], [2396, 2889, 2397], [2398, 2397, 2890], [2401, 2626, 2625], [2625, 2400, 2401], [2626, 2401, 2402], [2627, 2556, 2628], [2629, 2292, 2892], [2642, 2407, 2628], [2642, 2628, 2407], [2411, 2300, 2892], [2630, 2294, 2636], [2639, 2406, 2629], [2634, 2296, 2640], [2642, 2412, 2635], [2893, 2294, 2295], [2643, 2415, 2406], [2406, 2639, 2643], [2403, 2641, 2646], [2613, 2298, 2647], [2651, 2418, 2648], [2557, 2303, 2637], [2224, 2894, 2646], [2225, 2656, 2650], [2652, 2303, 2655], [2653, 2654, 2420], [2428, 2304, 2661], [2658, 2421, 2662], [2305, 2424, 2655], [2655, 2424, 2663], [2615, 2664, 2426], [2429, 2306, 2665], [2668, 2428, 2661], [2667, 2662, 2559], [2558, 2664, 2669], [2667, 2559, 2669], [2309, 2307, 2895], [2673, 2309, 2895], [2308, 2668, 2433], [2430, 2431, 2435], [2430, 2435, 2671], [2438, 2433, 2674], [2680, 2675, 2437], [2682, 2311, 2312], [2682, 2676, 2311], [2680, 2437, 2441], [2680, 2441, 2684], [2897, 2682, 2688], [2687, 2682, 2312], [2682, 2687, 2688], [2690, 2313, 2689], [2686, 2445, 2692], [2444, 2616, 2688], [2616, 2592, 2898], [2592, 2616, 2898], [2699, 2455, 2698], [2455, 2454, 2698], [2693, 2452, 2696], [2695, 2616, 2593], [2700, 2565, 2699], [2273, 2565, 2700], [2695, 2593, 2563], [2566, 2273, 2700], [2703, 2570, 2704], [2900, 2704, 2570], [2274, 2314, 2697], [2702, 2457, 2709], [2707, 2317, 2452], [2935, 2695, 2706], [2900, 2570, 2607], [2568, 2317, 2707], [2708, 2569, 2936], [2462, 2568, 2707], [2569, 2708, 2936], [2714, 2233, 2566], [2463, 2936, 2719], [2607, 2531, 2717], [2462, 2901, 2902], [2598, 2553, 2718], [2571, 2321, 2715], [2462, 2902, 2722], [2725, 2327, 2572], [2572, 2720, 2725], [2574, 2729, 2316], [2316, 2729, 2712], [2721, 2326, 2319], [2731, 2326, 2721], [2464, 2281, 2738], [2735, 2279, 2327], [2737, 2903, 2727], [2724, 2732, 2325], [2465, 2331, 2740], [2904, 2732, 2537], [2469, 2279, 2905], [2330, 2744, 2739], [2281, 2741, 2738], [2536, 2742, 2737], [2733, 2746, 2466], [2577, 2332, 2745], [2466, 2746, 2749], [2239, 2750, 2744], [2751, 2926, 2741], [2751, 2741, 2282], [2754, 2337, 2747], [2759, 2742, 2539], [2742, 2538, 2539], [2759, 2539, 2540], [2758, 2760, 2343], [2471, 2756, 2763], [2578, 2577, 2753], [2338, 2752, 2762], [2751, 2470, 2761], [2766, 2764, 2340], [2478, 2765, 2473], [2594, 2762, 2766], [2241, 2768, 2769], [2345, 2765, 2478], [2475, 2600, 2773], [2778, 2579, 2769], [2483, 2775, 2777], [2773, 2479, 2776], [2345, 2533, 2770], [2770, 2533, 2782], [2774, 2781, 2348], [2939, 2907, 2244], [2784, 2351, 2781], [2907, 2353, 2791], [2939, 2907, 2791], [2789, 2787, 2284], [2789, 2284, 2355], [2791, 2353, 2583], [2612, 2603, 2786], [2788, 2612, 2786], [2611, 2612, 2788], [2790, 2611, 2788], [2355, 2787, 2789], [2790, 2908, 2617], [2783, 2356, 2792], [2787, 2796, 2786], [2787, 2250, 2796], [2795, 2791, 2492], [2602, 2617, 2908], [2908, 2617, 2602], [2802, 2786, 2359], [2604, 2542, 2797], [2617, 2602, 2908], [2602, 2617, 2908], [2909, 2358, 2251], [2491, 2617, 2908], [2803, 2491, 2908], [2806, 2584, 2799], [2357, 2809, 2792], [2491, 2803, 2253], [2804, 2495, 2498], [2357, 2497, 2809], [2812, 2808, 2498], [2543, 2813, 2910], [2499, 2364, 2817], [2815, 2811, 2502], [2543, 2910, 2813], [2543, 2813, 2618], [2823, 2502, 2811], [2826, 2373, 2819], [2822, 2371, 2911], [2587, 2829, 2831], [2589, 2826, 2833], [2834, 2911, 2371], [2371, 2590, 2834], [2834, 2590, 2837], [2546, 2840, 2545], [2840, 2835, 2545], [2506, 2836, 2621], [2837, 2511, 2842], [2836, 2841, 2372], [2377, 2376, 2839], [2511, 2379, 2845], [2285, 2847, 2848], [2380, 2285, 2848], [2846, 2509, 2850], [2849, 2380, 2848], [2855, 2853, 2388], [2514, 2387, 2857], [2383, 2915, 2852], [2914, 2915, 2383], [2914, 2383, 2263], [2853, 2855, 2388], [2388, 2516, 2853], [2516, 2862, 2853], [2863, 2865, 2547], [2519, 2917, 2866], [2917, 2864, 2866], [2916, 2864, 2917], [2519, 2866, 2917], [2266, 2623, 2868], [2869, 2265, 2871], [2918, 2266, 2869], [2872, 2518, 2868], [2520, 2873, 2866], [2623, 2266, 2918], [2919, 2624, 2867], [2870, 2548, 2874], [2874, 2624, 2919], [2872, 2877, 2521], [2394, 2878, 2920], [2549, 2394, 2920], [2921, 2549, 2920], [2534, 2549, 2875], [2524, 2879, 2878], [2879, 2526, 2881], [2595, 2399, 2884], [2399, 2529, 2887], [2529, 2398, 2887], [2891, 2405, 2630], [2892, 2292, 2411], [2628, 2414, 2642], [2269, 2409, 2631], [2417, 2413, 2633], [2630, 2405, 2294], [2641, 2403, 2627], [2636, 2294, 2893], [2640, 2297, 2645], [2893, 2295, 2270], [2614, 2298, 2613], [2647, 2415, 2643], [2645, 2224, 2646], [2224, 2646, 2894], [2637, 2303, 2652], [2657, 2301, 2649], [2923, 2304, 2654], [2307, 2425, 2660], [2924, 2615, 2666], [2896, 2306, 2670], [2666, 2430, 2671], [2672, 2433, 2668], [2433, 2672, 2674], [2678, 2440, 2679], [2898, 2616, 2695], [2701, 2452, 2693], [2454, 2702, 2698], [2707, 2452, 2701], [2569, 2899, 2708], [2694, 2451, 2705], [2714, 2566, 2711], [2706, 2567, 2713], [2463, 2569, 2936], [2901, 2462, 2902], [2462, 2707, 2902], [2713, 2598, 2718], [2464, 2730, 2726], [2733, 2328, 2731], [2730, 2464, 2738], [2904, 2732, 2724], [2925, 2904, 2724], [2903, 2737, 2536], [2903, 2536, 2737], [2609, 2333, 2748], [2753, 2577, 2745], [2757, 2239, 2765], [2906, 2759, 2540], [2755, 2340, 2764], [2239, 2473, 2765], [2767, 2339, 2763], [2906, 2540, 2771], [2477, 2767, 2772], [2907, 2939, 2244], [2603, 2787, 2786], [2798, 2358, 2801], [2253, 2803, 2815], [2803, 2811, 2815], [2803, 2908, 2811], [2804, 2498, 2808], [2817, 2364, 2493], [2806, 2817, 2493], [2499, 2817, 2816], [2819, 2500, 2814], [2822, 2818, 2257], [2257, 2371, 2822], [2587, 2825, 2829], [2544, 2835, 2832], [2544, 2545, 2835], [2374, 2833, 2838], [2510, 2838, 2839], [2837, 2375, 2511], [2843, 2377, 2839], [2845, 2591, 2844], [2263, 2859, 2858], [2859, 2513, 2860], [2390, 2864, 2862], [2868, 2623, 2918], [2871, 2265, 2870], [2595, 2888, 2884], [2398, 2890, 2887], [2633, 2408, 2891], [2894, 2645, 2646], [2950, 2645, 2894], [2650, 2656, 2933], [2658, 2933, 2656], [2661, 2304, 2923], [2657, 2660, 2659], [2307, 2660, 2895], [2669, 2664, 2615], [2667, 2934, 2662], [2306, 2896, 2665], [2665, 2896, 2670], [2440, 2673, 2679], [2313, 2681, 2689], [2697, 2562, 2691], [2705, 2315, 2715], [2553, 2727, 2718], [2537, 2732, 2904], [2747, 2469, 2905], [2748, 2537, 2732], [2743, 2240, 2755], [2755, 2766, 2937], [2766, 2755, 2764], [2483, 2760, 2775], [2765, 2345, 2770], [2927, 2779, 2778], [2776, 2480, 2928], [2480, 2779, 2928], [2779, 2927, 2928], [2939, 2771, 2907], [2785, 2780, 2940], [2944, 2790, 2788], [2944, 2908, 2790], [2794, 2360, 2798], [2801, 2358, 2909], [2909, 2251, 2804], [2814, 2793, 2953], [2818, 2805, 2257], [2813, 2543, 2797], [2811, 2945, 2823], [2619, 2810, 2370], [2911, 2834, 2822], [2367, 2828, 2830], [2846, 2832, 2840], [2835, 2840, 2832], [2954, 2839, 2838], [2844, 2377, 2843], [2285, 2372, 2841], [2857, 2387, 2515], [2860, 2514, 2857], [2872, 2868, 2946], [2873, 2876, 2866], [2918, 2869, 2871], [2920, 2878, 3003], [2595, 2884, 2888], [2885, 2550, 2883], [2887, 2948, 2884], [2881, 2947, 2879], [2930, 2879, 2947], [2890, 2397, 2889], [2955, 2627, 2628], [2922, 2269, 2631], [2638, 2417, 2633], [2892, 2300, 2637], [2958, 2894, 2932], [2615, 2924, 2664], [2615, 2664, 2669], [2701, 2693, 2951], [2274, 2697, 2710], [2728, 2465, 2740], [2742, 2988, 2903], [2745, 2736, 2966], [2766, 2762, 2752], [2768, 2578, 2753], [2475, 2773, 2761], [2938, 2776, 2928], [2928, 2927, 2778], [2771, 2244, 2907], [2928, 2778, 2927], [2799, 2784, 2942], [2795, 2805, 2791], [2943, 2788, 2786], [2943, 2786, 2802], [2944, 2788, 2943], [2811, 2908, 2944], [2802, 2807, 2796], [2811, 2944, 2945], [2823, 2945, 2824], [2857, 2515, 2913], [2946, 2868, 2918], [2525, 2880, 2883], [2628, 2627, 2955], [2657, 2959, 2660], [2960, 2666, 2671], [2961, 2671, 2676], [2897, 2688, 2981], [2982, 2898, 2695], [2936, 2569, 2708], [2723, 2719, 2936], [2713, 2718, 2727], [2965, 2726, 2730], [2965, 2730, 2738], [2967, 2743, 2755], [2766, 2752, 2937], [2761, 2773, 2968], [2773, 2776, 3011], [2990, 2771, 2939], [2770, 2782, 2970], [2784, 2781, 2971], [2929, 2941, 2952], [2793, 2785, 2972], [2797, 2929, 2813], [2945, 2944, 2943], [2945, 2943, 2820], [2796, 2825, 2802], [2825, 2796, 2807], [2807, 2796, 2825], [2945, 2820, 2824], [2833, 2826, 2819], [2810, 2619, 2974], [2619, 2620, 2974], [2822, 2834, 2995], [2827, 2618, 2912], [2830, 2975, 2836], [2847, 2285, 2841], [2853, 2862, 2864], [2864, 2976, 2853], [2888, 2887, 2884], [2886, 2885, 2883], [2931, 3003, 2930], [3003, 2879, 2930], [2956, 2628, 2642], [2632, 2650, 2957], [2669, 2664, 2924], [2682, 2897, 2979], [2951, 2693, 2690], [2983, 2704, 2984], [2704, 2900, 2984], [2962, 2723, 2936], [2902, 2707, 2986], [2935, 2706, 2713], [2748, 2732, 2904], [2744, 2734, 2739], [2754, 2747, 2758], [2765, 2770, 2969], [2927, 2778, 2991], [2805, 2992, 2791], [2822, 2805, 2818], [2813, 2929, 2993], [2796, 2807, 2825], [2813, 2993, 2994], [2994, 2618, 2813], [2838, 2833, 2996], [2845, 2998, 2842], [2853, 2976, 2850], [2854, 2849, 3000], [2851, 2622, 2852], [3001, 2852, 2915], [2914, 2858, 2915], [2871, 2870, 2977], [2871, 2977, 2918], [2978, 2894, 2958], [2897, 2981, 2980], [2690, 2689, 3031], [2899, 2704, 2983], [2707, 2701, 3008], [2702, 2709, 2985], [2708, 2899, 2936], [2707, 3008, 2986], [2717, 3009, 2607], [2963, 3009, 2717], [2963, 3009, 2717], [3009, 2963, 2717], [2713, 2727, 2987], [2722, 2902, 3033], [2905, 2735, 2725], [2903, 2737, 2742], [2989, 2758, 2747], [2988, 2742, 2759], [2750, 2757, 2765], [3020, 2759, 2906], [2906, 2771, 3010], [2775, 2760, 2777], [2969, 2770, 2970], [2776, 2938, 3011], [3034, 2792, 2809], [2825, 2820, 2943], [2819, 2814, 2953], [2833, 2819, 2996], [2834, 2837, 2995], [2829, 2825, 2831], [2843, 2839, 2954], [2999, 2843, 2954], [2620, 2832, 2997], [2998, 3013, 2842], [2837, 2842, 3013], [2997, 2832, 2846], [2843, 2999, 3014], [2845, 2844, 2998], [3014, 2998, 2844], [3015, 2846, 2850], [3015, 2997, 2846], [3016, 2850, 2976], [2851, 2852, 3001], [3002, 2859, 2860], [2917, 2866, 2876], [2878, 2879, 3003], [3004, 2874, 2919], [3005, 2918, 2977], [2949, 2931, 2930], [2627, 2628, 2955], [2625, 2649, 2644], [2932, 2894, 2958], [3041, 2665, 2670], [2682, 2979, 2676], [2689, 2681, 3031], [2981, 2688, 2898], [2699, 3045, 3093], [2694, 2705, 3018], [2709, 2712, 2964], [2713, 3019, 2935], [2902, 2722, 3033], [2723, 2719, 2724], [2719, 2925, 2724], [2966, 2736, 2722], [2988, 2759, 3020], [2751, 2761, 3021], [2751, 3021, 2926], [3020, 2906, 3010], [2777, 2760, 3022], [3010, 2771, 2990], [2781, 2774, 3023], [2778, 2769, 2991], [2929, 2952, 2941], [2909, 2804, 3248], [2805, 2822, 3024], [2929, 2952, 3012], [2993, 2929, 3012], [2943, 2802, 2825], [2993, 3025, 2994], [2807, 2821, 2831], [2830, 2828, 2975], [2844, 2843, 3014], [2851, 3001, 3026], [3016, 2976, 2916], [2916, 2976, 2864], [3035, 2916, 2917], [2876, 2875, 2917], [3004, 2870, 2874], [2886, 2883, 3027], [2887, 2890, 3028], [2882, 2947, 2881], [2930, 3029, 2949], [2636, 2893, 3174], [3176, 2893, 2614], [2646, 2645, 2950], [2646, 2950, 2894], [2655, 2663, 3007], [2978, 2958, 3017], [3032, 2981, 2898], [2694, 3018, 2692], [2964, 2712, 2729], [2744, 2750, 3226], [2755, 2937, 3113], [3117, 3010, 2990], [3129, 2785, 2940], [2939, 2791, 2992], [2942, 3135, 2799], [3133, 2783, 2792], [2838, 2996, 3056], [2858, 2859, 3002], [3035, 2917, 3036], [2946, 2918, 3005], [2919, 3037, 3004], [2672, 2668, 2674], [2673, 3043, 2679], [3085, 2897, 2979], [2680, 2684, 2686], [2983, 3044, 2899], [2982, 2695, 2935], [3033, 2722, 3101], [2722, 3033, 3101], [2727, 2903, 2987], [2738, 2741, 2965], [3103, 2748, 2904], [2967, 2755, 3051], [2937, 2752, 2748], [3114, 2760, 2758], [2767, 2772, 2774], [2772, 2767, 2774], [3120, 2968, 2773], [3023, 3122, 2781], [2940, 2780, 2777], [2972, 2953, 2793], [2819, 2953, 3054], [2799, 3055, 2806], [2995, 3145, 3143], [2837, 3145, 2995], [2825, 2807, 2831], [3145, 2837, 3143], [3057, 2827, 2912], [3150, 2847, 2841], [3015, 2850, 3016], [3155, 2854, 3367], [2916, 3035, 3016], [2887, 3028, 2948], [2886, 3027, 3063], [2889, 2886, 3063], [2890, 2889, 3028], [2949, 3170, 2931], [3289, 2628, 2956], [3293, 2892, 3173], [3064, 2956, 2642], [2642, 2635, 3064], [3379, 2630, 2636], [2643, 2639, 3069], [2645, 3068, 2640], [3070, 2641, 2627], [2958, 2894, 2978], [2653, 3072, 2654], [3075, 2978, 3017], [2933, 2658, 2662], [2933, 2662, 3076], [3079, 3017, 3030], [3080, 3079, 3030], [2960, 3081, 2666], [2673, 2895, 3043], [2961, 3083, 2671], [3084, 2670, 2675], [2679, 3043, 3190], [2676, 2979, 3085], [2979, 2897, 3085], [2979, 2897, 3086], [3088, 3031, 2681], [3086, 2897, 2980], [3086, 2980, 2981], [3196, 2981, 3032], [2692, 2686, 3090], [2686, 2692, 3090], [3092, 2984, 2900], [3032, 2898, 2982], [2700, 2699, 3093], [2702, 3202, 2698], [3018, 2705, 3046], [3324, 2702, 3327], [3018, 3046, 3047], [3046, 2705, 3047], [3098, 2714, 2711], [2709, 2964, 2985], [3209, 2935, 3019], [3097, 2723, 2962], [3097, 3099, 2723], [2705, 2715, 3212], [2719, 2723, 3100], [3048, 2964, 3216], [2964, 2729, 3216], [2722, 3101, 3033], [2966, 2722, 3033], [3107, 2987, 3049], [3033, 3101, 2966], [3049, 2987, 2903], [2904, 2925, 3103], [3107, 3049, 2903], [3219, 2966, 3101], [3341, 3107, 2903], [3106, 2747, 2905], [2967, 3051, 2743], [2753, 2745, 3223], [2761, 2968, 3120], [3121, 2772, 2767], [3236, 2777, 3232], [3121, 3023, 2774], [2940, 3236, 3124], [2939, 3237, 2990], [2940, 2777, 3236], [3125, 2927, 2991], [2938, 3239, 3127], [3130, 2938, 2928], [2784, 2971, 3128], [2972, 3129, 2940], [2785, 3129, 2972], [2784, 3350, 3052], [2942, 2784, 3052], [2972, 3243, 3134], [3134, 2953, 2972], [3242, 2992, 2805], [3352, 2798, 2801], [2801, 2909, 3138], [3246, 2792, 3034], [2809, 3246, 3034], [3244, 3024, 2822], [3056, 2996, 3251], [2993, 3012, 3141], [2954, 3056, 3251], [2838, 3056, 2954], [2954, 3254, 3146], [3146, 3147, 2954], [2999, 2954, 3147], [3256, 3143, 3013], [3057, 2828, 2827], [2848, 3365, 3268], [2849, 2848, 3268], [2997, 3015, 3151], [3152, 3000, 2849], [3155, 2913, 2854], [3368, 3156, 2860], [3158, 2851, 3026], [3001, 2915, 3059], [2917, 3162, 3036], [3162, 2917, 2875], [3164, 3162, 2920], [2920, 3162, 2921], [2870, 3004, 3278], [3164, 2920, 3003], [3164, 3003, 3165], [3061, 2946, 3005], [3279, 3004, 3037], [2884, 3062, 2882], [3284, 2947, 2882], [3290, 3289, 2956], [3292, 2891, 2630], [2629, 2892, 3293], [2626, 3294, 2625], [3295, 2633, 3171], [2639, 2629, 3293], [2892, 2637, 3173], [2922, 3064, 2635], [3174, 2893, 3176], [3177, 2613, 2647], [2641, 3070, 3071], [3178, 3177, 2647], [3067, 2632, 2957], [3069, 2647, 2643], [3301, 3006, 2614], [2653, 2651, 3180], [2978, 2894, 3038], [2978, 3075, 3038], [2663, 3308, 3306], [3077, 3030, 3017], [2934, 3078, 2662], [3188, 2663, 2665], [3080, 3040, 3079], [3040, 3017, 3079], [2666, 3186, 2924], [2934, 2667, 3312], [3313, 2674, 2668], [3040, 3080, 3042], [2677, 2674, 3313], [2683, 2677, 3191], [2686, 3087, 2680], [2690, 3031, 3088], [3193, 3194, 2690], [2692, 3195, 2686], [2951, 2690, 3194], [2691, 2685, 3089], [3197, 3091, 2983], [3199, 3196, 3032], [3092, 3197, 2983], [2951, 3194, 3198], [2984, 3092, 2983], [3044, 3201, 2899], [3198, 2701, 2951], [3199, 3032, 2982], [2699, 2698, 3202], [3008, 2701, 3198], [3008, 3198, 3094], [3321, 2900, 3092], [3202, 2702, 3323], [2900, 3203, 3092], [2692, 3018, 3204], [3206, 2982, 3095], [3206, 3095, 2982], [2899, 3205, 2936], [3095, 3206, 2982], [2936, 3205, 3207], [3097, 2936, 3208], [3096, 3098, 2700], [2936, 3207, 3208], [3098, 2711, 2700], [3097, 3208, 2962], [2962, 3208, 3097], [3097, 2962, 2936], [2986, 3008, 3210], [3209, 2982, 2935], [3329, 2607, 3009], [2902, 2986, 3211], [2705, 3212, 3332], [2720, 2714, 3331], [3213, 3019, 2713], [3214, 2717, 2728], [2725, 2720, 3334], [3217, 2713, 2987], [3103, 2925, 3218], [3337, 2728, 2740], [3105, 2733, 3338], [3104, 2734, 2744], [2965, 2741, 3050], [2903, 2988, 3109], [3222, 2748, 3103], [3220, 2965, 3050], [2747, 3221, 2989], [3221, 3110, 2989], [2755, 3111, 3051], [3227, 2741, 2926], [2988, 3020, 3109], [2937, 2748, 3225], [3051, 3111, 3113], [3111, 2755, 3113], [3344, 3109, 3020], [2989, 3114, 2758], [2760, 3114, 3118], [2926, 3115, 3227], [3229, 2768, 2753], [3117, 3344, 3020], [3115, 2926, 3021], [3117, 3020, 3010], [3022, 2760, 3118], [3116, 2765, 3119], [3115, 2761, 3120], [2774, 2772, 3121], [2777, 3022, 3232], [3233, 3119, 2765], [3233, 2765, 2969], [2769, 3234, 3235], [3125, 2769, 3235], [2773, 3011, 3120], [3011, 3127, 3120], [3125, 2991, 2769], [3126, 3237, 2939], [2969, 2970, 3123], [2971, 2781, 3128], [2938, 3127, 3011], [2940, 3124, 3238], [2940, 3238, 2972], [3131, 3130, 2928], [3132, 2927, 3125], [3126, 2939, 2992], [3130, 3239, 2938], [3240, 3131, 2928], [3128, 3350, 2784], [2938, 3239, 3130], [2938, 3130, 3239], [2928, 2927, 3241], [2927, 3132, 3241], [3130, 3131, 3239], [3240, 2928, 3241], [3351, 3242, 2992], [3242, 3351, 2992], [3135, 2942, 3052], [3351, 3242, 2805], [3137, 2953, 3134], [3351, 2805, 3244], [2952, 2929, 3136], [3245, 2952, 3136], [2953, 3137, 3139], [2953, 3139, 3054], [3024, 3244, 2805], [2929, 2797, 3053], [3136, 2929, 3053], [3354, 2797, 2794], [2996, 2819, 3139], [2952, 3141, 3012], [2952, 3245, 3141], [2799, 3247, 3055], [3054, 3139, 2819], [3249, 2996, 3139], [3253, 3244, 2822], [3246, 2809, 3140], [3253, 2822, 2995], [3252, 3253, 2995], [3143, 3252, 2995], [3144, 2809, 2810], [3146, 2954, 3251], [3141, 3148, 2993], [2954, 3146, 3254], [3013, 3257, 3256], [3261, 3256, 3257], [2999, 3255, 3258], [3014, 3260, 2998], [2998, 3261, 3259], [2999, 3258, 3014], [3260, 3259, 2998], [3259, 3261, 2998], [2998, 3259, 3261], [3261, 3257, 3013], [3261, 3013, 2998], [2974, 3262, 2810], [2620, 3262, 2974], [3262, 3265, 3149], [3057, 2618, 3263], [3262, 2620, 3265], [3057, 2912, 2618], [2997, 3265, 2620], [2828, 3266, 2975], [2841, 2836, 3267], [3152, 2849, 3268], [3151, 3149, 2997], [3153, 3000, 3152], [3015, 3016, 3151], [3269, 2854, 3000], [3270, 3154, 3016], [3158, 2856, 2851], [3158, 2861, 2856], [3016, 3271, 3270], [2858, 3002, 3157], [3016, 3035, 3271], [2858, 3272, 3273], [2858, 3273, 2915], [2861, 3158, 3369], [3271, 3035, 3274], [3276, 3275, 3026], [3026, 3001, 3370], [3036, 3274, 3035], [3161, 3371, 3274], [3161, 3274, 3036], [2865, 3160, 2867], [2867, 3160, 2919], [3162, 3161, 3036], [2875, 2921, 3162], [3163, 3278, 2870], [3277, 3037, 2919], [3278, 2977, 2870], [3374, 2946, 3061], [3061, 3005, 3166], [3166, 3005, 2977], [3168, 3027, 2883], [3168, 3283, 3027], [3063, 3281, 2889], [3169, 3028, 2889], [3285, 3165, 2931], [2931, 3165, 3003], [3029, 2930, 3286], [2634, 3288, 2626], [3291, 3290, 2956], [3171, 2891, 3292], [2956, 3064, 3291], [3064, 2635, 3291], [3287, 3294, 2626], [3289, 2955, 2628], [3172, 2632, 3067], [3172, 2631, 2632], [3297, 2639, 3293], [3296, 2638, 2633], [2627, 2955, 3289], [3292, 2630, 3379], [3068, 2634, 2640], [3379, 2636, 3174], [3175, 2646, 2641], [3296, 3299, 2648], [3296, 2648, 2638], [3068, 2645, 3065], [2613, 3177, 2614], [3301, 2614, 3006], [3298, 2637, 2652], [3302, 2625, 3294], [2650, 3300, 2957], [2648, 3180, 2651], [3298, 2652, 3179], [3181, 2649, 3302], [3072, 2653, 3180], [3304, 2649, 3181], [3182, 2894, 3038], [2894, 3182, 3038], [2657, 2649, 3304], [3074, 2650, 2933], [3038, 2894, 2978], [2958, 2978, 3038], [2923, 2654, 3303], [3183, 2958, 3038], [2661, 2923, 3305], [3039, 2655, 3306], [2959, 2657, 3184], [3304, 3184, 2657], [2661, 3305, 3307], [2958, 3183, 3017], [3007, 2663, 3306], [2660, 2959, 3184], [3017, 3077, 3075], [3309, 3030, 3077], [3030, 3309, 3080], [3308, 2663, 3188], [3310, 2660, 3184], [3310, 2895, 2660], [3017, 3040, 3077], [3187, 3078, 2934], [2661, 3307, 2668], [2924, 3186, 2669], [3311, 2669, 3186], [3188, 2665, 3041], [3310, 3043, 2895], [2669, 3311, 2667], [3042, 3080, 3189], [2960, 2671, 3081], [3041, 2670, 3314], [3081, 2671, 3082], [2670, 3084, 3314], [2671, 3083, 3082], [2961, 2676, 3315], [2961, 3315, 3083], [2676, 3085, 3315], [3192, 2681, 2679], [3085, 2979, 3086], [2675, 2680, 3087], [3192, 3088, 2681], [3193, 2690, 3088], [3193, 3088, 3194], [3087, 2686, 3317], [3380, 3086, 2981], [3380, 2981, 3196], [3319, 2691, 3089], [3197, 3092, 3318], [3194, 3381, 3198], [3201, 2983, 3091], [2697, 2691, 3319], [3090, 2692, 3204], [3200, 2699, 3202], [3205, 2899, 3201], [3094, 3198, 3320], [3092, 3203, 3321], [3206, 3199, 2982], [2702, 3324, 3323], [2700, 3093, 3096], [2697, 3325, 2710], [3210, 3008, 3094], [3326, 3095, 3209], [3209, 3095, 2982], [2986, 3210, 3211], [3331, 2714, 3098], [2705, 3332, 3047], [3019, 3213, 3330], [3333, 2716, 2710], [3209, 3019, 3330], [2723, 3099, 3100], [3384, 3329, 3009], [2902, 3211, 3383], [2722, 2902, 3383], [3333, 2721, 2716], [2987, 3217, 3335], [2719, 3218, 2925], [3100, 3218, 2719], [2721, 3333, 3215], [2715, 2726, 3102], [3213, 2713, 3335], [3335, 2713, 3217], [3217, 2987, 3335], [3214, 2728, 3337], [2721, 3215, 2731], [2905, 2725, 3339], [2726, 2965, 3102], [3338, 2733, 2731], [3102, 2965, 3220], [3217, 2987, 3107], [2740, 3340, 3337], [2746, 2733, 3105], [2746, 3105, 3342], [2747, 3106, 3221], [3221, 3106, 2747], [3221, 2747, 3106], [3341, 2903, 3109], [3108, 2743, 3051], [3225, 2748, 3222], [3114, 2989, 3110], [3225, 3113, 2937], [2746, 3342, 2749], [3050, 2741, 3227], [3344, 3341, 3109], [2749, 3112, 3228], [2756, 2749, 3228], [3226, 2750, 3116], [3118, 3114, 3386], [2756, 3228, 2763], [3116, 2750, 2765], [2768, 3229, 3230], [3231, 2767, 2763], [2761, 3115, 3021], [2768, 3230, 3234], [3118, 3232, 3022], [3120, 3345, 3115], [3387, 3117, 3237], [2769, 2768, 3234], [2990, 3237, 3117], [3122, 3023, 3121], [3346, 3237, 3126], [3120, 3127, 3347], [2970, 2782, 3123], [2781, 3348, 3128], [2782, 2783, 3123], [3126, 2992, 3242], [3127, 3239, 3349], [2972, 3238, 3243], [3126, 3242, 3351], [3240, 3239, 3131], [3241, 3132, 3125], [3133, 2792, 3246], [3247, 2799, 3135], [3247, 3135, 2799], [2794, 2798, 3352], [3355, 3141, 3245], [2804, 3356, 3248], [3247, 3250, 3055], [3392, 3251, 3249], [2996, 3249, 3251], [3357, 2804, 2973], [3356, 2804, 3357], [3357, 2973, 2808], [3358, 3357, 2808], [2808, 2812, 3358], [3142, 2806, 3055], [3140, 2809, 3144], [3359, 2812, 2816], [3360, 3144, 2810], [3146, 3251, 3254], [3146, 3254, 3255], [3147, 3146, 3255], [2816, 2817, 3361], [3142, 2817, 2806], [3262, 3360, 2810], [2999, 3147, 3255], [3141, 3362, 3148], [3013, 3143, 2837], [3148, 3025, 2993], [3260, 3258, 3259], [3258, 3260, 3014], [3148, 2994, 3025], [3058, 3263, 2618], [3264, 2828, 3057], [2994, 3058, 3148], [2994, 3148, 3058], [3148, 3058, 2994], [2994, 3058, 2618], [3266, 2828, 3264], [3266, 3363, 2975], [2997, 3149, 3265], [2836, 2975, 3363], [3267, 2836, 3364], [3150, 2841, 3267], [2848, 2847, 3150], [3151, 3016, 3154], [3366, 3151, 3154], [3000, 3153, 3269], [3154, 3270, 3366], [3367, 2854, 3269], [2857, 3368, 2860], [2863, 2861, 3369], [3059, 2915, 3273], [3275, 3158, 3026], [3276, 3026, 3370], [2863, 3369, 2865], [3369, 3159, 2865], [3159, 3160, 2865], [2872, 3372, 2877], [2872, 3060, 3372], [3160, 3277, 2919], [2870, 3278, 3163], [3167, 2977, 3278], [2877, 3372, 3280], [2880, 2877, 3280], [3277, 3279, 3037], [3004, 3279, 3278], [3061, 3166, 3374], [3062, 3282, 2882], [2883, 2880, 3280], [2883, 3280, 3168], [3063, 3027, 3281], [3169, 2889, 3281], [3376, 3005, 3166], [3027, 3283, 3281], [3166, 2977, 3167], [3167, 3377, 3166], [3284, 2882, 3282], [3378, 3165, 3285], [2930, 2947, 3284], [3284, 3378, 2930], [3286, 2930, 3378], [3170, 3285, 2931], [3286, 2949, 3029], [3286, 3170, 2949], [2626, 3288, 3287], [3068, 3288, 2634], [3064, 3291, 2635], [3070, 2627, 3289], [3064, 2922, 3066], [3178, 2647, 3069], [2957, 3300, 3067], [2648, 3299, 3180], [2649, 2625, 3302], [3301, 3176, 2614], [3039, 3179, 2652], [3303, 2654, 3072], [3039, 2652, 2655], [2655, 3007, 3306], [3017, 3183, 3077], [3074, 2933, 3076], [2662, 3078, 3076], [3307, 3185, 2668], [3312, 3187, 2934], [3185, 3313, 2668], [3311, 3312, 2667], [2679, 3190, 3192], [2675, 3087, 3084], [2685, 2683, 3089], [3317, 2686, 3195], [3195, 2692, 3090], [3320, 3196, 3199], [3044, 2983, 3201], [2900, 3321, 3092], [2699, 3200, 3045], [3320, 3199, 3206], [3094, 3320, 3382], [2702, 2985, 3327], [3204, 3018, 3047], [3206, 3095, 3326], [3210, 3094, 3211], [3094, 3382, 3211], [3384, 2963, 2717], [3102, 3212, 2715], [3101, 2722, 3383], [2720, 3331, 3334], [2731, 3215, 3338], [3216, 2729, 3336], [2725, 3334, 3339], [2729, 3104, 3336], [3104, 2729, 2734], [3106, 2905, 3339], [2966, 3219, 2745], [2740, 2743, 3108], [2740, 3108, 3340], [2745, 3219, 3223], [3224, 2744, 3226], [2749, 3342, 3112], [3223, 3229, 2753], [3385, 3344, 3117], [3231, 2763, 3228], [3387, 3385, 3117], [2767, 3231, 3121], [3121, 3231, 3396], [3346, 3387, 3237], [3233, 2969, 3123], [3123, 2783, 3133], [3390, 3391, 3239], [3390, 3239, 3240], [3137, 3389, 3139], [3401, 3351, 3244], [3401, 3244, 3253], [2799, 3135, 3247], [3354, 2794, 3352], [3352, 2801, 3353], [3053, 2797, 3354], [3393, 3391, 3255], [3392, 3254, 3251], [3254, 3393, 3255], [3055, 3250, 3142], [3359, 3358, 2812], [3366, 3149, 3151], [3368, 2857, 3155], [2857, 2913, 3155], [3157, 3002, 2860], [3421, 3270, 3271], [2858, 3157, 3272], [3370, 3001, 3059], [3158, 3275, 3276], [3162, 3371, 3161], [2872, 2946, 3373], [2946, 3374, 3373], [2884, 2948, 3062], [2948, 3375, 3062], [3166, 3005, 3376], [3166, 3377, 3376], [2633, 2891, 3171], [2922, 2631, 3066], [2631, 3172, 3066], [3296, 2633, 3295], [3173, 2637, 3298], [2645, 2646, 3175], [3069, 2639, 3297], [2614, 3177, 3301], [2650, 3074, 3300], [3305, 2923, 3303], [3077, 3183, 3075], [2666, 3081, 3186], [2677, 3313, 3191], [3316, 2683, 3191], [3089, 2683, 3316], [2680, 3317, 3087], [2680, 3087, 3317], [3320, 3380, 3196], [3201, 3091, 3197], [3201, 3197, 3426], [3198, 3381, 3380], [3198, 3380, 3320], [3320, 3206, 3382], [2697, 3322, 3325], [3382, 3206, 3326], [2710, 3325, 3328], [2900, 2607, 3329], [3203, 2900, 3329], [2985, 2964, 3048], [3097, 3100, 3099], [3097, 3407, 3100], [3333, 2710, 3328], [3327, 2985, 3048], [3330, 3326, 3209], [3009, 2963, 3384], [3332, 3212, 3102], [3214, 3384, 2717], [3335, 3217, 3394], [3217, 3107, 3394], [3106, 3110, 3221], [3343, 2744, 3224], [3395, 3050, 3227], [3385, 3341, 3344], [3348, 2781, 3122], [3124, 3236, 3238], [3234, 3125, 3235], [3397, 3125, 3234], [3414, 3126, 3351], [3241, 3125, 3388], [3137, 3134, 3389], [3400, 3240, 3241], [3241, 3388, 3400], [3390, 3240, 3400], [3398, 3249, 3139], [3392, 3249, 3398], [3398, 3399, 3392], [3258, 3391, 3390], [3258, 3390, 3400], [3138, 2909, 3248], [3393, 3254, 3392], [3259, 3400, 3256], [3143, 3402, 3253], [3250, 3247, 3420], [3391, 3258, 3255], [3400, 3403, 3256], [3143, 3253, 3252], [3258, 3400, 3259], [3259, 3256, 3261], [2816, 3361, 3359], [3361, 2817, 3142], [2848, 3150, 3365], [3157, 2860, 3156], [3162, 3164, 3371], [3404, 3160, 3159], [3060, 2872, 3373], [3405, 3165, 3378], [3175, 2641, 3071], [3067, 3300, 3406], [3183, 3038, 3075], [3309, 3077, 3040], [3080, 3309, 3040], [3090, 3317, 3195], [2697, 3319, 3322], [3326, 3211, 3382], [3211, 3326, 3383], [3326, 3330, 3408], [3383, 3326, 3408], [3101, 3383, 3408], [3101, 3408, 3409], [3410, 3330, 3213], [3410, 3213, 3335], [3219, 3101, 3411], [3411, 3101, 3409], [3223, 3219, 3411], [3104, 2744, 3343], [3051, 3113, 3225], [3412, 3232, 3118], [3232, 3412, 3236], [3238, 3236, 3413], [3415, 3346, 3126], [3414, 3415, 3126], [3350, 3128, 3052], [3416, 3134, 3238], [3134, 3243, 3238], [3399, 3347, 3127], [3127, 3349, 3399], [3139, 3389, 3398], [3399, 3349, 3393], [3393, 3349, 3391], [3239, 3391, 3349], [3392, 3399, 3393], [3400, 3388, 3403], [3245, 3419, 3355], [3357, 3248, 3356], [3402, 3143, 3403], [3143, 3256, 3403], [3360, 3144, 3262], [3262, 3144, 3360], [2836, 3363, 3364], [3422, 3164, 3405], [3405, 3164, 3165], [3375, 2948, 3169], [2948, 3028, 3169], [3065, 2645, 3175], [3184, 3443, 3310], [3314, 3084, 3041], [3446, 3085, 3086], [3318, 3424, 3447], [3194, 3088, 3450], [3425, 3086, 3380], [3339, 3334, 3331], [3408, 3410, 3409], [3408, 3330, 3410], [3110, 3106, 3457], [3427, 3107, 3341], [3340, 3108, 3051], [3427, 3394, 3107], [3386, 3114, 3460], [3385, 3427, 3341], [3114, 3110, 3460], [3464, 3395, 3115], [3395, 3227, 3115], [3387, 3346, 3415], [3429, 3345, 3347], [3345, 3120, 3347], [3397, 3432, 3401], [3128, 3433, 3052], [3430, 3123, 3133], [3398, 3429, 3347], [3431, 3389, 3134], [3431, 3429, 3389], [3389, 3429, 3398], [3398, 3347, 3399], [3388, 3125, 3397], [3401, 3432, 3414], [3401, 3414, 3351], [3388, 3397, 3434], [3402, 3434, 3401], [3247, 3135, 3052], [3470, 3133, 3246], [3247, 3052, 3417], [3388, 3434, 3403], [3402, 3401, 3253], [3403, 3434, 3402], [3353, 2801, 3138], [3420, 3247, 3435], [3360, 3437, 3144], [3437, 3360, 3262], [3266, 3264, 3057], [3439, 3268, 3365], [3439, 3152, 3268], [3287, 3288, 3068], [3440, 3289, 3290], [3441, 3298, 3179], [3181, 3302, 3304], [3307, 3305, 3303], [3187, 3076, 3078], [3186, 3081, 3444], [3041, 3084, 3445], [3083, 3081, 3082], [3449, 3088, 3192], [3318, 3447, 3197], [3380, 3381, 3425], [3092, 3451, 3318], [3205, 3452, 3207], [3321, 3451, 3092], [3098, 3453, 3331], [3338, 3215, 3333], [3454, 3339, 3331], [3455, 3332, 3102], [3409, 3410, 3456], [3456, 3335, 3394], [3455, 3102, 3458], [3411, 3409, 3456], [3456, 3410, 3335], [3102, 3220, 3458], [3459, 3411, 3456], [3461, 3223, 3459], [3224, 3226, 3343], [3228, 3112, 3342], [3343, 3226, 3462], [3461, 3229, 3223], [3463, 3427, 3385], [3230, 3461, 3465], [3461, 3230, 3229], [3463, 3385, 3387], [3466, 3463, 3387], [3119, 3233, 3428], [3465, 3466, 3415], [3230, 3465, 3467], [3116, 3119, 3428], [3230, 3467, 3234], [3467, 3465, 3415], [3415, 3466, 3387], [3233, 3430, 3428], [3468, 3345, 3429], [3397, 3234, 3432], [3467, 3414, 3432], [3467, 3415, 3414], [3430, 3233, 3123], [3234, 3467, 3432], [3122, 3128, 3348], [3416, 3469, 3431], [3431, 3468, 3429], [3434, 3397, 3401], [3431, 3134, 3416], [3470, 3430, 3133], [3418, 3470, 3246], [3436, 3245, 3136], [3246, 3140, 3418], [3437, 3140, 3144], [3140, 3437, 3471], [3360, 3437, 3262], [3262, 3437, 3360], [3438, 3437, 3262], [3473, 3266, 3057], [3262, 3149, 3438], [3149, 3366, 3438], [3474, 3366, 3270], [3474, 3270, 3421], [3274, 3421, 3271], [3369, 3158, 3475], [3369, 3475, 3159], [3276, 3475, 3158], [3476, 3371, 3164], [3422, 3476, 3164], [3060, 3373, 3374], [3168, 3280, 3372], [3423, 3477, 3405], [3405, 3477, 3422], [3377, 3167, 3278], [3166, 3376, 3374], [3285, 3170, 3378], [3517, 3290, 3518], [3527, 3295, 3171], [3176, 3301, 3177], [3039, 3442, 3179], [3308, 3188, 3306], [3478, 3479, 3480], [3478, 3480, 3448], [3424, 3448, 3447], [3481, 3448, 3424], [3381, 3194, 3450], [3317, 3090, 3482], [3205, 3201, 3452], [3208, 3207, 3452], [3203, 3451, 3321], [3216, 3336, 3104], [3459, 3456, 3394], [3411, 3459, 3223], [3459, 3394, 3427], [3461, 3459, 3463], [3459, 3427, 3463], [3461, 3463, 3466], [3461, 3466, 3465], [3468, 3464, 3345], [3236, 3488, 3413], [3464, 3115, 3345], [3416, 3238, 3413], [3413, 3469, 3416], [3431, 3469, 3468], [3247, 3417, 3435], [3420, 3418, 3435], [3435, 3418, 3420], [3472, 3148, 3362], [3438, 3366, 3474], [3484, 3483, 3421], [3274, 3484, 3421], [3273, 3370, 3059], [3378, 3423, 3405], [3443, 3310, 3562], [3486, 3187, 3479], [3486, 3479, 3478], [3447, 3448, 3495], [3381, 3450, 3487], [3447, 3426, 3197], [3511, 3482, 3204], [3203, 3329, 3622], [3051, 3496, 3340], [3458, 3220, 3050], [3386, 3412, 3118], [3236, 3412, 3488], [3468, 3469, 3464], [3128, 3122, 3489], [3490, 3435, 3417], [3418, 3435, 3470], [3674, 3352, 3672], [3673, 3138, 3675], [3688, 3683, 3358], [3422, 3505, 3476], [3372, 3492, 3168], [3378, 3170, 3286], [3287, 3288, 3294], [3538, 3070, 3289], [3406, 3300, 3074], [3493, 3306, 3188], [3486, 3076, 3187], [3310, 3443, 3184], [3081, 3083, 3494], [3478, 3448, 3481], [3585, 3086, 3589], [3487, 3425, 3381], [3447, 3495, 3426], [3323, 3612, 3202], [3625, 3623, 3327], [3106, 3339, 3457], [3103, 3498, 3222], [3458, 3050, 3497], [3222, 3498, 3225], [3225, 3647, 3651], [3497, 3395, 3499], [3395, 3497, 3050], [3412, 3386, 3500], [3488, 3412, 3500], [3464, 3501, 3395], [3413, 3488, 3501], [3501, 3464, 3469], [3413, 3501, 3469], [3052, 3433, 3417], [3435, 3490, 3470], [3354, 3674, 3676], [3356, 3248, 3357], [3245, 3436, 3684], [3702, 3704, 3266], [3503, 3269, 3153], [3483, 3504, 3491], [3277, 3160, 3404], [3740, 3060, 3374], [3743, 3423, 3755], [3516, 3288, 3287], [3290, 3517, 3440], [3522, 3297, 3293], [3518, 3064, 3066], [3518, 3066, 3524], [3066, 3172, 3524], [3536, 3173, 3298], [3068, 3065, 3506], [3542, 3536, 3298], [3406, 3074, 3300], [3550, 3552, 3304], [3185, 3557, 3563], [3185, 3307, 3557], [3563, 3313, 3185], [3311, 3186, 3444], [3041, 3445, 3576], [3495, 3448, 3480], [3495, 3480, 3579], [3191, 3588, 3316], [3089, 3603, 3319], [3510, 3208, 3452], [3319, 3603, 3322], [3093, 3045, 3611], [3090, 3204, 3482], [3208, 3616, 3097], [3453, 3098, 3620], [3628, 3384, 3214], [3339, 3454, 3630], [3643, 3652, 3342], [3228, 3653, 3654], [3650, 3497, 3499], [3228, 3342, 3653], [3655, 3462, 3226], [3501, 3499, 3395], [3488, 3500, 3512], [3512, 3501, 3488], [3663, 3121, 3396], [3122, 3121, 3665], [3513, 3417, 3433], [3417, 3670, 3513], [3675, 3138, 3248], [3678, 3675, 3248], [3248, 3356, 3678], [3698, 3058, 3148], [3502, 3437, 3438], [3362, 3696, 3472], [3696, 3700, 3472], [3502, 3471, 3437], [3472, 3700, 3514], [3702, 3266, 3473], [3502, 3438, 3474], [3502, 3474, 3491], [3476, 3484, 3274], [3476, 3274, 3371], [3733, 3475, 3276], [3737, 3372, 3060], [3747, 3740, 3374], [3745, 3168, 3738], [3746, 3743, 3282], [3747, 3374, 3754], [3284, 3282, 3743], [3516, 3287, 3520], [3518, 3290, 3291], [3518, 3291, 3064], [3293, 3173, 3519], [3287, 3068, 3520], [3523, 3519, 3173], [3515, 3294, 3288], [3527, 3171, 3521], [3526, 3525, 3292], [3297, 3522, 3528], [3532, 3524, 3172], [3526, 3379, 3174], [3506, 3520, 3068], [3534, 3533, 3176], [3536, 3523, 3173], [3177, 3534, 3176], [3177, 3178, 3534], [3178, 3069, 3535], [3532, 3172, 3067], [3441, 3542, 3298], [3506, 3544, 3068], [3299, 3541, 3180], [3544, 3073, 3068], [3506, 3073, 3065], [3071, 3507, 3540], [3538, 3507, 3071], [3545, 3532, 3067], [3406, 3545, 3067], [3543, 3302, 3294], [3544, 3068, 3073], [3073, 3506, 3065], [3542, 3441, 3179], [3546, 3542, 3179], [3180, 3541, 3072], [3406, 3300, 3545], [3303, 3072, 3548], [3546, 3179, 3549], [3485, 3073, 3508], [3073, 3485, 3508], [3551, 3545, 3300], [3550, 3304, 3302], [3550, 3302, 3543], [3300, 3074, 3551], [3553, 3551, 3074], [3442, 3039, 3549], [3555, 3039, 3306], [3554, 3039, 3555], [3304, 3552, 3184], [3556, 3074, 3076], [3556, 3553, 3074], [3307, 3303, 3548], [3306, 3039, 3555], [3184, 3552, 3558], [3548, 3557, 3307], [3039, 3306, 3555], [3493, 3555, 3306], [3493, 3560, 3555], [3562, 3184, 3559], [3556, 3076, 3486], [3561, 3556, 3486], [3493, 3188, 3560], [3562, 3310, 3443], [3312, 3564, 3187], [3312, 3565, 3564], [3486, 3478, 3561], [3041, 3566, 3188], [3310, 3567, 3043], [3562, 3567, 3310], [3311, 3509, 3568], [3311, 3568, 3312], [3040, 3042, 3080], [3509, 3311, 3568], [3311, 3509, 3568], [3187, 3564, 3479], [3564, 3572, 3479], [3571, 3509, 3311], [3571, 3311, 3444], [3571, 3444, 3081], [3494, 3578, 3081], [3578, 3575, 3081], [3481, 3570, 3478], [3566, 3041, 3576], [3043, 3577, 3190], [3583, 3085, 3582], [3315, 3085, 3583], [3083, 3578, 3494], [3083, 3584, 3578], [3445, 3587, 3576], [3587, 3445, 3087], [3445, 3084, 3087], [3585, 3446, 3086], [3586, 3449, 3192], [3590, 3449, 3586], [3086, 3425, 3589], [3593, 3449, 3590], [3589, 3425, 3592], [3449, 3593, 3088], [3592, 3425, 3487], [3594, 3487, 3596], [3592, 3487, 3594], [3487, 3450, 3596], [3426, 3495, 3591], [3316, 3588, 3089], [3597, 3424, 3318], [3089, 3588, 3598], [3760, 3426, 3591], [3597, 3318, 3600], [3599, 3317, 3602], [3600, 3318, 3451], [3452, 3201, 3426], [3603, 3089, 3598], [3452, 3601, 3510], [3606, 3600, 3451], [3601, 3452, 3605], [3208, 3510, 3604], [3045, 3200, 3608], [3451, 3203, 3606], [3608, 3611, 3045], [3610, 3202, 3612], [3606, 3203, 3613], [3614, 3322, 3603], [3604, 3616, 3208], [3482, 3511, 3609], [3612, 3323, 3324], [3093, 3615, 3096], [3096, 3615, 3098], [3617, 3324, 3327], [3609, 3204, 3618], [3204, 3047, 3618], [3621, 3407, 3097], [3617, 3327, 3623], [3331, 3453, 3620], [3619, 3624, 3333], [3626, 3407, 3621], [3328, 3619, 3333], [3627, 3331, 3620], [3618, 3047, 3332], [3618, 3332, 3629], [3454, 3331, 3627], [3626, 3100, 3407], [3632, 3332, 3455], [3631, 3218, 3626], [3629, 3332, 3632], [3337, 3633, 3214], [3339, 3630, 3636], [3339, 3636, 3457], [3105, 3338, 3634], [3632, 3455, 3458], [3632, 3458, 3640], [3631, 3103, 3218], [3105, 3634, 3639], [3642, 3103, 3631], [3643, 3105, 3639], [3642, 3644, 3103], [3638, 3340, 3496], [3496, 3645, 3638], [3342, 3105, 3643], [3104, 3343, 3641], [3457, 3637, 3646], [3640, 3458, 3497], [3343, 3648, 3641], [3650, 3640, 3497], [3225, 3498, 3644], [3457, 3646, 3110], [3646, 3460, 3110], [3460, 3646, 3649], [3051, 3225, 3651], [3649, 3646, 3460], [3653, 3342, 3652], [3765, 3656, 3500], [3656, 3657, 3500], [3658, 3650, 3499], [3343, 3462, 3655], [3460, 3765, 3386], [3386, 3765, 3500], [3657, 3658, 3499], [3500, 3657, 3512], [3512, 3657, 3499], [3659, 3231, 3228], [3488, 3512, 3657], [3501, 3512, 3499], [3657, 3512, 3488], [3655, 3226, 3116], [3231, 3660, 3396], [3662, 3116, 3428], [3767, 3662, 3428], [3665, 3121, 3664], [3663, 3665, 3664], [3665, 3666, 3122], [3489, 3122, 3666], [3489, 3666, 3128], [3767, 3428, 3430], [3767, 3430, 3667], [3670, 3433, 3668], [3671, 3669, 3430], [3417, 3513, 3670], [3430, 3490, 3671], [3671, 3490, 3669], [3430, 3470, 3490], [3417, 3669, 3490], [3674, 3354, 3352], [3053, 3354, 3676], [3680, 3419, 3245], [3679, 3419, 3680], [3419, 3679, 3355], [3136, 3053, 3676], [3678, 3356, 3683], [3140, 3682, 3418], [3418, 3682, 3677], [3683, 3356, 3357], [3679, 3686, 3355], [3436, 3136, 3685], [3436, 3685, 3684], [3140, 3689, 3682], [3687, 3250, 3420], [3690, 3250, 3687], [3358, 3691, 3688], [3692, 3355, 3686], [3693, 3359, 3361], [3691, 3359, 3693], [3695, 3689, 3140], [3355, 3692, 3141], [3695, 3140, 3471], [3362, 3141, 3696], [3263, 3058, 3769], [3698, 3697, 3058], [3695, 3502, 3699], [3695, 3471, 3502], [3698, 3148, 3472], [3263, 3701, 3057], [3057, 3701, 3702], [3702, 3473, 3057], [3699, 3502, 3703], [3363, 3704, 3705], [3266, 3704, 3363], [3514, 3698, 3472], [3707, 3703, 3502], [3709, 3267, 3706], [3364, 3706, 3267], [3365, 3150, 3710], [3710, 3150, 3267], [3703, 3707, 3502], [3711, 3152, 3439], [3491, 3703, 3502], [3153, 3714, 3503], [3715, 3491, 3504], [3715, 3504, 3717], [3491, 3483, 3718], [3491, 3718, 3483], [3474, 3718, 3491], [3474, 3421, 3718], [3367, 3269, 3720], [3483, 3491, 3718], [3474, 3421, 3718], [3718, 3421, 3474], [3483, 3718, 3504], [3718, 3717, 3504], [3368, 3155, 3721], [3483, 3718, 3421], [3156, 3723, 3157], [3483, 3484, 3718], [3718, 3484, 3725], [3724, 3272, 3157], [3370, 3273, 3728], [3725, 3484, 3729], [3729, 3484, 3476], [3728, 3730, 3370], [3729, 3505, 3732], [3729, 3476, 3505], [3735, 3492, 3372], [3731, 3736, 3159], [3736, 3404, 3159], [3734, 3372, 3737], [3735, 3372, 3734], [3492, 3735, 3738], [3732, 3505, 3739], [3422, 3739, 3505], [3737, 3060, 3740], [3741, 3739, 3477], [3477, 3739, 3422], [3277, 3404, 3742], [3738, 3168, 3492], [3741, 3477, 3743], [3477, 3423, 3743], [3770, 3062, 3744], [3062, 3744, 3282], [3742, 3279, 3277], [3281, 3749, 3169], [3281, 3748, 3749], [3744, 3062, 3375], [3168, 3751, 3283], [3751, 3748, 3283], [3283, 3748, 3281], [3169, 3749, 3750], [3169, 3750, 3375], [3752, 3278, 3742], [3752, 3753, 3278], [3376, 3754, 3374], [3278, 3753, 3377], [3288, 3516, 3515], [3521, 3171, 3292], [3522, 3293, 3519], [3526, 3292, 3379], [3289, 3517, 3529], [3289, 3440, 3517], [3297, 3528, 3069], [3069, 3528, 3535], [3537, 3294, 3515], [3771, 3065, 3175], [3175, 3071, 3771], [3071, 3070, 3538], [3299, 3296, 3539], [3539, 3296, 3530], [3539, 3541, 3299], [3537, 3543, 3294], [3506, 3068, 3544], [3072, 3541, 3547], [3072, 3547, 3548], [3179, 3442, 3549], [3554, 3549, 3039], [3184, 3558, 3559], [3562, 3310, 3184], [3560, 3188, 3757], [3313, 3563, 3569], [3080, 3573, 3189], [3758, 3573, 3080], [3568, 3565, 3312], [3561, 3478, 3570], [3042, 3573, 3080], [3042, 3759, 3573], [3042, 3573, 3759], [3313, 3569, 3574], [3042, 3189, 3573], [3575, 3571, 3081], [3191, 3313, 3574], [3479, 3572, 3579], [3580, 3570, 3481], [3480, 3479, 3579], [3581, 3191, 3574], [3083, 3315, 3583], [3584, 3083, 3583], [3582, 3085, 3585], [3446, 3585, 3085], [3495, 3579, 3591], [3580, 3424, 3597], [3087, 3595, 3587], [3087, 3599, 3595], [3087, 3317, 3599], [3601, 3426, 3760], [3452, 3426, 3601], [3601, 3761, 3604], [3482, 3602, 3317], [3601, 3604, 3510], [3601, 3605, 3452], [3602, 3482, 3609], [3200, 3202, 3608], [3202, 3607, 3608], [3614, 3325, 3322], [3612, 3324, 3617], [3609, 3511, 3204], [3328, 3325, 3614], [3098, 3615, 3620], [3614, 3619, 3328], [3613, 3203, 3622], [3329, 3384, 3622], [3625, 3327, 3048], [3338, 3333, 3763], [3627, 3630, 3454], [3100, 3626, 3218], [3625, 3048, 3635], [3048, 3216, 3635], [3641, 3635, 3104], [3637, 3457, 3636], [3337, 3340, 3638], [3635, 3216, 3104], [3632, 3640, 3764], [3498, 3103, 3644], [3647, 3225, 3644], [3496, 3051, 3645], [3649, 3460, 3646], [3645, 3051, 3651], [3460, 3649, 3765], [3657, 3766, 3650], [3657, 3650, 3658], [3656, 3765, 3766], [3656, 3766, 3657], [3659, 3228, 3654], [3660, 3231, 3659], [3662, 3661, 3116], [3660, 3663, 3396], [3767, 3661, 3662], [3121, 3663, 3664], [3668, 3666, 3768], [3433, 3666, 3668], [3128, 3666, 3433], [3430, 3669, 3667], [3513, 3433, 3670], [3513, 3670, 3417], [3417, 3670, 3669], [3352, 3353, 3673], [3353, 3138, 3673], [3679, 3680, 3684], [3684, 3680, 3245], [3136, 3676, 3681], [3687, 3435, 3677], [3685, 3136, 3681], [3420, 3435, 3687], [3357, 3358, 3683], [3358, 3359, 3691], [3361, 3142, 3694], [3142, 3690, 3694], [3250, 3690, 3142], [3141, 3692, 3696], [3058, 3697, 3769], [3263, 3769, 3701], [3364, 3363, 3705], [3365, 3710, 3708], [3267, 3709, 3710], [3711, 3439, 3365], [3711, 3365, 3708], [3711, 3712, 3152], [3153, 3152, 3712], [3491, 3715, 3703], [3153, 3712, 3713], [3153, 3713, 3714], [3503, 3714, 3716], [3716, 3720, 3269], [3269, 3503, 3716], [3722, 3368, 3721], [3723, 3156, 3368], [3723, 3368, 3722], [3724, 3157, 3723], [3726, 3272, 3724], [3272, 3726, 3273], [3273, 3726, 3727], [3732, 3725, 3729], [3731, 3159, 3475], [3730, 3276, 3370], [3730, 3733, 3276], [3475, 3733, 3731], [3736, 3742, 3404], [3770, 3744, 3062], [3744, 3746, 3282], [3744, 3375, 3750], [3168, 3745, 3751], [3278, 3279, 3742], [3423, 3378, 3755], [3284, 3743, 3756], [3284, 3756, 3755], [3754, 3376, 3377], [3378, 3284, 3755], [3521, 3292, 3525], [3771, 3506, 3065], [3538, 3289, 3529], [3178, 3535, 3534], [3771, 3071, 3540], [3757, 3188, 3566], [3758, 3080, 3573], [3572, 3564, 3565], [3568, 3509, 3571], [3577, 3043, 3567], [3192, 3190, 3577], [3481, 3424, 3580], [3088, 3593, 3596], [3450, 3088, 3596], [3202, 3610, 3607], [3615, 3093, 3611], [3621, 3097, 3616], [3762, 3609, 3618], [3627, 3620, 3779], [3618, 3629, 3772], [3384, 3628, 3622], [3762, 3618, 3772], [3773, 3772, 3629], [3773, 3629, 3632], [3628, 3214, 3633], [3633, 3337, 3638], [3773, 3632, 3764], [3766, 3764, 3640], [3645, 3651, 3647], [3649, 3646, 3765], [3650, 3766, 3640], [3343, 3655, 3648], [3655, 3116, 3661], [3663, 3664, 3665], [3669, 3767, 3667], [3352, 3673, 3672], [3677, 3435, 3418], [3693, 3361, 3694], [3364, 3705, 3706], [3719, 3367, 3720], [3155, 3719, 3721], [3155, 3367, 3719], [3273, 3727, 3728], [3744, 3741, 3746], [3770, 3741, 3744], [3754, 3377, 3753], [3296, 3527, 3530], [3296, 3295, 3527], [3526, 3174, 3531], [3174, 3176, 3531], [3176, 3533, 3531], [3778, 3571, 3575], [3579, 3572, 3565], [3575, 3578, 3778], [3586, 3192, 3577], [3191, 3581, 3588], [3595, 3599, 3587], [3760, 3591, 3786], [3601, 3760, 3786], [3634, 3338, 3763], [3637, 3636, 3646], [3647, 3644, 3645], [3646, 3780, 3765], [3766, 3765, 3764], [3765, 3780, 3764], [3781, 3664, 3663], [3665, 3664, 3781], [3670, 3789, 3669], [3695, 3682, 3689], [3703, 3695, 3699], [3716, 3714, 3774], [3743, 3746, 3741], [3750, 3770, 3744], [3754, 3782, 3747], [3784, 3783, 3775], [3555, 3549, 3554], [3560, 3757, 3566], [3565, 3785, 3579], [3763, 3333, 3624], [3787, 3636, 3630], [3787, 3630, 3627], [3636, 3788, 3646], [3789, 3767, 3669], [3670, 3668, 3768], [3699, 3682, 3695], [3725, 3717, 3718], [3791, 3790, 3725], [3791, 3725, 3732], [3741, 3791, 3739], [3810, 3770, 3750], [3812, 3752, 3811], [3742, 3811, 3752], [3812, 3753, 3752], [3775, 3793, 3784], [3541, 3548, 3547], [3555, 3794, 3549], [3568, 3814, 3785], [3816, 3778, 3578], [3591, 3579, 3785], [3589, 3592, 3796], [3591, 3785, 3786], [3600, 3797, 3597], [3798, 3599, 3602], [3621, 3616, 3801], [3615, 3802, 3620], [3639, 3634, 3643], [3644, 3642, 3631], [3788, 3803, 3646], [3780, 3646, 3803], [3780, 3803, 3764], [3764, 3803, 3773], [3670, 3768, 3789], [3687, 3677, 3682], [3695, 3703, 3699], [3698, 3701, 3769], [3774, 3806, 3716], [3715, 3717, 3806], [3807, 3736, 3731], [3791, 3732, 3739], [3747, 3809, 3740], [3747, 3782, 3754], [3756, 3743, 3755], [3792, 3517, 3518], [3520, 3506, 3516], [3541, 3539, 3530], [3540, 3507, 3538], [3543, 3537, 3515], [3813, 3560, 3566], [3565, 3568, 3785], [3594, 3796, 3592], [3798, 3587, 3599], [3761, 3601, 3817], [3603, 3598, 3799], [3819, 3609, 3762], [3772, 3819, 3762], [3787, 3627, 3779], [3636, 3821, 3788], [3820, 3772, 3803], [3803, 3772, 3773], [3641, 3648, 3804], [3661, 3822, 3655], [3661, 3767, 3823], [3665, 3781, 3824], [3666, 3665, 3824], [3789, 3823, 3767], [3676, 3685, 3681], [3825, 3699, 3703], [3805, 3825, 3703], [3698, 3769, 3697], [3712, 3711, 3708], [3703, 3715, 3774], [3774, 3715, 3806], [3790, 3806, 3717], [3791, 3770, 3826], [3741, 3770, 3791], [3771, 3540, 3507], [3827, 3530, 3541], [3828, 3559, 3777], [3570, 3795, 3561], [3568, 3571, 3778], [3568, 3778, 3814], [3588, 3581, 3815], [3786, 3817, 3601], [3818, 3602, 3609], [3829, 3818, 3609], [3611, 3608, 3800], [3779, 3620, 3802], [3819, 3829, 3609], [3820, 3819, 3772], [3619, 3763, 3624], [3636, 3787, 3821], [3788, 3820, 3803], [3644, 3631, 3830], [3633, 3638, 3645], [3648, 3655, 3822], [3823, 3822, 3661], [3686, 3679, 3684], [3699, 3825, 3682], [3825, 3699, 3805], [3825, 3805, 3699], [3790, 3717, 3725], [3810, 3749, 3831], [3750, 3749, 3810], [3541, 3530, 3827], [3536, 3542, 3523], [3832, 3542, 3546], [3828, 3775, 3783], [3776, 3775, 3828], [3777, 3776, 3828], [3559, 3828, 3833], [3548, 3834, 3557], [3566, 3576, 3813], [3814, 3778, 3816], [3814, 3816, 3817], [3602, 3818, 3798], [3936, 3606, 3948], [3835, 3779, 3802], [3779, 3836, 3787], [3787, 3836, 3821], [3821, 3820, 3788], [3804, 3648, 3822], [3663, 3660, 3842], [3768, 3666, 3838], [3805, 3703, 3774], [4008, 3724, 3723], [3736, 3807, 3742], [3520, 3516, 3506], [3519, 3523, 3865], [3793, 3775, 3784], [3828, 3783, 3840], [3894, 3545, 3551], [3832, 3546, 3549], [3777, 3558, 3552], [3559, 3558, 3777], [3895, 3553, 3901], [3909, 3562, 3903], [3813, 3576, 3841], [3785, 3817, 3786], [3785, 3814, 3817], [3817, 3816, 3761], [3607, 3610, 3612], [3836, 3837, 3821], [3819, 3820, 3837], [3821, 3837, 3820], [3644, 3830, 3963], [3660, 3659, 3842], [3824, 3838, 3666], [3823, 3838, 3789], [3838, 3823, 3789], [3838, 3823, 3789], [3838, 3789, 3768], [3687, 3682, 3825], [3843, 3806, 3790], [3747, 3754, 4030], [3857, 3518, 3524], [3857, 3517, 3792], [3870, 3533, 3534], [3876, 3538, 3529], [3538, 3878, 3540], [3873, 3532, 3545], [3541, 3530, 3880], [3542, 3887, 3881], [3892, 3889, 3777], [3828, 3840, 3847], [3900, 3557, 3834], [3558, 3848, 3559], [4039, 3557, 3900], [3562, 3909, 3567], [3570, 3580, 3914], [3576, 3841, 3913], [3841, 3576, 3913], [3916, 3815, 3581], [3917, 3586, 3577], [3578, 3584, 3922], [3593, 3928, 3596], [3596, 3929, 3594], [3935, 3603, 3799], [3606, 3613, 3948], [3950, 3948, 3622], [3850, 3829, 3819], [3948, 3613, 3622], [3951, 3952, 3619], [3950, 3628, 3956], [3950, 3622, 3628], [3954, 3634, 3763], [3633, 3964, 3962], [3633, 3645, 3964], [3644, 3963, 3645], [3966, 3653, 3652], [3977, 3675, 3678], [3985, 3684, 3685], [3683, 3688, 3982], [3986, 3690, 3851], [3993, 3514, 3700], [3712, 3708, 3854], [3855, 3712, 3854], [3714, 3805, 3774], [3843, 3716, 3806], [4009, 3724, 4008], [3726, 4010, 4057], [3826, 3770, 3810], [3839, 3738, 3735], [4026, 3809, 3747], [4023, 4024, 3748], [4033, 3753, 3812], [3520, 3856, 3516], [3857, 3792, 3518], [3528, 3522, 4036], [3515, 3866, 3516], [3515, 3516, 3520], [3860, 3520, 3506], [3863, 3526, 3531], [3865, 3522, 3519], [3866, 3515, 3516], [3863, 3533, 3870], [3517, 3857, 3868], [3531, 3533, 3863], [3867, 3534, 3535], [3868, 3529, 3517], [3532, 3873, 3524], [3530, 3527, 3871], [3530, 3871, 3874], [3865, 3523, 3875], [3878, 3538, 3876], [3878, 3879, 3540], [3506, 3771, 3844], [3881, 3523, 3542], [3784, 3846, 3783], [3846, 3784, 3775], [3515, 3872, 3883], [4060, 3507, 3845], [4037, 3873, 3882], [3776, 3888, 3775], [3890, 3541, 3884], [3887, 3542, 3832], [3543, 3891, 3550], [3541, 3890, 3548], [3783, 3846, 3847], [3783, 3847, 3840], [3889, 3776, 3777], [3549, 3893, 3832], [3894, 3551, 3895], [3777, 3552, 3892], [3895, 3551, 3553], [3900, 3834, 3890], [3898, 3549, 3794], [3828, 3896, 3899], [3899, 3833, 3828], [3833, 3899, 3559], [3899, 3848, 3559], [3558, 3559, 3848], [3555, 3898, 3794], [3562, 3559, 3903], [3898, 3555, 3902], [3555, 3560, 3902], [3904, 3556, 3561], [3904, 3901, 3556], [3907, 3561, 3795], [3569, 3906, 3911], [3569, 3563, 3906], [3560, 3908, 3905], [3813, 3908, 3560], [3841, 3913, 3813], [3910, 3570, 3914], [3581, 3574, 3916], [3917, 3577, 3912], [3577, 3567, 3912], [3913, 3841, 3576], [3585, 3589, 3920], [3922, 3584, 3919], [3589, 3923, 3921], [3796, 3923, 3589], [3924, 3580, 3597], [3586, 3917, 3590], [3917, 3925, 3590], [3816, 3578, 3927], [3594, 3923, 3796], [4061, 3587, 3930], [3597, 3797, 3924], [3588, 3926, 3598], [3927, 3849, 3761], [3927, 3761, 3816], [3596, 3931, 3929], [3797, 3600, 3924], [3933, 3598, 3926], [3932, 3600, 3936], [3934, 3798, 3818], [3939, 3608, 3607], [3937, 3800, 3608], [3800, 3940, 3611], [3607, 3612, 3939], [3941, 3611, 3940], [3615, 3941, 3942], [3802, 3615, 3942], [3829, 3850, 3818], [3612, 3617, 3945], [3819, 3837, 3850], [3951, 3619, 3614], [3836, 3779, 3835], [3836, 4044, 3850], [3836, 3850, 3837], [3763, 3619, 3952], [3626, 3621, 3953], [3623, 3625, 3955], [3958, 3628, 3633], [3625, 3635, 3959], [3631, 3963, 3830], [3961, 3641, 3967], [3652, 3643, 3966], [3968, 3641, 3804], [3969, 3654, 3653], [3969, 3970, 3654], [3659, 3654, 3970], [3973, 3838, 3824], [3972, 3824, 3781], [3672, 3974, 3674], [3975, 3675, 3977], [3675, 3975, 3673], [3976, 3676, 3674], [3981, 3678, 3683], [3687, 3851, 3690], [3694, 3690, 3986], [3984, 3990, 3686], [3688, 3691, 3987], [3988, 3691, 3693], [3692, 3990, 3696], [3700, 3696, 3992], [3992, 3993, 3700], [3853, 3991, 3805], [3991, 3825, 3805], [3706, 3994, 3709], [3709, 3994, 3995], [3709, 3995, 3852], [3709, 3852, 3710], [3997, 3994, 3706], [3705, 3997, 3706], [3698, 3998, 3701], [3698, 3999, 3998], [3708, 3710, 4054], [3708, 4054, 3854], [3999, 3698, 3514], [3853, 3805, 3714], [4001, 3714, 4000], [3714, 3713, 4000], [3721, 3719, 4002], [3716, 3720, 4005], [4005, 3720, 3716], [3721, 4004, 3722], [3721, 4002, 4004], [3722, 4004, 3723], [4007, 3723, 4004], [4012, 4006, 3843], [4009, 3726, 3724], [3843, 3790, 4012], [3791, 4011, 3790], [4011, 3791, 4012], [3826, 4012, 3791], [3734, 4014, 3735], [3737, 4015, 3734], [4017, 3733, 4016], [3733, 3730, 4016], [3731, 4017, 4019], [3731, 3733, 4017], [3826, 3810, 4013], [4017, 3808, 4021], [3839, 4014, 4022], [4013, 3810, 4024], [3839, 3735, 4014], [3810, 4024, 3831], [3810, 3831, 4024], [3738, 3839, 4022], [4059, 3742, 4019], [4026, 3747, 4027], [3751, 3745, 3738], [3751, 3738, 4022], [3831, 3749, 3748], [3831, 3748, 4024], [3742, 3807, 4019], [3751, 4029, 3748], [4029, 4028, 3748], [3742, 4031, 3811], [4030, 3754, 3747], [3811, 4031, 4032], [3811, 4032, 3812], [3753, 4033, 4034], [3747, 3754, 4035], [3754, 3753, 4034], [4035, 3754, 4034], [3856, 3520, 3516], [3864, 3535, 3528], [3866, 3515, 3520], [3865, 3859, 3522], [3860, 3506, 3877], [3521, 3525, 3869], [3870, 3534, 3867], [3872, 3515, 3866], [3861, 3524, 3873], [3881, 3875, 3523], [3543, 3515, 3883], [3844, 3771, 3507], [3540, 3879, 3845], [3540, 3845, 3507], [3873, 3545, 3882], [3882, 3545, 3886], [3541, 3880, 3884], [3891, 3543, 3883], [3891, 3892, 3550], [3892, 3552, 3550], [3896, 3828, 3847], [3897, 3893, 3549], [3897, 3549, 3898], [3834, 3548, 3890], [3574, 3569, 3911], [3567, 3909, 3912], [3584, 3583, 3915], [4061, 3576, 3587], [3928, 3590, 3925], [3928, 3593, 3590], [3923, 3594, 3929], [3934, 3930, 3587], [3600, 3932, 3924], [3604, 3761, 3938], [3600, 3606, 3936], [3800, 3937, 3940], [3850, 4040, 3818], [4068, 3941, 3940], [3604, 3938, 3616], [3612, 3943, 4041], [3941, 3615, 3611], [3943, 3612, 3945], [4043, 4040, 3850], [3802, 3942, 4042], [4042, 3942, 3946], [3946, 4044, 4045], [3946, 4045, 3835], [4043, 3850, 4044], [3801, 3616, 3947], [3617, 3949, 3945], [3836, 3835, 4045], [3623, 3949, 3617], [4045, 4044, 3836], [3944, 3951, 3614], [3947, 3621, 3801], [3763, 3952, 3954], [3949, 3623, 3955], [3956, 3628, 3958], [3625, 3959, 3955], [3635, 3961, 3959], [3957, 3631, 3626], [3958, 3633, 3962], [3957, 3963, 3631], [3964, 3645, 3963], [3966, 3643, 3965], [3961, 3635, 3641], [3643, 3634, 3965], [3969, 3653, 3966], [3968, 3967, 3641], [3970, 3969, 4046], [3822, 3968, 3804], [4063, 3968, 4047], [4047, 3968, 3822], [3971, 3659, 3970], [3971, 3842, 3659], [4048, 4047, 3822], [3663, 3842, 3971], [3663, 3971, 3781], [3973, 4048, 3838], [3838, 4048, 3823], [4048, 3822, 3823], [3824, 3972, 4050], [4050, 3973, 3824], [3974, 3672, 3975], [3672, 3673, 3975], [3980, 3685, 3676], [3678, 3981, 3978], [3683, 3982, 3981], [3985, 3686, 3684], [3694, 3986, 3989], [3687, 4051, 3851], [3990, 3692, 3686], [3691, 3988, 3987], [3694, 3989, 3693], [4051, 3687, 3825], [3991, 4051, 3825], [3992, 3696, 3990], [4052, 4051, 3991], [4051, 4052, 3991], [3991, 4052, 4051], [3702, 3701, 3996], [4052, 3991, 3853], [3705, 3704, 3997], [3704, 4053, 3997], [3993, 3700, 3514], [3514, 3700, 4056], [4000, 4055, 4052], [3514, 4056, 3999], [4001, 4052, 3853], [3712, 3855, 4000], [3853, 3714, 4001], [4000, 3713, 3712], [3719, 3720, 4005], [3716, 4006, 3720], [4006, 3716, 3843], [4010, 3726, 4009], [4012, 3790, 4011], [3728, 3727, 4057], [4015, 4014, 3734], [4018, 4058, 4020], [4017, 3733, 3808], [4019, 3807, 3731], [3808, 3733, 4017], [4018, 4020, 4023], [4023, 4020, 4024], [4020, 4058, 4024], [4024, 4058, 4013], [4025, 3740, 3809], [3810, 3831, 4024], [4025, 3809, 4026], [4023, 3748, 4028], [4029, 3751, 4022], [4027, 3747, 4030], [4032, 4033, 3812], [4030, 3747, 4035], [3860, 3856, 3520], [3524, 3861, 3857], [3858, 3525, 3526], [4036, 3864, 3528], [3522, 3859, 4036], [3856, 3866, 3520], [3867, 3535, 3864], [3506, 3844, 3877], [4060, 3844, 3507], [3885, 3846, 3775], [3882, 3886, 4037], [3888, 3885, 3775], [3888, 3776, 3889], [3886, 3545, 3894], [3553, 3556, 3901], [3848, 3903, 3559], [3557, 4039, 3906], [3563, 3557, 3906], [3902, 3560, 3905], [3904, 3561, 3907], [3795, 3570, 3910], [3916, 3574, 3911], [3582, 3585, 3920], [3919, 3584, 3915], [3920, 3589, 3921], [3914, 3580, 3924], [3916, 3588, 3815], [3578, 3922, 3927], [3916, 3926, 3588], [3931, 3596, 3928], [3930, 3934, 4062], [3934, 3587, 3798], [3799, 3598, 3933], [4062, 3934, 4040], [3818, 4040, 3934], [3608, 3939, 3937], [3614, 3603, 3935], [3615, 3941, 4068], [3939, 3612, 4041], [3935, 3944, 3614], [3802, 4042, 3946], [3835, 3802, 3946], [3621, 3947, 3953], [3634, 3954, 3960], [3965, 3634, 3960], [3969, 3966, 4069], [3971, 4065, 3781], [3972, 3781, 4065], [4071, 4048, 3973], [3972, 4065, 4071], [3976, 3674, 3974], [3977, 3678, 3978], [3979, 3676, 3976], [3676, 3979, 3980], [3983, 3685, 3980], [3685, 3983, 3985], [3982, 3688, 3987], [4053, 3702, 3996], [3704, 3702, 4053], [3993, 4056, 3700], [4000, 4052, 4001], [4055, 4000, 3855], [4002, 3719, 4003], [4005, 3720, 4006], [3727, 3726, 4057], [3826, 4013, 4012], [4016, 3728, 4057], [4015, 3740, 4066], [4015, 3737, 3740], [4021, 3808, 4017], [4014, 4067, 4022], [4066, 3740, 4025], [4067, 4023, 4022], [4018, 4023, 4067], [3742, 4059, 4031], [3526, 3862, 3858], [3526, 3863, 3862], [3527, 3521, 3871], [3869, 3871, 3521], [3876, 3529, 3868], [3880, 3530, 3874], [3887, 3832, 3893], [3907, 3795, 3910], [3908, 3813, 3913], [3582, 3920, 3918], [4061, 3913, 3576], [3930, 4062, 4061], [3941, 3615, 4068], [3938, 3947, 3616], [3626, 3953, 3957], [3959, 3961, 4084], [3967, 3968, 4063], [4063, 4047, 4048], [3973, 4050, 4071], [3972, 4071, 4050], [3686, 3985, 3984], [3988, 3693, 3989], [4005, 4003, 3719], [4008, 3723, 4007], [4005, 4006, 4012], [4016, 3730, 3728], [3869, 3525, 3858], [4078, 3890, 3884], [3935, 3799, 3933], [3938, 3761, 3849], [3942, 3941, 4068], [3946, 3942, 4072], [4072, 4081, 3946], [4073, 4084, 3967], [3969, 4069, 3966], [4073, 3967, 4063], [3970, 4046, 3971], [3994, 3997, 4076], [4077, 4005, 4012], [3847, 3846, 3896], [3582, 3918, 4079], [3921, 4094, 4095], [4040, 4080, 4062], [4081, 4080, 4040], [4081, 4044, 3946], [3957, 4083, 4099], [4084, 3961, 3967], [4069, 3969, 3966], [3971, 4046, 4085], [4063, 4048, 4071], [4070, 4064, 4049], [4075, 4070, 4049], [4087, 4051, 4055], [4055, 4051, 4052], [3701, 3998, 3996], [3855, 4088, 4055], [4088, 4055, 3855], [3993, 4089, 4056], [4029, 4023, 4028], [4022, 4023, 4029], [4034, 4033, 4035], [4270, 3876, 4133], [3844, 4060, 3845], [3844, 3845, 3879], [3905, 3898, 3902], [3583, 3582, 4079], [3915, 3583, 4079], [3920, 3921, 4095], [3914, 3924, 4096], [4098, 4072, 3942], [4040, 4044, 4081], [4044, 4043, 4040], [3949, 4082, 3945], [3957, 4099, 3963], [3955, 3959, 4084], [4100, 4101, 4074], [4101, 4064, 4074], [4086, 3989, 3986], [3990, 3993, 3992], [4053, 4102, 3997], [4054, 3710, 3852], [4088, 3855, 3854], [4088, 3855, 4055], [4032, 4031, 4059], [3856, 3860, 3866], [3866, 3883, 3872], [3885, 3896, 3846], [3903, 3848, 4092], [3903, 4092, 4093], [3898, 3905, 3902], [3909, 3903, 4093], [4079, 3918, 4103], [3915, 4079, 3919], [3929, 4097, 3923], [3931, 4097, 3929], [4040, 4043, 4081], [4043, 4040, 4081], [4044, 4040, 4043], [4044, 4040, 4043], [3952, 3951, 3944], [4082, 3949, 3955], [3950, 3956, 3958], [4105, 4063, 4071], [4064, 4070, 4074], [4087, 4051, 3851], [3851, 4051, 4087], [3997, 4102, 4076], [4087, 4055, 4088], [3999, 4056, 4106], [4010, 4009, 4008], [4013, 4077, 4012], [4016, 4057, 4107], [4058, 4077, 4013], [4030, 4035, 4033], [4090, 3889, 3892], [3891, 4090, 3892], [3891, 3883, 4091], [3906, 4039, 3900], [3904, 3907, 3901], [3918, 3920, 4095], [4083, 3957, 4099], [3965, 3960, 3954], [3964, 3958, 3962], [4104, 4111, 4110], [4046, 3969, 4112], [4101, 4100, 4104], [4065, 4085, 4113], [4065, 3971, 4085], [4113, 4105, 4071], [4113, 4071, 4065], [3979, 3976, 3980], [3983, 3979, 3980], [4051, 4087, 3851], [4087, 3986, 3851], [3993, 4114, 4089], [4077, 4058, 4108], [4132, 3844, 3879], [3876, 3868, 4133], [3909, 4093, 3912], [4152, 3908, 3913], [3932, 3936, 4125], [3942, 4115, 4098], [4068, 3940, 4109], [4100, 4111, 4104], [3966, 3965, 4069], [4116, 4073, 4063], [4116, 4063, 4105], [3983, 3980, 3979], [4108, 4003, 4005], [4108, 4005, 4077], [3860, 4131, 3866], [4118, 3883, 3866], [4138, 3875, 3881], [4120, 3887, 3897], [3897, 3887, 3893], [3902, 3897, 3898], [4103, 3918, 4095], [4068, 4124, 4115], [4109, 4124, 4068], [4068, 4115, 3942], [3947, 3938, 4127], [4116, 4168, 4084], [4069, 3965, 4128], [4170, 4110, 4169], [4170, 4104, 4110], [4116, 4084, 4073], [3969, 4069, 4112], [3977, 3978, 4241], [3984, 3985, 3990], [4088, 4129, 4087], [3990, 3992, 3993], [4058, 4018, 4130], [4016, 4107, 4257], [4066, 4025, 4026], [4026, 4027, 4030], [4131, 3860, 3877], [4117, 3866, 4131], [3879, 3878, 4135], [3881, 3887, 4138], [3887, 4139, 4138], [3874, 3871, 3880], [4120, 4141, 3887], [4142, 3889, 4090], [4121, 3845, 4038], [3897, 3902, 4145], [4204, 3899, 3896], [3901, 3907, 4149], [4093, 4150, 3912], [3914, 4096, 4285], [3925, 4213, 3928], [4288, 3927, 4156], [4109, 4217, 4124], [3940, 4158, 4217], [3940, 3937, 4158], [3937, 3939, 4159], [4041, 3943, 3945], [3950, 3958, 4224], [3965, 3954, 4165], [3958, 3964, 4167], [4069, 4128, 4231], [4069, 4234, 4112], [4046, 4112, 4085], [4116, 4105, 4113], [4171, 4074, 4070], [4238, 4049, 4064], [3974, 3975, 4239], [4245, 3982, 3987], [4247, 3985, 3983], [4175, 3990, 3985], [3986, 4087, 4174], [4176, 4087, 4129], [3854, 4129, 4088], [3996, 3998, 4179], [4089, 4182, 4056], [4183, 4004, 4002], [4010, 4186, 4185], [4057, 4010, 4185], [4187, 4003, 4108], [4015, 4066, 4190], [4030, 4192, 4026], [4262, 4131, 3877], [4262, 3877, 3844], [4194, 3857, 3861], [3844, 4132, 4264], [4196, 3867, 3864], [3858, 4197, 4268], [4133, 3868, 3857], [4134, 4036, 3859], [3859, 4134, 4036], [4132, 3879, 4135], [3865, 4134, 3859], [4138, 3865, 3875], [4136, 3873, 4037], [3871, 4137, 3880], [4139, 3887, 4119], [4118, 3866, 3883], [3866, 4118, 3883], [4200, 3884, 3880], [4090, 3883, 4118], [3885, 3888, 4143], [3888, 4201, 4143], [3845, 4121, 4038], [4144, 3884, 4200], [3897, 4141, 4120], [3897, 4145, 4141], [3883, 4090, 3891], [3885, 4202, 3896], [4091, 3883, 3891], [3897, 4145, 4203], [4146, 4092, 3848], [3848, 3899, 4146], [4205, 3906, 3900], [4148, 3902, 3905], [4207, 3906, 4206], [3908, 4209, 3905], [3905, 4209, 4208], [4210, 4095, 4280], [4212, 3917, 3912], [4103, 4095, 4210], [3921, 3923, 4286], [3925, 3917, 4213], [3927, 3922, 4156], [3933, 3926, 4154], [3931, 3928, 4123], [4061, 4062, 4219], [3849, 3927, 4215], [4214, 4124, 4218], [4062, 4080, 4219], [4124, 4214, 4115], [4217, 4109, 3940], [4219, 4080, 4081], [3935, 4289, 4126], [3935, 3933, 4289], [3937, 4159, 4158], [4080, 4219, 4081], [4161, 4080, 4081], [4126, 3944, 3935], [3944, 4295, 4163], [4295, 3944, 4163], [3945, 4082, 4221], [3952, 3944, 4295], [4222, 3953, 3947], [3954, 3952, 4223], [4224, 3958, 4225], [4165, 3954, 4223], [3953, 4222, 3957], [4226, 3955, 4084], [4225, 3958, 4167], [4228, 4111, 4227], [3963, 4099, 4166], [3964, 3963, 4167], [4110, 4111, 4228], [3965, 4165, 4229], [4230, 4227, 4111], [4110, 4228, 4169], [4128, 3965, 4229], [4128, 4229, 4231], [4232, 4084, 4168], [4168, 4116, 4232], [4116, 4233, 4232], [4085, 4112, 4236], [4235, 4116, 4113], [4100, 4074, 4171], [4085, 4236, 4113], [4236, 4235, 4113], [4299, 4070, 4075], [4238, 4172, 4049], [4075, 4049, 4172], [3976, 3974, 4173], [4243, 3988, 3989], [4242, 3988, 4243], [4086, 3986, 4174], [3982, 4246, 4301], [3982, 4301, 3981], [4246, 3982, 4245], [4174, 4087, 4176], [4249, 4250, 4102], [4250, 4076, 4102], [4177, 4053, 3996], [4249, 4102, 4053], [4251, 4303, 3994], [4252, 4129, 3854], [4253, 4178, 3854], [4253, 3854, 4054], [4106, 4056, 4254], [4183, 4002, 4184], [4255, 4007, 4183], [4255, 4307, 4008], [4256, 4057, 4185], [4108, 4003, 4187], [4108, 4187, 4077], [4187, 4108, 4077], [4018, 4188, 4189], [4018, 4067, 4188], [4067, 4014, 4189], [4016, 4191, 4017], [4015, 4308, 4014], [4019, 4191, 4260], [4019, 4017, 4191], [4261, 4066, 4026], [4263, 4262, 3844], [4264, 4263, 3844], [4194, 3861, 4195], [4265, 3867, 4267], [4136, 4195, 3873], [3858, 3862, 4197], [3863, 4266, 4197], [4265, 4266, 3870], [4196, 3864, 4036], [4036, 4198, 4196], [4133, 3857, 4194], [4134, 3859, 4036], [4269, 3869, 3858], [3871, 4269, 4137], [3871, 3869, 4269], [4138, 4199, 3865], [4134, 3865, 4199], [3871, 4271, 4137], [3871, 4137, 4271], [4138, 4139, 4119], [4118, 3866, 4117], [4136, 4037, 4272], [3880, 4137, 4140], [4272, 4037, 3886], [4141, 4119, 3887], [4200, 3880, 4140], [4142, 4273, 3889], [4090, 4118, 4142], [4119, 4141, 3887], [3887, 4141, 4119], [3887, 4120, 4141], [3887, 4141, 4120], [4144, 4078, 3884], [4143, 4202, 3885], [4141, 4120, 3897], [4141, 3897, 4120], [3890, 4144, 4276], [3890, 4078, 4144], [4203, 4145, 3897], [3900, 3890, 4205], [4276, 4205, 3890], [4202, 4204, 3896], [4146, 4147, 4092], [4146, 3899, 4204], [4205, 4207, 3906], [4148, 3905, 4208], [4093, 4092, 4147], [4207, 4206, 3906], [4206, 3906, 4207], [3911, 3906, 4279], [4151, 3907, 3910], [4150, 4212, 3912], [4282, 4280, 4094], [4094, 4280, 4095], [4284, 3916, 3911], [3921, 4282, 4094], [4153, 3922, 3919], [4154, 3916, 4284], [4152, 3913, 4061], [3926, 3916, 4154], [4212, 4213, 3917], [3922, 4153, 4156], [4285, 3924, 4155], [4122, 4061, 4219], [4115, 4214, 4287], [3923, 4157, 4286], [4215, 4288, 4156], [3932, 4155, 3924], [4098, 4115, 4216], [4097, 4157, 3923], [4290, 3931, 4123], [4097, 4291, 4157], [3938, 3849, 4160], [4072, 4098, 4216], [4160, 3849, 4215], [4161, 4072, 4216], [4161, 4219, 4080], [4159, 3939, 4162], [4081, 4072, 4161], [3939, 4041, 4162], [3943, 4041, 4293], [4162, 3943, 4293], [4041, 3943, 4162], [4293, 4041, 3945], [4295, 3944, 4126], [4163, 3944, 4295], [3936, 3948, 4294], [4296, 4293, 3945], [3944, 4163, 4295], [3947, 4127, 4220], [4221, 4296, 3945], [4164, 4221, 4082], [4223, 3952, 4295], [4294, 3950, 4297], [4082, 3955, 4164], [4222, 4166, 3957], [4164, 3955, 4226], [4099, 3957, 4166], [4167, 3963, 4166], [4226, 4084, 4232], [4069, 4231, 4234], [4235, 4233, 4116], [4236, 4112, 4234], [4101, 4170, 4237], [4101, 4104, 4170], [4237, 4238, 4101], [4070, 4299, 4171], [4064, 4101, 4238], [4299, 4172, 4238], [4299, 4075, 4172], [4173, 3974, 4239], [4240, 3976, 4173], [4241, 3975, 3977], [4086, 4243, 3989], [4174, 4243, 4086], [4301, 4241, 3978], [3980, 3976, 4244], [4244, 4300, 4240], [4244, 3976, 4300], [3981, 4301, 3978], [4245, 3988, 4242], [3987, 3988, 4245], [4175, 3985, 4248], [4250, 3994, 4076], [4177, 4249, 4053], [3992, 3990, 4248], [4248, 3990, 4175], [4178, 4253, 4252], [3992, 4180, 3993], [3995, 4303, 3852], [4303, 4304, 3852], [4177, 3996, 4179], [4253, 3852, 4304], [4253, 4054, 3852], [4179, 3998, 3999], [4180, 4181, 4114], [4180, 4114, 3993], [4306, 3999, 4106], [4106, 4254, 4306], [4056, 4182, 4254], [4114, 4181, 4089], [4181, 4182, 4089], [4007, 4004, 4183], [4002, 4003, 4184], [4008, 4007, 4255], [4307, 4010, 4008], [4307, 4186, 4010], [4057, 4256, 4257], [4187, 4130, 4188], [4058, 4130, 4187], [4058, 4187, 4108], [4016, 4257, 4258], [4067, 4189, 4188], [4189, 4014, 4308], [4191, 4016, 4258], [4015, 4190, 4259], [4015, 4259, 4308], [4192, 4261, 4026], [4030, 4309, 4192], [4019, 4310, 4059], [4033, 4193, 4030], [4030, 4193, 4309], [4032, 4059, 4310], [4193, 4033, 4311], [4032, 4310, 4311], [4195, 3861, 3873], [4266, 3863, 3870], [4265, 3870, 3867], [3862, 3863, 4197], [4269, 3858, 4268], [4139, 4138, 4119], [4139, 4119, 4141], [4137, 4271, 4140], [3888, 3889, 4201], [4201, 3889, 4273], [4272, 3894, 4274], [4272, 3886, 3894], [4141, 4145, 4203], [3894, 3895, 4275], [4274, 3894, 4275], [4203, 4145, 3902], [3902, 4148, 4203], [4147, 4146, 4322], [3895, 3901, 4277], [4275, 3895, 4277], [3901, 4149, 4277], [4093, 4147, 4278], [3906, 4206, 4207], [4149, 3907, 4151], [3906, 4207, 4279], [4079, 4103, 4211], [4281, 4079, 4211], [4151, 3910, 3914], [4209, 3908, 4152], [3919, 4079, 4283], [4153, 3919, 4283], [4314, 4152, 4061], [4282, 3921, 4286], [4096, 3924, 4285], [4061, 4122, 4314], [4287, 4216, 4115], [4289, 3933, 4154], [4124, 4217, 4218], [4215, 3927, 4288], [4097, 3931, 4291], [4127, 3938, 4220], [4222, 3947, 4220], [4294, 3948, 3950], [4224, 4297, 3950], [4232, 4315, 4226], [4231, 4317, 4234], [4230, 4111, 4298], [4316, 4232, 4233], [4298, 4111, 4100], [4235, 4316, 4233], [4100, 4171, 4298], [3975, 4241, 4239], [4240, 4300, 3976], [4244, 3983, 3980], [4302, 3985, 4247], [4302, 4248, 3985], [4252, 4176, 4129], [3994, 4250, 4251], [4178, 4252, 3854], [4303, 3995, 3994], [4318, 4252, 4253], [3992, 4248, 4180], [4179, 3999, 4305], [4184, 4003, 4108], [4187, 4184, 4108], [4107, 4057, 4257], [4130, 4018, 4188], [4018, 4189, 4188], [4190, 4066, 4261], [4019, 4260, 4310], [4033, 4032, 4311], [3867, 4196, 4267], [4198, 4036, 4134], [4141, 4319, 4139], [4322, 4146, 4204], [4322, 4204, 4202], [4322, 4323, 4147], [4150, 4093, 4278], [4211, 4103, 4210], [4284, 3911, 4279], [4151, 3914, 4313], [4283, 4079, 4281], [4313, 3914, 4285], [4287, 4214, 4325], [4123, 3928, 4213], [4214, 4218, 4325], [4125, 4155, 3932], [4291, 3931, 4290], [4292, 4125, 3936], [4161, 4216, 4219], [4292, 3936, 4294], [4164, 4226, 4315], [3983, 4244, 4247], [4176, 4243, 4174], [4318, 4253, 4304], [4304, 4303, 4318], [4305, 3999, 4306], [4188, 4184, 4187], [4192, 4193, 4326], [4193, 4192, 4309], [3878, 3876, 4135], [4135, 3876, 4270], [4144, 4200, 4140], [4141, 4203, 4320], [4315, 4327, 4164], [4231, 4229, 4165], [4316, 4315, 4232], [4236, 4317, 4329], [4329, 4316, 4235], [4234, 4317, 4236], [4236, 4329, 4235], [4301, 4369, 4370], [4186, 4307, 4342], [4147, 4346, 4324], [4287, 4325, 4331], [4217, 4334, 4325], [4333, 4216, 4287], [4158, 4159, 4335], [4159, 4162, 4358], [4336, 4126, 4289], [4220, 3938, 4160], [4165, 4223, 4337], [4231, 4165, 4328], [4361, 4315, 4316], [4365, 4298, 4171], [4300, 4244, 4240], [4243, 4176, 4252], [4243, 4252, 4368], [4185, 4186, 4342], [4257, 4372, 4258], [4264, 4131, 4262], [4264, 4262, 4263], [4343, 4134, 4199], [4141, 4320, 4319], [4118, 4330, 4344], [4330, 4118, 4117], [4205, 4276, 4144], [4147, 4324, 4348], [4278, 4147, 4348], [4207, 4349, 4279], [4279, 4349, 4284], [4349, 4352, 4284], [4282, 4210, 4280], [4283, 4281, 4353], [4287, 4331, 4333], [4212, 4354, 4213], [4282, 4286, 4332], [4152, 4314, 4122], [4217, 4325, 4218], [4213, 4290, 4123], [4335, 4159, 4358], [4336, 4289, 4357], [4295, 4126, 4336], [4220, 4160, 4359], [4166, 4222, 4360], [4224, 4225, 4167], [4231, 4328, 4362], [4227, 4230, 4363], [4317, 4231, 4362], [4317, 4362, 4364], [4317, 4364, 4329], [4230, 4298, 4363], [4365, 4363, 4298], [4366, 4365, 4171], [4368, 4245, 4242], [4367, 4245, 4368], [4367, 4369, 4245], [4241, 4301, 4370], [4369, 4246, 4245], [4369, 4301, 4246], [4368, 4242, 4243], [4177, 4179, 4339], [4340, 4250, 4249], [4256, 4185, 4371], [4183, 4184, 4188], [4188, 4189, 4373], [4372, 4191, 4258], [4193, 4192, 4326], [4311, 4310, 4193], [4271, 4137, 4269], [4142, 4118, 4344], [4205, 4144, 4347], [4202, 4321, 4204], [4321, 4386, 4204], [4323, 4346, 4147], [4376, 4324, 4346], [4376, 4346, 4375], [4377, 4351, 4350], [4377, 4350, 4331], [4154, 4284, 4356], [4284, 4352, 4356], [4325, 4377, 4331], [4355, 4282, 4332], [4357, 4289, 4154], [4286, 4157, 4332], [4158, 4334, 4217], [4293, 4296, 4510], [4223, 4295, 4337], [4294, 4297, 4224], [4316, 4364, 4361], [4329, 4364, 4316], [4171, 4299, 4237], [4299, 4238, 4237], [4240, 4173, 4537], [4256, 4371, 4257], [4308, 4373, 4189], [4379, 4138, 4139], [4269, 4268, 4382], [4383, 4196, 4198], [4330, 4117, 4131], [4271, 4269, 4381], [4198, 4134, 4385], [4134, 4343, 4385], [4384, 4202, 4143], [4321, 4202, 4384], [4345, 4144, 4140], [4272, 4274, 4275], [4325, 4334, 4389], [4325, 4389, 4377], [4510, 4162, 4293], [4337, 4295, 4378], [4393, 4391, 4338], [4227, 4338, 4391], [4224, 4167, 4392], [4361, 4390, 4315], [4328, 4165, 4397], [4227, 4363, 4338], [4368, 4318, 4245], [4368, 4252, 4318], [4428, 4425, 4270], [4394, 4374, 4380], [4374, 4394, 4384], [4383, 4198, 4385], [4440, 4272, 4444], [4450, 4438, 4143], [4407, 4282, 4355], [4489, 4213, 4482], [4158, 4396, 4334], [4122, 4219, 4216], [4503, 4358, 4162], [4164, 4327, 4221], [4165, 4337, 4397], [4328, 4397, 4362], [4364, 4390, 4361], [4529, 4363, 4365], [4539, 4244, 4300], [4245, 4367, 4368], [4318, 4303, 4246], [4183, 4373, 4559], [4373, 4183, 4188], [4259, 4190, 4564], [4618, 4418, 4571], [4423, 4194, 4195], [4419, 4131, 4264], [4425, 4132, 4135], [4195, 4136, 4427], [4429, 4428, 4270], [4434, 4319, 4320], [4197, 4266, 4572], [4432, 4142, 4344], [4269, 4382, 4381], [4441, 4382, 4268], [4267, 4196, 4399], [4196, 4383, 4399], [4384, 4394, 4401], [4343, 4437, 4446], [4450, 4143, 4201], [4444, 4272, 4454], [4144, 4345, 4452], [4456, 4323, 4322], [4323, 4457, 4458], [4455, 4203, 4403], [4202, 4204, 4462], [4405, 4121, 4312], [4467, 4387, 4350], [4150, 4278, 4470], [4471, 4349, 4207], [4278, 4348, 4470], [4469, 4472, 4350], [4395, 4472, 4350], [4483, 4377, 4389], [4481, 4377, 4483], [4355, 4407, 4388], [4407, 4355, 4388], [4480, 4313, 4285], [4355, 4332, 4408], [4216, 4487, 4333], [4356, 4357, 4154], [4122, 4216, 4333], [4213, 4489, 4290], [4332, 4157, 4409], [4500, 4358, 4503], [4160, 4215, 4502], [4291, 4501, 4505], [4336, 4506, 4508], [4512, 4510, 4296], [4511, 4292, 4294], [4516, 4294, 4224], [4337, 4518, 4397], [4327, 4315, 4390], [4362, 4397, 4412], [4527, 4338, 4363], [4529, 4527, 4363], [4540, 4244, 4539], [4246, 4245, 4318], [4177, 4415, 4414], [4306, 4549, 4305], [4180, 4551, 4181], [4550, 4306, 4254], [4554, 4181, 4341], [4183, 4558, 4255], [4568, 4260, 4566], [4310, 4260, 4569], [4566, 4192, 4570], [4418, 4138, 4571], [4420, 4264, 4132], [4420, 4419, 4264], [4421, 4199, 4138], [4422, 4379, 4139], [4139, 4319, 4422], [4420, 4132, 4425], [4419, 4426, 4131], [4424, 4195, 4427], [4425, 4135, 4270], [4429, 4270, 4133], [4430, 4199, 4421], [4398, 4380, 4374], [4400, 4433, 4344], [4430, 4437, 4343], [4343, 4199, 4430], [4443, 4434, 4320], [4374, 4384, 4431], [4438, 4431, 4384], [4330, 4400, 4344], [4426, 4439, 4131], [4265, 4442, 4436], [4267, 4442, 4265], [4380, 4401, 4394], [4438, 4384, 4143], [4439, 4330, 4131], [4445, 4381, 4382], [4445, 4382, 4441], [4446, 4383, 4385], [4574, 4446, 4383], [4385, 4343, 4446], [4448, 4142, 4447], [4439, 4400, 4330], [4401, 4449, 4384], [4384, 4453, 4321], [4345, 4140, 4452], [4346, 4323, 4458], [4346, 4459, 4375], [4403, 4203, 4148], [4461, 4321, 4453], [4386, 4321, 4461], [4456, 4202, 4462], [4322, 4202, 4456], [4459, 4402, 4376], [4459, 4376, 4375], [4347, 4144, 4460], [4405, 4312, 4121], [4454, 4277, 4463], [4461, 4204, 4386], [4461, 4462, 4204], [4404, 4405, 4312], [4404, 4312, 4405], [4205, 4347, 4464], [4403, 4148, 4208], [4205, 4464, 4207], [4350, 4387, 4467], [4467, 4350, 4468], [4467, 4469, 4350], [4466, 4208, 4209], [4350, 4472, 4395], [4211, 4210, 4406], [4475, 4281, 4211], [4475, 4476, 4281], [4212, 4150, 4470], [4476, 4353, 4281], [4210, 4282, 4406], [4313, 4473, 4151], [4331, 4350, 4477], [4477, 4350, 4472], [4209, 4152, 4474], [4474, 4152, 4484], [4407, 4355, 4408], [4334, 4483, 4389], [4152, 4122, 4484], [4213, 4354, 4482], [4333, 4331, 4487], [4156, 4153, 4485], [4155, 4488, 4285], [4334, 4492, 4483], [4492, 4334, 4493], [4334, 4396, 4493], [4491, 4156, 4215], [4216, 4333, 4487], [4491, 4215, 4156], [4155, 4125, 4495], [4493, 4158, 4496], [4489, 4494, 4290], [4409, 4157, 4497], [4156, 4498, 4215], [4290, 4499, 4291], [4215, 4498, 4502], [4157, 4291, 4505], [4125, 4292, 4495], [4336, 4357, 4506], [4503, 4162, 4507], [4411, 4410, 4157], [4162, 4510, 4507], [4359, 4160, 4502], [4509, 4292, 4511], [4295, 4336, 4508], [4515, 4220, 4513], [4511, 4294, 4516], [4221, 4517, 4514], [4221, 4327, 4517], [4337, 4378, 4518], [4222, 4520, 4360], [4523, 4327, 4390], [4392, 4522, 4224], [4360, 4520, 4166], [4390, 4364, 4524], [4167, 4166, 4392], [4362, 4412, 4364], [4391, 4525, 4227], [4412, 4524, 4364], [4413, 4228, 4227], [4527, 4526, 4338], [4529, 4366, 4531], [4529, 4365, 4366], [4237, 4170, 4531], [4171, 4237, 4532], [4171, 4532, 4366], [4535, 4367, 4245], [4367, 4535, 4369], [4241, 4538, 4239], [4370, 4535, 4534], [4370, 4369, 4535], [4539, 4300, 4536], [4300, 4240, 4536], [4540, 4541, 4244], [4251, 4543, 4303], [4248, 4302, 4542], [4544, 4543, 4251], [4545, 4251, 4250], [4546, 4545, 4250], [4180, 4248, 4542], [4340, 4546, 4250], [4339, 4415, 4177], [4414, 4249, 4177], [4249, 4546, 4340], [4339, 4416, 4415], [4414, 4340, 4249], [4549, 4179, 4305], [4414, 4548, 4340], [4542, 4547, 4180], [4550, 4180, 4547], [4550, 4552, 4180], [4552, 4551, 4180], [4306, 4550, 4549], [4553, 4181, 4551], [4554, 4341, 4553], [4341, 4181, 4553], [4254, 4182, 4551], [4181, 4553, 4182], [4554, 4553, 4181], [4555, 4371, 4185], [4255, 4556, 4307], [4555, 4185, 4342], [4557, 4555, 4342], [4561, 4558, 4559], [4556, 4342, 4307], [4559, 4558, 4183], [4555, 4417, 4371], [4417, 4257, 4371], [4257, 4560, 4372], [4417, 4560, 4257], [4308, 4561, 4373], [4561, 4559, 4373], [4560, 4191, 4372], [4562, 4191, 4560], [4562, 4566, 4191], [4566, 4260, 4191], [4567, 4565, 4261], [4567, 4261, 4192], [4570, 4192, 4193], [4138, 4379, 4571], [4423, 4195, 4424], [4429, 4194, 4423], [4133, 4194, 4429], [4398, 4374, 4431], [4433, 4432, 4344], [4435, 4197, 4572], [4266, 4265, 4572], [4436, 4572, 4265], [4401, 4380, 4398], [4438, 4573, 4431], [4427, 4136, 4440], [4268, 4197, 4441], [4197, 4435, 4441], [4447, 4142, 4432], [4442, 4267, 4399], [4450, 4273, 4448], [4273, 4142, 4448], [4445, 4451, 4271], [4271, 4381, 4445], [4399, 4383, 4574], [4201, 4273, 4450], [4320, 4203, 4455], [4140, 4271, 4452], [4272, 4275, 4454], [4323, 4456, 4457], [4460, 4144, 4452], [4458, 4459, 4346], [4454, 4275, 4277], [4348, 4324, 4376], [4348, 4376, 4575], [4277, 4149, 4465], [4466, 4403, 4208], [4465, 4151, 4473], [4465, 4149, 4151], [4466, 4209, 4474], [4350, 4351, 4468], [4475, 4211, 4406], [4352, 4349, 4471], [4473, 4313, 4480], [4351, 4377, 4468], [4407, 4406, 4210], [4468, 4377, 4481], [4482, 4212, 4470], [4283, 4353, 4479], [4283, 4479, 4485], [4153, 4283, 4485], [4487, 4331, 4477], [4285, 4488, 4480], [4484, 4122, 4490], [4491, 4156, 4485], [4396, 4158, 4493], [4332, 4497, 4408], [4332, 4409, 4497], [4499, 4290, 4494], [4158, 4335, 4500], [4409, 4497, 4157], [4291, 4499, 4501], [4157, 4504, 4409], [4504, 4497, 4409], [4335, 4358, 4500], [4505, 4411, 4157], [4411, 4157, 4410], [4296, 4221, 4514], [4295, 4508, 4378], [4512, 4296, 4514], [4220, 4359, 4513], [4515, 4222, 4220], [4579, 4580, 4391], [4580, 4579, 4391], [4520, 4222, 4515], [4521, 4412, 4397], [4523, 4589, 4517], [4591, 4522, 4392], [4392, 4166, 4520], [4227, 4525, 4413], [4519, 4393, 4338], [4169, 4228, 4413], [4169, 4528, 4530], [4170, 4169, 4530], [4532, 4237, 4531], [4532, 4531, 4366], [4173, 4239, 4533], [4533, 4239, 4538], [4246, 4535, 4245], [4247, 4244, 4541], [4246, 4303, 4535], [4303, 4543, 4535], [4542, 4302, 4582], [4251, 4545, 4544], [4179, 4416, 4339], [4548, 4249, 4340], [4556, 4557, 4342], [4561, 4255, 4558], [4563, 4259, 4564], [4564, 4190, 4261], [4567, 4192, 4566], [4569, 4260, 4568], [4570, 4193, 4310], [4310, 4569, 4570], [4422, 4319, 4434], [4136, 4272, 4440], [4442, 4399, 4574], [4574, 4383, 4446], [4443, 4320, 4455], [4453, 4384, 4449], [4584, 4460, 4452], [4575, 4376, 4402], [4463, 4277, 4465], [4467, 4472, 4469], [4348, 4585, 4470], [4406, 4282, 4210], [4478, 4353, 4476], [4352, 4471, 4586], [4353, 4478, 4479], [4354, 4212, 4482], [4356, 4352, 4586], [4586, 4576, 4356], [4122, 4333, 4490], [4357, 4356, 4576], [4357, 4576, 4506], [4496, 4158, 4500], [4513, 4359, 4502], [4508, 4577, 4378], [4378, 4578, 4518], [4521, 4397, 4518], [4521, 4590, 4412], [4523, 4517, 4327], [4580, 4391, 4519], [4580, 4579, 4525], [4523, 4524, 4581], [4523, 4390, 4524], [4391, 4393, 4519], [4590, 4524, 4412], [4170, 4530, 4531], [4537, 4173, 4533], [4550, 4254, 4552], [4254, 4551, 4552], [4308, 4259, 4563], [4308, 4563, 4561], [4564, 4261, 4565], [4401, 4398, 4431], [4427, 4440, 4444], [4383, 4446, 4574], [4271, 4451, 4583], [4271, 4583, 4452], [4464, 4347, 4460], [4207, 4464, 4471], [4469, 4472, 4467], [4473, 4480, 4607], [4282, 4407, 4210], [4486, 4408, 4587], [4490, 4333, 4487], [4577, 4508, 4592], [4508, 4506, 4592], [4157, 4411, 4504], [4577, 4578, 4378], [4612, 4580, 4519], [4579, 4588, 4525], [4581, 4524, 4590], [4525, 4391, 4580], [4537, 4539, 4536], [4241, 4370, 4538], [4538, 4370, 4534], [4536, 4240, 4537], [4582, 4302, 4247], [4249, 4548, 4546], [4179, 4549, 4416], [4182, 4553, 4551], [4594, 4555, 4557], [4595, 4255, 4561], [4595, 4556, 4255], [4427, 4444, 4440], [4348, 4575, 4585], [4471, 4464, 4597], [4576, 4586, 4598], [4486, 4407, 4408], [4485, 4599, 4491], [4156, 4491, 4498], [4495, 4292, 4509], [4495, 4509, 4609], [4600, 4578, 4577], [4578, 4600, 4518], [4521, 4518, 4593], [4521, 4593, 4590], [4224, 4522, 4516], [4601, 4590, 4593], [4601, 4581, 4590], [4581, 4589, 4523], [4547, 4542, 4550], [4555, 4594, 4417], [4421, 4138, 4418], [4618, 4421, 4418], [4401, 4431, 4449], [4438, 4431, 4573], [4602, 4574, 4446], [4442, 4574, 4603], [4602, 4603, 4574], [4584, 4464, 4460], [4605, 4575, 4402], [4405, 4596, 4404], [4406, 4407, 4475], [4586, 4471, 4597], [4474, 4484, 4606], [4576, 4598, 4608], [4477, 4484, 4487], [4490, 4487, 4484], [4506, 4576, 4608], [4506, 4608, 4592], [4488, 4155, 4495], [4509, 4511, 4610], [4411, 4588, 4504], [4611, 4504, 4579], [4515, 4613, 4520], [4601, 4589, 4581], [4612, 4519, 4614], [4591, 4392, 4520], [4519, 4338, 4526], [4528, 4169, 4413], [4615, 4530, 4528], [4531, 4530, 4615], [4543, 4538, 4534], [4616, 4538, 4543], [4543, 4534, 4535], [4582, 4247, 4541], [4541, 4542, 4582], [4548, 4414, 4546], [4416, 4414, 4415], [4556, 4595, 4557], [4561, 4563, 4595], [4562, 4560, 4417], [4644, 4421, 4618], [4449, 4431, 4438], [4451, 4445, 4583], [4604, 4605, 4402], [4624, 4460, 4464], [4467, 4469, 4472], [4586, 4597, 4598], [4468, 4481, 4483], [4587, 4408, 4407], [4408, 4587, 4407], [4491, 4599, 4485], [4505, 4501, 4499], [4518, 4600, 4620], [4516, 4610, 4511], [4593, 4518, 4620], [4611, 4579, 4612], [4543, 4545, 4616], [4544, 4545, 4543], [4546, 4616, 4545], [4562, 4417, 4617], [4379, 4422, 4571], [4447, 4432, 4621], [4669, 4583, 4628], [4584, 4452, 4583], [4462, 4639, 4456], [4464, 4584, 4624], [4464, 4460, 4624], [4470, 4585, 4575], [4469, 4467, 4472], [4470, 4575, 4619], [4497, 4504, 4626], [4592, 4600, 4577], [4609, 4509, 4610], [4593, 4620, 4601], [4579, 4504, 4588], [4589, 4601, 4632], [4579, 4580, 4612], [4522, 4591, 4516], [4627, 4612, 4614], [4520, 4633, 4591], [4614, 4519, 4526], [4634, 4614, 4526], [4528, 4413, 4615], [4645, 4422, 4434], [4426, 4419, 4439], [4653, 4434, 4443], [4444, 4454, 4622], [4436, 4442, 4623], [4442, 4603, 4623], [4671, 4458, 4457], [4597, 4464, 4641], [4685, 4466, 4474], [4484, 4477, 4472], [4598, 4597, 4641], [4486, 4475, 4407], [4592, 4608, 4630], [4592, 4630, 4631], [4600, 4592, 4631], [4512, 4514, 4510], [4711, 4515, 4513], [4591, 4633, 4516], [4614, 4634, 4717], [4526, 4720, 4634], [4616, 4546, 4635], [4566, 4733, 4567], [4571, 4645, 4762], [4571, 4422, 4645], [4618, 4571, 4762], [4430, 4421, 4649], [4648, 4647, 4423], [4652, 4433, 4400], [4656, 4446, 4430], [4446, 4437, 4430], [4737, 4448, 4447], [4736, 4450, 4448], [4572, 4660, 4435], [4667, 4628, 4445], [4583, 4445, 4628], [4638, 4584, 4583], [4679, 4463, 4681], [4604, 4605, 4682], [4464, 4624, 4641], [4484, 4472, 4606], [4479, 4478, 4695], [4598, 4641, 4642], [4598, 4642, 4630], [4489, 4482, 4629], [4699, 4698, 4483], [4598, 4630, 4608], [4699, 4483, 4492], [4496, 4500, 4704], [4499, 4705, 4505], [4600, 4643, 4620], [4601, 4620, 4632], [4527, 4529, 4721], [4566, 4562, 4731], [4788, 4618, 4762], [4420, 4425, 4650], [4646, 4425, 4428], [4646, 4428, 4429], [4647, 4429, 4423], [4651, 4648, 4423], [4651, 4423, 4424], [4424, 4427, 4651], [4447, 4621, 4654], [4438, 4659, 4449], [4662, 4400, 4439], [4660, 4572, 4436], [4660, 4436, 4665], [4667, 4445, 4664], [4446, 4666, 4602], [4658, 4668, 4449], [4636, 4637, 4439], [4739, 4663, 4455], [4663, 4443, 4455], [4449, 4668, 4453], [4639, 4675, 4456], [4455, 4403, 4677], [4462, 4675, 4639], [4459, 4676, 4402], [4463, 4465, 4681], [4682, 4605, 4604], [4688, 4474, 4606], [4406, 4475, 4691], [4689, 4691, 4475], [4689, 4476, 4475], [4492, 4493, 4701], [4631, 4643, 4600], [4499, 4501, 4705], [4609, 4610, 4708], [4411, 4505, 4710], [4613, 4633, 4520], [4525, 4588, 4716], [4717, 4634, 4718], [4723, 4537, 4533], [4537, 4724, 4539], [4540, 4726, 4541], [4542, 4541, 4728], [4617, 4417, 4730], [4595, 4563, 4557], [4564, 4565, 4732], [4617, 4565, 4567], [4566, 4570, 4733], [4644, 4618, 4788], [4646, 4429, 4647], [4425, 4734, 4650], [4645, 4434, 4653], [4419, 4420, 4650], [4621, 4432, 4654], [4657, 4427, 4440], [4659, 4658, 4449], [4439, 4419, 4655], [4440, 4444, 4661], [4665, 4436, 4623], [4655, 4636, 4439], [4444, 4622, 4740], [4669, 4628, 4667], [4603, 4670, 4623], [4637, 4742, 4636], [4739, 4455, 4677], [4675, 4674, 4456], [4453, 4462, 4461], [4453, 4675, 4462], [4402, 4676, 4604], [4676, 4605, 4604], [4638, 4624, 4584], [4638, 4744, 4624], [4404, 4596, 4405], [4744, 4745, 4624], [4624, 4744, 4745], [4691, 4625, 4406], [4686, 4467, 4468], [4596, 4406, 4625], [4475, 4406, 4596], [4689, 4475, 4596], [4478, 4476, 4693], [4482, 4470, 4619], [4696, 4475, 4486], [4694, 4473, 4607], [4700, 4491, 4485], [4630, 4746, 4747], [4630, 4642, 4746], [4489, 4629, 4779], [4408, 4749, 4587], [4408, 4497, 4749], [4493, 4496, 4701], [4494, 4702, 4499], [4631, 4630, 4643], [4703, 4497, 4626], [4750, 4496, 4704], [4501, 4499, 4705], [4503, 4507, 4707], [4620, 4751, 4632], [4507, 4709, 4707], [4712, 4507, 4510], [4502, 4711, 4513], [4632, 4714, 4589], [4752, 4611, 4612], [4627, 4755, 4612], [4517, 4769, 4514], [4588, 4411, 4713], [4614, 4717, 4627], [4717, 4715, 4627], [4615, 4413, 4719], [4526, 4527, 4721], [4756, 4531, 4615], [4721, 4529, 4531], [4533, 4538, 4616], [4725, 4539, 4724], [4726, 4540, 4539], [4725, 4726, 4539], [4726, 4727, 4541], [4546, 4757, 4635], [4758, 4635, 4546], [4542, 4728, 4550], [4416, 4759, 4414], [4772, 4549, 4771], [4594, 4557, 4564], [4563, 4564, 4557], [4567, 4733, 4566], [4568, 4566, 4569], [4569, 4566, 4570], [4652, 4432, 4433], [4651, 4427, 4775], [4649, 4656, 4430], [4738, 4419, 4650], [4427, 4657, 4775], [4435, 4773, 4441], [4438, 4450, 4659], [4655, 4738, 4439], [4738, 4655, 4439], [4637, 4655, 4738], [4655, 4637, 4636], [4740, 4622, 4454], [4459, 4458, 4671], [4456, 4674, 4457], [4638, 4583, 4669], [4638, 4669, 4743], [4602, 4763, 4603], [4741, 4454, 4679], [4680, 4636, 4678], [4679, 4454, 4463], [4624, 4745, 4744], [4745, 4641, 4624], [4745, 4744, 4778], [4764, 4575, 4605], [4596, 4625, 4777], [4687, 4472, 4469], [4619, 4575, 4764], [4778, 4641, 4745], [4690, 4472, 4687], [4478, 4693, 4695], [4692, 4468, 4483], [4475, 4696, 4689], [4692, 4483, 4698], [4482, 4619, 4629], [4479, 4697, 4485], [4746, 4642, 4765], [4700, 4485, 4697], [4699, 4492, 4701], [4609, 4488, 4495], [4630, 4747, 4643], [4703, 4749, 4497], [4704, 4750, 4496], [4496, 4750, 4704], [4499, 4784, 4705], [4620, 4643, 4751], [4704, 4500, 4503], [4703, 4626, 4504], [4643, 4767, 4751], [4751, 4767, 4632], [4705, 4710, 4505], [4703, 4504, 4611], [4502, 4498, 4711], [4755, 4752, 4612], [4768, 4610, 4516], [4514, 4754, 4510], [4589, 4714, 4785], [4755, 4627, 4715], [4613, 4770, 4633], [4719, 4413, 4525], [4615, 4719, 4756], [4537, 4723, 4722], [4757, 4533, 4616], [4757, 4616, 4635], [4635, 4757, 4546], [4758, 4546, 4414], [4414, 4759, 4758], [4759, 4416, 4729], [4550, 4760, 4771], [4761, 4729, 4416], [4550, 4771, 4549], [4416, 4549, 4761], [4730, 4594, 4732], [4417, 4594, 4730], [4732, 4594, 4564], [4617, 4732, 4565], [4733, 4567, 4566], [4652, 4735, 4432], [4654, 4432, 4735], [4435, 4774, 4773], [4447, 4654, 4737], [4662, 4652, 4400], [4655, 4419, 4738], [4450, 4736, 4659], [4664, 4445, 4441], [4440, 4661, 4657], [4666, 4446, 4656], [4439, 4637, 4662], [4665, 4670, 4660], [4670, 4665, 4623], [4740, 4454, 4741], [4457, 4672, 4671], [4673, 4459, 4671], [4457, 4674, 4672], [4763, 4670, 4603], [4763, 4602, 4666], [4673, 4676, 4459], [4637, 4636, 4680], [4678, 4636, 4742], [4680, 4678, 4776], [4638, 4743, 4744], [4677, 4403, 4466], [4680, 4683, 4684], [4686, 4469, 4467], [4467, 4469, 4686], [4469, 4687, 4467], [4469, 4467, 4687], [4688, 4685, 4474], [4764, 4605, 4682], [4777, 4689, 4596], [4465, 4473, 4694], [4693, 4476, 4689], [4641, 4778, 4642], [4765, 4642, 4778], [4629, 4619, 4779], [4780, 4694, 4607], [4479, 4695, 4697], [4607, 4480, 4780], [4587, 4696, 4486], [4781, 4747, 4765], [4480, 4488, 4780], [4488, 4748, 4780], [4746, 4765, 4747], [4747, 4781, 4782], [4747, 4782, 4783], [4702, 4494, 4779], [4701, 4496, 4750], [4609, 4748, 4488], [4643, 4747, 4767], [4706, 4498, 4491], [4703, 4611, 4752], [4411, 4710, 4753], [4516, 4633, 4770], [4770, 4768, 4516], [4613, 4515, 4711], [4613, 4711, 4786], [4718, 4634, 4720], [4413, 4719, 4756], [4719, 4413, 4756], [4756, 4721, 4531], [4724, 4537, 4722], [4727, 4541, 4726], [4727, 4726, 4541], [4758, 4757, 4635], [4728, 4541, 4727], [4728, 4760, 4550], [4761, 4759, 4729], [4772, 4761, 4549], [4730, 4731, 4562], [4730, 4562, 4617], [4617, 4730, 4732], [4567, 4730, 4617], [4566, 4733, 4570], [4644, 4649, 4421], [4737, 4736, 4448], [4742, 4637, 4738], [4661, 4444, 4740], [4453, 4668, 4675], [4683, 4680, 4776], [4467, 4686, 4469], [4686, 4687, 4469], [4686, 4468, 4692], [4625, 4691, 4683], [4795, 4686, 4692], [4606, 4472, 4690], [4606, 4690, 4688], [4779, 4619, 4764], [4697, 4791, 4700], [4489, 4779, 4494], [4747, 4783, 4767], [4491, 4700, 4706], [4701, 4750, 4704], [4784, 4499, 4702], [4704, 4503, 4707], [4610, 4768, 4708], [4754, 4514, 4787], [4713, 4411, 4753], [4517, 4589, 4769], [4514, 4769, 4787], [4770, 4613, 4786], [4588, 4713, 4716], [4720, 4526, 4721], [4533, 4757, 4723], [4792, 4757, 4758], [4731, 4733, 4566], [4730, 4567, 4733], [4774, 4435, 4789], [4441, 4773, 4664], [4435, 4660, 4789], [4664, 4773, 4802], [4763, 4790, 4670], [4776, 4678, 4742], [4605, 4676, 4682], [4685, 4677, 4466], [4683, 4777, 4625], [4783, 4782, 4767], [4609, 4708, 4748], [4714, 4632, 4767], [4800, 4768, 4770], [4769, 4785, 4801], [4769, 4589, 4785], [4760, 4771, 4728], [4771, 4760, 4728], [4730, 4733, 4731], [4838, 4788, 4950], [4425, 4646, 4734], [4805, 4683, 4776], [4681, 4465, 4694], [4749, 4696, 4587], [4779, 4702, 4797], [4702, 4779, 4797], [4711, 4498, 4799], [4709, 4507, 4712], [4712, 4510, 4754], [4811, 4786, 4711], [4787, 4769, 4801], [4525, 4716, 4719], [4757, 4792, 4723], [4847, 4735, 4652], [4738, 4650, 4793], [4806, 4687, 4686], [4688, 4796, 4685], [4777, 4693, 4689], [4814, 4692, 4698], [4779, 4764, 4807], [4782, 4781, 4808], [4782, 4808, 4809], [4702, 4779, 4797], [4706, 4700, 4810], [4784, 4702, 4797], [4498, 4706, 4799], [4767, 4798, 4714], [4709, 4712, 4707], [4714, 4801, 4785], [4770, 4786, 4811], [4800, 4770, 4811], [4727, 4760, 4728], [4950, 4788, 4762], [4803, 4652, 4662], [4651, 4775, 4657], [4663, 4653, 4443], [4803, 4662, 4637], [4675, 4668, 4658], [4777, 4683, 4805], [4682, 4676, 4794], [4777, 4813, 4693], [4815, 4697, 4695], [4779, 4807, 4797], [4701, 4704, 4816], [4705, 4784, 4797], [4768, 4817, 4708], [4800, 4817, 4768], [4787, 4801, 4754], [4723, 4792, 4722], [4818, 4725, 4724], [4759, 4725, 4758], [4760, 4812, 4771], [4759, 4761, 4812], [4759, 4812, 4761], [4759, 4761, 4812], [4772, 4812, 4761], [4772, 4771, 4812], [4670, 4804, 4660], [4679, 4681, 4821], [4819, 4687, 4806], [4820, 4677, 4685], [4820, 4685, 4796], [4798, 4767, 4782], [4782, 4809, 4798], [4725, 4818, 4726], [4725, 4792, 4758], [4847, 4846, 4735], [4650, 4825, 4793], [4651, 4657, 4826], [4934, 4659, 4736], [4684, 4683, 4680], [4695, 4697, 4815], [4822, 4801, 4714], [4714, 4798, 4822], [4752, 4755, 4703], [4735, 4850, 4654], [4824, 4737, 4654], [4669, 4667, 4664], [4869, 4675, 4861], [4738, 4793, 4827], [4738, 4827, 4742], [4776, 4742, 4805], [4796, 4688, 4690], [4815, 4697, 4695], [4703, 4755, 4823], [4711, 4799, 4811], [4925, 4818, 4724], [4842, 4841, 4774], [4845, 4649, 4838], [4646, 4853, 4734], [4824, 4654, 4854], [4826, 4856, 4651], [4803, 4829, 4652], [4843, 4789, 4660], [4650, 4734, 4825], [4736, 4737, 4858], [4657, 4856, 4826], [4659, 4830, 4658], [4862, 4863, 4664], [4658, 4830, 4861], [4804, 4670, 4860], [4666, 4656, 4857], [4867, 4666, 4857], [4674, 4675, 4869], [4866, 4670, 4790], [4805, 4742, 4827], [4666, 4831, 4763], [4680, 4878, 4637], [4865, 4741, 4679], [4680, 4683, 4832], [4883, 4806, 4686], [4682, 4794, 4886], [4890, 4683, 4691], [4687, 4796, 4690], [4764, 4895, 4807], [4834, 4808, 4897], [4791, 4697, 4901], [4836, 4808, 4835], [4791, 4901, 4904], [4810, 4904, 4907], [4809, 4836, 4822], [4943, 4748, 4708], [4798, 4809, 4822], [4915, 4823, 4755], [4716, 4837, 4713], [4837, 4716, 4713], [4920, 4919, 4717], [4716, 4837, 4719], [4923, 4756, 4719], [4931, 4792, 4725], [4759, 4931, 4725], [4838, 4644, 4788], [4839, 4762, 4645], [4839, 4645, 4840], [4841, 4773, 4774], [4644, 4838, 4649], [4843, 4774, 4789], [4843, 4842, 4774], [4844, 4802, 4841], [4841, 4802, 4773], [4847, 4652, 4848], [4647, 4648, 4851], [4664, 4802, 4844], [4854, 4654, 4850], [4858, 4737, 4824], [4858, 4824, 4854], [4855, 4825, 4734], [4656, 4649, 4857], [4859, 4852, 4663], [4852, 4653, 4663], [4843, 4660, 4860], [4825, 4855, 4793], [4659, 4861, 4830], [4660, 4804, 4860], [4803, 4864, 4829], [4865, 4657, 4661], [4740, 4865, 4661], [4860, 4670, 4866], [4637, 4864, 4803], [4658, 4861, 4675], [4869, 4861, 4936], [4671, 4871, 4673], [4671, 4870, 4871], [4672, 4674, 4874], [4872, 4671, 4672], [4872, 4870, 4671], [4865, 4740, 4741], [4743, 4669, 4868], [4831, 4666, 4867], [4876, 4763, 4831], [4875, 4877, 4819], [4677, 4873, 4739], [4637, 4878, 4864], [4820, 4819, 4877], [4673, 4871, 4676], [4763, 4876, 4790], [4871, 4881, 4676], [4680, 4832, 4878], [4883, 4686, 4795], [4687, 4819, 4884], [4683, 4833, 4832], [4679, 4821, 4885], [4777, 4888, 4813], [4886, 4889, 4682], [4939, 4795, 4692], [4890, 4833, 4683], [4693, 4813, 4888], [4821, 4681, 4891], [4939, 4692, 4814], [4682, 4889, 4764], [4681, 4694, 4891], [4695, 4693, 4893], [4890, 4696, 4828], [4890, 4689, 4696], [4894, 4815, 4695], [4941, 4765, 4778], [4892, 4895, 4764], [4697, 4815, 4894], [4694, 4780, 4899], [4778, 4896, 4765], [4781, 4897, 4808], [4781, 4896, 4897], [4814, 4698, 4900], [4765, 4896, 4781], [4898, 4697, 4894], [4698, 4699, 4900], [4808, 4902, 4835], [4749, 4828, 4696], [4835, 4902, 4836], [4836, 4902, 4835], [4900, 4699, 4701], [4895, 4903, 4807], [4701, 4699, 4900], [4903, 4797, 4807], [4809, 4808, 4836], [4905, 4780, 4748], [4700, 4904, 4810], [4816, 4704, 4942], [4704, 4908, 4942], [4703, 4823, 4906], [4706, 4810, 4907], [4704, 4707, 4908], [4797, 4909, 4705], [4817, 4943, 4708], [4817, 4708, 4910], [4708, 4817, 4910], [4710, 4705, 4909], [4712, 4912, 4707], [4913, 4811, 4799], [4817, 4811, 4913], [4800, 4811, 4817], [4912, 4712, 4754], [4801, 4822, 4754], [4710, 4914, 4753], [4753, 4916, 4713], [4716, 4713, 4917], [4716, 4917, 4713], [4919, 4715, 4717], [4919, 4918, 4715], [4920, 4717, 4718], [4718, 4720, 4920], [4920, 4720, 4922], [4921, 4923, 4719], [4720, 4721, 4922], [4756, 4923, 4924], [4922, 4721, 4924], [4721, 4756, 4924], [4926, 4724, 4722], [4925, 4724, 4926], [4928, 4726, 4925], [4925, 4726, 4818], [4927, 4722, 4792], [4726, 4929, 4727], [4931, 4759, 4725], [4931, 4725, 4726], [4725, 4759, 4726], [4726, 4812, 4932], [4759, 4812, 4726], [4645, 4653, 4840], [4840, 4653, 4852], [4846, 4850, 4735], [4849, 4646, 4647], [4647, 4851, 4849], [4829, 4848, 4652], [4862, 4664, 4844], [4830, 4861, 4659], [4669, 4863, 4868], [4937, 4827, 4793], [4674, 4869, 4874], [4672, 4874, 4872], [4790, 4876, 4866], [4952, 4875, 4806], [4875, 4819, 4806], [4865, 4679, 4880], [4879, 4743, 4868], [4806, 4883, 4882], [4881, 4794, 4676], [4795, 4887, 4883], [4744, 4743, 4879], [4888, 4777, 4805], [4886, 4794, 4881], [4687, 4884, 4796], [4778, 4744, 4954], [4889, 4892, 4764], [4693, 4888, 4893], [4890, 4691, 4689], [4941, 4778, 4765], [4941, 4896, 4778], [4896, 4955, 4897], [4814, 4900, 4940], [4905, 4899, 4780], [4700, 4791, 4904], [4905, 4780, 4748], [4905, 4748, 4780], [4699, 4701, 4942], [4943, 4905, 4748], [4942, 4701, 4816], [4958, 4908, 4707], [4749, 4703, 4906], [4942, 4908, 4958], [4799, 4706, 4945], [4947, 4754, 4948], [4945, 4949, 4913], [4822, 4946, 4754], [4945, 4913, 4799], [4949, 4817, 4913], [4914, 4710, 4909], [4755, 4715, 4915], [4918, 4915, 4715], [4917, 4716, 4713], [4917, 4837, 4716], [4929, 4726, 4928], [4760, 4727, 4933], [4932, 4760, 4933], [4760, 4932, 4812], [4845, 4857, 4649], [4959, 4843, 4860], [4855, 4734, 4951], [4734, 4853, 4951], [4648, 4651, 4856], [4830, 4659, 4934], [4664, 4862, 4863], [4862, 4664, 4863], [4863, 4669, 4664], [4805, 4827, 4937], [4820, 4873, 4677], [4805, 4937, 4938], [4888, 4805, 4953], [4795, 4939, 4887], [4962, 4893, 4888], [4939, 4814, 4940], [4778, 4954, 4941], [4896, 4941, 4955], [4891, 4694, 4899], [4964, 4956, 4902], [4835, 4902, 4956], [4828, 4749, 4957], [4836, 4835, 4956], [4957, 4749, 4906], [4836, 4956, 4948], [4706, 4907, 4945], [4817, 4910, 4943], [4836, 4948, 4822], [4946, 4822, 4948], [4707, 4912, 4947], [4949, 4910, 4817], [4948, 4754, 4946], [4912, 4754, 4947], [4911, 4823, 4915], [4713, 4916, 4917], [4927, 4926, 4722], [4931, 4927, 4792], [4933, 4727, 4930], [4960, 4851, 4648], [4736, 4858, 4934], [4856, 4657, 4935], [4793, 4855, 4937], [4935, 4657, 4865], [4663, 4739, 4859], [4739, 4873, 4859], [4867, 4876, 4831], [4820, 4877, 4873], [4865, 4880, 4961], [4953, 4805, 4938], [4744, 4879, 4954], [4884, 4820, 4796], [4819, 4820, 4884], [4885, 4880, 4679], [4887, 4939, 4883], [4963, 4939, 4940], [4695, 4893, 4894], [4963, 4940, 4900], [4898, 4901, 4697], [4902, 4808, 4834], [4699, 4966, 4900], [4964, 4965, 4967], [4942, 4966, 4699], [4956, 4964, 4967], [4947, 4967, 4944], [4947, 4956, 4967], [4967, 4958, 4944], [4958, 4707, 4944], [4909, 4797, 4903], [4911, 4906, 4823], [4948, 4956, 4947], [4944, 4707, 4947], [4916, 4753, 4914], [4719, 4837, 4921], [4929, 4930, 4727], [4930, 4932, 4933], [4979, 4851, 4960], [4646, 4849, 4951], [4853, 4646, 4951], [4960, 4648, 4856], [4937, 4855, 4968], [4938, 4937, 4968], [4886, 4881, 4984], [4878, 4832, 4833], [4941, 4954, 4969], [4939, 4963, 4970], [4885, 4821, 4891], [4966, 4972, 4963], [4966, 4963, 4900], [4965, 4973, 4967], [4942, 4900, 4966], [4958, 4967, 4973], [4958, 4966, 4942], [4942, 4966, 4900], [4958, 4973, 4966], [4943, 4986, 4905], [4907, 4974, 4945], [4988, 4910, 4949], [4923, 4921, 4924], [4926, 4927, 4925], [4927, 4931, 4925], [4950, 4762, 4839], [4830, 4977, 4861], [4850, 4846, 4978], [4849, 4851, 4979], [4951, 4849, 4979], [4871, 4870, 4981], [4952, 4806, 4882], [4983, 4881, 4871], [4983, 4984, 4881], [4938, 4968, 4953], [4889, 4886, 4984], [4941, 4969, 4955], [4885, 4891, 4971], [4891, 4986, 4971], [4972, 4966, 4985], [4891, 4899, 4986], [4905, 4943, 4899], [4906, 4828, 4957], [4993, 4904, 4901], [4943, 4986, 4899], [4986, 4943, 4905], [4903, 4987, 4909], [4988, 4943, 4910], [4921, 4989, 4924], [4929, 4932, 4930], [4726, 4932, 4929], [4862, 4844, 4863], [4859, 4840, 4852], [4977, 4976, 4861], [4857, 4845, 4975], [4981, 4850, 4978], [4978, 4871, 4981], [4935, 4865, 4982], [4867, 4857, 4980], [4973, 4985, 4966], [4974, 4988, 4949], [4945, 4974, 4949], [4921, 4837, 4989], [4929, 4931, 4726], [5089, 4841, 4842], [5089, 5108, 5132], [4844, 4990, 4863], [4847, 4978, 4846], [4978, 4847, 4991], [4859, 4873, 4877], [4983, 4871, 4978], [4978, 4991, 4983], [4859, 4877, 4995], [4864, 4878, 4983], [4953, 4962, 4888], [4972, 4985, 4973], [4992, 4898, 4894], [4992, 4901, 4898], [4904, 4993, 4907], [5008, 4847, 4848], [4995, 4840, 4859], [4976, 4994, 4996], [4996, 4861, 4976], [5073, 5063, 4977], [4858, 4854, 4981], [4981, 4854, 4850], [4982, 4856, 4935], [4872, 4981, 4870], [4867, 4997, 4876], [4998, 4962, 4953], [4832, 4878, 4833], [4893, 4962, 4894], [4894, 4962, 5001], [4901, 4993, 4907], [4993, 4901, 4907], [4988, 4986, 4943], [4925, 4929, 4928], [5005, 4842, 4843], [4830, 4934, 5015], [5000, 4968, 4855], [5000, 4855, 4951], [4991, 4864, 4983], [4878, 4984, 4983], [5036, 4963, 4972], [4986, 4988, 4999], [4931, 4929, 4925], [5018, 4936, 4861], [4858, 4981, 4872], [5002, 4856, 4982], [5017, 4860, 5023], [4953, 4968, 5000], [4882, 4883, 4952], [4998, 4953, 5000], [4997, 5025, 4876], [4961, 4880, 4885], [4883, 4939, 5028], [4969, 4955, 5033], [5036, 4970, 4963], [4889, 5029, 4892], [5029, 5037, 4892], [5034, 4833, 5093], [5042, 4890, 4828], [4987, 4903, 4895], [4988, 5048, 4999], [4974, 5048, 4988], [4909, 5050, 4914], [5051, 4911, 4915], [4919, 4920, 4922], [4950, 5003, 4838], [4839, 4840, 5006], [5007, 4845, 4838], [5005, 4843, 4959], [5007, 4838, 4845], [4990, 4844, 5011], [4838, 5013, 4845], [4863, 4990, 5011], [4975, 4845, 5013], [5014, 4848, 4829], [5014, 5009, 4848], [5073, 4977, 4830], [5015, 4934, 4858], [4829, 4864, 4991], [4951, 5020, 5000], [4951, 4979, 5020], [4856, 5002, 4960], [5020, 4979, 5000], [5021, 4867, 4980], [4869, 4936, 5022], [5023, 4866, 4876], [4869, 5022, 4874], [4867, 5025, 4997], [4952, 4883, 5024], [4982, 4865, 4961], [5029, 4889, 4984], [4878, 4832, 5031], [5031, 4832, 4833], [4885, 5030, 4961], [4962, 4998, 5001], [5031, 4833, 5034], [4954, 5033, 4969], [5035, 4970, 4939], [5035, 4939, 4970], [5030, 4885, 4971], [4955, 4969, 5033], [5035, 4970, 5036], [5030, 4971, 5041], [5033, 4897, 4955], [4897, 5039, 4834], [4834, 5039, 4902], [5041, 4971, 4986], [5040, 4972, 5043], [4999, 5041, 4986], [5044, 4964, 4902], [5046, 4964, 5045], [4973, 4965, 5043], [5047, 4987, 4895], [5049, 4828, 4906], [4911, 5051, 4906], [4987, 5050, 4909], [4916, 4914, 5052], [5054, 4917, 4916], [5055, 5053, 4915], [4918, 5055, 4915], [5056, 5057, 4917], [4917, 5057, 4837], [5057, 5058, 4837], [4837, 5058, 4989], [4924, 4989, 5058], [5061, 4924, 5058], [4919, 4922, 5060], [5003, 4950, 4839], [4976, 4977, 5012], [4977, 5063, 5012], [5011, 5016, 4863], [4980, 4857, 4975], [5020, 5000, 4979], [5019, 4960, 5002], [5064, 4875, 4952], [4883, 5028, 5081], [4961, 5030, 5068], [5027, 4954, 4879], [4939, 4970, 5032], [5033, 4955, 4969], [4833, 4890, 5038], [5001, 4992, 4894], [4890, 5070, 5038], [4902, 5039, 5087], [5048, 5041, 4999], [4972, 4973, 5043], [4901, 4992, 4993], [5048, 5071, 5041], [4965, 4964, 5046], [5048, 4974, 4993], [4974, 4907, 4993], [5050, 4987, 5072], [5052, 4914, 5050], [5051, 4915, 5053], [4917, 5054, 5056], [4918, 4919, 5055], [5060, 4922, 5062], [5062, 4922, 4924], [5089, 4842, 5108], [4844, 4841, 5004], [5003, 4839, 5006], [4844, 5004, 5011], [4838, 5007, 5013], [4996, 4976, 5018], [4994, 4976, 4996], [5010, 4840, 4995], [5074, 5010, 4995], [4996, 5018, 4861], [4872, 4874, 5015], [4872, 5015, 4858], [4875, 4995, 4877], [5022, 4936, 5018], [4979, 4960, 5019], [5020, 4979, 5019], [4866, 5023, 4860], [4952, 5076, 5064], [5090, 4875, 5064], [5065, 5000, 5020], [5002, 4982, 5078], [5066, 5078, 4982], [5024, 5076, 4952], [5079, 4998, 5065], [4879, 4868, 5067], [5026, 5024, 4883], [4998, 5000, 5065], [5066, 4982, 5080], [4982, 4961, 5080], [5026, 4883, 5081], [4939, 5081, 5028], [5001, 4998, 5079], [5032, 4970, 5035], [5083, 4992, 5001], [5083, 5069, 4992], [5071, 5084, 5041], [5036, 4972, 5040], [4993, 4992, 5086], [5084, 5071, 5048], [5088, 5084, 5048], [5048, 4993, 5088], [5044, 5045, 4964], [5055, 4919, 5059], [5062, 4924, 5061], [5010, 5006, 4840], [5009, 5008, 4848], [4868, 4863, 5016], [4980, 4975, 5021], [4874, 5022, 5077], [5020, 5019, 5065], [5019, 5091, 5065], [5091, 5002, 5078], [5092, 5103, 5023], [5026, 5081, 5028], [5092, 4876, 5025], [5081, 5026, 5028], [5029, 4984, 4878], [5029, 4878, 5031], [5068, 5080, 4961], [5079, 5082, 5001], [5001, 5082, 5083], [5085, 5030, 5041], [5068, 5030, 5085], [5084, 5094, 5068], [5038, 5093, 4833], [5086, 4992, 5069], [5085, 5041, 5084], [4993, 5084, 5088], [5086, 5084, 4993], [5108, 4842, 5005], [4959, 4860, 5017], [5007, 5095, 5013], [4976, 5012, 5018], [5008, 5075, 4847], [4991, 4847, 5075], [5015, 5073, 4830], [5090, 5074, 4995], [4991, 5014, 5075], [4991, 5075, 5014], [5090, 4995, 4875], [5018, 5073, 5022], [5021, 4975, 5013], [5077, 5015, 4874], [5019, 5002, 5091], [5066, 5098, 5078], [5096, 4867, 5021], [5081, 5024, 5026], [5097, 5065, 5091], [5065, 5097, 5079], [5098, 5066, 5080], [5097, 5082, 5079], [5080, 5068, 5094], [5084, 5068, 5085], [5069, 5083, 5086], [5083, 5099, 5086], [5070, 5093, 5038], [5087, 5044, 4902], [5047, 4895, 4892], [5059, 4919, 5060], [5004, 4841, 5089], [5005, 4959, 5100], [5003, 5007, 4838], [4959, 5017, 5100], [5073, 5012, 5063], [5010, 5074, 5090], [5012, 5073, 5018], [5075, 5008, 5014], [4991, 5014, 4829], [5075, 5014, 4991], [5101, 5090, 5064], [4868, 5016, 5067], [5101, 5064, 5076], [5021, 5013, 5102], [5092, 5023, 4876], [5024, 5081, 5102], [5091, 5078, 5098], [4867, 5096, 5025], [5097, 5091, 5098], [5080, 5099, 5098], [4939, 5032, 5081], [5082, 5097, 5083], [5094, 5099, 5080], [5099, 5084, 5086], [5094, 5084, 5099], [5039, 4897, 5033], [5105, 4892, 5037], [5105, 5106, 4892], [5047, 4892, 5106], [4916, 5052, 5054], [5101, 5007, 5003], [5101, 5006, 5090], [5003, 5006, 5101], [5008, 5009, 5014], [5006, 5010, 5090], [5101, 5095, 5007], [5013, 5095, 5024], [5024, 5095, 5101], [5024, 5101, 5076], [5102, 5013, 5024], [5015, 5077, 5022], [4879, 5067, 5027], [5104, 4954, 5027], [5032, 5035, 5081], [5098, 5099, 5097], [5099, 5083, 5097], [5033, 4954, 5104], [5042, 5070, 4890], [5043, 4965, 5046], [5042, 4828, 5049], [4987, 5047, 5072], [4906, 5051, 5049], [5054, 5052, 5056], [5057, 5056, 5058], [5022, 5073, 5015], [5096, 5021, 5081], [5021, 5102, 5081], [5093, 5031, 5034], [5035, 5036, 5109], [5017, 5023, 5103], [5111, 5017, 5103], [5081, 5035, 5096], [5039, 5033, 5110], [5042, 5093, 5070], [5044, 5087, 5045], [5106, 5072, 5047], [5049, 5107, 5042], [5055, 5059, 5060], [5027, 5067, 5115], [5109, 5092, 5025], [5025, 5096, 5109], [5109, 5096, 5035], [5037, 5029, 5105], [5105, 5029, 5031], [5105, 5031, 5093], [5060, 5062, 5058], [5062, 5061, 5058], [5004, 5112, 5011], [5017, 5113, 5100], [5109, 5117, 5092], [5109, 5118, 5117], [5119, 5039, 5033], [5087, 5039, 5119], [5036, 5040, 5121], [5087, 5130, 5045], [5106, 5124, 5072], [5125, 5052, 5050], [5055, 5060, 5127], [5116, 5129, 5103], [5103, 5092, 5116], [5135, 5040, 5043], [5123, 5093, 5042], [5045, 5131, 5046], [5137, 5127, 5060], [5004, 5089, 5128], [5016, 5011, 5114], [5109, 5117, 5118], [5109, 5118, 5117], [5040, 5109, 5036], [5040, 5036, 5121], [5131, 5045, 5122], [5136, 5107, 5049], [5051, 5136, 5049], [5143, 5052, 5125], [5126, 5052, 5143], [5128, 5089, 5132], [5004, 5133, 5112], [5005, 5100, 5113], [5011, 5112, 5114], [5067, 5016, 5115], [5117, 5118, 5092], [5104, 5139, 5033], [5130, 5087, 5120], [5141, 5093, 5123], [5141, 5106, 5105], [5072, 5142, 5050], [5053, 5055, 5137], [5137, 5055, 5127], [5058, 5056, 5144], [5144, 5060, 5058], [5134, 5148, 5111], [5111, 5103, 5129], [5104, 5027, 5138], [5104, 5138, 5139], [5121, 5118, 5109], [5039, 5110, 5033], [5040, 5121, 5109], [5105, 5093, 5141], [5045, 5130, 5122], [5135, 5043, 5046], [5107, 5123, 5042], [5149, 5123, 5107], [5125, 5050, 5142], [5126, 5056, 5052], [5132, 5108, 5005], [5113, 5017, 5148], [5134, 5111, 5129], [5115, 5016, 5114], [5121, 5040, 5135], [5141, 5124, 5106], [5051, 5147, 5136], [5147, 5051, 5053], [5147, 5053, 5150], [5137, 5150, 5053], [5151, 5005, 5113], [5148, 5017, 5111], [5033, 5139, 5140], [5140, 5119, 5033], [5046, 5152, 5135], [5141, 5123, 5145], [5145, 5123, 5149], [5072, 5124, 5142], [5136, 5146, 5107], [5144, 5056, 5126], [5004, 5128, 5133], [5121, 5135, 5152], [5153, 5122, 5130], [5131, 5122, 5153], [5124, 5141, 5145], [5149, 5124, 5145], [5146, 5149, 5107], [5150, 5136, 5147], [5155, 5136, 5150], [5143, 5125, 5154], [5155, 5150, 5137], [5126, 5137, 5144], [5116, 5092, 5118], [5120, 5153, 5130], [5152, 5131, 5153], [5046, 5131, 5152], [5149, 5146, 5136], [5137, 5060, 5144], [5027, 5115, 5138], [5120, 5087, 5119], [5152, 5121, 5131], [5131, 5121, 5152], [5125, 5142, 5154], [5126, 5155, 5137], [5133, 5128, 5158], [5132, 5005, 5151], [5121, 5152, 5157], [5142, 5124, 5149], [5142, 5149, 5154], [5154, 5149, 5136], [5143, 5154, 5136], [5126, 5143, 5155], [5140, 5139, 5138], [5156, 5140, 5162], [5119, 5140, 5156], [5118, 5121, 5157], [5136, 5155, 5143], [5164, 5153, 5120], [5133, 5114, 5112], [5159, 5134, 5129], [5115, 5114, 5165], [5162, 5119, 5156], [5119, 5163, 5120], [5166, 5133, 5158], [5138, 5161, 5140], [5172, 5116, 5118], [5140, 5156, 5162], [5164, 5152, 5153], [5167, 5170, 5113], [5133, 5169, 5114], [5160, 5159, 5129], [5138, 5115, 5165], [5116, 5160, 5129], [5173, 5172, 5171], [5157, 5172, 5118], [5167, 5148, 5168], [5113, 5148, 5167], [5170, 5151, 5113], [5116, 5171, 5160], [5171, 5116, 5173], [5172, 5173, 5116], [5172, 5174, 5177], [5172, 5157, 5174], [5177, 5174, 5157], [5157, 5164, 5177], [5157, 5152, 5164], [5119, 5183, 5163], [5179, 5151, 5176], [5161, 5138, 5165], [5177, 5178, 5172], [5119, 5162, 5183], [5132, 5151, 5179], [5166, 5169, 5133], [5134, 5181, 5148], [5181, 5168, 5148], [5181, 5134, 5159], [5159, 5160, 5181], [5165, 5114, 5182], [5171, 5172, 5178], [5140, 5161, 5175], [5140, 5175, 5156], [5184, 5183, 5175], [5175, 5183, 5156], [5183, 5162, 5156], [5164, 5120, 5163], [5158, 5128, 5132], [5151, 5180, 5176], [5151, 5170, 5180], [5167, 5168, 5170], [5161, 5165, 5182], [5158, 5132, 5179], [5181, 5170, 5168], [5182, 5114, 5169], [5166, 5158, 5169], [5160, 5171, 5181], [5171, 5170, 5181], [5185, 5171, 5178], [5176, 5180, 5179], [5169, 5158, 5187], [5170, 5171, 5180], [5177, 5186, 5178], [5158, 5179, 5188], [5180, 5188, 5179], [5180, 5171, 5185], [5189, 5178, 5186], [5177, 5164, 5186], [5187, 5158, 5188], [5163, 5186, 5164], [5194, 5188, 5180], [5180, 5185, 5191], [5178, 5189, 5192], [5186, 5192, 5189], [5200, 5184, 5175], [5190, 5169, 5187], [5192, 5185, 5178], [5186, 5163, 5193], [5187, 5188, 5194], [5190, 5187, 5194], [5194, 5180, 5196], [5180, 5191, 5196], [5195, 5182, 5169], [5185, 5196, 5191], [5192, 5196, 5185], [5199, 5192, 5186], [5184, 5200, 5183], [5195, 5169, 5190], [5197, 5182, 5195], [5198, 5195, 5199], [5197, 5195, 5198], [5199, 5196, 5192], [5161, 5198, 5175], [5202, 5199, 5186], [5202, 5186, 5193], [5183, 5193, 5163], [5202, 5193, 5183], [5190, 5194, 5195], [5195, 5194, 5196], [5198, 5161, 5182], [5198, 5182, 5197], [5199, 5195, 5196], [5200, 5175, 5203], [5201, 5202, 5183], [5200, 5201, 5183], [5175, 5198, 5203], [5203, 5204, 5200], [5198, 5199, 5202], [5203, 5198, 5202], [5200, 5204, 5201], [5204, 5202, 5201], [5202, 5204, 5203]], + positions: [[15.85415005683899, 27.896950021386147, -24.917999282479286], [16.001449897885323, 29.114199802279472, -24.810049682855606], [17.33729988336563, 29.78315018117428, -24.825699627399445], [15.59234969317913, 27.713749557733536, -24.183249101042747], [17.38560013473034, 28.173750266432762, -23.489199578762054], [16.939649358391762, 28.359299525618553, -24.828599765896797], [15.720950439572334, 29.41320091485977, -23.476500064134598], [17.353100702166557, 29.48874980211258, -24.318400770425797], [18.792299553751945, 30.017400160431862, -24.720899760723114], [17.447199672460556, 31.62575140595436, -23.77369999885559], [17.996350303292274, 31.195249408483505, -24.663349613547325], [18.812650814652443, 31.032200902700424, -24.75699968636036], [19.520100206136703, 29.889900237321854, -23.368600755929947], [19.3636491894722, 31.510699540376663, -23.58495071530342], [18.885349854826927, 28.379999101161957, -23.152200505137444], [15.565349720418453, 31.77575021982193, -22.97619916498661], [15.135150402784348, 33.679500222206116, -23.642150685191154], [15.056050382554531, 34.94755178689957, -23.283949121832848], [13.13064992427826, 33.670950680971146, -23.347700014710426], [16.64089970290661, 33.06185081601143, -22.835399955511093], [12.801299802958965, 32.004449516534805, -23.05220067501068], [11.149900034070015, 31.88125044107437, -22.916950285434723], [11.478650383651257, 32.87634998559952, -22.93110080063343], [13.62650003284216, 34.70110148191452, -22.878650575876236], [17.330849543213844, 29.38389964401722, -21.58919908106327], [11.2143000587821, 31.785398721694946, -21.978149190545082], [19.474400207400322, 29.67974916100502, -21.611399948596954], [15.875199809670448, 30.291350558400154, -22.18575030565262], [19.8488999158144, 31.891800463199615, -22.213999181985855], [15.228049829602242, 31.201399862766266, -21.447300910949707], [13.309899717569351, 31.838450580835342, -21.605050191283226], [17.8554505109787, 32.477349042892456, -22.0357496291399], [11.723349802196026, 33.069901168346405, -21.647000685334206], [17.406700178980827, 33.641450107097626, -21.624699234962463], [12.752650305628777, 33.79509970545769, -21.37189917266369], [13.497250154614449, 35.43199971318245, -21.073900163173676], [15.215650200843811, 35.53434833884239, -21.428599953651428], [19.49629932641983, 33.24649855494499, -20.97479999065399], [-10.924450121819973, 81.22999966144562, -21.45479992032051], [-13.042549602687359, 80.95649629831314, -21.308450028300285], [-11.29894983023405, 82.54650235176086, -21.394800394773483], [-12.932299636304379, 86.69549971818924, -21.43624983727932], [-11.60844974219799, 87.0869979262352, -21.308649331331253], [20.660050213336945, 31.72130137681961, -21.054750308394432], [16.68735034763813, 34.88269820809364, -21.224400028586388], [-13.253900222480297, 82.80500024557114, -21.1327001452446], [-12.320900335907936, 87.77900040149689, -21.27549983561039], [-14.770099893212318, 86.52299642562866, -20.90189978480339], [-12.957150116562843, 74.96750354766846, -20.931849256157875], [-13.51029984652996, 75.654998421669, -20.80654911696911], [-14.616750180721283, 80.38350194692612, -20.70385031402111], [13.444449752569199, 37.66455128788948, -20.806599408388138], [14.527750201523304, 37.731051445007324, -20.77155001461506], [-15.109349973499775, 83.20300281047821, -20.653650164604187], [18.09605024755001, 30.046699568629265, -20.247049629688263], [19.29360069334507, 30.35935014486313, -19.842900335788727], [17.493300139904022, 31.17460012435913, -19.338399171829224], [21.17694914340973, 31.517300754785538, -19.622599706053734], [15.529650263488293, 31.9674015045166, -19.712500274181366], [21.412549540400505, 33.70549902319908, -19.616849720478058], [13.158549554646015, 33.94560143351555, -19.582699984312057], [17.24730059504509, 35.51194816827774, -19.59720067679882], [13.304649852216244, 38.53930160403252, -19.497999921441078], [-13.061599805951118, 74.8170018196106, -19.540250301361084], [-11.715100146830082, 75.0890001654625, -20.58590017259121], [-12.186899781227112, 75.60650259256363, -20.255200564861298], [-15.029899775981903, 78.67500185966492, -19.898999482393265], [-15.727449208498001, 80.84650337696075, -19.955450668931007], [-12.550899758934975, 80.42100071907043, -19.169950857758522], [-11.596949771046638, 81.14500343799591, -19.936300814151764], [-11.698699556291103, 82.76449888944626, -20.109299570322037], [-12.968050315976143, 83.1030011177063, -19.200699403882027], [-14.922100119292736, 84.86150205135345, -20.19454911351204], [-13.760649599134922, 84.83699709177017, -19.444549456238747], [-13.128549791872501, 86.86850219964981, -19.77274939417839], [-15.034399926662445, 87.06200122833252, -19.33104917407036], [-17.25265011191368, 26.81479975581169, -19.966550171375275], [-15.189849771559238, 27.17440016567707, -19.594699144363403], [-17.289049923419952, 28.24060060083866, -20.709900185465813], [-15.791850164532661, 28.138399124145508, -20.609799772500992], [-15.088150277733803, 29.408849775791168, -20.498299971222878], [-16.799800097942352, 29.721349477767944, -20.557299256324768], [-18.410449847579002, 29.16250005364418, -20.531050860881805], [15.37530031055212, 37.69734874367714, -19.559450447559357], [-15.104150399565697, 74.64350014925003, -19.605550915002823], [-14.481550082564354, 75.65400004386902, -20.542949438095093], [-15.33610001206398, 79.3825015425682, -20.567599684000015], [-13.697950169444084, 78.67150008678436, -19.098149612545967], [-15.896100550889969, 82.47900009155273, -20.27600072324276], [-16.882499679923058, 83.23150128126144, -20.601149648427963], [-17.338700592517853, 84.8195031285286, -19.72164958715439], [-19.70534957945347, 26.836900040507317, -19.593549892306328], [-19.39455047249794, 28.221650049090385, -20.427100360393524], [-19.88914981484413, 29.6485498547554, -19.950149580836296], [-12.898550368845463, 29.47239950299263, -19.65554989874363], [-18.223950639367104, 30.048450455069542, -20.379450172185898], [-14.48609959334135, 30.112100765109062, -20.402099937200546], [-13.390500098466873, 30.129900202155113, -20.418399944901466], [19.49005015194416, 34.164149314165115, -19.979000091552734], [-15.2040496468544, 76.53599977493286, -19.700149074196815], [-13.047349639236927, 76.10999792814255, -19.52660083770752], [-17.35679991543293, 78.93600314855576, -20.00950090587139], [-17.839549109339714, 82.55550265312195, -19.97550018131733], [-21.29334956407547, 27.44870074093342, -19.327549263834953], [-17.39165000617504, 31.583648175001144, -19.7502002120018], [-15.360649675130844, 31.801700592041016, -19.914349541068077], [-12.916799634695053, 31.66535124182701, -20.19215002655983], [-13.096749782562256, 33.83930027484894, -19.93595063686371], [12.337899766862392, 35.09499877691269, -19.647499546408653], [11.218699626624584, 35.76729819178581, -19.543800503015518], [11.39924954622984, 37.608448415994644, -19.63525079190731], [-16.93199947476387, 86.72650158405304, -19.37980018556118], [-13.790150173008442, 28.158050030469894, -19.66555044054985], [-19.675899296998978, 31.640298664569855, -19.48785036802292], [-19.71055008471012, 82.73450285196304, -19.460849463939667], [-17.70945079624653, 26.509350165724754, -19.377099350094795], [-11.980299837887287, 31.4020998775959, -19.132349640130997], [-39.72340002655983, 31.634200364351273, -19.707199186086655], [-15.11014997959137, 33.369701355695724, -19.51570063829422], [-11.772600002586842, 33.61715003848076, -18.937349319458008], [14.651600271463394, 33.127300441265106, -18.882550299167633], [19.519299268722534, 35.49744933843613, -18.94490048289299], [16.07920043170452, 35.9858013689518, -19.823849201202393], [-21.659500896930695, 29.467549175024033, -19.693300127983093], [-39.48019817471504, 29.95450049638748, -19.475899636745453], [-41.583601385354996, 31.53429925441742, -19.15550045669079], [-13.117549940943718, 35.316549241542816, -19.213799387216568], [-15.160350129008293, 35.4650504887104, -19.182799383997917], [9.869850240647793, 37.12794929742813, -19.272200763225555], [-17.273249104619026, 74.86599683761597, -19.02100071310997], [-17.318399623036385, 76.8439993262291, -19.255250692367554], [-19.437050446867943, 78.78100126981735, -19.12504993379116], [-17.314350232481956, 80.9980034828186, -19.459450617432594], [-19.415700808167458, 84.77400243282318, -18.653100356459618], [-23.61314930021763, 29.617149382829666, -19.296899437904358], [-41.39905050396919, 29.75280024111271, -18.91539990901947], [-37.530649453401566, 31.56774863600731, -18.8704002648592], [-21.683750674128532, 31.63440153002739, -19.19744908809662], [9.33805014938116, 35.97160056233406, -18.94949935376644], [-16.28055050969124, 26.47409960627556, -19.05974932014942], [-23.443449288606644, 28.095200657844543, -18.859950825572014], [-38.12659904360771, 30.20630031824112, -19.01089958846569], [-23.740749806165695, 31.87450021505356, -18.94479990005493], [-41.03275015950203, 32.9090990126133, -19.0069992095232], [-39.54390063881874, 32.85465016961098, -19.00535076856613], [21.719949319958687, 35.23769974708557, -18.97595077753067], [-19.775500521063805, 81.06350153684616, -18.76864954829216], [-17.513150349259377, 33.54185074567795, -18.954450264573097], [-16.72614924609661, 34.977201372385025, -18.991300836205482], [-25.533750653266907, 29.60819937288761, -18.705250695347786], [-25.704400613904, 31.5527506172657, -18.73820088803768], [16.804449260234833, 37.09540143609047, -18.77490058541298], [-19.70995031297207, 86.3180011510849, -18.834199756383896], [-15.61800017952919, 26.447949931025505, -17.842650413513184], [-14.57470003515482, 26.66500024497509, -17.456699162721634], [-21.57454937696457, 26.68534964323044, -17.460500821471214], [-13.504049740731716, 27.66129933297634, -17.41744950413704], [-23.69995042681694, 27.51230075955391, -17.578650265932083], [-12.117399834096432, 29.997650533914566, -18.49284954369068], [18.813500180840492, 30.725600197911263, -18.839849159121513], [19.543450325727463, 31.51480108499527, -17.451100051403046], [-36.98424994945526, 31.112300232052803, -18.364299088716507], [21.80594950914383, 31.569600105285645, -17.57819950580597], [-41.32099822163582, 33.07585045695305, -17.76750013232231], [-39.44174945354462, 33.44070166349411, -17.263999208807945], [22.789500653743744, 33.275000751018524, -18.802599981427193], [23.754650726914406, 33.850301057100296, -17.435800284147263], [13.787600211799145, 34.10400077700615, -17.736099660396576], [-17.4064002931118, 35.390499979257584, -17.371149733662605], [19.581099972128868, 36.30660101771355, -18.157050013542175], [9.29384957998991, 36.28529980778694, -17.93929934501648], [17.546599730849266, 37.5107005238533, -17.473049461841583], [9.376049973070621, 36.84459999203682, -18.323250114917755], [12.793250381946564, 38.215599954128265, -17.753399908542633], [-13.979350216686726, 74.86700266599655, -17.361000180244446], [-17.15265028178692, 74.16699826717377, -17.744550481438637], [-13.759549707174301, 77.00300216674805, -17.598699778318405], [-13.709800317883492, 78.94749939441681, -17.594899982213974], [-21.719399839639664, 80.6720033288002, -17.844950780272484], [-21.24194987118244, 82.53049850463867, -18.70889961719513], [-21.586600691080093, 86.71849966049194, -17.733950167894363], [-22.956199944019318, 90.78150242567062, -18.703650683164597], [-21.623050794005394, 90.84449708461761, -17.45229959487915], [-21.577849984169006, 91.42599999904633, -18.765900284051895], [-21.2543997913599, 92.14600175619125, -18.843000754714012], [-21.22489921748638, 92.18049794435501, -18.27234961092472], [-17.294850200414658, 26.462100446224213, -17.59999990463257], [-12.586349621415138, 28.821300715208054, -17.672449350357056], [-43.032899498939514, 30.246399343013763, -18.449749797582626], [-43.3618500828743, 29.462099075317383, -17.774399369955063], [-41.8131984770298, 29.58264946937561, -16.985150054097176], [-37.56999969482422, 30.10150045156479, -17.70230010151863], [-42.298901826143265, 31.666800379753113, -17.46794953942299], [17.398150637745857, 32.094601541757584, -17.819199711084366], [-37.601400166749954, 33.552899956703186, -17.573099583387375], [-21.78025059401989, 33.0592505633831, -18.44939962029457], [-19.650649279356003, 33.03875029087067, -18.47974956035614], [15.788950026035309, 33.02590176463127, -17.68594980239868], [-12.210249900817871, 35.28260067105293, -18.44790019094944], [12.760099954903126, 34.95325148105621, -17.30014942586422], [22.57150039076805, 35.34340113401413, -18.52330006659031], [15.156400389969349, 38.1847508251667, -17.752250656485558], [-18.49140040576458, 75.4064992070198, -18.586499616503716], [-19.133949652314186, 76.47500187158585, -18.557550385594368], [-20.35989984869957, 76.49250328540802, -18.245000392198563], [-20.55085077881813, 78.42499762773514, -18.63979920744896], [-21.828049793839455, 83.1495001912117, -18.14815029501915], [-14.188000001013279, 84.48050171136856, -18.32124963402748], [-21.371399983763695, 85.2925032377243, -18.642200157046318], [-21.086499094963074, 85.77500283718109, -18.803700804710388], [-19.797300919890404, 87.16250211000443, -17.28449948132038], [-17.584199085831642, 86.90749853849411, -17.29390025138855], [-23.45149964094162, 90.52649885416031, -17.462600022554398], [-20.237550139427185, 90.79699963331223, -17.86790043115616], [-19.54065077006817, 26.468150317668915, -17.753100022673607], [-25.29424987733364, 28.09230051934719, -17.470799386501312], [-39.55544903874397, 29.38240021467209, -17.378149554133415], [-26.21540054678917, 29.058249667286873, -18.150649964809418], [-27.15279906988144, 31.65784850716591, -18.48825067281723], [-11.769399978220463, 30.182350426912308, -17.21459999680519], [-11.114549823105335, 31.693249940872192, -17.68695004284382], [-35.56229919195175, 31.531650573015213, -17.53610000014305], [23.36765080690384, 32.0092998445034, -17.260100692510605], [-35.46075150370598, 33.5954986512661, -17.45785027742386], [-23.714549839496613, 33.67124870419502, -18.033800646662712], [-18.306950107216835, 34.0302512049675, -18.159549683332443], [-10.908350348472595, 35.54245084524155, -18.035249784588814], [23.337749764323235, 35.21984815597534, -17.023000866174698], [11.184250004589558, 36.00769862532616, -17.401399090886116], [21.459750831127167, 36.351051181554794, -17.52219907939434], [-13.12359981238842, 36.29060089588165, -17.702000215649605], [-15.144850127398968, 36.29019856452942, -17.623549327254295], [11.230450123548508, 37.53200173377991, -17.209550365805626], [-17.669999971985817, 72.76750355958939, -17.62240007519722], [-19.36575025320053, 72.69600033760071, -17.23955012857914], [-19.70360055565834, 74.13499802350998, -18.149100244045258], [-15.313150361180305, 74.6074989438057, -17.224950715899467], [-21.73219993710518, 78.32399755716324, -17.839549109339714], [-13.663800433278084, 80.88800311088562, -17.726950347423553], [-20.208749920129776, 84.42749828100204, -18.167750909924507], [-21.925000473856926, 84.79849994182587, -18.239200115203857], [-15.215899795293808, 84.98650044202805, -17.333749681711197], [-15.92780090868473, 86.71200275421143, -17.692549154162407], [-23.695850744843483, 88.76899629831314, -17.416300252079964], [-27.5494996458292, 29.44899909198284, -17.514750361442566], [-28.14449928700924, 31.61795064806938, -18.207749351859093], [-25.484349578619003, 33.69459882378578, -17.79085025191307], [-13.707200065255165, 82.7919989824295, -18.001500517129898], [-27.596300467848778, 33.542901277542114, -17.646700143814087], [-21.39204926788807, 34.21664983034134, -18.023250624537468], [-19.283650442957878, 34.135349094867706, -17.750699073076248], [-10.91230008751154, 37.534650415182114, -18.047500401735306], [-10.844750329852104, 39.765551686286926, -17.917999997735023], [-25.233250111341476, 88.76699954271317, -17.340950667858124], [-29.60284985601902, 31.661201268434525, -17.709000036120415], [-29.54930067062378, 33.68379920721054, -17.26974919438362], [-10.488799773156643, 33.36134925484657, -17.660750076174736], [-23.496849462389946, 35.80955043435097, -17.943700775504112], [-21.4821994304657, 35.78995168209076, -17.370499670505524], [-25.76485089957714, 35.502199083566666, -17.778849229216576], [-25.58940090239048, 37.863701581954956, -17.945749685168266], [-23.62149953842163, 37.508051842451096, -17.49279908835888], [-13.075999915599823, 37.70525008440018, -17.30090007185936], [-27.745099738240242, 37.50874847173691, -17.951600253582], [-29.38530035316944, 37.55360096693039, -17.619749531149864], [-29.530750587582588, 39.464350789785385, -17.944449558854103], [-27.561699971556664, 39.730001240968704, -17.98889972269535], [-25.55925026535988, 39.51355069875717, -17.42894947528839], [-12.959499843418598, 39.56935182213783, -17.68440008163452], [-12.84135039895773, 41.61065071821213, -17.604999244213104], [-10.84935013204813, 41.49584844708443, -17.668599262833595], [-11.277049779891968, 43.899551033973694, -17.42120087146759], [-21.7141006141901, 76.26199722290039, -17.472250387072563], [-23.614799603819847, 84.94800329208374, -17.36314967274666], [-20.274050533771515, 89.44450318813324, -17.55649968981743], [-21.236000582575798, 88.82699906826019, -17.26374961435795], [-27.678750455379486, 35.583000630140305, -17.316250130534172], [-29.734650626778603, 41.57854989171028, -17.759699374437332], [-31.5544493496418, 41.467998176813126, -17.604250460863113], [-20.898999646306038, 73.40250164270401, -16.90795086324215], [-23.406650871038437, 82.88449794054031, -17.367949709296227], [-29.574599117040634, 30.185749754309654, -16.73934981226921], [-33.579450100660324, 33.742550760507584, -16.9357992708683], [-9.886300191283226, 33.98120030760765, -17.056100070476532], [-19.78844963014126, 35.10329872369766, -16.93674921989441], [-9.424500167369843, 35.743650048971176, -16.939949244260788], [-9.427100419998169, 37.65064850449562, -17.01200008392334], [19.682200625538826, 37.60499879717827, -16.84259995818138], [-9.565699845552444, 39.62330147624016, -16.899550333619118], [-31.884800642728806, 39.445798844099045, -17.21080020070076], [-27.54944935441017, 41.86220094561577, -17.115900292992592], [19.453000277280807, 39.41329941153526, -17.438899725675583], [19.780399277806282, 41.54660180211067, -17.54309982061386], [17.402200028300285, 41.44274815917015, -17.372049391269684], [-12.623700313270092, 43.43489930033684, -16.885649412870407], [6.830200087279081, 68.13649833202362, -17.655549570918083], [8.951949886977673, 68.13549995422363, -17.53699965775013], [4.9156202003359795, 68.17449629306793, -17.55700074136257], [6.890700198709965, 70.12499868869781, -17.577949911355972], [11.119100265204906, 70.22999972105026, -17.658349126577377], [8.954649791121483, 70.14200091362, -17.6766999065876], [13.023000210523605, 69.97600197792053, -17.584150657057762], [15.348600223660469, 70.17949968576431, -17.54149980843067], [8.837600238621235, 72.03350216150284, -17.464900389313698], [11.314949952065945, 71.99150323867798, -17.679449170827866], [13.131200335919857, 71.80149853229523, -17.72885024547577], [15.28680045157671, 72.05349951982498, -17.606349661946297], [-21.688099950551987, 74.40400123596191, -16.998300328850746], [-23.392099887132645, 79.08950001001358, -16.762850806117058], [-14.546750113368034, 81.13250136375427, -16.798749566078186], [-14.849849976599216, 83.15449953079224, -16.98240078985691], [-25.415699928998947, 87.29150146245956, -16.936300322413445], [-33.57214853167534, 31.955301761627197, -16.829900443553925], [-31.537849456071854, 31.684648245573044, -16.86294935643673], [-31.646601855754852, 33.74030068516731, -16.91179908812046], [-29.523000121116638, 35.70840135216713, -16.754750162363052], [-23.902300745248795, 39.246998727321625, -16.61139912903309], [17.6961999386549, 39.494600147008896, -17.430150881409645], [21.531999111175537, 39.68270123004913, -16.88079908490181], [-26.077700778841972, 41.33240133523941, -16.739899292588234], [-31.678348779678345, 43.86330023407936, -16.91650040447712], [-29.59280088543892, 43.44864934682846, -16.911199316382408], [17.233099788427353, 43.623700737953186, -17.127150669693947], [19.585350528359413, 43.82935166358948, -16.879649832844734], [17.482399940490723, 45.88855057954788, -17.263000831007957], [2.903915010392666, 62.15199828147888, -17.38015003502369], [2.9428349807858467, 64.21949714422226, -17.485950142145157], [4.990300163626671, 64.12199884653091, -17.376000061631203], [2.88840988650918, 66.11250340938568, -17.413349822163582], [4.90302499383688, 66.16249680519104, -17.555249854922295], [6.857399828732014, 66.07499718666077, -17.414800822734833], [9.095150046050549, 65.92799723148346, -17.038149759173393], [10.769150219857693, 68.0909976363182, -17.326099798083305], [17.37540028989315, 68.24350357055664, -17.261799424886703], [13.180100359022617, 68.2469978928566, -17.18820072710514], [4.872934892773628, 70.45549899339676, -17.166249454021454], [15.424899756908417, 67.8664967417717, -17.075899988412857], [17.549099400639534, 70.02349942922592, -17.497900873422623], [19.473500549793243, 70.26950269937515, -17.243249341845512], [6.811050232499838, 72.37400114536285, -17.075149342417717], [17.604049295186996, 72.2770020365715, -17.329800873994827], [13.317599892616272, 74.22950118780136, -17.10830070078373], [15.168399550020695, 74.50550049543381, -16.944849863648415], [11.032350361347198, 74.38500225543976, -16.9406495988369], [17.201600596308708, 32.87560120224953, -16.75174944102764], [-22.134650498628616, 37.104249000549316, -16.835549846291542], [-31.651999801397324, 37.86670044064522, -16.804000362753868], [15.434900298714638, 39.44304957985878, -17.097700387239456], [21.55965007841587, 41.43914952874184, -16.80454984307289], [-33.51235017180443, 41.769251227378845, -16.805099323391914], [13.001799583435059, 41.73574969172478, -17.103150486946106], [12.973199598491192, 43.71950030326843, -17.15949922800064], [15.15404973179102, 43.74299943447113, -17.351100221276283], [14.920299872756004, 45.9292009472847, -17.29479990899563], [-11.110249906778336, 45.41600123047829, -16.8078001588583], [17.307499423623085, 48.10820147395134, -17.34199933707714], [15.099849551916122, 48.36390167474747, -16.993800178170204], [19.517699256539345, 48.2184998691082, -17.05870032310486], [17.061399295926094, 50.17000064253807, -17.14175008237362], [19.75635066628456, 50.271499902009964, -17.2109492123127], [1.1484549613669515, 58.12999978661537, -17.146000638604164], [1.0422549676150084, 60.17649918794632, -17.301099374890327], [-0.9477150160819292, 60.175999999046326, -17.11284928023815], [0.891459989361465, 62.185999006032944, -17.315000295639038], [0.9675649926066399, 64.24999982118607, -17.220700159668922], [7.017150055617094, 64.11399692296982, -17.0089490711689], [0.9122900082729757, 66.2510022521019, -17.00199954211712], [2.9366048984229565, 68.0909976363182, -17.198549583554268], [11.116700246930122, 66.27599895000458, -16.788849607110023], [19.76119913160801, 68.14400106668472, -17.241649329662323], [19.52439919114113, 72.18100130558014, -16.95849932730198], [9.038499556481838, 74.1565003991127, -16.848700121045113], [17.413800582289696, 74.15200024843216, -16.866950318217278], [-23.68145063519478, 80.77900111675262, -16.78304933011532], [-36.45344823598862, 30.460499227046967, -16.915850341320038], [12.96200044453144, 39.695750921964645, -16.994399949908257], [15.368600375950336, 41.52974858880043, -17.194949090480804], [-33.266499638557434, 43.47220063209534, -16.728900372982025], [12.95975036919117, 46.06034979224205, -16.81080088019371], [19.75269988179207, 46.26639932394028, -16.753999516367912], [21.62794955074787, 50.16649886965752, -16.77905023097992], [17.773600295186043, 52.09000036120415, -16.922449693083763], [19.772199913859367, 52.35449969768524, -17.177099362015724], [21.723149344325066, 52.40600183606148, -16.932500526309013], [19.593000411987305, 54.25800010561943, -16.92969910800457], [21.754300221800804, 54.35999855399132, -17.06570014357567], [-1.0199949610978365, 56.35799840092659, -17.20624975860119], [-3.007699968293309, 56.329499930143356, -17.005950212478638], [1.0689250193536282, 56.13400042057037, -16.961250454187393], [-3.0913350638002157, 58.22300165891647, -16.860250383615494], [-0.9813300566747785, 58.389998972415924, -17.178850248456], [3.179005114361644, 60.12500077486038, -17.070600762963295], [21.33999951183796, 60.22850051522255, -16.988899558782578], [23.632299154996872, 60.23800000548363, -17.032800242304802], [-1.0332500096410513, 62.24000081419945, -16.91724918782711], [21.362749859690666, 62.28100135922432, -17.08490028977394], [23.681599646806717, 62.114499509334564, -17.055649310350418], [5.1993997767567635, 62.180500477552414, -16.972549259662628], [21.715300157666206, 64.24950063228607, -17.1338003128767], [23.4957505017519, 64.23249840736389, -16.987299546599388], [-0.875169993378222, 64.27150219678879, -16.746100038290024], [8.692599833011627, 64.42449986934662, -16.638999804854393], [21.75690047442913, 66.11049920320511, -17.112599685788155], [19.53515037894249, 66.07949733734131, -17.04154908657074], [1.2337800581008196, 68.12050193548203, -16.755150631070137], [21.72905020415783, 68.05100291967392, -17.05940067768097], [21.825699135661125, 70.27699798345566, -16.868000850081444], [3.1036599539220333, 70.14200091362, -16.746550798416138], [5.240350030362606, 71.99949771165848, -16.776449978351593], [-23.308249190449715, 86.83600276708603, -16.63755066692829], [-26.686500757932663, 28.547950088977814, -16.6812501847744], [21.280700340867043, 37.93204948306084, -16.61279983818531], [-32.983049750328064, 39.99809920787811, -16.788199543952942], [21.21580019593239, 43.06764900684357, -16.7130995541811], [15.536850318312645, 50.270501524209976, -16.699200496077538], [-0.9425349999219179, 52.354998886585236, -16.772300004959106], [-2.8979999478906393, 51.95000022649765, -16.841549426317215], [-4.914605058729649, 52.14900150895119, -16.79849997162819], [-0.9751649922691286, 54.365500807762146, -16.998499631881714], [-4.848570097237825, 54.41199988126755, -16.732150688767433], [-2.9965450521558523, 54.33399975299835, -16.978399828076363], [23.495299741625786, 54.029498249292374, -16.721250489354134], [0.6833799998275936, 54.42800000309944, -16.73940010368824], [19.70909908413887, 56.23399838805199, -16.6982002556324], [21.48200012743473, 56.324999779462814, -16.9747993350029], [23.785300552845, 56.274499744176865, -16.835149377584457], [23.652950301766396, 58.21099877357483, -16.958700492978096], [21.51555009186268, 58.24900045990944, -16.95214956998825], [3.1317099928855896, 58.346498757600784, -16.727199777960777], [-2.8108449187129736, 60.31949818134308, -16.755200922489166], [19.777750596404076, 64.29199874401093, -16.82169921696186], [23.750150576233864, 66.25749915838242, -16.87229983508587], [17.423249781131744, 66.31500273942947, -16.702299937605858], [23.608749732375145, 68.12400370836258, -16.794349998235703], [-22.873500362038612, 76.5715017914772, -16.60184934735298], [19.85340006649494, 32.18214958906174, -15.335150063037872], [-41.74795001745224, 33.6776003241539, -15.243150293827057], [24.573149159550667, 33.196501433849335, -16.705850139260292], [15.357499942183495, 33.42675045132637, -16.013899818062782], [-8.857750333845615, 35.65619885921478, -15.352199785411358], [-19.502250477671623, 35.82710027694702, -15.668049454689026], [-15.51750022917986, 36.4452488720417, -15.982499346137047], [11.312250047922134, 39.420150220394135, -16.582800075411797], [11.376099660992622, 41.59124940633774, -16.704900190234184], [-9.631600230932236, 41.428301483392715, -16.520099714398384], [11.554599739611149, 43.83604973554611, -16.625450924038887], [21.702300757169724, 43.95980015397072, -15.43550007045269], [-11.275799944996834, 46.12069949507713, -15.824200585484505], [13.716050423681736, 48.02050068974495, -16.60745032131672], [20.95559984445572, 48.37099835276604, -16.63210056722164], [-3.115494968369603, 50.13950169086456, -16.76665060222149], [-4.800150170922279, 50.21600052714348, -16.797300428152084], [16.290750354528427, 51.87999829649925, -16.519900411367416], [22.822000086307526, 52.209001034498215, -16.69814996421337], [18.080750480294228, 53.990498185157776, -16.58800058066845], [0.562085013370961, 52.98500135540962, -16.540100798010826], [-4.38296515494585, 56.32000043988228, -16.764050349593163], [20.19510045647621, 58.30699950456619, -16.671450808644295], [25.21350048482418, 58.50499868392944, -16.642499715089798], [25.496549904346466, 60.33200025558472, -16.61914959549904], [4.7358800657093525, 60.52650138735771, -16.659799963235855], [20.152749493718147, 60.36200001835823, -16.707850620150566], [-2.487905090674758, 62.21599876880646, -16.514649614691734], [19.80390027165413, 62.519997358322144, -16.628649085760117], [25.583850219845772, 62.34150007367134, -16.640400514006615], [6.449200212955475, 62.19150125980377, -16.519399359822273], [25.478100404143333, 64.18950110673904, -16.55000075697899], [18.316449597477913, 64.75050002336502, -16.526399180293083], [-0.6582100177183747, 65.86500257253647, -16.643749549984932], [24.931149557232857, 66.00750237703323, -16.588550060987473], [13.550249859690666, 66.90599769353867, -16.660550609230995], [15.751499682664871, 66.7480006814003, -16.695350408554077], [3.504059975966811, 71.63950055837631, -16.428299248218536], [21.461650729179382, 71.80249691009521, -16.575949266552925], [-17.409000545740128, 72.38700240850449, -15.634650364518166], [-19.842399284243584, 71.99399918317795, -15.919549390673637], [7.2003500536084175, 73.80899786949158, -16.616150736808777], [-16.549449414014816, 73.85549694299698, -16.27420075237751], [-14.665050432085991, 76.22750103473663, -15.618300065398216], [-25.36039985716343, 83.37199687957764, -16.425399109721184], [-25.701750069856644, 85.14399826526642, -15.766600146889687], [-16.343150287866592, 85.52800118923187, -16.450999304652214], [-17.61149987578392, 26.558250188827515, -15.155700035393238], [-15.866050496697426, 26.47309936583042, -15.89285023510456], [-21.774999797344208, 26.9322507083416, -15.324899926781654], [-15.02930000424385, 27.152299880981445, -15.174799598753452], [-23.600850254297256, 27.540700510144234, -15.453499741852283], [-25.556549429893494, 28.262000530958176, -15.58309979736805], [-27.665499597787857, 29.219800606369972, -15.060050413012505], [-12.910350225865841, 29.461750760674477, -15.224150381982327], [-39.493199437856674, 29.362449422478676, -15.319200232625008], [-11.911899782717228, 30.158499255776405, -15.916049480438232], [-37.531498819589615, 29.80724908411503, -15.234200283885002], [-35.94709932804108, 30.349450185894966, -15.383400022983551], [-42.51629859209061, 31.37049823999405, -15.61024971306324], [-11.085250414907932, 31.64689987897873, -15.306550078094006], [-33.50045159459114, 31.209450215101242, -15.548399649560452], [-31.835351139307022, 30.980249866843224, -15.183350071310997], [21.632449701428413, 31.58405050635338, -15.554750338196754], [23.467449471354485, 31.050100922584534, -15.559050254523754], [24.500299245119095, 32.10584819316864, -16.631949692964554], [25.547299534082413, 31.573951244354248, -15.676800161600113], [17.49804988503456, 32.90925174951553, -15.54310042411089], [25.415850803256035, 33.693499863147736, -15.247450210154057], [-9.852100163698196, 33.352650701999664, -15.535449609160423], [13.419399969279766, 33.51784870028496, -15.749199315905571], [-37.46910020709038, 34.309301525354385, -15.442900359630585], [-36.111198365688324, 34.441251307725906, -15.646949410438538], [12.328250333666801, 35.022251307964325, -16.32314920425415], [23.713450878858566, 35.60340031981468, -15.15134982764721], [22.348450496792793, 36.38409823179245, -15.922199934720993], [-31.845849007368088, 35.802651196718216, -15.888649970293045], [-21.41745015978813, 37.747450172901154, -15.208699740469456], [22.22995087504387, 37.39380091428757, -15.943499282002449], [-33.90505164861679, 39.297498762607574, -15.886649489402771], [-25.470249354839325, 42.0556515455246, -15.413950197398663], [-13.595299795269966, 41.82495176792145, -16.05845056474209], [-8.650099858641624, 41.77255183458328, -15.993250533938408], [-27.951199561357498, 43.14634948968887, -16.408799216151237], [-27.20789983868599, 42.76290163397789, -16.165899112820625], [-13.149850070476532, 43.92734915018082, -15.561000443994999], [-10.106050409376621, 43.49825158715248, -16.44054986536503], [-34.087300300598145, 44.270798563957214, -16.10570028424263], [-29.31619994342327, 44.40784826874733, -15.80044999718666], [-31.445201486349106, 45.76810076832771, -15.463350340723991], [-12.082099914550781, 44.71245035529137, -16.175249591469765], [10.753000155091286, 44.13264989852905, -16.053099185228348], [12.078800238668919, 45.03300040960312, -16.608649864792824], [-6.8720499984920025, 48.34530130028725, -16.503600403666496], [-4.94876503944397, 47.98484966158867, -16.49314910173416], [-3.2022399827837944, 48.52814972400665, -16.471799463033676], [-6.897999905049801, 50.28950050473213, -16.508499160408974], [14.484300278127193, 50.36100000143051, -16.136249527335167], [-1.419509993866086, 50.21649971604347, -16.512099653482437], [-6.537649780511856, 52.353501319885254, -16.527950763702393], [3.3648901153355837, 56.201498955488205, -15.876799821853638], [25.15145018696785, 56.22199922800064, -16.462599858641624], [2.583645051345229, 56.73149973154068, -16.58100076019764], [-4.450609907507896, 57.61599913239479, -16.61060005426407], [19.27899941802025, 60.23050099611282, -16.19729958474636], [18.858399242162704, 62.0804987847805, -16.061149537563324], [7.5158001855015755, 62.02549859881401, -15.799950808286667], [12.850400060415268, 65.73150306940079, -16.175299882888794], [0.48247649101540446, 68.70850175619125, -16.29900000989437], [23.222200572490692, 70.11000066995621, -16.581149771809578], [24.072300642728806, 70.17599791288376, -16.217000782489777], [1.4961600536480546, 69.65799629688263, -16.370100900530815], [4.643685184419155, 72.83750176429749, -16.184799373149872], [19.292300567030907, 73.60749691724777, -16.528049483895302], [-22.260649129748344, 73.70000332593918, -16.002150252461433], [11.062400415539742, 76.45750045776367, -15.33455029129982], [12.136000208556652, 75.56849718093872, -16.37819968163967], [13.080899603664875, 76.53100043535233, -15.387900173664093], [15.413199551403522, 75.64949989318848, -16.32869988679886], [15.268649905920029, 76.58649981021881, -15.349149703979492], [-23.7614493817091, 76.32800191640854, -15.679700300097466], [-14.52529989182949, 78.65750044584274, -15.510099940001965], [-14.559700153768063, 79.54549789428711, -16.41939952969551], [-15.687499195337296, 82.64999836683273, -15.47439955174923], [-25.90774931013584, 82.78899639844894, -15.844900161027908], [-24.57660064101219, 84.77749675512314, -16.44515059888363], [-16.01085066795349, 84.15249735116959, -16.097750514745712], [-17.688050866127014, 86.16799861192703, -15.590899623930454], [-25.731150060892105, 86.32300049066544, -15.985600650310516], [-26.55790001153946, 87.47400343418121, -16.41860045492649], [-25.507550686597824, 88.57899904251099, -15.294450335204601], [-23.775100708007812, 89.37250077724457, -15.172899700701237], [-23.086000233888626, 90.15200287103653, -15.933100134134293], [-22.25489914417267, 90.18749743700027, -15.922300517559052], [-20.21149918437004, 26.510100811719894, -16.29910059273243], [-32.07245096564293, 37.08679974079132, -16.23239926993847], [-33.480700105428696, 37.71565109491348, -15.447850339114666], [10.393399745225906, 41.47949814796448, -16.170350834727287], [22.16245047748089, 42.05489903688431, -16.189999878406525], [-6.670849863439798, 46.89750075340271, -16.45285077393055], [-6.840500049293041, 45.845698565244675, -16.253750771284103], [12.60450016707182, 48.12309890985489, -15.916850417852402], [21.98454923927784, 47.85750061273575, -15.95655083656311], [-1.0494999587535858, 48.13940078020096, -15.682199969887733], [23.535549640655518, 49.82985183596611, -15.677349641919136], [-7.384900003671646, 52.433498203754425, -16.229750588536263], [-0.3018440038431436, 51.04149878025055, -16.251949593424797], [15.22149983793497, 52.365999668836594, -15.597550198435783], [24.068349972367287, 51.961999386548996, -16.146600246429443], [1.2608800316229463, 52.307501435279846, -15.87270013988018], [-6.563649978488684, 53.85399982333183, -16.383200883865356], [1.520470017567277, 53.86349931359291, -16.20754972100258], [16.987500712275505, 54.43749949336052, -15.759099274873734], [-7.111750077456236, 54.546501487493515, -15.974899753928185], [25.65469965338707, 53.98450046777725, -15.75935073196888], [-5.445399787276983, 56.20099976658821, -16.321849077939987], [17.371000722050667, 56.18949979543686, -15.324600040912628], [-5.419999826699495, 58.32900106906891, -15.96280001103878], [19.1042497754097, 58.092501014471054, -16.146749258041382], [5.057400092482567, 58.25600028038025, -15.363399870693684], [-5.134350154548883, 60.31550094485283, -15.721550211310387], [5.53479976952076, 59.68799814581871, -15.886999666690826], [-3.667674958705902, 62.449999153614044, -15.953099355101585], [10.889049619436264, 64.17249888181686, -15.359049662947655], [26.246700435876846, 66.12300127744675, -16.17944985628128], [25.81785060465336, 68.01500171422958, -15.934249386191368], [-1.0502099758014083, 68.26549768447876, -15.55825024843216], [5.042300093919039, 74.3665024638176, -15.23470040410757], [20.063450559973717, 74.4979977607727, -15.818599611520767], [6.9217500276863575, 74.83749836683273, -15.783600509166718], [-23.50440062582493, 74.4514986872673, -15.616049990057945], [10.35735011100769, 75.48599690198898, -16.232699155807495], [17.36520044505596, 76.22650265693665, -15.384850092232227], [-25.682000443339348, 80.55850118398666, -15.65760001540184], [-27.274450287222862, 86.8844985961914, -15.382549725472927], [-19.76419985294342, 26.557600125670433, -15.377149917185307], [-17.324000597000122, 26.522250846028328, -16.068749129772186], [-29.34885025024414, 29.896600171923637, -15.111650340259075], [-34.661151468753815, 34.60479900240898, -16.056450083851814], [-33.52634981274605, 35.54980084300041, -15.082400292158127], [10.427449829876423, 37.65594959259033, -16.082199290394783], [-8.584249764680862, 37.53004968166351, -15.626750886440277], [-13.868199661374092, 39.7723987698555, -15.991199761629105], [10.311449877917767, 38.950350135564804, -16.16235077381134], [-8.583099581301212, 39.65720161795616, -15.904050320386887], [-35.47839820384979, 41.50170087814331, -15.26935026049614], [-35.51959991455078, 43.68999972939491, -15.28919953852892], [-8.809049613773823, 43.70199888944626, -16.064250841736794], [-27.559949085116386, 43.83635148406029, -15.177549794316292], [-6.909550167620182, 43.93380135297775, -16.09024964272976], [20.26825025677681, 44.926151633262634, -16.133299097418785], [-9.361449629068375, 45.92235013842583, -16.05845056474209], [-33.57885032892227, 45.66960036754608, -15.53419977426529], [11.032150126993656, 46.215951442718506, -15.606150031089783], [-5.019600037485361, 45.922648161649704, -16.16944931447506], [-3.1143799424171448, 46.00929841399193, -15.926249325275421], [-9.03830025345087, 48.140451312065125, -15.993449836969376], [-0.5603599711321294, 49.9889999628067, -16.1483995616436], [26.22614987194538, 56.154001504182816, -15.933800488710403], [18.494300544261932, 56.53350055217743, -16.058549284934998], [26.20824985206127, 57.862501591444016, -16.253549605607986], [27.470149099826813, 60.21549925208092, -15.720050781965256], [27.522750198841095, 62.11499869823456, -15.721550211310387], [9.008700028061867, 62.50300258398056, -15.02820011228323], [27.549199759960175, 64.17950242757797, -15.648549422621727], [-3.097265027463436, 64.12900239229202, -15.8012006431818], [17.40100048482418, 64.022496342659, -15.646200627088547], [-2.890764968469739, 66.22199714183807, -15.138099901378155], [15.183200128376484, 65.64249843358994, -15.968799591064453], [-1.602969947271049, 66.6164979338646, -15.905400738120079], [0.8596350089646876, 70.66349685192108, -15.527499839663506], [2.848939970135689, 72.40650057792664, -15.570299699902534], [23.760400712490082, 72.3389983177185, -15.511849895119667], [22.13124930858612, 72.60199636220932, -16.169600188732147], [-21.775050088763237, 72.08699733018875, -16.017049551010132], [21.7995997518301, 74.22299683094025, -15.326299704611301], [-15.182649716734886, 74.33199882507324, -15.173249877989292], [-15.03910031169653, 80.82599937915802, -15.267250128090382], [-24.25454929471016, 86.47549897432327, -16.1469504237175], [-21.167699247598648, 87.43800222873688, -15.054699964821339], [-21.663600578904152, 88.77649903297424, -15.459350310266018], [11.289400048553944, 33.621300011873245, -15.175649896264076], [10.701999999582767, 35.4420505464077, -15.6809501349926], [-23.21919985115528, 39.796698838472366, -15.308000147342682], [23.576250299811363, 39.763499051332474, -15.224199742078781], [-2.4747850839048624, 47.406699508428574, -15.986200422048569], [-9.119000285863876, 50.30300095677376, -15.603650361299515], [-9.082499891519547, 52.27449908852577, -15.249949879944324], [2.9287850484251976, 54.49650064110756, -15.252349898219109], [-7.178850006312132, 56.356001645326614, -15.415649861097336], [27.60230004787445, 58.09750035405159, -15.385299921035767], [6.740749813616276, 60.3644996881485, -15.1765001937747], [9.286699816584587, 63.67100030183792, -15.818500891327858], [-21.693449467420578, 70.61800360679626, -15.049249865114689], [-19.721349701285362, 70.14550268650055, -15.295750461518764], [9.161749854683876, 76.29799842834473, -15.118800103664398], [8.625599555671215, 75.41000097990036, -15.913499519228935], [-19.508449360728264, 86.77099645137787, -15.069699846208096], [23.651650175452232, 37.617649883031845, -15.127000398933887], [9.261500090360641, 39.701301604509354, -15.597349964082241], [-24.5046503841877, 40.70660099387169, -15.95810055732727], [-5.052550230175257, 43.83004829287529, -15.772299841046333], [21.688099950551987, 46.15899920463562, -15.445699915289879], [0.9161849739030004, 50.378501415252686, -15.213199891149998], [-4.952460061758757, 62.0109997689724, -15.15084970742464], [27.56665088236332, 66.20199978351593, -15.349100343883038], [25.567999109625816, 70.40700316429138, -15.3182502835989], [-23.562850430607796, 72.20300287008286, -15.206900425255299], [18.28780025243759, 75.24900138378143, -15.899550169706345], [-24.10624921321869, 78.55349779129028, -15.531850047409534], [-4.983790218830109, 94.95099633932114, -15.385599806904793], [-2.991779940202832, 94.9999988079071, -15.224349685013294], [-2.966139931231737, 96.47750109434128, -15.31434990465641], [-1.5606599627062678, 96.86300158500671, -15.691500157117844], [-13.845150358974934, 28.145799413323402, -15.335850417613983], [-41.60264879465103, 29.506200924515724, -14.955650083720684], [-34.86575186252594, 30.74684925377369, -14.93964996188879], [18.976500257849693, 32.68589824438095, -15.286150388419628], [-39.45085033774376, 33.94480049610138, -15.077600255608559], [-35.44740006327629, 34.89140048623085, -14.742099680006504], [-17.959950491786003, 35.799648612737656, -15.170300379395485], [-15.31280018389225, 37.56074979901314, -15.305399894714355], [8.990650065243244, 37.462398409843445, -15.064549632370472], [-14.06165026128292, 37.84295171499252, -15.722749754786491], [-15.341750346124172, 39.500199258327484, -15.224849805235863], [-7.011250127106905, 39.334751665592194, -15.084899961948395], [-15.246899798512459, 41.690051555633545, -15.042750164866447], [23.14325049519539, 41.623201221227646, -14.984999783337116], [-24.05169978737831, 41.10870137810707, -14.928050339221954], [8.834349922835827, 41.415851563215256, -15.02980012446642], [-6.953349802643061, 41.69460013508797, -15.65524935722351], [9.390749968588352, 43.609101325273514, -15.08999988436699], [-2.857780084013939, 43.84255036711693, -15.019799582660198], [9.727300144731998, 45.54729908704758, -14.759100042283535], [-29.8396497964859, 45.42459920048714, -14.904799871146679], [-13.088599778711796, 45.59744894504547, -14.834149740636349], [-1.1627100175246596, 46.18449881672859, -14.909000135958195], [-10.972750373184681, 48.07420074939728, -15.10975044220686], [11.443049646914005, 48.06319996714592, -15.037200413644314], [23.44224974513054, 47.98955097794533, -14.80565033853054], [13.05755041539669, 50.20949989557266, -15.165500342845917], [25.588899850845337, 52.18150094151497, -15.093700028955936], [15.724549070000648, 54.0505014359951, -15.035849995911121], [-8.74170009046793, 54.2214997112751, -14.870749786496162], [27.73444913327694, 56.32450059056282, -14.916700311005116], [4.433885216712952, 56.35400116443634, -14.824549667537212], [-6.907300092279911, 58.367498219013214, -14.874500222504139], [17.479749396443367, 58.17199870944023, -14.933300204575062], [17.648400738835335, 60.23800000548363, -15.013400465250015], [17.386050894856453, 62.286000698804855, -15.132100321352482], [13.214649632573128, 64.76049870252609, -15.14974981546402], [15.444999560713768, 64.73349779844284, -15.160850249230862], [1.3702999567613006, 72.31750339269638, -14.814550057053566], [3.115009982138872, 73.69299978017807, -14.703449793159962], [7.0011499337852, 75.8574977517128, -14.871650375425816], [19.101250916719437, 76.05750113725662, -14.942999929189682], [-16.9366504997015, 84.77000147104263, -14.860750176012516], [-27.607399970293045, 85.04600077867508, -14.828849583864212], [-20.433450117707253, 36.733049899339676, -15.222449786961079], [-4.884560126811266, 41.468601673841476, -15.060899779200554], [27.365999296307564, 68.30400228500366, -14.866000041365623], [-0.723504985217005, 70.0799971818924, -14.699799939990044], [-27.579650282859802, 80.8504968881607, -14.91320040076971], [-4.461809992790222, 96.07650339603424, -14.80835024267435], [-43.72059926390648, 29.839549213647842, -14.577150344848633], [-30.974000692367554, 30.54480068385601, -15.281249769032001], [23.97965081036091, 30.37315048277378, -14.596150256693363], [25.766100734472275, 30.14099970459938, -14.798450283706188], [9.218350052833557, 35.707101225852966, -14.835399575531483], [-35.24494916200638, 39.489950984716415, -14.701900072395802], [-15.067200176417828, 43.67595165967941, -14.568050391972065], [-35.347748547792435, 45.46479880809784, -14.660200104117393], [0.48072548815980554, 48.57270047068596, -14.721550047397614], [-10.54459996521473, 50.21499842405319, -14.770249836146832], [25.04269964993, 50.49249902367592, -14.820300042629242], [2.4264398962259293, 52.45950073003769, -14.758950099349022], [-4.460244905203581, 63.81600350141525, -14.832000248134136], [25.388849899172783, 71.99700176715851, -14.680149964988232], [-15.667950734496117, 72.22100347280502, -14.7598497569561], [23.38705025613308, 73.82349669933319, -14.767300337553024], [-6.859750021249056, 92.93749928474426, -14.91244975477457], [-4.963359795510769, 93.48099678754807, -14.796700328588486], [-7.005849853157997, 94.60899978876114, -14.779649674892426], [-1.9349800422787666, 95.70349752902985, -15.125400386750698], [-17.233150079846382, 37.45634853839874, -14.804249629378319], [27.173049747943878, 54.39149960875511, -14.781399630010128], [-6.432599853724241, 60.09000167250633, -14.625799842178822], [-27.764299884438515, 82.70250260829926, -14.749799855053425], [-25.928150862455368, 28.65164913237095, -14.648900367319584], [13.191649690270424, 32.131798565387726, -14.716249890625477], [15.051649883389473, 32.218050211668015, -14.778349548578262], [-5.433550104498863, 39.655499160289764, -14.639549888670444], [-3.619475057348609, 42.09284856915474, -14.761149883270264], [28.952300548553467, 60.44049933552742, -14.621799811720848], [29.033450409770012, 62.39499896764755, -14.60960041731596], [28.94660085439682, 64.08250331878662, -14.61120042949915], [-17.44074933230877, 69.99050080776215, -14.89889994263649], [-8.734500035643578, 92.85549819469452, -14.710250310599804], [-15.728000551462173, 27.94319950044155, -13.443750329315662], [-23.66805076599121, 28.149299323558807, -13.291199691593647], [-39.372749626636505, 29.29460071027279, -13.15889973193407], [-35.36750003695488, 30.28004989027977, -13.244500383734703], [26.92195028066635, 31.88975155353546, -14.626150019466877], [-33.94110128283501, 30.916599556803703, -13.651249930262566], [-43.52555051445961, 31.633999198675156, -14.608800411224365], [21.764950826764107, 31.04734979569912, -13.365199789404869], [17.08330027759075, 32.17194974422455, -14.556399546563625], [-43.085549026727676, 33.43839943408966, -14.452350325882435], [-9.077049791812897, 33.37530046701431, -13.501299545168877], [8.93229991197586, 33.425651490688324, -13.46485037356615], [-37.54635155200958, 34.81385111808777, -14.355650171637535], [-19.370099529623985, 37.60179877281189, -14.498949982225895], [-7.294150069355965, 37.66379877924919, -14.622249640524387], [-34.25614908337593, 36.958448588848114, -13.25829979032278], [-22.161200642585754, 39.06720131635666, -14.467749744653702], [-17.491549253463745, 39.72160071134567, -14.713349752128124], [8.145700208842754, 39.40805047750473, -14.496750198304653], [-17.14085042476654, 41.61275178194046, -14.531750231981277], [-23.652350530028343, 41.93570092320442, -13.574699871242046], [8.33440013229847, 42.071498930454254, -14.255549758672714], [-25.38355067372322, 42.82575100660324, -14.121750369668007], [23.36069941520691, 41.9236496090889, -13.054500333964825], [-25.968700647354126, 43.21319982409477, -14.374599792063236], [22.54059910774231, 43.23489964008331, -14.343099668622017], [-27.393650263547897, 44.43315044045448, -13.399249874055386], [-1.3372700195759535, 44.81419920921326, -14.370850287377834], [22.55295030772686, 45.789748430252075, -14.524949714541435], [-34.01919826865196, 46.90539836883545, -14.275950379669666], [-31.31899982690811, 46.73530161380768, -14.235399663448334], [-12.346300296485424, 47.59259894490242, -14.524449594318867], [10.1500004529953, 47.0210500061512, -14.425450004637241], [-33.042099326848984, 47.01890051364899, -14.353250153362751], [25.671549141407013, 49.73375052213669, -13.525299727916718], [3.212495008483529, 51.88100039958954, -13.366100378334522], [13.957049697637558, 52.228499203920364, -14.630299992859364], [13.061700388789177, 52.228499203920364, -13.311999849975109], [3.4970699343830347, 53.5379983484745, -14.05125018209219], [14.868849888443947, 54.41249907016754, -13.906399719417095], [-8.48739966750145, 55.810000747442245, -14.307700097560883], [16.160549595952034, 55.84150180220604, -14.473600313067436], [5.319300107657909, 56.14100024104118, -13.57400044798851], [6.396249867975712, 58.731500059366226, -14.364649541676044], [7.73815019056201, 59.75300073623657, -13.758550398051739], [16.202300786972046, 62.83300369977951, -14.356049709022045], [12.215799652040005, 63.751496374607086, -14.255049638450146], [-5.438949912786484, 64.24249708652496, -13.476749882102013], [29.50024977326393, 66.30299985408783, -13.39734997600317], [-2.4695799220353365, 68.15849989652634, -14.365199953317642], [28.136499226093292, 68.8060000538826, -13.991099782288074], [-19.533200189471245, 68.21350008249283, -14.594299718737602], [-17.759500071406364, 68.30199807882309, -14.61744960397482], [26.904450729489326, 69.8309987783432, -14.546600170433521], [-23.202499374747276, 71.36400043964386, -14.411100186407566], [-24.951649829745293, 72.81699776649475, -14.746399596333504], [-25.19804984331131, 74.23649728298187, -14.631450176239014], [23.882100358605385, 74.82349872589111, -13.382050208747387], [4.967025015503168, 76.22849941253662, -13.118349947035313], [20.47334983944893, 75.70800185203552, -14.686600305140018], [-25.348249822854996, 76.6804963350296, -14.650699682533741], [-14.127049595117569, 76.5490010380745, -14.414000324904919], [-14.264550060033798, 78.43200117349625, -14.425849542021751], [-25.553949177265167, 78.9944976568222, -14.580350369215012], [-14.480150304734707, 80.98100125789642, -13.790350407361984], [-29.008449986577034, 81.09550178050995, -14.358299784362316], [-14.989799819886684, 82.62249827384949, -13.425899669528008], [-27.693400159478188, 87.26000040769577, -13.790350407361984], [-21.674450486898422, 87.67849951982498, -13.848899863660336], [-7.027999963611364, 92.3914983868599, -13.06384988129139], [27.23879925906658, 30.06104938685894, -14.437899924814701], [-11.070850305259228, 31.464699655771255, -13.53325042873621], [11.263749562203884, 32.111749053001404, -14.3563998863101], [10.013050399720669, 33.74344855546951, -14.588399790227413], [8.45940038561821, 35.403549671173096, -13.997199945151806], [-35.26569902896881, 38.0590483546257, -13.190150260925293], [-31.586650758981705, 47.34715074300766, -13.265949673950672], [-13.761949725449085, 46.36780172586441, -14.03720024973154], [10.534550063312054, 48.59384894371033, -13.267000205814838], [-11.511949822306633, 50.31999945640564, -13.74175027012825], [-10.966150090098381, 52.386000752449036, -13.225900009274483], [27.354750782251358, 52.26600170135498, -13.246449641883373], [28.140699490904808, 54.52150106430054, -13.670549727976322], [-9.254800155758858, 56.361500173807144, -13.081200420856476], [28.810400515794754, 58.814000338315964, -14.5176500082016], [10.895050130784512, 62.33150139451027, -13.233699835836887], [14.844849705696106, 63.68499994277954, -13.983350247144699], [-3.091159975156188, 68.401999771595, -13.475949876010418], [-15.788750723004341, 70.16099989414215, -14.531100168824196], [-14.189300127327442, 74.66600090265274, -14.38899990171194], [2.898880047723651, 74.90299642086029, -13.261400163173676], [21.518949419260025, 76.3159990310669, -13.320550322532654], [19.843649119138718, 76.93249732255936, -13.507800176739693], [10.498049668967724, 77.31950283050537, -14.232399873435497], [15.882400795817375, 77.41499692201614, -14.180200174450874], [-8.382249623537064, 94.26400065422058, -14.412949793040752], [-19.22059990465641, 27.069000527262688, -13.31380009651184], [-25.628499686717987, 28.99784967303276, -13.226600363850594], [-13.388600200414658, 29.474399983882904, -13.204749673604965], [-44.941700994968414, 29.17500026524067, -13.958649709820747], [-43.83924975991249, 31.539548188447952, -13.532250188291073], [27.30889990925789, 33.06775167584419, -13.099250383675098], [-39.32280093431473, 33.97924825549126, -13.004199601709843], [-19.237250089645386, 39.08580169081688, -14.422450214624405], [-4.527075216174126, 39.32974860072136, -13.922849670052528], [-2.7518500573933125, 41.4731502532959, -13.817350380122662], [11.488550342619419, 50.076499581336975, -13.201099820435047], [-9.707850404083729, 54.52850088477135, -13.661449775099754], [8.964049629867077, 60.70299819111824, -13.112200424075127], [-6.072049960494041, 61.69949844479561, -14.200449921190739], [16.566550359129906, 61.72750145196915, -14.236800372600555], [13.029550202190876, 63.560500741004944, -13.740399852395058], [-4.70176013186574, 65.96550345420837, -13.168799690902233], [-27.75385044515133, 78.69499921798706, -13.671300373971462], [-10.2960504591465, 92.29099750518799, -14.398500323295593], [-5.5796499364078045, 93.09100359678268, -13.532849960029125], [-21.398499608039856, 27.529550716280937, -13.176100328564644], [25.541599839925766, 29.174799099564552, -13.27965036034584], [27.681199833750725, 29.479099437594414, -13.771950267255306], [-30.62400035560131, 30.52780032157898, -14.231249690055847], [12.906650081276894, 31.15849941968918, -14.150049537420273], [15.537249855697155, 31.058449298143387, -13.917099684476852], [10.789750143885612, 31.59330040216446, -13.73514998704195], [-41.783448308706284, 34.117698669433594, -13.201500289142132], [-8.485999889671803, 34.98684987425804, -14.143100008368492], [25.689249858260155, 35.51650047302246, -13.285700231790543], [-7.042150013148785, 35.469699651002884, -13.424850068986416], [-6.52319984510541, 37.19649836421013, -14.101950451731682], [25.334199890494347, 37.63590008020401, -13.341549783945084], [-21.707650274038315, 40.07035121321678, -14.057899825274944], [-5.048399791121483, 37.54495084285736, -13.19964975118637], [-20.083049312233925, 39.8576483130455, -14.160700142383575], [-19.291600212454796, 41.93640127778053, -13.669000007212162], [-17.695950344204903, 42.4082987010479, -14.01865016669035], [-37.209898233413696, 43.28560084104538, -13.163849711418152], [-25.705350562930107, 43.510399758815765, -13.020750135183334], [-15.683349221944809, 44.264499098062515, -14.023150317370892], [8.585349656641483, 44.304199516773224, -13.699200004339218], [-36.69055178761482, 44.31400075554848, -14.004699885845184], [-0.7517799967899919, 43.605148792266846, -13.230299577116966], [-0.49324851715937257, 45.58515176177025, -13.973300345242023], [-29.891999438405037, 46.305101364851, -13.263699598610401], [23.384949192404747, 45.9257997572422, -13.265850022435188], [-36.04875132441521, 46.23445123434067, -13.381349854171276], [1.226964988745749, 47.85804823040962, -13.51344957947731], [-12.110699899494648, 48.92915114760399, -14.070450328290462], [12.483649887144566, 50.73799937963486, -14.132849872112274], [2.6221650186926126, 50.15949904918671, -13.098100200295448], [-10.023299604654312, 52.910998463630676, -14.234649948775768], [4.66425996273756, 54.32949960231781, -13.043650425970554], [15.238399617373943, 56.078001856803894, -13.103899545967579], [16.50650054216385, 58.241501450538635, -13.733400031924248], [29.71234917640686, 58.08750167489052, -13.105349615216255], [-7.972249761223793, 58.44150111079216, -13.630850240588188], [-7.353499997407198, 60.2790005505085, -13.32040037959814], [-20.23879997432232, 66.69849902391434, -14.296400360763073], [-21.760450676083565, 66.09000265598297, -13.976049609482288], [-19.60105076432228, 65.95300137996674, -14.173599891364574], [-15.169999562203884, 68.1070014834404, -13.741900213062763], [-16.307499259710312, 68.66099685430527, -14.371399767696857], [-21.723199635744095, 68.12799721956253, -14.111150056123734], [-1.2861599680036306, 70.5690011382103, -13.771849684417248], [27.680449187755585, 70.72599977254868, -13.370749540627003], [-14.37814999371767, 72.08450138568878, -14.126400463283062], [-25.935349985957146, 71.84600085020065, -14.118299819529057], [0.8589749922975898, 72.99000024795532, -13.740899972617626], [-26.196900755167007, 74.09349828958511, -14.147049747407436], [25.837799534201622, 72.76050001382828, -13.66764958947897], [4.593589808791876, 75.35500079393387, -14.11729957908392], [22.270599380135536, 75.3529965877533, -14.037800021469593], [-26.17719955742359, 75.52900165319443, -14.10175021737814], [6.797600071877241, 76.88699662685394, -13.398399576544762], [8.694199845194817, 77.25399732589722, -13.733900152146816], [17.69915036857128, 77.21450179815292, -14.049050398170948], [-29.870299622416496, 80.5089995265007, -13.609049841761589], [-29.511749744415283, 82.9085037112236, -13.7491999194026], [-29.56629917025566, 84.85250174999237, -13.813399709761143], [-23.587599396705627, 88.5080024600029, -13.466999866068363], [-8.978749625384808, 91.33200347423553, -13.389850035309792], [-11.088049970567226, 90.93599766492844, -13.540299609303474], [-11.210749857127666, 93.16900372505188, -13.669449836015701], [-9.242850355803967, 94.2464992403984, -13.250250369310379], [-4.923595115542412, 94.85699981451035, -13.508600182831287], [-3.539355006068945, 95.3345000743866, -13.945650309324265], [-17.32189953327179, 27.409100905060768, -13.168550096452236], [-36.170098930597305, 39.650000631809235, -13.24365008622408], [-3.181695006787777, 39.84389826655388, -13.18410038948059], [29.02740053832531, 56.23149871826172, -13.300550170242786], [6.058149971067905, 57.757001370191574, -13.999899849295616], [7.222549989819527, 58.39800089597702, -13.025449588894844], [-17.454050481319427, 66.15450233221054, -14.002700336277485], [-22.231800481677055, 69.64550167322159, -14.011800289154053], [-14.51804954558611, 70.26000320911407, -14.033850282430649], [-27.731850743293762, 76.63950324058533, -13.59730027616024], [-43.62395033240318, 29.88935075700283, -13.302150182425976], [-41.63609817624092, 29.3917004019022, -12.880399823188782], [-27.545100077986717, 29.829049482941628, -12.937299907207489], [-37.46534883975983, 29.6548493206501, -13.105549849569798], [23.58425036072731, 30.025750398635864, -12.917700223624706], [-29.58099916577339, 30.415600165724754, -13.491399586200714], [13.054749928414822, 29.765300452709198, -13.227400369942188], [22.794749587774277, 30.687350779771805, -13.758200220763683], [28.042050078511238, 31.797301024198532, -13.381949625909328], [-31.647399067878723, 31.23144991695881, -12.816299684345722], [17.553599551320076, 31.159749254584312, -13.649599626660347], [-43.07875037193298, 33.1309512257576, -13.420600444078445], [26.066699996590614, 34.23105180263519, -13.258550316095352], [-37.828151136636734, 34.32735055685043, -13.22139985859394], [-37.13719919323921, 34.775249660015106, -13.717950321733952], [-35.62435135245323, 34.78804975748062, -13.586750254034996], [-33.66050124168396, 35.84875166416168, -13.150399550795555], [7.642900105565786, 35.70394963026047, -12.977899983525276], [7.513950113207102, 39.619751274585724, -13.254649937152863], [24.472899734973907, 40.04095122218132, -13.337450101971626], [-36.628298461437225, 41.76250100135803, -13.9164999127388], [-1.5495149418711662, 41.823748499155045, -12.992200441658497], [22.700950503349304, 44.08879950642586, -13.004500418901443], [-37.09530085325241, 45.256100594997406, -12.669799849390984], [-15.139100141823292, 45.9464006125927, -13.181700371205807], [0.9273050236515701, 46.07750102877617, -12.877600267529488], [-35.336799919605255, 47.2959503531456, -12.716149911284447], [-13.560649938881397, 47.90575057268143, -13.18180002272129], [24.130700156092644, 47.37500101327896, -13.598100282251835], [9.679500013589859, 47.56304994225502, -12.97254953533411], [24.982700124382973, 48.11809957027435, -12.8754498437047], [-12.53880001604557, 49.85164850950241, -12.960500083863735], [26.506250724196434, 51.09050124883652, -13.61520029604435], [14.00614995509386, 53.92200127243996, -12.977199628949165], [-8.63569974899292, 58.06349962949753, -12.856850400567055], [16.638899222016335, 60.21999940276146, -13.71384970843792], [30.150750651955605, 60.23950129747391, -13.108599931001663], [16.161199659109116, 60.30350178480148, -12.673749588429928], [-6.819650065153837, 62.05400079488754, -12.87010032683611], [15.376050025224686, 62.48350068926811, -13.182749971747398], [30.067050829529762, 62.0109997689724, -13.302749954164028], [29.985450208187103, 64.37700241804123, -13.161749579012394], [-19.47689987719059, 64.16749954223633, -13.821950182318687], [-3.9492850191891193, 66.46949797868729, -13.846349902451038], [29.177499935030937, 68.32999736070633, -12.951199896633625], [-23.493599146604538, 70.29350101947784, -13.517599552869797], [-25.44119954109192, 70.4284980893135, -12.88795005530119], [-27.5736004114151, 72.30599969625473, -13.600350357592106], [-13.21529969573021, 74.24599677324295, -13.55534978210926], [-27.263300493359566, 74.33900237083435, -13.657149858772755], [25.26180073618889, 74.24899935722351, -12.775249779224396], [1.1674950364977121, 74.09299910068512, -12.864800170063972], [23.28445017337799, 75.75800269842148, -12.777600437402725], [-13.088500127196312, 76.47550106048584, -13.505250215530396], [9.258899837732315, 77.80449837446213, -12.85105012357235], [10.888099670410156, 78.05050164461136, -13.012349605560303], [12.848550453782082, 78.1404972076416, -13.064499944448471], [-13.180200010538101, 78.90400290489197, -13.278200291097164], [-13.179300352931023, 80.75600117444992, -12.845800258219242], [-15.784500166773796, 84.40999686717987, -12.844599783420563], [-16.853850334882736, 85.10799705982208, -13.336899690330029], [-17.75454916059971, 86.40850335359573, -12.819199822843075], [-29.54605035483837, 86.64499968290329, -13.16909957677126], [-19.467800855636597, 87.21049875020981, -13.16864974796772], [-21.876700222492218, 87.92950212955475, -13.228950090706348], [-25.74249915778637, 88.33149820566177, -12.82500009983778], [-10.400050319731236, 93.96349638700485, -13.251150026917458], [-6.892750039696693, 94.74200010299683, -12.922150082886219], [-14.754850417375565, 29.019750654697418, -13.338100165128708], [15.261399559676647, 29.622599482536316, -13.044250197708607], [19.897300750017166, 31.07919916510582, -13.154850341379642], [9.572549723088741, 31.7191481590271, -12.873049825429916], [7.297900039702654, 37.57454827427864, -12.856749817728996], [24.80825036764145, 39.42130133509636, -12.69179955124855], [-21.576549857854843, 41.723500937223434, -13.449200429022312], [7.747400086373091, 41.53215140104294, -13.215499930083752], [-37.07754984498024, 41.64630174636841, -12.925350107252598], [-17.3116996884346, 43.98655146360397, -13.105999678373337], [7.869900204241276, 43.16980019211769, -12.842699885368347], [8.922549895942211, 46.07114940881729, -13.045050203800201], [6.339250132441521, 56.84550106525421, -12.774400413036346], [15.920400619506836, 57.86599963903427, -12.836449779570103], [9.751450270414352, 61.778999865055084, -13.692350126802921], [-21.58614993095398, 64.33849781751633, -13.79809994250536], [-17.24899932742119, 64.36850130558014, -13.149900361895561], [-23.604849353432655, 66.21100008487701, -13.505199924111366], [-15.365500003099442, 66.30200147628784, -12.951299548149109], [-23.464249446988106, 68.0219978094101, -13.44310026615858], [-13.383599929511547, 70.18399983644485, -13.275249861180782], [27.21790038049221, 72.15700298547745, -12.76249997317791], [-27.546100318431854, 70.94799727201462, -12.888450175523758], [-0.8665199857205153, 72.0214992761612, -12.870649807155132], [-12.996199540793896, 72.29749858379364, -13.221349567174911], [15.164550393819809, 78.16649973392487, -13.121649622917175], [-31.59024938941002, 80.72199672460556, -13.12205009162426], [-13.157499954104424, 90.7519981265068, -13.360749930143356], [-13.044450432062149, 92.97250211238861, -12.908199802041054], [-28.02469953894615, 44.954750686883926, -12.783000245690346], [1.9714550580829382, 49.58970099687576, -13.651600107550621], [-10.469700209796429, 54.2295016348362, -12.697599828243256], [-21.71345055103302, 62.25550174713135, -13.427349738776684], [-23.6246008425951, 62.19099834561348, -13.228850439190865], [-23.659300059080124, 64.23850357532501, -13.476350344717503], [17.60205067694187, 77.91750133037567, -13.032999821007252], [29.167549684643745, 29.656950384378433, -12.903599999845028], [11.162050068378448, 29.943950474262238, -12.64095026999712], [17.409199848771095, 29.963500797748566, -12.878349982202053], [-30.00500053167343, 30.818799510598183, -12.81139999628067], [-35.94129905104637, 34.43555161356926, -12.836149893701077], [-33.91110152006149, 47.70340025424957, -12.934500351548195], [28.840700164437294, 54.57400158047676, -12.698750011622906], [-19.65159922838211, 62.05900013446808, -13.076050207018852], [13.03774956613779, 62.78400123119354, -12.720700353384018], [-18.03554967045784, 62.43950128555298, -12.606499716639519], [-2.555360086262226, 70.1265037059784, -12.657550163567066], [-29.409950599074364, 76.41299813985825, -12.68870010972023], [-29.698550701141357, 78.7699967622757, -12.711450457572937], [-31.537648290395737, 85.05000174045563, -12.776950374245644], [-25.276150554418564, 66.24200195074081, -12.793850153684616], [-15.26974979788065, 90.97900241613388, -12.856650166213512], [-24.387700483202934, 28.752250596880913, -12.960650026798248], [27.661899104714394, 28.204649686813354, -12.60984968394041], [-11.669999919831753, 29.925450682640076, -12.5753004103899], [19.19260062277317, 30.303100124001503, -12.589000165462494], [28.989600017666817, 31.195100396871567, -12.663999572396278], [-7.409750018268824, 34.08975154161453, -12.786449864506721], [-5.374350119382143, 36.35615110397339, -12.653299607336521], [-16.51415042579174, 45.24324834346771, -12.601549737155437], [-21.84540033340454, 60.12149900197983, -12.833899818360806], [-25.74240043759346, 62.01700121164322, -12.82539963722229], [-25.608399882912636, 64.16100263595581, -12.821200303733349], [-4.103145096451044, 67.4624964594841, -12.957549653947353], [-13.420900329947472, 68.29400360584259, -12.601150199770927], [-29.343700036406517, 72.19649851322174, -12.724650092422962], [-31.617499887943268, 79.44100350141525, -12.3752998188138], [-31.56055137515068, 82.61449635028839, -12.746649794280529], [-27.439650148153305, 88.21800351142883, -12.582999654114246], [-14.759750105440617, 92.38249808549881, -12.722699902951717], [29.101699590682983, 28.121450915932655, -12.448850087821484], [26.236150413751602, 28.439199551939964, -12.406899593770504], [-9.596900083124638, 31.9877490401268, -12.746449559926987], [-19.864900037646294, 43.174199759960175, -12.473849579691887], [0.4212814965285361, 44.42699998617172, -12.460149824619293], [-23.600300773978233, 59.98700112104416, -12.869349680840969], [-19.931400194764137, 60.711998492479324, -12.636150233447552], [-25.508899241685867, 60.444001108407974, -12.643599882721901], [-16.129599884152412, 64.6205022931099, -12.611250393092632], [-24.995099753141403, 68.32899898290634, -12.575550004839897], [-11.50204986333847, 70.26749849319458, -12.42849975824356], [-28.948800638318062, 70.74149698019028, -12.3434504494071], [-29.130900278687477, 74.5450034737587, -12.71315012127161], [3.496315097436309, 75.80450177192688, -12.62119971215725], [-11.165999807417393, 76.39499753713608, -12.711799703538418], [21.53255045413971, 77.20299810171127, -12.042299844324589], [18.892550840973854, 77.86150276660919, -12.68364954739809], [-11.131149716675282, 78.7615031003952, -12.602199800312519], [-13.78989964723587, 82.1864977478981, -12.590750120580196], [-15.342749655246735, 89.40450102090836, -12.448200024664402], [-19.56705003976822, 27.084799483418465, -11.047150008380413], [-42.39324852824211, 31.50010108947754, -12.407549656927586], [7.799049839377403, 33.97955000400543, -12.471050024032593], [-3.5366748925298452, 38.07784989476204, -12.341500259935856], [6.937350146472454, 41.53145104646683, -11.154050007462502], [-0.46374500379897654, 41.544098407030106, -11.325550265610218], [-23.575499653816223, 43.0418998003006, -12.546850368380547], [-21.770650520920753, 42.92700067162514, -12.34589982777834], [8.142950013279915, 44.91319879889488, -12.351100333034992], [-16.10654965043068, 46.22054845094681, -11.712850071489811], [-14.802600257098675, 47.09719866514206, -12.5345503911376], [-12.00919970870018, 52.306998521089554, -11.734750121831894], [11.90195046365261, 51.94300040602684, -11.145750060677528], [-8.317350409924984, 59.63300168514252, -12.26465031504631], [-6.419450044631958, 63.69300186634064, -12.308400124311447], [-6.951199844479561, 64.31650370359421, -11.216050013899803], [-14.10644967108965, 67.25800037384033, -12.584649957716465], [29.097450897097588, 69.61250305175781, -12.331550009548664], [-11.753500439226627, 72.3159983754158, -12.572499923408031], [-11.242999695241451, 74.29700344800949, -12.595799751579762], [-10.186250321567059, 76.55049860477448, -12.53610011190176], [-10.107900016009808, 77.77749747037888, -12.568449601531029], [-9.771750308573246, 77.01300084590912, -12.195499613881111], [-33.03325176239014, 80.14900237321854, -12.434350326657295], [-29.63005006313324, 88.12449872493744, -12.476700358092785], [-12.857000343501568, 89.56699818372726, -12.28955015540123], [-11.221400462090969, 90.60049802064896, -11.20030041784048], [-16.99190028011799, 90.83399921655655, -12.445200234651566], [-8.754800073802471, 94.08500045537949, -11.817499995231628], [29.74884957075119, 27.477499097585678, -11.313499882817268], [-15.450350008904934, 27.156250551342964, -11.165999807417393], [30.19844926893711, 29.742149636149406, -11.936349794268608], [-25.823449715971947, 28.89605052769184, -11.932100169360638], [23.71330000460148, 29.468849301338196, -11.137199588119984], [-37.872251123189926, 29.42110039293766, -11.164999566972256], [-41.80515184998512, 29.644349589943886, -11.191699653863907], [-35.63779965043068, 29.956599697470665, -11.141099967062473], [18.247250467538834, 28.9380494505167, -11.89970038831234], [-29.305249452590942, 29.640400782227516, -11.291500180959702], [20.10449953377247, 29.56569939851761, -11.636950075626373], [21.543949842453003, 29.612699523568153, -11.18400041013956], [-33.409249037504196, 30.891649425029755, -11.75064966082573], [-29.418399557471275, 30.690250918269157, -12.210099957883358], [-8.931799791753292, 31.38909861445427, -11.832700110971928], [8.796799927949905, 31.33605048060417, -11.562449857592583], [-6.697149947285652, 33.330898731946945, -11.519400402903557], [27.884049341082573, 33.842701464891434, -11.41194999217987], [-37.63055056333542, 34.09085050225258, -11.153199709951878], [-35.53919866681099, 35.595450550317764, -11.110150255262852], [-34.06289964914322, 35.72800010442734, -11.865600012242794], [-35.71594879031181, 37.661951035261154, -11.503449641168118], [-36.77795082330704, 40.02254828810692, -12.277349829673767], [-1.399144995957613, 39.8501493036747, -11.160650290548801], [-37.7422496676445, 41.27335175871849, -11.235999874770641], [22.91419915854931, 43.69004815816879, -11.161400005221367], [-17.40580052137375, 45.51694914698601, -11.201350018382072], [-27.316950261592865, 44.65844854712486, -12.117300182580948], [-29.1725005954504, 46.28169909119606, -11.85075007379055], [23.989999666810036, 45.79859972000122, -11.369099840521812], [-31.72200173139572, 48.4342984855175, -11.626649647951126], [9.280749596655369, 48.057250678539276, -11.038550175726414], [2.422640100121498, 48.67500066757202, -12.49490026384592], [26.1098500341177, 49.07039925456047, -12.13034987449646], [-13.674999587237835, 50.13500154018402, -11.010999791324139], [10.874849744141102, 50.30199885368347, -11.211750097572803], [26.85914933681488, 50.57549849152565, -12.345099821686745], [11.974750086665154, 51.33099853992462, -12.454750016331673], [-11.40925008803606, 54.185498505830765, -11.196300387382507], [29.364600777626038, 54.32499945163727, -11.153250001370907], [30.071599408984184, 56.359998881816864, -11.275350116193295], [-9.539850056171417, 58.21549892425537, -11.267700232565403], [-25.47984942793846, 58.397501707077026, -12.388399802148342], [-22.313300520181656, 58.74650180339813, -12.428750284016132], [-23.8779503852129, 58.49099904298782, -12.451499700546265], [-19.29605007171631, 59.950001537799835, -11.757100000977516], [31.17549978196621, 60.313500463962555, -11.124449782073498], [31.307600438594818, 62.37750127911568, -11.25395018607378], [-27.13330090045929, 62.28199973702431, -12.39595003426075], [13.295399956405163, 62.294501811265945, -11.366150341928005], [31.36495128273964, 64.36599791049957, -11.140000075101852], [-16.32704958319664, 63.871003687381744, -12.234900146722794], [-15.051299706101418, 64.02400135993958, -11.332900263369083], [-26.1307992041111, 66.51700288057327, -12.222950346767902], [-5.567649845033884, 66.40949845314026, -11.715750209987164], [30.161449685692787, 68.09599697589874, -11.81770022958517], [-12.429499998688698, 68.17150115966797, -12.091400101780891], [-29.832299798727036, 70.50199806690216, -11.384150013327599], [-1.109460019506514, 72.74200022220612, -11.977950111031532], [0.8938750252127647, 74.7309997677803, -11.8860499933362], [2.878089901059866, 76.80950313806534, -11.360250413417816], [23.526350036263466, 76.86249911785126, -11.47644966840744], [5.10590011253953, 77.39999890327454, -11.8220504373312], [19.763100892305374, 78.62850278615952, -11.593650095164776], [7.1263001300394535, 77.70449668169022, -12.363250367343426], [8.945999667048454, 78.87350022792816, -11.815049685537815], [17.669200897216797, 78.88100296258926, -11.935300193727016], [-11.310850270092487, 80.61499893665314, -12.537949718534946], [-31.16079978644848, 86.89150214195251, -12.337200343608856], [-20.13860084116459, 87.97600120306015, -12.451349757611752], [-21.738100796937943, 88.9509990811348, -11.747250333428383], [-23.72325025498867, 89.11100029945374, -11.28540001809597], [-9.497200138866901, 91.21549874544144, -11.677349917590618], [-17.424000427126884, 92.6159992814064, -11.380149982869625], [-10.825499892234802, 93.31650286912918, -11.065050028264523], [-10.439200326800346, 93.96149963140488, -11.839250102639198], [13.10035027563572, 27.758050709962845, -11.153549887239933], [15.351000241935253, 27.53799967467785, -11.38909999281168], [27.32989937067032, 35.71594879031181, -11.095549911260605], [-2.9937250073999166, 37.47415170073509, -11.08929980546236], [-2.4228650145232677, 39.06349837779999, -11.877399869263172], [-37.86414861679077, 44.02780160307884, -11.567999608814716], [-19.34009976685047, 44.11900043487549, -11.336450465023518], [-17.861800268292427, 44.59574818611145, -12.154899537563324], [-14.95909970253706, 47.992050647735596, -11.130999773740768], [4.594579804688692, 52.40749940276146, -11.301400139927864], [5.4107001051306725, 54.09349873661995, -11.105550453066826], [14.59490042179823, 56.37349933385849, -11.308950372040272], [6.033449899405241, 55.59350177645683, -11.527899652719498], [-23.020800203084946, 57.79850110411644, -12.207649648189545], [-27.173299342393875, 60.25749817490578, -12.300100177526474], [-27.6528000831604, 64.18850272893906, -11.86749991029501], [-14.652700163424015, 65.81749767065048, -12.08414975553751], [-10.147900320589542, 73.92950356006622, -11.61350030452013], [11.452849954366684, 79.11600172519684, -11.818249709904194], [12.980500236153603, 78.84149998426437, -12.069899588823318], [-33.946748822927475, 80.66599816083908, -11.851250194013119], [-11.103100143373013, 80.66249638795853, -11.28854975104332], [-12.589899823069572, 82.9394981265068, -11.515949852764606], [-33.65445137023926, 85.0059986114502, -11.226899921894073], [-17.285749316215515, 89.35750275850296, -12.309250421822071], [-13.307999819517136, 27.62800082564354, -11.128200218081474], [12.513750232756138, 28.577350080013275, -12.043650262057781], [-11.1347995698452, 29.260700568556786, -11.69629953801632], [29.68195080757141, 31.741049140691757, -11.190749704837799], [-41.31989926099777, 33.2942008972168, -11.096050031483173], [-39.72199931740761, 33.710598945617676, -10.988649912178516], [-35.94585135579109, 34.564949572086334, -11.494300328195095], [25.847099721431732, 37.73605078458786, -11.000249534845352], [23.02989922463894, 41.777901351451874, -11.020850390195847], [0.7967600249685347, 43.73544827103615, -11.144700460135937], [-23.727400228381157, 44.016849249601364, -11.16579957306385], [7.360449992120266, 43.82390156388283, -10.906250216066837], [-27.541199699044228, 45.59649899601936, -11.30754966288805], [8.491749875247478, 46.53824865818024, -11.250150389969349], [2.816889900714159, 48.05535078048706, -11.080699972808361], [-33.578649163246155, 48.61694946885109, -11.623349972069263], [3.564164973795414, 49.96684938669205, -11.244350112974644], [28.010299429297447, 51.80500075221062, -11.19139976799488], [13.401900418102741, 54.12599816918373, -11.161450296640396], [-27.729200199246407, 58.12250077724457, -12.008599936962128], [-21.593300625681877, 58.054499328136444, -11.844250373542309], [-7.956000044941902, 60.68599969148636, -11.970849707722664], [-28.062349185347557, 60.29500067234039, -12.052900157868862], [-28.132950887084007, 62.463000416755676, -12.012300081551075], [14.785599894821644, 61.72249838709831, -11.20235025882721], [-7.651249878108501, 62.34300136566162, -11.347400024533272], [-17.045550048351288, 62.03949823975563, -11.43679954111576], [31.24544955790043, 66.12949818372726, -11.061149649322033], [-26.102900505065918, 68.10399889945984, -11.791699565947056], [-5.010600201785564, 68.0909976363182, -11.408300139009953], [-11.009699665009975, 68.14000010490417, -11.256200261414051], [29.636800289154053, 70.41449844837189, -11.213250458240509], [27.786249294877052, 72.6805031299591, -11.592299677431583], [-30.229749158024788, 73.95750284194946, -12.007799930870533], [25.773800909519196, 74.92399960756302, -11.638299562036991], [-31.55529871582985, 76.07600092887878, -11.222699657082558], [-31.654201447963715, 78.25300097465515, -11.050499975681305], [-33.63725170493126, 82.93750137090683, -11.32499985396862], [-14.861649833619595, 85.08750051259995, -11.733249761164188], [-32.25509822368622, 87.02699840068817, -11.27410028129816], [-17.18199998140335, 87.04949915409088, -11.585850268602371], [-19.60109919309616, 88.93749862909317, -11.889999732375145], [-15.54575003683567, 88.49100023508072, -11.182799935340881], [-17.70794950425625, 88.49850296974182, -11.890700086951256], [-18.186699599027634, 91.0945013165474, -12.188299559056759], [-7.748750038444996, 92.74300187826157, -11.867649853229523], [17.616750672459602, 27.670249342918396, -11.073900386691093], [-27.495350688695908, 29.153399169445038, -11.687999591231346], [-4.772999789565802, 35.457201302051544, -11.416349560022354], [6.651800125837326, 37.56145015358925, -11.306899599730968], [-35.84745153784752, 48.03809896111488, -11.383449658751488], [-13.96539993584156, 48.67459833621979, -11.955950409173965], [-25.663599371910095, 56.06050044298172, -11.922299861907959], [-23.467350751161575, 56.115999817848206, -11.434749700129032], [-26.270849630236626, 57.46849998831749, -12.196299619972706], [15.323550440371037, 58.19400027394295, -11.034499853849411], [-20.419999957084656, 59.19799953699112, -11.962699703872204], [15.536550432443619, 60.36049872636795, -11.067399755120277], [-27.726400643587112, 66.07100367546082, -11.165549978613853], [-13.140950351953506, 66.26400351524353, -11.655599810183048], [-10.523850098252296, 70.18350064754486, -11.280200444161892], [-31.615450978279114, 70.21699845790863, -11.30445022135973], [-31.475048512220383, 72.05899804830551, -11.640300042927265], [-27.4835005402565, 71.25499844551086, -11.89965009689331], [-25.983300060033798, 70.34149765968323, -11.198650114238262], [-10.596499778330326, 72.02299684286118, -11.318850331008434], [-3.0332200694829226, 71.94899767637253, -11.149999685585499], [6.878950167447329, 78.81399989128113, -11.603400111198425], [15.370099805295467, 79.42900061607361, -11.63989957422018], [-13.252399861812592, 84.7335010766983, -11.025049723684788], [-33.592451363801956, 86.70499920845032, -11.206050403416157], [-31.412851065397263, 88.26649934053421, -11.088250204920769], [-19.495299085974693, 91.22200310230255, -11.835100129246712], [-15.567399561405182, 92.88600087165833, -11.11880037933588], [-23.610850796103477, 27.49755047261715, -11.029450222849846], [-25.62814950942993, 27.869850397109985, -10.971450246870518], [6.682150065898895, 39.481498301029205, -11.172699742019176], [-25.74934996664524, 44.51470077037811, -11.329550296068192], [-27.549250051379204, 56.23349919915199, -11.84650044888258], [-29.352400451898575, 60.30450016260147, -11.657699942588806], [-29.59340065717697, 62.19400092959404, -11.338099837303162], [-3.4172451123595238, 70.58349996805191, -11.437700130045414], [-26.236649602651596, 71.59800082445145, -10.843650437891483], [-29.57735024392605, 78.35949957370758, -10.871750302612782], [15.045249834656715, 80.72999864816666, -10.891550220549107], [10.928500443696976, 80.66350221633911, -11.115949600934982], [-11.735750362277031, 82.78950303792953, -11.42484974116087], [-12.206600047647953, 84.03649926185608, -11.90869975835085], [-13.510449789464474, 89.34350311756134, -10.948649607598782], [-17.547449097037315, 26.90120041370392, -10.949550196528435], [-21.555500105023384, 27.382949367165565, -11.139050126075745], [27.626749128103256, 27.59449928998947, -11.064499616622925], [25.84034949541092, 28.26559916138649, -10.841449722647667], [31.562551856040955, 27.67989970743656, -10.661650449037552], [10.746650397777557, 28.93250063061714, -11.119949631392956], [31.33324906229973, 29.460899531841278, -10.716649703681469], [24.909349158406258, 28.811749070882797, -10.94914972782135], [-39.60629925131798, 29.272500425577164, -10.606150142848492], [-9.442999958992004, 29.736999422311783, -10.756400413811207], [9.422499686479568, 29.9236997961998, -10.779050178825855], [-42.472049593925476, 31.685199588537216, -10.955249890685081], [-31.33530169725418, 31.0092493891716, -11.511499993503094], [-7.522400002926588, 31.698450446128845, -10.789950378239155], [7.859149947762489, 32.01274946331978, -10.829250328242779], [7.193149998784065, 33.511098474264145, -10.929649695754051], [-5.311000160872936, 33.93565118312836, -10.579699650406837], [6.71715009957552, 35.53155064582825, -11.091349646449089], [24.820400401949883, 39.11624848842621, -10.93559991568327], [-37.59489953517914, 39.53329846262932, -10.932100005447865], [23.976799100637436, 40.2725487947464, -10.996299795806408], [-21.313399076461792, 43.991949409246445, -10.903250426054], [7.889649830758572, 45.62839865684509, -10.724400170147419], [1.7714350251480937, 45.43574899435043, -10.835300199687481], [-37.5560000538826, 46.21409997344017, -11.1006498336792], [-29.67430092394352, 48.12460020184517, -11.26480009406805], [24.600349366664886, 46.56194895505905, -10.840900242328644], [25.602849200367928, 48.011649399995804, -10.846099816262722], [10.136250406503677, 49.19999837875366, -11.343750171363354], [27.087949216365814, 50.1055009663105, -10.826149955391884], [-12.642850168049335, 51.98249965906143, -10.79775020480156], [3.963179886341095, 51.134999841451645, -11.355250142514706], [12.41180021315813, 52.78699845075607, -10.842500254511833], [28.731700032949448, 52.96500027179718, -10.903649963438511], [-27.69945003092289, 54.12599816918373, -11.493350379168987], [-25.390949100255966, 54.127998650074005, -11.14645041525364], [-29.751000925898552, 54.0659986436367, -11.380200274288654], [-10.814099572598934, 56.049998849630356, -10.717649944126606], [-29.778599739074707, 56.23599886894226, -11.488749645650387], [6.630599964410067, 56.34799972176552, -10.781900025904179], [-10.08475013077259, 56.887999176979065, -11.360700242221355], [-21.581200882792473, 56.42849951982498, -10.69835014641285], [7.446799892932177, 57.79549852013588, -11.232949793338776], [-29.390400275588036, 58.13249945640564, -11.685799807310104], [-19.80309933423996, 58.28249827027321, -10.8194500207901], [8.296550251543522, 58.931998908519745, -11.39719970524311], [-8.905950002372265, 60.240499675273895, -10.860400274395943], [9.176700375974178, 60.053501278162, -10.977800004184246], [-17.78304949402809, 60.458000749349594, -10.806149803102016], [10.258999653160572, 60.99599972367287, -10.973099619150162], [11.399799957871437, 61.62349879741669, -10.884799994528294], [-15.625599771738052, 62.470000237226486, -10.66564954817295], [-6.695750169456005, 66.19550287723541, -10.808300226926804], [-27.101749554276466, 67.93349981307983, -10.85904985666275], [-27.42215059697628, 72.0990002155304, -10.842500254511833], [-1.1346950195729733, 74.3900015950203, -11.182649992406368], [27.16274932026863, 74.3350014090538, -10.997449979186058], [-31.835950911045074, 74.18400049209595, -11.129249818623066], [1.0992749594151974, 76.66400074958801, -11.064049787819386], [25.367900729179382, 76.05499774217606, -10.892399586737156], [-10.748550295829773, 76.3934999704361, -10.781900025904179], [-29.74884957075119, 77.13250070810318, -10.763900354504585], [21.769750863313675, 78.39050143957138, -11.27185020595789], [5.1668500527739525, 78.65700125694275, -11.064600199460983], [-28.503399342298508, 77.9770016670227, -11.53464987874031], [-10.93745045363903, 78.29099893569946, -10.914900340139866], [-33.5577018558979, 78.62299680709839, -11.102699674665928], [13.239599764347076, 80.43500036001205, -10.960149578750134], [17.417050898075104, 80.23250102996826, -10.975649580359459], [-35.41655093431473, 79.08350229263306, -10.73244959115982], [-35.54049879312515, 80.5630013346672, -10.811899788677692], [-15.620799735188484, 86.42750233411789, -10.92199981212616], [-29.529400169849396, 88.95199745893478, -10.9655000269413], [-27.698099613189697, 89.00699764490128, -10.991450399160385], [-19.337600097060204, 93.02149713039398, -11.340400204062462], [-9.225299581885338, 92.73599833250046, -11.118150316178799], [-13.056750409305096, 93.2840034365654, -10.962500236928463], [11.407350189983845, 28.287850320339203, -10.79929992556572], [-43.49225014448166, 29.79169972240925, -10.680150240659714], [30.5208507925272, 57.92099982500076, -11.373399756848812], [30.85930086672306, 58.40950086712837, -10.791650041937828], [-29.398899525403976, 64.17399644851685, -10.787149891257286], [-11.361800134181976, 66.11549854278564, -10.747049935162067], [-4.905929788947105, 70.12899965047836, -10.866650380194187], [-2.7444250881671906, 74.39050078392029, -10.634000413119793], [-35.01395136117935, 85.55950224399567, -10.819200426340103], [-35.40955111384392, 86.51000261306763, -10.549799539148808], [-25.73464997112751, 89.06950056552887, -11.018199846148491], [-21.606050431728363, 91.01299941539764, -11.06830034404993], [-21.38639986515045, 92.74650365114212, -10.788599960505962], [-17.360549420118332, 96.89900279045105, -11.095399968326092], [-17.34359934926033, 98.17150235176086, -10.821499861776829], [-33.74509885907173, 30.37079982459545, -10.629200376570225], [-3.7172550801187754, 36.2561009824276, -10.803350247442722], [-33.530350774526596, 50.25799944996834, -11.287650093436241], [-31.737301498651505, 50.23200064897537, -11.303050443530083], [-31.751848757267, 54.13850024342537, -11.20929978787899], [-23.623250424861908, 54.341498762369156, -10.630999691784382], [-31.853899359703064, 56.403998285532, -11.109749786555767], [-31.770549714565277, 58.37149918079376, -10.971000418066978], [-12.990499846637249, 64.18099999427795, -10.74334979057312], [-33.35890173912048, 70.17699629068375, -10.655649937689304], [-33.37239846587181, 72.00200110673904, -10.744350031018257], [3.29177500680089, 78.6214992403984, -10.597649961709976], [6.8870000541210175, 80.1595002412796, -10.570649988949299], [-19.504450261592865, 94.69050168991089, -11.212349869310856], [-18.052000552415848, 95.12399882078171, -10.601899586617947], [-19.601650536060333, 96.70449793338776, -10.777950286865234], [19.376050680875778, 28.074350208044052, -10.70914976298809], [-27.60539948940277, 28.262700885534286, -10.811650194227695], [-11.531500145792961, 28.101200237870216, -10.746249929070473], [-31.518500298261642, 29.953399673104286, -10.720199905335903], [28.95529940724373, 33.26505050063133, -10.536650195717812], [0.18651450227480382, 42.20480099320412, -10.659299790859222], [-35.62925010919571, 50.30849948525429, -10.887599550187588], [-29.39154952764511, 50.232499837875366, -11.0360998660326], [-33.76689925789833, 52.4899996817112, -10.957499966025352], [-29.5136496424675, 52.2255003452301, -11.19530014693737], [-31.53020143508911, 52.223000675439835, -11.248700320720673], [-27.571650221943855, 51.96499824523926, -10.968349874019623], [-31.5263494849205, 60.277000069618225, -10.745099745690823], [31.020749360322952, 68.00749897956848, -10.815300047397614], [8.874700404703617, 80.39849996566772, -10.74874959886074], [19.668450579047203, 80.25950193405151, -10.559700429439545], [-37.28419914841652, 38.033898919820786, -10.728949680924416], [2.3282950278371572, 46.3145487010479, -10.55539958178997], [-27.821499854326248, 47.87220060825348, -10.613749735057354], [-25.882750749588013, 52.58350074291229, -10.739199817180634], [-33.475201576948166, 54.34200167655945, -10.866150259971619], [-33.406201750040054, 56.19049817323685, -10.676800273358822], [-31.126350164413452, 61.91850081086159, -10.541300289332867], [-11.852400377392769, 65.08299708366394, -10.73320023715496], [29.357900843024254, 71.98449969291687, -10.611699894070625], [-32.94900059700012, 74.58549737930298, -10.765399783849716], [-0.7632349734194577, 76.11949741840363, -10.61095017939806], [-43.39829832315445, 31.011300161480904, -10.352700017392635], [30.909700319170952, 31.02869912981987, -10.3150000795722], [-39.00985047221184, 41.529200971126556, -10.372250340878963], [-39.049651473760605, 43.93500089645386, -10.521999560296535], [-25.91479942202568, 45.32885178923607, -10.522199794650078], [-18.420100212097168, 45.173950493335724, -10.43890044093132], [-16.40014909207821, 46.98535054922104, -10.399449616670609], [-37.57914900779724, 47.95515164732933, -10.552150197327137], [-27.600349858403206, 50.296999514102936, -10.502450168132782], [-35.433799028396606, 52.179500460624695, -10.606000199913979], [4.299764987081289, 50.95599964261055, -10.375450365245342], [13.899199664592743, 55.60849979519844, -10.363999754190445], [-33.12255069613457, 58.18599835038185, -10.5359498411417], [-10.221850126981735, 57.751499116420746, -10.338399559259415], [-8.459200151264668, 62.26449832320213, -10.359750129282475], [-13.290300033986568, 62.81200051307678, -10.315599851310253], [-29.337450861930847, 66.01300090551376, -9.267199784517288], [-6.674299947917461, 67.94600188732147, -10.352199897170067], [31.10790066421032, 69.64650005102158, -10.369949974119663], [-10.588949546217918, 74.11450147628784, -10.5876000598073], [29.16629984974861, 73.58899712562561, -10.335800237953663], [-33.14660117030144, 75.55750012397766, -10.418849997222424], [27.129599824547768, 75.63149929046631, -10.572950355708599], [25.19015036523342, 77.90999859571457, -10.402250103652477], [0.7407300290651619, 77.91599631309509, -10.537750087678432], [23.466600105166435, 78.51599901914597, -10.587800294160843], [21.844249218702316, 79.64500039815903, -10.392149910330772], [-37.1212512254715, 80.13200014829636, -10.387049987912178], [15.037650242447853, 80.5554986000061, -9.862300008535385], [11.127750389277935, 80.30849695205688, -9.932249784469604], [-34.73670035600662, 82.15150237083435, -10.338599793612957], [-12.377900071442127, 90.11449664831161, -10.565550066530704], [-22.842150181531906, 90.39150178432465, -10.47189999371767], [-20.941000431776047, 94.76649761199951, -10.581400245428085], [-29.1460994631052, 28.351349756121635, -10.247649624943733], [-38.99639844894409, 45.920100063085556, -10.302100330591202], [-37.12094947695732, 50.309501588344574, -10.340499691665173], [-25.115899741649628, 51.683999598026276, -9.92560014128685], [-34.98705103993416, 54.26650121808052, -10.501449927687645], [-29.340799897909164, 71.91350311040878, -10.327300056815147], [-4.924514796584845, 71.74500077962875, -10.440999642014503], [27.911249548196793, 74.76949691772461, -9.313349612057209], [-12.31675036251545, 81.5190002322197, -10.301100090146065], [-10.806400328874588, 27.642350643873215, -9.247600100934505], [6.667550187557936, 33.49504992365837, -9.20180045068264], [-36.926548928022385, 35.96064820885658, -10.333850048482418], [-0.5858949734829366, 39.79974985122681, -9.347449988126755], [-14.683900400996208, 49.1134487092495, -10.386049747467041], [-23.657049983739853, 52.27850005030632, -9.274049662053585], [8.298899978399277, 58.96199867129326, -9.236600250005722], [9.06634982675314, 60.004498809576035, -9.059100411832333], [-13.515099883079529, 62.37449869513512, -9.13000013679266], [32.45149925351143, 65.97699970006943, -10.057950392365456], [-36.26269847154617, 86.99800074100494, -9.21849999576807], [-13.307349756360054, 90.7839983701706, -9.669399820268154], [-17.320100218057632, 26.742849498987198, -9.144599549472332], [-15.483549796044827, 26.70864947140217, -9.022049605846405], [15.7670509070158, 26.599949225783348, -10.143149644136429], [19.76259984076023, 27.275249361991882, -9.735849685966969], [-27.61255018413067, 27.2777508944273, -9.281899780035019], [13.05409986525774, 26.91509947180748, -9.323449805378914], [11.01830042898655, 27.69945003092289, -8.936749771237373], [21.511150524020195, 27.58209966123104, -9.061750024557114], [-37.71749883890152, 35.49090027809143, -9.884949773550034], [-38.32520171999931, 37.57530078291893, -10.124250315129757], [-1.429855008609593, 38.00459951162338, -8.991849608719349], [-39.93314877152443, 39.744000881910324, -9.437999688088894], [23.50570075213909, 39.67040032148361, -9.137400425970554], [-40.050748735666275, 43.740350753068924, -9.666450321674347], [-20.142700523138046, 44.65530067682266, -9.834500029683113], [-39.72560167312622, 47.98005148768425, -9.251650422811508], [-17.614249140024185, 46.34125158190727, -9.155799634754658], [-27.043750509619713, 47.88750037550926, -10.147400200366974], [-37.98019886016846, 50.08799955248833, -9.939800016582012], [-25.61740018427372, 49.97045174241066, -9.510399773716927], [10.67274995148182, 50.68250000476837, -9.414049796760082], [-37.771400064229965, 52.353501319885254, -9.554600343108177], [5.011099856346846, 52.19849944114685, -9.121149778366089], [12.857500463724136, 54.1204996407032, -9.251300245523453], [-36.17655113339424, 54.28000167012215, -9.97494999319315], [-21.639449521899223, 54.44749817252159, -9.054100140929222], [-35.799700766801834, 56.203000247478485, -9.625149890780449], [30.70089966058731, 57.028498500585556, -10.211300104856491], [-34.005798399448395, 58.48199874162674, -9.914199821650982], [-9.935850277543068, 58.8034987449646, -10.08905004709959], [-18.736500293016434, 58.019500225782394, -9.609649889171124], [-33.77595171332359, 60.18399819731712, -9.262749925255775], [-17.022449523210526, 60.03750115633011, -9.875199757516384], [-31.928651034832, 62.479499727487564, -9.416449815034866], [32.19344839453697, 61.97800114750862, -9.836049750447273], [-9.113499894738197, 64.22849744558334, -9.265299886465073], [-30.297350138425827, 64.61849808692932, -9.474500082433224], [32.15264901518822, 68.34950298070908, -9.982299990952015], [-6.32070004940033, 69.64050233364105, -9.73065011203289], [-31.759098172187805, 70.90900093317032, -9.909099899232388], [-5.4557002149522305, 70.45649737119675, -9.090850129723549], [-35.68210080265999, 70.44199854135513, -9.23524983227253], [-11.6200502961874, 70.09399682283401, -9.208000265061855], [-11.306400410830975, 72.03249633312225, -9.297399781644344], [-4.904144909232855, 72.01399654150009, -9.71280038356781], [-33.55655074119568, 72.48850166797638, -9.217849932610989], [-34.195348620414734, 74.70499724149704, -9.80675034224987], [27.601899579167366, 75.89550316333771, -9.255100041627884], [25.713549926877022, 76.58799737691879, -9.03285015374422], [-33.527400344610214, 78.25499773025513, -9.349900297820568], [-35.593751817941666, 78.27749848365784, -9.238299913704395], [-12.091699987649918, 78.79749685525894, -9.323650039732456], [-37.84840181469917, 80.84800094366074, -9.762600064277649], [8.898800238966942, 79.7709971666336, -9.994049556553364], [-12.120500206947327, 80.66099882125854, -10.165500454604626], [-13.420149683952332, 83.01849663257599, -9.173600003123283], [-33.50545093417168, 88.21050077676773, -9.349600411951542], [-11.777300387620926, 92.39999949932098, -10.065199807286263], [-17.743200063705444, 96.94249927997589, -9.694499894976616], [-29.534999281167984, 27.678700163960457, -9.228049777448177], [24.52315017580986, 39.18125107884407, -10.141399689018726], [-40.22995010018349, 41.84434935450554, -9.550349786877632], [-25.5196001380682, 46.140000224113464, -9.716849774122238], [2.558730076998472, 45.83379998803139, -9.043499827384949], [4.028819967061281, 49.70179870724678, -9.44804958999157], [28.960999101400375, 52.45549976825714, -9.157950058579445], [7.601200137287378, 58.00599977374077, -9.033399634063244], [-14.55955021083355, 61.849500983953476, -9.976300410926342], [35.57555004954338, 62.24500015377998, -9.85225010663271], [35.264451056718826, 64.48999792337418, -9.967549704015255], [36.226000636816025, 63.872501254081726, -10.233149863779545], [37.69565001130104, 64.13350254297256, -10.004599578678608], [37.83734887838364, 66.22499972581863, -9.97950043529272], [35.444699227809906, 66.2430003285408, -9.876199997961521], [-7.87969958037138, 66.47299975156784, -9.244699962437153], [-7.143800146877766, 68.1850016117096, -9.07064974308014], [-26.84449963271618, 70.06850093603134, -9.094350039958954], [-29.642950743436813, 72.3785012960434, -9.166750125586987], [-11.195000261068344, 74.06000047922134, -9.337999857962132], [-12.150250375270844, 91.30900353193283, -9.970099665224552], [-14.823749661445618, 26.491999626159668, -9.113050065934658], [15.018150210380554, 26.45689994096756, -9.048249572515488], [17.103100195527077, 26.422349736094475, -8.724650368094444], [-19.74545046687126, 26.735899969935417, -9.070799686014652], [-12.914399616420269, 26.710249483585358, -9.026099927723408], [18.28470081090927, 26.666900143027306, -9.546900168061256], [-23.57419952750206, 26.713749393820763, -8.723899722099304], [31.93499892950058, 27.17900089919567, -9.167949669063091], [-25.536350905895233, 26.80025063455105, -8.830149658024311], [27.372749522328377, 27.367450296878815, -8.844399824738503], [25.6888996809721, 28.116650879383087, -8.89539998024702], [-31.429149210453033, 28.84339913725853, -9.703800082206726], [32.08104893565178, 30.060699209570885, -9.373449720442295], [-8.719149976968765, 29.273249208927155, -9.142800234258175], [9.104249998927116, 29.375599697232246, -9.089949540793896], [22.212199866771698, 28.729500249028206, -9.847999550402164], [23.778149858117104, 28.859199956059456, -9.296899661421776], [-43.497100472450256, 29.63555045425892, -9.785549715161324], [-41.581399738788605, 30.141999945044518, -9.564650245010853], [-39.68074917793274, 29.732249677181244, -9.489900432527065], [-37.73225098848343, 29.93514947593212, -9.018300101161003], [-35.55414825677872, 29.695499688386917, -8.836899884045124], [-33.57364982366562, 29.347149655222893, -9.104950353503227], [31.48769959807396, 31.658150255680084, -9.049749933183193], [-6.693299859762192, 31.3369482755661, -9.062100201845169], [7.5576999224722385, 31.50619938969612, -9.044099599123001], [-41.710350662469864, 31.57695010304451, -9.44720022380352], [30.37099912762642, 32.29235112667084, -9.57425031810999], [-41.34345054626465, 33.08555111289024, -9.542400017380714], [-4.748514853417873, 33.60304981470108, -9.100549854338169], [29.792899265885353, 33.694300800561905, -8.981299586594105], [-39.65580090880394, 33.45035016536713, -9.074949659407139], [-38.30984979867935, 34.28500145673752, -9.60609968751669], [6.229199934750795, 35.27455031871796, -9.146999567747116], [28.859850019216537, 34.80495139956474, -8.982500061392784], [-3.16408509388566, 35.62590107321739, -9.122500196099281], [27.52479910850525, 35.96245124936104, -9.005299769341946], [-2.186229918152094, 36.86340153217316, -8.846649900078773], [25.459999218583107, 37.682849913835526, -8.941950276494026], [-39.94610160589218, 37.63340041041374, -8.960699662566185], [6.179300136864185, 39.59539905190468, -9.054499678313732], [22.667549550533295, 41.298750787973404, -9.10934992134571], [0.5427399883046746, 41.822999715805054, -8.887549862265587], [23.212049156427383, 43.81474852561951, -8.889400400221348], [1.5385049628093839, 43.82704943418503, -9.06750001013279], [6.844049785286188, 43.55045035481453, -8.969149552285671], [-23.76065030694008, 45.54219916462898, -8.792299777269363], [-23.138700053095818, 44.75324973464012, -9.396100416779518], [-21.763350814580917, 44.60030049085617, -9.453649632632732], [7.584750186651945, 45.627448707818985, -8.990149945020676], [-19.369499757885933, 45.28899863362312, -8.8724996894598], [24.030650034546852, 45.48085108399391, -8.858850225806236], [-40.115151554346085, 45.53909972310066, -9.491500444710255], [25.08074976503849, 46.858400106430054, -8.850649930536747], [-16.4551492780447, 47.68545180559158, -8.89385025948286], [-25.510000064969063, 47.95125126838684, -9.141700342297554], [-15.724599361419678, 48.41715097427368, -9.163900278508663], [9.00185015052557, 48.30535128712654, -9.03400033712387], [25.807900354266167, 47.94264957308769, -9.132199920713902], [-14.880199916660786, 49.803148955106735, -8.943499997258186], [10.0662000477314, 49.86029863357544, -8.755650371313095], [27.398500591516495, 50.00850185751915, -9.003750048577785], [-14.05125018209219, 50.595998764038086, -9.555299766361713], [4.295635037124157, 50.439998507499695, -8.768299594521523], [-13.555100187659264, 52.12150141596794, -8.946550078690052], [28.454450890421867, 51.60149931907654, -9.115350432693958], [11.577799916267395, 52.15999856591225, -8.797249756753445], [-22.736800834536552, 53.53099852800369, -9.384050033986568], [5.7982997968792915, 54.43299934267998, -8.989199995994568], [29.97254952788353, 54.151501506567, -9.050150401890278], [-12.877750210464, 54.05449867248535, -8.885649964213371], [-12.217650189995766, 54.803501814603806, -9.18314978480339], [-11.57859992235899, 56.154001504182816, -9.149700403213501], [6.638550199568272, 56.33949860930443, -9.039100259542465], [30.402900651097298, 55.68550154566765, -9.533500298857689], [-19.637400284409523, 56.23149871826172, -8.933399803936481], [31.01935051381588, 56.26500025391579, -8.881050162017345], [-35.52110120654106, 58.09599906206131, -8.995549753308296], [-10.99220011383295, 58.45849961042404, -9.206649847328663], [14.93079960346222, 58.13299864530563, -8.986850269138813], [31.795449554920197, 58.182500302791595, -9.05575044453144], [-17.31180027127266, 58.219000697135925, -8.925650268793106], [31.93660080432892, 60.09649857878685, -9.538150392472744], [15.250200405716896, 60.261499136686325, -8.927600458264351], [-15.229799784719944, 60.3254996240139, -9.166699834167957], [-9.610350243747234, 60.75749918818474, -9.779499843716621], [-9.545300155878067, 62.562502920627594, -9.398999623954296], [10.212100110948086, 61.00299954414368, -9.492600336670876], [14.345649629831314, 61.563000082969666, -8.954299613833427], [13.012150302529335, 61.88900023698807, -9.163649752736092], [-13.044649735093117, 64.10250067710876, -8.960450068116188], [-31.11420013010502, 64.03099745512009, -8.842400275170803], [33.752501010894775, 66.19550287723541, -9.211099706590176], [-27.870450168848038, 68.35900247097015, -9.00224968791008], [-11.899949982762337, 68.31750273704529, -9.526650421321392], [31.501401215791702, 70.45850157737732, -9.096549823880196], [-33.64564850926399, 70.53600251674652, -9.123099967837334], [-26.356549933552742, 70.73599845170975, -9.503000415861607], [31.142249703407288, 71.58900052309036, -8.96649993956089], [-35.57020053267479, 72.42149859666824, -9.315099567174911], [29.97625060379505, 72.55549728870392, -9.20450035482645], [-27.467550709843636, 72.36050069332123, -8.80375038832426], [-2.9821849893778563, 72.33799993991852, -8.820350281894207], [-2.6857301127165556, 73.97600263357162, -9.411349892616272], [29.192950576543808, 73.96300137042999, -9.114500135183334], [-33.33739936351776, 75.87850093841553, -9.004799649119377], [-11.69584970921278, 76.6569972038269, -8.799400180578232], [-1.0160199599340558, 74.522003531456, -9.228100068867207], [-0.33293600426986814, 76.02199912071228, -9.59755014628172], [-31.684301793575287, 76.36100053787231, -8.928350172936916], [-29.544100165367126, 77.02399790287018, -8.891049772500992], [25.487450882792473, 77.80899852514267, -9.421099908649921], [0.8862150134518743, 76.40500366687775, -9.400949813425541], [2.859510015696287, 76.66949927806854, -8.867849595844746], [-31.64694830775261, 78.80750298500061, -9.271150454878807], [-29.386049136519432, 78.94500344991684, -9.134200401604176], [3.353864885866642, 78.53499799966812, -9.654900059103966], [23.633800446987152, 78.47099751234055, -9.363049641251564], [4.994300194084644, 78.26700061559677, -9.593450464308262], [-37.57699951529503, 78.76399904489517, -9.0616000816226], [-12.425900436937809, 79.50150221586227, -8.917950093746185], [8.917099796235561, 78.79000157117844, -9.12955030798912], [6.917899940162897, 78.62450182437897, -9.170600213110447], [19.69360001385212, 78.85649800300598, -9.028799831867218], [21.514400839805603, 78.62599939107895, -9.029700420796871], [-39.84155133366585, 80.53749799728394, -9.13309957832098], [7.659549824893475, 80.15350252389908, -9.890899993479252], [13.07045016437769, 78.96649837493896, -8.848600089550018], [-12.898200191557407, 81.0990035533905, -9.065349586308002], [19.176200032234192, 80.52550256252289, -9.717850014567375], [13.333950191736221, 79.92900162935257, -9.516599588096142], [17.246700823307037, 80.30399680137634, -9.603249840438366], [-35.9501987695694, 81.33699744939804, -9.783649817109108], [-35.585448145866394, 82.64599740505219, -8.969450369477272], [-34.38179939985275, 83.5615023970604, -9.60635021328926], [-34.372299909591675, 84.3454971909523, -9.675850160419941], [-13.922049663960934, 84.55599844455719, -9.6627501770854], [-35.64969822764397, 84.83149856328964, -9.016149677336216], [-14.777050353586674, 85.23599803447723, -8.826250210404396], [-15.862999483942986, 86.70350164175034, -9.033950045704842], [-15.200300142168999, 88.99600058794022, -9.352399967610836], [-31.53429925441742, 88.81799876689911, -9.047550149261951], [-29.739849269390106, 89.46099877357483, -9.057600051164627], [-27.622200548648834, 89.63499963283539, -9.526100009679794], [-25.528499856591225, 90.12100100517273, -9.065000340342522], [-23.234449326992035, 90.92400223016739, -8.8644502684474], [-21.91684953868389, 92.90450066328049, -8.813099935650826], [-13.073249720036983, 92.51049906015396, -9.77845024317503], [-15.475999563932419, 92.6084965467453, -9.276649914681911], [-17.642799764871597, 93.07549893856049, -8.841400034725666], [-18.01224984228611, 95.0699970126152, -9.500049985945225], [-21.008750423789024, 94.79500353336334, -9.098449721932411], [-19.510649144649506, 96.59349918365479, -9.389500133693218], [-21.66295051574707, 26.71149931848049, -8.777099661529064], [33.39939936995506, 27.680600062012672, -8.73200036585331], [6.034799851477146, 37.56999969482422, -8.909200318157673], [6.4027998596429825, 41.4000004529953, -8.9009003713727], [3.3576600253582, 47.86524921655655, -8.976450189948082], [-39.55245018005371, 50.31849816441536, -8.876550011336803], [-37.60385140776634, 54.45300042629242, -8.993200026452541], [13.886949978768826, 56.052498519420624, -9.130200371146202], [-20.773449912667274, 55.759500712156296, -9.47870034724474], [-11.12465001642704, 60.171499848365784, -8.91914963722229], [-32.95154869556427, 61.93849816918373, -8.663349784910679], [11.180100031197071, 61.723001301288605, -8.856049738824368], [37.73310035467148, 62.35099956393242, -9.377099573612213], [33.58655050396919, 64.24400210380554, -9.374899789690971], [39.52350094914436, 64.21750038862228, -8.951149880886078], [32.463498413562775, 64.94999676942825, -9.858899749815464], [-8.751749992370605, 65.91899693012238, -9.074199944734573], [-12.788349762558937, 66.40250235795975, -8.797000162303448], [39.919499307870865, 66.20749831199646, -9.367450140416622], [-11.671899817883968, 66.33350253105164, -9.828699752688408], [33.69339928030968, 68.24050098657608, -8.898399770259857], [35.58345139026642, 68.4870034456253, -9.266049601137638], [37.42444887757301, 68.24850291013718, -9.502450004220009], [39.766449481248856, 68.29699873924255, -9.124750271439552], [-31.6770002245903, 72.04899936914444, -8.938649669289589], [-26.374399662017822, 71.51799649000168, -9.004799649119377], [-35.40024906396866, 74.3900015950203, -8.833999745547771], [11.017650365829468, 78.94250005483627, -9.012400172650814], [15.279149636626244, 79.0340006351471, -8.917300030589104], [-36.773551255464554, 87.33350038528442, -8.873499929904938], [-26.20524913072586, 89.78749811649323, -9.706949815154076], [-31.54049813747406, 28.02935056388378, -8.739699609577656], [-5.805999971926212, 32.09029883146286, -8.860450237989426], [-39.38554972410202, 35.65270081162453, -8.876100182533264], [35.5350486934185, 60.221001505851746, -9.349299594759941], [33.51270034909248, 62.13099882006645, -9.360499680042267], [-12.443800456821918, 67.94550269842148, -8.705000393092632], [29.57789972424507, 27.073049917817116, -8.770650252699852], [-9.76139958947897, 28.144750744104385, -8.745449595153332], [23.49640056490898, 28.29729951918125, -8.640299551188946], [-7.7194999903440475, 29.929399490356445, -8.695799857378006], [37.345051765441895, 60.325998812913895, -8.875399827957153], [-10.783500038087368, 61.72649934887886, -8.780550211668015], [17.587000504136086, 79.06799763441086, -8.893200196325779], [-35.28150171041489, 88.02799880504608, -8.624750189483166], [-14.930100180208683, 90.76549857854843, -8.832300081849098], [33.54185074567795, 60.157500207424164, -8.928749710321426], [-37.545301020145416, 82.44749903678894, -8.788649924099445], [32.91115164756775, 29.345350340008736, -8.59019998461008], [14.365499839186668, 56.9319985806942, -8.607899770140648], [35.609349608421326, 58.48050117492676, -8.737649768590927], [37.55364939570427, 69.96650248765945, -8.779199793934822], [-27.54184976220131, 90.0299996137619, -8.57979990541935], [19.82484944164753, 26.4894999563694, -8.317150175571442], [24.702750146389008, 28.65315042436123, -8.823749609291553], [-39.70799967646599, 31.612299382686615, -8.679499849677086], [30.84379993379116, 33.02345052361488, -8.329300209879875], [-3.780259983614087, 34.36579927802086, -8.429249748587608], [6.022249814122915, 36.03589907288551, -8.570199832320213], [24.230699986219406, 38.30819949507713, -8.249600417912006], [-40.9960001707077, 40.000900626182556, -8.43065045773983], [-41.297849267721176, 41.71130061149597, -8.477150462567806], [-41.185300797224045, 43.894700706005096, -8.619200438261032], [2.2281750570982695, 44.872451573610306, -8.576150052249432], [-21.741649135947227, 45.05079984664917, -8.506749756634235], [-41.07224941253662, 45.93275114893913, -8.459949865937233], [26.54144912958145, 48.71105030179024, -8.404799737036228], [-24.17049929499626, 50.316501408815384, -8.425399661064148], [-39.34524953365326, 52.16199904680252, -8.484800346195698], [-22.259749472141266, 52.786000072956085, -8.340599946677685], [-37.3384989798069, 56.07299879193306, -8.436299860477448], [-12.596949934959412, 56.111499667167664, -8.436749689280987], [-18.22805032134056, 56.88349902629852, -8.421050384640694], [-15.884850174188614, 58.76550078392029, -8.350100368261337], [33.493999391794205, 58.283500373363495, -8.386650122702122], [38.911499083042145, 62.7174973487854, -8.460599929094315], [41.29695147275925, 66.25449657440186, -8.454649709165096], [-28.78524921834469, 67.40699708461761, -8.312899619340897], [35.67714989185333, 69.72599774599075, -8.484099991619587], [-37.341050803661346, 70.43299823999405, -8.427450433373451], [-3.4589949063956738, 71.06450200080872, -8.36739968508482], [-1.3299150159582496, 73.07650148868561, -8.498050272464752], [0.9495699778199196, 75.03949850797653, -8.520849980413914], [4.837890155613422, 77.0924985408783, -8.588500320911407], [21.731749176979065, 77.34549790620804, -8.514399640262127], [23.783499374985695, 77.11400091648102, -8.583500050008297], [-39.34844955801964, 79.14800196886063, -8.426600135862827], [-31.047150492668152, 79.73500341176987, -8.579649962484837], [-29.903650283813477, 79.7400027513504, -8.643600158393383], [-41.590701788663864, 80.98500221967697, -8.404949679970741], [-39.37260061502457, 81.95149898529053, -8.482149802148342], [-16.71620085835457, 87.54400163888931, -8.359399624168873], [-16.579650342464447, 88.69750052690506, -8.38600005954504], [-28.956200927495956, 89.86999839544296, -8.545700460672379], [-19.155049696564674, 94.77200359106064, -8.588450029492378], [-33.04015100002289, 28.271600604057312, -8.27960018068552], [6.042750086635351, 39.1337014734745, -8.572350256145], [8.180700242519379, 46.92775011062622, -8.361900225281715], [-38.85985165834427, 53.72750014066696, -8.33974964916706], [30.87420016527176, 54.98950183391571, -8.331749588251114], [-12.298749759793282, 58.3919994533062, -8.404750376939774], [37.10684925317764, 58.884501457214355, -8.496450260281563], [-34.91244837641716, 59.812501072883606, -8.34755040705204], [41.60115122795105, 68.06699931621552, -8.533350192010403], [39.30079936981201, 70.12499868869781, -8.481400087475777], [-37.03190013766289, 72.17449694871902, -8.357900194823742], [14.146850444376469, 26.42204985022545, -8.310399949550629], [-15.283400192856789, 26.988249272108078, -7.119100075215101], [9.638549759984016, 28.369400650262833, -8.281799964606762], [7.846849970519543, 30.60084953904152, -8.324350230395794], [-40.4512993991375, 35.40809825062752, -7.7935499139130116], [-2.6898649521172047, 35.42130067944527, -7.171799894422293], [-40.87644815444946, 37.8573015332222, -8.212050423026085], [22.96300046145916, 41.67195037007332, -7.1367002092301846], [-42.227499186992645, 43.935101479291916, -7.224550005048513], [-40.97364842891693, 47.47600108385086, -8.209999650716782], [-24.407150223851204, 48.05564880371094, -8.1794997677207], [30.236700549721718, 53.365498781204224, -7.847250439226627], [-18.94170045852661, 55.48600107431412, -8.035499602556229], [32.12819993495941, 56.178998202085495, -7.550150156021118], [38.23160007596016, 60.03350019454956, -7.450900040566921], [-33.86874869465828, 62.08749860525131, -6.995650008320808], [-29.82570044696331, 66.32550060749054, -7.056300062686205], [33.73584896326065, 67.86850094795227, -7.164150010794401], [40.99214822053909, 69.63349878787994, -8.309099823236465], [-35.777900367975235, 70.75800001621246, -7.317999843508005], [-11.934899725019932, 70.91650366783142, -7.542000152170658], [25.3503005951643, 75.50100237131119, -8.200399577617645], [23.311449214816093, 76.05700194835663, -7.445049937814474], [7.274750154465437, 77.7755007147789, -7.705000229179859], [-33.948298543691635, 79.19999957084656, -8.033749647438526], [-40.57694971561432, 79.72999662160873, -8.118550293147564], [-12.633400037884712, 80.90750128030777, -7.19395000487566], [-31.89004957675934, 89.48399871587753, -7.484850008040667], [-16.331849619746208, 91.45700186491013, -8.262399584054947], [23.61389994621277, 27.232550084590912, -7.339150179177523], [33.94414857029915, 29.720349237322807, -7.463099900633097], [32.80625119805336, 31.12740069627762, -8.184850215911865], [2.67530488781631, 45.9071509540081, -7.078949827700853], [27.843749150633812, 49.663349986076355, -7.593200076371431], [-12.978999875485897, 56.218501180410385, -7.148650009185076], [38.03424909710884, 58.27150121331215, -7.193149998784065], [-14.051600359380245, 64.72949683666229, -7.770549971610308], [41.83129966259003, 64.16449695825577, -7.168550044298172], [-5.555150099098682, 68.58649849891663, -8.168100379407406], [31.660448759794235, 68.23199987411499, -7.856350392103195], [34.34690088033676, 69.45300102233887, -7.334399968385696], [35.55845096707344, 70.45599818229675, -7.141049951314926], [39.916250854730606, 70.79750299453735, -8.02375003695488], [-38.015399128198624, 72.24900275468826, -7.704849820584059], [-33.297598361968994, 71.99449837207794, -7.1807000786066055], [27.322549372911453, 73.88900220394135, -7.974750362336636], [19.3315502256155, 77.71699875593185, -7.699649780988693], [-31.648900359869003, 80.37800341844559, -7.223949767649174], [-20.326899364590645, 94.27150338888168, -8.100450038909912], [-38.4337492287159, 30.953800305724144, -7.201150059700012], [7.125500123947859, 43.74359920620918, -7.068450096994638], [-22.910699248313904, 51.56800150871277, -8.032949641346931], [-38.62304985523224, 54.55249920487404, -8.089800365269184], [35.63360124826431, 56.41400068998337, -7.83194974064827], [-11.165300384163857, 60.15300005674362, -7.281249854713678], [-15.664549544453621, 60.33800169825554, -7.541149854660034], [13.196500018239021, 62.61099874973297, -7.142200134694576], [41.85919836163521, 70.21349668502808, -7.7819498255848885], [-4.495684988796711, 69.64900344610214, -7.881850004196167], [37.40435093641281, 71.23350352048874, -8.131500333547592], [-27.646800503134727, 71.98049873113632, -6.953000091016293], [-31.638100743293762, 72.331503033638, -6.92619988694787], [-37.45904937386513, 73.96800071001053, -7.0373499765992165], [-35.72285175323486, 74.79099929332733, -7.194050122052431], [-30.194450169801712, 77.0144984126091, -6.977899931371212], [21.59070037305355, 76.66199654340744, -7.229050155729055], [-43.601248413324356, 81.05800300836563, -6.9771502166986465], [-39.614200592041016, 82.9090029001236, -7.407300174236298], [-17.42440089583397, 90.88350087404251, -7.765349932014942], [-18.14825087785721, 92.47799962759018, -7.970199920237064], [21.787650883197784, 26.722799986600876, -7.909799925982952], [-23.673249408602715, 27.081599459052086, -6.871100049465895], [12.570999562740326, 26.539599522948265, -7.594650145620108], [-21.74445055425167, 27.60305069386959, -6.7818001843988895], [-29.55544926226139, 26.78835019469261, -6.712149828672409], [33.80110114812851, 27.15655043721199, -7.124700117856264], [-31.70190006494522, 27.369199320673943, -7.097550202161074], [-33.66075083613396, 27.971049770712852, -7.002399768680334], [-35.95145046710968, 29.220400378108025, -7.17665022239089], [-7.273649796843529, 29.69514951109886, -7.053050212562084], [8.680200204253197, 29.27670069038868, -7.22324987873435], [7.901900447905064, 30.382750555872917, -6.667799782007933], [-6.312000099569559, 30.868899077177048, -6.976299919188023], [33.57170149683952, 31.529098749160767, -6.8883998319506645], [-5.30195003375411, 31.85170143842697, -7.012200076133013], [7.201349828392267, 31.783800572156906, -6.953500211238861], [32.34805166721344, 32.411299645900726, -7.0524499751627445], [-40.11420160531998, 33.61370041966438, -7.1911499835550785], [29.502149671316147, 34.22684967517853, -6.767999846488237], [24.053199216723442, 38.21654990315437, -6.738400086760521], [-42.28055104613304, 41.429001837968826, -7.017150055617094], [1.6758199781179428, 43.57580095529556, -6.893500220030546], [23.81264977157116, 43.78949850797653, -6.895300000905991], [2.2334749810397625, 44.89469900727272, -7.45740020647645], [-42.2075018286705, 45.99044844508171, -6.919700186699629], [-22.76564948260784, 45.7894504070282, -7.833350449800491], [-21.77415043115616, 46.02774977684021, -7.328450214117765], [-19.814299419522285, 46.19140177965164, -7.336500100791454], [7.972650229930878, 45.8517000079155, -7.28575000539422], [-18.168650567531586, 46.60319909453392, -7.812099996954203], [25.354299694299698, 45.98819836974144, -6.85515021905303], [-17.339199781417847, 48.14400151371956, -7.406299933791161], [9.116950444877148, 47.749899327754974, -7.198399864137173], [3.4189100842922926, 47.974199056625366, -6.842250004410744], [26.197200641036034, 47.56449908018112, -7.438300177454948], [-40.61020165681839, 50.47899857163429, -7.733500096946955], [-15.764899551868439, 50.57799816131592, -7.218599785119295], [29.931649565696716, 52.03549936413765, -7.072850130498409], [-14.841250143945217, 52.44649946689606, -6.996899843215942], [4.764684941619635, 52.07949876785278, -7.146600168198347], [-40.30120000243187, 52.37999930977821, -7.1494500152766705], [-13.915049843490124, 52.834998816251755, -7.993149571120739], [-39.45029899477959, 54.12450060248375, -7.068050093948841], [-21.042050793766975, 53.66000160574913, -7.975350134074688], [31.286101788282394, 54.200999438762665, -6.9657498970627785], [13.257450424134731, 54.322000592947006, -6.99960021302104], [-19.3387009203434, 54.31799963116646, -6.943350192159414], [5.31555013731122, 54.09950017929077, -6.803050171583891], [-38.090549409389496, 56.43549934029579, -7.196149788796902], [-37.25019842386246, 57.93150141835213, -6.966900080442429], [-17.167849466204643, 58.057498186826706, -7.16619985178113], [-12.698049657046795, 58.12149867415428, -7.421750109642744], [33.64510089159012, 56.21949955821037, -7.352349814027548], [33.60224887728691, 57.18649923801422, -8.024799637496471], [36.57599911093712, 57.2500005364418, -8.114100433886051], [-15.92789962887764, 58.90800058841705, -7.50515004619956], [7.182400207966566, 58.33350121974945, -7.095050066709518], [-35.5740487575531, 60.03149971365929, -7.113299798220396], [14.93894960731268, 61.81950122117996, -6.940649822354317], [9.73424967378378, 61.63400039076805, -6.995900068432093], [-10.722249746322632, 61.53399869799614, -7.674249820411205], [10.94105001538992, 62.334999442100525, -7.074600085616112], [38.568250834941864, 61.63949891924858, -6.859099958091974], [-15.385350212454796, 62.12649866938591, -6.9935498759150505], [39.470650255680084, 62.52899765968323, -7.229499984532595], [-9.037449955940247, 62.35149875283241, -6.980699952691793], [-31.77719935774803, 64.28249925374985, -6.817750167101622], [-14.784250408411026, 63.89550119638443, -6.8604000844061375], [-8.763650432229042, 63.74350190162659, -7.770999800413847], [40.48305004835129, 63.858501613140106, -7.907349616289139], [42.06885024905205, 65.85749983787537, -7.846199907362461], [-13.786500319838524, 66.04500114917755, -6.989100016653538], [-6.6963499411940575, 66.19749963283539, -7.394100073724985], [-12.86575011909008, 68.22150200605392, -7.073749788105488], [-5.02610020339489, 68.18199902772903, -7.0383502170443535], [43.637849390506744, 68.15999746322632, -7.612400222569704], [42.73014888167381, 69.1789984703064, -7.970049977302551], [31.006649136543274, 69.41650062799454, -7.811900228261948], [29.71065044403076, 70.36250084638596, -7.3574502021074295], [29.04280088841915, 71.91549986600876, -7.817300036549568], [-1.0922349756583571, 72.44350016117096, -6.966799963265657], [-29.6167004853487, 72.45050370693207, -6.892649922519922], [1.0482750367373228, 74.30200278759003, -7.1923998184502125], [25.704199448227882, 74.41700249910355, -7.046299986541271], [2.37878505140543, 75.04600286483765, -6.869549863040447], [-33.85945037007332, 75.16349852085114, -6.75344979390502], [24.149950593709946, 75.34100115299225, -6.993500050157309], [-31.571250408887863, 76.17899775505066, -6.950300186872482], [5.059400107711554, 76.67800039052963, -7.018299773335457], [-28.97145040333271, 78.18900048732758, -7.113399915397167], [6.597450003027916, 77.20249891281128, -6.605899892747402], [-37.7206988632679, 78.9484977722168, -7.073800079524517], [15.575299970805645, 78.1169980764389, -7.009549997746944], [-39.55424949526787, 79.04250174760818, -7.094500120729208], [-29.520699754357338, 80.26999980211258, -7.3413001373410225], [-41.87909886240959, 79.97050136327744, -7.1508497931063175], [-43.83169859647751, 82.73950219154358, -7.264900021255016], [-41.5615513920784, 82.72799849510193, -7.131699938327074], [-37.71689906716347, 83.38700234889984, -7.324900012463331], [-36.8649996817112, 84.45599675178528, -6.870250217616558], [-36.52910143136978, 85.10000258684158, -7.463550195097923], [-16.77289977669716, 87.45899796485901, -6.856199819594622], [-36.47284954786301, 86.9785025715828, -7.004899904131889], [-33.5858017206192, 89.01400119066238, -6.989949848502874], [-17.677349969744682, 88.7639969587326, -7.2073498740792274], [-29.632650315761566, 90.17550200223923, -7.122050039470196], [-23.575399070978165, 90.488001704216, -6.943000014871359], [-21.614249795675278, 90.84050357341766, -6.757999770343304], [-21.48755080997944, 92.55000203847885, -7.627100218087435], [-19.615650177001953, 92.9424986243248, -7.651600055396557], [13.307750225067139, 26.43820084631443, -6.572300102561712], [14.456500299274921, 26.446500793099403, -7.308050058782101], [15.358650125563145, 26.73020027577877, -6.796000059694052], [17.31489971280098, 26.785099878907204, -6.9481502287089825], [18.09309981763363, 26.50110051035881, -7.457850035279989], [19.697699695825577, 26.48019976913929, -7.014799863100052], [-27.641650289297104, 26.669349521398544, -6.850500125437975], [-25.573400780558586, 26.73020027577877, -7.1056499145925045], [-11.164399795234203, 26.927150785923004, -7.052700035274029], [11.275350116193295, 26.978500187397003, -6.940249819308519], [31.466498970985413, 26.906799525022507, -6.889500189572573], [31.602848321199417, 33.04089978337288, -6.749200168997049], [6.6904001869261265, 33.41050073504448, -6.767699960619211], [28.773000463843346, 34.8007008433342, -7.427149917930365], [27.547450736165047, 35.40299832820892, -6.776600144803524], [25.03030002117157, 37.180300801992416, -7.088200189173222], [-1.1746400268748403, 37.671200931072235, -6.881500128656626], [6.033900193870068, 37.614598870277405, -6.9738999009132385], [-42.14410111308098, 39.37605023384094, -6.949500180780888], [6.064999848604202, 39.14244845509529, -7.565749809145927], [-0.2945105079561472, 39.35600072145462, -6.836850196123123], [6.583349779248238, 41.579149663448334, -6.969649810343981], [0.6998599856160581, 41.68215021491051, -6.919099949300289], [-23.360449820756912, 47.7849505841732, -7.187800016254187], [-41.7916513979435, 48.088401556015015, -7.026250008493662], [27.25440077483654, 48.21684956550598, -6.750899832695723], [10.95774956047535, 50.25799944996834, -6.726049818098545], [-23.357750847935677, 49.70559850335121, -7.3562501929700375], [29.180599376559258, 50.618499517440796, -6.88060000538826], [-21.248050034046173, 52.03849822282791, -7.039499934762716], [-13.826649636030197, 54.36449870467186, -7.228800095617771], [5.917749833315611, 55.63800036907196, -7.008349988609552], [13.984349556267262, 55.61849847435951, -7.256649900227785], [14.700849540531635, 56.786999106407166, -6.710149813443422], [37.697501480579376, 56.204501539468765, -6.9761499762535095], [6.291300058364868, 56.95199966430664, -6.802900228649378], [-36.57035157084465, 58.66900086402893, -7.382750045508146], [8.770150132477283, 60.56550145149231, -7.053900044411421], [-7.380050141364336, 64.45199996232986, -6.753149908035994], [31.471099704504013, 66.27099961042404, -7.269000168889761], [33.708199858665466, 66.14150106906891, -7.08540016785264], [-28.197649866342545, 68.40699911117554, -6.918950006365776], [43.763499706983566, 70.28750330209732, -6.993450224399567], [-37.75455057621002, 70.13549655675888, -6.922150030732155], [-3.01109510473907, 70.4915001988411, -6.738650146871805], [35.877350717782974, 72.11250066757202, -6.920250132679939], [39.4463986158371, 72.35550135374069, -7.2142998687922955], [37.53814846277237, 72.54700362682343, -7.128649856895208], [-11.916549876332283, 72.57349789142609, -6.937750149518251], [27.613399550318718, 72.63000309467316, -7.001200225204229], [-11.773950420320034, 74.1174966096878, -6.8513997830450535], [-33.065300434827805, 75.58750361204147, -7.366249803453684], [-11.83874998241663, 76.30299776792526, -6.866250187158585], [9.266350418329239, 77.92250066995621, -7.188349962234497], [17.209649085998535, 77.99900323152542, -7.20309978350997], [10.91775018721819, 78.07499915361404, -6.907950155436993], [-35.676948726177216, 79.14099842309952, -7.506850175559521], [-33.48039835691452, 80.10450005531311, -7.045149803161621], [-41.000500321388245, 79.4299989938736, -6.831150036305189], [-13.508300296962261, 83.0100029706955, -7.0395502261817455], [-14.765650033950806, 85.1685032248497, -7.005599793046713], [-35.55480018258095, 88.40599656105042, -6.845950148999691], [-27.664149180054665, 90.3329998254776, -7.012200076133013], [-25.651700794696808, 90.45100212097168, -6.910750176757574], [-13.276499696075916, 26.5944991260767, -6.973249837756157], [-13.21869995445013, 26.522399857640266, -7.067199796438217], [21.46965079009533, 26.430750265717506, -6.865350063890219], [-19.55444924533367, 27.69559994339943, -7.016799878329039], [-17.216850072145462, 27.628449723124504, -6.633799988776445], [27.35459990799427, 27.33365073800087, -6.940550170838833], [35.17819941043854, 27.766399085521698, -6.745549850165844], [-9.126249700784683, 27.948999777436256, -6.770499981939793], [9.75119974464178, 28.05970050394535, -6.795850116759539], [25.693750008940697, 27.678100392222404, -6.705599837005138], [34.97444838285446, 29.546750709414482, -6.640499923378229], [-37.408750504255295, 29.939699918031693, -6.681050173938274], [-39.40904885530472, 31.979799270629883, -6.652299780398607], [-4.270065110176802, 33.296849578619, -7.027800194919109], [-3.4411849919706583, 34.23570096492767, -6.719099823385477], [6.222900003194809, 35.33070161938667, -6.694700103253126], [-41.397448629140854, 35.643551498651505, -6.6222501918673515], [6.011799909174442, 36.003999412059784, -7.223600056022406], [26.013299822807312, 36.30569949746132, -6.717599928379059], [-41.70665144920349, 37.50690072774887, -7.058550138026476], [23.24414998292923, 39.48745131492615, -6.862250156700611], [9.99240018427372, 49.10225048661232, -7.3022497817873955], [-41.30909964442253, 50.22500082850456, -6.699650082737207], [4.176994785666466, 50.21800100803375, -6.940000224858522], [11.949749663472176, 52.06549912691116, -6.937250029295683], [-17.959600314497948, 56.31349980831146, -6.914250086992979], [15.24754986166954, 58.17500129342079, -6.99960021302104], [15.740400180220604, 60.21450087428093, -6.683750078082085], [41.397351771593094, 62.63100355863571, -6.770149804651737], [43.94324868917465, 66.07349961996078, -7.012649904936552], [-5.930500105023384, 66.73400104045868, -6.807050202041864], [-28.969550505280495, 67.43200123310089, -6.713449954986572], [-26.99740044772625, 70.4675018787384, -6.594549864530563], [-12.457050383090973, 70.05900144577026, -6.731899920850992], [-39.375949651002884, 70.74149698019028, -6.759149953722954], [-2.3881399538367987, 71.50600105524063, -7.433149963617325], [-39.3838994204998, 72.41649925708771, -6.674150004982948], [3.558934899047017, 75.94099640846252, -7.012399844825268], [19.908949732780457, 77.12549716234207, -6.7780502140522], [-11.92064955830574, 78.63149791955948, -6.588149815797806], [-28.358150273561478, 79.12950217723846, -6.840450223535299], [-12.44909968227148, 79.58699762821198, -7.316200062632561], [-15.726149082183838, 86.47099882364273, -6.7900000140070915], [-21.76854945719242, 50.314001739025116, -6.685200147330761], [-20.24644985795021, 52.83449962735176, -6.836500018835068], [-32.770898193120956, 63.44400346279144, -6.77420012652874], [41.430000215768814, 72.27350026369095, -6.8317498080432415], [-19.73690092563629, 90.7370001077652, -6.974199786782265], [29.56170029938221, 27.038149535655975, -6.782650016248226], [6.271000020205975, 39.65970128774643, -6.599599961191416], [0.08060200343606994, 40.16625136137009, -6.724949926137924], [35.692449659109116, 54.23299968242645, -6.740599870681763], [-11.248650029301643, 58.23750048875809, -6.724350154399872], [33.34935009479523, 64.47599828243256, -6.799099966883659], [31.594499945640564, 64.41749632358551, -6.804899778217077], [-30.79815022647381, 65.38250297307968, -6.732699926942587], [13.380450196564198, 78.09949666261673, -6.6210501827299595], [19.50494945049286, 26.69614925980568, -6.549399811774492], [7.828200235962868, 59.59250032901764, -6.672699935734272], [-9.765650145709515, 60.53449958562851, -6.5817502327263355], [43.67474839091301, 64.70850110054016, -6.5531497821211815], [30.065450817346573, 68.22600215673447, -6.727899890393019], [-35.70979833602905, 80.03950119018555, -6.56840018928051], [-28.41714955866337, 80.10700345039368, -6.785950157791376], [-31.439051032066345, 89.93099629878998, -6.606350187212229], [23.13854917883873, 26.47314965724945, -6.433200091123581], [-19.285399466753006, 47.90965095162392, -6.508800201117992], [-17.24354922771454, 49.43329840898514, -6.472350098192692], [3.948620054870844, 49.70544949173927, -6.402850151062012], [37.312351167201996, 54.171498864889145, -6.463599856942892], [-16.700850799679756, 60.04000082612038, -6.4907497726380825], [32.82894939184189, 62.238000333309174, -6.396499928086996], [31.778451055288315, 62.524497509002686, -6.649299990385771], [45.44714838266373, 68.09750199317932, -6.529950071126223], [43.65440085530281, 71.87949866056442, -6.4165000803768635], [18.223049119114876, 77.52849906682968, -6.335299927741289], [-37.13599964976311, 79.61300015449524, -6.607300136238337], [-45.42575031518936, 82.94499665498734, -6.49929977953434], [-43.964799493551254, 83.97349715232849, -6.379200145602226], [-19.27190087735653, 89.20200169086456, -6.421899888664484], [8.536700159311295, 46.195849776268005, -6.596399936825037], [-21.864699199795723, 48.19989949464798, -6.5253498032689095], [33.78190100193024, 54.58199977874756, -6.3911001197993755], [-39.081450551748276, 55.74150010943413, -6.428400054574013], [44.93295028805733, 69.71850246191025, -6.56779995188117], [-35.06860136985779, 71.57500088214874, -6.295099854469299], [-35.01655161380768, 28.399750590324402, -6.296650040894747], [-1.9528650445863605, 36.445751786231995, -6.338649895042181], [10.264400392770767, 48.93435165286064, -6.3612498342990875], [-40.82075133919716, 51.87249928712845, -6.333949975669384], [12.574249878525734, 52.81750112771988, -6.414500065147877], [32.03950077295303, 60.83650141954422, -6.246849894523621], [30.292199924588203, 66.67699664831161, -6.302650086581707], [-3.961570095270872, 69.23750042915344, -6.487200036644936], [-12.262949720025063, 71.68199867010117, -6.210850086063147], [36.13084927201271, 73.54749739170074, -6.261699832975864], [39.462100714445114, 73.57999682426453, -6.308650132268667], [8.43810010701418, 77.5114968419075, -6.286200135946274], [-38.91110047698021, 83.71850103139877, -6.324150133877993], [-45.31639814376831, 84.30449664592743, -6.296849809587002], [-14.08930029720068, 84.48600023984909, -6.328199990093708], [-12.240899726748466, 54.80150133371353, -6.164750084280968], [-34.825049340724945, 61.59700080752373, -6.205849815160036], [28.493499383330345, 70.92849910259247, -6.313450168818235], [-40.9184992313385, 71.58199697732925, -6.190250162035227], [-11.350049637258053, 82.48600363731384, -6.267650052905083], [23.4693493694067, 26.63465030491352, -5.007000174373388], [19.865399226546288, 27.41589955985546, -4.878699779510498], [36.03215143084526, 29.54990044236183, -5.15265017747879], [34.19100120663643, 31.75869956612587, -5.799849983304739], [33.6638018488884, 33.56349840760231, -5.077349953353405], [7.452699821442366, 41.535601019859314, -5.221100058406591], [2.5649250019341707, 46.261951327323914, -5.376049783080816], [9.350050240755081, 45.969150960445404, -5.1644002087414265], [9.934850037097931, 47.76174947619438, -5.6604500859975815], [27.63034962117672, 48.254698514938354, -5.196500103920698], [-13.372349552810192, 52.03250050544739, -5.388250108808279], [-40.676049888134, 52.78149992227554, -6.093749776482582], [35.41775047779083, 53.1185008585453, -6.063200067728758], [-11.335249990224838, 56.81199952960014, -6.138850003480911], [-18.04804988205433, 58.4929995238781, -5.889249965548515], [31.796548515558243, 59.969499707221985, -5.7044499553740025], [-17.52525009214878, 60.166001319885254, -5.211700219660997], [38.44984993338585, 60.13049930334091, -5.183700006455183], [15.53369965404272, 62.477000057697296, -5.269149783998728], [41.94454848766327, 62.61499971151352, -5.725549999624491], [33.842798322439194, 63.93449753522873, -5.688299890607595], [29.78234924376011, 65.94649702310562, -5.068750120699406], [45.851901173591614, 66.09649956226349, -5.231100134551525], [-13.938849791884422, 66.83100014925003, -5.573850125074387], [-4.435374867171049, 67.69999861717224, -5.3611500188708305], [-3.4944249782711267, 68.681500852108, -5.023700185120106], [34.57149863243103, 68.87649744749069, -5.969949997961521], [45.49245163798332, 70.13150304555893, -5.123599898070097], [-37.511348724365234, 70.75300067663193, -5.250450223684311], [-40.90160131454468, 70.72649896144867, -6.153599824756384], [35.54454818367958, 72.23200052976608, -5.35944988951087], [-31.815901398658752, 72.14149832725525, -5.243950057774782], [-40.07440060377121, 72.78650254011154, -6.070349831134081], [43.88809949159622, 72.90449738502502, -5.4951501078903675], [25.929100811481476, 72.7355033159256, -4.971425049006939], [25.242550298571587, 74.00199770927429, -5.685300100594759], [1.5688750427216291, 73.89000058174133, -5.575300194323063], [21.587349474430084, 75.89799910783768, -5.508400034159422], [-10.900549590587616, 76.77599787712097, -5.799099802970886], [14.448249712586403, 77.8995007276535, -6.093349773436785], [-37.53269836306572, 80.78499883413315, -5.090299993753433], [-11.061900295317173, 81.20200037956238, -6.2743001617491245], [-43.911151587963104, 84.97100323438644, -5.240549799054861], [-41.643548756837845, 84.42199975252151, -5.119800101965666], [-12.958900071680546, 84.60649847984314, -5.914149805903435], [-34.01770070195198, 89.43150192499161, -5.3865001536905766], [31.938500702381134, 26.920149102807045, -5.207600072026253], [-23.63624982535839, 27.845600619912148, -5.196699872612953], [24.941250681877136, 44.153548777103424, -5.431199911981821], [-20.63789963722229, 48.66094887256622, -5.951149854809046], [-15.276449732482433, 49.92635175585747, -5.455249920487404], [-42.026400566101074, 50.269000232219696, -5.10959979146719], [13.782449997961521, 53.79850044846535, -5.172300152480602], [-12.60489970445633, 53.677998483181, -5.73629979044199], [38.147199898958206, 53.982000797986984, -5.938149988651276], [-19.380200654268265, 56.12749978899956, -5.400899797677994], [-11.00310031324625, 56.173499673604965, -5.131000187247992], [38.66805136203766, 55.73999881744385, -6.03235000744462], [5.402400158345699, 56.164998561143875, -5.08899986743927], [6.522350013256073, 58.499500155448914, -5.2893501706421375], [46.097248792648315, 64.72799926996231, -5.172349978238344], [46.56060039997101, 68.42300295829773, -4.944575019180775], [-31.749699264764786, 77.00599730014801, -5.116850137710571], [-10.430400259792805, 80.27700334787369, -6.019500084221363], [-8.79490002989769, 80.66850155591965, -5.976850166916847], [-9.400400333106518, 81.42899721860886, -6.1286999844014645], [-9.020250290632248, 82.98750221729279, -5.499499849975109], [-11.18605025112629, 83.34600180387497, -6.064250133931637], [-36.470599472522736, 85.25550365447998, -5.808949936181307], [-13.115949928760529, 26.6097504645586, -4.9813902005553246], [10.885999538004398, 26.9009992480278, -5.12159988284111], [-27.57829986512661, 27.04720012843609, -4.972605034708977], [-25.782199576497078, 27.510900050401688, -4.878255072981119], [15.129650011658669, 27.173250913619995, -5.080449860543013], [17.54789985716343, 27.501899749040604, -4.68192994594574], [-21.748950704932213, 28.161749243736267, -5.0604501739144325], [-19.48465034365654, 28.284849599003792, -5.180350039154291], [-9.126399643719196, 27.669599279761314, -5.0225998274981976], [8.753550238907337, 29.33714911341667, -4.915184807032347], [-36.38089820742607, 28.801949694752693, -5.618299823254347], [-6.964900065213442, 29.461899772286415, -5.154099781066179], [-39.85150158405304, 31.559698283672333, -4.996755160391331], [-5.205200053751469, 31.51325136423111, -5.074049811810255], [-2.373320050537586, 35.4793481528759, -4.986070096492767], [6.716949865221977, 35.42035073041916, -5.17710018903017], [-41.9529490172863, 35.58855131268501, -4.976455122232437], [6.830949801951647, 37.58484870195389, -4.936459939926863], [-42.70464926958084, 38.93269971013069, -5.468349903821945], [23.643599823117256, 39.56194967031479, -4.903795197606087], [23.654699325561523, 41.5072999894619, -4.984620027244091], [8.735899813473225, 44.07219961285591, -4.769455175846815], [-42.52434894442558, 48.21205139160156, -5.194900091737509], [3.7720000836998224, 50.364501774311066, -5.180899985134602], [-20.92920057475567, 52.163999527692795, -4.802349954843521], [11.602950282394886, 49.82535168528557, -5.108850076794624], [-20.25654911994934, 52.43850126862526, -5.4616001434624195], [-41.27990081906319, 52.2180013358593, -4.928459879010916], [37.53669932484627, 51.89700052142143, -5.37189980968833], [4.338964819908142, 52.607499063014984, -5.120499990880489], [35.52180156111717, 52.144501358270645, -5.3415498696267605], [-19.840799272060394, 54.33500185608864, -5.330250132828951], [33.306799829006195, 53.78900095820427, -5.564600229263306], [31.472649425268173, 54.072000086307526, -5.007450003176928], [-40.35814851522446, 54.188501089811325, -4.995754919946194], [-11.720400303602219, 54.31849882006645, -4.9614449962973595], [-39.31615129113197, 56.17149919271469, -4.987949971109629], [14.918600209057331, 55.98000064492226, -4.9582901410758495], [-18.964150920510292, 57.967498898506165, -4.804554861038923], [39.42304849624634, 56.28649890422821, -5.012399982661009], [15.869349241256714, 58.22800099849701, -5.041900090873241], [31.75780177116394, 58.22199955582619, -5.368350073695183], [16.1857008934021, 60.24099886417389, -5.428750067949295], [-36.98424994945526, 59.517499059438705, -5.049599800258875], [32.87665173411369, 60.39850041270256, -4.741195123642683], [-8.91529954969883, 60.277000069618225, -4.91840997710824], [33.470701426267624, 62.291499227285385, -4.945725202560425], [-35.04965081810951, 61.7544986307621, -4.9390350468456745], [37.563201040029526, 62.22499907016754, -4.857224877923727], [11.165999807417393, 62.99050152301788, -5.710749886929989], [39.47275131940842, 62.84099817276001, -5.657599773257971], [-7.74630019441247, 62.53249943256378, -4.930795170366764], [30.70555068552494, 63.69800120592117, -5.810449831187725], [-15.347249805927277, 64.27600234746933, -4.952054936438799], [44.06164959073067, 64.49099630117416, -5.244750063866377], [-31.978800892829895, 64.47549909353256, -5.002549849450588], [-30.790049582719803, 65.48500061035156, -5.01520000398159], [-6.176500115543604, 65.42950123548508, -5.6350501254200935], [34.45360064506531, 65.58600068092346, -5.841949954628944], [-29.707549139857292, 66.48150086402893, -4.927199799567461], [-5.245049949735403, 66.33800268173218, -5.091649945825338], [29.14544939994812, 67.89900362491608, -4.9947951920330524], [35.64370051026344, 68.27700138092041, -5.208049900829792], [47.55609855055809, 68.31800192594528, -5.008149892091751], [-13.798600062727928, 68.2855024933815, -4.897605162113905], [-13.168049976229668, 70.29999792575836, -5.062450189143419], [-39.43625092506409, 70.13899832963943, -5.235900171101093], [44.87524926662445, 70.29300183057785, -4.938185214996338], [-41.730351746082306, 70.03050297498703, -5.138350185006857], [-41.837550699710846, 72.62949645519257, -5.164649803191423], [45.53275182843208, 72.11899757385254, -5.123449955135584], [27.126500383019447, 71.98899984359741, -5.462099798023701], [-27.443349361419678, 72.21049815416336, -4.929445218294859], [-0.4678555123973638, 71.90550118684769, -5.1703001372516155], [42.11195185780525, 73.05250316858292, -5.244450177997351], [-39.446450769901276, 73.81650060415268, -4.999700002372265], [38.1680503487587, 73.80100339651108, -5.168850068002939], [41.30059853196144, 74.11299645900726, -4.9614799208939075], [-11.102399788796902, 74.3660032749176, -4.924735054373741], [23.731650784611702, 74.65700060129166, -5.094300024211407], [-33.53365138173103, 76.1445015668869, -4.985250066965818], [3.158325096592307, 74.4910016655922, -4.8866900615394115], [5.2085998468101025, 75.86699724197388, -5.15695009380579], [19.673550501465797, 76.32949948310852, -4.924700129777193], [8.939900435507298, 76.94599777460098, -5.012750159949064], [11.22019998729229, 77.12650299072266, -4.701110068708658], [12.796949595212936, 77.6669979095459, -5.47575019299984], [15.28444979339838, 77.18849927186966, -4.814814776182175], [-29.321299865841866, 77.90400087833405, -4.991544876247644], [-10.385749861598015, 78.99150252342224, -5.849150009453297], [-41.56440123915672, 80.12349903583527, -5.090250167995691], [-39.67839851975441, 80.76699823141098, -4.87020518630743], [-27.896199375391006, 78.97450029850006, -4.985244944691658], [-27.830200269818306, 80.33300191164017, -4.869794938713312], [-6.864749826490879, 80.40550351142883, -5.460300017148256], [-31.42695128917694, 81.1299979686737, -5.0361501052975655], [-5.067550111562014, 81.05050027370453, -5.028900224715471], [-45.32545059919357, 81.5265029668808, -5.048300139605999], [-7.163649890571833, 82.60449767112732, -5.314650014042854], [-10.976449586451054, 84.75600183010101, -5.7854498736560345], [-39.39510136842728, 84.29650217294693, -4.996324889361858], [-45.87534815073013, 85.06999909877777, -5.17110014334321], [-15.250450000166893, 86.75549924373627, -5.150999873876572], [-17.981549724936485, 88.13949674367905, -5.127800162881613], [-31.63595125079155, 90.15949815511703, -4.979135002940893], [-29.56715039908886, 90.44750034809113, -4.9584549851715565], [-27.62709930539131, 90.36049991846085, -4.910665098577738], [-23.693649098277092, 90.1859998703003, -5.072250030934811], [11.90285012125969, 26.460399851202965, -5.038300063461065], [12.743949890136719, 26.44124999642372, -4.840509966015816], [13.628450222313404, 26.6464501619339, -5.007800180464983], [21.70890010893345, 26.857800781726837, -5.123950075358152], [23.786449804902077, 26.462949812412262, -5.12220012024045], [-29.62370030581951, 26.675749570131302, -4.982585087418556], [-15.246500261127949, 27.293449267745018, -4.986134823411703], [25.588100776076317, 26.819299906492233, -5.094099789857864], [-31.720198690891266, 26.801250874996185, -5.06669981405139], [33.531200140714645, 26.86380036175251, -5.052150227129459], [35.88365018367767, 27.54325047135353, -4.904884845018387], [-10.97480021417141, 26.8412996083498, -4.911310039460659], [29.48470041155815, 27.003800496459007, -4.918240010738373], [-33.63934904336929, 27.32120081782341, -5.113500170409679], [27.602599933743477, 27.25300006568432, -4.90156002342701], [-17.494499683380127, 28.041500598192215, -4.855410195887089], [9.761650115251541, 28.14294956624508, -5.011749919503927], [-35.35439819097519, 27.876049280166626, -4.939049948006868], [-37.51615062355995, 29.194949194788933, -4.933495074510574], [8.130749687552452, 30.198149383068085, -5.448650103062391], [-38.864098489284515, 30.246850103139877, -4.962345119565725], [35.239651799201965, 31.506549566984177, -4.854459781199694], [7.700449787080288, 31.605150550603867, -4.873780068010092], [-40.524400770664215, 33.06424990296364, -5.5195000022649765], [-4.126360174268484, 32.95920044183731, -5.029300227761269], [7.1089500561356544, 33.643048256635666, -5.028500221669674], [31.689200550317764, 33.65530073642731, -4.901220090687275], [29.59359996020794, 33.980801701545715, -4.993794951587915], [-41.31925106048584, 34.01299938559532, -4.863865207880735], [-3.5861150827258825, 33.711548894643784, -4.944114945828915], [27.414599433541298, 35.206351429224014, -4.816154949367046], [26.06325037777424, 36.259450018405914, -5.288249813020229], [-1.8312500324100256, 36.490298807621, -4.998169839382172], [-42.502500116825104, 37.503551691770554, -4.941780120134354], [-1.0887749958783388, 37.649448961019516, -5.1194000989198685], [25.17174929380417, 37.47415170073509, -4.775165114551783], [24.129100143909454, 38.37670013308525, -5.476600024849176], [-0.30651901033706963, 39.44125026464462, -4.945565015077591], [-43.06425154209137, 39.6435484290123, -4.846340045332909], [0.05775200042990036, 40.19850119948387, -5.68540021777153], [7.07395002245903, 39.56194967031479, -5.012650042772293], [0.6272000027820468, 41.906699538230896, -5.062699783593416], [-43.23180019855499, 41.653551161289215, -4.9209450371563435], [7.829849608242512, 43.322399258613586, -5.426549818366766], [23.665549233555794, 44.03020069003105, -4.443630110472441], [1.5087949577718973, 43.75524818897247, -4.8762052319943905], [-43.262798339128494, 43.89125108718872, -4.923515021800995], [2.083755098283291, 44.79119926691055, -5.436699837446213], [-43.28399896621704, 45.65894976258278, -4.525105003267527], [25.635499507188797, 45.74200138449669, -4.872934892773628], [26.656800881028175, 46.66249826550484, -5.743749905377626], [3.0169449746608734, 48.03229868412018, -4.969969857484102], [11.092299595475197, 48.349399119615555, -4.756985232234001], [-20.214300602674484, 48.986900597810745, -5.58369979262352], [-19.276399165391922, 48.521049320697784, -4.797299858182669], [-17.39729940891266, 48.40010032057762, -5.0245001912117], [29.355600476264954, 50.188999623060226, -5.432350095361471], [-20.81499993801117, 50.07550120353699, -5.052399821579456], [-17.113149166107178, 49.54079911112785, -5.76250022277236], [12.051950208842754, 51.033999770879745, -5.40135009214282], [29.524249956011772, 52.264001220464706, -5.092550069093704], [-14.374599792063236, 51.5579991042614, -5.671950057148933], [13.038299977779388, 52.17200145125389, -4.986769985407591], [33.75454992055893, 52.58199945092201, -4.7300951555371284], [4.786000121384859, 54.31250110268593, -5.119049921631813], [39.43140059709549, 54.25550043582916, -4.904014989733696], [-37.79755160212517, 58.30850079655647, -5.075749941170216], [39.04874995350838, 58.393001556396484, -4.990764893591404], [-10.393049567937851, 57.785000652074814, -5.332650151103735], [-9.825550019741058, 58.47200006246567, -4.745385143905878], [7.253849878907204, 60.11899933218956, -4.892794881016016], [-35.962000489234924, 60.50899997353554, -5.0940001383423805], [8.173000067472458, 60.755498707294464, -5.544200073927641], [-16.647400334477425, 61.795998364686966, -4.817144945263863], [-8.324550464749336, 61.618998646736145, -5.074600223451853], [9.083000011742115, 62.28049844503403, -4.94647491723299], [30.746400356292725, 62.18649819493294, -5.688500124961138], [-33.87885168194771, 62.63600289821625, -5.164300091564655], [-15.971150249242783, 62.80999630689621, -5.054200068116188], [11.316600255668163, 63.579000532627106, -4.9017551355063915], [13.16550001502037, 64.0069991350174, -4.704840015619993], [41.847001761198044, 64.31899964809418, -5.329300183802843], [-32.90925174951553, 63.759997487068176, -4.966705106198788], [-6.799850147217512, 64.12799656391144, -4.978740122169256], [29.946299269795418, 64.38499689102173, -4.85421484336257], [35.79365089535713, 66.17649644613266, -5.1543498411774635], [-28.885100036859512, 67.40300357341766, -5.470450036227703], [-27.938250452280045, 68.39299947023392, -4.912460222840309], [-2.5708600878715515, 69.95200365781784, -5.164749920368195], [28.873249888420105, 69.45650279521942, -5.5113499984145164], [-26.82814933359623, 70.1799988746643, -4.976565018296242], [35.84295138716698, 70.41549682617188, -5.0246999599039555], [27.690600603818893, 70.52150368690491, -4.860084969550371], [-26.388999074697495, 71.59899920225143, -5.003300029784441], [-1.5615649754181504, 70.8014965057373, -4.85367001965642], [-35.89500114321709, 71.20499759912491, -4.721054807305336], [-34.81470048427582, 71.4695006608963, -5.49690006300807], [-12.844800017774105, 72.13950157165527, -4.8230797983706], [-33.52100029587746, 71.75599783658981, -4.935734905302525], [-29.595300555229187, 72.36400246620178, -4.972055088728666], [0.8438850054517388, 72.78700172901154, -4.830060061067343], [-12.148049660027027, 73.38249683380127, -5.0246501341462135], [37.765249609947205, 73.09350371360779, -4.777824971824884], [35.939548164606094, 73.91949743032455, -4.992059897631407], [-37.587400525808334, 74.10749793052673, -4.982059821486473], [39.71545025706291, 74.95500147342682, -4.872415214776993], [-35.726550966501236, 74.59449768066406, -4.976029973477125], [-34.162599593400955, 75.12550055980682, -5.471149925142527], [-8.707299828529358, 76.52950286865234, -5.33345015719533], [-9.01809986680746, 78.67100089788437, -5.056249909102917], [6.8709999322891235, 76.36000216007233, -4.919929895550013], [17.45929941534996, 76.92249864339828, -5.012250039726496], [-43.7716506421566, 80.4084986448288, -4.948215093463659], [-35.718850791454315, 81.0369998216629, -4.9921199679374695], [-33.79274904727936, 81.13449811935425, -4.970194771885872], [-29.613850638270378, 81.01049810647964, -4.8286197707057], [-5.33945020288229, 82.15299993753433, -5.052550230175257], [-46.35154828429222, 82.2950005531311, -4.968875087797642], [-37.567999213933945, 84.55149829387665, -5.003400146961212], [-8.939100429415703, 84.84199643135071, -5.252650007605553], [-7.231050170958042, 85.29999852180481, -5.146250128746033], [-36.361951380968094, 86.7374986410141, -4.94953989982605], [-6.703750230371952, 86.76250278949738, -5.011199973523617], [-5.335149820894003, 86.94849908351898, -5.064699798822403], [-17.249900847673416, 87.67350018024445, -4.9275849014520645], [-35.44804826378822, 88.82500231266022, -4.938684869557619], [-19.622400403022766, 88.8655036687851, -5.031750071793795], [-21.455999463796616, 89.41800147294998, -4.867555107921362], [-22.33774960041046, 89.97300267219543, -5.576900206506252], [-25.68270079791546, 90.31099826097488, -4.996605217456818], [28.31064909696579, 34.439899027347565, -4.9330098554492], [39.31950032711029, 52.48900130391121, -4.598109982907772], [35.520099103450775, 64.06749784946442, -5.022900179028511], [-14.721550047397614, 65.85849821567535, -4.772670101374388], [-11.111400090157986, 86.80599927902222, -4.664274863898754], [-8.857499808073044, 86.90249919891357, -5.078949965536594], [29.709599912166595, 56.22150003910065, -4.8619951121509075], [31.595800071954727, 56.25050142407417, -4.853580147027969], [29.97720055282116, 58.072999119758606, -4.769625142216682], [30.246449634432793, 60.32650172710419, -4.86451992765069], [30.174799263477325, 62.1194988489151, -4.893905017524958], [39.482299238443375, 64.52549993991852, -5.228499881923199], [-43.70354861021042, 70.22649794816971, -4.661890212446451], [-43.607551604509354, 71.8970000743866, -4.662595223635435], [-8.834750391542912, 74.4670033454895, -4.807864781469107], [-6.845499854534864, 74.92300122976303, -4.88997483626008], [-7.077500224113464, 76.28849893808365, -4.884264897555113], [-47.86450043320656, 83.31699669361115, -4.7550201416015625], [-47.81140014529228, 84.7800001502037, -4.623760003596544], [-13.21639958769083, 86.70199662446976, -4.761859774589539], [-32.98554942011833, 89.88100290298462, -4.70638507977128], [37.439100444316864, 64.17050212621689, -5.093750078231096], [27.61550061404705, 50.14749988913536, -4.965054802596569], [27.6783499866724, 52.29150131344795, -4.751239903271198], [29.32005003094673, 54.35049906373024, -4.955430049449205], [41.464198380708694, 66.09699875116348, -4.774259869009256], [25.120800361037254, 26.462599635124207, -4.4567701406776905], [-7.830250076949596, 28.498249128460884, -4.606250207871199], [32.13239833712578, 34.89924967288971, -4.340014886111021], [33.410198986530304, 35.383351147174835, -4.367220215499401], [8.181699551641941, 42.14470088481903, -4.419909790158272], [1.996465027332306, 45.035701245069504, -4.750545136630535], [-43.02775114774704, 46.99534922838211, -4.5977202244102955], [25.666050612926483, 48.17755147814751, -4.739705007523298], [10.335800237953663, 46.762898564338684, -4.4508748687803745], [-15.711350366473198, 48.37324842810631, -4.52602980658412], [-13.830100186169147, 50.32850056886673, -4.577165003865957], [26.024900376796722, 50.031501799821854, -4.575090017169714], [12.505399994552135, 50.80400034785271, -4.64027002453804], [35.76809912919998, 50.48099905252457, -4.306055139750242], [37.57745027542114, 50.32699927687645, -4.566664807498455], [3.8893551100045443, 51.86700075864792, -4.504790063947439], [-12.23789993673563, 52.83350124955177, -4.554145038127899], [32.12425112724304, 52.97650024294853, -4.4260649010539055], [-20.834850147366524, 54.34099957346916, -4.606645088642836], [28.255699202418327, 54.30600047111511, -4.327970091253519], [14.56919964402914, 54.7964982688427, -4.545920062810183], [16.708100214600563, 60.43799966573715, -4.41986508667469], [16.692500561475754, 61.67399883270264, -4.388289991766214], [15.13685006648302, 63.97649645805359, -4.324834793806076], [37.61399909853935, 66.1659985780716, -4.679275210946798], [43.71355101466179, 66.2275031208992, -4.528020042926073], [39.56004977226257, 66.4450004696846, -4.7094798646867275], [28.314150869846344, 68.85399669408798, -4.35067480430007], [-26.401899755001068, 70.73699682950974, -4.50973492115736], [46.21734842658043, 73.60199838876724, -4.4193752110004425], [-40.89925065636635, 73.68150353431702, -4.520244896411896], [44.4442518055439, 73.75449687242508, -4.529760219156742], [-35.0460484623909, 75.66949725151062, -4.392324946820736], [4.72167506814003, 74.93499666452408, -4.370030015707016], [21.840650588274002, 75.14700293540955, -4.466920159757137], [13.65474984049797, 77.1695002913475, -4.514215048402548], [23.744700476527214, 45.935798436403275, -4.449720028787851], [24.28244985640049, 47.5086010992527, -4.407770000398159], [35.46920046210289, 62.882497906684875, -4.403499886393547], [-23.14385026693344, 89.75800126791, -4.279599990695715], [34.790750592947006, 33.01884979009628, -4.291200079023838], [39.03834894299507, 50.85299909114838, -4.330589901655912], [26.500549167394638, 51.596499979496, -4.194760229438543], [5.557499825954437, 57.72149935364723, -4.225519951432943], [9.583299979567528, 63.35949897766113, -4.278149921447039], [-5.827850196510553, 65.00999629497528, -4.439310170710087], [37.3772494494915, 67.8505003452301, -4.293494857847691], [43.92920061945915, 67.43449717760086, -4.122484941035509], [-44.993799179792404, 70.72500139474869, -4.296349827200174], [-43.005749583244324, 73.73650372028351, -4.182119853794575], [-36.85494884848595, 86.35249733924866, -4.223810043185949], [39.95424881577492, 49.952950328588486, -3.2857649493962526], [-20.891400054097176, 55.42450025677681, -4.221600014716387], [32.65494853258133, 58.775000274181366, -4.478320013731718], [7.613500114530325, 61.37499958276749, -4.286524839699268], [39.354849606752396, 67.4939975142479, -4.31107496842742], [41.53034836053848, 67.63750314712524, -4.197615198791027], [-21.82525023818016, 27.983849868178368, -2.8586850967258215], [-23.574799299240112, 28.257999569177628, -3.0518199782818556], [29.606150463223457, 34.26875174045563, -3.6334949545562267], [22.986799478530884, 46.10859975218773, -3.9763799868524075], [37.68400102853775, 68.85000318288803, -4.00304002687335], [-44.00414973497391, 74.43799823522568, -3.313085064291954], [-11.198800057172775, 73.37100058794022, -3.5944851115345955], [-11.15384977310896, 74.2105022072792, -2.658205106854439], [-35.898301750421524, 75.40050148963928, -4.06576506793499], [-42.89780184626579, 79.56250011920929, -3.364739939570427], [-41.03019833564758, 85.29900014400482, -4.054345190525055], [-48.861801624298096, 86.1705020070076, -4.103194922208786], [10.968349874019623, 27.2364504635334, -2.9796950984746218], [12.753300368785858, 26.468699797987938, -3.0048249755054712], [23.606350645422935, 27.114950120449066, -3.0895851086825132], [25.902999565005302, 26.464950293302536, -3.144690068438649], [-13.464650139212608, 26.776699349284172, -3.12133994884789], [-29.60829995572567, 26.848899200558662, -3.0573999974876642], [33.6698517203331, 26.844050735235214, -2.953419927507639], [35.90960055589676, 27.357399463653564, -3.062434960156679], [-33.50704908370972, 27.01679989695549, -3.0239499174058437], [13.952000066637993, 26.87009982764721, -2.9877100605517626], [29.663000255823135, 27.106299996376038, -2.9877549968659878], [-27.760449796915054, 27.477649971842766, -2.9218399431556463], [-8.86439997702837, 27.75770053267479, -2.9477050993591547], [-35.623349249362946, 27.62329950928688, -3.066950011998415], [-15.349499881267548, 27.44939923286438, -2.930595073848963], [15.713950619101524, 27.496900409460068, -3.052139887586236], [21.59244939684868, 27.667799964547157, -3.054064931347966], [27.628550305962563, 26.81634947657585, -3.2628399785608053], [-17.30019971728325, 28.2126497477293, -2.969420049339533], [9.911100380122662, 28.22449989616871, -3.6036649253219366], [17.472650855779648, 27.81130000948906, -2.7928201016038656], [19.6359995752573, 27.880650013685226, -2.9482650570571423], [-19.716599956154823, 28.261449187994003, -3.1701799016445875], [-37.046950310468674, 28.34930084645748, -2.920974977314472], [9.38894972205162, 29.617050662636757, -2.8484249487519264], [37.09099814295769, 29.549049213528633, -2.9445900581777096], [-37.824951112270355, 28.845300897955894, -3.2560350373387337], [-7.062749937176704, 29.35349941253662, -2.9657799750566483], [-39.307549595832825, 30.230650678277016, -2.8699850663542747], [-40.358200669288635, 31.251050531864166, -2.852550009265542], [-5.046050064265728, 31.654149293899536, -3.1849900260567665], [36.48129850625992, 30.60624934732914, -3.82791506126523], [8.60155001282692, 31.56450018286705, -2.876390004530549], [36.166101694107056, 31.8806990981102, -3.40009992942214], [7.857699878513813, 32.404251396656036, -3.9026099257171154], [7.9369498416781425, 33.54870155453682, -3.2161399722099304], [-41.59329831600189, 33.476151525974274, -2.8752500656992197], [35.73039919137955, 33.51005166769028, -2.8991049621254206], [-3.7496050354093313, 33.537451177835464, -3.0344899278134108], [30.837949365377426, 34.36575084924698, -3.5847548861056566], [-2.5913899298757315, 35.376399755477905, -2.8396251145750284], [27.720250189304352, 36.129798740148544, -3.0241101048886776], [33.62264856696129, 36.16030141711235, -2.9292749240994453], [-42.48030111193657, 35.58430075645447, -3.0755349434912205], [31.581051647663116, 35.59200093150139, -3.0183750204741955], [-1.3207850279286504, 37.85555064678192, -2.950740046799183], [25.663699954748154, 37.796951830387115, -3.0489149503409863], [-42.84074902534485, 37.134598940610886, -3.5019901115447283], [7.814199663698673, 37.793248891830444, -2.82836495898664], [-43.369799852371216, 37.852950394153595, -2.7442399878054857], [-0.6750900065526366, 39.53830152750015, -2.988375024870038], [23.927349597215652, 39.8377999663353, -2.9403900261968374], [-43.43879967927933, 39.618149399757385, -3.222449915483594], [7.783649954944849, 39.25130143761635, -3.94461490213871], [8.534500375390053, 39.7709496319294, -2.8541500214487314], [-0.260288012214005, 41.29600152373314, -2.7299500070512295], [9.186499752104282, 41.503649204969406, -3.0304400715976954], [23.46239984035492, 41.45050048828125, -3.381625050678849], [-43.74970123171806, 41.583698242902756, -2.9512199107557535], [0.15330349560827017, 41.86829924583435, -3.3063599839806557], [-43.587248772382736, 44.0140999853611, -3.263235092163086], [0.9554650168865919, 43.85890066623688, -3.144599962979555], [23.56564998626709, 43.317750096321106, -3.8159850519150496], [21.8813493847847, 43.80805045366287, -3.663900075480342], [9.54500027000904, 43.54434832930565, -3.6126149352639914], [11.118249967694283, 44.02405023574829, -2.659430028870702], [-43.472401797771454, 46.22089862823486, -2.884760033339262], [1.3546249829232693, 45.959748327732086, -2.656920114532113], [11.274400167167187, 45.95065116882324, -3.440564963966608], [2.420980017632246, 48.08714985847473, -3.473609918728471], [23.365600034594536, 48.23154956102371, -3.273080103099346], [11.186400428414345, 47.34304919838905, -3.9893900975584984], [-42.98185184597969, 48.093099147081375, -2.8993450105190277], [-19.909599795937538, 47.546401619911194, -3.109860001131892], [-17.234349623322487, 47.30429872870445, -3.190584946423769], [-15.057800337672234, 48.341698944568634, -2.9021298978477716], [13.260100036859512, 48.02265018224716, -3.016730071976781], [-21.546799689531326, 48.40565100312233, -2.7579849120229483], [37.56454959511757, 49.19774830341339, -4.044414963573217], [37.46980056166649, 48.07424917817116, -3.303299890831113], [2.676134929060936, 50.069499760866165, -3.046090016141534], [24.899300187826157, 50.371501594781876, -3.5168048925697803], [13.53165041655302, 50.24050176143646, -3.5095999483019114], [35.22145003080368, 49.80364814400673, -3.5103450063616037], [-21.939000114798546, 49.84449967741966, -3.435370046645403], [-42.36074909567833, 50.25149881839752, -2.901040017604828], [-13.543699868023396, 50.10800063610077, -3.1597299966961145], [-22.196950390934944, 52.360501140356064, -3.455864964053035], [25.54750069975853, 52.42300033569336, -2.901349915191531], [-12.5730000436306, 51.38149857521057, -2.9938449151813984], [3.029200015589595, 52.34299972653389, -2.922164974734187], [-41.607748717069626, 52.339501678943634, -2.962864935398102], [40.42875021696091, 52.328500896692276, -3.2179849222302437], [26.862099766731262, 52.95649915933609, -3.64071992225945], [33.13624858856201, 52.08300054073334, -3.376489970833063], [-11.829949915409088, 52.33050137758255, -2.748805098235607], [-41.179850697517395, 53.516000509262085, -3.026715014129877], [15.405000187456608, 53.85550111532211, -3.166710026562214], [32.16705098748207, 52.10699886083603, -3.0525950714945793], [32.00174868106842, 53.89950051903725, -3.5387349780648947], [-11.041199788451195, 54.00549992918968, -3.0280048958957195], [3.492414951324463, 54.17799949645996, -2.94498004950583], [27.287550270557404, 54.2760007083416, -3.3774450421333313], [40.46269878745079, 54.27850037813187, -2.850945107638836], [-21.875249221920967, 54.47449907660484, -2.93330498971045], [4.161950200796127, 54.88850176334381, -3.613654989749193], [-40.3238981962204, 54.701000452041626, -2.7189450338482857], [32.515451312065125, 55.876001715660095, -3.8552850019186735], [-39.50899839401245, 56.33600056171417, -3.06560005992651], [-20.98339982330799, 56.20250105857849, -2.939679892733693], [-10.524850338697433, 55.47399818897247, -3.441894892603159], [15.83850011229515, 56.2095008790493, -3.5563549026846886], [28.68190035223961, 56.062500923871994, -3.7929851096123457], [4.339649807661772, 56.46950006484985, -3.2442749943584204], [-20.330749452114105, 56.78800120949745, -3.485729917883873], [40.05245119333267, 56.269001215696335, -3.0564700718969107], [5.032599903643131, 58.2364983856678, -3.221960039809346], [29.107600450515747, 58.371998369693756, -3.557885065674782], [39.3127016723156, 57.79150128364563, -3.0314200557768345], [-19.571300595998764, 58.30749869346619, -3.138310043141246], [17.209699377417564, 58.35049971938133, -2.849075011909008], [-38.06224837899208, 58.208998292684555, -2.8263500425964594], [-9.034549817442894, 57.92950093746185, -2.969050081446767], [33.30865129828453, 58.42150002717972, -2.8205299749970436], [-37.19799965620041, 59.588998556137085, -3.2535300124436617], [-18.685849383473396, 60.03199890255928, -2.7256449684500694], [6.601499859243631, 60.54199859499931, -3.7816250696778297], [33.66215154528618, 60.14150008559227, -3.304810030385852], [17.660800367593765, 60.23550033569336, -2.8315449599176645], [-8.393200114369392, 59.82249975204468, -3.59243992716074], [37.55350038409233, 60.063499957323074, -3.114470047876239], [-35.83889827132225, 60.67550182342529, -2.94690509326756], [-17.850499600172043, 60.64699962735176, -3.5780149046331644], [-7.503849919885397, 60.36350131034851, -2.859130036085844], [29.036149382591248, 60.263000428676605, -3.2158500980585814], [-6.70079980045557, 62.18000128865242, -3.3126301132142544], [7.01574981212616, 62.33049929141998, -3.0398250091820955], [34.432198852300644, 61.822500079870224, -3.8600200787186623], [-34.94369983673096, 61.71949952840805, -2.975224982947111], [36.92144900560379, 61.35300174355507, -3.80330509506166], [-17.414700239896774, 62.305498868227005, -2.8856350108981133], [35.39605066180229, 61.870500445365906, -3.7010149098932743], [-33.79660099744797, 62.61549890041351, -2.8220899403095245], [17.723649740219116, 62.15500086545944, -2.8651400934904814], [17.16490089893341, 64.11050260066986, -2.8264999855309725], [-15.98840020596981, 64.51349705457687, -3.529229899868369], [29.04984913766384, 63.98849934339523, -3.5610098857432604], [-32.77340158820152, 63.553497195243835, -3.0921949073672295], [8.880600333213806, 64.2549991607666, -3.0712198931723833], [-31.70285001397133, 64.53800201416016, -3.132190089672804], [-6.160899996757507, 63.67350369691849, -3.4619849175214767], [11.233200319111347, 64.81000036001205, -3.7961099296808243], [-5.210299976170063, 64.37049806118011, -2.935385098680854], [15.37409983575344, 64.78799879550934, -3.6096100229769945], [13.806100003421307, 64.94999676942825, -3.9191199466586113], [-4.500444978475571, 65.81900268793106, -3.3611799590289593], [-29.536200687289238, 66.10400229692459, -2.9992801137268543], [-15.415050089359283, 66.3755014538765, -3.3167500514537096], [-15.381249599158764, 68.06950271129608, -2.9228751081973314], [-27.24055014550686, 68.28799843788147, -3.171750111505389], [-2.477214904502034, 68.21999698877335, -3.2391599379479885], [43.96265000104904, 68.50700080394745, -3.798780031502247], [46.030350029468536, 68.35900247097015, -3.7793300580233335], [41.44579917192459, 68.64549964666367, -3.819015109911561], [47.617848962545395, 68.21999698877335, -3.8694250397384167], [39.39874842762947, 68.58699768781662, -3.8697500713169575], [27.431350201368332, 68.09650361537933, -3.2150400802493095], [-15.187400393188, 70.08200138807297, -2.9355750884860754], [-0.7905749953351915, 70.36250084638596, -3.5031400620937347], [-43.68950054049492, 69.98399645090103, -2.7404900174587965], [27.078399434685707, 69.9549987912178, -3.8144849240779877], [45.46064883470535, 70.37699967622757, -3.5573949571698904], [-45.91380059719086, 70.28850167989731, -3.2345750369131565], [-41.54285043478012, 69.90650296211243, -3.1232149340212345], [-25.605149567127228, 70.30700147151947, -2.8254699427634478], [-13.911000452935696, 69.93550062179565, -3.9955549873411655], [-39.557598531246185, 70.19700109958649, -2.991134999319911], [43.680500239133835, 70.3594982624054, -3.249394940212369], [36.44169867038727, 70.68800181150436, -3.9133098907768726], [-35.490501672029495, 71.02199643850327, -2.9253100510686636], [25.62505006790161, 70.27699798345566, -2.9454100877046585], [-25.727149099111557, 71.9825029373169, -2.9359098989516497], [46.040598303079605, 72.36149907112122, -3.1916298903524876], [-33.27760100364685, 71.56500220298767, -3.2568350434303284], [-15.176200307905674, 71.98599725961685, -2.5697199162095785], [-13.04479967802763, 72.782501578331, -3.195360070094466], [37.63144835829735, 72.00899720191956, -3.8398050237447023], [-31.73699975013733, 72.14199751615524, -2.7688450645655394], [-45.894600450992584, 72.28449732065201, -3.4870749805122614], [1.1271650437265635, 71.87499850988388, -3.329284954816103], [36.39540076255798, 72.07150012254715, -3.7993649020791054], [-29.563400894403458, 72.61350005865097, -2.9258099384605885], [-27.581600472331047, 72.56700098514557, -2.942345105111599], [24.901200085878372, 72.00949639081955, -3.339444985613227], [2.8664949350059032, 72.35849648714066, -2.962609985843301], [41.850849986076355, 72.38549739122391, -3.2413199078291655], [46.9743013381958, 73.66249710321426, -3.5004750825464725], [23.576749488711357, 72.49400019645691, -3.0296898912638426], [39.78224843740463, 74.54150170087814, -3.5630250349640846], [40.92954844236374, 74.21550154685974, -3.5551399923861027], [43.78015175461769, 72.43700325489044, -2.79430509544909], [3.5431499127298594, 73.58449697494507, -3.6335999611765146], [-41.627950966358185, 74.45300370454788, -2.9909349977970123], [-39.37384858727455, 74.35649633407593, -2.917614998295903], [44.3168506026268, 73.81950318813324, -3.491780022159219], [-37.74325177073479, 74.78249818086624, -3.372010076418519], [45.99969834089279, 74.09600168466568, -2.9853449668735266], [-9.373200125992298, 74.90549981594086, -3.3808299340307713], [5.092049948871136, 73.9934965968132, -3.4137601032853127], [21.804099902510643, 74.11900162696838, -3.352255094796419], [-7.309849839657545, 74.92200285196304, -3.7484399508684874], [-35.629648715257645, 76.06799900531769, -3.0819301027804613], [19.74949985742569, 74.54050332307816, -3.0195401050150394], [6.890799850225449, 74.42550361156464, -3.1853700056672096], [9.056700393557549, 75.81450045108795, -3.602979937568307], [-7.385550066828728, 75.99999755620956, -3.63902491517365], [-33.551450818777084, 76.63550227880478, -2.9928949661552906], [17.57895015180111, 75.84399729967117, -3.4720399416983128], [10.917999781668186, 76.01799815893173, -3.45236505381763], [13.163399882614613, 76.04049891233444, -3.1727850437164307], [15.51584992557764, 76.13000273704529, -3.4087649546563625], [-9.061800315976143, 76.69249922037125, -3.1601600348949432], [-31.85965120792389, 77.2090032696724, -2.8855199925601482], [-29.442699626088142, 77.87050306797028, -3.038134891539812], [-27.37485058605671, 78.7770003080368, -3.0071348883211613], [-9.229250252246857, 79.06150072813034, -3.1560349743813276], [-43.818000704050064, 80.63499629497528, -2.9245950281620026], [-41.71665012836456, 80.827496945858, -3.492170013487339], [-6.993249990046024, 80.73049783706665, -3.5319048911333084], [-27.327200397849083, 80.49099892377853, -2.9061450622975826], [-5.66894980147481, 80.98900318145752, -3.906494937837124], [-45.42350023984909, 81.45149797201157, -3.1259150709956884], [-31.614050269126892, 81.26349747180939, -2.92238499969244], [-37.54755109548569, 81.95549994707108, -2.948279958218336], [-35.591550171375275, 81.6200003027916, -3.4711849875748158], [-33.530499786138535, 81.47849887609482, -2.9403800144791603], [-46.41775041818619, 82.57099986076355, -3.024300094693899], [-6.922299973666668, 82.27550238370895, -3.6597950384020805], [-47.33565077185631, 83.39150249958038, -3.1282349955290556], [-9.17190033942461, 82.75499939918518, -3.111860016360879], [-48.38104918599129, 84.35100317001343, -2.8540799394249916], [-8.979950100183487, 85.0749984383583, -3.511834889650345], [-49.619998782873154, 85.25250107049942, -3.2438200432807207], [-39.663951843976974, 85.39199829101562, -3.8036650512367487], [-42.900148779153824, 85.68049967288971, -3.7644400727003813], [-45.89495062828064, 86.64800226688385, -2.999885007739067], [-44.00105029344559, 86.61500364542007, -3.45828989520669], [-37.60505095124245, 86.65599673986435, -3.1048699747771025], [-7.172300014644861, 86.53649687767029, -3.7994799204170704], [-48.06140065193176, 86.8925005197525, -3.514345036819577], [-11.212450452148914, 86.93800121545792, -3.0258100014179945], [-9.150650352239609, 86.51100099086761, -3.3356898929923773], [-36.5445502102375, 87.42000162601471, -3.0938549898564816], [-16.77210070192814, 87.6460000872612, -3.5419301129877567], [-17.287850379943848, 88.78350257873535, -3.402685048058629], [-35.69604828953743, 88.99550139904022, -3.001315053552389], [-19.66020092368126, 89.23400193452835, -3.744299989193678], [-21.490750834345818, 89.33699876070023, -2.8564399108290672], [-33.74684974551201, 89.6885022521019, -2.8341200668364763], [-23.67429994046688, 89.27399665117264, -2.926464891061187], [-33.033549785614014, 89.8749977350235, -3.407810116186738], [-31.760700047016144, 90.02500027418137, -3.200765000656247], [-25.82854963839054, 89.93549644947052, -3.440770087763667], [-24.27149936556816, 89.88449722528458, -3.8187499158084393], [-29.58020009100437, 90.12150019407272, -2.899979939684272], [-27.755599468946457, 90.11650085449219, -3.1361649744212627], [-31.445801258087158, 26.703400537371635, -3.076845081523061], [-11.335249990224838, 26.774099096655846, -2.961569931358099], [-25.872500613331795, 27.73124910891056, -3.1101598870009184], [19.635550677776337, 29.63794954121113, -2.8510550037026405], [7.783299777656794, 35.46639904379845, -2.892544958740473], [-1.9348949426785111, 36.44439950585365, -3.7020801100879908], [21.338850259780884, 41.42490029335022, -2.9750450048595667], [21.780699491500854, 45.83679884672165, -2.987094921991229], [35.795800387859344, 48.17444831132889, -2.717080060392618], [39.69144821166992, 48.212699592113495, -2.7518500573933125], [13.825999572873116, 51.73749849200249, -3.8811499252915382], [15.369550324976444, 52.12600156664848, -2.7435950469225645], [27.741700410842896, 56.21350184082985, -2.808195073157549], [32.919298857450485, 56.19249865412712, -2.83075007610023], [-9.771349839866161, 55.98000064492226, -2.5608050636947155], [29.007399454712868, 61.88400089740753, -3.277669893577695], [28.76969985663891, 66.21850281953812, -3.7328898906707764], [37.62980177998543, 70.27050107717514, -3.7592200096696615], [-37.49009966850281, 70.62699645757675, -3.0067849438637495], [-44.624000787734985, 72.6500004529953, -3.965740092098713], [22.86135032773018, 74.09150153398514, -3.786930115893483], [-43.42665150761604, 75.78299939632416, -3.1747049652040005], [-29.54009920358658, 80.9670016169548, -3.0747249256819487], [-38.96860033273697, 81.62949979305267, -3.6658700555562973], [-39.766550064086914, 82.20399916172028, -2.8363200835883617], [-10.803299956023693, 83.06899666786194, -2.682874910533428], [-11.041649617254734, 85.03799885511398, -2.72196508012712], [-41.4125993847847, 86.62749826908112, -3.3982601016759872], [-49.656350165605545, 87.04700320959091, -2.8872399125248194], [-14.856849797070026, 87.54649758338928, -2.981635043397546], [-13.023150153458118, 87.6694992184639, -2.857609884813428], [31.574249267578125, 26.978449895977974, -2.979324897751212], [-40.86954891681671, 32.07644820213318, -2.7443799190223217], [29.555749148130417, 35.08175164461136, -2.6999549008905888], [32.833848148584366, 54.47550117969513, -2.6213049422949553], [5.381799768656492, 60.06250157952309, -2.703309990465641], [15.139199793338776, 66.1109983921051, -2.69644008949399], [13.074399903416634, 66.27900153398514, -2.714104950428009], [-48.325348645448685, 70.10199874639511, -3.0256749596446753], [-17.560649663209915, 90.91649949550629, -3.0484648887068033], [-15.053300186991692, 90.99700301885605, -2.9276199638843536], [21.059950813651085, 30.011450871825218, -3.0611450783908367], [36.955200135707855, 31.35170042514801, -2.628220012411475], [35.09579971432686, 35.310350358486176, -2.724624937400222], [23.54324981570244, 50.21049827337265, -2.606784924864769], [33.78940001130104, 49.886949360370636, -2.7676450554281473], [35.516951233148575, 60.459498316049576, -2.6852800510823727], [11.051050387322903, 65.96700102090836, -2.739665098488331], [27.60235033929348, 66.23250246047974, -2.715524984523654], [-3.2426901161670685, 66.61350280046463, -2.6926349382847548], [-48.345599323511124, 69.07849758863449, -3.0472499784082174], [-26.453400030732155, 68.91000270843506, -2.84366006962955], [41.70624911785126, 70.47949731349945, -3.191265044733882], [39.4306518137455, 70.1645016670227, -3.397200023755431], [39.41835090517998, 72.05449789762497, -3.3224199432879686], [-39.46169838309288, 86.77399903535843, -2.7441899292171], [-19.463449716567993, 90.38899838924408, -2.7335449121892452], [-25.538399815559387, 89.56199884414673, -2.620300045236945], [-15.013099648058414, 92.58750081062317, -2.7508349157869816], [18.3105506002903, 28.960250318050385, -2.8889349196106195], [12.947900220751762, 46.03014886379242, -2.5493749417364597], [-49.99009892344475, 70.21050155162811, -2.6524949353188276], [0.8006750140339136, 70.66749781370163, -2.664565108716488], [8.818699978291988, 74.22249764204025, -2.629674971103668], [25.31054988503456, 26.70064941048622, -2.415795112028718], [27.598250657320023, 26.4871995896101, -2.349874936044216], [36.80809959769249, 28.4000001847744, -2.524120034649968], [21.362900733947754, 31.48144856095314, -2.7709100395441055], [8.281650021672249, 33.14590081572533, -2.5051350239664316], [27.024749666452408, 36.955349147319794, -2.444060053676367], [24.77704919874668, 39.25300016999245, -2.2627951111644506], [32.2096012532711, 50.283998250961304, -2.3409801069647074], [40.84260016679764, 51.94149911403656, -2.5300749111920595], [-22.686300799250603, 52.13949829339981, -2.4001048877835274], [3.7132299039512873, 56.001000106334686, -2.527110045775771], [16.848549246788025, 56.29799887537956, -2.508060075342655], [38.45055028796196, 58.678001165390015, -2.556249964982271], [7.606950122863054, 63.478000462055206, -2.7536998968571424], [-16.76899939775467, 64.28050249814987, -2.5697550736367702], [-16.36289991438389, 65.67800045013428, -2.504209987819195], [-27.9985498636961, 67.01599806547165, -2.638600068166852], [-1.3131400337442756, 68.61650198698044, -2.5349499192088842], [-34.068599343299866, 71.4154988527298, -2.4683300871402025], [-12.281999923288822, 73.72249662876129, -2.5237349327653646], [-37.525251507759094, 75.69050043821335, -2.491794992238283], [-8.877400308847427, 80.70450276136398, -2.9625899624079466], [-43.62820088863373, 88.51300179958344, -2.615914912894368], [19.914250820875168, 31.571149826049805, -2.437639981508255], [21.931400522589684, 40.362950414419174, -2.5199949741363525], [20.322799682617188, 42.11780056357384, -2.440159907564521], [20.252499729394913, 43.85650157928467, -2.3422399535775185], [21.601099520921707, 47.61055111885071, -2.396990079432726], [37.55135089159012, 46.47374898195267, -2.4348050355911255], [38.97760063409805, 46.53380066156387, -2.359640086069703], [-22.71449938416481, 50.16399919986725, -2.2427949588745832], [15.168550424277782, 50.41550099849701, -2.4910049978643656], [25.94755031168461, 54.17649820446968, -2.3421149235218763], [27.862999588251114, 58.07949975132942, -2.4196200538426638], [-7.909400388598442, 58.8424988090992, -2.2950449492782354], [27.75000035762787, 64.26949799060822, -2.4059799034148455], [16.75104908645153, 65.69600105285645, -2.3902400862425566], [25.880450382828712, 68.21049749851227, -2.269099932163954], [-48.266101628541946, 72.34349846839905, -2.525855088606477], [-46.171750873327255, 74.65849816799164, -2.4704199749976397], [21.77559956908226, 72.51700013875961, -2.453790046274662], [5.091900005936623, 72.27899879217148, -2.3894549813121557], [-11.074000038206577, 76.6495019197464, -2.4598250165581703], [15.304500237107277, 74.9640017747879, -2.540044952183962], [11.116250418126583, 74.59750026464462, -2.458419883623719], [-26.408350095152855, 79.67399805784225, -2.3137200623750687], [-41.89775139093399, 82.42149651050568, -2.529744990170002], [-35.552650690078735, 81.90350234508514, -2.4903600569814444], [-15.7756507396698, 88.79750221967697, -2.7101049199700356], [-48.00080135464668, 88.09249848127365, -2.3618401028215885], [-41.63705185055733, 88.77649903297424, -2.322999993339181], [-23.527199402451515, 28.71819958090782, -2.2703749127686024], [-4.1187601163983345, 32.983798533678055, -2.434094902127981], [14.729799702763557, 48.540301620960236, -2.361780032515526], [40.949251502752304, 50.958000123500824, -2.3768949322402477], [28.08764949440956, 62.17750161886215, -2.476559951901436], [9.136700071394444, 65.7769963145256, -2.2042749915271997], [-50.32049864530563, 71.51400297880173, -2.246239921078086], [17.466150224208832, 74.22850281000137, -2.243754919618368], [12.860850431025028, 74.81549680233002, -2.443850040435791], [-10.62885019928217, 78.72150093317032, -2.2678349632769823], [-11.28149963915348, 80.87150007486343, -2.327929949387908], [21.702349185943604, 33.56369957327843, -2.2253699135035276], [1.708419993519783, 48.41554909944534, -2.290640026330948], [23.825999349355698, 51.702000200748444, -2.217514906078577], [28.137950226664543, 60.25699898600578, -2.3334650322794914], [5.788050126284361, 61.69499829411507, -2.2406699135899544], [-5.676050204783678, 62.39499896764755, -2.1875849924981594], [-30.490050092339516, 64.89899754524231, -2.268590033054352], [23.854099214076996, 70.63750177621841, -2.243210095912218], [-47.80985042452812, 73.48649948835373, -2.2570600267499685], [-43.68655011057854, 82.74649828672409, -2.1870050113648176], [-31.669050455093384, 89.75899964570999, -2.2006051149219275], [-27.559949085116386, 89.7504985332489, -2.2622200194746256], [-16.914449632167816, 92.0334979891777, -2.2437500301748514], [22.929150611162186, 33.94220024347305, -2.1193900611251593], [10.241099633276463, 42.13225096464157, -2.251330064609647], [20.266899839043617, 45.86545005440712, -2.1683399099856615], [16.6749507188797, 54.26749959588051, -2.2448799572885036], [-16.339050605893135, 70.67050039768219, -2.259755041450262], [-12.68364954739809, 83.1025019288063, -2.154499990865588], [-12.862649746239185, 84.77400243282318, -2.1813700441271067], [-49.51120167970657, 87.99699693918228, -2.224245108664036], [19.425049424171448, 31.605251133441925, -1.125980052165687], [-5.510149989277124, 31.740300357341766, -1.1692499974742532], [21.785149350762367, 35.55665165185928, -1.0702100116759539], [-2.478349953889847, 37.33174875378609, -0.9798150276765227], [22.2936999052763, 37.30574995279312, -0.8125050226226449], [7.516299840062857, 37.76689991354942, -1.156529993750155], [36.4999994635582, 46.41614854335785, -2.136145019903779], [-16.65619947016239, 47.18190059065819, -1.0921399807557464], [1.9450349500402808, 49.748651683330536, -2.199999988079071], [1.1634050169959664, 50.41100084781647, -0.994520029053092], [-23.049049079418182, 52.56599932909012, -1.175279961898923], [26.52765065431595, 55.769000202417374, -2.096255077049136], [3.1002399045974016, 58.15050005912781, -1.1604049941524863], [37.581201642751694, 58.219000697135925, -1.2277349596843123], [-25.732150301337242, 68.08499991893768, -1.321690040640533], [-46.0391491651535, 70.68850100040436, -1.1251099640503526], [2.721264958381653, 70.81200182437897, -2.1350099705159664], [-24.47439916431904, 71.68350368738174, -2.119279932230711], [6.879750173538923, 72.62349873781204, -2.135304966941476], [-41.974298655986786, 75.0180035829544, -1.269795000553131], [-45.585550367832184, 74.9569982290268, -1.1181849986314774], [-41.12214967608452, 83.21850001811981, -1.6826150240376592], [-37.78684884309769, 87.16650307178497, -0.839230022393167], [-40.330298244953156, 88.21699768304825, -2.0988150499761105], [-23.53844977915287, 88.73149752616882, -1.1416750494390726], [-30.351949855685234, 89.76449817419052, -2.1388051100075245], [29.689550399780273, 26.738150045275688, -1.1741600465029478], [17.492949962615967, 27.621550485491753, -0.9341749828308821], [31.675901263952255, 27.122050523757935, -0.924870022572577], [35.46055033802986, 27.846649289131165, -1.1747650569304824], [15.538400039076805, 27.418699115514755, -0.9611800196580589], [-17.341449856758118, 27.880800887942314, -0.9998950408771634], [23.69469963014126, 27.654049918055534, -1.041590003296733], [21.55184932053089, 28.108499944210052, -0.8356149774044752], [-39.18749839067459, 30.22249974310398, -1.1247099610045552], [17.501100897789, 29.56550009548664, -0.6344600114971399], [37.1643491089344, 31.679999083280563, -0.9467899799346924], [19.98724974691868, 32.99374878406525, -1.109529985114932], [36.96484863758087, 33.354949206113815, -0.724659999832511], [21.145200356841087, 33.86490046977997, -1.2508300133049488], [36.57114878296852, 34.04029831290245, -1.5061800368130207], [22.884149104356766, 34.81154888868332, -2.0415550097823143], [23.25735054910183, 35.87004914879799, -1.2529200175777078], [27.455700561404228, 37.59140148758888, -0.8959550177678466], [25.98940022289753, 38.41190040111542, -1.4726449735462666], [25.652950629591942, 39.384301751852036, -0.6225749966688454], [-1.5297849895432591, 39.55719992518425, -1.2748100562021136], [21.54890075325966, 39.694398641586304, -0.9750999743118882], [19.352950155735016, 41.801851242780685, -1.415814971551299], [-0.9497500141151249, 41.63629934191704, -1.1827950365841389], [10.938350111246109, 41.69980064034462, -0.9705550037324429], [-43.55794936418533, 44.032301753759384, -0.7456300081685185], [0.24570600362494588, 45.89080065488815, -1.0999100049957633], [37.16665133833885, 45.20940035581589, -1.754635013639927], [39.88815099000931, 46.179648488759995, -1.7046249704435468], [-15.220699831843376, 47.75939881801605, -0.9068499784916639], [15.813799574971199, 48.07145148515701, -1.8253399757668376], [20.820550620555878, 48.49810153245926, -1.9407400395721197], [-14.005550183355808, 48.49585145711899, -0.7789349765516818], [32.32739865779877, 49.65230077505112, -1.2241499498486519], [-12.84290011972189, 49.66479912400246, -0.9372449712827802], [32.37830102443695, 51.4025017619133, -1.8370699835941195], [33.0999493598938, 52.45999991893768, -0.9602999780327082], [17.585650086402893, 54.27049845457077, -1.7056900542229414], [2.5409350637346506, 54.388999938964844, -1.5111200045794249], [33.65129977464676, 56.35949969291687, -1.0096400510519743], [-21.841900423169136, 56.25100061297417, -1.0960249928757548], [-39.33069854974747, 56.11100047826767, -0.98559504840523], [-8.692449890077114, 56.14599958062172, -1.3539900537580252], [25.68564936518669, 56.379999965429306, -1.5808299649506807], [38.8639010488987, 57.50250071287155, -1.545730046927929], [27.198350057005882, 58.483000844717026, -1.8841050332412124], [-6.876800209283829, 58.382999151945114, -0.9884099708870053], [36.947350949048996, 59.27349999547005, -1.968594966456294], [-36.97355091571808, 59.57400053739548, -1.5422300202772021], [35.7014499604702, 59.507500380277634, -1.8509499495849013], [-6.543050054460764, 60.00249832868576, -1.6993599710986018], [4.683940205723047, 62.25999817252159, -1.2299149530008435], [-19.391050562262535, 62.065500766038895, -0.7513849996030331], [27.154050767421722, 62.369998544454575, -1.880299998447299], [-5.041650030761957, 61.96799874305725, -1.4157999539747834], [-18.209099769592285, 62.65850365161896, -1.6651799669489264], [6.991500034928322, 64.36800211668015, -1.8022849690169096], [-31.474851071834564, 63.85800242424011, -1.1058900272473693], [-29.630349949002266, 64.7754967212677, -0.9336199727840722], [-17.372699454426765, 66.12350046634674, -1.5437400434166193], [-2.6830900460481644, 65.86150079965591, -1.839870004914701], [17.39400066435337, 66.37299805879593, -1.7267550574615598], [25.620250031352043, 66.07700139284134, -1.6502150101587176], [9.031450375914574, 66.51149690151215, -1.7692949622869492], [-27.62174978852272, 66.23899936676025, -1.1134400265291333], [-1.8364950083196163, 67.13750213384628, -2.1768698934465647], [11.58014964312315, 67.16799736022949, -2.027269918471575], [12.391950003802776, 67.22699850797653, -2.0335649605840445], [15.313499607145786, 67.18149781227112, -1.9877851009368896], [-17.363350838422775, 68.13950091600418, -1.5742500545457006], [0.865160021930933, 68.27250123023987, -1.6017700545489788], [-25.00779926776886, 69.50099766254425, -1.7392999725416303], [-48.09274896979332, 70.78450173139572, -1.229319954290986], [1.1587300105020404, 69.63100284337997, -1.9126549595966935], [-37.49949857592583, 70.52099704742432, -1.0146050481125712], [3.068865044042468, 70.1024979352951, -1.7399350181221962], [-17.086099833250046, 72.12299853563309, -0.7733650272712111], [-50.296999514102936, 72.57699966430664, -1.4053400373086333], [-25.59169940650463, 72.9840025305748, -0.7662450079806149], [19.6540504693985, 72.2535029053688, -1.7012599855661392], [-15.345449559390545, 72.8904977440834, -1.498879981227219], [20.38850076496601, 72.67899811267853, -2.0662350580096245], [8.94275028258562, 73.02899658679962, -2.051004907116294], [10.23850031197071, 73.0224996805191, -2.0723650231957436], [-47.96694964170456, 74.7779980301857, -1.4164899475872517], [-12.972500175237656, 76.71400159597397, -1.2353550409898162], [-31.70974925160408, 77.06049829721451, -0.8532549836672843], [-11.213299818336964, 78.90850305557251, -1.7956349765881896], [-27.480199933052063, 77.96599715948105, -1.3971650041639805], [-25.654399767518044, 79.02950048446655, -0.9568550158292055], [-11.681100353598595, 80.17700165510178, -1.9142599776387215], [-29.74100038409233, 80.83099871873856, -1.0129399597644806], [-33.535998314619064, 81.48699998855591, -0.9386300225742161], [-35.53035110235214, 81.99399709701538, -0.9482749737799168], [-45.66790163516998, 82.77250081300735, -1.6596349887549877], [-47.586649656295776, 85.01449972391129, -0.9436549735255539], [-49.637749791145325, 86.77799999713898, -1.3333649840205908], [-13.671750202775002, 85.18850058317184, -1.867105020210147], [-12.943149544298649, 86.75000071525574, -1.767090056091547], [-45.92674970626831, 87.7309963107109, -1.8587149679660797], [-15.460999682545662, 86.83150261640549, -1.144660054706037], [-15.995949506759644, 88.99249881505966, -1.7051449976861477], [-41.372399777173996, 89.48300033807755, -1.6064749797806144], [-44.16834935545921, 89.23099935054779, -1.506755012087524], [-33.71790051460266, 88.79999816417694, -0.8213549735955894], [-27.629250660538673, 89.32600170373917, -0.9680549846962094], [-15.91859944164753, 92.29499846696854, -1.1925100116059184], [-31.640000641345978, 26.756299659609795, -1.0068099945783615], [33.834751695394516, 27.362849563360214, -0.8487799786962569], [-11.221200227737427, 26.90334990620613, -0.8806950063444674], [-25.867149233818054, 27.66825072467327, -0.942995015066117], [19.659999758005142, 27.674950659275055, -1.2053799582645297], [-23.74495007097721, 27.989249676465988, -0.9409150225110352], [-21.784700453281403, 28.02320010960102, -0.9948000079020858], [-19.800350069999695, 28.06979976594448, -0.9241750231012702], [-7.320050150156021, 29.648499563336372, -0.9539800230413675], [-37.943851202726364, 29.02654930949211, -1.0702749714255333], [9.81105025857687, 30.17525002360344, -1.513854949735105], [19.57070082426071, 30.569100752472878, -1.9659299869090319], [21.321900188922882, 32.225899398326874, -1.8364900024607778], [8.620800450444221, 33.35985168814659, -0.8639100124128163], [-42.51294955611229, 35.58475151658058, -0.9853299707174301], [29.54299934208393, 36.15260124206543, -1.31608999799937], [35.67644953727722, 35.68679839372635, -0.9015100076794624], [-3.119165077805519, 35.560499876737595, -1.0540350340306759], [23.665200918912888, 37.47725114226341, -0.9110000100918114], [7.791799958795309, 38.9692485332489, -1.252594985999167], [-43.434299528598785, 39.81329873204231, -0.9687949786894023], [8.79644975066185, 40.34214839339256, -1.0498149786144495], [11.645049788057804, 42.94374957680702, -1.8887149635702372], [13.119899667799473, 43.66140067577362, -1.4558000257238746], [0.25814399123191833, 44.104449450969696, -1.718914951197803], [19.096599891781807, 44.492099434137344, -1.7721649492159486], [37.67099976539612, 43.80200058221817, -1.190760056488216], [15.027450397610664, 46.22805118560791, -1.8311500316485763], [19.13524977862835, 45.94450071454048, -1.7909799935296178], [-17.812350764870644, 46.88490182161331, -0.8435400086455047], [35.62559932470322, 45.871950685977936, -1.2818799586966634], [-19.74719949066639, 47.09554836153984, -0.9717749780975282], [41.2992499768734, 48.13859984278679, -0.9494799887761474], [0.7824599742889404, 48.22494834661484, -1.1824850225821137], [34.87024828791618, 47.35274985432625, -1.5841450076550245], [19.641799852252007, 48.33399876952171, -1.667735050432384], [33.45780074596405, 47.91634902358055, -1.5061149606481194], [32.38524869084358, 47.864001244306564, -0.9203599765896797], [21.591100841760635, 50.16849935054779, -1.7995750531554222], [16.31009951233864, 49.8524010181427, -1.8129199743270874], [17.525650560855865, 50.354499369859695, -1.5193299623206258], [2.0477650687098503, 51.90400034189224, -1.6794350231066346], [23.298950865864754, 52.58699879050255, -1.6740249702706933], [40.93080013990402, 53.60950157046318, -1.0502899531275034], [-41.048549115657806, 53.766001015901566, -1.3640549732372165], [-22.748200222849846, 54.23450097441673, -0.9352799970656633], [25.061750784516335, 54.44800108671188, -1.7793900333344936], [33.25185179710388, 54.32850122451782, -0.893110001925379], [17.931150272488594, 56.25800043344498, -1.7355449963361025], [2.739259973168373, 56.39149993658066, -1.3070449931547046], [-8.184599690139294, 57.60449916124344, -1.7417649505659938], [34.357700496912, 57.92149901390076, -1.2122000334784389], [19.269999116659164, 58.37450176477432, -1.3337699929252267], [-20.35360038280487, 58.75600129365921, -1.3736350229009986], [35.75589880347252, 58.37099999189377, -0.8469200110994279], [-19.77209933102131, 60.23300066590309, -1.229734974913299], [4.3728849850595, 60.09000167250633, -1.6207799781113863], [-35.7852503657341, 60.21000072360039, -0.8637100108899176], [19.325850531458855, 60.27999892830849, -1.4180149883031845], [19.350500777363777, 62.192000448703766, -1.535719959065318], [-33.751800656318665, 62.08400055766106, -0.9703150135464966], [-4.296645056456327, 63.56149911880493, -1.7779349582269788], [-17.82985031604767, 64.19049948453903, -1.5729600563645363], [19.47619952261448, 64.23249840736389, -1.3414300046861172], [18.269749358296394, 64.74199891090393, -1.7434799810871482], [-2.866684924811125, 64.00349736213684, -1.1990000493824482], [26.848899200558662, 64.30850178003311, -1.8491250229999423], [-0.9402399882674217, 66.21000170707703, -1.3314200332388282], [11.268500238656998, 68.20549815893173, -1.739209983497858], [13.51234968751669, 68.41699779033661, -1.66229996830225], [15.384799800813198, 67.88250058889389, -1.726430025883019], [24.90909956395626, 68.26499849557877, -1.8784699495881796], [-0.5180549924261868, 67.98700243234634, -1.79410504642874], [23.29530008137226, 69.99900192022324, -1.8088100478053093], [-50.0744991004467, 70.60050219297409, -1.0557100176811218], [-17.823249101638794, 70.4289972782135, -1.4458650257438421], [-23.626500740647316, 70.02349942922592, -1.239040051586926], [-35.60110181570053, 70.83850353956223, -0.95038500148803], [4.962964914739132, 70.23750245571136, -1.6044250223785639], [-23.58650043606758, 72.2699984908104, -1.1237800354138017], [6.992849987000227, 71.74299657344818, -1.8544449703767896], [21.223250776529312, 71.51100039482117, -1.79410504642874], [21.752500906586647, 70.41800022125244, -1.6233449568971992], [8.882950060069561, 71.99150323867798, -1.7208399949595332], [11.02210022509098, 72.28449732065201, -1.7286250367760658], [17.360400408506393, 72.21350073814392, -1.5680299839004874], [17.276499420404434, 73.47550243139267, -1.9108749693259597], [13.037599623203278, 72.37549871206284, -1.6745650209486485], [15.033000148832798, 72.51150161027908, -1.6359499422833323], [13.585399836301804, 73.54699820280075, -1.8347350414842367], [15.47284983098507, 73.78300279378891, -1.9006750080734491], [-13.517400249838829, 74.61249828338623, -1.4203450409695506], [-43.668799102306366, 74.85750317573547, -0.7103349780663848], [-39.91544991731644, 75.46249777078629, -1.4322949573397636], [-11.838600039482117, 75.32700151205063, -1.8769849557429552], [-39.314448833465576, 75.71399956941605, -0.8143599843606353], [-33.5734486579895, 76.67150348424911, -0.9228250128217041], [-29.0313009172678, 77.66050100326538, -1.447114977054298], [-25.63134953379631, 80.25199919939041, -0.7210599724203348], [-13.212550431489944, 80.71299642324448, -1.374369952827692], [-13.504800386726856, 82.61299878358841, -1.7855700571089983], [-37.78170049190521, 82.59149640798569, -0.8578400011174381], [-39.53395038843155, 83.07600021362305, -1.1025499552488327], [-15.49839973449707, 83.0644965171814, -1.0453700087964535], [-43.967701494693756, 83.6154967546463, -1.8235399620607495], [-43.801501393318176, 84.60249751806259, -0.8238250156864524], [-49.48420077562332, 88.30700069665909, -0.7978350040502846], [-45.843448489904404, 88.82399648427963, -0.84479502402246], [-48.24234917759895, 88.92499655485153, -1.078544999472797], [-35.297948867082596, 88.55299651622772, -1.4504699502140284], [-29.524050652980804, 89.11100029945374, -0.7894000154919922], [-21.641500294208527, 89.08099681138992, -0.7778350263834], [-31.551949679851532, 89.23099935054779, -0.9484050096943974], [-19.575700163841248, 90.50799906253815, -1.0269200429320335], [-15.820799395442009, 91.17349982261658, -1.6693549696356058], [-17.01964996755123, 91.99149906635284, -1.100294990465045], [13.029100373387337, 26.56315080821514, -0.8532999781891704], [13.469249941408634, 26.482999324798584, -0.9738500230014324], [25.849850848317146, 27.029650285840034, -0.953859998844564], [27.73509919643402, 26.451250538229942, -1.0239549446851015], [28.98775041103363, 26.472799479961395, -0.8559650159440935], [-29.79700081050396, 26.781149208545685, -0.8989250054582953], [-12.91470043361187, 26.69765055179596, -0.8660249877721071], [11.36889960616827, 27.67370082437992, -0.89359498815611], [-33.502548933029175, 27.058949694037437, -0.8637150167487562], [-35.62450036406517, 27.68000029027462, -0.908499991055578], [-15.225949697196484, 27.22175046801567, -0.8346600225195289], [-9.09150019288063, 27.890099212527275, -0.92505500651896], [-37.02645003795624, 28.36805023252964, -0.9298999793827534], [36.90854832530022, 29.830899089574814, -1.1220650048926473], [-23.295599967241287, 28.722049668431282, -1.373445033095777], [10.533500462770462, 29.42020073533058, -0.6905950140208006], [-40.36394879221916, 31.412549316883087, -0.8753149886615574], [9.42115020006895, 31.635601073503494, -0.9502199827693403], [-40.858350694179535, 32.07619860768318, -1.287829945795238], [-4.635194782167673, 33.2937017083168, -0.6366400048136711], [-41.61515086889267, 33.52909907698631, -0.792820006608963], [-3.9277952164411545, 33.96020084619522, -1.2773500056937337], [22.873150184750557, 34.200798720121384, -1.6777149867266417], [7.719949819147587, 35.421401262283325, -1.0014149593189359], [31.634248793125153, 36.23050078749657, -0.8976800017990172], [33.597249537706375, 36.553848534822464, -0.9903250029310584], [-43.35144907236099, 37.70880028605461, -0.9913799585774541], [-1.7838949570432305, 38.0234494805336, -1.5862650470808148], [23.68295006453991, 39.410948753356934, -1.0354799451306462], [-43.73820126056671, 41.54429957270622, -0.8735100273042917], [-0.6200450006872416, 43.8092015683651, -0.6960600148886442], [39.68355059623718, 43.95335167646408, -0.8992949733510613], [-43.56979951262474, 46.05584964156151, -1.140424981713295], [17.222600057721138, 46.04465141892433, -1.5694750472903252], [40.75760021805763, 47.01894894242287, -1.3321599690243602], [-43.077848851680756, 47.31455072760582, -1.0131950257346034], [-21.579649299383163, 47.716300934553146, -0.7836250006221235], [-22.63074927031994, 48.73425140976906, -0.769464997574687], [-42.581550776958466, 48.56494814157486, -0.5501100094988942], [19.74325068295002, 50.28950050473213, -1.4262549811974168], [-23.032499477267265, 49.94960129261017, -0.9495400008745492], [-42.30155050754547, 50.158001482486725, -0.9121400071308017], [41.42585024237633, 50.3075011074543, -0.844345020595938], [21.764500066637993, 52.43400111794472, -1.3165100244805217], [-10.9095498919487, 51.99750140309334, -1.0262499563395977], [1.2085450580343604, 52.414000034332275, -0.6843400187790394], [-41.380900889635086, 52.13499814271927, -0.9605300147086382], [-10.226099751889706, 53.8100004196167, -1.5329699963331223], [23.60384911298752, 54.4155016541481, -1.334585016593337], [-22.300299257040024, 54.8115000128746, -1.368134981021285], [40.52479937672615, 54.755501449108124, -0.7610250031575561], [-40.37189856171608, 54.46549877524376, -0.8411949966102839], [-9.054250083863735, 54.36300113797188, -0.6569050019606948], [39.548199623823166, 56.35499954223633, -0.9121050243265927], [25.762800127267838, 58.24349820613861, -1.338095054961741], [-37.73580119013786, 58.116499334573746, -0.8609649958088994], [-21.12019993364811, 58.09349939227104, -0.8102899882942438], [27.158349752426147, 60.19249930977821, -1.7615349497646093], [4.876414779573679, 64.16100263595581, -1.051355036906898], [25.74470080435276, 64.25949931144714, -1.484254957176745], [6.912999786436558, 66.13949686288834, -1.3228650204837322], [-29.006600379943848, 65.57949632406235, -1.43520999699831], [9.007750079035759, 68.10449808835983, -1.452794997021556], [-26.798099279403687, 67.3765018582344, -1.5488850185647607], [23.673750460147858, 68.09700280427933, -1.4695399440824986], [-41.52679815888405, 70.07650285959244, -0.9050799999386072], [-39.57739844918251, 70.16400247812271, -0.7915599853731692], [-43.50589960813522, 70.23649662733078, -0.8706150110810995], [-51.672499626874924, 72.30900228023529, -0.6780850235372782], [-34.6251018345356, 71.19549810886383, -0.8714600116945803], [-33.567801117897034, 71.61550223827362, -0.9027799824252725], [-31.825151294469833, 72.18600064516068, -0.8819050271995366], [-29.660450294613838, 72.73949682712555, -0.8824900141917169], [-13.926650397479534, 73.06650280952454, -1.3793200487270951], [-27.74149924516678, 72.91000336408615, -0.8373750024475157], [-49.80529844760895, 74.3274986743927, -0.6118849851191044], [-37.4796986579895, 75.94200223684311, -0.8666199864819646], [-35.43740138411522, 76.32999867200851, -0.8716200245544314], [-29.67200055718422, 77.15950161218643, -0.6812550127506256], [-13.291450217366219, 78.82650196552277, -1.0988200083374977], [-27.656299993395805, 80.4940015077591, -0.9544300264678895], [-31.584199517965317, 81.10199868679047, -0.7666950114071369], [-47.00680077075958, 83.3209976553917, -1.2558699818328023], [-41.78734868764877, 83.98950099945068, -0.815759995020926], [-15.352649614214897, 84.92399752140045, -1.030470011755824], [-35.638999193906784, 86.8304967880249, -0.6617499748244882], [-39.26200047135353, 87.54049986600876, -1.4829549472779036], [-40.02929851412773, 88.78649771213531, -0.9207049733959138], [-25.32934956252575, 89.1914963722229, -0.729450024664402], [-41.66720062494278, 90.19800275564194, -0.8410249720327556], [-43.63745078444481, 90.45600146055222, -0.7387800142168999], [-17.37005077302456, 90.94350039958954, -0.8721249760128558], [-27.53020077943802, 27.497900649905205, -0.927964982111007], [17.33125001192093, 43.77155005931854, -1.2612499995157123], [15.21615032106638, 43.754249811172485, -1.0598499793559313], [17.664900049567223, 48.12759906053543, -1.492070034146309], [17.90284924209118, 52.306000143289566, -1.472419942729175], [41.2713997066021, 51.9229993224144, -0.7463599904440343], [25.360699743032455, 60.25100126862526, -1.168985036201775], [-5.03640016540885, 60.17199903726578, -0.8044100250117481], [25.30430071055889, 62.207501381635666, -1.1995249660685658], [17.440399155020714, 68.18850338459015, -1.3239550171419978], [2.966115018352866, 68.0759996175766, -1.2481550220400095], [12.810450047254562, 70.19399851560593, -1.5101799508556724], [10.89164987206459, 70.15900313854218, -1.4805849641561508], [6.8824500776827335, 70.18700242042542, -1.45496497862041], [8.868950419127941, 70.08600234985352, -1.3806050410494208], [23.545250296592712, 56.2950000166893, -1.0293900268152356], [3.1023549381643534, 60.22350117564201, -0.8236999856308103], [-32.00244903564453, 62.95450031757355, -0.5946150049567223], [19.645599648356438, 66.37100130319595, -1.1526199523359537], [4.969414789229631, 68.05650144815445, -1.1642599711194634], [6.86000008136034, 68.15849989652634, -1.2252000160515308], [15.103800222277641, 70.05850225687027, -1.4297650195658207], [21.750299260020256, 68.11200082302094, -1.1676149442791939], [19.784949719905853, 70.15500217676163, -1.2373699573799968], [17.405850812792778, 70.24949789047241, -1.2733649928122759], [-48.64700138568878, 86.61749958992004, -0.6370749906636775], [-17.74270087480545, 88.58849853277206, -1.2403699802234769], [35.90479865670204, 29.12059985101223, -0.5176650010980666], [32.7845998108387, 50.58149993419647, -0.6413999944925308], [19.80680041015148, 52.34849825501442, -1.1560650309547782], [19.659999758005142, 54.383501410484314, -1.0126499691978097], [21.526850759983063, 54.30850014090538, -1.039394992403686], [19.70520056784153, 56.31750077009201, -1.0317800333723426], [-3.1136299949139357, 62.307000160217285, -0.7413550047203898], [-0.8423199760727584, 64.37650322914124, -0.8815950131975114], [23.543599992990494, 66.19500368833542, -1.1499449610710144], [23.653799667954445, 64.23799693584442, -0.9615899762138724], [1.0854899883270264, 66.19349867105484, -0.9665049728937447], [-23.76380003988743, 68.29849630594254, -0.576850026845932], [-19.43429931998253, 70.26249915361404, -0.7599099772050977], [-51.4645017683506, 70.84649801254272, -0.772489991504699], [-21.925000473856926, 71.80900126695633, -0.6683300016447902], [-15.35714976489544, 81.04249835014343, -0.7480750209651887], [-17.620550468564034, 86.98949962854385, -0.7028250256553292], [-19.12439987063408, 88.66800367832184, -0.5566800246015191], [39.180051535367966, 41.80924966931343, -0.6837950204499066], [17.693450674414635, 42.02859848737717, -0.5993549712002277], [35.72624921798706, 43.95189881324768, -0.5628149956464767], [23.81880022585392, 58.24749916791916, -0.9313650080002844], [-19.249850884079933, 64.24400210380554, -0.5153099773451686], [4.85243508592248, 66.04749709367752, -1.0172249749302864], [-19.31069977581501, 66.14550203084946, -0.5287100211717188], [3.0373549088835716, 66.19449704885483, -0.9106299839913845], [21.815750747919083, 66.35650247335434, -0.973474991042167], [-26.06559917330742, 66.55749678611755, -0.5153099773451686], [20.017700269818306, 68.08450073003769, -1.0204750578850508], [-21.603899076581, 70.45900076627731, -0.726079975720495], [-48.822298645973206, 71.43650203943253, -0.47223849105648696], [-15.400050207972527, 74.42449778318405, -0.6831299979239702], [-15.242050401866436, 76.55899971723557, -0.60655502602458], [-28.13895046710968, 77.39400118589401, -0.49100350588560104], [27.20239944756031, 26.63169987499714, -0.568179995752871], [-8.226100355386734, 28.99329923093319, -0.4475339956115931], [-6.304699927568436, 31.015699729323387, -0.4669055051635951], [7.948700338602066, 34.64280068874359, -0.6909550284035504], [29.492700472474098, 36.974698305130005, -0.4240474954713136], [-2.271279925480485, 39.35965150594711, -0.35515849594958127], [20.215800032019615, 40.175601840019226, -0.4439075128175318], [37.62374818325043, 41.798148304224014, -0.7627399754710495], [37.55370154976845, 39.47234898805618, -0.7586299907416105], [9.426499716937542, 41.03204980492592, -0.43835651013068855], [13.063750229775906, 42.28150099515915, -0.5709499819204211], [41.033048182725906, 45.845698565244675, -0.4752720124088228], [33.58139842748642, 45.99134996533394, -0.3482509928289801], [-11.382900178432465, 50.53599923849106, -0.4297484993003309], [-9.724799543619156, 52.63249948620796, -0.46856151311658323], [1.32531498093158, 54.14950102567673, -0.39364848635159433], [21.679149940609932, 56.08149990439415, -0.8915049838833511], [-7.094900123775005, 56.24949932098389, -0.2856510109268129], [1.4173650415614247, 56.16400018334389, -0.3524665080476552], [21.55650034546852, 58.42699855566025, -0.7869700202718377], [-5.010500084608793, 58.408498764038086, -0.1840665063355118], [21.315500140190125, 60.202501714229584, -0.930839974898845], [-20.675400272011757, 59.72599983215332, -0.4312410019338131], [23.68205040693283, 60.3180006146431, -0.8510149782523513], [2.981750061735511, 62.135498970746994, -0.6534199928864837], [21.36404998600483, 62.197498977184296, -0.9009100031107664], [23.667050525546074, 62.220498919487, -0.9321449906565249], [21.369799971580505, 64.20250236988068, -0.9136850130744278], [2.955890027806163, 64.28299844264984, -0.6645200191996992], [0.9528499795123935, 64.2549991607666, -0.5900399992242455], [-19.538750872015953, 68.1765004992485, -0.6360149709507823], [-17.455050721764565, 74.44100081920624, -0.3727335133589804], [-48.354700207710266, 76.08850300312042, -0.3196930047124624], [-41.002098470926285, 75.655996799469, -0.5445550195872784], [-15.667499974370003, 78.8234993815422, -0.4726870101876557], [-45.88890075683594, 84.30299907922745, -0.4473844892345369], [-17.688749358057976, 85.02449840307236, -0.3999084874521941], [-19.64230090379715, 87.4750018119812, -0.22564550454262644], [37.931401282548904, 37.610750645399094, -0.45482348650693893], [36.0557995736599, 37.58599981665611, -0.42971898801624775], [36.17880120873451, 39.389051496982574, -0.40645498665980995], [38.94830122590065, 39.49445113539696, -0.3852935042232275], [-0.2626870118547231, 46.37559875845909, -0.3356630040798336], [-17.556799575686455, 80.85200190544128, -0.19141449593007565], [-17.635449767112732, 82.92300254106522, -0.3348469908814877], [16.89404994249344, 31.715549528598785, -0.14990799536462873], [37.43460029363632, 35.64634919166565, -0.26260848972015083], [15.352250076830387, 42.13609918951988, -0.22418350272346288], [-0.9463350288569927, 62.17750161886215, -0.38563451380468905], [-28.17610092461109, 65.04649668931961, -0.2713605063036084], [-21.72435075044632, 68.14149767160416, -0.24240500351879746], [-17.722150310873985, 78.94749939441681, -0.3335160145070404], [-34.16509926319122, 86.59400045871735, -0.18560800526756793], [-4.19899495318532, 34.808199852705, -0.1615344954188913], [26.965899392962456, 38.819048553705215, -0.18577949958853424], [36.19445115327835, 41.558001190423965, -0.18988500232808292], [38.00614923238754, 57.00850114226341, -0.21667999681085348], [1.5199650079011917, 58.28449875116348, -0.27793951448984444], [34.80985015630722, 57.080499827861786, -0.1595920039108023], [1.0862699709832668, 60.148000717163086, -0.21415100491140038], [-3.053789958357811, 60.32799929380417, -0.1937134948093444], [1.0030700359493494, 62.20950186252594, -0.3379860136192292], [-17.726149410009384, 76.5250027179718, -0.14406400441657752], [-24.06504936516285, 79.50150221586227, -0.14467400615103543], [-18.910599872469902, 80.01399785280228, -0.13133800530340523], [-18.94734986126423, 85.41549742221832, -0.167342004715465], [17.237450927495956, 27.663350105285645, 1.0998649522662163], [21.638650447130203, 29.194800183176994, 1.2559399474412203], [17.02135056257248, 31.63069859147072, 0.28601998928934336], [31.076550483703613, 36.74184903502464, -0.07380249735433608], [32.24065154790878, 45.979950577020645, -0.14204649778548628], [-0.14192500384524465, 48.22954908013344, -0.15311250172089785], [-0.9760800166986883, 60.961998999118805, -0.10828600352397189], [-24.23815056681633, 66.99249893426895, -0.10753150127129629], [-48.04230108857155, 76.73250138759613, 1.255364972166717], [13.24160024523735, 27.157699689269066, 1.125855022110045], [14.748499728739262, 26.48339979350567, 1.0260799899697304], [27.653850615024567, 26.998650282621384, 0.9309449815191329], [29.698699712753296, 26.476649567484856, 0.7197699742391706], [-13.173899613320827, 26.683000847697258, 0.6364950095303357], [15.512149780988693, 26.751400902867317, 1.026325044222176], [-31.599748879671097, 26.975400745868683, 1.0045849485322833], [-15.05540031939745, 26.717999950051308, 1.163964974693954], [-11.141800321638584, 27.50529907643795, 1.0500899516046047], [31.605150550603867, 26.930399239063263, 1.0545400436967611], [-29.608100652694702, 26.688499376177788, 0.9701550006866455], [-27.763700112700462, 26.91729925572872, 1.1814050376415253], [-33.457498997449875, 27.232149615883827, 0.9062999743036926], [-17.472799867391586, 26.994800195097923, 1.0645299917086959], [25.755349546670914, 27.536500245332718, 0.9880949510261416], [-35.35090014338493, 27.841050177812576, 0.9182100184261799], [-25.74305050075054, 27.37635001540184, 0.8882249821908772], [33.53625163435936, 27.936000376939774, 0.7187650189734995], [-23.534899577498436, 27.49045006930828, 0.8337399922311306], [-21.776599809527397, 27.64734998345375, 0.8723199716769159], [-19.514599815011024, 27.644149959087372, 0.857010018080473], [-9.717349894344807, 28.050750494003296, 0.5049050087109208], [11.914500035345554, 28.061749413609505, 0.3606454993132502], [23.40560033917427, 28.021100908517838, 0.8064649882726371], [-36.86570003628731, 28.525300323963165, 0.32997800735756755], [21.832900121808052, 28.384050354361534, 1.027515041641891], [-37.866100668907166, 29.55774962902069, 1.0708350455388427], [-9.011499583721161, 29.360249638557434, 1.2376699596643448], [11.490999720990658, 29.58814986050129, 1.0923000518232584], [17.38925091922283, 29.562799260020256, 0.08184600301319733], [35.55614873766899, 29.646949842572212, 0.8271450060419738], [-7.717799860984087, 30.140899121761322, 0.6512000109069049], [-38.78889977931976, 30.26380017399788, 0.4745580081362277], [-39.943549782037735, 31.5093994140625, 0.8454499766230583], [-6.929450202733278, 31.666401773691177, 1.0414449498057365], [10.692499577999115, 31.25470131635666, 1.1408899445086718], [36.55795007944107, 31.070200726389885, 0.9039299911819398], [9.34594962745905, 32.003749161958694, 0.981244957074523], [37.14405000209808, 32.15150162577629, 1.0389500530436635], [-5.732649937272072, 32.50344842672348, 0.3389350022189319], [-5.457600113004446, 33.57499837875366, 0.6256899796426296], [37.69094869494438, 33.593300729990005, 0.8564050076529384], [-41.34704917669296, 33.82189944386482, 1.036565052345395], [8.376900106668472, 33.00229832530022, 0.878644990734756], [7.521850056946278, 33.695101737976074, 1.2718900106847286], [-4.934865050017834, 35.654399544000626, 1.1083600111305714], [38.471098989248276, 35.63009947538376, 0.6854900275357068], [7.522699888795614, 35.57354956865311, 0.9534350247122347], [-42.1733483672142, 35.74265167117119, 0.8755350136198103], [35.065848380327225, 36.413151770830154, 0.07927999831736088], [33.46094861626625, 37.700798362493515, 0.5379149806685746], [-3.597474889829755, 37.72909939289093, 0.705829996149987], [7.652049884200096, 37.74454817175865, 0.9936849819496274], [31.617648899555206, 37.5996008515358, 0.5685000214725733], [-42.64625161886215, 37.205200642347336, 1.0187450097873807], [39.15645182132721, 37.60804980993271, 1.0002399794757366], [29.956849291920662, 37.917349487543106, 0.5855450290255249], [35.028401762247086, 37.61415183544159, 0.30318700009956956], [22.760450839996338, 37.53485158085823, 0.028706499506370164], [-43.046850711107254, 38.02505135536194, 0.9977750014513731], [28.314199298620224, 38.19635137915611, 0.16995900659821928], [-3.362024901434779, 39.58585113286972, 1.1352249421179295], [7.91229959577322, 38.96705061197281, 0.8650249801576138], [27.78870053589344, 39.92234915494919, 1.0100649669766426], [35.356950014829636, 39.68539834022522, 0.3096009895671159], [39.7305004298687, 39.62145000696182, 1.038530026562512], [-43.10955107212067, 39.31155055761337, 0.8335050079040229], [21.71025052666664, 39.24195095896721, 0.9717899956740439], [23.644300177693367, 39.19510170817375, 0.901584979146719], [25.666549801826477, 39.51049968600273, 0.9573500137776136], [19.495850428938866, 39.86779972910881, 0.9650950087234378], [8.683750405907631, 40.313348174095154, 0.9844000451266766], [-2.690389985218644, 41.6937991976738, 1.117079984396696], [-43.3136485517025, 41.4542518556118, 0.8489200263284147], [17.521750181913376, 40.09135067462921, 1.2457900447770953], [9.366899728775024, 41.03349894285202, 1.0306650074198842], [35.329051315784454, 41.53025150299072, 0.24079800641629845], [16.79830066859722, 41.058249771595, 0.5098499823361635], [11.201250366866589, 42.084548622369766, 1.1878600344061852], [15.250849537551403, 41.675448417663574, 0.7837599841877818], [-1.7548550385981798, 42.09575057029724, 0.20625200704671443], [13.137499801814556, 42.3891507089138, 1.1251949472352862], [40.29335081577301, 41.68979823589325, 0.8137000259011984], [-43.279800564050674, 43.57755184173584, 0.6851549842394888], [-1.6033999854698777, 43.51134970784187, 0.42833699262700975], [41.3532517850399, 44.08559948205948, 0.9639650234021246], [33.77804905176163, 44.03584823012352, 0.44995799544267356], [-1.2718300567939878, 45.67259922623634, 0.5979749839752913], [-43.26405003666878, 45.9522008895874, 0.4323979956097901], [32.098300755023956, 46.19130119681358, 0.8253200212493539], [33.51350128650665, 45.43749988079071, 0.0204444004339166], [41.742049157619476, 46.313248574733734, 0.85346499690786], [-19.56789940595627, 46.77315056324005, 1.1008200235664845], [-17.819099128246307, 46.56894877552986, 1.0965400142595172], [-1.1185399489477277, 48.08789864182472, 0.6642600055783987], [-20.27924917638302, 47.01244831085205, 0.47638651449233294], [-15.17034973949194, 47.12745174765587, 0.8006599964573979], [-21.83930017054081, 47.48005047440529, 1.1042150435969234], [41.87300056219101, 47.86720126867294, 0.9926899801939726], [-42.27510094642639, 48.081450164318085, 0.9161049965769053], [-13.095900416374207, 47.8801503777504, 0.9758649975992739], [32.46084973216057, 48.09600114822388, 1.057879999279976], [-22.926200181245804, 48.538848757743835, 0.8848049910739064], [0.14563900185748935, 50.35850033164024, 0.10800000018207356], [-41.60714894533157, 50.34499987959862, 0.930989976041019], [-10.94990037381649, 50.02300068736076, 0.39795698830857873], [32.93965011835098, 50.0354990363121, 0.8121500140987337], [41.78975149989128, 50.08750036358833, 0.7992549799382687], [-23.754499852657318, 50.20749941468239, 1.0377150028944016], [-41.1512516438961, 51.5265017747879, 0.46016048872843385], [-23.828299716114998, 52.13300138711929, 0.7984400144778192], [33.493299037218094, 52.50050127506256, 1.0352650424465537], [-8.967749774456024, 51.88500136137009, 0.5148450145497918], [41.285350918769836, 52.10249871015549, 0.8900599787011743], [0.2352745068492368, 52.48349905014038, 0.16072149446699768], [-8.252750150859356, 53.82499843835831, 0.16585949924774468], [34.03269872069359, 54.188501089811325, 1.028324943035841], [0.4322715103626251, 54.32499945163727, 0.1296720001846552], [40.084801614284515, 54.20849844813347, 1.0172900510951877], [-39.78180140256882, 54.188501089811325, 0.9828249458223581], [-23.661799728870392, 54.39700186252594, 1.0355249978601933], [-6.951950024813414, 54.1285015642643, 0.4517284978646785], [-6.573200225830078, 55.895499885082245, 0.13429549289867282], [39.18455168604851, 55.818501859903336, 0.31680098618380725], [-38.950249552726746, 55.773500353097916, 0.5327400285750628], [0.44396749581210315, 56.345999240875244, 0.12704900291282684], [-23.16479943692684, 56.299999356269836, 0.9466349729336798], [34.2739000916481, 55.582500994205475, 0.3919030132237822], [-38.21809962391853, 56.45649880170822, 1.0706749744713306], [35.57024896144867, 56.210000067949295, 0.9009449859149754], [37.70019859075546, 56.04049935936928, 1.0454149451106787], [-4.945269785821438, 56.302499026060104, 0.4768199869431555], [36.217100918293, 57.30399861931801, 0.14564150478690863], [-21.96729928255081, 58.447498828172684, 0.4206020093988627], [-4.6161748468875885, 57.829998433589935, 0.05821900049340911], [0.4836499865632504, 58.3450011909008, 0.10730049689300358], [36.92600131034851, 57.30900168418884, 0.16427300579380244], [-37.12495043873787, 57.87049978971481, 0.7185849826782942], [-35.92675179243088, 58.57349932193756, 1.4216250274330378], [-35.17179936170578, 59.870000928640366, 0.5733600119128823], [-21.6303002089262, 60.31300127506256, 0.5662500043399632], [-2.7383749838918447, 59.59299951791763, 0.03606509926612489], [-0.9646249818615615, 60.130998492240906, 0.07045899837976322], [0.23871799930930138, 59.735000133514404, 0.060237500292714685], [-33.751800656318665, 60.47600135207176, 1.2166800443083048], [-33.191751688718796, 61.521001160144806, 0.6235300097614527], [-21.566100418567657, 62.03150004148483, 0.631954986602068], [-20.34365013241768, 62.78599798679352, 0.05879949821974151], [-31.545300036668777, 62.13049963116646, 0.9105249773710966], [-30.783800408244133, 63.34599852561951, 0.21333550103008747], [-29.291199520230293, 63.970498740673065, 0.306716508930549], [-27.48589962720871, 64.16700035333633, 0.6632850272580981], [-20.40090039372444, 65.43850153684616, 0.05584150130744092], [-25.69199912250042, 65.54850190877914, 0.2748059923760593], [-21.83080092072487, 66.34850054979324, 0.21059249411337078], [-23.485349491238594, 66.38099998235703, 0.2888810122385621], [-20.955249667167664, 66.65600091218948, -0.03957610169891268], [-41.45380109548569, 70.20500302314758, 0.9471899829804897], [-39.567649364471436, 70.22599875926971, 0.8888450101949275], [-43.49185153841972, 70.40350139141083, 0.9804549627006054], [-37.499599158763885, 70.56649774312973, 0.9718050132505596], [-45.68219929933548, 70.89199870824814, 0.815009989310056], [-19.314350560307503, 70.90450078248978, 0.6928599905222654], [-35.61035171151161, 71.09200209379196, 0.8153599919751287], [-51.769498735666275, 71.18099927902222, 0.38573448546230793], [-50.792500376701355, 71.01850211620331, 0.031251449399860576], [-47.01225087046623, 71.29249721765518, 0.4807015066035092], [-19.462550058960915, 72.1369981765747, 0.9711500024423003], [-33.45644846558571, 71.9354972243309, 0.9625449893064797], [-50.2065010368824, 71.96349650621414, 1.131859957240522], [-48.16029965877533, 71.75250351428986, 1.0190550237894058], [-52.22950130701065, 72.42000102996826, 0.9652799926698208], [-21.794600412249565, 72.11200147867203, 1.0972149902954698], [-31.816449016332626, 72.41600006818771, 0.7515450124628842], [-17.728149890899658, 72.66899943351746, 0.14602950250264257], [-23.59969913959503, 72.33700156211853, 1.107544987462461], [-29.48259934782982, 73.03600013256073, 0.8095750235952437], [-51.74199864268303, 73.77500087022781, 1.1308899847790599], [-27.612950652837753, 73.15900176763535, 1.2597599998116493], [-25.671549141407013, 73.04450124502182, 0.9590699919499457], [-17.979450523853302, 73.88599961996078, 0.33314150641672313], [-50.439998507499695, 74.62900131940842, 0.6556300213560462], [-45.79145088791847, 75.09399950504303, 0.3259464865550399], [-46.12334817647934, 76.2849971652031, 1.1503100395202637], [-19.60024982690811, 74.3815004825592, 0.7749450160190463], [-49.417100846767426, 76.02100074291229, 1.3556600315496325], [-43.70279982686043, 75.90600103139877, 0.9580699843354523], [-41.522301733493805, 75.80649852752686, 0.9239449864253402], [-19.730649888515472, 76.65249705314636, 0.6246750126592815], [-39.444200694561005, 75.92850178480148, 0.8462899713777006], [-37.64135017991066, 76.044000685215, 0.9258849895559251], [-35.51024943590164, 76.12349838018417, 1.133474987000227], [-18.811499699950218, 76.49999856948853, -0.03238565113861114], [-29.500799253582954, 76.93099975585938, 1.0378649458289146], [-33.65755081176758, 76.10350102186203, 1.0519749484956264], [-31.732000410556793, 76.18600130081177, 1.1272350093349814], [-28.021199628710747, 77.45449990034103, 0.49058301374316216], [-27.417950332164764, 77.9855027794838, 0.894565018825233], [-25.759149342775345, 78.52400094270706, 0.9270749869756401], [-23.593299090862274, 78.86549830436707, 0.8265699725598097], [-19.732000306248665, 78.96649837493896, 0.6902349996380508], [-23.628849536180496, 80.34499734640121, 1.0118749924004078], [-19.80309933423996, 81.03299885988235, 0.5799150094389915], [-17.5292007625103, 80.93349635601044, 0.1578189985593781], [-27.58754976093769, 80.1519975066185, 1.058074994944036], [-25.74170008301735, 80.17700165510178, 0.9286950225941837], [-29.63149920105934, 80.50549775362015, 0.9216400212608278], [-31.653299927711487, 80.86150139570236, 0.8996149990707636], [-33.47339853644371, 81.2235027551651, 1.0557499481365085], [-35.585951060056686, 81.90499991178513, 0.9682850213721395], [-19.473500549793243, 82.92300254106522, 0.5942999850958586], [-37.84840181469917, 82.62600004673004, 0.7682800060138106], [-38.9411486685276, 83.19500088691711, 0.7837400189600885], [-40.24134948849678, 83.87350291013718, 0.8158899727277458], [-18.1062500923872, 84.28700268268585, 0.042029150790767744], [-41.73099994659424, 84.72950011491776, 0.9929999941959977], [-46.365100890398026, 85.12750267982483, 0.4989749868400395], [-19.83789913356304, 85.05450189113617, 0.33510051434859633], [-43.95439848303795, 85.51649749279022, 0.8664099732413888], [-35.02679988741875, 85.40499955415726, 0.960209988988936], [-33.78415107727051, 85.21950244903564, 1.191694987937808], [-47.76054993271828, 87.13550120592117, 0.3553039859980345], [-35.879600793123245, 85.9764963388443, 0.6242499803192914], [-33.30960124731064, 86.71700209379196, 0.7551650051027536], [-19.588900730013847, 86.70450001955032, 0.31099398620426655], [-37.72040084004402, 86.63850277662277, 1.0649049654603004], [-21.48579992353916, 87.00200170278549, 0.46742300037294626], [-47.9588508605957, 88.79899978637695, 1.0000199545174837], [-19.513899460434914, 89.02300149202347, 0.4270274948794395], [-23.692399263381958, 88.08249980211258, 0.15016199904493988], [-33.29885005950928, 88.38199824094772, 0.7636399823240936], [-21.467549726366997, 88.5159969329834, 0.2523614966776222], [-39.89645093679428, 88.81299942731857, 0.9815549710765481], [-29.562149196863174, 88.74949812889099, 0.8386449771933258], [-27.45174989104271, 88.45099806785583, 0.7186949951574206], [-25.817399844527245, 88.68899941444397, 0.45733549632132053], [-31.700249761343002, 88.79449963569641, 0.7850250112824142], [-45.93515023589134, 89.65949714183807, 0.3196739999111742], [-43.797049671411514, 90.65800160169601, 0.9265349945053458], [-41.78114980459213, 90.57050198316574, 0.9057500283233821], [-17.714550718665123, 90.79799801111221, 0.29032249585725367], [-19.17955093085766, 90.16600251197815, 0.4416049923747778], [-3.81884491071105, 36.118749529123306, 0.20081900584045798], [22.970600053668022, 36.49690002202988, 0.019368100765859708], [22.25870080292225, 37.13595122098923, 0.05994800085318275], [34.795600920915604, 42.92624816298485, 0.22109950077719986], [31.735550612211227, 44.00860145688057, 1.2074699625372887], [-1.1674000415951014, 50.314001739025116, 0.7895400049164891], [-40.574751794338226, 52.35299840569496, 1.168629969470203], [-0.9799499530345201, 56.30749836564064, 0.5225050263106823], [-3.0003099236637354, 58.33600088953972, 0.2680314937606454], [-0.8890599710866809, 58.27400088310242, 0.27708549168892205], [-21.30959928035736, 64.21949714422226, 0.4526750126387924], [-25.72295069694519, 64.25099819898605, 0.9966300567612052], [-44.853001832962036, 75.50700008869171, 0.41535351192578673], [-23.5431008040905, 86.91299706697464, 0.9346699807792902], [19.33090016245842, 28.098199516534805, 0.824834976810962], [-1.1578899575397372, 52.210498601198196, 0.7581450045108795], [-1.197375007905066, 54.25050109624863, 0.7765850168652833], [-21.63900062441826, 78.8784995675087, 1.0229500476270914], [5.089850164949894, 29.524799436330795, 1.2992450501769781], [7.269650232046843, 30.253350734710693, 1.324104960076511], [6.997900083661079, 31.700100749731064, 1.2004049494862556], [29.467349871993065, 39.35689851641655, 1.0243599535897374], [-9.175400249660015, 50.269000232219696, 1.1159200221300125], [-2.9295100830495358, 56.319501250982285, 0.6955250282771885], [-29.4428002089262, 62.61000037193298, 1.311114989221096], [-40.600501000881195, 89.80000019073486, 0.679530028719455], [3.626809921115637, 29.101349413394928, 1.1582949664443731], [3.88948991894722, 28.502050787210464, 1.1414800537750125], [33.52139890193939, 39.550598710775375, 1.0070049902424216], [33.633049577474594, 41.64564982056618, 1.1077950475737453], [-7.19119980931282, 52.19599977135658, 1.0774299735203385], [-5.094899795949459, 54.251499474048615, 0.9264000109396875], [-23.456349968910217, 64.2160028219223, 1.0272749932482839], [-21.198749542236328, 82.80699700117111, 1.347990008071065], [-21.944750100374222, 84.90350097417831, 1.056805020198226], [28.980400413274765, 26.646550744771957, 1.4605650212615728], [4.22697002068162, 28.52250076830387, 1.2162800412625074], [-6.264950148761272, 33.4603488445282, 1.5329449670389295], [38.952551782131195, 36.2294502556324, 1.6035550506785512], [16.121700406074524, 40.78239947557449, 1.5519700245931745], [40.93464836478233, 42.089350521564484, 1.384414965286851], [-2.773039974272251, 43.74074935913086, 1.5162850031629205], [-42.8243987262249, 44.412851333618164, 1.4781949575990438], [-15.725700184702873, 46.6374009847641, 1.602230011485517], [32.76195004582405, 48.89414831995964, 1.343984971754253], [-11.038349941372871, 48.24040085077286, 1.578285009600222], [-2.808555029332638, 54.35999855399132, 0.9879349963739514], [-23.176850751042366, 58.31500142812729, 1.5437949914485216], [-21.584799513220787, 76.55400037765503, 1.4154500095173717], [-21.38490043580532, 80.64799755811691, 1.0910100536420941], [-46.61634936928749, 86.42499893903732, 1.423330046236515], [-43.95819827914238, 85.8049988746643, 1.485120039433241], [-38.819700479507446, 87.4829962849617, 1.4548100298270583], [-25.552349165081978, 86.66899800300598, 1.525745028629899], [-47.23479971289635, 89.81700241565704, 1.2788899475708604], [-45.86485028266907, 89.85599875450134, 1.4659849693998694], [-4.5912498608231544, 37.68404945731163, 1.6955649480223656], [31.69279918074608, 39.4572988152504, 1.448209979571402], [-42.83434897661209, 39.95919972658157, 1.482730032876134], [29.70919944345951, 41.37500002980232, 1.3762949965894222], [31.802549958229065, 41.746750473976135, 1.3209900353103876], [-3.2495250925421715, 45.851949602365494, 1.7509550089016557], [-3.0199550092220306, 50.31000077724457, 1.4198949793353677], [-2.913380041718483, 52.38550156354904, 1.1741550406441092], [-5.203950218856335, 52.457500249147415, 1.306219957768917], [-23.328149691224098, 60.28499826788902, 1.63031998090446], [-23.460600525140762, 62.3444989323616, 1.3863899512216449], [-27.919849380850792, 62.49599903821945, 1.7406099941581488], [-21.312600001692772, 74.24049824476242, 1.499030040577054], [-23.62865023314953, 84.97849851846695, 1.4705349458381534], [-36.66149824857712, 28.60325016081333, 1.2562499614432454], [4.926280118525028, 31.551498919725418, 1.6201400430873036], [-2.806429984048009, 48.105448484420776, 1.5066449996083975], [35.337451845407486, 54.96950075030327, 1.8024799646809697], [-27.27070078253746, 87.53799647092819, 1.6810749657452106], [-8.174500428140163, 30.77320009469986, 1.8249700078740716], [5.466800183057785, 32.71475061774254, 1.6965599497780204], [-40.49070179462433, 32.87824988365173, 1.6595550114288926], [-9.145449846982956, 48.666998744010925, 1.815684954635799], [-6.941849831491709, 50.10100081562996, 1.6845399513840675], [-4.995489958673716, 50.05750060081482, 1.695950049906969], [-25.53590014576912, 62.20550090074539, 1.8700649961829185], [-32.39769861102104, 86.87300235033035, 1.7444499535486102], [3.7045299541205168, 30.94080090522766, 1.7179650021716952], [-4.243544768542051, 38.82269933819771, 1.795190037228167], [-31.83929994702339, 60.91950088739395, 1.8472949741408229], [-23.121999576687813, 81.94799721240997, 1.8370100297033787], [19.604749977588654, 27.66204997897148, 3.1520850025117397], [21.645549684762955, 29.801949858665466, 2.6851750444620848], [3.7070950493216515, 29.917949810624123, 2.5600700173527002], [3.8520449306815863, 31.3199982047081, 2.2817100398242474], [7.280449848622084, 33.309198915958405, 2.877800026908517], [31.192699447274208, 43.69939863681793, 2.8824799228459597], [-4.613054916262627, 48.1424517929554, 1.9311649957671762], [-23.674599826335907, 72.4714994430542, 2.6058850344270468], [-33.12055021524429, 75.70900022983551, 2.896019956097007], [-23.312000557780266, 76.61650329828262, 1.874850015155971], [-29.668599367141724, 76.7195001244545, 3.0890749767422676], [-27.464600279927254, 77.85250246524811, 2.3870549630373716], [15.415599569678307, 26.47539973258972, 2.262500114738941], [29.70764972269535, 26.79304964840412, 3.045985009521246], [-29.708899557590485, 27.12715044617653, 3.217630088329315], [-15.367399901151657, 27.090150862932205, 2.9701399616897106], [16.865849494934082, 26.4809001237154, 2.9979299288243055], [31.751450151205063, 26.67595073580742, 3.11088003218174], [-27.699999511241913, 26.77525021135807, 2.8995200991630554], [-25.74409916996956, 26.845799759030342, 3.0234549194574356], [-19.549500197172165, 26.692349463701248, 2.794790081679821], [-13.105450198054314, 27.823450043797493, 3.0198399908840656], [15.302750281989574, 27.081500738859177, 3.3232050482183695], [-21.47350087761879, 26.808850467205048, 3.156339982524514], [27.533549815416336, 27.4510495364666, 2.873634919524193], [-31.605400145053864, 27.516299858689308, 3.2631950452923775], [-23.586450144648552, 26.865750551223755, 2.9262350872159004], [-33.516451716423035, 27.71719917654991, 2.9534450732171535], [13.688400387763977, 27.904899790883064, 2.6047949213534594], [33.41514989733696, 27.823299169540405, 2.995589980855584], [-35.25305166840553, 28.359949588775635, 2.6275550480931997], [-11.22829969972372, 28.340650722384453, 2.858160063624382], [25.317849591374397, 27.70725078880787, 3.1165650580078363], [17.913250252604485, 27.038250118494034, 2.8013449627906084], [23.596450686454773, 27.77089923620224, 3.1340699642896652], [21.725349128246307, 27.753999456763268, 3.1081701163202524], [-35.964250564575195, 28.977200388908386, 3.2718100119382143], [-10.726500302553177, 28.86985056102276, 3.067529993131757], [34.56350043416023, 28.781550005078316, 1.9562500528991222], [12.946899980306625, 29.465749859809875, 3.0655849259346724], [-37.39570081233978, 29.822049662470818, 2.662984887138009], [4.950379952788353, 29.70154955983162, 2.9048449359834194], [35.483598709106445, 29.687149450182915, 3.020874923095107], [-9.172400459647179, 29.78610061109066, 2.9766999650746584], [6.901650223881006, 29.795000329613686, 3.086369950324297], [8.865299634635448, 30.211299657821655, 3.0392049811780453], [-39.43689912557602, 31.757600605487823, 2.6144750881940126], [11.226899921894073, 31.35475143790245, 2.913794945925474], [9.287649765610695, 31.293250620365143, 2.5179400108754635], [-8.302100002765656, 31.05819970369339, 2.811935031786561], [36.53459995985031, 30.91534972190857, 3.0755249317735434], [37.313248962163925, 32.14145079255104, 2.9949049931019545], [4.364245105534792, 31.88309818506241, 3.1143450178205967], [-7.200149819254875, 31.614001840353012, 3.3066601026803255], [-6.606049835681915, 33.29620137810707, 2.645459957420826], [5.133950151503086, 32.865799963474274, 2.991179935634136], [-40.16375169157982, 33.40994939208031, 3.1544400844722986], [38.174599409103394, 33.670298755168915, 3.060230053961277], [-5.887450184673071, 34.00830179452896, 3.1789098866283894], [7.993799634277821, 35.75655072927475, 2.381300088018179], [38.75099867582321, 35.09385138750076, 2.4544401094317436], [-5.506750196218491, 35.54685041308403, 3.055729903280735], [-41.29450023174286, 35.57619825005531, 2.9633298981934786], [39.22475129365921, 35.81155091524124, 3.3449800685048103], [-5.17694978043437, 37.59169951081276, 2.9600150883197784], [7.991899736225605, 36.99975088238716, 2.2844900377094746], [39.76975008845329, 37.664901465177536, 2.86257010884583], [-41.947148740291595, 37.48074918985367, 2.989724976941943], [8.46050027757883, 37.73890063166618, 3.2233200035989285], [-5.085600074380636, 39.64414820075035, 2.8144600801169872], [40.47210142016411, 39.25039991736412, 2.840995090082288], [24.152349680662155, 38.82564976811409, 2.6148150209337473], [-42.12860018014908, 39.62624818086624, 3.029430052265525], [9.009449742734432, 39.600301533937454, 3.045859979465604], [21.75075002014637, 38.869600743055344, 2.4491699878126383], [25.66324919462204, 39.15505111217499, 3.0130099039524794], [19.699400290846825, 39.12745043635368, 2.4754900950938463], [17.46015064418316, 39.59299996495247, 2.9416850302368402], [27.420800179243088, 39.9852991104126, 3.01794009283185], [17.136549577116966, 41.582200676202774, 3.3297999761998653], [41.33540019392967, 41.641898453235626, 2.9246550984680653], [9.848999790847301, 41.12650081515312, 2.9113299679011106], [-42.46934875845909, 41.57869890332222, 3.0431849882006645], [29.798200353980064, 41.885800659656525, 2.986445091664791], [11.196049861609936, 42.23819822072983, 2.995315007865429], [15.474800020456314, 42.40269958972931, 2.5502799544483423], [-3.874490037560463, 42.01744869351387, 2.082565100863576], [13.215100392699242, 43.16664859652519, 3.2992749474942684], [41.77194833755493, 43.4938482940197, 2.9377099126577377], [-42.127348482608795, 43.899450451135635, 3.1429899390786886], [-3.8005050737410784, 43.88580098748207, 2.1756149362772703], [-42.063549160957336, 46.07740044593811, 2.942960010841489], [42.006999254226685, 45.889850705862045, 2.980859950184822], [-17.42440089583397, 45.6000491976738, 3.085504984483123], [32.116301357746124, 45.97270116209984, 3.0176849104464054], [-19.744349643588066, 46.07829824090004, 2.943095052614808], [-14.854449778795242, 45.77295109629631, 2.830615034326911], [-13.328149914741516, 46.82154953479767, 2.03876500017941], [-11.150499805808067, 45.92994973063469, 2.835189923644066], [-22.14515022933483, 47.09234833717346, 2.9361199121922255], [-41.332051157951355, 48.257701098918915, 2.880479907616973], [-23.377949371933937, 47.950901091098785, 3.189519979059696], [-8.853999897837639, 47.41805046796799, 2.311500022187829], [32.85659849643707, 48.43840003013611, 2.9251249507069588], [41.90640151500702, 48.266150057315826, 3.0657199677079916], [-24.192649871110916, 49.83010143041611, 2.509854966774583], [41.4327010512352, 50.26400089263916, 2.9841200448572636], [-41.35705158114433, 49.67175051569939, 2.34096497297287], [-40.226198732852936, 50.38300156593323, 3.3774098847061396], [33.461350947618484, 50.323501229286194, 3.1399698927998543], [-39.57555070519447, 52.24499851465225, 2.8612050227820873], [-25.085749104619026, 52.083998918533325, 3.025975078344345], [41.07009992003441, 51.77700147032738, 2.380630001425743], [34.24545004963875, 51.95600166916847, 3.256320022046566], [40.16049951314926, 52.32749879360199, 3.1487150117754936], [-24.47660081088543, 53.04750055074692, 2.2100000642240047], [-39.34270143508911, 53.66399884223938, 2.30960501357913], [-24.40585009753704, 54.3614998459816, 2.3255751002579927], [39.268698543310165, 53.729500621557236, 2.6187049224972725], [35.75170040130615, 53.987499326467514, 2.8489551041275263], [37.74794936180115, 54.023001343011856, 2.9721250757575035], [-37.872299551963806, 54.16649952530861, 3.300424898043275], [-37.25000098347664, 56.10150098800659, 2.560694934800267], [-24.347050115466118, 56.28050118684769, 2.27577006444335], [-24.119850248098373, 58.255501091480255, 2.1513348910957575], [-35.29990091919899, 57.705000042915344, 2.622555010020733], [-33.4494486451149, 59.67450141906738, 2.1586299408227205], [-31.540848314762115, 59.97550114989281, 2.493770094588399], [-29.49034981429577, 61.48900091648102, 2.1311601158231497], [-25.847500190138817, 61.51850149035454, 2.112860092893243], [-41.55445098876953, 70.4675018787384, 3.014284884557128], [-39.41889852285385, 70.52549719810486, 3.010659944266081], [-43.911948800086975, 70.95649838447571, 3.096055006608367], [-37.52930089831352, 70.93100249767303, 3.109459998086095], [-36.05839982628822, 71.23599946498871, 2.7607399970293045], [-45.52444815635681, 71.31549715995789, 2.5654800701886415], [-46.36809974908829, 71.53750211000443, 2.905044937506318], [-35.02359986305237, 71.67500257492065, 2.921140054240823], [-33.53219851851463, 72.09549844264984, 2.783325035125017], [-48.07234928011894, 72.10700213909149, 3.1833499670028687], [-51.697999238967896, 72.85100221633911, 2.8195499908179045], [-50.1680001616478, 72.80249893665314, 3.097639884799719], [-25.556549429893494, 72.0914974808693, 3.112724982202053], [-31.588751822710037, 72.39449769258499, 3.0824749264866114], [-29.490049928426743, 72.4010020494461, 2.998614916577935], [-27.67910063266754, 72.11349904537201, 3.004459897056222], [-51.546499133110046, 74.10400360822678, 2.9629149939864874], [-23.099249228835106, 75.02249628305435, 1.9842199981212616], [-50.71450024843216, 74.95500147342682, 3.2280199229717255], [-50.13149976730347, 76.66599750518799, 2.9705949127674103], [-35.613950341939926, 74.99650120735168, 2.7702751103788614], [-34.263499081134796, 75.25850087404251, 3.3094799146056175], [-42.020950466394424, 75.9735032916069, 2.883075037971139], [-37.57705166935921, 75.58450102806091, 2.4392399936914444], [-43.96580159664154, 76.4480009675026, 3.0351949390023947], [-45.862000435590744, 77.12250202894211, 2.904084976762533], [-25.484150275588036, 77.97600328922272, 2.20466498285532], [-23.98419938981533, 78.0860036611557, 2.043650019913912], [-29.555700719356537, 80.12749999761581, 2.9589750338345766], [-27.6117492467165, 80.7190015912056, 3.229649970307946], [-31.658850610256195, 80.36000281572342, 3.0409700702875853], [-25.863949209451675, 80.98050206899643, 2.7630100958049297], [-24.316800758242607, 81.106998026371, 2.2243999410420656], [-33.6323007941246, 80.89549839496613, 2.9827600810676813], [-35.36774963140488, 81.40149712562561, 3.1425401102751493], [-36.40874847769737, 81.91650360822678, 2.404195023700595], [-37.664901465177536, 82.29649811983109, 3.0423500575125217], [-22.254150360822678, 83.18249881267548, 2.0620899740606546], [-23.446999490261078, 82.93049782514572, 2.3723049089312553], [-25.42649954557419, 84.61649715900421, 2.3969700559973717], [-33.47339853644371, 84.94099974632263, 2.90862494148314], [-35.59264913201332, 85.23149788379669, 3.059745067730546], [-41.681550443172455, 84.70399677753448, 3.035154892131686], [-43.79890114068985, 85.46499907970428, 3.2256999984383583], [-29.675550758838654, 84.58299934864044, 2.884645015001297], [-45.92734947800636, 86.61749958992004, 2.9072000179439783], [-29.338249936699867, 85.79400181770325, 1.932239974848926], [-43.8227504491806, 85.74900031089783, 2.492730040103197], [-31.658899039030075, 86.86549961566925, 2.273679943755269], [-29.53770011663437, 86.89799904823303, 2.508535049855709], [-27.401499450206757, 86.80350333452225, 2.2667599841952324], [-38.19974884390831, 86.24400198459625, 2.8309649787843227], [-39.64579850435257, 87.15599775314331, 3.288045059889555], [-40.35795107483864, 88.55850249528885, 2.6691548991948366], [-29.698949307203293, 88.04299682378769, 2.3085149005055428], [-31.598150730133057, 88.12999725341797, 2.2472450509667397], [-41.473448276519775, 88.88450264930725, 3.516244934871793], [-47.11874946951866, 89.51199799776077, 2.5788950733840466], [-45.889850705862045, 89.93600308895111, 3.083379939198494], [-43.77250000834465, 89.33400362730026, 3.1228449661284685], [-43.41164976358414, 90.20700305700302, 2.2319499403238297], [-41.74380004405975, 90.12600034475327, 2.335109980776906], [-17.444800585508347, 26.80410072207451, 3.0406450387090445], [34.48919951915741, 28.81545014679432, 3.084939904510975], [21.549250930547714, 31.198350712656975, 3.194809891283512], [-41.05360060930252, 34.04795005917549, 2.502074930816889], [-5.314600188285112, 46.2353490293026, 2.600365085527301], [-21.584149450063705, 46.582598239183426, 3.3834900241345167], [-10.380949825048447, 47.59715124964714, 2.160009928047657], [-5.487999878823757, 47.43940010666847, 2.422885037958622], [-6.69594993814826, 47.63295128941536, 2.6727349031716585], [-7.611500099301338, 48.58750104904175, 2.009775023907423], [-33.57435017824173, 58.32299962639809, 2.936410019174218], [-24.323999881744385, 59.78750064969063, 2.1213949657976627], [-25.516699999570847, 60.31399965286255, 2.4148051161319017], [17.94539950788021, 61.60949915647507, 3.030814928933978], [-27.617650106549263, 61.67399883270264, 2.223445102572441], [-23.65175075829029, 74.06499981880188, 2.4741198867559433], [-24.142000824213028, 76.46100223064423, 2.1494401153177023], [-39.583150297403336, 75.79000294208527, 2.7344950940459967], [-31.814251095056534, 76.26699656248093, 3.447629977017641], [-25.790799409151077, 76.37699693441391, 2.615289995446801], [-48.222798854112625, 78.04449647665024, 3.07629001326859], [-39.63160142302513, 83.10449868440628, 3.318019909784198], [-27.577649801969528, 84.60850268602371, 2.9209800995886326], [-46.698350459337234, 88.59600126743317, 3.2261100132018328], [20.40559984743595, 28.72134931385517, 2.4652150459587574], [-5.285600200295448, 41.8848991394043, 3.06990509852767], [-5.082750227302313, 43.80929842591286, 2.7711549773812294], [-25.743799284100533, 58.290500193834305, 2.8690900653600693], [17.79934950172901, 60.34399941563606, 3.267359919846058], [-29.788199812173843, 60.13299897313118, 2.881784923374653], [-37.35170140862465, 85.54399758577347, 3.2586900051683187], [-31.694501638412476, 84.85999703407288, 2.9438650235533714], [-12.989499606192112, 45.529648661613464, 3.06152505800128], [-35.49540042877197, 56.29250034689903, 3.438360057771206], [19.39365081489086, 60.18200144171715, 3.2529900781810284], [-27.49055065214634, 60.03599986433983, 2.8805648908019066], [-8.719050325453281, 45.69169878959656, 3.1276799272745848], [-25.560850277543068, 56.21949955821037, 3.1263199634850025], [19.13050003349781, 58.715999126434326, 3.249174915254116], [18.963199108839035, 61.557501554489136, 3.1847599893808365], [-37.38725185394287, 74.64049756526947, 3.183794906362891], [-25.483399629592896, 82.81350135803223, 3.201205050572753], [-38.31309825181961, 30.964599922299385, 3.323789918795228], [23.149000480771065, 38.58400136232376, 3.4960999619215727], [-6.180699914693832, 44.426798820495605, 3.377079963684082], [-7.182300090789795, 46.132899820804596, 3.5029249265789986], [-24.803200736641884, 49.89689961075783, 3.586655016988516], [34.651000052690506, 53.13749983906746, 2.8440600726753473], [-25.594599545001984, 54.13249880075455, 3.416654886677861], [-31.922750174999237, 58.143500238657, 3.4667400177568197], [-26.235099881887436, 71.41300290822983, 3.3818550873547792], [-25.665100663900375, 74.4204968214035, 3.2929799053817987], [-27.62809954583645, 76.4785036444664, 3.125069895759225], [-50.313498824834824, 78.5055011510849, 3.2730100210756063], [11.321449652314186, 30.136149376630783, 3.787419991567731], [12.527350336313248, 31.11105039715767, 3.7565650418400764], [8.724099956452847, 33.521849662065506, 3.6169150844216347], [8.543300442397594, 35.74340045452118, 3.6789351142942905], [18.150899559259415, 38.77114877104759, 3.3653751015663147], [19.118700176477432, 38.57779875397682, 3.6454100627452135], [40.96360132098198, 40.07070139050484, 3.322344971820712], [15.2235496789217, 43.304700404405594, 3.511805087327957], [-9.67315025627613, 44.08305138349533, 3.658104920759797], [35.08710116147995, 52.627500146627426, 3.737384919077158], [18.973900005221367, 56.44199997186661, 3.39548010379076], [17.84284971654415, 58.352500200271606, 3.3950048964470625], [-38.99750113487244, 75.09549707174301, 3.384235082194209], [21.485500037670135, 38.572851568460464, 3.592344932258129], [17.740849405527115, 56.09700083732605, 3.515365067869425], [-27.664249762892723, 58.2754984498024, 3.3501749858260155], [-46.79210111498833, 77.70349830389023, 3.530754940584302], [-40.62705114483833, 83.74600112438202, 3.6223100032657385], [-27.379799634218216, 82.60399848222733, 3.8375400472432375], [-14.394950121641159, 44.75940018892288, 3.621750045567751], [17.891699448227882, 54.22050133347511, 3.809570102021098], [19.070850685238838, 53.740501403808594, 3.848025109618902], [-33.62544998526573, 56.775499135255814, 3.804920008406043], [-29.409049078822136, 58.074500411748886, 3.6907049361616373], [-51.45600065588951, 78.38699966669083, 3.794125048443675], [-10.958700440824032, 43.64459961652756, 3.913590218871832], [-27.66535058617592, 56.43250048160553, 3.82775510661304], [15.432150103151798, 28.179200366139412, 4.693484865128994], [13.206150382757187, 29.05995026230812, 4.499984905123711], [-8.708000183105469, 29.228050261735916, 4.149015061557293], [-7.2997501119971275, 30.42224980890751, 3.9017898961901665], [20.986750721931458, 31.946398317813873, 5.012600217014551], [-6.810449995100498, 41.76095128059387, 5.408749915659428], [12.225099839270115, 42.94690117239952, 4.467404913157225], [-13.236450031399727, 44.17094960808754, 3.8073949981480837], [41.833650320768356, 43.772049248218536, 5.117999855428934], [-40.97545146942139, 46.337950974702835, 4.37641516327858], [32.63850137591362, 47.28090018033981, 3.7062501069158316], [-36.32289916276932, 54.892998188734055, 3.7744499277323484], [-27.595950290560722, 74.59349930286407, 3.930944949388504], [-29.01894971728325, 83.54000002145767, 3.8842549547553062], [17.225949093699455, 27.212299406528473, 5.0490000285208225], [21.438149735331535, 26.90665051341057, 4.9135698936879635], [27.623750269412994, 27.47355028986931, 4.929115064442158], [-15.58264996856451, 28.25620025396347, 4.668219946324825], [23.56790006160736, 27.3655503988266, 5.001700017601252], [33.51765125989914, 27.72424928843975, 4.945415072143078], [-33.42375159263611, 28.387200087308884, 4.277764819562435], [-11.154649779200554, 27.10055001080036, 4.935909993946552], [-8.832599967718124, 27.260050177574158, 4.905790090560913], [-35.42499989271164, 29.796449467539787, 4.798990208655596], [-6.826499942690134, 29.65960092842579, 4.394189920276403], [11.07189990580082, 29.358649626374245, 4.847859963774681], [4.966005217283964, 29.771950095891953, 5.172249861061573], [-37.47659921646118, 31.711749732494354, 5.104850046336651], [-5.967400036752224, 31.867101788520813, 4.00995509698987], [6.742499768733978, 32.849349081516266, 4.180740099400282], [9.161850437521935, 33.21145102381706, 4.377440083771944], [-4.920495208352804, 33.45499932765961, 4.903505090624094], [39.42820057272911, 35.59799864888191, 4.984245169907808], [9.486050345003605, 37.46794909238815, 5.026599857956171], [40.32585024833679, 37.68004849553108, 5.008149892091751], [-5.76404994353652, 39.42330181598663, 4.938735160976648], [27.66069956123829, 40.02169892191887, 4.927179776132107], [-41.458748281002045, 41.82010143995285, 4.6292198821902275], [41.57175123691559, 41.756950318813324, 5.4743001237511635], [29.91040050983429, 41.959598660469055, 5.164800211787224], [17.261099070310593, 43.91314834356308, 5.143050104379654], [-17.52915047109127, 43.99130120873451, 4.744779784232378], [-19.904449582099915, 45.15425115823746, 4.38365014269948], [32.16870129108429, 45.64389958977699, 4.875999875366688], [-7.611299864947796, 45.64395174384117, 4.1790250688791275], [-21.5620007365942, 45.63489928841591, 4.98044490814209], [-40.60870036482811, 48.32195118069649, 3.983614966273308], [-25.84715001285076, 50.23200064897537, 4.5759351924061775], [-37.7376489341259, 52.02300101518631, 4.555314779281616], [35.73400154709816, 51.69700086116791, 4.806914832442999], [37.772901356220245, 52.06650123000145, 4.821904934942722], [-27.180049568414688, 54.78399991989136, 3.946519922465086], [17.379499971866608, 54.117001593112946, 5.211350042372942], [17.619650810956955, 56.27249926328659, 5.123550072312355], [19.617799669504166, 58.60250070691109, 5.204500164836645], [18.82600039243698, 61.3815002143383, 4.092310089617968], [-41.69854894280434, 70.96250355243683, 5.2466499619185925], [-26.27749927341938, 72.47299700975418, 4.221574869006872], [-51.23399943113327, 74.22050088644028, 4.311915021389723], [-27.678249403834343, 73.6050009727478, 4.34513995423913], [-41.662249714136124, 75.08250325918198, 4.929365124553442], [-30.226200819015503, 75.33799856901169, 4.0580350905656815], [-43.980348855257034, 76.01399719715118, 4.948885180056095], [-50.11050030589104, 76.59050077199936, 5.0650998018682], [-52.27949842810631, 78.65700125694275, 4.9331397749483585], [-50.15350133180618, 79.10650223493576, 5.02335000783205], [-31.709298491477966, 80.92399686574936, 5.041900090873241], [-29.63864989578724, 81.08749985694885, 4.522955045104027], [-39.5655483007431, 81.02049678564072, 5.230099894106388], [-37.636898458004, 81.68549835681915, 4.417350050061941], [-27.83234976232052, 82.7149972319603, 4.239249974489212], [-29.80794943869114, 82.64350146055222, 4.907680209726095], [-31.775351613759995, 84.02500301599503, 4.612455144524574], [-37.40815073251724, 85.18899977207184, 5.097549874335527], [-44.05120015144348, 84.83350276947021, 5.009000189602375], [-41.65320098400116, 87.20450103282928, 5.206999834626913], [-43.794699013233185, 88.85049819946289, 4.8614852130413055], [29.91425059735775, 26.88639983534813, 4.9110399559140205], [31.617101281881332, 26.680899783968925, 4.942834842950106], [-19.724000245332718, 27.78954990208149, 4.865239840000868], [-27.60379947721958, 27.83004939556122, 4.910754971206188], [-17.75760017335415, 27.957599610090256, 4.704955033957958], [-13.173749670386314, 27.759699150919914, 5.078999791294336], [-36.82884946465492, 30.343350023031235, 4.143354948610067], [6.992400158196688, 29.67110089957714, 4.871075041592121], [4.706354811787605, 31.924650073051453, 4.904919769614935], [-5.217450205236673, 31.780801713466644, 5.082449875771999], [5.0178999081254005, 32.68684819340706, 5.040000192821026], [-39.29080069065094, 33.74135121703148, 4.750589840114117], [-40.60174897313118, 35.24374961853027, 4.044179804623127], [-39.637599140405655, 35.62914952635765, 5.316350143402815], [-4.8215351998806, 35.754650831222534, 4.794064909219742], [-5.258449818938971, 37.58944943547249, 5.00435009598732], [19.211500883102417, 37.974100559949875, 5.322400014847517], [21.801600232720375, 38.163501769304276, 4.930494818836451], [9.809100069105625, 39.44329917430878, 4.641234874725342], [11.266149580478668, 41.816048324108124, 5.070750135928392], [-11.890499852597713, 43.26954856514931, 4.211355000734329], [31.085850670933723, 43.481599539518356, 4.964699968695641], [-8.80844984203577, 43.69734972715378, 4.861279856413603], [-15.492299571633339, 43.38369891047478, 4.662239924073219], [-13.24899960309267, 43.2671494781971, 4.269740078598261], [-7.085899822413921, 43.76155138015747, 4.675880074501038], [33.113401383161545, 48.08640107512474, 4.887320101261139], [-25.216149166226387, 48.34344983100891, 5.039250012487173], [34.0052992105484, 49.90905150771141, 4.8768650740385056], [-39.228398352861404, 49.91234838962555, 4.646845161914825], [39.856649935245514, 50.263501703739166, 5.319999996572733], [39.497051388025284, 51.7595000565052, 4.408789798617363], [-26.273300871253014, 52.384499460458755, 4.200494848191738], [19.448550418019295, 52.25300043821335, 4.857160151004791], [17.77149923145771, 52.62349918484688, 5.163449794054031], [-36.93785145878792, 53.75500023365021, 4.15609497576952], [20.192600786685944, 54.33899909257889, 4.534175153821707], [-35.382501780986786, 54.10800129175186, 4.479669965803623], [-27.723899111151695, 54.20650169253349, 4.326355177909136], [-28.149399906396866, 55.73999881744385, 4.126625135540962], [-33.368248492479324, 56.024499237537384, 4.221950192004442], [-29.631199315190315, 56.291498243808746, 4.2570848017930984], [-31.66845068335533, 56.28599971532822, 4.36459481716156], [17.896000295877457, 58.173999190330505, 4.753245040774345], [18.278950825333595, 60.22699922323227, 4.355330020189285], [-39.36760127544403, 70.9884986281395, 5.013099871575832], [-43.45174878835678, 71.08250260353088, 4.678665194660425], [-37.68309950828552, 71.24900072813034, 4.8453048802912235], [-29.847849160432816, 71.25700265169144, 4.528365097939968], [-27.68540009856224, 72.11100310087204, 4.6994551084935665], [-46.06039822101593, 71.9354972243309, 5.021799821406603], [-31.912699341773987, 72.02000170946121, 5.403249990195036], [-33.19625183939934, 72.45899736881256, 5.363500211387873], [-48.189349472522736, 72.70249724388123, 5.080750212073326], [-50.69800093770027, 74.50450211763382, 5.01195015385747], [-39.70760107040405, 75.25549829006195, 4.998680204153061], [-37.769898772239685, 74.65700060129166, 5.022500175982714], [-35.60329973697662, 74.53799992799759, 5.253199953585863], [-29.62310053408146, 74.13499802350998, 4.681630060076714], [-31.66314959526062, 75.62349736690521, 4.267424810677767], [-47.985151410102844, 78.30899953842163, 5.229350179433823], [-33.72415155172348, 81.02700114250183, 5.216049961745739], [-40.35079851746559, 82.01000094413757, 4.548780154436827], [-41.7216494679451, 82.846499979496, 5.042199976742268], [-42.32550039887428, 84.0035006403923, 4.619610030204058], [-35.64475104212761, 84.76649969816208, 4.80171013623476], [-45.49089819192886, 86.8690013885498, 4.942660219967365], [-39.39775004982948, 86.22299879789352, 5.0663999281823635], [18.074149265885353, 26.513900607824326, 4.558530170470476], [19.0443005412817, 26.517799124121666, 4.517844878137112], [19.605550915002823, 26.603300124406815, 5.084400065243244], [-23.600250482559204, 27.853500097990036, 5.2535999566316605], [-25.712300091981888, 27.949800714850426, 5.324949976056814], [-21.761350333690643, 27.760950848460197, 4.979595076292753], [-29.448499903082848, 27.931099757552147, 4.892319906502962], [-31.726449728012085, 28.243349865078926, 4.862375091761351], [25.771450251340866, 27.51374989748001, 5.127950105816126], [-33.67545083165169, 29.405150562524796, 5.410199984908104], [35.60350090265274, 29.78760004043579, 5.004949867725372], [9.08220000565052, 29.495950788259506, 5.054099950939417], [36.517150700092316, 30.877750366926193, 4.449999891221523], [37.198200821876526, 31.853601336479187, 5.167200230062008], [-38.77570107579231, 32.32390061020851, 4.339700099080801], [38.386449217796326, 33.686649054288864, 5.011450033634901], [9.593700058758259, 35.650551319122314, 5.063400138169527], [-41.123151779174805, 37.45725005865097, 4.46606520563364], [18.356099724769592, 38.28360140323639, 4.604124929755926], [23.66740070283413, 38.41039910912514, 5.017300136387348], [18.21414940059185, 39.271801710128784, 4.845209885388613], [25.906799361109734, 39.017099887132645, 4.813964944332838], [-41.125550866127014, 39.46999832987785, 4.601425025612116], [41.26309975981712, 40.418051183223724, 4.962204955518246], [18.15659925341606, 41.95794835686684, 4.6349200420081615], [-11.211900040507317, 41.59950092434883, 4.545609932392836], [30.613450333476067, 42.76049882173538, 4.307284951210022], [-41.13880172371864, 43.98145154118538, 4.59246477112174], [13.078750111162663, 43.389901518821716, 4.995389841496944], [15.173399820923805, 44.18184980750084, 5.103600211441517], [41.626349091529846, 45.91275006532669, 5.387249868363142], [-23.138750344514847, 46.60404846072197, 5.125999916344881], [41.34200140833855, 48.07104915380478, 4.8506599850952625], [-39.667848497629166, 47.998301684856415, 4.909984767436981], [-23.990249261260033, 47.362301498651505, 4.890750162303448], [40.82769900560379, 49.74659904837608, 4.611094947904348], [20.24790085852146, 56.12049996852875, 4.522370174527168], [19.622299820184708, 60.05449965596199, 4.787929821759462], [-44.400401413440704, 71.50749862194061, 4.935049917548895], [-35.63909977674484, 71.63599878549576, 4.4792150147259235], [-49.633100628852844, 73.22649657726288, 5.143600050359964], [-33.729299902915955, 74.692003428936, 4.985334817320108], [-33.01050141453743, 75.55299997329712, 4.478625021874905], [-45.60194909572601, 76.97299867868423, 5.229999776929617], [-46.83090001344681, 77.78199762105942, 4.9940901808440685], [-35.57074815034866, 81.2619999051094, 5.018049851059914], [-33.52845087647438, 84.37500149011612, 5.021700169891119], [-42.00815036892891, 88.40849995613098, 4.2030951008200645], [-46.043701469898224, 89.1529992222786, 5.019050091505051], [-45.44924944639206, 89.93449807167053, 4.686249885708094], [20.898550748825073, 33.2489013671875, 5.3872000426054], [40.77395051717758, 38.914501667022705, 5.033350083976984], [-6.053300108760595, 41.13835096359253, 4.598794970661402], [-27.773749083280563, 52.30199918150902, 4.802050068974495], [-29.540499672293663, 54.09400165081024, 4.754825029522181], [-33.40829908847809, 54.25399914383888, 4.748644772917032], [-31.666100025177002, 74.18549805879593, 5.0221998244524], [-6.888499949127436, 27.869800105690956, 5.228249821811914], [-5.7508498430252075, 29.54214997589588, 5.242350045591593], [3.784209955483675, 31.833000481128693, 5.303650163114071], [6.869299802929163, 32.32885152101517, 5.094400141388178], [8.782650344073772, 32.327800989151, 5.218449980020523], [11.03460043668747, 33.42939913272858, 5.090199876576662], [-12.94384989887476, 41.42419993877411, 4.95315995067358], [-42.90580004453659, 87.72599697113037, 4.826834890991449], [-27.496550232172012, 50.13899877667427, 5.507050082087517], [-35.82580015063286, 52.443500608205795, 5.1574502140283585], [-31.798798590898514, 54.19500172138214, 4.925264976918697], [15.39320033043623, 28.780100867152214, 5.527600180357695], [-11.034299619495869, 39.74359855055809, 5.154449958354235], [18.780050799250603, 41.60090163350105, 5.313150119036436], [-9.418799541890621, 41.748300194740295, 5.501599982380867], [-15.118050388991833, 41.661448776721954, 5.393149796873331], [-19.164299592375755, 44.06680166721344, 5.287449806928635], [-39.83030095696449, 45.896001160144806, 5.413599777966738], [-37.4237485229969, 50.0359982252121, 5.455099977552891], [21.069299429655075, 52.03849822282791, 5.566350184381008], [-42.9111011326313, 75.21750032901764, 5.47245005145669], [-39.60774838924408, 76.1369988322258, 5.626999773085117], [-53.71750146150589, 79.00600135326385, 5.446250084787607], [-37.497200071811676, 81.52049779891968, 5.468199960887432], [-15.460100024938583, 28.739849105477333, 5.509399808943272], [13.330250047147274, 28.467699885368347, 5.488649941980839], [-35.99284961819649, 31.0379508882761, 5.574299953877926], [11.333550326526165, 32.41024911403656, 5.437150131911039], [-38.08329999446869, 33.59150141477585, 5.702800117433071], [10.778450407087803, 35.30459851026535, 5.861199926584959], [-40.08080065250397, 37.693701684474945, 5.588950123637915], [-11.117850430309772, 37.46579959988594, 5.281850229948759], [-12.745399959385395, 38.01824897527695, 5.48115000128746], [-40.20245000720024, 39.33585062623024, 5.734450183808804], [25.175800547003746, 38.67284953594208, 5.4941498674452305], [10.592049919068813, 39.76774960756302, 5.70000009611249], [19.307050853967667, 39.69449922442436, 5.567450076341629], [-40.02914950251579, 41.39145091176033, 5.738249979913235], [-40.06759822368622, 43.692201375961304, 5.63920009881258], [-20.442049950361252, 44.770050793886185, 5.442399997264147], [32.78139978647232, 46.919599175453186, 5.51265012472868], [34.947749227285385, 50.50399899482727, 5.510999821126461], [-29.59664911031723, 52.269499748945236, 5.361349787563086], [-33.494699746370316, 52.14349925518036, 5.507550202310085], [20.8468995988369, 54.13400009274483, 5.243849940598011], [-31.705550849437714, 52.01449990272522, 5.620049778372049], [20.835749804973602, 56.385498493909836, 5.293849855661392], [20.66349983215332, 57.757001370191574, 5.50934998318553], [-31.77184984087944, 71.21600210666656, 5.417199805378914], [-29.5951496809721, 72.28600233793259, 5.18900016322732], [-33.32924842834473, 71.17550075054169, 5.429349839687347], [-35.506948828697205, 71.42099738121033, 5.3936499170959], [-40.8313013613224, 81.48399740457535, 5.344899836927652], [-42.945001274347305, 83.52649956941605, 5.319749936461449], [-31.569648534059525, 82.74450153112411, 5.677199922502041], [2.535345032811165, 27.873100712895393, 5.633799824863672], [13.087100349366665, 32.51494839787483, 5.507899913936853], [12.730750255286694, 33.66880118846893, 5.80149982124567], [-13.258200138807297, 39.294350892305374, 5.4352497681975365], [-37.85324841737747, 48.345550894737244, 5.898050032556057], [-8.936800062656403, 26.51984989643097, 5.840550176799297], [1.550175016745925, 28.24385091662407, 5.781250074505806], [-31.703751534223557, 28.85645069181919, 5.6986999697983265], [-29.969150200486183, 28.690699487924576, 5.708449985831976], [-19.333399832248688, 28.990749269723892, 5.803000181913376], [3.051884938031435, 29.74564954638481, 5.757850129157305], [-17.265649512410164, 28.91015075147152, 5.596249829977751], [3.7375150714069605, 32.69084915518761, 5.730399861931801], [-10.900800116360188, 36.518748849630356, 5.631150212138891], [20.475050434470177, 39.572250097990036, 5.744149908423424], [-14.340300112962723, 39.9601012468338, 5.62505004927516], [-29.33109924197197, 50.648998469114304, 5.8304001577198505], [19.682200625538826, 50.48450082540512, 5.936900153756142], [37.96349838376045, 50.62349885702133, 5.9599000960588455], [20.903799682855606, 50.74299871921539, 5.862699821591377], [1.7321950290352106, 28.687499463558197, 5.72599982842803], [-9.869449771940708, 37.6426987349987, 5.7496498338878155], [-16.87154918909073, 42.31664910912514, 5.697350017726421], [-35.77934950590134, 50.35949870944023, 5.797199904918671], [1.745410030707717, 28.08310091495514, 6.239850074052811], [-21.27465046942234, 28.963150456547737, 5.922549869865179], [15.654649585485458, 29.10415083169937, 7.149550132453442], [1.881869975477457, 29.22705002129078, 6.468900013715029], [13.801650144159794, 33.48295018076897, 6.800150033086538], [-4.329024814069271, 33.55704993009567, 6.819350179284811], [20.252499729394913, 34.25534814596176, 6.823750212788582], [20.7614004611969, 33.55395048856735, 6.683600135147572], [19.301600754261017, 37.594400346279144, 6.822950206696987], [19.930750131607056, 39.43534940481186, 6.7992000840604305], [19.855350255966187, 41.76409915089607, 6.782250013202429], [18.587950617074966, 43.48424822092056, 5.8292001485824585], [17.56184920668602, 45.02924904227257, 5.9427497908473015], [17.29230023920536, 46.2287999689579, 6.922650150954723], [-33.8331013917923, 50.42500048875809, 5.954950116574764], [17.8095493465662, 52.27699875831604, 7.005949970334768], [-41.405901312828064, 74.85199719667435, 7.289149798452854], [-42.0912504196167, 75.59999823570251, 6.256400141865015], [-43.53699833154678, 75.872503221035, 6.860049907118082], [-41.68039932847023, 82.97950029373169, 6.701800040900707], [-10.977399535477161, 26.52519941329956, 6.5218498930335045], [19.745400175452232, 27.40035019814968, 6.8826498463749886], [21.647650748491287, 26.79404988884926, 7.116950117051601], [-13.368899933993816, 26.723049581050873, 6.816999986767769], [-6.991149857640266, 26.982950046658516, 6.786399986594915], [29.761100187897682, 26.778100058436394, 6.688999943435192], [31.771499663591385, 27.082649990916252, 6.965999957174063], [23.573249578475952, 26.6634002327919, 7.120450027287006], [18.037600442767143, 28.03890034556389, 6.5032001584768295], [33.42289850115776, 28.013400733470917, 6.754800211638212], [25.642650201916695, 26.888299733400345, 6.950450129806995], [27.52939984202385, 26.913000270724297, 7.087800186127424], [-14.878050424158573, 27.8657004237175, 6.983499974012375], [2.888190094381571, 28.191449120640755, 6.519000045955181], [12.87319976836443, 28.194550424814224, 6.9250501692295074], [14.717900194227695, 28.197849169373512, 6.919149775058031], [-5.855500232428312, 28.166400268673897, 7.00390012934804], [-27.5494996458292, 28.936050832271576, 7.278149947524071], [-23.626599460840225, 29.825499281287193, 6.7241499200463295], [-15.781650319695473, 28.960250318050385, 6.524149794131517], [4.879864864051342, 28.815999627113342, 6.8350001238286495], [17.260849475860596, 29.640449211001396, 7.267999928444624], [34.32239964604378, 28.794899582862854, 6.944499909877777], [-29.656900092959404, 28.99554930627346, 7.232599891722202], [-21.992800757288933, 29.97715026140213, 6.6040498204529285], [-5.109699908643961, 29.678549617528915, 7.058599963784218], [35.47209873795509, 29.759149998426437, 6.932499818503857], [-31.523101031780243, 29.778599739074707, 7.032699882984161], [-17.51524955034256, 29.751000925898552, 6.767650134861469], [10.857299901545048, 28.839899227023125, 6.861649919301271], [9.0658999979496, 29.142700135707855, 7.098599802702665], [2.9511749744415283, 29.52679991722107, 7.125049829483032], [6.73185009509325, 29.204750433564186, 6.854699924588203], [-33.51069986820221, 30.209749937057495, 6.227599922567606], [-35.48489883542061, 31.793948262929916, 6.398600060492754], [3.0957600101828575, 31.641598790884018, 7.006150204688311], [37.237249314785004, 31.86044842004776, 6.883449852466583], [-4.656584933400154, 31.472600996494293, 6.79050013422966], [6.8025002256035805, 32.37085044384003, 6.9055999629199505], [8.883800357580185, 32.10959956049919, 6.935149896889925], [11.146049946546555, 31.98704868555069, 6.779000163078308], [12.764300219714642, 32.378699630498886, 6.903599947690964], [-37.04399988055229, 33.9214988052845, 6.440749857574701], [3.6790301091969013, 32.778650522232056, 6.7715998739004135], [4.926284775137901, 32.82739967107773, 6.896500010043383], [38.443099707365036, 33.64714980125427, 6.739300210028887], [-37.347301840782166, 35.70275008678436, 6.7564500495791435], [39.57350179553032, 35.734500735998154, 7.131250109523535], [-4.84506506472826, 35.58975085616112, 7.061449810862541], [-10.903749614953995, 36.34029999375343, 6.883800029754639], [-12.976749800145626, 37.72934898734093, 6.90620020031929], [-9.937799535691738, 36.43079847097397, 7.315449882298708], [11.2636499106884, 37.602998316287994, 6.8120998330414295], [-38.96240144968033, 37.55655139684677, 6.238900125026703], [-8.906450122594833, 37.56434842944145, 7.021049968898296], [40.39280116558075, 37.72765025496483, 7.02620018273592], [-5.706800147891045, 37.826549261808395, 6.6141001880168915], [21.359499543905258, 37.64164820313454, 7.010149769484997], [23.31545017659664, 37.77080029249191, 7.239399943500757], [-8.833900094032288, 39.564549922943115, 6.799300201237202], [25.227950885891914, 38.5066494345665, 6.846799980849028], [26.215750724077225, 38.93420100212097, 6.842750124633312], [41.001349687576294, 39.65485095977783, 6.7413002252578735], [-14.184899628162384, 39.19554874300957, 6.330150179564953], [11.397600173950195, 39.2630510032177, 6.809200160205364], [-14.974700286984444, 39.97210040688515, 6.8916999734938145], [-6.808800157159567, 39.437249302864075, 6.832300219684839], [27.499400079250336, 39.744749665260315, 6.884950213134289], [20.878849551081657, 39.709750562906265, 7.248200010508299], [-8.935750462114811, 41.229698807001114, 6.349849980324507], [41.18970036506653, 41.3024015724659, 7.085599936544895], [11.95515040308237, 41.33389890193939, 6.708600092679262], [-7.2686998173594475, 41.04755073785782, 6.279199849814177], [29.59365025162697, 41.543148458004, 6.789450068026781], [-16.145149245858192, 41.17650166153908, 6.904100067913532], [-17.130950465798378, 42.09375008940697, 6.767400074750185], [12.786050327122211, 42.06389933824539, 7.311999797821045], [41.26444831490517, 43.67375001311302, 6.85185007750988], [-18.251849338412285, 42.98600181937218, 6.927050184458494], [19.62379924952984, 43.68184879422188, 6.792100146412849], [31.528398394584656, 43.928198516368866, 7.249999791383743], [13.583149760961533, 43.54989901185036, 6.968049798160791], [-19.536999985575676, 43.8600517809391, 7.034100126475096], [14.873550273478031, 44.495098292827606, 6.8939500488340855], [32.30920061469078, 45.45990005135536, 6.617450155317783], [-20.593149587512016, 44.607751071453094, 6.857799831777811], [19.72764916718006, 45.916598290205, 6.9205001927912235], [15.931399539113045, 45.3682504594326, 7.104299962520599], [-38.95924985408783, 43.94204914569855, 6.318000145256519], [-21.889450028538704, 45.47559842467308, 7.112099789083004], [-38.63925114274025, 46.43639922142029, 5.990399979054928], [41.113950312137604, 45.82975059747696, 6.469099782407284], [-23.500099778175354, 46.50714993476868, 7.0604500360786915], [40.85329920053482, 47.04369977116585, 6.252950057387352], [-24.184450507164, 47.054801136255264, 6.459800060838461], [33.18440169095993, 46.58835008740425, 7.306599989533424], [-25.621650740504265, 47.66710102558136, 6.964100059121847], [33.85600075125694, 47.95604944229126, 6.842049770057201], [39.76539894938469, 47.81404882669449, 6.985050160437822], [-27.55269967019558, 48.230499029159546, 7.043700199574232], [-35.600099712610245, 47.87309840321541, 6.575900129973888], [21.661149337887764, 49.89660158753395, 6.452600006014109], [35.61760112643242, 49.598049372434616, 6.582549773156643], [-35.13620048761368, 49.324098974466324, 6.248100195080042], [38.95045071840286, 49.438949674367905, 6.511699873954058], [-29.608149081468582, 49.83099922537804, 6.204300094395876], [-31.588051468133926, 50.627999007701874, 6.062950007617474], [17.56029948592186, 50.406500697135925, 7.2200000286102295], [21.902499720454216, 52.67700180411339, 6.635800004005432], [21.649999544024467, 54.32000011205673, 6.8696001544594765], [18.01305077970028, 54.21049892902374, 6.66389986872673], [21.00439928472042, 55.97599968314171, 6.624250207096338], [18.207749351859093, 55.748000741004944, 6.364449858665466], [19.58180032670498, 56.1784990131855, 7.289750035852194], [19.37139965593815, 57.509999722242355, 6.576899904757738], [-39.54875096678734, 71.0344985127449, 7.073749788105488], [-35.5505496263504, 71.14800065755844, 6.425850093364716], [-33.87970104813576, 72.23200052976608, 6.2823002226650715], [-43.04169863462448, 71.35900110006332, 6.364849861711264], [-41.58715158700943, 71.19449973106384, 7.230199873447418], [-37.804849445819855, 71.07950001955032, 6.723349913954735], [-44.12059858441353, 71.73199951648712, 6.928150076419115], [-45.776501297950745, 72.1369981765747, 6.827349774539471], [-47.962699085474014, 72.7899968624115, 7.081099785864353], [-49.993451684713364, 74.43950325250626, 6.7091998644173145], [-35.61455011367798, 72.3785012960434, 6.856299936771393], [-36.100998520851135, 73.58449697494507, 6.2315501272678375], [-37.80049830675125, 73.94099980592728, 6.515650078654289], [-39.86860066652298, 74.29700344800949, 7.115750107914209], [-49.01890084147453, 75.80649852752686, 6.531749852001667], [-39.98905047774315, 75.70350170135498, 6.418250035494566], [-45.92235013842583, 76.69900357723236, 7.089150138199329], [-48.05760085582733, 76.48850232362747, 6.862250156700611], [-50.076499581336975, 78.16550135612488, 6.28589978441596], [-48.855751752853394, 77.57149636745453, 6.288500037044287], [-52.3810014128685, 78.90050113201141, 6.386950146406889], [-53.792499005794525, 78.95849645137787, 6.273999810218811], [-40.052201598882675, 81.21850341558456, 6.251949816942215], [-35.64419969916344, 81.56750351190567, 6.298250053077936], [-37.62215003371239, 82.46450126171112, 6.982800085097551], [-33.030249178409576, 81.79400116205215, 5.948999896645546], [-32.23314881324768, 82.75700360536575, 6.203149911016226], [-43.00675168633461, 83.55449885129929, 6.367249879986048], [-33.67929905653, 82.99600332975388, 6.595099810510874], [-43.77425089478493, 84.91049706935883, 6.700200028717518], [-35.49814969301224, 84.12300050258636, 6.768399849534035], [-37.59165108203888, 84.81550216674805, 7.278500124812126], [-39.587050676345825, 86.01000159978867, 7.075800094753504], [-44.09375041723251, 86.67799830436707, 7.3091997765004635], [-41.722748428583145, 86.59300208091736, 7.002899888902903], [-45.451998710632324, 87.38649636507034, 6.89420010894537], [-45.60549929738045, 88.68400007486343, 6.930550094693899], [-44.16229948401451, 88.5000005364418, 6.868700031191111], [-9.026950225234032, 26.500549167394638, 6.879149936139584], [-25.71910060942173, 29.455050826072693, 7.033550180494785], [4.210724961012602, 28.522299602627754, 6.486800033599138], [-19.808700308203697, 30.10530024766922, 6.469099782407284], [13.134749606251717, 35.61355173587799, 7.100900169461966], [-38.97655010223389, 41.5274016559124, 6.393199786543846], [-37.396349012851715, 46.20220139622688, 6.620599888265133], [-37.015151232481, 47.95685037970543, 6.364449858665466], [19.365999847650528, 48.090800642967224, 6.909599993377924], [19.75874975323677, 49.41524937748909, 6.314700003713369], [-31.703948974609375, 49.79125037789345, 6.401849910616875], [-49.26149919629097, 73.27800244092941, 6.3749998807907104], [-33.746350556612015, 31.565051525831223, 7.126899901777506], [-35.74435040354729, 33.62119942903519, 7.043099962174892], [11.76880020648241, 35.907648503780365, 6.674000062048435], [-38.892749696969986, 39.351850748062134, 6.342200096696615], [21.004950627684593, 41.26419872045517, 7.470049895346165], [17.90820062160492, 48.22869971394539, 7.060249801725149], [-29.632849618792534, 48.05200174450874, 7.257599849253893], [-33.525899052619934, 49.32139813899994, 6.412100046873093], [37.61965036392212, 49.539949744939804, 6.898900028318167], [-37.654150277376175, 43.837349861860275, 6.979350000619888], [-33.33434835076332, 47.940999269485474, 6.781450007110834], [-39.40499946475029, 82.8310027718544, 7.129149977117777], [-35.544250160455704, 82.7689990401268, 7.049050182104111], [20.917950198054314, 35.75354814529419, 7.67565006390214], [-37.64975070953369, 37.705451250076294, 6.97400001809001], [-37.64199838042259, 39.409950375556946, 7.044749800115824], [28.61350029706955, 40.613751858472824, 6.681249942630529], [-35.78434884548187, 45.776400715112686, 7.119750138372183], [-31.775299459695816, 48.09984937310219, 6.91650016233325], [-19.524449482560158, 31.21810033917427, 7.287399843335152], [-21.55029959976673, 31.57994896173477, 7.332350127398968], [14.473550021648407, 34.11899879574776, 7.375999819487333], [14.602500014007092, 35.60969978570938, 7.680749986320734], [-6.839000154286623, 37.702351808547974, 7.59855005890131], [40.68335145711899, 39.027951657772064, 7.640049792826176], [-37.71615028381348, 41.48640111088753, 7.05979997292161], [40.59330001473427, 44.175051152706146, 7.837249897420406], [40.18649831414223, 46.02684825658798, 7.538599893450737], [21.215349435806274, 46.34235054254532, 7.565599866211414], [21.631449460983276, 48.21759834885597, 7.264200132340193], [35.357799381017685, 48.02649840712547, 7.754149846732616], [22.73714914917946, 50.18499866127968, 7.280400022864342], [18.637800589203835, 54.515499621629715, 7.5079998932778835], [-37.7376489341259, 72.30249792337418, 7.374349981546402], [-41.80305078625679, 84.52200144529343, 7.632299792021513], [-10.96665021032095, 26.558799669146538, 7.3211002163589], [13.045400381088257, 37.4472513794899, 7.831599563360214], [-33.64219889044762, 46.19764909148216, 7.323550060391426], [11.521849781274796, 28.49549986422062, 7.381250150501728], [36.397550255060196, 30.798550695180893, 7.337300106883049], [-23.347700014710426, 31.37819841504097, 7.590699940919876], [-35.66195070743561, 35.581450909376144, 7.525850087404251], [20.19990049302578, 36.2742505967617, 7.917899638414383], [20.60900069773197, 43.55045035481453, 7.65935005620122], [22.97629974782467, 48.40419813990593, 7.677549961954355], [-32.28364884853363, 30.87580017745495, 7.597050163894892], [12.635800056159496, 39.78709876537323, 7.953199557960033], [-35.496048629283905, 41.64715111255646, 7.703199982643127], [-35.561349242925644, 43.392449617385864, 7.551149930804968], [-31.555548310279846, 45.93135043978691, 7.770299911499023], [37.52335160970688, 48.204001039266586, 7.791650015860796], [22.638149559497833, 51.8605001270771, 7.739949971437454], [-39.50599953532219, 72.81699776649475, 7.858250290155411], [17.563549801707268, 31.683098524808884, 7.803000044077635], [17.068849876523018, 31.46965056657791, 8.839449845254421], [-34.031301736831665, 33.32814946770668, 7.794199977070093], [5.863499827682972, 32.565049827098846, 7.556249853223562], [17.63085089623928, 35.65584868192673, 7.673799991607666], [-35.388801246881485, 37.48214989900589, 7.816099561750889], [-35.45685112476349, 39.353400468826294, 7.696149870753288], [-33.50365161895752, 43.68855059146881, 7.8140003606677055], [-13.156900182366371, 26.619600132107735, 9.175949729979038], [-7.116400171071291, 26.877349242568016, 8.854550309479237], [25.583399459719658, 27.101749554276466, 9.060599841177464], [27.65429951250553, 26.84039995074272, 8.781050331890583], [29.76834960281849, 27.42060087621212, 9.212849661707878], [-15.349600464105606, 27.81910076737404, 9.049950167536736], [21.621650084853172, 27.947500348091125, 8.54714959859848], [31.46209940314293, 27.934549376368523, 9.085950441658497], [15.526900067925453, 27.983849868178368, 8.843149989843369], [-5.82109997048974, 28.028549626469612, 8.89815017580986], [11.117749847471714, 28.269749134778976, 8.84309969842434], [18.979649990797043, 29.433200135827065, 7.9576000571250916], [-17.294349148869514, 29.582049697637558, 8.921699598431587], [33.793751150369644, 29.461700469255447, 9.427799843251705], [3.7890200037509203, 29.845649376511574, 8.826450444757938], [4.911584779620171, 29.06624972820282, 8.921049535274506], [-25.172550231218338, 29.59885075688362, 8.688299916684628], [35.214949399232864, 30.002299696207047, 8.614299818873405], [16.10255055129528, 29.588250443339348, 8.38869996368885], [-4.886224865913391, 29.83424998819828, 9.37584973871708], [-31.743798404932022, 29.505949467420578, 9.010300040245056], [-24.707650765776634, 30.635399743914604, 7.873550057411194], [-19.35954950749874, 31.442198902368546, 8.872649632394314], [-32.44839981198311, 30.99285066127777, 8.77045001834631], [3.650845028460026, 31.065599992871284, 8.356500416994095], [-32.9461507499218, 31.738050282001495, 8.976549841463566], [-23.559950292110443, 31.542550772428513, 9.008600376546383], [11.008749715983868, 31.66225180029869, 9.07790008932352], [8.907300420105457, 31.800951808691025, 8.950400166213512], [12.480850331485271, 32.03925117850304, 9.326200000941753], [6.819500122219324, 31.842049211263657, 8.861400187015533], [4.745809826999903, 31.731300055980682, 8.971650153398514], [13.630550354719162, 33.79720076918602, 8.891800418496132], [-4.956029821187258, 33.44609960913658, 9.131849743425846], [18.026800826191902, 33.170100301504135, 8.023000322282314], [37.87694871425629, 33.6063988506794, 9.204450063407421], [17.790449783205986, 33.56029838323593, 8.881350047886372], [39.16795179247856, 35.72164848446846, 8.797699585556984], [14.757850207388401, 36.00820153951645, 8.8061997666955], [19.42799985408783, 35.48604995012283, 9.081950411200523], [18.366750329732895, 34.97985005378723, 8.425899781286716], [-5.698000080883503, 35.86465120315552, 8.58165044337511], [-11.416849680244923, 35.49814969301224, 8.843200281262398], [-9.14124958217144, 36.038950085639954, 9.140550158917904], [-6.94249989464879, 37.06229850649834, 8.823949843645096], [21.0354495793581, 37.84390166401863, 8.797800168395042], [-8.302849717438221, 36.97429969906807, 8.98864958435297], [19.533850252628326, 37.61490061879158, 8.525799959897995], [-13.345349580049515, 37.50764951109886, 8.707149885594845], [23.889800533652306, 37.14755177497864, 9.086750447750092], [39.68590125441551, 37.51260042190552, 9.054450318217278], [25.655750185251236, 38.01894932985306, 9.285599924623966], [21.28645032644272, 39.56890106201172, 9.208249859511852], [27.80899964272976, 39.46080058813095, 9.22504998743534], [-15.32949972897768, 39.38550129532814, 8.89655016362667], [-16.943449154496193, 40.28080031275749, 9.580249898135662], [29.85209971666336, 41.4297990500927, 8.791900239884853], [-17.7108496427536, 41.51944816112518, 9.028050117194653], [13.765649870038033, 42.374398559331894, 8.436749689280987], [21.891549229621887, 43.69769990444183, 8.75415001064539], [-19.881300628185272, 43.36899891495705, 8.82364995777607], [15.17335046082735, 43.936800211668015, 9.122000075876713], [31.948000192642212, 43.396349996328354, 9.202299639582634], [-21.456200629472733, 43.93085092306137, 9.475650265812874], [39.58920016884804, 43.80735009908676, 8.992699906229973], [-22.086750715970993, 45.27534916996956, 8.422699756920338], [16.116399317979813, 45.37155106663704, 8.977700024843216], [33.71734917163849, 45.875150710344315, 8.677699603140354], [-23.666150867938995, 45.626699924468994, 9.098400361835957], [16.924500465393066, 47.805048525333405, 9.038800373673439], [-29.647499322891235, 46.002600342035294, 8.760949596762657], [23.72414991259575, 48.149701207876205, 8.96450038999319], [16.74794964492321, 49.78474974632263, 9.03335027396679], [23.653799667954445, 50.12749880552292, 8.843399584293365], [23.111149668693542, 51.591500639915466, 9.065049700438976], [17.639949917793274, 52.351001650094986, 9.105649776756763], [22.31759950518608, 52.87550017237663, 9.047149680554867], [21.450549364089966, 53.88199910521507, 8.871899917721748], [-41.61100089550018, 70.41800022125244, 9.365200065076351], [-40.171850472688675, 70.81150263547897, 8.368049748241901], [-43.706201016902924, 70.98750025033951, 9.249449707567692], [-43.755900114774704, 72.57650047540665, 9.152599610388279], [-45.99149897694588, 72.24900275468826, 9.090550243854523], [-48.29540103673935, 72.42249697446823, 9.400499984622002], [-49.34785142540932, 74.24650341272354, 8.349699899554253], [-43.25005039572716, 75.40950179100037, 7.969049736857414], [-41.534651070833206, 85.00249683856964, 8.249499835073948], [-43.05624961853027, 85.54449677467346, 8.177150040864944], [-39.496049284935, 84.66050028800964, 7.990350015461445], [-43.494198471307755, 86.86549961566925, 8.2225501537323], [23.820599541068077, 27.620749548077583, 9.176449850201607], [13.274949975311756, 27.82749943435192, 9.282249957323074], [6.863350048661232, 28.99714931845665, 8.69510043412447], [9.069100022315979, 28.797149658203125, 8.763199672102928], [19.848499447107315, 29.792549088597298, 8.7117999792099], [-4.593254998326302, 31.731199473142624, 9.422799572348595], [36.285001784563065, 31.30270168185234, 8.995450101792812], [36.959998309612274, 32.08855167031288, 8.87375045567751], [19.531449303030968, 31.62579983472824, 8.90239980071783], [-33.661048859357834, 33.422548323869705, 9.068449959158897], [-34.063298255205154, 35.61009839177132, 9.349750354886055], [-34.60105136036873, 35.6036014854908, 7.9597001895308495], [-34.14205089211464, 40.33524915575981, 8.023950271308422], [-33.698901534080505, 41.537050157785416, 8.009900338947773], [40.19474983215332, 41.65010154247284, 8.903499692678452], [21.79175056517124, 41.66325181722641, 8.79605021327734], [-18.56200024485588, 42.81099885702133, 8.104500360786915], [-32.06915035843849, 44.8327511548996, 7.966199889779091], [22.250499576330185, 45.49665004014969, 8.488199673593044], [16.66560024023056, 46.16525024175644, 9.396799840033054], [-25.637449696660042, 45.91770097613335, 9.391349740326405], [22.936450317502022, 46.448398381471634, 8.911349810659885], [19.735800102353096, 53.881000727415085, 8.978749625384808], [-39.872050285339355, 71.89849764108658, 8.452200330793858], [-41.856348514556885, 73.78199696540833, 8.594449609518051], [-43.983299285173416, 74.41850006580353, 9.182949550449848], [-48.26749861240387, 74.42200183868408, 9.337550029158592], [-44.372450560331345, 75.59149712324142, 8.334999904036522], [-8.988150395452976, 26.590250432491302, 9.124400094151497], [-21.542450413107872, 32.80794993042946, 8.84804967790842], [14.819599688053131, 37.449199706315994, 8.960950188338757], [-33.396098762750626, 39.19535130262375, 8.847950026392937], [19.957000389695168, 39.276301860809326, 8.188899606466293], [-31.426798552274704, 43.67804899811745, 8.565150201320648], [39.1213484108448, 45.84129899740219, 8.481849916279316], [-27.4788998067379, 47.272149473428726, 8.492650464177132], [37.358950823545456, 47.25734889507294, 8.432700298726559], [-47.460898756980896, 75.62199980020523, 8.48584994673729], [-45.84505036473274, 75.97850263118744, 8.379950188100338], [-29.68055009841919, 27.76999957859516, 9.063949808478355], [-27.61485055088997, 27.705499902367592, 8.967599831521511], [33.08524936437607, 28.48385088145733, 8.532400242984295], [19.72305029630661, 33.42530131340027, 8.794150315225124], [21.77949994802475, 35.59330105781555, 9.159499779343605], [-33.93609821796417, 37.70200163125992, 9.453699924051762], [13.611500151455402, 39.69670087099075, 8.611000142991543], [40.08699953556061, 39.7551991045475, 9.084549732506275], [-31.83244913816452, 39.51609879732132, 8.879450149834156], [-31.228849664330482, 41.441600769758224, 8.717549964785576], [-32.44204819202423, 41.830550879240036, 8.156250230967999], [14.166849665343761, 42.975399643182755, 8.633649908006191], [-29.084300622344017, 46.97540029883385, 8.453349582850933], [35.499900579452515, 47.040101140737534, 8.50555021315813], [-26.225650683045387, 47.03599959611893, 8.611699566245079], [-10.954000055789948, 26.61599963903427, 9.253749623894691], [-26.06699988245964, 28.058450669050217, 9.323449805378914], [-22.794049233198166, 32.74739906191826, 9.15130041539669], [29.04059924185276, 40.50024971365929, 9.222550317645073], [-41.55129939317703, 72.25149869918823, 9.283900260925293], [21.502800285816193, 29.5438002794981, 9.52105037868023], [14.11375030875206, 35.05155071616173, 9.466799907386303], [-12.926699593663216, 35.69075092673302, 9.807550348341465], [-6.9044497795403, 35.57464852929115, 9.771049953997135], [15.083099715411663, 41.55005142092705, 9.674199856817722], [-29.724549502134323, 44.11355033516884, 9.282300248742104], [33.321548253297806, 44.35094818472862, 9.664700366556644], [37.45625168085098, 45.86679860949516, 9.179550223052502], [-27.559049427509308, 46.06825113296509, 9.370599873363972], [-31.327001750469208, 27.967700734734535, 9.806600399315357], [16.74959994852543, 29.629550874233246, 9.525800123810768], [-23.97499978542328, 30.04789911210537, 9.845550172030926], [21.400300785899162, 33.8113009929657, 9.749299846589565], [-10.742750018835068, 33.78995135426521, 9.698400273919106], [14.937150292098522, 39.504650980234146, 9.260349906980991], [-29.725799337029457, 39.76760059595108, 9.458550252020359], [-29.58514913916588, 41.81569814682007, 9.453900158405304], [31.132999807596207, 42.47970134019852, 9.425950236618519], [35.57629883289337, 45.63165083527565, 9.419200010597706], [-45.88095098733902, 74.93750005960464, 9.368949569761753], [23.255499079823494, 36.086250096559525, 9.872550144791603], [-14.84024990350008, 37.87184879183769, 9.877399541437626], [26.642050594091415, 38.54160010814667, 9.516250342130661], [-19.374649971723557, 42.265549302101135, 9.72955022007227], [37.73915022611618, 44.04300078749657, 9.93650034070015], [-44.94430124759674, 71.3609978556633, 9.39824990928173], [-8.973900228738785, 33.60245004296303, 9.86110046505928], [-6.93164998665452, 33.500999212265015, 9.921000339090824], [38.54304924607277, 35.388801246881485, 9.7893001511693], [-27.710000053048134, 43.934401124715805, 9.895600378513336], [22.841550409793854, 43.89600083231926, 9.841550141572952], [9.392050094902515, 28.56604941189289, 9.721750393509865], [23.036250844597816, 28.73319946229458, 9.785549715161324], [32.173749059438705, 28.74154970049858, 9.786950424313545], [21.34780026972294, 31.502198427915573, 9.881850332021713], [21.816149353981018, 39.48254883289337, 11.346999555826187], [17.366699874401093, 29.541049152612686, 11.26255001872778], [5.093949846923351, 28.75645086169243, 10.944750159978867], [-20.911499857902527, 32.548051327466965, 10.006249882280827], [18.695350736379623, 34.377049654722214, 10.745950043201447], [19.519299268722534, 35.71435064077377, 11.128599755465984], [-29.04535084962845, 39.08564895391464, 10.77979989349842], [-27.87424996495247, 40.57155176997185, 9.974350221455097], [-27.978049591183662, 41.96904972195625, 9.944849647581577], [17.536500468850136, 50.0665009021759, 10.819200426340103], [-13.144800439476967, 27.173899114131927, 11.234999634325504], [-8.847599849104881, 26.67834982275963, 11.095499619841576], [-6.992400158196688, 27.562599629163742, 11.122649535536766], [-29.76370044052601, 26.838650926947594, 11.045199818909168], [-27.623450383543968, 26.74565091729164, 11.323349550366402], [-25.431599467992783, 27.47569978237152, 10.82765031605959], [-31.86659887433052, 27.652500197291374, 11.151749640703201], [-14.962700195610523, 28.09225022792816, 10.88894996792078], [13.369900174438953, 28.12045067548752, 10.738350450992584], [15.23439958691597, 27.92385034263134, 11.161849834024906], [17.168300226330757, 27.951449155807495, 11.168000288307667], [27.617499232292175, 28.157999739050865, 10.32250002026558], [11.29355002194643, 28.244899585843086, 10.713299736380577], [29.20529991388321, 28.263799846172333, 10.37134975194931], [-5.77550008893013, 28.419649228453636, 10.626750066876411], [25.06365068256855, 28.443949297070503, 10.229350067675114], [9.388349950313568, 28.468450531363487, 10.703650303184986], [23.6371997743845, 29.778750613331795, 10.673049837350845], [31.699951738119125, 29.630450531840324, 10.80115046352148], [-17.082849517464638, 29.94300052523613, 10.887700133025646], [8.761749602854252, 29.097849503159523, 11.351999826729298], [-5.401600152254105, 29.59899976849556, 10.821250267326832], [-23.735249415040016, 29.479000717401505, 11.117399670183659], [2.9597249813377857, 29.67960014939308, 11.11149974167347], [-32.513149082660675, 29.102599248290062, 10.306649841368198], [-33.06565061211586, 29.660899192094803, 11.123600415885448], [16.89149998128414, 31.494751572608948, 10.830650106072426], [35.345401614904404, 31.814999878406525, 10.860949754714966], [-22.968050092458725, 31.8247489631176, 11.159149929881096], [-19.41009983420372, 31.78749978542328, 10.944349691271782], [-33.559199422597885, 31.66244924068451, 11.008399538695812], [4.814565181732178, 32.259501516819, 10.90485043823719], [10.744200088083744, 31.274501234292984, 10.710449889302254], [13.246900402009487, 31.555648893117905, 10.727999731898308], [8.876600302755833, 31.63135051727295, 11.178599670529366], [-5.47999981790781, 31.529050320386887, 10.618150234222412], [6.808650214225054, 31.9472998380661, 11.401049792766571], [-8.974149823188782, 31.89690038561821, 11.271649971604347], [-21.74909971654415, 32.954249531030655, 11.355600319802761], [-6.923200096935034, 31.74145147204399, 11.196999810636044], [17.413750290870667, 33.56274962425232, 11.394600383937359], [-33.61884877085686, 33.609598875045776, 11.196999810636044], [36.97475045919418, 33.65259990096092, 10.644550435245037], [13.767000287771225, 33.554598689079285, 10.406900197267532], [-11.624850332736969, 33.13789889216423, 10.698550380766392], [-13.08939978480339, 33.76865014433861, 11.25164981931448], [-8.330750279128551, 35.000499337911606, 10.288150049746037], [37.619151175022125, 35.6159508228302, 10.979849845170975], [14.20115027576685, 35.00320017337799, 10.402549989521503], [-13.234050013124943, 34.91529822349548, 10.204100050032139], [23.931900039315224, 35.34094989299774, 10.589100420475006], [14.685849659144878, 35.83785146474838, 11.154400184750557], [20.817549899220467, 37.60455176234245, 11.00040040910244], [38.87984901666641, 37.62714937329292, 10.379649698734283], [15.017000027000904, 37.42609918117523, 10.995299555361271], [25.881750509142876, 37.0899997651577, 10.603399947285652], [27.610650286078453, 37.800900638103485, 11.088499799370766], [15.665050595998764, 39.45919871330261, 11.071249842643738], [-31.74934908747673, 38.626499474048615, 10.066050104796886], [-30.020400881767273, 37.953950464725494, 11.240250431001186], [28.205350041389465, 38.895800709724426, 10.668599978089333], [39.01224955916405, 39.351899176836014, 10.402999818325043], [-17.467500641942024, 39.31745141744614, 10.39975043386221], [29.56084907054901, 39.44170102477074, 11.089500039815903], [-27.68789976835251, 39.49404880404472, 11.203000321984291], [16.149800270795822, 41.235048323869705, 10.784950107336044], [30.1572997123003, 40.89440032839775, 10.347049683332443], [39.011601358652115, 41.05044901371002, 10.333149693906307], [22.773049771785736, 41.908349841833115, 11.173250153660774], [31.648650765419006, 41.457999497652054, 10.816199705004692], [-20.675500854849815, 42.72665083408356, 10.017000138759613], [15.997199341654778, 43.36944967508316, 10.814400389790535], [37.51569986343384, 42.98520088195801, 10.415449738502502], [23.510849103331566, 43.75309869647026, 11.13935001194477], [-23.624049499630928, 44.27560046315193, 10.079549625515938], [35.516250878572464, 44.60395127534866, 10.04990004003048], [16.59795083105564, 44.57734897732735, 11.241000145673752], [23.9741001278162, 45.726750046014786, 10.80590020865202], [17.41180010139942, 45.83119973540306, 11.195500381290913], [17.606599256396294, 48.11820015311241, 10.956049896776676], [24.246100336313248, 48.12680184841156, 10.746450163424015], [23.623650893568993, 50.17700046300888, 11.255700141191483], [22.873999550938606, 51.52599886059761, 10.74109971523285], [18.052199855446815, 51.913999021053314, 10.549400001764297], [21.504050120711327, 52.26150155067444, 11.103950440883636], [19.25080083310604, 53.091999143362045, 10.417849756777287], [19.53204907476902, 52.43900045752525, 11.381950229406357], [-43.890148401260376, 70.75800001621246, 10.770649649202824], [-42.126599699258804, 70.60550153255463, 10.358350351452827], [-42.075298726558685, 71.48600369691849, 10.314449667930603], [-45.68810015916824, 71.05500251054764, 10.6137003749609], [-46.397700905799866, 71.9899982213974, 10.97320020198822], [-47.4899485707283, 72.71450012922287, 10.660500265657902], [-43.978650122880936, 72.15899974107742, 10.859699919819832], [-46.23369872570038, 73.60850274562836, 10.32514963299036], [-47.9903481900692, 73.53699952363968, 10.36909967660904], [6.849899888038635, 28.851550072431564, 10.889600031077862], [33.42460095882416, 30.223049223423004, 10.772350244224072], [3.565100021660328, 31.124049797654152, 11.392449960112572], [22.200750187039375, 31.672198325395584, 10.427850298583508], [22.192100062966347, 33.06810185313225, 10.387849994003773], [-15.231600031256676, 35.491250455379486, 10.933750309050083], [-15.818299725651741, 37.58670017123222, 10.376700200140476], [-33.052798360586166, 37.57869824767113, 10.436699725687504], [-19.984500482678413, 41.3411483168602, 10.412599891424179], [37.7373993396759, 41.659899055957794, 10.765199549496174], [-22.145850583910942, 42.97855123877525, 10.371849872171879], [33.727049827575684, 43.36410015821457, 10.495349764823914], [-26.317249983549118, 43.84180158376694, 10.19969955086708], [-23.786699399352074, 43.37120056152344, 10.382150299847126], [-25.59575065970421, 43.32264885306358, 10.302900336682796], [35.585299134254456, 43.474700301885605, 10.647949762642384], [-10.85629966109991, 26.646599173545837, 11.238549835979939], [25.686349719762802, 29.413100332021713, 11.044450104236603], [-10.79500000923872, 32.075848430395126, 11.486000381410122], [23.513099178671837, 33.50840136408806, 10.945250280201435], [-33.02524983882904, 35.35924851894379, 11.133099906146526], [-31.689651310443878, 37.49625012278557, 10.830800049006939], [-25.77825076878071, 41.53285175561905, 10.377899743616581], [22.35184982419014, 41.032999753952026, 10.545849800109863], [-21.73049934208393, 41.49625077843666, 10.581700131297112], [-24.268750101327896, 28.262650594115257, 11.408699676394463], [29.568549245595932, 29.61600013077259, 11.309499852359295], [35.741351544857025, 33.6184985935688, 11.624550446867943], [25.624999776482582, 35.7016995549202, 11.250750161707401], [-17.57040061056614, 37.41789981722832, 10.750150308012962], [-25.830300524830818, 39.86325114965439, 11.127149686217308], [-23.448999971151352, 39.71315175294876, 11.196250095963478], [-19.746700301766396, 39.45145010948181, 10.69945003837347], [-23.61690066754818, 41.482001543045044, 10.546100325882435], [23.47555011510849, 31.65154904127121, 11.020299978554249], [-32.07385167479515, 36.271948367357254, 11.32120005786419], [-17.132800072431564, 36.29095107316971, 11.33320014923811], [37.637751549482346, 37.5976487994194, 11.417699977755547], [-19.49935033917427, 37.99809888005257, 11.016850359737873], [-21.703200414776802, 39.421550929546356, 10.879050008952618], [33.47019851207733, 41.82254895567894, 11.191049590706825], [-15.762200579047203, 29.415499418973923, 11.691349558532238], [2.6125051081180573, 27.999799698591232, 11.595649644732475], [4.525864962488413, 28.47214974462986, 11.317649856209755], [12.888049706816673, 29.65415082871914, 10.983300395309925], [27.605699375271797, 29.868299141526222, 11.530599556863308], [-17.685800790786743, 31.161349266767502, 11.799849569797516], [10.906550101935863, 29.584599658846855, 11.196400038897991], [33.676598221063614, 31.560849398374557, 11.719699949026108], [15.138199552893639, 31.78124874830246, 11.275799944996834], [14.870749786496162, 33.539701253175735, 11.575000360608101], [-20.655399188399315, 38.62705081701279, 11.00664958357811], [37.867750972509384, 39.454199373722076, 11.194249615073204], [16.52894914150238, 41.69154912233353, 11.790250428020954], [35.69389879703522, 41.72369837760925, 11.253399774432182], [18.471650779247284, 50.84399878978729, 11.258600279688835], [-32.67564997076988, 28.28509919345379, 11.509899981319904], [15.211050398647785, 29.66335043311119, 11.770550161600113], [29.401250183582306, 37.67390176653862, 11.937799863517284], [31.656350940465927, 39.548251777887344, 11.826200410723686], [1.549944980069995, 27.759749442338943, 11.814000084996223], [-6.711150053888559, 29.71399948000908, 11.91094983369112], [1.813409966416657, 28.922950848937035, 11.805850081145763], [-20.3660000115633, 32.71085023880005, 11.686650104820728], [25.82719922065735, 33.73654931783676, 11.849399656057358], [35.41044890880585, 39.46154937148094, 11.805149726569653], [25.68650059401989, 31.5590500831604, 11.866950429975986], [27.264650911092758, 35.81659868359566, 11.907549574971199], [31.642399728298187, 31.02869912981987, 11.961800046265125], [-10.937349870800972, 27.576399967074394, 12.697749771177769], [-31.707100570201874, 27.09849923849106, 13.131000101566315], [-25.612149387598038, 26.893800124526024, 13.041299767792225], [-9.100150316953659, 27.576550841331482, 12.736950069665909], [-12.879200279712677, 28.128400444984436, 12.460749596357346], [16.235850751399994, 28.050949797034264, 12.41500023752451], [17.610250040888786, 27.86255069077015, 13.181050308048725], [-7.6939500868320465, 28.17239984869957, 12.492399662733078], [-32.918449491262436, 28.15534919500351, 12.825150042772293], [3.5807699896395206, 28.362000361084938, 12.265150435268879], [-14.651150442659855, 29.89809960126877, 12.570199556648731], [17.373450100421906, 28.981899842619896, 12.856650166213512], [6.701500155031681, 29.541000723838806, 12.660300359129906], [-33.51619839668274, 29.648950323462486, 12.87390012294054], [-23.23709987103939, 29.291599988937378, 13.003449887037277], [3.342630108818412, 29.5004490762949, 12.501150369644165], [29.56395037472248, 31.21880069375038, 12.189200147986412], [27.525700628757477, 31.065650284290314, 12.054850347340107], [-17.088400200009346, 31.944449990987778, 12.650299817323685], [5.0999498926103115, 31.43249824643135, 12.73105014115572], [-22.801849991083145, 31.49370104074478, 12.599550187587738], [-13.300999999046326, 31.635049730539322, 12.764650397002697], [-19.421599805355072, 33.5380993783474, 12.831750325858593], [-13.419250026345253, 33.08055177330971, 12.279699556529522], [-33.60695019364357, 33.55570137500763, 13.280300423502922], [-14.50629997998476, 34.05994921922684, 12.211100198328495], [15.870800241827965, 35.65710037946701, 12.608549557626247], [36.03535145521164, 35.69624945521355, 12.090199626982212], [17.632149159908295, 35.58905050158501, 12.778449803590775], [-16.20654948055744, 35.146549344062805, 12.418350204825401], [-31.685151159763336, 36.263901740312576, 13.257450424134731], [19.04514990746975, 36.23965010046959, 12.647300027310848], [-17.500149086117744, 35.53225100040436, 12.925799936056137], [-19.42959986627102, 37.38820180296898, 12.908799573779106], [15.844149515032768, 37.3789481818676, 12.758499942719936], [20.27050033211708, 37.21015155315399, 12.217950075864792], [-29.441699385643005, 37.44170069694519, 12.82070018351078], [-20.885199308395386, 38.15995156764984, 13.515099883079529], [35.878900438547134, 37.9147008061409, 12.09929957985878], [21.27154916524887, 39.64649885892868, 13.268150389194489], [-21.938350051641464, 39.09220173954964, 12.673900462687016], [-27.13165059685707, 39.09344971179962, 12.291950173676014], [-25.72380006313324, 39.33269903063774, 12.765450403094292], [-23.608649149537086, 39.46070000529289, 13.194450177252293], [16.05604961514473, 39.49195146560669, 12.447649613022804], [33.77484902739525, 39.92345184087753, 11.96265034377575], [22.737199440598488, 41.48295149207115, 12.65565026551485], [17.25585013628006, 43.61509904265404, 13.2788997143507], [23.503100499510765, 43.81579905748367, 13.084550388157368], [17.642449587583542, 45.69635167717934, 12.950349599123001], [23.539949208498, 45.84775120019913, 13.528900220990181], [18.32914911210537, 47.06655070185661, 12.333150021731853], [23.492850363254547, 48.06619882583618, 13.065500184893608], [18.841100856661797, 48.45989868044853, 13.162749819457531], [18.799850717186928, 48.97645115852356, 12.167350389063358], [19.547199830412865, 50.344500690698624, 13.238750398159027], [22.97765016555786, 49.925848841667175, 12.677700258791447], [21.72189950942993, 50.29600113630295, 13.318650424480438], [19.800549373030663, 51.616501063108444, 12.78155017644167], [21.065449342131615, 51.62449926137924, 12.567349709570408], [4.515084903687239, 28.50000001490116, 12.345249764621258], [-9.508250281214714, 31.111599877476692, 12.375649996101856], [27.43469923734665, 32.11599960923195, 12.320799753069878], [33.057551831007004, 32.19529986381531, 12.273349799215794], [-33.859848976135254, 31.80449828505516, 12.954900041222572], [35.03134846687317, 35.482801496982574, 12.437200173735619], [30.017200857400894, 37.087298929691315, 12.266700156033039], [20.60849964618683, 37.922948598861694, 12.535599991679192], [34.09985080361366, 37.9238985478878, 12.20215018838644], [17.13315024971962, 41.89525172114372, 13.020150363445282], [4.903994966298342, 29.266150668263435, 13.005300424993038], [-7.387950085103512, 29.048899188637733, 12.417900376021862], [16.167299821972847, 29.242200776934624, 12.570150196552277], [-11.319049634039402, 31.084099784493446, 12.536000460386276], [6.520349998027086, 31.0737993568182, 12.576700188219547], [31.74544870853424, 32.120801508426666, 12.512749992311], [27.556899935007095, 33.550649881362915, 12.456449680030346], [33.556099981069565, 33.59004855155945, 12.542850337922573], [-15.410000458359718, 33.43785181641579, 12.9015501588583], [28.051000088453293, 35.033199936151505, 12.411399744451046], [29.5647494494915, 35.5152003467083, 12.60245032608509], [33.393800258636475, 37.40755096077919, 12.408250011503696], [35.093650221824646, 37.12014853954315, 12.356899678707123], [31.665001064538956, 37.59504854679108, 12.474450282752514], [-27.835549786686897, 38.12975063920021, 13.333650305867195], [33.10929983854294, 38.94584998488426, 12.263149954378605], [-29.573999345302582, 26.656949892640114, 13.024999760091305], [-8.950349874794483, 29.346000403165817, 12.769949622452259], [29.589949175715446, 32.05300122499466, 12.488549575209618], [-21.28555066883564, 33.62970054149628, 13.231749646365643], [19.348150119185448, 37.57144883275032, 13.285799883306026], [33.473748713731766, 35.579849034547806, 12.597950175404549], [-12.993499636650085, 29.4367503374815, 12.817099690437317], [-17.756300047039986, 33.472251147031784, 13.085500337183475], [29.620299115777016, 33.59305113554001, 12.700200080871582], [31.736601144075394, 33.55659916996956, 12.661599554121494], [31.700100749731064, 35.52054986357689, 12.703750282526016], [-24.001799523830414, 27.918849140405655, 13.500549830496311], [-11.17394957691431, 29.639149084687233, 12.823649682104588], [-15.357100404798985, 31.769998371601105, 12.904349714517593], [-22.302549332380295, 31.722400337457657, 13.362349942326546], [-32.98730030655861, 35.04065051674843, 13.268900103867054], [17.27999933063984, 37.869200110435486, 13.743449933826923], [17.05924980342388, 39.35224935412407, 13.782699592411518], [21.99755050241947, 41.463349014520645, 13.830049894750118], [-27.624299749732018, 26.685550808906555, 13.472500257194042], [-19.757350906729698, 35.675499588251114, 13.73239979147911], [-30.98195046186447, 36.75445169210434, 13.523650355637074], [-22.267799824476242, 29.365599155426025, 13.830849900841713], [-32.855648547410965, 27.823850512504578, 14.807149767875671], [-23.68899993598461, 27.652699500322342, 15.377599745988846], [-33.29269960522652, 29.62544932961464, 15.163999982178211], [-33.59375149011612, 31.653448939323425, 14.989599585533142], [-21.693849936127663, 33.52399915456772, 15.673749148845673], [-20.811699330806732, 35.11429950594902, 13.841049745678902], [-21.726850420236588, 35.47929972410202, 15.165899880230427], [-29.49419990181923, 37.14204952120781, 15.102200210094452], [-27.36560069024563, 38.20804879069328, 15.29925037175417], [-21.7531006783247, 37.50229999423027, 14.762749895453453], [-25.243550539016724, 39.00665044784546, 14.30600043386221], [19.858049228787422, 39.3713004887104, 14.124250039458275], [17.86714978516102, 41.4666011929512, 14.842449687421322], [18.22975091636181, 45.0003482401371, 14.382200315594673], [19.73564922809601, 47.58309945464134, 14.909200370311737], [22.06280082464218, 48.768799751996994, 13.975599780678749], [-29.639700427651405, 26.903999969363213, 15.132100321352482], [-20.973749458789825, 31.478401273489, 15.227200463414192], [-26.202650740742683, 38.72520104050636, 14.225100167095661], [-23.72319996356964, 39.007849991321564, 14.77145031094551], [-27.71889977157116, 26.990700513124466, 15.528449788689613], [-31.937148422002792, 27.597250416874886, 15.615650452673435], [-20.78630030155182, 29.383499175310135, 15.147649683058262], [-22.082500159740448, 38.89574855566025, 14.35954961925745], [21.691499277949333, 43.88070106506348, 14.925099909305573], [21.658899262547493, 47.963451594114304, 14.54865001142025], [-33.11324864625931, 33.59460085630417, 15.395550057291985], [-32.83974900841713, 34.81154888868332, 14.74430039525032], [-31.738299876451492, 35.6503501534462, 15.40450006723404], [17.95784942805767, 39.82369974255562, 14.519150368869305], [18.093600869178772, 43.3526486158371, 14.746850356459618], [19.477449357509613, 45.72505131363869, 15.083099715411663], [20.210599526762962, 49.41390082240105, 14.5474998280406], [19.38435062766075, 39.927348494529724, 14.521749690175056], [21.369799971580505, 42.32440143823624, 14.749599620699883], [22.497400641441345, 43.859999626874924, 14.486050233244896], [-21.704599261283875, 28.11945043504238, 15.491100028157234], [19.89939995110035, 41.69460013508797, 15.003199689090252], [22.485749796032906, 45.429348945617676, 14.638449996709824], [-25.600450113415718, 27.4097491055727, 15.904400497674942], [-23.50115031003952, 37.80265152454376, 15.577149577438831], [-25.425000116229057, 38.33030164241791, 15.617149882018566], [19.200049340724945, 44.05039921402931, 15.371249988675117], [21.50925062596798, 46.29484936594963, 15.062999911606312], [-30.54329939186573, 36.45525127649307, 15.979349613189697], [-23.152999579906464, 35.847701132297516, 16.02949947118759], [-29.934650287032127, 27.892300859093666, 16.89774915575981], [-20.35689912736416, 30.065299943089485, 16.3317508995533], [-21.800050511956215, 31.307749450206757, 16.680650413036346], [-32.304998487234116, 33.51230174303055, 17.32725091278553], [-30.111100524663925, 36.699648946523666, 16.366049647331238], [-27.596749365329742, 37.6182496547699, 17.613649368286133], [-25.82710050046444, 37.50165179371834, 16.83804951608181], [-32.82960131764412, 31.769901514053345, 16.658799722790718], [-31.199950724840164, 28.184799477458, 16.7386494576931], [-23.00715073943138, 28.23909930884838, 16.626499593257904], [-21.89360000193119, 28.133399784564972, 16.84975065290928], [-31.681399792432785, 29.6439491212368, 17.34350062906742], [-23.538649082183838, 29.418399557471275, 16.85974933207035], [-23.64405058324337, 31.61894902586937, 16.76120050251484], [-23.724300786852837, 33.699050545692444, 16.363700851798058], [-23.190150037407875, 33.038001507520676, 16.31684973835945], [-23.98969978094101, 35.02510115504265, 16.334200277924538], [-31.76869824528694, 35.67875176668167, 17.450349405407906], [-25.848399847745895, 28.095100075006485, 16.909200698137283], [-25.578200817108154, 35.523299127817154, 16.923049464821815], [-25.604700669646263, 33.65970030426979, 17.452050000429153], [-27.552999556064606, 28.13754975795746, 17.426349222660065], [-25.721849873661995, 29.57024984061718, 17.726950347423553], [-21.37329988181591, 29.50740046799183, 17.157400026917458], [-32.14164823293686, 31.504951417446136, 17.74965040385723], [-29.45614978671074, 37.30374947190285, 17.62544922530651], [-31.11100010573864, 36.9565486907959, 17.745450139045715], [-25.450449436903, 31.813248991966248, 17.91970059275627], [-27.285749092698097, 35.42134910821915, 17.913199961185455], [-29.54079955816269, 29.141299426555634, 18.106399103999138], [-27.482949197292328, 28.881000354886055, 18.02385039627552], [-27.265800163149834, 34.023549407720566, 18.1791502982378], [-29.636399820446968, 30.118349939584732, 18.52164976298809], [-26.187200099229813, 31.107550486922264, 18.37324909865856], [-27.75520086288452, 33.35845097899437, 18.514899536967278], [-28.05590070784092, 35.98380088806152, 18.5100007802248], [-27.632199227809906, 30.123800039291382, 18.55980046093464], [-29.61055003106594, 31.546801328659058, 18.74914951622486], [-27.69709937274456, 31.660500913858414, 18.737349659204483], [-31.35579824447632, 32.275550067424774, 18.66910047829151], [-31.591400504112244, 33.663149923086166, 19.408099353313446], [-29.57965061068535, 33.601898699998856, 19.09469999372959], [-31.22889995574951, 36.909300833940506, 19.63149942457676], [-29.99899908900261, 36.92544996738434, 19.509749487042427], [-29.56094965338707, 35.58560088276863, 19.806750118732452], [-31.78989887237549, 35.649850964546204, 19.6773000061512], [-31.335800886154175, 36.05709969997406, 20.413100719451904]], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/meshes/teapot.ts b/bindings/wgpu/webgpu-samples-ts/meshes/teapot.ts new file mode 100644 index 00000000..fae33188 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/meshes/teapot.ts @@ -0,0 +1,11 @@ +import teapotData from 'teapot'; +import {computeSurfaceNormals} from './utils'; + +export const mesh = { + positions: teapotData.positions as [number, number, number][], + triangles: teapotData.cells as [number, number, number][], + normals: [] as [number, number, number][], +}; + +// Compute surface normals +mesh.normals = computeSurfaceNormals(mesh.positions, mesh.triangles); diff --git a/bindings/wgpu/webgpu-samples-ts/meshes/utils.ts b/bindings/wgpu/webgpu-samples-ts/meshes/utils.ts new file mode 100644 index 00000000..a0f3b97a --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/meshes/utils.ts @@ -0,0 +1,70 @@ +import {vec3} from 'wgpu-matrix'; + +export function computeSurfaceNormals( + positions: [number, number, number][], + triangles: [number, number, number][] +): [number, number, number][] { + const normals: [number, number, number][] = positions.map(() => { + // Initialize to zero. + return [0, 0, 0]; + }); + triangles.forEach(([i0, i1, i2]) => { + const p0 = positions[i0]; + const p1 = positions[i1]; + const p2 = positions[i2]; + + const v0 = vec3.subtract(p1, p0); + const v1 = vec3.subtract(p2, p0); + + vec3.normalize(v0, v0); + vec3.normalize(v1, v1); + const norm = vec3.cross(v0, v1); + + // Accumulate the normals. + vec3.add(normals[i0], norm, normals[i0]); + vec3.add(normals[i1], norm, normals[i1]); + vec3.add(normals[i2], norm, normals[i2]); + }); + normals.forEach((n) => { + // Normalize accumulated normals. + vec3.normalize(n, n); + }); + + return normals; +} + +type ProjectedPlane = 'xy' | 'xz' | 'yz'; + +const projectedPlane2Ids: { [key in ProjectedPlane]: [number, number] } = { + xy: [0, 1], + xz: [0, 2], + yz: [1, 2], +}; + +export function computeProjectedPlaneUVs( + positions: [number, number, number][], + projectedPlane: ProjectedPlane = 'xy' +): [number, number][] { + const idxs = projectedPlane2Ids[projectedPlane]; + const uvs: [number, number][] = positions.map(() => { + // Initialize to zero. + return [0, 0]; + }); + const extentMin = [Infinity, Infinity]; + const extentMax = [-Infinity, -Infinity]; + positions.forEach((pos, i) => { + // Simply project to the selected plane + uvs[i][0] = pos[idxs[0]]; + uvs[i][1] = pos[idxs[1]]; + + extentMin[0] = Math.min(pos[idxs[0]], extentMin[0]); + extentMin[1] = Math.min(pos[idxs[1]], extentMin[1]); + extentMax[0] = Math.max(pos[idxs[0]], extentMax[0]); + extentMax[1] = Math.max(pos[idxs[1]], extentMax[1]); + }); + uvs.forEach((uv) => { + uv[0] = (uv[0] - extentMin[0]) / (extentMax[0] - extentMin[0]); + uv[1] = (uv[1] - extentMin[1]) / (extentMax[1] - extentMin[1]); + }); + return uvs; +} diff --git a/bindings/wgpu/webgpu-samples-ts/other/korlibs.d.ts b/bindings/wgpu/webgpu-samples-ts/other/korlibs.d.ts new file mode 100644 index 00000000..23a4d11b --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/other/korlibs.d.ts @@ -0,0 +1,20 @@ +export declare namespace korlibs.math.geom { + class Matrix4 { + constructor(); + + static get Companion(): { + get dummy(): string; + }; + } + + class Angle { + + get radians(): Number; + + static get Companion(): { + fromRadians(radians: Number): Angle + } + } +} + +export as namespace korlibs_math_geom; \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/package-lock.json b/bindings/wgpu/webgpu-samples-ts/package-lock.json new file mode 100644 index 00000000..3faa59c9 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/package-lock.json @@ -0,0 +1,4298 @@ +{ + "name": "webgpu-samples", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "webgpu-samples", + "version": "0.1.0", + "license": "BSD-3-Clause", + "dependencies": { + "@codemirror/lang-javascript": "^6.2.2", + "@codemirror/view": "^6.25.0", + "@uiw/codemirror-theme-monokai": "^4.21.24", + "codemirror": "^6.0.1", + "dat.gui": "^0.7.6", + "showdown": "^2.1.0", + "stats.js": "github:mrdoob/stats.js#b235d9c", + "teapot": "^1.0.0", + "wgpu-matrix": "^2.5.0" + }, + "devDependencies": { + "@babel/runtime": "^7.24.0", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-typescript": "^11.1.6", + "@tsconfig/recommended": "^1.0.3", + "@types/dat.gui": "^0.7.12", + "@types/showdown": "^2.0.6", + "@types/stats.js": "^0.17.3", + "@typescript-eslint/eslint-plugin": "^7.1.1", + "@webgpu/types": "^0.1.40", + "chokidar": "^3.6.0", + "eslint": "^8.26.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-html": "^8.0.0", + "eslint-plugin-prettier": "^4.2.1", + "glob": "^10.3.10", + "prettier": "^2.7.1", + "rollup": "^4.12.0", + "rollup-plugin-copy": "^3.5.0", + "servez": "^2.1.3", + "tslib": "^2.6.2", + "typescript": "^5.3.3" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.0.tgz", + "integrity": "sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@codemirror/autocomplete": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.13.0.tgz", + "integrity": "sha512-SuDrho1klTINfbcMPnyro1ZxU9xJtwDMtb62R8TjL/tOl71IoOsvBo1a9x+hDvHhIzkTcJHy2VC+rmpGgYkRSw==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0" + }, + "peerDependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/commands": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.3.3.tgz", + "integrity": "sha512-dO4hcF0fGT9tu1Pj1D2PvGvxjeGkbC6RGcZw6Qs74TH+Ed1gw98jmUgd2axWvIZEqTeTuFrg1lEB1KV6cK9h1A==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.4.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.1.0" + } + }, + "node_modules/@codemirror/lang-javascript": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.2.tgz", + "integrity": "sha512-VGQfY+FCc285AhWuwjYxQyUQcYurWlxdKYT4bqwr3Twnd5wP5WSeu52t4tvvuWmljT4EmgEgZCqSieokhtY8hg==", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.6.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0", + "@lezer/javascript": "^1.0.0" + } + }, + "node_modules/@codemirror/language": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.1.tgz", + "integrity": "sha512-5GrXzrhq6k+gL5fjkAwt90nYDmjlzTIJV8THnxNFtNKWotMIlzzN+CpqxqwXOECnUdOndmSeWntVrVcv5axWRQ==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.23.0", + "@lezer/common": "^1.1.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "node_modules/@codemirror/lint": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.5.0.tgz", + "integrity": "sha512-+5YyicIaaAZKU8K43IQi8TBy6mF6giGeWAH7N96Z5LC30Wm5JMjqxOYIE9mxwMG1NbhT2mA3l9hA4uuKUM3E5g==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/search": { + "version": "6.5.6", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.6.tgz", + "integrity": "sha512-rpMgcsh7o0GuCDUXKPvww+muLA1pDJaFrpq/CCHtpQJYz8xopu4D1hPcKRoDD0YlF8gZaqTNIRa4VRBWyhyy7Q==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/state": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.4.1.tgz", + "integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==" + }, + "node_modules/@codemirror/view": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.25.0.tgz", + "integrity": "sha512-XnMGOm6qXB8znzCko0N7k97qZayVdvqpA0JebxA5fHtgBjC/XlCPhH9TK92TahsoCKMPQlaTCUep06Dwj/+GXQ==", + "dependencies": { + "@codemirror/state": "^6.4.0", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@lezer/common": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.1.tgz", + "integrity": "sha512-yemX0ZD2xS/73llMZIK6KplkjIjf2EvAHcinDi/TfJ9hS25G0388+ClHt6/3but0oOxinTcQHJLDXh6w1crzFQ==" + }, + "node_modules/@lezer/highlight": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.0.tgz", + "integrity": "sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@lezer/javascript": { + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.13.tgz", + "integrity": "sha512-5IBr8LIO3xJdJH1e9aj/ZNLE4LSbdsx25wFmGRAZsj2zSmwAYjx26JyU/BYOCpRQlu1jcv1z3vy4NB9+UkfRow==", + "dependencies": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.1.3", + "@lezer/lr": "^1.3.0" + } + }, + "node_modules/@lezer/lr": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.0.tgz", + "integrity": "sha512-Wst46p51km8gH0ZUmeNrtpRYmdlRHUpN1DQd3GFAyKANi8WVz8c2jHYTf1CVScFaCjQw1iO3ZZdqGDxQPRErTg==", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@rollup/plugin-commonjs": { + "version": "25.0.7", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-25.0.7.tgz", + "integrity": "sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "glob": "^8.0.3", + "is-reference": "1.2.1", + "magic-string": "^0.30.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "15.2.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz", + "integrity": "sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-builtin-module": "^3.2.1", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-typescript": { + "version": "11.1.6", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.6.tgz", + "integrity": "sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0||^4.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", + "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", + "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", + "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", + "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", + "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", + "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", + "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", + "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", + "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", + "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", + "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", + "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", + "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@tsconfig/recommended": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/recommended/-/recommended-1.0.3.tgz", + "integrity": "sha512-+jby/Guq9H8O7NWgCv6X8VAiQE8Dr/nccsCtL74xyHKhu2Knu5EAKmOZj3nLCnLm1KooUzKY+5DsnGVqhM8/wQ==", + "dev": true + }, + "node_modules/@types/dat.gui": { + "version": "0.7.12", + "resolved": "https://registry.npmjs.org/@types/dat.gui/-/dat.gui-0.7.12.tgz", + "integrity": "sha512-el5dYeQZu2r6YW6Ft4rGtjr/dLe/uzXESMoie5UM6/weVShB1V8IRpXtTKrczd4qe7044fTKZS2l8d6EBFOkoA==", + "dev": true + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "node_modules/@types/fs-extra": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-8.1.5.tgz", + "integrity": "sha512-0dzKcwO+S8s2kuF5Z9oUWatQJj5Uq/iqphEtE3GQJVRRYm/tD1LglU2UnXi2A8jLq5umkGouOXOR9y0n613ZwQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-forge": { + "version": "1.3.11", + "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.11.tgz", + "integrity": "sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", + "dev": true + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, + "node_modules/@types/showdown": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/showdown/-/showdown-2.0.6.tgz", + "integrity": "sha512-pTvD/0CIeqe4x23+YJWlX2gArHa8G0J0Oh6GKaVXV7TAeickpkkZiNOgFcFcmLQ5lB/K0qBJL1FtRYltBfbGCQ==", + "dev": true + }, + "node_modules/@types/stats.js": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.3.tgz", + "integrity": "sha512-pXNfAD3KHOdif9EQXZ9deK82HVNaXP5ZIF5RP2QG6OQFNTaY2YIetfrE9t528vEreGQvEPRDDc8muaoYeK0SxQ==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.1.tgz", + "integrity": "sha512-zioDz623d0RHNhvx0eesUmGfIjzrk18nSBC8xewepKXbBvN/7c1qImV7Hg8TI1URTxKax7/zxfxj3Uph8Chcuw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/type-utils": "7.1.1", + "@typescript-eslint/utils": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.1.tgz", + "integrity": "sha512-ZWUFyL0z04R1nAEgr9e79YtV5LbafdOtN7yapNbn1ansMyaegl2D4bL7vHoJ4HPSc4CaLwuCVas8CVuneKzplQ==", + "dev": true, + "peer": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/typescript-estree": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.1.tgz", + "integrity": "sha512-cirZpA8bJMRb4WZ+rO6+mnOJrGFDd38WoXCEI57+CYBqta8Yc8aJym2i7vyqLL1vVYljgw0X27axkUXz32T8TA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.1.tgz", + "integrity": "sha512-5r4RKze6XHEEhlZnJtR3GYeCh1IueUHdbrukV2KSlLXaTjuSfeVF8mZUVPLovidCuZfbVjfhi4c0DNSa/Rdg5g==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.1.1", + "@typescript-eslint/utils": "7.1.1", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.1.tgz", + "integrity": "sha512-KhewzrlRMrgeKm1U9bh2z5aoL4s7K3tK5DwHDn8MHv0yQfWFz/0ZR6trrIHHa5CsF83j/GgHqzdbzCXJ3crx0Q==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.1.tgz", + "integrity": "sha512-9ZOncVSfr+sMXVxxca2OJOPagRwT0u/UHikM2Rd6L/aB+kL/QAuTnsv6MeXtjzCJYb8PzrXarypSGIPx3Jemxw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/visitor-keys": "7.1.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.1.tgz", + "integrity": "sha512-thOXM89xA03xAE0lW7alstvnyoBUbBX38YtY+zAUcpRPcq9EIhXPuJ0YTv948MbzmKh6e1AUszn5cBFK49Umqg==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.1.1", + "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/typescript-estree": "7.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.1.tgz", + "integrity": "sha512-yTdHDQxY7cSoCcAtiBzVzxleJhkGB9NncSIyMYe2+OGON1ZsP9zOPws/Pqgopa65jvknOjlk/w7ulPlZ78PiLQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.1.1", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@uiw/codemirror-theme-monokai": { + "version": "4.21.24", + "resolved": "https://registry.npmjs.org/@uiw/codemirror-theme-monokai/-/codemirror-theme-monokai-4.21.24.tgz", + "integrity": "sha512-p4iKNyS6QOSg3SYi/T5CDep3gFaRE3wSw46ryMX5dpOHzd/wzgxHewRSb3NoGtBzfcynZIxVfEdUBTwG3FRtPQ==", + "dependencies": { + "@uiw/codemirror-themes": "4.21.24" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + } + }, + "node_modules/@uiw/codemirror-themes": { + "version": "4.21.24", + "resolved": "https://registry.npmjs.org/@uiw/codemirror-themes/-/codemirror-themes-4.21.24.tgz", + "integrity": "sha512-InY24KWP8YArDBACWHKFZ6ZU+WCvRHf3ZB2cCVxMVN35P1ANUmRzpAP2ernZQ5OIriL1/A/kXgD0Zg3Y65PNgg==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@codemirror/language": ">=6.0.0", + "@codemirror/state": ">=6.0.0", + "@codemirror/view": ">=6.0.0" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/@webgpu/types": { + "version": "0.1.40", + "resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.40.tgz", + "integrity": "sha512-/BBkHLS6/eQjyWhY2H7Dx5DHcVrS2ICj9owvSRdgtQT6KcafLZA86tPze0xAOsd4FbsYKCUBUQyNi87q7gV7kw==", + "dev": true + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dev": true, + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==", + "dev": true + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/colorette": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==", + "dev": true + }, + "node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dev": true, + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-disposition/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "dev": true + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "dev": true, + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/dat.gui": { + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/dat.gui/-/dat.gui-0.7.9.tgz", + "integrity": "sha512-sCNc1OHobc+Erc1HqiswYgHdVNpSJUlk/Hz8vzOCsER7rl+oF/4+v8GXFUyCgtXpoCX6+bnmg07DedLvBLwYKQ==" + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "dev": true, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "dev": true + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-prettier": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", + "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-plugin-html": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-8.0.0.tgz", + "integrity": "sha512-NINLBAXM3mLa3k5Ezr/kNLHAJJwbot6lS7Ro+SUftDw4cA51KMmcDuCf98GP6Q6kTVPY1hIggzskxAdxfUPXSA==", + "dev": true, + "dependencies": { + "htmlparser2": "^9.1.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/eslint-plugin-prettier": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "eslint": ">=7.28.0", + "prettier": ">=2.0.0" + }, + "peerDependenciesMeta": { + "eslint-config-prettier": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.18.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.3.tgz", + "integrity": "sha512-6VyCijWQ+9O7WuVMTRBTl+cjNNIzD5cY5mQ1WM8r/LEkI2u8EYpOotESNwzNlyCn3g+dmjKYI6BmNneSr/FSRw==", + "dev": true, + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.5.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/express/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", + "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", + "dev": true, + "dependencies": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/globby/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/globby/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globby/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/htmlparser2": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", + "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.1.0", + "entities": "^4.5.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-builtin-module": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "dev": true, + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", + "dev": true + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-object": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.1.tgz", + "integrity": "sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "dev": true, + "engines": { + "node": "14 || >=16.14" + } + }, + "node_modules/magic-string": { + "version": "0.30.8", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.8.tgz", + "integrity": "sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "dev": true, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "dev": true, + "engines": { + "node": ">= 6.13.0" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-scurry": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", + "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "dev": true, + "dependencies": { + "lru-cache": "^9.1.1 || ^10.0.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/rollup": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", + "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.12.0", + "@rollup/rollup-android-arm64": "4.12.0", + "@rollup/rollup-darwin-arm64": "4.12.0", + "@rollup/rollup-darwin-x64": "4.12.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", + "@rollup/rollup-linux-arm64-gnu": "4.12.0", + "@rollup/rollup-linux-arm64-musl": "4.12.0", + "@rollup/rollup-linux-riscv64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-gnu": "4.12.0", + "@rollup/rollup-linux-x64-musl": "4.12.0", + "@rollup/rollup-win32-arm64-msvc": "4.12.0", + "@rollup/rollup-win32-ia32-msvc": "4.12.0", + "@rollup/rollup-win32-x64-msvc": "4.12.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/rollup-plugin-copy": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-copy/-/rollup-plugin-copy-3.5.0.tgz", + "integrity": "sha512-wI8D5dvYovRMx/YYKtUNt3Yxaw4ORC9xo6Gt9t22kveWz1enG9QrhVlagzwrxSC455xD1dHMKhIJkbsQ7d48BA==", + "dev": true, + "dependencies": { + "@types/fs-extra": "^8.0.1", + "colorette": "^1.1.0", + "fs-extra": "^8.1.0", + "globby": "10.0.1", + "is-plain-object": "^3.0.0" + }, + "engines": { + "node": ">=8.3" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/secure-compare": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz", + "integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==", + "dev": true + }, + "node_modules/selfsigned": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.4.1.tgz", + "integrity": "sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==", + "dev": true, + "dependencies": { + "@types/node-forge": "^1.3.0", + "node-forge": "^1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==", + "dev": true, + "dependencies": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-index/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/serve-index/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-index/node_modules/http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-index/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "dev": true + }, + "node_modules/serve-index/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/serve-index/node_modules/setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "node_modules/serve-index/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "dev": true, + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/server-destroy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", + "integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==", + "dev": true + }, + "node_modules/servez": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/servez/-/servez-2.1.3.tgz", + "integrity": "sha512-VZwm7alwXfyMem6VREfJ6ii5qv0+9Q5XaaLVMXk4xC+VT/1y5fJc6SB1QWNDxhZBI9pd+cbwI7OhtcHPC2G6Hw==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1", + "color-support": "^1.1.3", + "commander": "^11.0.0", + "servez-lib": "^2.8.2" + }, + "bin": { + "servez": "bin/servez" + } + }, + "node_modules/servez-lib": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/servez-lib/-/servez-lib-2.8.2.tgz", + "integrity": "sha512-HIjtK+RGHm6TcL8Ll4xW8cyRnyGRwJzDT6uUMU1wwvl2FVJgR2SJCeTyy7vp2fEDzZPW64uF/GQlDGQeQeXPeA==", + "dev": true, + "dependencies": { + "basic-auth": "^2.0.1", + "cors": "^2.8.5", + "debug": "^4.3.4", + "express": "^4.18.2", + "secure-compare": "^3.0.1", + "selfsigned": "^2.1.1", + "serve-index": "^1.9.1", + "server-destroy": "^1.0.1" + } + }, + "node_modules/set-function-length": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/showdown": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/showdown/-/showdown-2.1.0.tgz", + "integrity": "sha512-/6NVYu4U819R2pUIk79n67SYgJHWCce0a5xTP979WbNp0FL9MN1I1QK662IDU1b6JzKTvmhgI7T7JYIxBi3kMQ==", + "dependencies": { + "commander": "^9.0.0" + }, + "bin": { + "showdown": "bin/showdown.js" + }, + "funding": { + "type": "individual", + "url": "https://www.paypal.me/tiviesantos" + } + }, + "node_modules/showdown/node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stats.js": { + "version": "0.17.0", + "resolved": "git+ssh://git@github.com/mrdoob/stats.js.git#b235d9c1e9c90c95b59d69bba53565c65bb2f694", + "license": "MIT" + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/style-mod": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", + "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==" + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/teapot": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/teapot/-/teapot-1.0.0.tgz", + "integrity": "sha512-tjFLPnJ5Dre9kIJaXcKG0VDufbsQwGVZrrGOCG4qStmXPjOySFJpmTE98ZW19LHddSQvjcC6VGVluVSR8Wc/eQ==" + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/ts-api-utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.2.1.tgz", + "integrity": "sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==" + }, + "node_modules/wgpu-matrix": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/wgpu-matrix/-/wgpu-matrix-2.5.1.tgz", + "integrity": "sha512-fEKK2Hm3JW0KEko2CdrKEg4d81KBKU8UXGhX0kb//3s0A1MrXFG37jzCbvuRdx0XtBs0923oFvSjevwNI5G4Eg==" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/package.json b/bindings/wgpu/webgpu-samples-ts/package.json new file mode 100644 index 00000000..9b780591 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/package.json @@ -0,0 +1,58 @@ +{ + "name": "webgpu-samples", + "version": "0.1.0", + "description": "Samples using the WebGPU API", + "license": "BSD-3-Clause", + "private": false, + "type": "module", + "repository": { + "type": "git", + "url": "https://github.com/webgpu/webgpu-samples.git" + }, + "scripts": { + "gradle": "../gradlew :webgpu-samples-ts:jsBrowserDevelopmentWebpack", + "lint": "eslint --ext .ts,.js,.html src/ sample/ build/ .eslintrc.cjs rollup.config.js index.html", + "fix": "eslint --fix --ext .ts,.js,.html src/ sample/ build/ .eslintrc.cjs rollup.config.js index.html", + "build": "node build-scripts/tools/build.js", + "start": "npm run gradle && node build-scripts/tools/serve.js", + "serve": "node build-scripts/tools/serve.js", + "server": "servez out", + "watch": "rollup -c -w", + "export": "npm run build" + }, + "dependencies": { + "@codemirror/lang-javascript": "^6.2.2", + "@codemirror/view": "^6.25.0", + "@uiw/codemirror-theme-monokai": "^4.21.24", + "codemirror": "^6.0.1", + "dat.gui": "^0.7.6", + "showdown": "^2.1.0", + "stats.js": "github:mrdoob/stats.js#b235d9c", + "teapot": "^1.0.0", + "wgpu-matrix": "^2.5.0" + }, + "devDependencies": { + "@babel/runtime": "^7.24.0", + "@rollup/plugin-commonjs": "^25.0.7", + "@rollup/plugin-node-resolve": "^15.2.3", + "@rollup/plugin-typescript": "^11.1.6", + "@tsconfig/recommended": "^1.0.3", + "@types/dat.gui": "^0.7.12", + "@types/showdown": "^2.0.6", + "@types/stats.js": "^0.17.3", + "@typescript-eslint/eslint-plugin": "^7.1.1", + "@webgpu/types": "^0.1.40", + "chokidar": "^3.6.0", + "eslint": "^8.26.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-html": "^8.0.0", + "eslint-plugin-prettier": "^4.2.1", + "glob": "^10.3.10", + "prettier": "^2.7.1", + "rollup": "^4.12.0", + "rollup-plugin-copy": "^3.5.0", + "servez": "^2.1.3", + "tslib": "^2.6.2", + "typescript": "^5.3.3" + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/font/ya-hei-ascii-msdf.json b/bindings/wgpu/webgpu-samples-ts/public/assets/font/ya-hei-ascii-msdf.json new file mode 100644 index 00000000..19ec37ac --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/public/assets/font/ya-hei-ascii-msdf.json @@ -0,0 +1,3407 @@ +{ + "pages": [ + "ya-hei-ascii.png" + ], + "chars": [ + { + "id": 124, + "index": 98, + "char": "|", + "width": 8, + "height": 49, + "xoffset": 2, + "yoffset": 1, + "xadvance": 11, + "chnl": 15, + "x": 0, + "y": 0, + "page": 0 + }, + { + "id": 106, + "index": 80, + "char": "j", + "width": 16, + "height": 48, + "xoffset": -6, + "yoffset": 3, + "xadvance": 11, + "chnl": 15, + "x": 0, + "y": 50, + "page": 0 + }, + { + "id": 87, + "index": 61, + "char": "W", + "width": 46, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 43, + "chnl": 15, + "x": 9, + "y": 0, + "page": 0 + }, + { + "id": 81, + "index": 55, + "char": "Q", + "width": 35, + "height": 45, + "xoffset": 0, + "yoffset": 4, + "xadvance": 34, + "chnl": 15, + "x": 0, + "y": 99, + "page": 0 + }, + { + "id": 36, + "index": 10, + "char": "$", + "width": 22, + "height": 44, + "xoffset": 1, + "yoffset": 0, + "xadvance": 25, + "chnl": 15, + "x": 17, + "y": 37, + "page": 0 + }, + { + "id": 40, + "index": 14, + "char": "(", + "width": 14, + "height": 43, + "xoffset": 1, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 145, + "page": 0 + }, + { + "id": 41, + "index": 15, + "char": ")", + "width": 15, + "height": 43, + "xoffset": -2, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 189, + "page": 0 + }, + { + "id": 91, + "index": 65, + "char": "[", + "width": 12, + "height": 43, + "xoffset": 2, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 15, + "y": 145, + "page": 0 + }, + { + "id": 93, + "index": 67, + "char": "]", + "width": 12, + "height": 43, + "xoffset": -1, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 233, + "page": 0 + }, + { + "id": 123, + "index": 97, + "char": "{", + "width": 15, + "height": 43, + "xoffset": 0, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 0, + "y": 277, + "page": 0 + }, + { + "id": 125, + "index": 99, + "char": "}", + "width": 15, + "height": 43, + "xoffset": -1, + "yoffset": 4, + "xadvance": 14, + "chnl": 15, + "x": 13, + "y": 233, + "page": 0 + }, + { + "id": 47, + "index": 21, + "char": "/", + "width": 23, + "height": 41, + "xoffset": -3, + "yoffset": 4, + "xadvance": 18, + "chnl": 15, + "x": 16, + "y": 189, + "page": 0 + }, + { + "id": 92, + "index": 66, + "char": "\\", + "width": 23, + "height": 41, + "xoffset": -3, + "yoffset": 4, + "xadvance": 17, + "chnl": 15, + "x": 28, + "y": 145, + "page": 0 + }, + { + "id": 12385, + "index": 28668, + "char": "ち", + "width": 33, + "height": 41, + "xoffset": 3, + "yoffset": 2, + "xadvance": 42, + "chnl": 15, + "x": 36, + "y": 82, + "page": 0 + }, + { + "id": 64, + "index": 38, + "char": "@", + "width": 40, + "height": 40, + "xoffset": 2, + "yoffset": 4, + "xadvance": 43, + "chnl": 15, + "x": 40, + "y": 37, + "page": 0 + }, + { + "id": 12435, + "index": 28718, + "char": "ん", + "width": 39, + "height": 38, + "xoffset": 1, + "yoffset": 3, + "xadvance": 42, + "chnl": 15, + "x": 0, + "y": 321, + "page": 0 + }, + { + "id": 37, + "index": 11, + "char": "%", + "width": 38, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 37, + "chnl": 15, + "x": 16, + "y": 277, + "page": 0 + }, + { + "id": 98, + "index": 72, + "char": "b", + "width": 25, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 27, + "chnl": 15, + "x": 29, + "y": 231, + "page": 0 + }, + { + "id": 100, + "index": 74, + "char": "d", + "width": 25, + "height": 38, + "xoffset": 0, + "yoffset": 2, + "xadvance": 27, + "chnl": 15, + "x": 40, + "y": 187, + "page": 0 + }, + { + "id": 102, + "index": 76, + "char": "f", + "width": 18, + "height": 38, + "xoffset": -1, + "yoffset": 2, + "xadvance": 15, + "chnl": 15, + "x": 52, + "y": 124, + "page": 0 + }, + { + "id": 103, + "index": 77, + "char": "g", + "width": 25, + "height": 38, + "xoffset": 0, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 70, + "y": 78, + "page": 0 + }, + { + "id": 104, + "index": 78, + "char": "h", + "width": 23, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 26, + "chnl": 15, + "x": 81, + "y": 0, + "page": 0 + }, + { + "id": 107, + "index": 81, + "char": "k", + "width": 23, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 23, + "chnl": 15, + "x": 81, + "y": 39, + "page": 0 + }, + { + "id": 108, + "index": 82, + "char": "l", + "width": 8, + "height": 38, + "xoffset": 2, + "yoffset": 2, + "xadvance": 11, + "chnl": 15, + "x": 0, + "y": 360, + "page": 0 + }, + { + "id": 112, + "index": 86, + "char": "p", + "width": 25, + "height": 38, + "xoffset": 2, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 0, + "y": 399, + "page": 0 + }, + { + "id": 113, + "index": 87, + "char": "q", + "width": 25, + "height": 38, + "xoffset": 0, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 9, + "y": 360, + "page": 0 + }, + { + "id": 12399, + "index": 28682, + "char": "は", + "width": 38, + "height": 38, + "xoffset": 3, + "yoffset": 4, + "xadvance": 42, + "chnl": 15, + "x": 0, + "y": 438, + "page": 0 + }, + { + "id": 38, + "index": 12, + "char": "&", + "width": 37, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 37, + "chnl": 15, + "x": 26, + "y": 399, + "page": 0 + }, + { + "id": 48, + "index": 22, + "char": "0", + "width": 25, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 35, + "y": 360, + "page": 0 + }, + { + "id": 51, + "index": 25, + "char": "3", + "width": 23, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 40, + "y": 315, + "page": 0 + }, + { + "id": 54, + "index": 28, + "char": "6", + "width": 24, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 61, + "y": 353, + "page": 0 + }, + { + "id": 56, + "index": 30, + "char": "8", + "width": 24, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 39, + "y": 437, + "page": 0 + }, + { + "id": 57, + "index": 31, + "char": "9", + "width": 24, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 39, + "y": 475, + "page": 0 + }, + { + "id": 63, + "index": 37, + "char": "?", + "width": 19, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 20, + "chnl": 15, + "x": 55, + "y": 226, + "page": 0 + }, + { + "id": 67, + "index": 41, + "char": "C", + "width": 28, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 28, + "chnl": 15, + "x": 55, + "y": 264, + "page": 0 + }, + { + "id": 71, + "index": 45, + "char": "G", + "width": 30, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 31, + "chnl": 15, + "x": 64, + "y": 302, + "page": 0 + }, + { + "id": 77, + "index": 51, + "char": "M", + "width": 37, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 41, + "chnl": 15, + "x": 66, + "y": 163, + "page": 0 + }, + { + "id": 79, + "index": 53, + "char": "O", + "width": 34, + "height": 37, + "xoffset": 0, + "yoffset": 4, + "xadvance": 34, + "chnl": 15, + "x": 71, + "y": 117, + "page": 0 + }, + { + "id": 83, + "index": 57, + "char": "S", + "width": 24, + "height": 37, + "xoffset": 1, + "yoffset": 4, + "xadvance": 24, + "chnl": 15, + "x": 96, + "y": 78, + "page": 0 + }, + { + "id": 105, + "index": 79, + "char": "i", + "width": 9, + "height": 37, + "xoffset": 1, + "yoffset": 3, + "xadvance": 11, + "chnl": 15, + "x": 75, + "y": 200, + "page": 0 + }, + { + "id": 109, + "index": 83, + "char": "m", + "width": 37, + "height": 27, + "xoffset": 2, + "yoffset": 13, + "xadvance": 39, + "chnl": 15, + "x": 0, + "y": 477, + "page": 0 + }, + { + "id": 121, + "index": 95, + "char": "y", + "width": 26, + "height": 37, + "xoffset": -2, + "yoffset": 13, + "xadvance": 22, + "chnl": 15, + "x": 84, + "y": 238, + "page": 0 + }, + { + "id": 12395, + "index": 28678, + "char": "に", + "width": 37, + "height": 37, + "xoffset": 3, + "yoffset": 4, + "xadvance": 42, + "chnl": 15, + "x": 85, + "y": 200, + "page": 0 + }, + { + "id": 33, + "index": 7, + "char": "!", + "width": 9, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 13, + "chnl": 15, + "x": 56, + "y": 0, + "page": 0 + }, + { + "id": 49, + "index": 23, + "char": "1", + "width": 22, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 104, + "y": 155, + "page": 0 + }, + { + "id": 50, + "index": 24, + "char": "2", + "width": 24, + "height": 36, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 106, + "y": 116, + "page": 0 + }, + { + "id": 52, + "index": 26, + "char": "4", + "width": 27, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 105, + "y": 0, + "page": 0 + }, + { + "id": 53, + "index": 27, + "char": "5", + "width": 22, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 105, + "y": 37, + "page": 0 + }, + { + "id": 55, + "index": 29, + "char": "7", + "width": 25, + "height": 36, + "xoffset": 0, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 121, + "y": 74, + "page": 0 + }, + { + "id": 65, + "index": 39, + "char": "A", + "width": 33, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 30, + "chnl": 15, + "x": 128, + "y": 37, + "page": 0 + }, + { + "id": 66, + "index": 40, + "char": "B", + "width": 24, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 26, + "chnl": 15, + "x": 133, + "y": 0, + "page": 0 + }, + { + "id": 68, + "index": 42, + "char": "D", + "width": 30, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 32, + "chnl": 15, + "x": 158, + "y": 0, + "page": 0 + }, + { + "id": 69, + "index": 43, + "char": "E", + "width": 21, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 23, + "chnl": 15, + "x": 64, + "y": 391, + "page": 0 + }, + { + "id": 70, + "index": 44, + "char": "F", + "width": 20, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 22, + "chnl": 15, + "x": 64, + "y": 428, + "page": 0 + }, + { + "id": 72, + "index": 46, + "char": "H", + "width": 28, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 32, + "chnl": 15, + "x": 64, + "y": 465, + "page": 0 + }, + { + "id": 73, + "index": 47, + "char": "I", + "width": 14, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 12, + "chnl": 15, + "x": 66, + "y": 0, + "page": 0 + }, + { + "id": 74, + "index": 48, + "char": "J", + "width": 16, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 17, + "chnl": 15, + "x": 85, + "y": 428, + "page": 0 + }, + { + "id": 75, + "index": 49, + "char": "K", + "width": 27, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 93, + "y": 465, + "page": 0 + }, + { + "id": 76, + "index": 50, + "char": "L", + "width": 21, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 22, + "chnl": 15, + "x": 86, + "y": 340, + "page": 0 + }, + { + "id": 78, + "index": 52, + "char": "N", + "width": 30, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 34, + "chnl": 15, + "x": 86, + "y": 377, + "page": 0 + }, + { + "id": 80, + "index": 54, + "char": "P", + "width": 24, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 26, + "chnl": 15, + "x": 102, + "y": 414, + "page": 0 + }, + { + "id": 82, + "index": 56, + "char": "R", + "width": 27, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 121, + "y": 451, + "page": 0 + }, + { + "id": 84, + "index": 58, + "char": "T", + "width": 26, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 24, + "chnl": 15, + "x": 95, + "y": 276, + "page": 0 + }, + { + "id": 85, + "index": 59, + "char": "U", + "width": 28, + "height": 36, + "xoffset": 2, + "yoffset": 4, + "xadvance": 31, + "chnl": 15, + "x": 111, + "y": 238, + "page": 0 + }, + { + "id": 86, + "index": 60, + "char": "V", + "width": 32, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 28, + "chnl": 15, + "x": 123, + "y": 192, + "page": 0 + }, + { + "id": 88, + "index": 62, + "char": "X", + "width": 30, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 127, + "y": 153, + "page": 0 + }, + { + "id": 89, + "index": 63, + "char": "Y", + "width": 29, + "height": 36, + "xoffset": -2, + "yoffset": 4, + "xadvance": 25, + "chnl": 15, + "x": 131, + "y": 111, + "page": 0 + }, + { + "id": 90, + "index": 64, + "char": "Z", + "width": 28, + "height": 36, + "xoffset": -1, + "yoffset": 4, + "xadvance": 26, + "chnl": 15, + "x": 147, + "y": 74, + "page": 0 + }, + { + "id": 119, + "index": 93, + "char": "w", + "width": 36, + "height": 27, + "xoffset": -1, + "yoffset": 13, + "xadvance": 33, + "chnl": 15, + "x": 162, + "y": 37, + "page": 0 + }, + { + "id": 116, + "index": 90, + "char": "t", + "width": 18, + "height": 34, + "xoffset": -1, + "yoffset": 7, + "xadvance": 16, + "chnl": 15, + "x": 189, + "y": 0, + "page": 0 + }, + { + "id": 35, + "index": 9, + "char": "#", + "width": 29, + "height": 33, + "xoffset": -1, + "yoffset": 4, + "xadvance": 27, + "chnl": 15, + "x": 108, + "y": 313, + "page": 0 + }, + { + "id": 59, + "index": 33, + "char": ";", + "width": 11, + "height": 33, + "xoffset": -1, + "yoffset": 13, + "xadvance": 10, + "chnl": 15, + "x": 122, + "y": 275, + "page": 0 + }, + { + "id": 12371, + "index": 28654, + "char": "こ", + "width": 32, + "height": 31, + "xoffset": 5, + "yoffset": 8, + "xadvance": 42, + "chnl": 15, + "x": 134, + "y": 275, + "page": 0 + }, + { + "id": 58, + "index": 32, + "char": ":", + "width": 9, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 10, + "chnl": 15, + "x": 108, + "y": 347, + "page": 0 + }, + { + "id": 97, + "index": 71, + "char": "a", + "width": 22, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 23, + "chnl": 15, + "x": 117, + "y": 376, + "page": 0 + }, + { + "id": 99, + "index": 73, + "char": "c", + "width": 21, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 21, + "chnl": 15, + "x": 118, + "y": 347, + "page": 0 + }, + { + "id": 101, + "index": 75, + "char": "e", + "width": 24, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 24, + "chnl": 15, + "x": 138, + "y": 307, + "page": 0 + }, + { + "id": 111, + "index": 85, + "char": "o", + "width": 27, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 27, + "chnl": 15, + "x": 140, + "y": 229, + "page": 0 + }, + { + "id": 115, + "index": 89, + "char": "s", + "width": 19, + "height": 28, + "xoffset": 0, + "yoffset": 13, + "xadvance": 19, + "chnl": 15, + "x": 156, + "y": 190, + "page": 0 + }, + { + "id": 110, + "index": 84, + "char": "n", + "width": 23, + "height": 27, + "xoffset": 2, + "yoffset": 13, + "xadvance": 26, + "chnl": 15, + "x": 158, + "y": 148, + "page": 0 + }, + { + "id": 114, + "index": 88, + "char": "r", + "width": 16, + "height": 27, + "xoffset": 2, + "yoffset": 13, + "xadvance": 16, + "chnl": 15, + "x": 161, + "y": 111, + "page": 0 + }, + { + "id": 117, + "index": 91, + "char": "u", + "width": 23, + "height": 27, + "xoffset": 1, + "yoffset": 13, + "xadvance": 26, + "chnl": 15, + "x": 127, + "y": 405, + "page": 0 + }, + { + "id": 118, + "index": 92, + "char": "v", + "width": 26, + "height": 27, + "xoffset": -2, + "yoffset": 13, + "xadvance": 22, + "chnl": 15, + "x": 176, + "y": 65, + "page": 0 + }, + { + "id": 120, + "index": 94, + "char": "x", + "width": 24, + "height": 27, + "xoffset": -1, + "yoffset": 13, + "xadvance": 21, + "chnl": 15, + "x": 199, + "y": 35, + "page": 0 + }, + { + "id": 122, + "index": 96, + "char": "z", + "width": 23, + "height": 27, + "xoffset": -1, + "yoffset": 13, + "xadvance": 21, + "chnl": 15, + "x": 208, + "y": 0, + "page": 0 + }, + { + "id": 60, + "index": 34, + "char": "<", + "width": 23, + "height": 26, + "xoffset": 4, + "yoffset": 12, + "xadvance": 31, + "chnl": 15, + "x": 178, + "y": 93, + "page": 0 + }, + { + "id": 62, + "index": 36, + "char": ">", + "width": 23, + "height": 26, + "xoffset": 4, + "yoffset": 12, + "xadvance": 31, + "chnl": 15, + "x": 178, + "y": 120, + "page": 0 + }, + { + "id": 126, + "index": 100, + "char": "~", + "width": 26, + "height": 11, + "xoffset": 3, + "yoffset": 19, + "xadvance": 31, + "chnl": 15, + "x": 158, + "y": 176, + "page": 0 + }, + { + "id": 43, + "index": 17, + "char": "+", + "width": 25, + "height": 25, + "xoffset": 3, + "yoffset": 12, + "xadvance": 31, + "chnl": 15, + "x": 182, + "y": 147, + "page": 0 + }, + { + "id": 61, + "index": 35, + "char": "=", + "width": 25, + "height": 17, + "xoffset": 3, + "yoffset": 17, + "xadvance": 31, + "chnl": 15, + "x": 127, + "y": 433, + "page": 0 + }, + { + "id": 94, + "index": 68, + "char": "^", + "width": 25, + "height": 23, + "xoffset": 3, + "yoffset": 4, + "xadvance": 31, + "chnl": 15, + "x": 121, + "y": 488, + "page": 0 + }, + { + "id": 95, + "index": 69, + "char": "_", + "width": 23, + "height": 7, + "xoffset": -2, + "yoffset": 40, + "xadvance": 19, + "chnl": 15, + "x": 0, + "y": 505, + "page": 0 + }, + { + "id": 42, + "index": 16, + "char": "*", + "width": 20, + "height": 20, + "xoffset": 0, + "yoffset": 4, + "xadvance": 19, + "chnl": 15, + "x": 147, + "y": 488, + "page": 0 + }, + { + "id": 45, + "index": 19, + "char": "-", + "width": 16, + "height": 7, + "xoffset": 1, + "yoffset": 22, + "xadvance": 18, + "chnl": 15, + "x": 71, + "y": 155, + "page": 0 + }, + { + "id": 44, + "index": 18, + "char": ",", + "width": 10, + "height": 15, + "xoffset": -1, + "yoffset": 31, + "xadvance": 10, + "chnl": 15, + "x": 84, + "y": 276, + "page": 0 + }, + { + "id": 34, + "index": 8, + "char": "\"", + "width": 14, + "height": 14, + "xoffset": 2, + "yoffset": 4, + "xadvance": 18, + "chnl": 15, + "x": 36, + "y": 124, + "page": 0 + }, + { + "id": 39, + "index": 13, + "char": "'", + "width": 8, + "height": 14, + "xoffset": 1, + "yoffset": 4, + "xadvance": 11, + "chnl": 15, + "x": 66, + "y": 200, + "page": 0 + }, + { + "id": 96, + "index": 70, + "char": "`", + "width": 13, + "height": 11, + "xoffset": 0, + "yoffset": 2, + "xadvance": 12, + "chnl": 15, + "x": 52, + "y": 163, + "page": 0 + }, + { + "id": 46, + "index": 20, + "char": ".", + "width": 9, + "height": 9, + "xoffset": 0, + "yoffset": 31, + "xadvance": 10, + "chnl": 15, + "x": 156, + "y": 219, + "page": 0 + }, + { + "id": 32, + "index": 3, + "char": " ", + "width": 0, + "height": 0, + "xoffset": -2, + "yoffset": 36, + "xadvance": 12, + "chnl": 15, + "x": 26, + "y": 437, + "page": 0 + } + ], + "info": { + "face": "ya-hei-ascii", + "size": 42, + "bold": 0, + "italic": 0, + "charset": [ + " ", + "!", + "\"", + "#", + "$", + "%", + "&", + "'", + "(", + ")", + "*", + "+", + ",", + "-", + ".", + "/", + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + ":", + ";", + "<", + "=", + ">", + "?", + "@", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "[", + "\\", + "]", + "^", + "_", + "`", + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h", + "i", + "j", + "k", + "l", + "m", + "n", + "o", + "p", + "q", + "r", + "s", + "t", + "u", + "v", + "w", + "x", + "y", + "z", + "{", + "|", + "}", + "~", + "こ", + "ん", + "に", + "ち", + "は" + ], + "unicode": 1, + "stretchH": 100, + "smooth": 1, + "aa": 1, + "padding": [ + 2, + 2, + 2, + 2 + ], + "spacing": [ + 0, + 0 + ] + }, + "common": { + "lineHeight": 45, + "base": 36, + "scaleW": 512, + "scaleH": 512, + "pages": 1, + "packed": 0, + "alphaChnl": 0, + "redChnl": 0, + "greenChnl": 0, + "blueChnl": 0 + }, + "distanceField": { + "fieldType": "msdf", + "distanceRange": 4 + }, + "kernings": [ + { + "first": 34, + "second": 114, + "amount": -1 + }, + { + "first": 34, + "second": 115, + "amount": -1 + }, + { + "first": 39, + "second": 114, + "amount": -1 + }, + { + "first": 39, + "second": 115, + "amount": -1 + }, + { + "first": 40, + "second": 106, + "amount": 5 + }, + { + "first": 42, + "second": 65, + "amount": -4 + }, + { + "first": 42, + "second": 74, + "amount": -3 + }, + { + "first": 42, + "second": 99, + "amount": -2 + }, + { + "first": 42, + "second": 100, + "amount": -2 + }, + { + "first": 42, + "second": 101, + "amount": -2 + }, + { + "first": 42, + "second": 103, + "amount": -2 + }, + { + "first": 42, + "second": 111, + "amount": -2 + }, + { + "first": 42, + "second": 113, + "amount": -2 + }, + { + "first": 65, + "second": 42, + "amount": -3 + }, + { + "first": 65, + "second": 44, + "amount": 1 + }, + { + "first": 65, + "second": 59, + "amount": 1 + }, + { + "first": 65, + "second": 67, + "amount": -1 + }, + { + "first": 65, + "second": 71, + "amount": -1 + }, + { + "first": 65, + "second": 74, + "amount": 2 + }, + { + "first": 65, + "second": 79, + "amount": -1 + }, + { + "first": 65, + "second": 84, + "amount": -3 + }, + { + "first": 65, + "second": 85, + "amount": -1 + }, + { + "first": 65, + "second": 86, + "amount": -3 + }, + { + "first": 65, + "second": 87, + "amount": -2 + }, + { + "first": 65, + "second": 89, + "amount": -3 + }, + { + "first": 65, + "second": 90, + "amount": 1 + }, + { + "first": 65, + "second": 116, + "amount": -1 + }, + { + "first": 65, + "second": 118, + "amount": -1 + }, + { + "first": 65, + "second": 119, + "amount": -1 + }, + { + "first": 65, + "second": 121, + "amount": -1 + }, + { + "first": 66, + "second": 84, + "amount": -2 + }, + { + "first": 66, + "second": 89, + "amount": -1 + }, + { + "first": 67, + "second": 63, + "amount": 0 + }, + { + "first": 67, + "second": 67, + "amount": -1 + }, + { + "first": 67, + "second": 71, + "amount": -1 + }, + { + "first": 67, + "second": 79, + "amount": -1 + }, + { + "first": 67, + "second": 81, + "amount": -1 + }, + { + "first": 68, + "second": 44, + "amount": -3 + }, + { + "first": 68, + "second": 46, + "amount": -3 + }, + { + "first": 68, + "second": 65, + "amount": -1 + }, + { + "first": 68, + "second": 84, + "amount": -2 + }, + { + "first": 68, + "second": 88, + "amount": -1 + }, + { + "first": 68, + "second": 90, + "amount": -1 + }, + { + "first": 69, + "second": 65, + "amount": 0 + }, + { + "first": 69, + "second": 74, + "amount": 1 + }, + { + "first": 69, + "second": 84, + "amount": 0 + }, + { + "first": 69, + "second": 87, + "amount": 1 + }, + { + "first": 69, + "second": 88, + "amount": 0 + }, + { + "first": 70, + "second": 44, + "amount": -3 + }, + { + "first": 70, + "second": 46, + "amount": -3 + }, + { + "first": 70, + "second": 65, + "amount": -3 + }, + { + "first": 70, + "second": 74, + "amount": -1 + }, + { + "first": 70, + "second": 83, + "amount": -1 + }, + { + "first": 70, + "second": 84, + "amount": 0 + }, + { + "first": 70, + "second": 97, + "amount": -2 + }, + { + "first": 70, + "second": 102, + "amount": 0 + }, + { + "first": 71, + "second": 84, + "amount": -1 + }, + { + "first": 71, + "second": 86, + "amount": -1 + }, + { + "first": 71, + "second": 121, + "amount": -1 + }, + { + "first": 74, + "second": 44, + "amount": -2 + }, + { + "first": 74, + "second": 46, + "amount": -2 + }, + { + "first": 74, + "second": 65, + "amount": -1 + }, + { + "first": 74, + "second": 74, + "amount": -1 + }, + { + "first": 74, + "second": 97, + "amount": -1 + }, + { + "first": 75, + "second": 44, + "amount": 1 + }, + { + "first": 75, + "second": 59, + "amount": 1 + }, + { + "first": 75, + "second": 67, + "amount": -2 + }, + { + "first": 75, + "second": 71, + "amount": -2 + }, + { + "first": 75, + "second": 74, + "amount": 2 + }, + { + "first": 75, + "second": 79, + "amount": -2 + }, + { + "first": 75, + "second": 81, + "amount": -2 + }, + { + "first": 75, + "second": 88, + "amount": 1 + }, + { + "first": 75, + "second": 90, + "amount": 1 + }, + { + "first": 75, + "second": 99, + "amount": -1 + }, + { + "first": 75, + "second": 100, + "amount": -1 + }, + { + "first": 75, + "second": 101, + "amount": -1 + }, + { + "first": 75, + "second": 103, + "amount": -1 + }, + { + "first": 75, + "second": 111, + "amount": -1 + }, + { + "first": 75, + "second": 113, + "amount": -1 + }, + { + "first": 75, + "second": 116, + "amount": -1 + }, + { + "first": 75, + "second": 118, + "amount": -2 + }, + { + "first": 75, + "second": 119, + "amount": -1 + }, + { + "first": 75, + "second": 121, + "amount": -2 + }, + { + "first": 76, + "second": 42, + "amount": -5 + }, + { + "first": 76, + "second": 63, + "amount": -2 + }, + { + "first": 76, + "second": 65, + "amount": 1 + }, + { + "first": 76, + "second": 67, + "amount": -1 + }, + { + "first": 76, + "second": 71, + "amount": -1 + }, + { + "first": 76, + "second": 74, + "amount": 2 + }, + { + "first": 76, + "second": 79, + "amount": -2 + }, + { + "first": 76, + "second": 81, + "amount": -2 + }, + { + "first": 76, + "second": 84, + "amount": -3 + }, + { + "first": 76, + "second": 85, + "amount": -1 + }, + { + "first": 76, + "second": 86, + "amount": -3 + }, + { + "first": 76, + "second": 87, + "amount": -1 + }, + { + "first": 76, + "second": 89, + "amount": -3 + }, + { + "first": 76, + "second": 90, + "amount": 1 + }, + { + "first": 76, + "second": 116, + "amount": -1 + }, + { + "first": 76, + "second": 118, + "amount": -2 + }, + { + "first": 76, + "second": 119, + "amount": -1 + }, + { + "first": 76, + "second": 121, + "amount": -2 + }, + { + "first": 79, + "second": 44, + "amount": -2 + }, + { + "first": 79, + "second": 46, + "amount": -2 + }, + { + "first": 79, + "second": 65, + "amount": -1 + }, + { + "first": 79, + "second": 74, + "amount": 0 + }, + { + "first": 79, + "second": 84, + "amount": -2 + }, + { + "first": 79, + "second": 88, + "amount": -1 + }, + { + "first": 79, + "second": 89, + "amount": -1 + }, + { + "first": 79, + "second": 90, + "amount": -1 + }, + { + "first": 80, + "second": 44, + "amount": -7 + }, + { + "first": 80, + "second": 46, + "amount": -7 + }, + { + "first": 80, + "second": 65, + "amount": -4 + }, + { + "first": 80, + "second": 71, + "amount": 0 + }, + { + "first": 80, + "second": 74, + "amount": -3 + }, + { + "first": 80, + "second": 87, + "amount": 1 + }, + { + "first": 80, + "second": 88, + "amount": -1 + }, + { + "first": 80, + "second": 97, + "amount": -1 + }, + { + "first": 80, + "second": 99, + "amount": -2 + }, + { + "first": 80, + "second": 100, + "amount": -2 + }, + { + "first": 80, + "second": 101, + "amount": -2 + }, + { + "first": 80, + "second": 103, + "amount": -2 + }, + { + "first": 80, + "second": 111, + "amount": -2 + }, + { + "first": 80, + "second": 113, + "amount": -2 + }, + { + "first": 81, + "second": 44, + "amount": -2 + }, + { + "first": 81, + "second": 46, + "amount": -3 + }, + { + "first": 81, + "second": 65, + "amount": -1 + }, + { + "first": 81, + "second": 84, + "amount": -2 + }, + { + "first": 81, + "second": 88, + "amount": -1 + }, + { + "first": 81, + "second": 89, + "amount": 0 + }, + { + "first": 81, + "second": 90, + "amount": -1 + }, + { + "first": 82, + "second": 59, + "amount": 2 + }, + { + "first": 82, + "second": 67, + "amount": -1 + }, + { + "first": 82, + "second": 71, + "amount": -1 + }, + { + "first": 82, + "second": 74, + "amount": 1 + }, + { + "first": 82, + "second": 79, + "amount": 0 + }, + { + "first": 82, + "second": 81, + "amount": 0 + }, + { + "first": 82, + "second": 84, + "amount": -1 + }, + { + "first": 82, + "second": 89, + "amount": -1 + }, + { + "first": 82, + "second": 99, + "amount": -1 + }, + { + "first": 82, + "second": 100, + "amount": -1 + }, + { + "first": 82, + "second": 101, + "amount": -1 + }, + { + "first": 82, + "second": 103, + "amount": -1 + }, + { + "first": 82, + "second": 111, + "amount": -1 + }, + { + "first": 82, + "second": 113, + "amount": -1 + }, + { + "first": 83, + "second": 116, + "amount": -1 + }, + { + "first": 83, + "second": 118, + "amount": -1 + }, + { + "first": 83, + "second": 119, + "amount": -1 + }, + { + "first": 83, + "second": 121, + "amount": -1 + }, + { + "first": 84, + "second": 44, + "amount": -3 + }, + { + "first": 84, + "second": 46, + "amount": -4 + }, + { + "first": 84, + "second": 58, + "amount": -1 + }, + { + "first": 84, + "second": 59, + "amount": -1 + }, + { + "first": 84, + "second": 65, + "amount": -3 + }, + { + "first": 84, + "second": 67, + "amount": -2 + }, + { + "first": 84, + "second": 71, + "amount": -2 + }, + { + "first": 84, + "second": 74, + "amount": -3 + }, + { + "first": 84, + "second": 79, + "amount": -2 + }, + { + "first": 84, + "second": 81, + "amount": -2 + }, + { + "first": 84, + "second": 84, + "amount": 1 + }, + { + "first": 84, + "second": 86, + "amount": 1 + }, + { + "first": 84, + "second": 87, + "amount": 1 + }, + { + "first": 84, + "second": 88, + "amount": 0 + }, + { + "first": 84, + "second": 89, + "amount": 1 + }, + { + "first": 84, + "second": 97, + "amount": -5 + }, + { + "first": 84, + "second": 99, + "amount": -5 + }, + { + "first": 84, + "second": 100, + "amount": -5 + }, + { + "first": 84, + "second": 101, + "amount": -5 + }, + { + "first": 84, + "second": 102, + "amount": -2 + }, + { + "first": 84, + "second": 103, + "amount": -5 + }, + { + "first": 84, + "second": 109, + "amount": -4 + }, + { + "first": 84, + "second": 110, + "amount": -4 + }, + { + "first": 84, + "second": 111, + "amount": -5 + }, + { + "first": 84, + "second": 112, + "amount": -4 + }, + { + "first": 84, + "second": 113, + "amount": -5 + }, + { + "first": 84, + "second": 114, + "amount": -4 + }, + { + "first": 84, + "second": 115, + "amount": -3 + }, + { + "first": 84, + "second": 117, + "amount": -4 + }, + { + "first": 84, + "second": 118, + "amount": -2 + }, + { + "first": 84, + "second": 119, + "amount": -3 + }, + { + "first": 84, + "second": 120, + "amount": -4 + }, + { + "first": 84, + "second": 121, + "amount": -3 + }, + { + "first": 84, + "second": 122, + "amount": -3 + }, + { + "first": 85, + "second": 65, + "amount": -1 + }, + { + "first": 86, + "second": 44, + "amount": -5 + }, + { + "first": 86, + "second": 46, + "amount": -5 + }, + { + "first": 86, + "second": 65, + "amount": -3 + }, + { + "first": 86, + "second": 67, + "amount": -1 + }, + { + "first": 86, + "second": 71, + "amount": -1 + }, + { + "first": 86, + "second": 74, + "amount": -2 + }, + { + "first": 86, + "second": 79, + "amount": 0 + }, + { + "first": 86, + "second": 81, + "amount": -1 + }, + { + "first": 86, + "second": 83, + "amount": -1 + }, + { + "first": 86, + "second": 84, + "amount": 1 + }, + { + "first": 86, + "second": 97, + "amount": -3 + }, + { + "first": 86, + "second": 99, + "amount": -3 + }, + { + "first": 86, + "second": 100, + "amount": -3 + }, + { + "first": 86, + "second": 101, + "amount": -3 + }, + { + "first": 86, + "second": 103, + "amount": -3 + }, + { + "first": 86, + "second": 109, + "amount": -2 + }, + { + "first": 86, + "second": 110, + "amount": -2 + }, + { + "first": 86, + "second": 111, + "amount": -3 + }, + { + "first": 86, + "second": 112, + "amount": -2 + }, + { + "first": 86, + "second": 113, + "amount": -3 + }, + { + "first": 86, + "second": 114, + "amount": -2 + }, + { + "first": 86, + "second": 115, + "amount": -1 + }, + { + "first": 86, + "second": 117, + "amount": -2 + }, + { + "first": 87, + "second": 44, + "amount": -3 + }, + { + "first": 87, + "second": 46, + "amount": -3 + }, + { + "first": 87, + "second": 65, + "amount": -2 + }, + { + "first": 87, + "second": 84, + "amount": 1 + }, + { + "first": 87, + "second": 97, + "amount": -2 + }, + { + "first": 87, + "second": 99, + "amount": -1 + }, + { + "first": 87, + "second": 100, + "amount": -1 + }, + { + "first": 87, + "second": 101, + "amount": -1 + }, + { + "first": 87, + "second": 103, + "amount": -1 + }, + { + "first": 87, + "second": 111, + "amount": -1 + }, + { + "first": 87, + "second": 113, + "amount": -1 + }, + { + "first": 88, + "second": 44, + "amount": 1 + }, + { + "first": 88, + "second": 46, + "amount": 1 + }, + { + "first": 88, + "second": 59, + "amount": 2 + }, + { + "first": 88, + "second": 67, + "amount": -1 + }, + { + "first": 88, + "second": 71, + "amount": -1 + }, + { + "first": 88, + "second": 74, + "amount": 2 + }, + { + "first": 88, + "second": 79, + "amount": -1 + }, + { + "first": 88, + "second": 81, + "amount": -1 + }, + { + "first": 88, + "second": 84, + "amount": 1 + }, + { + "first": 89, + "second": 44, + "amount": -4 + }, + { + "first": 89, + "second": 46, + "amount": -4 + }, + { + "first": 89, + "second": 65, + "amount": -4 + }, + { + "first": 89, + "second": 67, + "amount": -1 + }, + { + "first": 89, + "second": 71, + "amount": -1 + }, + { + "first": 89, + "second": 74, + "amount": -1 + }, + { + "first": 89, + "second": 79, + "amount": -1 + }, + { + "first": 89, + "second": 81, + "amount": -1 + }, + { + "first": 89, + "second": 83, + "amount": -1 + }, + { + "first": 89, + "second": 84, + "amount": 1 + }, + { + "first": 89, + "second": 97, + "amount": -4 + }, + { + "first": 89, + "second": 99, + "amount": -4 + }, + { + "first": 89, + "second": 100, + "amount": -4 + }, + { + "first": 89, + "second": 101, + "amount": -4 + }, + { + "first": 89, + "second": 102, + "amount": -1 + }, + { + "first": 89, + "second": 103, + "amount": -4 + }, + { + "first": 89, + "second": 109, + "amount": -3 + }, + { + "first": 89, + "second": 110, + "amount": -3 + }, + { + "first": 89, + "second": 111, + "amount": -4 + }, + { + "first": 89, + "second": 112, + "amount": -3 + }, + { + "first": 89, + "second": 113, + "amount": -4 + }, + { + "first": 89, + "second": 114, + "amount": -3 + }, + { + "first": 89, + "second": 115, + "amount": -3 + }, + { + "first": 89, + "second": 117, + "amount": -3 + }, + { + "first": 90, + "second": 74, + "amount": 2 + }, + { + "first": 90, + "second": 84, + "amount": 1 + }, + { + "first": 90, + "second": 121, + "amount": -1 + }, + { + "first": 91, + "second": 106, + "amount": 5 + }, + { + "first": 98, + "second": 97, + "amount": -1 + }, + { + "first": 98, + "second": 102, + "amount": 0 + }, + { + "first": 98, + "second": 120, + "amount": -1 + }, + { + "first": 99, + "second": 74, + "amount": 2 + }, + { + "first": 99, + "second": 84, + "amount": -2 + }, + { + "first": 99, + "second": 89, + "amount": -2 + }, + { + "first": 101, + "second": 34, + "amount": -2 + }, + { + "first": 101, + "second": 39, + "amount": -2 + }, + { + "first": 102, + "second": 41, + "amount": 3 + }, + { + "first": 102, + "second": 44, + "amount": -3 + }, + { + "first": 102, + "second": 45, + "amount": -2 + }, + { + "first": 102, + "second": 46, + "amount": -3 + }, + { + "first": 102, + "second": 58, + "amount": 2 + }, + { + "first": 102, + "second": 59, + "amount": 2 + }, + { + "first": 102, + "second": 63, + "amount": 1 + }, + { + "first": 102, + "second": 93, + "amount": 3 + }, + { + "first": 102, + "second": 98, + "amount": 0 + }, + { + "first": 102, + "second": 104, + "amount": 0 + }, + { + "first": 102, + "second": 116, + "amount": 1 + }, + { + "first": 102, + "second": 118, + "amount": 1 + }, + { + "first": 102, + "second": 119, + "amount": 1 + }, + { + "first": 102, + "second": 120, + "amount": 0 + }, + { + "first": 102, + "second": 121, + "amount": 1 + }, + { + "first": 102, + "second": 125, + "amount": 2 + }, + { + "first": 103, + "second": 106, + "amount": 1 + }, + { + "first": 106, + "second": 106, + "amount": 1 + }, + { + "first": 107, + "second": 44, + "amount": 2 + }, + { + "first": 107, + "second": 45, + "amount": -3 + }, + { + "first": 107, + "second": 46, + "amount": 2 + }, + { + "first": 107, + "second": 58, + "amount": 2 + }, + { + "first": 107, + "second": 59, + "amount": 2 + }, + { + "first": 107, + "second": 99, + "amount": -1 + }, + { + "first": 107, + "second": 100, + "amount": -1 + }, + { + "first": 107, + "second": 101, + "amount": -1 + }, + { + "first": 107, + "second": 103, + "amount": -1 + }, + { + "first": 107, + "second": 111, + "amount": -1 + }, + { + "first": 107, + "second": 113, + "amount": -1 + }, + { + "first": 107, + "second": 116, + "amount": 0 + }, + { + "first": 110, + "second": 34, + "amount": -2 + }, + { + "first": 110, + "second": 39, + "amount": -2 + }, + { + "first": 111, + "second": 34, + "amount": -3 + }, + { + "first": 111, + "second": 39, + "amount": -3 + }, + { + "first": 111, + "second": 97, + "amount": -1 + }, + { + "first": 111, + "second": 102, + "amount": -1 + }, + { + "first": 111, + "second": 120, + "amount": -1 + }, + { + "first": 112, + "second": 97, + "amount": -1 + }, + { + "first": 112, + "second": 102, + "amount": -1 + }, + { + "first": 112, + "second": 120, + "amount": -1 + }, + { + "first": 113, + "second": 106, + "amount": 2 + }, + { + "first": 114, + "second": 44, + "amount": -4 + }, + { + "first": 114, + "second": 45, + "amount": -3 + }, + { + "first": 114, + "second": 46, + "amount": -4 + }, + { + "first": 114, + "second": 58, + "amount": 2 + }, + { + "first": 114, + "second": 59, + "amount": 2 + }, + { + "first": 114, + "second": 99, + "amount": -1 + }, + { + "first": 114, + "second": 100, + "amount": -1 + }, + { + "first": 114, + "second": 101, + "amount": -1 + }, + { + "first": 114, + "second": 102, + "amount": 1 + }, + { + "first": 114, + "second": 103, + "amount": -1 + }, + { + "first": 114, + "second": 109, + "amount": 0 + }, + { + "first": 114, + "second": 110, + "amount": 0 + }, + { + "first": 114, + "second": 111, + "amount": -1 + }, + { + "first": 114, + "second": 113, + "amount": -1 + }, + { + "first": 114, + "second": 115, + "amount": 0 + }, + { + "first": 114, + "second": 116, + "amount": 1 + }, + { + "first": 114, + "second": 118, + "amount": 2 + }, + { + "first": 114, + "second": 119, + "amount": 2 + }, + { + "first": 114, + "second": 120, + "amount": 1 + }, + { + "first": 114, + "second": 121, + "amount": 2 + }, + { + "first": 114, + "second": 122, + "amount": 1 + }, + { + "first": 116, + "second": 45, + "amount": -3 + }, + { + "first": 116, + "second": 63, + "amount": -1 + }, + { + "first": 116, + "second": 99, + "amount": -1 + }, + { + "first": 116, + "second": 100, + "amount": -1 + }, + { + "first": 116, + "second": 101, + "amount": 0 + }, + { + "first": 116, + "second": 103, + "amount": 0 + }, + { + "first": 116, + "second": 111, + "amount": 0 + }, + { + "first": 116, + "second": 113, + "amount": 0 + }, + { + "first": 116, + "second": 120, + "amount": 1 + }, + { + "first": 117, + "second": 34, + "amount": -1 + }, + { + "first": 117, + "second": 39, + "amount": -1 + }, + { + "first": 118, + "second": 44, + "amount": -3 + }, + { + "first": 118, + "second": 46, + "amount": -3 + }, + { + "first": 118, + "second": 97, + "amount": -1 + }, + { + "first": 118, + "second": 99, + "amount": 0 + }, + { + "first": 118, + "second": 100, + "amount": 0 + }, + { + "first": 118, + "second": 101, + "amount": 0 + }, + { + "first": 118, + "second": 103, + "amount": 0 + }, + { + "first": 118, + "second": 111, + "amount": 0 + }, + { + "first": 118, + "second": 113, + "amount": 0 + }, + { + "first": 119, + "second": 44, + "amount": -2 + }, + { + "first": 119, + "second": 46, + "amount": -2 + }, + { + "first": 119, + "second": 99, + "amount": 0 + }, + { + "first": 119, + "second": 100, + "amount": 0 + }, + { + "first": 119, + "second": 101, + "amount": 0 + }, + { + "first": 119, + "second": 103, + "amount": 0 + }, + { + "first": 119, + "second": 111, + "amount": 0 + }, + { + "first": 119, + "second": 113, + "amount": 0 + }, + { + "first": 120, + "second": 99, + "amount": 0 + }, + { + "first": 120, + "second": 100, + "amount": 0 + }, + { + "first": 120, + "second": 101, + "amount": 0 + }, + { + "first": 120, + "second": 103, + "amount": 0 + }, + { + "first": 120, + "second": 111, + "amount": 0 + }, + { + "first": 120, + "second": 113, + "amount": 0 + }, + { + "first": 121, + "second": 34, + "amount": 1 + }, + { + "first": 121, + "second": 39, + "amount": 1 + }, + { + "first": 121, + "second": 44, + "amount": -2 + }, + { + "first": 121, + "second": 46, + "amount": -3 + }, + { + "first": 121, + "second": 63, + "amount": -2 + }, + { + "first": 121, + "second": 99, + "amount": 0 + }, + { + "first": 121, + "second": 100, + "amount": 0 + }, + { + "first": 121, + "second": 101, + "amount": 0 + }, + { + "first": 121, + "second": 102, + "amount": 0 + }, + { + "first": 121, + "second": 103, + "amount": 0 + }, + { + "first": 121, + "second": 111, + "amount": 0 + }, + { + "first": 121, + "second": 113, + "amount": 0 + }, + { + "first": 121, + "second": 116, + "amount": 0 + }, + { + "first": 123, + "second": 106, + "amount": 4 + } + ] +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/font/ya-hei-ascii.png b/bindings/wgpu/webgpu-samples-ts/public/assets/font/ya-hei-ascii.png new file mode 100644 index 00000000..a23980bb Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/font/ya-hei-ascii.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/gltf/whale.glb b/bindings/wgpu/webgpu-samples-ts/public/assets/gltf/whale.glb new file mode 100644 index 00000000..4d361020 Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/gltf/whale.glb differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/Di-3d.png b/bindings/wgpu/webgpu-samples-ts/public/assets/img/Di-3d.png new file mode 100644 index 00000000..ebbff45e Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/Di-3d.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/brickwall_albedo.png b/bindings/wgpu/webgpu-samples-ts/public/assets/img/brickwall_albedo.png new file mode 100644 index 00000000..35835088 Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/brickwall_albedo.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/brickwall_height.png b/bindings/wgpu/webgpu-samples-ts/public/assets/img/brickwall_height.png new file mode 100644 index 00000000..48ab26fa Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/brickwall_height.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/brickwall_normal.png b/bindings/wgpu/webgpu-samples-ts/public/assets/img/brickwall_normal.png new file mode 100644 index 00000000..aa6643de Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/brickwall_normal.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/negx.jpg b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/negx.jpg new file mode 100644 index 00000000..992fde51 Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/negx.jpg differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/negy.jpg b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/negy.jpg new file mode 100644 index 00000000..a51a38dc Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/negy.jpg differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/negz.jpg b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/negz.jpg new file mode 100644 index 00000000..c463f0d5 Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/negz.jpg differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/posx.jpg b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/posx.jpg new file mode 100644 index 00000000..106d3a68 Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/posx.jpg differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/posy.jpg b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/posy.jpg new file mode 100644 index 00000000..1ea42cd2 Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/posy.jpg differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/posz.jpg b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/posz.jpg new file mode 100644 index 00000000..69463d06 Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/posz.jpg differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/readme.txt b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/readme.txt new file mode 100644 index 00000000..0ce9e3d2 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/public/assets/img/cubemap/readme.txt @@ -0,0 +1,20 @@ +Author +====== + +This is the work of Emil Persson, aka Humus. +http://www.humus.name +humus@comhem.se + + + +Legal stuff +=========== + +This work is free and may be used by anyone for any purpose +and may be distributed freely to anyone using any distribution +media or distribution method as long as this file is included. +Distribution without this file is allowed if it's distributed +with free non-commercial software; however, fair credit of the +original author is expected. +Any commercial distribution of this software requires the written +approval of Emil Persson. diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/moon.jpg b/bindings/wgpu/webgpu-samples-ts/public/assets/img/moon.jpg new file mode 100644 index 00000000..daec570b Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/moon.jpg differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/saturn.jpg b/bindings/wgpu/webgpu-samples-ts/public/assets/img/saturn.jpg new file mode 100644 index 00000000..d8b23dfe Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/saturn.jpg differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/spiral_height.png b/bindings/wgpu/webgpu-samples-ts/public/assets/img/spiral_height.png new file mode 100644 index 00000000..1f1680ff Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/spiral_height.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/spiral_normal.png b/bindings/wgpu/webgpu-samples-ts/public/assets/img/spiral_normal.png new file mode 100644 index 00000000..5cba15cf Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/spiral_normal.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/toybox_height.png b/bindings/wgpu/webgpu-samples-ts/public/assets/img/toybox_height.png new file mode 100644 index 00000000..35510d73 Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/toybox_height.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/toybox_normal.png b/bindings/wgpu/webgpu-samples-ts/public/assets/img/toybox_normal.png new file mode 100644 index 00000000..634728fb Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/toybox_normal.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/webgpu.png b/bindings/wgpu/webgpu-samples-ts/public/assets/img/webgpu.png new file mode 100644 index 00000000..a44b73ea Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/webgpu.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/img/wood_albedo.png b/bindings/wgpu/webgpu-samples-ts/public/assets/img/wood_albedo.png new file mode 100644 index 00000000..e28e2aee Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/img/wood_albedo.png differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/assets/video/pano.webm b/bindings/wgpu/webgpu-samples-ts/public/assets/video/pano.webm new file mode 100644 index 00000000..62aa3085 Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/assets/video/pano.webm differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/css/HomePage.css b/bindings/wgpu/webgpu-samples-ts/public/css/HomePage.css new file mode 100644 index 00000000..b7ceb646 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/public/css/HomePage.css @@ -0,0 +1,4 @@ +.homePage { + background: white; + color: #222; +} diff --git a/bindings/wgpu/webgpu-samples-ts/public/css/MainLayout.css b/bindings/wgpu/webgpu-samples-ts/public/css/MainLayout.css new file mode 100644 index 00000000..3e5acc02 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/public/css/MainLayout.css @@ -0,0 +1,94 @@ +.container { + padding-left: 15px; + padding-right: 15px; +} + +.wrapper { + display: flex; + height: 100%; +} + +.panel { + flex: 1 0 auto; + max-width: 300px; + height: 100%; + background: #fafafa; + overflow-y: auto; + position: relative; +} + +.exampleList { + padding: 0; + margin-block-start: 16px; + margin-block-end: 16px; +} + +.exampleList h3 { + color: rgb(43, 126, 171); +} + +.exampleList li { + list-style: none; + padding: 0.3em 0; +} + +.expand { + display: none; + position: absolute; + right: 1em; + top: 1em; + width: 36px; + height: 36px; + background-image: url(../menu.svg); + background-size: cover; +} + +.panel .panelContents { + display: block; + transition: max-height 0s; + max-height: 100vh; +} + +#menuToggle { + display: none; +} + +main { + overflow: auto; +} + +@media only screen and (max-width: 768px) { + .wrapper { + flex-direction: column; + } + + main { + overflow: visible; + } + + #menuToggle ~ .panelContents { + max-height: 0; + overflow: hidden; + } + + #menuToggle:checked ~ .panelContents { + max-height: 2000px; + } + + .panel .panelContents { + display: block; + transition: max-height 0.3s ease-out; + } + + .panel { + flex: 0 0 fit-content; + max-width: 100%; + height: auto; + overflow: hidden; + } + + .expand { + display: inline-block; + } +} + diff --git a/bindings/wgpu/webgpu-samples-ts/public/css/SampleLayout.css b/bindings/wgpu/webgpu-samples-ts/public/css/SampleLayout.css new file mode 100644 index 00000000..fde021bf --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/public/css/SampleLayout.css @@ -0,0 +1,162 @@ +#sample { + flex: 1 1 auto; + display: flex; + flex-direction: column; +} + +.sampleContainer { + text-align: center; + width: 100%; +} + +.sampleContainer iframe { + width: 100%; + height: 100%; + border: none; + display: block; +} + +.sampleCategory { + margin-top: 5px; + margin-bottom: 5px; + display: inline-block; +} + +[data-tooltip] { + cursor: pointer; +} + +[data-tooltip]::after { + pointer-events: none; + content: attr(data-tooltip); + background-color: rgba(255, 255, 255, 1); + box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.1); + border-radius: 10px; + transition: opacity 0.2s ease-in, transform 0.2s ease-out; + padding: 0.5em; + opacity: 0; + display: block; + position: absolute; + transform: translateY(-0.5em); +} + +[data-tooltip]:hover::after { + opacity: 1; + transform: translateY(0.25em); +} + +nav.sourceFileNav { +} + +nav.sourceFileNav ul { + box-sizing: border-box; + list-style-type: none; + padding: 0; + margin: 0; + margin-top: 15px; +} + +nav.sourceFileNav li { + display: inline-block; + margin: 0; + padding: 0; + transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); +} + +nav.sourceFileNav::before { + content: ''; + position: absolute; + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + width: 30px; + height: 37px; + top: 15px; + left: 0px; + pointer-events: none; +} + +nav.sourceFileNav[data-left=true]::before { + background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent); +} + +nav.sourceFileNav::after { + content: ''; + position: absolute; + display: flex; + justify-content: center; + align-items: center; + width: 30px; + height: 37px; + top: 15px; + right: 0px; + pointer-events: none; +} + +nav.sourceFileNav[data-right=true]::after { + background: linear-gradient(270deg, rgba(0, 0, 0, 0.35), transparent); +} + +nav.sourceFileNav div.sourceFileScrollContainer { + white-space: nowrap; + overflow-x: auto; + scrollbar-width: thin; +} + +nav.sourceFileNav div.sourceFileScrollContainer::-webkit-scrollbar { + display: inline; + margin-top: 10px; + margin-bottom: 10px; + height: 11px; + width: 10px; +} + +nav.sourceFileNav div.sourceFileScrollContainer::-webkit-scrollbar-thumb { + background: rgb(200, 200, 200); + height: 4px; + border-radius: 20px; + -webkit-box-shadow: inset 0px 0px 10px rgb(45, 33, 33); + border: 0.5px solid transparent; + background-clip: content-box; +} + +nav.sourceFileNav div.sourceFileScrollContainer::-webkit-scrollbar-track { + background: rgba(0, 0, 0, 0); +} + +nav.sourceFileNav li a { + display: block; + margin: 0; + padding: 10px; + color: white; + background-color: #403e3e; +} + +nav.sourceFileNav li:hover { + height: 100%; + box-shadow: 0 -10px 0 0 rgb(167, 167, 167); + border-radius: 10px +} + +nav.sourceFileNav li a[data-active=true] { + background-color: #282823; +} + +nav.sourceFileNav li:has(a[data-active=true]) { + box-shadow: 0 -10px 0 0 rgb(167, 167, 167); + border-radius: 10px; +} + +.sourceFileContainer { + overflow: hidden; + height: 0; +} + +.sourceFileContainer[data-active=true] { + height: auto; +} + +.sourceFileContainer :global(.CodeMirror) { + margin-top: 0; +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/public/css/styles.css b/bindings/wgpu/webgpu-samples-ts/public/css/styles.css new file mode 100644 index 00000000..5b5564bf --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/public/css/styles.css @@ -0,0 +1,51 @@ +@import url('HomePage.css'); +@import url('MainLayout.css'); +@import url('SampleLayout.css'); + + +* { + box-sizing: border-box; +} + +html, body { + margin: 0; + height: 100%; +} + +body { + font-family: 'Inconsolata', monospace; +} + +a { + text-decoration: none; +} + +a:link, +a:visited { + color: #045b88; +} + +a:hover { + text-decoration: underline; +} + +main { + display: flex; + flex-direction: column; + position: relative; + flex: 1; + background: black; + color: #ddd; + padding-left: 15px; + padding-right: 15px; +} + +.CodeMirror { + height: auto !important; + margin: 1em 0; +} + +.CodeMirror-scroll { + height: auto !important; + overflow: visible !important; +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/public/favicon.ico b/bindings/wgpu/webgpu-samples-ts/public/favicon.ico new file mode 100644 index 00000000..c323a8f7 Binary files /dev/null and b/bindings/wgpu/webgpu-samples-ts/public/favicon.ico differ diff --git a/bindings/wgpu/webgpu-samples-ts/public/js/iframe-helper.js b/bindings/wgpu/webgpu-samples-ts/public/js/iframe-helper.js new file mode 100644 index 00000000..1e9b57aa --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/public/js/iframe-helper.js @@ -0,0 +1,13 @@ +if (window.frameElement) { + const body = document.body; + const observer = new ResizeObserver(() => { + window.parent.postMessage({ + cmd: 'resize', + data: { + width: body.scrollWidth, + height: body.scrollHeight, + }, + }); + }); + observer.observe(body); +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/public/menu.svg b/bindings/wgpu/webgpu-samples-ts/public/menu.svg new file mode 100644 index 00000000..c84912cf --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/public/menu.svg @@ -0,0 +1,4 @@ + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/public/workload-simulator.html b/bindings/wgpu/webgpu-samples-ts/public/workload-simulator.html new file mode 100644 index 00000000..1c72a18a --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/public/workload-simulator.html @@ -0,0 +1,1286 @@ + + + +Web graphics workload simulator + + + + + +
+

Drag the logo, or choose "Animate".

+ + +
+ + + +
+ +
+
+
+

+ + + + +
+
+ Canvas options + Canvas size pixels2 +
+ + + +
+ +
+
+
+
+ Extra rendering work +
+ +
draw 64K pixels
+
+ +
using 1 draw call(s)
+
+ Multiply the above slider values by: + + + +
+ +
+
+ Data uploads (e.g. bufferData, mapAsync) + +
0.00 MB mappedAtCreation/bufferData per frame
+
+ +
0.00 MB queue.writeBuffer/bufferSubData per frame
+
+ +
0.00 MB mapAsync/bufferData per frame
+
+ +
+ +
+
+ WebGL context creation options + + + + + + + + +
+ Power preference + + + +
+ +
+ +
+ WebGPU canvas context options + + +
+
+ WebGL Context attributes +

+            
+        
+
+ Supported WebGL Extensions +
+
+ WebGPU Adapter information +

+        
+
+
+ +
0 ms extra Javascript work per frame
+
+ + + + +

+
Web graphics workload simulator
+

+
+ + diff --git a/bindings/wgpu/webgpu-samples-ts/rollup.config.js b/bindings/wgpu/webgpu-samples-ts/rollup.config.js new file mode 100644 index 00000000..16f70119 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/rollup.config.js @@ -0,0 +1,124 @@ +import fs from 'fs'; +import path from 'path'; +import {nodeResolve} from '@rollup/plugin-node-resolve'; +import typescript from '@rollup/plugin-typescript'; +import commonjs from '@rollup/plugin-commonjs'; +import {readDirSyncRecursive} from './build-scripts/lib/readdir.js'; + +const outPath = 'out'; + +function wgslPlugin() { + return { + name: 'wgsl-plugin', + transform(code, id) { + if (id.endsWith('.wgsl')) { + return { + code: `export default \`${code}\`;`, + map: {mappings: ''}, + }; + } + }, + }; +} + +function makeRelativeToCWD(id) { + return path.relative(process.cwd(), path.normalize(id)).replaceAll('\\', '/'); +} + +function filenamePlugin() { + return { + name: 'filename-plugin', + transform(code, id) { + return { + code: code.replaceAll( + '__DIRNAME__', + () => `${JSON.stringify(makeRelativeToCWD(path.dirname(id)))}` + ), + map: {mappings: ''}, + }; + }, + }; +} + +/** + * Given a path like sample/foo/main.ts then, if an index.html doesn't exist + * in the same folder, generate a redirect index.html in the out folder. + * Note: + * `samples/name/index.html` is a redirect (generated) + * `sample/name/index.html` is the live sample (the iframe's src) + */ +function writeRedirect(filename) { + const sampleName = path.basename(path.dirname(filename)); + const dirname = path.join(outPath, 'samples', sampleName); + const filepath = path.join(dirname, 'index.html'); + fs.mkdirSync(dirname, {recursive: true}); + console.log('created', filepath); + fs.writeFileSync( + filepath, + `\ + + + + + + +` + ); +} + +const sampleFiles = readDirSyncRecursive('sample'); + +// Generate redirects for all samples +sampleFiles + .filter((n) => n.endsWith('/index.html')) + .forEach((n) => writeRedirect(n)); + +const samplePlugins = [ + wgslPlugin(), + nodeResolve(), + commonjs(), + typescript({tsconfig: './sample/tsconfig.json'}), +]; + +// add a rollup rule for each sample +const samples = sampleFiles + .filter((n) => n.endsWith('/main.ts') || n.endsWith('/worker.ts')) + .map((filename) => { + return { + input: filename, + output: [ + { + file: `${outPath}/${filename.replace(/\.ts$/, '.js')}`, + format: 'esm', + sourcemap: true, + }, + ], + plugins: samplePlugins, + }; + }); + +export default [ + { + input: 'src/main.ts', + output: [ + { + file: `${outPath}/main.js`, + format: 'esm', + sourcemap: true, + }, + ], + plugins: [ + nodeResolve(), + commonjs(), + filenamePlugin(), + typescript({tsconfig: './src/tsconfig.json'}), + ], + watch: { + clearScreen: false, + }, + }, + ...samples, +]; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/composite.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/composite.wgsl new file mode 100644 index 00000000..72604372 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/composite.wgsl @@ -0,0 +1,93 @@ +struct Uniforms { + modelViewProjectionMatrix: mat4x4f, + maxStorableFragments: u32, + targetWidth: u32, +}; + +struct SliceInfo { + sliceStartY: i32 +}; + +struct Heads { + numFragments: u32, + data: array +}; + +struct LinkedListElement { + color: vec4f, + depth: f32, + next: u32 +}; + +struct LinkedList { + data: array +}; + +@binding(0) @group(0) var uniforms: Uniforms; +@binding(1) @group(0) var heads: Heads; +@binding(2) @group(0) var linkedList: LinkedList; +@binding(3) @group(0) var sliceInfo: SliceInfo; + +// Output a full screen quad +@vertex +fn main_vs(@builtin(vertex_index) vertIndex: u32) -> @builtin(position) vec4f { + const position = array( + vec2(-1.0, -1.0), + vec2(1.0, -1.0), + vec2(1.0, 1.0), + vec2(-1.0, -1.0), + vec2(1.0, 1.0), + vec2(-1.0, 1.0), + ); + + return vec4(position[vertIndex], 0.0, 1.0); +} + +@fragment +fn main_fs(@builtin(position) position: vec4f) -> @location(0) vec4f { + let fragCoords = vec2i(position.xy); + let headsIndex = u32(fragCoords.y - sliceInfo.sliceStartY) * uniforms.targetWidth + u32(fragCoords.x); + + // The maximum layers we can process for any pixel + const maxLayers = 24u; + + var layers: array; + + var numLayers = 0u; + var elementIndex = heads.data[headsIndex]; + + // copy the list elements into an array up to the maximum amount of layers + while elementIndex != 0xFFFFFFFFu && numLayers < maxLayers { + layers[numLayers] = linkedList.data[elementIndex]; + numLayers++; + elementIndex = linkedList.data[elementIndex].next; + } + + if numLayers == 0u { + discard; + } + + // sort the fragments by depth + for (var i = 1u; i < numLayers; i++) { + let toInsert = layers[i]; + var j = i; + + while j > 0u && toInsert.depth > layers[j - 1u].depth { + layers[j] = layers[j - 1u]; + j--; + } + + layers[j] = toInsert; + } + + // pre-multiply alpha for the first layer + var color = vec4(layers[0].color.a * layers[0].color.rgb, layers[0].color.a); + + // blend the remaining layers + for (var i = 1u; i < numLayers; i++) { + let mixed = mix(color.rgb, layers[i].color.rgb, layers[i].color.aaa); + color = vec4(mixed, color.a); + } + + return color; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/index.html b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/index.html new file mode 100644 index 00000000..1928ce8d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: a-buffer + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/main.ts new file mode 100644 index 00000000..80b5e76e --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/main.ts @@ -0,0 +1,651 @@ +import {mat4, vec3} from 'wgpu-matrix'; +import {GUI} from 'dat.gui'; + +import {mesh} from '../../meshes/teapot'; + +import opaqueWGSL from './opaque.wgsl'; +import translucentWGSL from './translucent.wgsl'; +import compositeWGSL from './composite.wgsl'; + +function roundUp(n: number, k: number): number { + return Math.ceil(n / k) * k; +} + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const params = new URLSearchParams(window.location.search); + +const settings = { + memoryStrategy: params.get('memoryStrategy') || 'multipass', +}; + +// Create the model vertex buffer +const vertexBuffer = device.createBuffer({ + size: 3 * mesh.positions.length * Float32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, + label: 'vertexBuffer', +}); +{ + const mapping = new Float32Array(vertexBuffer.getMappedRange()); + for (let i = 0; i < mesh.positions.length; ++i) { + mapping.set(mesh.positions[i], 3 * i); + } + vertexBuffer.unmap(); +} + +// Create the model index buffer +const indexCount = mesh.triangles.length * 3; +const indexBuffer = device.createBuffer({ + size: indexCount * Uint16Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.INDEX, + mappedAtCreation: true, + label: 'indexBuffer', +}); +{ + const mapping = new Uint16Array(indexBuffer.getMappedRange()); + for (let i = 0; i < mesh.triangles.length; ++i) { + mapping.set(mesh.triangles[i], 3 * i); + } + indexBuffer.unmap(); +} + +// Uniforms contains: +// * modelViewProjectionMatrix: mat4x4f +// * maxStorableFragments: u32 +// * targetWidth: u32 +const uniformsSize = roundUp( + 16 * Float32Array.BYTES_PER_ELEMENT + 2 * Uint32Array.BYTES_PER_ELEMENT, + 16 +); + +const uniformBuffer = device.createBuffer({ + size: uniformsSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + label: 'uniformBuffer', +}); + +const opaqueModule = device.createShaderModule({ + code: opaqueWGSL, + label: 'opaqueModule', +}); + +const opaquePipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: opaqueModule, + buffers: [ + { + arrayStride: 3 * Float32Array.BYTES_PER_ELEMENT, + attributes: [ + { + // position + format: 'float32x3', + offset: 0, + shaderLocation: 0, + }, + ], + }, + ], + }, + fragment: { + module: opaqueModule, + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus', + }, + label: 'opaquePipeline', +}); + +const opaquePassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, + clearValue: {r: 0, g: 0, b: 0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: undefined, + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, + label: 'opaquePassDescriptor', +}; + +const opaqueBindGroup = device.createBindGroup({ + layout: opaquePipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + size: 16 * Float32Array.BYTES_PER_ELEMENT, + label: 'modelViewProjection', + }, + }, + ], + label: 'opaquePipeline', +}); + +const translucentModule = device.createShaderModule({ + code: translucentWGSL, + label: 'translucentModule', +}); + +const translucentBindGroupLayout = device.createBindGroupLayout({ + label: 'translucentBindGroupLayout', + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, + buffer: { + type: 'uniform', + }, + }, + { + binding: 1, + visibility: GPUShaderStage.FRAGMENT, + buffer: { + type: 'storage', + }, + }, + { + binding: 2, + visibility: GPUShaderStage.FRAGMENT, + buffer: { + type: 'storage', + }, + }, + { + binding: 3, + visibility: GPUShaderStage.FRAGMENT, + texture: {sampleType: 'depth'}, + }, + { + binding: 4, + visibility: GPUShaderStage.FRAGMENT, + buffer: { + type: 'uniform', + hasDynamicOffset: true, + }, + }, + ], +}); + +const translucentPipeline = device.createRenderPipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [translucentBindGroupLayout], + label: 'translucentPipelineLayout', + }), + vertex: { + module: translucentModule, + buffers: [ + { + arrayStride: 3 * Float32Array.BYTES_PER_ELEMENT, + attributes: [ + { + format: 'float32x3', + offset: 0, + shaderLocation: 0, + }, + ], + }, + ], + }, + fragment: { + module: translucentModule, + targets: [ + { + format: presentationFormat, + writeMask: 0x0, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, + label: 'translucentPipeline', +}); + +const translucentPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + loadOp: 'load', + storeOp: 'store', + view: undefined, + }, + ], + label: 'translucentPassDescriptor', +}; + +const compositeModule = device.createShaderModule({ + code: compositeWGSL, + label: 'compositeModule', +}); + +const compositeBindGroupLayout = device.createBindGroupLayout({ + label: 'compositeBindGroupLayout', + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, + buffer: { + type: 'uniform', + }, + }, + { + binding: 1, + visibility: GPUShaderStage.FRAGMENT, + buffer: { + type: 'storage', + }, + }, + { + binding: 2, + visibility: GPUShaderStage.FRAGMENT, + buffer: { + type: 'storage', + }, + }, + { + binding: 3, + visibility: GPUShaderStage.FRAGMENT, + buffer: { + type: 'uniform', + hasDynamicOffset: true, + }, + }, + ], +}); + +const compositePipeline = device.createRenderPipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [compositeBindGroupLayout], + label: 'compositePipelineLayout', + }), + vertex: { + module: compositeModule, + }, + fragment: { + module: compositeModule, + targets: [ + { + format: presentationFormat, + blend: { + color: { + srcFactor: 'one', + operation: 'add', + dstFactor: 'one-minus-src-alpha', + }, + alpha: {}, + }, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, + label: 'compositePipeline', +}); + +const compositePassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, + loadOp: 'load', + storeOp: 'store', + }, + ], + label: 'compositePassDescriptor', +}; + +const configure = () => { + let devicePixelRatio = window.devicePixelRatio; + + // The default maximum storage buffer binding size is 128Mib. The amount + // of memory we need to store transparent fragments depends on the size + // of the canvas and the average number of layers per fragment we want to + // support. When the devicePixelRatio is 1, we know that 128Mib is enough + // to store 4 layers per pixel at 600x600. However, when the device pixel + // ratio is high enough we will exceed this limit. + // + // We provide 2 choices of mitigations to this issue: + // 1) Clamp the device pixel ratio to a value which we know will not break + // the limit. The tradeoff here is that the canvas resolution will not + // match the native resolution and therefore may have a reduction in + // quality. + // 2) Break the frame into a series of horizontal slices using the scissor + // functionality and process a single slice at a time. This limits memory + // usage because we only need enough memory to process the dimensions + // of the slice. The tradeoff is the performance reduction due to multiple + // passes. + if (settings.memoryStrategy === 'clamp-pixel-ratio') { + devicePixelRatio = Math.min(window.devicePixelRatio, 3); + } + + canvas.width = canvas.clientWidth * devicePixelRatio; + canvas.height = canvas.clientHeight * devicePixelRatio; + + const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING, + label: 'depthTexture', + }); + + const depthTextureView = depthTexture.createView({ + label: 'depthTextureView', + }); + + // Determines how much memory is allocated to store linked-list elements + const averageLayersPerFragment = 4; + + // Each element stores + // * color : vec4f + // * depth : f32 + // * index of next element in the list : u32 + const linkedListElementSize = + 5 * Float32Array.BYTES_PER_ELEMENT + 1 * Uint32Array.BYTES_PER_ELEMENT; + + // We want to keep the linked-list buffer size under the maxStorageBufferBindingSize. + // Split the frame into enough slices to meet that constraint. + const bytesPerline = + canvas.width * averageLayersPerFragment * linkedListElementSize; + const maxLinesSupported = Math.floor( + device.limits.maxStorageBufferBindingSize / bytesPerline + ); + const numSlices = Math.ceil(canvas.height / maxLinesSupported); + const sliceHeight = Math.ceil(canvas.height / numSlices); + const linkedListBufferSize = sliceHeight * bytesPerline; + + const linkedListBuffer = device.createBuffer({ + size: linkedListBufferSize, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, + label: 'linkedListBuffer', + }); + + // To slice up the frame we need to pass the starting fragment y position of the slice. + // We do this using a uniform buffer with a dynamic offset. + const sliceInfoBuffer = device.createBuffer({ + size: numSlices * device.limits.minUniformBufferOffsetAlignment, + usage: GPUBufferUsage.UNIFORM, + mappedAtCreation: true, + label: 'sliceInfoBuffer', + }); + { + const mapping = new Int32Array(sliceInfoBuffer.getMappedRange()); + + // This assumes minUniformBufferOffsetAlignment is a multiple of 4 + const stride = + device.limits.minUniformBufferOffsetAlignment / + Int32Array.BYTES_PER_ELEMENT; + for (let i = 0; i < numSlices; ++i) { + mapping[i * stride] = i * sliceHeight; + } + sliceInfoBuffer.unmap(); + } + + // `Heads` struct contains the start index of the linked-list of translucent fragments + // for a given pixel. + // * numFragments : u32 + // * data : array + const headsBuffer = device.createBuffer({ + size: (1 + canvas.width * sliceHeight) * Uint32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, + label: 'headsBuffer', + }); + + const headsInitBuffer = device.createBuffer({ + size: (1 + canvas.width * sliceHeight) * Uint32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.COPY_SRC, + mappedAtCreation: true, + label: 'headsInitBuffer', + }); + { + const buffer = new Uint32Array(headsInitBuffer.getMappedRange()); + + for (let i = 0; i < buffer.length; ++i) { + buffer[i] = 0xffffffff; + } + + headsInitBuffer.unmap(); + } + + const translucentBindGroup = device.createBindGroup({ + layout: translucentBindGroupLayout, + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + label: 'uniforms', + }, + }, + { + binding: 1, + resource: { + buffer: headsBuffer, + label: 'headsBuffer', + }, + }, + { + binding: 2, + resource: { + buffer: linkedListBuffer, + label: 'linkedListBuffer', + }, + }, + { + binding: 3, + resource: depthTextureView, + }, + { + binding: 4, + resource: { + buffer: sliceInfoBuffer, + size: device.limits.minUniformBufferOffsetAlignment, + label: 'sliceInfoBuffer', + }, + }, + ], + label: 'translucentBindGroup', + }); + + const compositeBindGroup = device.createBindGroup({ + layout: compositePipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + label: 'uniforms', + }, + }, + { + binding: 1, + resource: { + buffer: headsBuffer, + label: 'headsBuffer', + }, + }, + { + binding: 2, + resource: { + buffer: linkedListBuffer, + label: 'linkedListBuffer', + }, + }, + { + binding: 3, + resource: { + buffer: sliceInfoBuffer, + size: device.limits.minUniformBufferOffsetAlignment, + label: 'sliceInfoBuffer', + }, + }, + ], + }); + + opaquePassDescriptor.depthStencilAttachment.view = depthTextureView; + + // Rotates the camera around the origin based on time. + function getCameraViewProjMatrix() { + const aspect = canvas.width / canvas.height; + + const projectionMatrix = mat4.perspective( + (2 * Math.PI) / 5, + aspect, + 1, + 2000.0 + ); + + const upVector = vec3.fromValues(0, 1, 0); + const origin = vec3.fromValues(0, 0, 0); + const eyePosition = vec3.fromValues(0, 5, -100); + + const rad = Math.PI * (Date.now() / 5000); + const rotation = mat4.rotateY(mat4.translation(origin), rad); + vec3.transformMat4(eyePosition, rotation, eyePosition); + + const viewMatrix = mat4.lookAt(eyePosition, origin, upVector); + + const viewProjMatrix = mat4.multiply(projectionMatrix, viewMatrix); + return viewProjMatrix as Float32Array; + } + + return function doDraw() { + // update the uniform buffer + { + const buffer = new ArrayBuffer(uniformBuffer.size); + + new Float32Array(buffer).set(getCameraViewProjMatrix()); + new Uint32Array(buffer, 16 * Float32Array.BYTES_PER_ELEMENT).set([ + averageLayersPerFragment * canvas.width * sliceHeight, + canvas.width, + ]); + + device.queue.writeBuffer(uniformBuffer, 0, buffer); + } + + const commandEncoder = device.createCommandEncoder(); + const textureView = context.getCurrentTexture().createView(); + + // Draw the opaque objects + opaquePassDescriptor.colorAttachments[0].view = textureView; + const opaquePassEncoder = + commandEncoder.beginRenderPass(opaquePassDescriptor); + opaquePassEncoder.setPipeline(opaquePipeline); + opaquePassEncoder.setBindGroup(0, opaqueBindGroup); + opaquePassEncoder.setVertexBuffer(0, vertexBuffer); + opaquePassEncoder.setIndexBuffer(indexBuffer, 'uint16'); + opaquePassEncoder.drawIndexed(mesh.triangles.length * 3, 8); + opaquePassEncoder.end(); + + for (let slice = 0; slice < numSlices; ++slice) { + // initialize the heads buffer + commandEncoder.copyBufferToBuffer( + headsInitBuffer, + 0, + headsBuffer, + 0, + headsInitBuffer.size + ); + + const scissorX = 0; + const scissorY = slice * sliceHeight; + const scissorWidth = canvas.width; + const scissorHeight = + Math.min((slice + 1) * sliceHeight, canvas.height) - + slice * sliceHeight; + + // Draw the translucent objects + translucentPassDescriptor.colorAttachments[0].view = textureView; + const translucentPassEncoder = commandEncoder.beginRenderPass( + translucentPassDescriptor + ); + + // Set the scissor to only process a horizontal slice of the frame + translucentPassEncoder.setScissorRect( + scissorX, + scissorY, + scissorWidth, + scissorHeight + ); + + translucentPassEncoder.setPipeline(translucentPipeline); + translucentPassEncoder.setBindGroup(0, translucentBindGroup, [ + slice * device.limits.minUniformBufferOffsetAlignment, + ]); + translucentPassEncoder.setVertexBuffer(0, vertexBuffer); + translucentPassEncoder.setIndexBuffer(indexBuffer, 'uint16'); + translucentPassEncoder.drawIndexed(mesh.triangles.length * 3, 8); + translucentPassEncoder.end(); + + // Composite the opaque and translucent objects + compositePassDescriptor.colorAttachments[0].view = textureView; + const compositePassEncoder = commandEncoder.beginRenderPass( + compositePassDescriptor + ); + + // Set the scissor to only process a horizontal slice of the frame + compositePassEncoder.setScissorRect( + scissorX, + scissorY, + scissorWidth, + scissorHeight + ); + + compositePassEncoder.setPipeline(compositePipeline); + compositePassEncoder.setBindGroup(0, compositeBindGroup, [ + slice * device.limits.minUniformBufferOffsetAlignment, + ]); + compositePassEncoder.draw(6); + compositePassEncoder.end(); + } + + device.queue.submit([commandEncoder.finish()]); + }; +}; + +let doDraw = configure(); + +const updateSettings = () => { + doDraw = configure(); +}; + +const gui = new GUI(); +gui + .add(settings, 'memoryStrategy', ['multipass', 'clamp-pixel-ratio']) + .onFinishChange(updateSettings); + +function frame() { + doDraw(); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/meta.ts new file mode 100644 index 00000000..0613cdf9 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/meta.ts @@ -0,0 +1,13 @@ +export default { + name: 'A-Buffer', + description: `Demonstrates order independent transparency using a per-pixel + linked-list of translucent fragments. Provides a choice for + limiting memory usage (when required).`, + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'opaque.wgsl'}, + {path: 'translucent.wgsl'}, + {path: 'composite.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/opaque.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/opaque.wgsl new file mode 100644 index 00000000..ec943f64 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/opaque.wgsl @@ -0,0 +1,44 @@ +struct Uniforms { + modelViewProjectionMatrix: mat4x4f, +}; + +@binding(0) @group(0) var uniforms: Uniforms; + +struct VertexOutput { + @builtin(position) position: vec4f, + @location(0) @interpolate(flat) instance: u32 +}; + +@vertex +fn main_vs(@location(0) position: vec4f, @builtin(instance_index) instance: u32) -> VertexOutput { + var output: VertexOutput; + + // distribute instances into a staggered 4x4 grid + const gridWidth = 125.0; + const cellSize = gridWidth / 4.0; + let row = instance / 2u; + let col = instance % 2u; + + let xOffset = -gridWidth / 2.0 + cellSize / 2.0 + 2.0 * cellSize * f32(col) + f32(row % 2u != 0u) * cellSize; + let zOffset = -gridWidth / 2.0 + cellSize / 2.0 + 2.0 + f32(row) * cellSize; + + let offsetPos = vec4(position.x + xOffset, position.y, position.z + zOffset, position.w); + + output.position = uniforms.modelViewProjectionMatrix * offsetPos; + output.instance = instance; + return output; +} + +@fragment +fn main_fs(@location(0) @interpolate(flat) instance: u32) -> @location(0) vec4f { + const colors = array( + vec3(1.0, 0.0, 0.0), + vec3(0.0, 1.0, 0.0), + vec3(0.0, 0.0, 1.0), + vec3(1.0, 0.0, 1.0), + vec3(1.0, 1.0, 0.0), + vec3(0.0, 1.0, 1.0), + ); + + return vec4(colors[instance % 6u], 1.0); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/translucent.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/translucent.wgsl new file mode 100644 index 00000000..b74bc096 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/a-buffer/translucent.wgsl @@ -0,0 +1,91 @@ +struct Uniforms { + modelViewProjectionMatrix: mat4x4f, + maxStorableFragments: u32, + targetWidth: u32, +}; + +struct SliceInfo { + sliceStartY: i32 +}; + +struct Heads { + numFragments: atomic, + data: array> +}; + +struct LinkedListElement { + color: vec4f, + depth: f32, + next: u32 +}; + +struct LinkedList { + data: array +}; + +@binding(0) @group(0) var uniforms: Uniforms; +@binding(1) @group(0) var heads: Heads; +@binding(2) @group(0) var linkedList: LinkedList; +@binding(3) @group(0) var opaqueDepthTexture: texture_depth_2d; +@binding(4) @group(0) var sliceInfo: SliceInfo; + +struct VertexOutput { + @builtin(position) position: vec4f, + @location(0) @interpolate(flat) instance: u32 +}; + +@vertex +fn main_vs(@location(0) position: vec4f, @builtin(instance_index) instance: u32) -> VertexOutput { + var output: VertexOutput; + + // distribute instances into a staggered 4x4 grid + const gridWidth = 125.0; + const cellSize = gridWidth / 4.0; + let row = instance / 2u; + let col = instance % 2u; + + let xOffset = -gridWidth / 2.0 + cellSize / 2.0 + 2.0 * cellSize * f32(col) + f32(row % 2u == 0u) * cellSize; + let zOffset = -gridWidth / 2.0 + cellSize / 2.0 + 2.0 + f32(row) * cellSize; + + let offsetPos = vec4(position.x + xOffset, position.y, position.z + zOffset, position.w); + + output.position = uniforms.modelViewProjectionMatrix * offsetPos; + output.instance = instance; + + return output; +} + +@fragment +fn main_fs(@builtin(position) position: vec4f, @location(0) @interpolate(flat) instance: u32) { + const colors = array( + vec3(1.0, 0.0, 0.0), + vec3(0.0, 1.0, 0.0), + vec3(0.0, 0.0, 1.0), + vec3(1.0, 0.0, 1.0), + vec3(1.0, 1.0, 0.0), + vec3(0.0, 1.0, 1.0), + ); + + let fragCoords = vec2i(position.xy); + let opaqueDepth = textureLoad(opaqueDepthTexture, fragCoords, 0); + + // reject fragments behind opaque objects + if position.z >= opaqueDepth { + discard; + } + + // The index in the heads buffer corresponding to the head data for the fragment at + // the current location. + let headsIndex = u32(fragCoords.y - sliceInfo.sliceStartY) * uniforms.targetWidth + u32(fragCoords.x); + + // The index in the linkedList buffer at which to store the new fragment + let fragIndex = atomicAdd(&heads.numFragments, 1u); + + // If we run out of space to store the fragments, we just lose them + if fragIndex < uniforms.maxStorableFragments { + let lastHead = atomicExchange(&heads.data[headsIndex], fragIndex); + linkedList.data[fragIndex].depth = position.z; + linkedList.data[fragIndex].next = lastHead; + linkedList.data[fragIndex].color = vec4(colors[(instance + 3u) % 6u], 0.3); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/animometer/animometer.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/animometer/animometer.wgsl new file mode 100644 index 00000000..3b1bed18 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/animometer/animometer.wgsl @@ -0,0 +1,49 @@ +struct Time { + value : f32, +} + +struct Uniforms { + scale : f32, + offsetX : f32, + offsetY : f32, + scalar : f32, + scalarOffset : f32, +} + +@binding(0) @group(0) var time : Time; +@binding(0) @group(1) var uniforms : Uniforms; + +struct VertexOutput { + @builtin(position) Position : vec4f, + @location(0) v_color : vec4f, +} + +@vertex +fn vert_main( + @location(0) position : vec4f, + @location(1) color : vec4f +) -> VertexOutput { + var fade = (uniforms.scalarOffset + time.value * uniforms.scalar / 10.0) % 1.0; + if (fade < 0.5) { + fade = fade * 2.0; + } else { + fade = (1.0 - fade) * 2.0; + } + var xpos = position.x * uniforms.scale; + var ypos = position.y * uniforms.scale; + var angle = 3.14159 * 2.0 * fade; + var xrot = xpos * cos(angle) - ypos * sin(angle); + var yrot = xpos * sin(angle) + ypos * cos(angle); + xpos = xrot + uniforms.offsetX; + ypos = yrot + uniforms.offsetY; + + var output : VertexOutput; + output.v_color = vec4(fade, 1.0 - fade, 0.0, 1.0) + color; + output.Position = vec4(xpos, ypos, 0.0, 1.0); + return output; +} + +@fragment +fn frag_main(@location(0) v_color : vec4f) -> @location(0) vec4f { + return v_color; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/animometer/index.html b/bindings/wgpu/webgpu-samples-ts/sample/animometer/index.html new file mode 100644 index 00000000..7c64e1ce --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/animometer/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: animometer + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/animometer/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/animometer/main.ts new file mode 100644 index 00000000..ed49e7c5 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/animometer/main.ts @@ -0,0 +1,367 @@ +import {GUI} from 'dat.gui'; +import animometerWGSL from './animometer.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const perfDisplayContainer = document.createElement('div'); +perfDisplayContainer.style.color = 'white'; +perfDisplayContainer.style.background = 'black'; +perfDisplayContainer.style.position = 'absolute'; +perfDisplayContainer.style.top = '10px'; +perfDisplayContainer.style.left = '10px'; + +const perfDisplay = document.createElement('pre'); +perfDisplayContainer.appendChild(perfDisplay); +if (canvas.parentNode) { + canvas.parentNode.appendChild(perfDisplayContainer); +} else { + console.error('canvas.parentNode is null'); +} + +const params = new URLSearchParams(window.location.search); +const settings = { + numTriangles: Number(params.get('numTriangles')) || 20000, + renderBundles: Boolean(params.get('renderBundles')), + dynamicOffsets: Boolean(params.get('dynamicOffsets')), +}; + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', + usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const timeBindGroupLayout = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX, + buffer: { + type: 'uniform', + minBindingSize: 4, + }, + }, + ], +}); + +const bindGroupLayout = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX, + buffer: { + type: 'uniform', + minBindingSize: 20, + }, + }, + ], +}); + +const dynamicBindGroupLayout = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX, + buffer: { + type: 'uniform', + hasDynamicOffset: true, + minBindingSize: 20, + }, + }, + ], +}); + +const vec4Size = 4 * Float32Array.BYTES_PER_ELEMENT; +const pipelineLayout = device.createPipelineLayout({ + bindGroupLayouts: [timeBindGroupLayout, bindGroupLayout], +}); +const dynamicPipelineLayout = device.createPipelineLayout({ + bindGroupLayouts: [timeBindGroupLayout, dynamicBindGroupLayout], +}); + +const shaderModule = device.createShaderModule({ + code: animometerWGSL, +}); +const pipelineDesc: GPURenderPipelineDescriptor = { + layout: 'auto', + vertex: { + module: shaderModule, + buffers: [ + { + // vertex buffer + arrayStride: 2 * vec4Size, + stepMode: 'vertex', + attributes: [ + { + // vertex positions + shaderLocation: 0, + offset: 0, + format: 'float32x4', + }, + { + // vertex colors + shaderLocation: 1, + offset: vec4Size, + format: 'float32x4', + }, + ], + }, + ], + }, + fragment: { + module: shaderModule, + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + frontFace: 'ccw', + cullMode: 'none', + }, +}; + +const pipeline = device.createRenderPipeline({ + ...pipelineDesc, + layout: pipelineLayout, +}); + +const dynamicPipeline = device.createRenderPipeline({ + ...pipelineDesc, + layout: dynamicPipelineLayout, +}); + +const vertexBuffer = device.createBuffer({ + size: 2 * 3 * vec4Size, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); + +// prettier-ignore +new Float32Array(vertexBuffer.getMappedRange()).set([ + // position data /**/ color data + 0, 0.1, 0, 1, /**/ 1, 0, 0, 1, + -0.1, -0.1, 0, 1, /**/ 0, 1, 0, 1, + 0.1, -0.1, 0, 1, /**/ 0, 0, 1, 1, +]); +vertexBuffer.unmap(); + +function configure() { + const numTriangles = settings.numTriangles; + const uniformBytes = 5 * Float32Array.BYTES_PER_ELEMENT; + const alignedUniformBytes = Math.ceil(uniformBytes / 256) * 256; + const alignedUniformFloats = + alignedUniformBytes / Float32Array.BYTES_PER_ELEMENT; + const uniformBuffer = device.createBuffer({ + size: numTriangles * alignedUniformBytes + Float32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.UNIFORM, + }); + const uniformBufferData = new Float32Array( + numTriangles * alignedUniformFloats + ); + const bindGroups = new Array(numTriangles); + for (let i = 0; i < numTriangles; ++i) { + uniformBufferData[alignedUniformFloats * i + 0] = Math.random() * 0.2 + 0.2; // scale + uniformBufferData[alignedUniformFloats * i + 1] = + 0.9 * 2 * (Math.random() - 0.5); // offsetX + uniformBufferData[alignedUniformFloats * i + 2] = + 0.9 * 2 * (Math.random() - 0.5); // offsetY + uniformBufferData[alignedUniformFloats * i + 3] = Math.random() * 1.5 + 0.5; // scalar + uniformBufferData[alignedUniformFloats * i + 4] = Math.random() * 10; // scalarOffset + + bindGroups[i] = device.createBindGroup({ + layout: bindGroupLayout, + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + offset: i * alignedUniformBytes, + size: 6 * Float32Array.BYTES_PER_ELEMENT, + }, + }, + ], + }); + } + + const dynamicBindGroup = device.createBindGroup({ + layout: dynamicBindGroupLayout, + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + offset: 0, + size: 6 * Float32Array.BYTES_PER_ELEMENT, + }, + }, + ], + }); + + const timeOffset = numTriangles * alignedUniformBytes; + const timeBindGroup = device.createBindGroup({ + layout: timeBindGroupLayout, + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + offset: timeOffset, + size: Float32Array.BYTES_PER_ELEMENT, + }, + }, + ], + }); + + // writeBuffer too large may OOM. TODO: The browser should internally chunk uploads. + const maxMappingLength = (14 * 1024 * 1024) / Float32Array.BYTES_PER_ELEMENT; + for ( + let offset = 0; + offset < uniformBufferData.length; + offset += maxMappingLength + ) { + const uploadCount = Math.min( + uniformBufferData.length - offset, + maxMappingLength + ); + + device.queue.writeBuffer( + uniformBuffer, + offset * Float32Array.BYTES_PER_ELEMENT, + uniformBufferData.buffer, + uniformBufferData.byteOffset + offset * Float32Array.BYTES_PER_ELEMENT, + uploadCount * Float32Array.BYTES_PER_ELEMENT + ); + } + + function recordRenderPass( + passEncoder: GPURenderBundleEncoder | GPURenderPassEncoder + ) { + if (settings.dynamicOffsets) { + passEncoder.setPipeline(dynamicPipeline); + } else { + passEncoder.setPipeline(pipeline); + } + passEncoder.setVertexBuffer(0, vertexBuffer); + passEncoder.setBindGroup(0, timeBindGroup); + const dynamicOffsets = [0]; + for (let i = 0; i < numTriangles; ++i) { + if (settings.dynamicOffsets) { + dynamicOffsets[0] = i * alignedUniformBytes; + passEncoder.setBindGroup(1, dynamicBindGroup, dynamicOffsets); + } else { + passEncoder.setBindGroup(1, bindGroups[i]); + } + passEncoder.draw(3); + } + } + + let startTime: number | undefined = undefined; + const uniformTime = new Float32Array([0]); + + const renderPassDescriptor = { + colorAttachments: [ + { + view: undefined as GPUTextureView, // Assigned later + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear' as const, + storeOp: 'store' as const, + }, + ], + }; + + const renderBundleEncoder = device.createRenderBundleEncoder({ + colorFormats: [presentationFormat], + }); + recordRenderPass(renderBundleEncoder); + const renderBundle = renderBundleEncoder.finish(); + + return function doDraw(timestamp: number) { + if (startTime === undefined) { + startTime = timestamp; + } + uniformTime[0] = (timestamp - startTime) / 1000; + device.queue.writeBuffer(uniformBuffer, timeOffset, uniformTime.buffer); + + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + + if (settings.renderBundles) { + passEncoder.executeBundles([renderBundle]); + } else { + recordRenderPass(passEncoder); + } + + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + }; +} + +let doDraw = configure(); + +const updateSettings = () => { + doDraw = configure(); +}; +const gui = new GUI(); +gui + .add(settings, 'numTriangles', 0, 200000) + .step(1) + .onFinishChange(updateSettings); +gui.add(settings, 'renderBundles'); +gui.add(settings, 'dynamicOffsets'); + +let previousFrameTimestamp: number | undefined = undefined; +let jsTimeAvg: number | undefined = undefined; +let frameTimeAvg: number | undefined = undefined; +let updateDisplay = true; + +function frame(timestamp: number) { + let frameTime = 0; + if (previousFrameTimestamp !== undefined) { + frameTime = timestamp - previousFrameTimestamp; + } + previousFrameTimestamp = timestamp; + + const start = performance.now(); + doDraw(timestamp); + const jsTime = performance.now() - start; + if (frameTimeAvg === undefined) { + frameTimeAvg = frameTime; + } + if (jsTimeAvg === undefined) { + jsTimeAvg = jsTime; + } + + const w = 0.2; + frameTimeAvg = (1 - w) * frameTimeAvg + w * frameTime; + jsTimeAvg = (1 - w) * jsTimeAvg + w * jsTime; + + if (updateDisplay) { + perfDisplay.innerHTML = `Avg Javascript: ${jsTimeAvg.toFixed( + 2 + )} ms\nAvg Frame: ${frameTimeAvg.toFixed(2)} ms`; + updateDisplay = false; + setTimeout(() => { + updateDisplay = true; + }, 100); + } + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/animometer/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/animometer/meta.ts new file mode 100644 index 00000000..1410bbfe --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/animometer/meta.ts @@ -0,0 +1,6 @@ +export default { + name: 'Animometer', + description: 'A WebGPU port of the Animometer MotionMark benchmark.', + filename: __DIRNAME__, + sources: [{path: 'main.ts'}, {path: 'animometer.wgsl'}], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/application/application.ts b/bindings/wgpu/webgpu-samples-ts/sample/application/application.ts new file mode 100644 index 00000000..a7f7b5d6 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/application/application.ts @@ -0,0 +1,24 @@ +import {io} from "../../out/kotlin-libs/wgpu-webgpu-samples-ts"; +import Application = io.ygdrasil.wgpu.examples.Application; +import RenderingContext = io.ygdrasil.wgpu.RenderingContext; +import Device = io.ygdrasil.wgpu.Device; + +export async function fromCanvas(canvas: HTMLCanvasElement): Promise { + const adapter = await navigator.gpu.requestAdapter(); + const device = await adapter.requestDevice(); + const context = canvas.getContext('webgpu') as GPUCanvasContext; + + return new TSApplication(new RenderingContext(context), new Device(device)); +} + +export class TSApplication extends Application { + + constructor(renderingContext: io.ygdrasil.wgpu.RenderingContext, device: io.ygdrasil.wgpu.Device) { + super(renderingContext, device, undefined); + + } + + run() { + + } +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/atomicToZero.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/atomicToZero.wgsl new file mode 100644 index 00000000..c1d21d87 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/atomicToZero.wgsl @@ -0,0 +1,7 @@ +@group(0) @binding(3) var counter: atomic; + +@compute @workgroup_size(1, 1, 1) +fn atomicToZero() { + let counterValue = atomicLoad(&counter); + atomicSub(&counter, counterValue); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/bitonicCompute.ts b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/bitonicCompute.ts new file mode 100644 index 00000000..d6f837e0 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/bitonicCompute.ts @@ -0,0 +1,129 @@ +export const computeArgKeys = ['width', 'height', 'algo', 'blockHeight']; + +export const NaiveBitonicCompute = (workgroupSize: number) => { + if (workgroupSize % 2 !== 0 || workgroupSize > 256) { + workgroupSize = 256; + } + // Ensure that workgroupSize is half the number of elements + return ` + +struct Uniforms { + width: f32, + height: f32, + algo: u32, + blockHeight: u32, +} + +// Create local workgroup data that can contain all elements +var local_data: array; + +// Define groups (functions refer to this data) +@group(0) @binding(0) var input_data: array; +@group(0) @binding(1) var output_data: array; +@group(0) @binding(2) var uniforms: Uniforms; +@group(0) @binding(3) var counter: atomic; + +// Compare and swap values in local_data +fn local_compare_and_swap(idx_before: u32, idx_after: u32) { + //idx_before should always be < idx_after + if (local_data[idx_after] < local_data[idx_before]) { + atomicAdd(&counter, 1); + var temp: u32 = local_data[idx_before]; + local_data[idx_before] = local_data[idx_after]; + local_data[idx_after] = temp; + } + return; +} + +// invoke_id goes from 0 to workgroupSize +fn get_flip_indices(invoke_id: u32, block_height: u32) -> vec2u { + // Caculate index offset (i.e move indices into correct block) + let block_offset: u32 = ((2 * invoke_id) / block_height) * block_height; + let half_height = block_height / 2; + // Calculate index spacing + var idx: vec2u = vec2u( + invoke_id % half_height, block_height - (invoke_id % half_height) - 1, + ); + idx.x += block_offset; + idx.y += block_offset; + return idx; +} + +fn get_disperse_indices(invoke_id: u32, block_height: u32) -> vec2u { + var block_offset: u32 = ((2 * invoke_id) / block_height) * block_height; + let half_height = block_height / 2; + var idx: vec2u = vec2u( + invoke_id % half_height, (invoke_id % half_height) + half_height + ); + idx.x += block_offset; + idx.y += block_offset; + return idx; +} + +fn global_compare_and_swap(idx_before: u32, idx_after: u32) { + if (input_data[idx_after] < input_data[idx_before]) { + output_data[idx_before] = input_data[idx_after]; + output_data[idx_after] = input_data[idx_before]; + } +} + +// Constants/enum +const ALGO_NONE = 0; +const ALGO_LOCAL_FLIP = 1; +const ALGO_LOCAL_DISPERSE = 2; +const ALGO_GLOBAL_FLIP = 3; + +// Our compute shader will execute specified # of invocations or elements / 2 invocations +@compute @workgroup_size(${workgroupSize}, 1, 1) +fn computeMain( + @builtin(global_invocation_id) global_id: vec3u, + @builtin(local_invocation_id) local_id: vec3u, + @builtin(workgroup_id) workgroup_id: vec3u, +) { + + let offset = ${workgroupSize} * 2 * workgroup_id.x; + // If we will perform a local swap, then populate the local data + if (uniforms.algo <= 2) { + // Assign range of input_data to local_data. + // Range cannot exceed maxWorkgroupsX * 2 + // Each invocation will populate the workgroup data... (1 invocation for every 2 elements) + local_data[local_id.x * 2] = input_data[offset + local_id.x * 2]; + local_data[local_id.x * 2 + 1] = input_data[offset + local_id.x * 2 + 1]; + } + + //...and wait for each other to finish their own bit of data population. + workgroupBarrier(); + + switch uniforms.algo { + case 1: { // Local Flip + let idx = get_flip_indices(local_id.x, uniforms.blockHeight); + local_compare_and_swap(idx.x, idx.y); + } + case 2: { // Local Disperse + let idx = get_disperse_indices(local_id.x, uniforms.blockHeight); + local_compare_and_swap(idx.x, idx.y); + } + case 3: { // Global Flip + let idx = get_flip_indices(global_id.x, uniforms.blockHeight); + global_compare_and_swap(idx.x, idx.y); + } + case 4: { + let idx = get_disperse_indices(global_id.x, uniforms.blockHeight); + global_compare_and_swap(idx.x, idx.y); + } + default: { + + } + } + + // Ensure that all invocations have swapped their own regions of data + workgroupBarrier(); + + if (uniforms.algo <= ALGO_LOCAL_DISPERSE) { + //Repopulate global data with local data + output_data[offset + local_id.x * 2] = local_data[local_id.x * 2]; + output_data[offset + local_id.x * 2 + 1] = local_data[local_id.x * 2 + 1]; + } + +}`; +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/bitonicDisplay.frag.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/bitonicDisplay.frag.wgsl new file mode 100644 index 00000000..33bbf49c --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/bitonicDisplay.frag.wgsl @@ -0,0 +1,56 @@ +struct ComputeUniforms { + width: f32, + height: f32, + algo: u32, + blockHeight: u32, +} + +struct FragmentUniforms { + // boolean, either 0 or 1 + highlight: u32, +} + +struct VertexOutput { + @builtin(position) Position: vec4f, + @location(0) fragUV: vec2f +} + +// Uniforms from compute shader +@group(0) @binding(0) var data: array; +@group(0) @binding(2) var uniforms: ComputeUniforms; +// Fragment shader uniforms +@group(1) @binding(0) var fragment_uniforms: FragmentUniforms; + +@fragment +fn frag_main(input: VertexOutput) -> @location(0) vec4f { + var uv: vec2f = vec2f( + input.fragUV.x * uniforms.width, + input.fragUV.y * uniforms.height + ); + + var pixel: vec2u = vec2u( + u32(floor(uv.x)), + u32(floor(uv.y)), + ); + + var elementIndex = u32(uniforms.width) * pixel.y + pixel.x; + var colorChanger = data[elementIndex]; + + var subtracter = f32(colorChanger) / (uniforms.width * uniforms.height); + + if (fragment_uniforms.highlight == 1) { + return select( + //If element is above halfHeight, highlight green + vec4f(vec3f(0.0, 1.0 - subtracter, 0.0).rgb, 1.0), + //If element is below halfheight, highlight red + vec4f(vec3f(1.0 - subtracter, 0.0, 0.0).rgb, 1.0), + elementIndex % uniforms.blockHeight < uniforms.blockHeight / 2 + ); + } + + var color: vec3f = vec3f( + 1.0 - subtracter + ); + + return vec4f(color.rgb, 1.0); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/bitonicDisplay.ts b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/bitonicDisplay.ts new file mode 100644 index 00000000..c5029060 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/bitonicDisplay.ts @@ -0,0 +1,70 @@ +import { + BindGroupCluster, + Base2DRendererClass, + createBindGroupCluster, +} from './utils'; + +import bitonicDisplay from './bitonicDisplay.frag.wgsl'; + +interface BitonicDisplayRenderArgs { + highlight: number; +} + +export default class BitonicDisplayRenderer extends Base2DRendererClass { + switchBindGroup: (name: string) => void; + setArguments: (args: BitonicDisplayRenderArgs) => void; + computeBGDescript: BindGroupCluster; + + constructor( + device: GPUDevice, + presentationFormat: GPUTextureFormat, + renderPassDescriptor: GPURenderPassDescriptor, + computeBGDescript: BindGroupCluster, + label: string + ) { + super(); + this.renderPassDescriptor = renderPassDescriptor; + this.computeBGDescript = computeBGDescript; + + const uniformBuffer = device.createBuffer({ + size: Uint32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); + + const bgCluster = createBindGroupCluster( + [0], + [GPUShaderStage.FRAGMENT], + ['buffer'], + [{type: 'uniform'}], + [[{buffer: uniformBuffer}]], + label, + device + ); + + this.currentBindGroup = bgCluster.bindGroups[0]; + + this.pipeline = super.create2DRenderPipeline( + device, + label, + [this.computeBGDescript.bindGroupLayout, bgCluster.bindGroupLayout], + bitonicDisplay, + presentationFormat + ); + + this.setArguments = (args: BitonicDisplayRenderArgs) => { + device.queue.writeBuffer( + uniformBuffer, + 0, + new Uint32Array([args.highlight]) + ); + }; + } + + startRun(commandEncoder: GPUCommandEncoder, args: BitonicDisplayRenderArgs) { + this.setArguments(args); + super.executeRun(commandEncoder, this.renderPassDescriptor, this.pipeline, [ + this.computeBGDescript.bindGroups[0], + this.currentBindGroup, + ]); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/index.html b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/index.html new file mode 100644 index 00000000..bfe92054 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: bitonicSort + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/main.ts new file mode 100644 index 00000000..6249e7b4 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/main.ts @@ -0,0 +1,911 @@ +import {GUI} from 'dat.gui'; +import Stats from 'stats.js'; +import {createBindGroupCluster, SampleInitFactoryWebGPU} from './utils'; +import BitonicDisplayRenderer from './bitonicDisplay'; +import {NaiveBitonicCompute} from './bitonicCompute'; +import atomicToZero from './atomicToZero.wgsl'; + +// Type of step that will be executed in our shader +enum StepEnum { + NONE, + FLIP_LOCAL, + DISPERSE_LOCAL, + FLIP_GLOBAL, + DISPERSE_GLOBAL, +} + +type StepType = +// NONE: No sort step has or will occur + | 'NONE' + // FLIP_LOCAL: A sort step that performs a flip operation over indices in a workgroup's locally addressable area + // (i.e invocations * workgroup_index -> invocations * (workgroup_index + 1) - 1. + | 'FLIP_LOCAL' + // DISPERSE_LOCAL A sort step that performs a flip operation over indices in a workgroup's locally addressable area. + | 'DISPERSE_LOCAL' + // FLIP_GLOBAL A sort step that performs a flip step across a range of indices outside a workgroup's locally addressable area. + | 'FLIP_GLOBAL' + // DISPERSE_GLOBAL A sort step that performs a disperse operation across a range of indices outside a workgroup's locally addressable area. + | 'DISPERSE_GLOBAL'; + +type DisplayType = 'Elements' | 'Swap Highlight'; + +interface ConfigInfo { + // Number of sorts executed under a given elements + size limit config + sorts: number; + // Total collective time taken to execute each complete sort under this config + time: number; +} + +interface StringKeyToNumber { + [key: string]: ConfigInfo; +} + +// Gui settings object +interface SettingsInterface { + 'Total Elements': number; + 'Grid Width': number; + 'Grid Height': number; + 'Grid Dimensions': string; + 'Workgroup Size': number; + 'Size Limit': number; + 'Workgroups Per Step': number; + 'Hovered Cell': number; + 'Swapped Cell': number; + 'Current Step': string; + 'Step Index': number; + 'Total Steps': number; + 'Prev Step': StepType; + 'Next Step': StepType; + 'Prev Swap Span': number; + 'Next Swap Span': number; + executeStep: boolean; + 'Randomize Values': () => void; + 'Execute Sort Step': () => void; + 'Log Elements': () => void; + 'Auto Sort': () => void; + 'Auto Sort Speed': number; + 'Display Mode': DisplayType; + 'Total Swaps': number; + stepTime: number; + 'Step Time': string; + sortTime: number; + 'Sort Time': string; + 'Average Sort Time': string; + configToCompleteSwapsMap: StringKeyToNumber; + configKey: string; +} + +const getNumSteps = (numElements: number) => { + const n = Math.log2(numElements); + return (n * (n + 1)) / 2; +}; + +SampleInitFactoryWebGPU( + async ({ + device, + gui, + presentationFormat, + context, + canvas, + timestampQueryAvailable, + }) => { + const maxInvocationsX = device.limits.maxComputeWorkgroupSizeX; + + let querySet: GPUQuerySet; + let timestampQueryResolveBuffer: GPUBuffer; + let timestampQueryResultBuffer: GPUBuffer; + if (timestampQueryAvailable) { + querySet = device.createQuerySet({type: 'timestamp', count: 2}); + timestampQueryResolveBuffer = device.createBuffer({ + // 2 timestamps * BigInt size for nanoseconds + size: 2 * BigInt64Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.QUERY_RESOLVE | GPUBufferUsage.COPY_SRC, + }); + timestampQueryResultBuffer = device.createBuffer({ + // 2 timestamps * BigInt size for nanoseconds + size: 2 * BigInt64Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ, + }); + } + + const totalElementOptions = []; + const maxElements = maxInvocationsX * 32; + for (let i = maxElements; i >= 4; i /= 2) { + totalElementOptions.push(i); + } + + const sizeLimitOptions: number[] = []; + for (let i = maxInvocationsX; i >= 2; i /= 2) { + sizeLimitOptions.push(i); + } + + const defaultGridWidth = + Math.sqrt(maxElements) % 2 === 0 + ? Math.floor(Math.sqrt(maxElements)) + : Math.floor(Math.sqrt(maxElements / 2)); + + const defaultGridHeight = maxElements / defaultGridWidth; + + const settings: SettingsInterface = { + // TOTAL ELEMENT AND GRID SETTINGS + // The number of elements to be sorted. Must equal gridWidth * gridHeight || Workgroup Size * Workgroups * 2. + // When changed, all relevant values within the settings object are reset to their defaults at the beginning of a sort with n elements. + 'Total Elements': maxElements, + // The width of the screen in cells. + 'Grid Width': defaultGridWidth, + // The height of the screen in cells. + 'Grid Height': defaultGridHeight, + // Grid Dimensions as string + 'Grid Dimensions': `${defaultGridWidth}x${defaultGridHeight}`, + + // INVOCATION, WORKGROUP SIZE, AND WORKGROUP DISPATCH SETTINGS + // The size of a workgroup, or the number of invocations executed within each workgroup + // Determined algorithmically based on 'Size Limit', maxInvocationsX, and the current number of elements to sort + 'Workgroup Size': maxInvocationsX, + // An artifical constraint on the maximum workgroup size/maximumn invocations per workgroup as specified by device.limits.maxComputeWorkgroupSizeX + 'Size Limit': maxInvocationsX, + // Total workgroups that are dispatched during each step of the bitonic sort + 'Workgroups Per Step': maxElements / (maxInvocationsX * 2), + + // HOVER SETTINGS + // The element/cell in the element visualizer directly beneath the mouse cursor + 'Hovered Cell': 0, + // The element/cell in the element visualizer that the hovered cell will swap with in the next execution step of the bitonic sort. + 'Swapped Cell': 1, + + // STEP INDEX, STEP TYPE, AND STEP SWAP SPAN SETTINGS + // The index of the current step in the bitonic sort. + 'Step Index': 0, + // The total number of steps required to sort the displayed elements. + 'Total Steps': getNumSteps(maxElements), + // A string that condenses 'Step Index' and 'Total Steps' into a single GUI Controller display element. + 'Current Step': `0 of 91`, + // The category of the previously executed step. Always begins the bitonic sort with a value of 'NONE' and ends with a value of 'DISPERSE_LOCAL' + 'Prev Step': 'NONE', + // The category of the next step that will be executed. Always begins the bitonic sort with a value of 'FLIP_LOCAL' and ends with a value of 'NONE' + 'Next Step': 'FLIP_LOCAL', + // The maximum span of a swap operation in the sort's previous step. + 'Prev Swap Span': 0, + // The maximum span of a swap operation in the sort's upcoming step. + 'Next Swap Span': 2, + + // ANIMATION LOOP AND FUNCTION SETTINGS + // A flag that designates whether we will dispatch a workload this frame. + executeStep: false, + // A function that randomizes the values of each element. + // When called, all relevant values within the settings object are reset to their defaults at the beginning of a sort with n elements. + 'Randomize Values': () => { + return; + }, + // A function that manually executes a single step of the bitonic sort. + 'Execute Sort Step': () => { + return; + }, + // A function that logs the values of each element as an array to the browser's console. + 'Log Elements': () => { + return; + }, + // A function that automatically executes each step of the bitonic sort at an interval determined by 'Auto Sort Speed' + 'Auto Sort': () => { + return; + }, + // The speed at which each step of the bitonic sort will be executed after 'Auto Sort' has been called. + 'Auto Sort Speed': 50, + + // MISCELLANEOUS SETTINGS + 'Display Mode': 'Elements', + // An atomic value representing the total number of swap operations executed over the course of the bitonic sort. + 'Total Swaps': 0, + + // TIMESTAMP SETTINGS + // NOTE: Timestep values below all are calculated in terms of milliseconds rather than the nanoseconds a timestamp query set usually outputs. + // Time taken to execute the previous step of the bitonic sort in milliseconds + 'Step Time': '0ms', + stepTime: 0, + // Total taken to colletively execute each step of the complete bitonic sort, represented in milliseconds. + 'Sort Time': '0ms', + sortTime: 0, + // Average time taken to complete a bitonic sort with the current combination of n 'Total Elements' and x 'Size Limit' + 'Average Sort Time': '0ms', + // A string to number map that maps a string representation of the current 'Total Elements' + 'Size Limit' configuration to a number + // representing the total number of sorts that have been executed under that same configuration. + configToCompleteSwapsMap: { + '8192 256': { + sorts: 0, + time: 0, + }, + }, + // Current key into configToCompleteSwapsMap + configKey: '8192 256', + }; + + // Initialize initial elements array + let elements = new Uint32Array( + Array.from({length: settings['Total Elements']}, (_, i) => i) + ); + + // Initialize elementsBuffer and elementsStagingBuffer + const elementsBufferSize = + Float32Array.BYTES_PER_ELEMENT * totalElementOptions[0]; + // Initialize input, output, staging buffers + const elementsInputBuffer = device.createBuffer({ + size: elementsBufferSize, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, + }); + const elementsOutputBuffer = device.createBuffer({ + size: elementsBufferSize, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC, + }); + const elementsStagingBuffer = device.createBuffer({ + size: elementsBufferSize, + usage: GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST, + }); + + // Initialize atomic swap buffer on GPU and CPU. Counts number of swaps actually performed by + // compute shader (when value at index x is greater than value at index y) + const atomicSwapsOutputBuffer = device.createBuffer({ + size: Uint32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC, + }); + const atomicSwapsStagingBuffer = device.createBuffer({ + size: Uint32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.MAP_READ | GPUBufferUsage.COPY_DST, + }); + + // Create uniform buffer for compute shader + const computeUniformsBuffer = device.createBuffer({ + // width, height, blockHeight, algo + size: Float32Array.BYTES_PER_ELEMENT * 4, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); + + const computeBGCluster = createBindGroupCluster( + [0, 1, 2, 3], + [ + GPUShaderStage.COMPUTE | GPUShaderStage.FRAGMENT, + GPUShaderStage.COMPUTE, + GPUShaderStage.COMPUTE | GPUShaderStage.FRAGMENT, + GPUShaderStage.COMPUTE, + ], + ['buffer', 'buffer', 'buffer', 'buffer'], + [ + {type: 'read-only-storage'}, + {type: 'storage'}, + {type: 'uniform'}, + {type: 'storage'}, + ], + [ + [ + {buffer: elementsInputBuffer}, + {buffer: elementsOutputBuffer}, + {buffer: computeUniformsBuffer}, + {buffer: atomicSwapsOutputBuffer}, + ], + ], + 'BitonicSort', + device + ); + + let computePipeline = device.createComputePipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [computeBGCluster.bindGroupLayout], + }), + compute: { + module: device.createShaderModule({ + code: NaiveBitonicCompute(settings['Workgroup Size']), + }), + }, + }); + + // Simple pipeline that zeros out an atomic value at group 0 binding 3 + const atomicToZeroComputePipeline = device.createComputePipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [computeBGCluster.bindGroupLayout], + }), + compute: { + module: device.createShaderModule({ + code: atomicToZero, + }), + }, + }); + + // Create bitonic debug renderer + const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: {r: 0.1, g: 0.4, b: 0.5, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + }; + + const bitonicDisplayRenderer = new BitonicDisplayRenderer( + device, + presentationFormat, + renderPassDescriptor, + computeBGCluster, + 'BitonicDisplay' + ); + + const resetTimeInfo = () => { + settings.stepTime = 0; + settings.sortTime = 0; + stepTimeController.setValue('0ms'); + sortTimeController.setValue(`0ms`); + const nanCheck = + settings.configToCompleteSwapsMap[settings.configKey].time / + settings.configToCompleteSwapsMap[settings.configKey].sorts; + const ast = nanCheck ? nanCheck : 0; + averageSortTimeController.setValue(`${ast.toFixed(5)}ms`); + }; + + const resetExecutionInformation = () => { + // The workgroup size is either elements / 2 or Size Limit + workgroupSizeController.setValue( + Math.min(settings['Total Elements'] / 2, settings['Size Limit']) + ); + + // Dispatch a workgroup for every (Size Limit * 2) elements + const workgroupsPerStep = + (settings['Total Elements'] - 1) / (settings['Size Limit'] * 2); + + workgroupsPerStepController.setValue(Math.ceil(workgroupsPerStep)); + + // Reset step Index and number of steps based on elements size + settings['Step Index'] = 0; + settings['Total Steps'] = getNumSteps(settings['Total Elements']); + currentStepController.setValue( + `${settings['Step Index']} of ${settings['Total Steps']}` + ); + + // Get new width and height of screen display in cells + const newCellWidth = + Math.sqrt(settings['Total Elements']) % 2 === 0 + ? Math.floor(Math.sqrt(settings['Total Elements'])) + : Math.floor(Math.sqrt(settings['Total Elements'] / 2)); + const newCellHeight = settings['Total Elements'] / newCellWidth; + settings['Grid Width'] = newCellWidth; + settings['Grid Height'] = newCellHeight; + gridDimensionsController.setValue(`${newCellWidth}x${newCellHeight}`); + + // Set prevStep to None (restart) and next step to FLIP + prevStepController.setValue('NONE'); + nextStepController.setValue('FLIP_LOCAL'); + + // Reset block heights + prevBlockHeightController.setValue(0); + nextBlockHeightController.setValue(2); + + // Reset Total Swaps by setting atomic value to 0 + const commandEncoder = device.createCommandEncoder(); + const computePassEncoder = commandEncoder.beginComputePass(); + computePassEncoder.setPipeline(atomicToZeroComputePipeline); + computePassEncoder.setBindGroup(0, computeBGCluster.bindGroups[0]); + computePassEncoder.dispatchWorkgroups(1); + computePassEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + totalSwapsController.setValue(0); + + highestBlockHeight = 2; + }; + + const randomizeElementArray = () => { + let currentIndex = elements.length; + // While there are elements to shuffle + while (currentIndex !== 0) { + // Pick a remaining element + const randomIndex = Math.floor(Math.random() * currentIndex); + currentIndex -= 1; + [elements[currentIndex], elements[randomIndex]] = [ + elements[randomIndex], + elements[currentIndex], + ]; + } + }; + + const resizeElementArray = () => { + // Recreate elements array with new length + elements = new Uint32Array( + Array.from({length: settings['Total Elements']}, (_, i) => i) + ); + + resetExecutionInformation(); + + // Create new shader invocation with workgroupSize that reflects number of invocations + computePipeline = device.createComputePipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [computeBGCluster.bindGroupLayout], + }), + compute: { + module: device.createShaderModule({ + code: NaiveBitonicCompute( + Math.min(settings['Total Elements'] / 2, settings['Size Limit']) + ), + }), + }, + }); + // Randomize array elements + randomizeElementArray(); + highestBlockHeight = 2; + }; + + randomizeElementArray(); + + const setSwappedCell = () => { + let swappedIndex: number; + switch (settings['Next Step']) { + case 'FLIP_LOCAL': + case 'FLIP_GLOBAL': { + const blockHeight = settings['Next Swap Span']; + const p2 = Math.floor(settings['Hovered Cell'] / blockHeight) + 1; + const p3 = settings['Hovered Cell'] % blockHeight; + swappedIndex = blockHeight * p2 - p3 - 1; + swappedCellController.setValue(swappedIndex); + } + break; + case 'DISPERSE_LOCAL': { + const blockHeight = settings['Next Swap Span']; + const halfHeight = blockHeight / 2; + swappedIndex = + settings['Hovered Cell'] % blockHeight < halfHeight + ? settings['Hovered Cell'] + halfHeight + : settings['Hovered Cell'] - halfHeight; + swappedCellController.setValue(swappedIndex); + } + break; + case 'NONE': { + swappedIndex = settings['Hovered Cell']; + swappedCellController.setValue(swappedIndex); + } + default: { + swappedIndex = settings['Hovered Cell']; + swappedCellController.setValue(swappedIndex); + } + break; + } + }; + + let autoSortIntervalID: ReturnType | null = null; + const endSortInterval = () => { + if (autoSortIntervalID !== null) { + clearInterval(autoSortIntervalID); + autoSortIntervalID = null; + } + }; + const startSortInterval = () => { + const currentIntervalSpeed = settings['Auto Sort Speed']; + autoSortIntervalID = setInterval(() => { + if (settings['Next Step'] === 'NONE') { + clearInterval(autoSortIntervalID); + autoSortIntervalID = null; + sizeLimitController.domElement.style.pointerEvents = 'auto'; + } + if (settings['Auto Sort Speed'] !== currentIntervalSpeed) { + clearInterval(autoSortIntervalID); + autoSortIntervalID = null; + startSortInterval(); + } + settings.executeStep = true; + setSwappedCell(); + }, settings['Auto Sort Speed']); + }; + + // At top level, information about resources used to execute the compute shader + // i.e elements sorted, invocations per workgroup, and workgroups dispatched + const computeResourcesFolder = gui.addFolder('Compute Resources'); + computeResourcesFolder + .add(settings, 'Total Elements', totalElementOptions) + .onChange(() => { + endSortInterval(); + resizeElementArray(); + sizeLimitController.domElement.style.pointerEvents = 'auto'; + // Create new config key for current element + size limit configuration + const currConfigKey = `${settings['Total Elements']} ${settings['Size Limit']}`; + // If configKey doesn't exist in the map, create it. + if (!settings.configToCompleteSwapsMap[currConfigKey]) { + settings.configToCompleteSwapsMap[currConfigKey] = { + sorts: 0, + time: 0, + }; + } + settings.configKey = currConfigKey; + resetTimeInfo(); + }); + const sizeLimitController = computeResourcesFolder + .add(settings, 'Size Limit', sizeLimitOptions) + .onChange(() => { + // Change total workgroups per step and size of a workgroup based on arbitrary constraint + // imposed by size limit. + const constraint = Math.min( + settings['Total Elements'] / 2, + settings['Size Limit'] + ); + const workgroupsPerStep = + (settings['Total Elements'] - 1) / (settings['Size Limit'] * 2); + workgroupSizeController.setValue(constraint); + workgroupsPerStepController.setValue(Math.ceil(workgroupsPerStep)); + // Apply new compute resources values to the sort's compute pipeline + computePipeline = computePipeline = device.createComputePipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [computeBGCluster.bindGroupLayout], + }), + compute: { + module: device.createShaderModule({ + code: NaiveBitonicCompute( + Math.min(settings['Total Elements'] / 2, settings['Size Limit']) + ), + }), + }, + }); + // Create new config key for current element + size limit configuration + const currConfigKey = `${settings['Total Elements']} ${settings['Size Limit']}`; + // If configKey doesn't exist in the map, create it. + if (!settings.configToCompleteSwapsMap[currConfigKey]) { + settings.configToCompleteSwapsMap[currConfigKey] = { + sorts: 0, + time: 0, + }; + } + settings.configKey = currConfigKey; + resetTimeInfo(); + }); + const workgroupSizeController = computeResourcesFolder.add( + settings, + 'Workgroup Size' + ); + const workgroupsPerStepController = computeResourcesFolder.add( + settings, + 'Workgroups Per Step' + ); + + computeResourcesFolder.open(); + + // Folder with functions that control the execution of the sort + const controlFolder = gui.addFolder('Sort Controls'); + controlFolder.add(settings, 'Execute Sort Step').onChange(() => { + // Size Limit locked upon sort + sizeLimitController.domElement.style.pointerEvents = 'none'; + endSortInterval(); + settings.executeStep = true; + }); + controlFolder.add(settings, 'Randomize Values').onChange(() => { + endSortInterval(); + randomizeElementArray(); + resetExecutionInformation(); + resetTimeInfo(); + // Unlock workgroup size limit controller since sort has stopped + sizeLimitController.domElement.style.pointerEvents = 'auto'; + }); + controlFolder + .add(settings, 'Log Elements') + .onChange(() => console.log(elements)); + controlFolder.add(settings, 'Auto Sort').onChange(() => { + // Invocation Limit locked upon sort + sizeLimitController.domElement.style.pointerEvents = 'none'; + startSortInterval(); + }); + controlFolder.add(settings, 'Auto Sort Speed', 50, 1000).step(50); + controlFolder.open(); + + // Information about grid display + const gridFolder = gui.addFolder('Grid Information'); + gridFolder.add(settings, 'Display Mode', ['Elements', 'Swap Highlight']); + const gridDimensionsController = gridFolder.add( + settings, + 'Grid Dimensions' + ); + const hoveredCellController = gridFolder + .add(settings, 'Hovered Cell') + .onChange(setSwappedCell); + const swappedCellController = gridFolder.add(settings, 'Swapped Cell'); + + // Additional Information about the execution state of the sort + const executionInformationFolder = gui.addFolder('Execution Information'); + const currentStepController = executionInformationFolder.add( + settings, + 'Current Step' + ); + const prevStepController = executionInformationFolder.add( + settings, + 'Prev Step' + ); + const nextStepController = executionInformationFolder.add( + settings, + 'Next Step' + ); + const totalSwapsController = executionInformationFolder.add( + settings, + 'Total Swaps' + ); + const prevBlockHeightController = executionInformationFolder.add( + settings, + 'Prev Swap Span' + ); + const nextBlockHeightController = executionInformationFolder.add( + settings, + 'Next Swap Span' + ); + + // Timestamp information for Chrome 121+ or other compatible browsers + const timestampFolder = gui.addFolder('Timestamp Info (Chrome 121+)'); + const stepTimeController = timestampFolder.add(settings, 'Step Time'); + const sortTimeController = timestampFolder.add(settings, 'Sort Time'); + const averageSortTimeController = timestampFolder.add( + settings, + 'Average Sort Time' + ); + + // Adjust styles of Function List Elements within GUI + const liFunctionElements = document.getElementsByClassName('cr function'); + for (let i = 0; i < liFunctionElements.length; i++) { + (liFunctionElements[i].children[0] as HTMLElement).style.display = 'flex'; + (liFunctionElements[i].children[0] as HTMLElement).style.justifyContent = + 'center'; + ( + liFunctionElements[i].children[0].children[1] as HTMLElement + ).style.position = 'absolute'; + } + + // Mouse listener that determines values of hoveredCell and swappedCell + canvas.addEventListener('mousemove', (event) => { + const currWidth = canvas.getBoundingClientRect().width; + const currHeight = canvas.getBoundingClientRect().height; + const cellSize: [number, number] = [ + currWidth / settings['Grid Width'], + currHeight / settings['Grid Height'], + ]; + const xIndex = Math.floor(event.offsetX / cellSize[0]); + const yIndex = + settings['Grid Height'] - 1 - Math.floor(event.offsetY / cellSize[1]); + hoveredCellController.setValue(yIndex * settings['Grid Width'] + xIndex); + settings['Hovered Cell'] = yIndex * settings['Grid Width'] + xIndex; + }); + + // Deactivate interaction with select GUI elements + sizeLimitController.domElement.style.pointerEvents = 'none'; + workgroupsPerStepController.domElement.style.pointerEvents = 'none'; + hoveredCellController.domElement.style.pointerEvents = 'none'; + swappedCellController.domElement.style.pointerEvents = 'none'; + currentStepController.domElement.style.pointerEvents = 'none'; + prevStepController.domElement.style.pointerEvents = 'none'; + prevBlockHeightController.domElement.style.pointerEvents = 'none'; + nextStepController.domElement.style.pointerEvents = 'none'; + nextBlockHeightController.domElement.style.pointerEvents = 'none'; + workgroupSizeController.domElement.style.pointerEvents = 'none'; + gridDimensionsController.domElement.style.pointerEvents = 'none'; + totalSwapsController.domElement.style.pointerEvents = 'none'; + stepTimeController.domElement.style.pointerEvents = 'none'; + sortTimeController.domElement.style.pointerEvents = 'none'; + averageSortTimeController.domElement.style.pointerEvents = 'none'; + gui.width = 325; + + let highestBlockHeight = 2; + + startSortInterval(); + + async function frame() { + // Write elements buffer + device.queue.writeBuffer( + elementsInputBuffer, + 0, + elements.buffer, + elements.byteOffset, + elements.byteLength + ); + + const dims = new Float32Array([ + settings['Grid Width'], + settings['Grid Height'], + ]); + const stepDetails = new Uint32Array([ + StepEnum[settings['Next Step']], + settings['Next Swap Span'], + ]); + device.queue.writeBuffer( + computeUniformsBuffer, + 0, + dims.buffer, + dims.byteOffset, + dims.byteLength + ); + + device.queue.writeBuffer(computeUniformsBuffer, 8, stepDetails); + + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + bitonicDisplayRenderer.startRun(commandEncoder, { + highlight: settings['Display Mode'] === 'Elements' ? 0 : 1, + }); + if ( + settings.executeStep && + highestBlockHeight < settings['Total Elements'] * 2 + ) { + let computePassEncoder: GPUComputePassEncoder; + if (timestampQueryAvailable) { + computePassEncoder = commandEncoder.beginComputePass({ + timestampWrites: { + querySet, + beginningOfPassWriteIndex: 0, + endOfPassWriteIndex: 1, + }, + }); + } else { + computePassEncoder = commandEncoder.beginComputePass(); + } + computePassEncoder.setPipeline(computePipeline); + computePassEncoder.setBindGroup(0, computeBGCluster.bindGroups[0]); + computePassEncoder.dispatchWorkgroups(settings['Workgroups Per Step']); + computePassEncoder.end(); + // Resolve time passed in between beginning and end of computePass + if (timestampQueryAvailable) { + commandEncoder.resolveQuerySet( + querySet, + 0, + 2, + timestampQueryResolveBuffer, + 0 + ); + commandEncoder.copyBufferToBuffer( + timestampQueryResolveBuffer, + 0, + timestampQueryResultBuffer, + 0, + 2 * BigInt64Array.BYTES_PER_ELEMENT + ); + } + settings['Step Index'] = settings['Step Index'] + 1; + currentStepController.setValue( + `${settings['Step Index']} of ${settings['Total Steps']}` + ); + prevStepController.setValue(settings['Next Step']); + prevBlockHeightController.setValue(settings['Next Swap Span']); + nextBlockHeightController.setValue(settings['Next Swap Span'] / 2); + // Each cycle of a bitonic sort contains a flip operation followed by multiple disperse operations + // Next Swap Span will equal one when the sort needs to begin a new cycle of flip and disperse operations + if (settings['Next Swap Span'] === 1) { + // The next cycle's flip operation will have a maximum swap span 2 times that of the previous cycle + highestBlockHeight *= 2; + if (highestBlockHeight === settings['Total Elements'] * 2) { + // The next cycle's maximum swap span exceeds the total number of elements. Therefore, the sort is over. + // Accordingly, there will be no next step. + nextStepController.setValue('NONE'); + // And if there is no next step, then there are no swaps, and no block range within which two elements are swapped. + nextBlockHeightController.setValue(0); + // Finally, with our sort completed, we can increment the number of total completed sorts executed with n 'Total Elements' + // and x 'Size Limit', which will allow us to calculate the average time of all sorts executed with this specific + // configuration of compute resources + settings.configToCompleteSwapsMap[settings.configKey].sorts += 1; + } else if (highestBlockHeight > settings['Workgroup Size'] * 2) { + // The next cycle's maximum swap span exceeds the range of a single workgroup, so our next flip will operate on global indices. + nextStepController.setValue('FLIP_GLOBAL'); + nextBlockHeightController.setValue(highestBlockHeight); + } else { + // The next cycle's maximum swap span can be executed on a range of indices local to the workgroup. + nextStepController.setValue('FLIP_LOCAL'); + nextBlockHeightController.setValue(highestBlockHeight); + } + } else { + // Otherwise, execute the next disperse operation + settings['Next Swap Span'] > settings['Workgroup Size'] * 2 + ? nextStepController.setValue('DISPERSE_GLOBAL') + : nextStepController.setValue('DISPERSE_LOCAL'); + } + + // Copy GPU accessible buffers to CPU accessible buffers + commandEncoder.copyBufferToBuffer( + elementsOutputBuffer, + 0, + elementsStagingBuffer, + 0, + elementsBufferSize + ); + + commandEncoder.copyBufferToBuffer( + atomicSwapsOutputBuffer, + 0, + atomicSwapsStagingBuffer, + 0, + Uint32Array.BYTES_PER_ELEMENT + ); + } + device.queue.submit([commandEncoder.finish()]); + + if ( + settings.executeStep && + highestBlockHeight < settings['Total Elements'] * 4 + ) { + // Copy GPU element data to CPU + await elementsStagingBuffer.mapAsync( + GPUMapMode.READ, + 0, + elementsBufferSize + ); + const copyElementsBuffer = elementsStagingBuffer.getMappedRange( + 0, + elementsBufferSize + ); + // Copy atomic swaps data to CPU + await atomicSwapsStagingBuffer.mapAsync( + GPUMapMode.READ, + 0, + Uint32Array.BYTES_PER_ELEMENT + ); + const copySwapsBuffer = atomicSwapsStagingBuffer.getMappedRange( + 0, + Uint32Array.BYTES_PER_ELEMENT + ); + const elementsData = copyElementsBuffer.slice( + 0, + Uint32Array.BYTES_PER_ELEMENT * settings['Total Elements'] + ); + const swapsData = copySwapsBuffer.slice( + 0, + Uint32Array.BYTES_PER_ELEMENT + ); + // Extract data + const elementsOutput = new Uint32Array(elementsData); + totalSwapsController.setValue(new Uint32Array(swapsData)[0]); + elementsStagingBuffer.unmap(); + atomicSwapsStagingBuffer.unmap(); + // Elements output becomes elements input, swap accumulate + elements = elementsOutput; + setSwappedCell(); + + // Handle timestamp query stuff + if (timestampQueryAvailable) { + // Copy timestamp query result buffer data to CPU + await timestampQueryResultBuffer.mapAsync( + GPUMapMode.READ, + 0, + 2 * BigInt64Array.BYTES_PER_ELEMENT + ); + const copyTimestampResult = new BigInt64Array( + timestampQueryResultBuffer.getMappedRange() + ); + // Calculate new step, sort, and average sort times + const newStepTime = + Number(copyTimestampResult[1] - copyTimestampResult[0]) / 1000000; + const newSortTime = settings.sortTime + newStepTime; + // Apply calculated times to settings object as both number and 'ms' appended string + settings.stepTime = newStepTime; + settings.sortTime = newSortTime; + stepTimeController.setValue(`${newStepTime.toFixed(5)}ms`); + sortTimeController.setValue(`${newSortTime.toFixed(5)}ms`); + // Calculate new average sort upon end of final execution step of a full bitonic sort. + if (highestBlockHeight === settings['Total Elements'] * 2) { + // Lock off access to this larger if block..not best architected solution but eh + highestBlockHeight *= 2; + settings.configToCompleteSwapsMap[settings.configKey].time += + newSortTime; + const averageSortTime = + settings.configToCompleteSwapsMap[settings.configKey].time / + settings.configToCompleteSwapsMap[settings.configKey].sorts; + averageSortTimeController.setValue( + `${averageSortTime.toFixed(5)}ms` + ); + } + timestampQueryResultBuffer.unmap(); + // Get correct range of data from CPU copy of GPU Data + } + } + settings.executeStep = false; + requestAnimationFrame(frame); + } + + requestAnimationFrame(frame); + } +).then((init) => { + const canvas = document.querySelector('canvas') as HTMLCanvasElement; + const stats = new Stats(); + const gui = new GUI(); + + document.body.appendChild(stats.dom); + + init({canvas, stats, gui}); +}); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/meta.ts new file mode 100644 index 00000000..c4661b81 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/meta.ts @@ -0,0 +1,14 @@ +export default { + name: 'Bitonic Sort', + description: + "A naive bitonic sort algorithm executed on the GPU, based on tgfrerer's implementation at poniesandlight.co.uk/reflect/bitonic_merge_sort/. Each dispatch of the bitonic sort shader dispatches a workgroup containing elements/2 invocations. The GUI's Execution Information folder contains information about the sort's current state. The visualizer displays the sort's results as colored cells sorted from brightest to darkest.", + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'bitonicDisplay.ts'}, + {path: '../../shaders/fullscreenTexturedQuad.wgsl'}, + {path: './bitonicDisplay.frag.wgsl'}, + {path: './bitonicCompute.ts'}, + {path: './atomicToZero.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/utils.ts b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/utils.ts new file mode 100644 index 00000000..99b19ecf --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/bitonicSort/utils.ts @@ -0,0 +1,225 @@ +import type {GUI} from 'dat.gui'; +import fullscreenTexturedQuad from '../../shaders/fullscreenTexturedQuad.wgsl'; + +type BindGroupBindingLayout = + | GPUBufferBindingLayout + | GPUTextureBindingLayout + | GPUSamplerBindingLayout + | GPUStorageTextureBindingLayout + | GPUExternalTextureBindingLayout; + +// An object containing +// 1. A generated Bind Group Layout +// 2. An array of Bind Groups that accord to that layout +export type BindGroupCluster = { + bindGroups: GPUBindGroup[]; + bindGroupLayout: GPUBindGroupLayout; +}; + +type ResourceTypeName = + | 'buffer' + | 'texture' + | 'sampler' + | 'externalTexture' + | 'storageTexture'; + +/** + * @param {number[]} bindings - The binding value of each resource in the bind group. + * @param {number[]} visibilities - The GPUShaderStage visibility of the resource at the corresponding index. + * @param {ResourceTypeName[]} resourceTypes - The resourceType at the corresponding index. + * @returns {BindGroupsObjectsAndLayout} An object containing an array of bindGroups and the bindGroupLayout they implement. + */ +export const createBindGroupCluster = ( + bindings: number[], + visibilities: number[], + resourceTypes: ResourceTypeName[], + resourceLayouts: BindGroupBindingLayout[], + resources: GPUBindingResource[][], + label: string, + device: GPUDevice +): BindGroupCluster => { + const layoutEntries: GPUBindGroupLayoutEntry[] = []; + for (let i = 0; i < bindings.length; i++) { + layoutEntries.push({ + binding: bindings[i], + visibility: visibilities[i % visibilities.length], + [resourceTypes[i]]: resourceLayouts[i], + }); + } + + const bindGroupLayout = device.createBindGroupLayout({ + label: `${label}.bindGroupLayout`, + entries: layoutEntries, + }); + + const bindGroups: GPUBindGroup[] = []; + //i represent the bindGroup index, j represents the binding index of the resource within the bindgroup + //i=0, j=0 bindGroup: 0, binding: 0 + //i=1, j=1, bindGroup: 0, binding: 1 + //NOTE: not the same as @group(0) @binding(1) group index within the fragment shader is set within a pipeline + for (let i = 0; i < resources.length; i++) { + const groupEntries: GPUBindGroupEntry[] = []; + for (let j = 0; j < resources[0].length; j++) { + groupEntries.push({ + binding: j, + resource: resources[i][j], + }); + } + const newBindGroup = device.createBindGroup({ + label: `${label}.bindGroup${i}`, + layout: bindGroupLayout, + entries: groupEntries, + }); + bindGroups.push(newBindGroup); + } + + return { + bindGroups, + bindGroupLayout, + }; +}; + +export type ShaderKeyInterface = { + [K in T[number]]: number; +}; + +export type SampleInitParams = { + canvas: HTMLCanvasElement; + gui?: GUI; + stats?: Stats; +}; + +interface DeviceInitParms { + device: GPUDevice; +} + +interface DeviceInit3DParams extends DeviceInitParms { + context: GPUCanvasContext; + presentationFormat: GPUTextureFormat; + timestampQueryAvailable: boolean; +} + +type CallbackSync3D = (params: SampleInitParams & DeviceInit3DParams) => void; +type CallbackAsync3D = ( + params: SampleInitParams & DeviceInit3DParams +) => Promise; + +type SampleInitCallback3D = CallbackSync3D | CallbackAsync3D; +export type SampleInit = (params: SampleInitParams) => void; + +export const SampleInitFactoryWebGPU = async ( + callback: SampleInitCallback3D +): Promise => { + const init = async ({canvas, gui, stats}) => { + const adapter = await navigator.gpu.requestAdapter(); + const timestampQueryAvailable = adapter.features.has('timestamp-query'); + let device: GPUDevice; + if (timestampQueryAvailable) { + device = await adapter.requestDevice({ + requiredFeatures: ['timestamp-query'], + }); + } else { + device = await adapter.requestDevice(); + } + const context = canvas.getContext('webgpu') as GPUCanvasContext; + const devicePixelRatio = window.devicePixelRatio; + canvas.width = canvas.clientWidth * devicePixelRatio; + canvas.height = canvas.clientHeight * devicePixelRatio; + const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', + }); + + callback({ + canvas, + gui, + device, + context, + presentationFormat, + stats, + timestampQueryAvailable, + }); + }; + return init; +}; + +export abstract class Base2DRendererClass { + abstract switchBindGroup(name: string): void; + + abstract startRun( + commandEncoder: GPUCommandEncoder, + ...args: unknown[] + ): void; + + renderPassDescriptor: GPURenderPassDescriptor; + pipeline: GPURenderPipeline; + bindGroupMap: Record; + currentBindGroup: GPUBindGroup; + currentBindGroupName: string; + + executeRun( + commandEncoder: GPUCommandEncoder, + renderPassDescriptor: GPURenderPassDescriptor, + pipeline: GPURenderPipeline, + bindGroups: GPUBindGroup[] + ) { + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + for (let i = 0; i < bindGroups.length; i++) { + passEncoder.setBindGroup(i, bindGroups[i]); + } + passEncoder.draw(6, 1, 0, 0); + passEncoder.end(); + } + + setUniformArguments( + device: GPUDevice, + uniformBuffer: GPUBuffer, + instance: T, + keys: K + ) { + for (let i = 0; i < keys.length; i++) { + device.queue.writeBuffer( + uniformBuffer, + i * 4, + new Float32Array([instance[keys[i]]]) + ); + } + } + + create2DRenderPipeline( + device: GPUDevice, + label: string, + bgLayouts: GPUBindGroupLayout[], + code: string, + presentationFormat: GPUTextureFormat + ) { + return device.createRenderPipeline({ + label: `${label}.pipeline`, + layout: device.createPipelineLayout({ + bindGroupLayouts: bgLayouts, + }), + vertex: { + module: device.createShaderModule({ + code: fullscreenTexturedQuad, + }), + }, + fragment: { + module: device.createShaderModule({ + code: code, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + cullMode: 'none', + }, + }); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/bundleCulling/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/bundleCulling/meta.ts new file mode 100644 index 00000000..6ea483e5 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/bundleCulling/meta.ts @@ -0,0 +1,10 @@ +export default { + name: 'Bundle Culling', + description: `A demonstration of using frustum culling with render bundles through indirect instanced draw calls. + +Source at https://github.com/toji/webgpu-bundle-culling/ +`, + filename: __DIRNAME__, + url: 'https://toji.github.io/webgpu-bundle-culling/', + sources: [], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cameras/camera.ts b/bindings/wgpu/webgpu-samples-ts/sample/cameras/camera.ts new file mode 100644 index 00000000..b1237124 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cameras/camera.ts @@ -0,0 +1,353 @@ +// Note: The code in this file does not use the 'dst' output parameter of functions in the +// 'wgpu-matrix' library, so produces many temporary vectors and matrices. +// This is intentional, as this sample prefers readability over performance. +import {Mat4, Vec3, Vec4, mat4, vec3} from 'wgpu-matrix'; +import Input from './input'; + +// Common interface for camera implementations +export default interface Camera { + // update updates the camera using the user-input and returns the view matrix. + update(delta_time: number, input: Input): Mat4; + + // The camera matrix. + // This is the inverse of the view matrix. + matrix: Mat4; + // Alias to column vector 0 of the camera matrix. + right: Vec4; + // Alias to column vector 1 of the camera matrix. + up: Vec4; + // Alias to column vector 2 of the camera matrix. + back: Vec4; + // Alias to column vector 3 of the camera matrix. + position: Vec4; +} + +// The common functionality between camera implementations +class CameraBase { + // The camera matrix + private matrix_ = new Float32Array([ + 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, + ]); + + // The calculated view matrix + private readonly view_ = mat4.create(); + + // Aliases to column vectors of the matrix + private right_ = new Float32Array(this.matrix_.buffer, 4 * 0, 4); + private up_ = new Float32Array(this.matrix_.buffer, 4 * 4, 4); + private back_ = new Float32Array(this.matrix_.buffer, 4 * 8, 4); + private position_ = new Float32Array(this.matrix_.buffer, 4 * 12, 4); + + // Returns the camera matrix + get matrix() { + return this.matrix_; + } + + // Assigns `mat` to the camera matrix + set matrix(mat: Mat4) { + mat4.copy(mat, this.matrix_); + } + + // Returns the camera view matrix + get view() { + return this.view_; + } + + // Assigns `mat` to the camera view + set view(mat: Mat4) { + mat4.copy(mat, this.view_); + } + + // Returns column vector 0 of the camera matrix + get right() { + return this.right_; + } + + // Assigns `vec` to the first 3 elements of column vector 0 of the camera matrix + set right(vec: Vec3) { + vec3.copy(vec, this.right_); + } + + // Returns column vector 1 of the camera matrix + get up() { + return this.up_; + } + + // Assigns `vec` to the first 3 elements of column vector 1 of the camera matrix + set up(vec: Vec3) { + vec3.copy(vec, this.up_); + } + + // Returns column vector 2 of the camera matrix + get back() { + return this.back_; + } + + // Assigns `vec` to the first 3 elements of column vector 2 of the camera matrix + set back(vec: Vec3) { + vec3.copy(vec, this.back_); + } + + // Returns column vector 3 of the camera matrix + get position() { + return this.position_; + } + + // Assigns `vec` to the first 3 elements of column vector 3 of the camera matrix + set position(vec: Vec3) { + vec3.copy(vec, this.position_); + } +} + +// WASDCamera is a camera implementation that behaves similar to first-person-shooter PC games. +export class WASDCamera extends CameraBase implements Camera { + // The camera absolute pitch angle + private pitch = 0; + // The camera absolute yaw angle + private yaw = 0; + + // The movement veloicty + private readonly velocity_ = vec3.create(); + + // Speed multiplier for camera movement + movementSpeed = 10; + + // Speed multiplier for camera rotation + rotationSpeed = 1; + + // Movement velocity drag coeffient [0 .. 1] + // 0: Continues forever + // 1: Instantly stops moving + frictionCoefficient = 0.99; + + // Returns velocity vector + get velocity() { + return this.velocity_; + } + + // Assigns `vec` to the velocity vector + set velocity(vec: Vec3) { + vec3.copy(vec, this.velocity_); + } + + // Construtor + constructor(options?: { + // The initial position of the camera + position?: Vec3; + // The initial target of the camera + target?: Vec3; + }) { + super(); + if (options && (options.position || options.target)) { + const position = options.position ?? vec3.create(0, 0, -5); + const target = options.target ?? vec3.create(0, 0, 0); + const forward = vec3.normalize(vec3.sub(target, position)); + this.recalculateAngles(forward); + this.position = position; + } + } + + // Returns the camera matrix + get matrix() { + return super.matrix; + } + + // Assigns `mat` to the camera matrix, and recalcuates the camera angles + set matrix(mat: Mat4) { + super.matrix = mat; + this.recalculateAngles(this.back); + } + + update(deltaTime: number, input: Input): Mat4 { + const sign = (positive: boolean, negative: boolean) => + (positive ? 1 : 0) - (negative ? 1 : 0); + + // Apply the delta rotation to the pitch and yaw angles + this.yaw -= input.analog.x * deltaTime * this.rotationSpeed; + this.pitch -= input.analog.y * deltaTime * this.rotationSpeed; + + // Wrap yaw between [0° .. 360°], just to prevent large accumulation. + this.yaw = mod(this.yaw, Math.PI * 2); + // Clamp pitch between [-90° .. +90°] to prevent somersaults. + this.pitch = clamp(this.pitch, -Math.PI / 2, Math.PI / 2); + + // Save the current position, as we're about to rebuild the camera matrix. + const position = vec3.copy(this.position); + + // Reconstruct the camera's rotation, and store into the camera matrix. + super.matrix = mat4.rotateX(mat4.rotationY(this.yaw), this.pitch); + + // Calculate the new target velocity + const digital = input.digital; + const deltaRight = sign(digital.right, digital.left); + const deltaUp = sign(digital.up, digital.down); + const targetVelocity = vec3.create(); + const deltaBack = sign(digital.backward, digital.forward); + vec3.addScaled(targetVelocity, this.right, deltaRight, targetVelocity); + vec3.addScaled(targetVelocity, this.up, deltaUp, targetVelocity); + vec3.addScaled(targetVelocity, this.back, deltaBack, targetVelocity); + vec3.normalize(targetVelocity, targetVelocity); + vec3.mulScalar(targetVelocity, this.movementSpeed, targetVelocity); + + // Mix new target velocity + this.velocity = lerp( + targetVelocity, + this.velocity, + Math.pow(1 - this.frictionCoefficient, deltaTime) + ); + + // Integrate velocity to calculate new position + this.position = vec3.addScaled(position, this.velocity, deltaTime); + + // Invert the camera matrix to build the view matrix + this.view = mat4.invert(this.matrix); + return this.view; + } + + // Recalculates the yaw and pitch values from a directional vector + recalculateAngles(dir: Vec3) { + this.yaw = Math.atan2(dir[0], dir[2]); + this.pitch = -Math.asin(dir[1]); + } +} + +// ArcballCamera implements a basic orbiting camera around the world origin +export class ArcballCamera extends CameraBase implements Camera { + // The camera distance from the target + private distance = 0; + + // The current angular velocity + private angularVelocity = 0; + + // The current rotation axis + private axis_ = vec3.create(); + + // Returns the rotation axis + get axis() { + return this.axis_; + } + + // Assigns `vec` to the rotation axis + set axis(vec: Vec3) { + vec3.copy(vec, this.axis_); + } + + // Speed multiplier for camera rotation + rotationSpeed = 1; + + // Speed multiplier for camera zoom + zoomSpeed = 0.1; + + // Rotation velocity drag coeffient [0 .. 1] + // 0: Spins forever + // 1: Instantly stops spinning + frictionCoefficient = 0.999; + + // Construtor + constructor(options?: { + // The initial position of the camera + position?: Vec3; + }) { + super(); + if (options && options.position) { + this.position = options.position; + this.distance = vec3.len(this.position); + this.back = vec3.normalize(this.position); + this.recalcuateRight(); + this.recalcuateUp(); + } + } + + // Returns the camera matrix + get matrix() { + return super.matrix; + } + + // Assigns `mat` to the camera matrix, and recalcuates the distance + set matrix(mat: Mat4) { + super.matrix = mat; + this.distance = vec3.len(this.position); + } + + update(deltaTime: number, input: Input): Mat4 { + const epsilon = 0.0000001; + + if (input.analog.touching) { + // Currently being dragged. + this.angularVelocity = 0; + } else { + // Dampen any existing angular velocity + this.angularVelocity *= Math.pow(1 - this.frictionCoefficient, deltaTime); + } + + // Calculate the movement vector + const movement = vec3.create(); + vec3.addScaled(movement, this.right, input.analog.x, movement); + vec3.addScaled(movement, this.up, -input.analog.y, movement); + + // Cross the movement vector with the view direction to calculate the rotation axis x magnitude + const crossProduct = vec3.cross(movement, this.back); + + // Calculate the magnitude of the drag + const magnitude = vec3.len(crossProduct); + + if (magnitude > epsilon) { + // Normalize the crossProduct to get the rotation axis + this.axis = vec3.scale(crossProduct, 1 / magnitude); + + // Remember the current angular velocity. This is used when the touch is released for a fling. + this.angularVelocity = magnitude * this.rotationSpeed; + } + + // The rotation around this.axis to apply to the camera matrix this update + const rotationAngle = this.angularVelocity * deltaTime; + if (rotationAngle > epsilon) { + // Rotate the matrix around axis + // Note: The rotation is not done as a matrix-matrix multiply as the repeated multiplications + // will quickly introduce substantial error into the matrix. + this.back = vec3.normalize(rotate(this.back, this.axis, rotationAngle)); + this.recalcuateRight(); + this.recalcuateUp(); + } + + // recalculate `this.position` from `this.back` considering zoom + if (input.analog.zoom !== 0) { + this.distance *= 1 + input.analog.zoom * this.zoomSpeed; + } + this.position = vec3.scale(this.back, this.distance); + + // Invert the camera matrix to build the view matrix + this.view = mat4.invert(this.matrix); + return this.view; + } + + // Assigns `this.right` with the cross product of `this.up` and `this.back` + recalcuateRight() { + this.right = vec3.normalize(vec3.cross(this.up, this.back)); + } + + // Assigns `this.up` with the cross product of `this.back` and `this.right` + recalcuateUp() { + this.up = vec3.normalize(vec3.cross(this.back, this.right)); + } +} + +// Returns `x` clamped between [`min` .. `max`] +function clamp(x: number, min: number, max: number): number { + return Math.min(Math.max(x, min), max); +} + +// Returns `x` float-modulo `div` +function mod(x: number, div: number): number { + return x - Math.floor(Math.abs(x) / div) * div * Math.sign(x); +} + +// Returns `vec` rotated `angle` radians around `axis` +function rotate(vec: Vec3, axis: Vec3, angle: number): Vec3 { + return vec3.transformMat4Upper3x3(vec, mat4.rotation(axis, angle)); +} + +// Returns the linear interpolation between 'a' and 'b' using 's' +function lerp(a: Vec3, b: Vec3, s: number): Vec3 { + return vec3.addScaled(a, vec3.sub(b, a), s); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cameras/cube.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/cameras/cube.wgsl new file mode 100644 index 00000000..0513561f --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cameras/cube.wgsl @@ -0,0 +1,25 @@ +struct Uniforms { + modelViewProjectionMatrix : mat4x4f, +} + +@group(0) @binding(0) var uniforms : Uniforms; +@group(0) @binding(1) var mySampler: sampler; +@group(0) @binding(2) var myTexture: texture_2d; + +struct VertexOutput { + @builtin(position) Position : vec4f, + @location(0) fragUV : vec2f, +} + +@vertex +fn vertex_main( + @location(0) position : vec4f, + @location(1) uv : vec2f +) -> VertexOutput { + return VertexOutput(uniforms.modelViewProjectionMatrix * position, uv); +} + +@fragment +fn fragment_main(@location(0) fragUV: vec2f) -> @location(0) vec4f { + return textureSample(myTexture, mySampler, fragUV); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cameras/index.html b/bindings/wgpu/webgpu-samples-ts/sample/cameras/index.html new file mode 100644 index 00000000..b1cf4fa0 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cameras/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: cameras + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cameras/input.ts b/bindings/wgpu/webgpu-samples-ts/sample/cameras/input.ts new file mode 100644 index 00000000..6998a7e0 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cameras/input.ts @@ -0,0 +1,129 @@ +// Input holds as snapshot of input state +export default interface Input { + // Digital input (e.g keyboard state) + readonly digital: { + readonly forward: boolean; + readonly backward: boolean; + readonly left: boolean; + readonly right: boolean; + readonly up: boolean; + readonly down: boolean; + }; + // Analog input (e.g mouse, touchscreen) + readonly analog: { + readonly x: number; + readonly y: number; + readonly zoom: number; + readonly touching: boolean; + }; +} + +// InputHandler is a function that when called, returns the current Input state. +export type InputHandler = () => Input; + +// createInputHandler returns an InputHandler by attaching event handlers to the window and canvas. +export function createInputHandler( + window: Window, + canvas: HTMLCanvasElement +): InputHandler { + const digital = { + forward: false, + backward: false, + left: false, + right: false, + up: false, + down: false, + }; + const analog = { + x: 0, + y: 0, + zoom: 0, + }; + let mouseDown = false; + + const setDigital = (e: KeyboardEvent, value: boolean) => { + switch (e.code) { + case 'KeyW': + digital.forward = value; + e.preventDefault(); + e.stopPropagation(); + break; + case 'KeyS': + digital.backward = value; + e.preventDefault(); + e.stopPropagation(); + break; + case 'KeyA': + digital.left = value; + e.preventDefault(); + e.stopPropagation(); + break; + case 'KeyD': + digital.right = value; + e.preventDefault(); + e.stopPropagation(); + break; + case 'Space': + digital.up = value; + e.preventDefault(); + e.stopPropagation(); + break; + case 'ShiftLeft': + case 'ControlLeft': + case 'KeyC': + digital.down = value; + e.preventDefault(); + e.stopPropagation(); + break; + } + }; + + window.addEventListener('keydown', (e) => setDigital(e, true)); + window.addEventListener('keyup', (e) => setDigital(e, false)); + + canvas.style.touchAction = 'pinch-zoom'; + canvas.addEventListener('pointerdown', () => { + mouseDown = true; + }); + canvas.addEventListener('pointerup', () => { + mouseDown = false; + }); + canvas.addEventListener('pointermove', (e) => { + mouseDown = e.pointerType == 'mouse' ? (e.buttons & 1) !== 0 : true; + if (mouseDown) { + analog.x += e.movementX; + analog.y += e.movementY; + } + }); + canvas.addEventListener( + 'wheel', + (e) => { + mouseDown = (e.buttons & 1) !== 0; + if (mouseDown) { + // The scroll value varies substantially between user agents / browsers. + // Just use the sign. + analog.zoom += Math.sign(e.deltaY); + e.preventDefault(); + e.stopPropagation(); + } + }, + {passive: false} + ); + + return () => { + const out = { + digital, + analog: { + x: analog.x, + y: analog.y, + zoom: analog.zoom, + touching: mouseDown, + }, + }; + // Clear the analog values, as these accumulate. + analog.x = 0; + analog.y = 0; + analog.zoom = 0; + return out; + }; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cameras/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/cameras/main.ts new file mode 100644 index 00000000..071e4dc2 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cameras/main.ts @@ -0,0 +1,233 @@ +import {mat4, vec3} from 'wgpu-matrix'; +import {GUI} from 'dat.gui'; +import { + cubeVertexArray, + cubeVertexSize, + cubeUVOffset, + cubePositionOffset, + cubeVertexCount, +} from '../../meshes/cube'; +import cubeWGSL from './cube.wgsl'; +import {ArcballCamera, WASDCamera} from './camera'; +import {createInputHandler} from './input'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; + +// The input handler +const inputHandler = createInputHandler(window, canvas); + +// The camera types +const initialCameraPosition = vec3.create(3, 2, 5); +const cameras = { + arcball: new ArcballCamera({position: initialCameraPosition}), + WASD: new WASDCamera({position: initialCameraPosition}), +}; + +const gui = new GUI(); + +// GUI parameters +const params: { type: 'arcball' | 'WASD' } = { + type: 'arcball', +}; + +// Callback handler for camera mode +let oldCameraType = params.type; +gui.add(params, 'type', ['arcball', 'WASD']).onChange(() => { + // Copy the camera matrix from old to new + const newCameraType = params.type; + cameras[newCameraType].matrix = cameras[oldCameraType].matrix; + oldCameraType = newCameraType; +}); + +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +// Create a vertex buffer from the cube data. +const verticesBuffer = device.createBuffer({ + size: cubeVertexArray.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +new Float32Array(verticesBuffer.getMappedRange()).set(cubeVertexArray); +verticesBuffer.unmap(); + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: cubeWGSL, + }), + buffers: [ + { + arrayStride: cubeVertexSize, + attributes: [ + { + // position + shaderLocation: 0, + offset: cubePositionOffset, + format: 'float32x4', + }, + { + // uv + shaderLocation: 1, + offset: cubeUVOffset, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + code: cubeWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + cullMode: 'back', + }, + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus', + }, +}); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const uniformBufferSize = 4 * 16; // 4x4 matrix +const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +// Fetch the image and upload it into a GPUTexture. +let cubeTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/Di-3d.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + + cubeTexture = device.createTexture({ + size: [imageBitmap.width, imageBitmap.height, 1], + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + device.queue.copyExternalImageToTexture( + {source: imageBitmap}, + {texture: cubeTexture}, + [imageBitmap.width, imageBitmap.height] + ); +} + +// Create a sampler with linear filtering for smooth interpolation. +const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', +}); + +const uniformBindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + { + binding: 1, + resource: sampler, + }, + { + binding: 2, + resource: cubeTexture.createView(), + }, + ], +}); + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: {r: 0.5, g: 0.5, b: 0.5, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +const aspect = canvas.width / canvas.height; +const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 100.0); +const modelViewProjectionMatrix = mat4.create(); + +function getModelViewProjectionMatrix(deltaTime: number) { + const camera = cameras[params.type]; + const viewMatrix = camera.update(deltaTime, inputHandler()); + mat4.multiply(projectionMatrix, viewMatrix, modelViewProjectionMatrix); + return modelViewProjectionMatrix as Float32Array; +} + +let lastFrameMS = Date.now(); + +function frame() { + const now = Date.now(); + const deltaTime = (now - lastFrameMS) / 1000; + lastFrameMS = now; + + const modelViewProjection = getModelViewProjectionMatrix(deltaTime); + device.queue.writeBuffer( + uniformBuffer, + 0, + modelViewProjection.buffer, + modelViewProjection.byteOffset, + modelViewProjection.byteLength + ); + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.setBindGroup(0, uniformBindGroup); + passEncoder.setVertexBuffer(0, verticesBuffer); + passEncoder.draw(cubeVertexCount); + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cameras/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/cameras/meta.ts new file mode 100644 index 00000000..f38e208b --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cameras/meta.ts @@ -0,0 +1,12 @@ +export default { + name: 'Cameras', + description: 'This example provides example camera implementations', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'camera.ts'}, + {path: 'input.ts'}, + {path: 'cube.wgsl'}, + {path: '../../meshes/cube.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/clusteredShading/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/clusteredShading/meta.ts new file mode 100644 index 00000000..05970357 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/clusteredShading/meta.ts @@ -0,0 +1,10 @@ +export default { + name: 'Clustered Shading', + description: `Shows a simple clustered forward shading renderer. + +Source at https://github.com/toji/webgpu-clustered-shading/ +`, + filename: __DIRNAME__, + url: 'https://toji.github.io/webgpu-clustered-shading/', + sources: [], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/index.html b/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/index.html new file mode 100644 index 00000000..52f9380d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: computeBoids + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/main.ts new file mode 100644 index 00000000..d3e36af8 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/main.ts @@ -0,0 +1,340 @@ +import spriteWGSL from './sprite.wgsl'; +import updateSpritesWGSL from './updateSprites.wgsl'; +import {GUI} from 'dat.gui'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); + +const hasTimestampQuery = adapter.features.has('timestamp-query'); +const device = await adapter.requestDevice({ + requiredFeatures: hasTimestampQuery ? ['timestamp-query'] : [], +}); + +const perfDisplayContainer = document.createElement('div'); +perfDisplayContainer.style.color = 'white'; +perfDisplayContainer.style.backdropFilter = 'blur(10px)'; +perfDisplayContainer.style.position = 'absolute'; +perfDisplayContainer.style.bottom = '10px'; +perfDisplayContainer.style.left = '10px'; +perfDisplayContainer.style.textAlign = 'left'; + +const perfDisplay = document.createElement('pre'); +perfDisplay.style.margin = '.5em'; +perfDisplayContainer.appendChild(perfDisplay); +if (canvas.parentNode) { + canvas.parentNode.appendChild(perfDisplayContainer); +} else { + console.error('canvas.parentNode is null'); +} + +const context = canvas.getContext('webgpu') as GPUCanvasContext; +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const spriteShaderModule = device.createShaderModule({code: spriteWGSL}); +const renderPipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: spriteShaderModule, + buffers: [ + { + // instanced particles buffer + arrayStride: 4 * 4, + stepMode: 'instance', + attributes: [ + { + // instance position + shaderLocation: 0, + offset: 0, + format: 'float32x2', + }, + { + // instance velocity + shaderLocation: 1, + offset: 2 * 4, + format: 'float32x2', + }, + ], + }, + { + // vertex buffer + arrayStride: 2 * 4, + stepMode: 'vertex', + attributes: [ + { + // vertex positions + shaderLocation: 2, + offset: 0, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: spriteShaderModule, + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, +}); + +const computePipeline = device.createComputePipeline({ + layout: 'auto', + compute: { + module: device.createShaderModule({ + code: updateSpritesWGSL, + }), + }, +}); + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined as GPUTextureView, // Assigned later + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear' as const, + storeOp: 'store' as const, + }, + ], +}; + +const computePassDescriptor: GPUComputePassDescriptor = {}; + +/** Storage for timestamp query results */ +let querySet: GPUQuerySet | undefined = undefined; +/** Timestamps are resolved into this buffer */ +let resolveBuffer: GPUBuffer | undefined = undefined; +/** Pool of spare buffers for MAP_READing the timestamps back to CPU. A buffer + * is taken from the pool (if available) when a readback is needed, and placed + * back into the pool once the readback is done and it's unmapped. */ +const spareResultBuffers = []; + +if (hasTimestampQuery) { + querySet = device.createQuerySet({ + type: 'timestamp', + count: 4, + }); + resolveBuffer = device.createBuffer({ + size: 4 * BigInt64Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.QUERY_RESOLVE | GPUBufferUsage.COPY_SRC, + }); + computePassDescriptor.timestampWrites = { + querySet, + beginningOfPassWriteIndex: 0, + endOfPassWriteIndex: 1, + }; + renderPassDescriptor.timestampWrites = { + querySet, + beginningOfPassWriteIndex: 2, + endOfPassWriteIndex: 3, + }; +} + +// prettier-ignore +const vertexBufferData = new Float32Array([ + -0.01, -0.02, 0.01, + -0.02, 0.0, 0.02, +]); + +const spriteVertexBuffer = device.createBuffer({ + size: vertexBufferData.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +new Float32Array(spriteVertexBuffer.getMappedRange()).set(vertexBufferData); +spriteVertexBuffer.unmap(); + +const simParams = { + deltaT: 0.04, + rule1Distance: 0.1, + rule2Distance: 0.025, + rule3Distance: 0.025, + rule1Scale: 0.02, + rule2Scale: 0.05, + rule3Scale: 0.005, +}; + +const simParamBufferSize = 7 * Float32Array.BYTES_PER_ELEMENT; +const simParamBuffer = device.createBuffer({ + size: simParamBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +function updateSimParams() { + device.queue.writeBuffer( + simParamBuffer, + 0, + new Float32Array([ + simParams.deltaT, + simParams.rule1Distance, + simParams.rule2Distance, + simParams.rule3Distance, + simParams.rule1Scale, + simParams.rule2Scale, + simParams.rule3Scale, + ]) + ); +} + +const gui = new GUI(); +updateSimParams(); +Object.keys(simParams).forEach((k) => { + const key = k as keyof typeof simParams; + gui.add(simParams, key).onFinishChange(updateSimParams); +}); + +const numParticles = 1500; +const initialParticleData = new Float32Array(numParticles * 4); +for (let i = 0; i < numParticles; ++i) { + initialParticleData[4 * i + 0] = 2 * (Math.random() - 0.5); + initialParticleData[4 * i + 1] = 2 * (Math.random() - 0.5); + initialParticleData[4 * i + 2] = 2 * (Math.random() - 0.5) * 0.1; + initialParticleData[4 * i + 3] = 2 * (Math.random() - 0.5) * 0.1; +} + +const particleBuffers: GPUBuffer[] = new Array(2); +const particleBindGroups: GPUBindGroup[] = new Array(2); +for (let i = 0; i < 2; ++i) { + particleBuffers[i] = device.createBuffer({ + size: initialParticleData.byteLength, + usage: GPUBufferUsage.VERTEX | GPUBufferUsage.STORAGE, + mappedAtCreation: true, + }); + new Float32Array(particleBuffers[i].getMappedRange()).set( + initialParticleData + ); + particleBuffers[i].unmap(); +} + +for (let i = 0; i < 2; ++i) { + particleBindGroups[i] = device.createBindGroup({ + layout: computePipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: simParamBuffer, + }, + }, + { + binding: 1, + resource: { + buffer: particleBuffers[i], + offset: 0, + size: initialParticleData.byteLength, + }, + }, + { + binding: 2, + resource: { + buffer: particleBuffers[(i + 1) % 2], + offset: 0, + size: initialParticleData.byteLength, + }, + }, + ], + }); +} + +let t = 0; +let computePassDurationSum = 0; +let renderPassDurationSum = 0; +let timerSamples = 0; + +function frame() { + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + { + const passEncoder = commandEncoder.beginComputePass(computePassDescriptor); + passEncoder.setPipeline(computePipeline); + passEncoder.setBindGroup(0, particleBindGroups[t % 2]); + passEncoder.dispatchWorkgroups(Math.ceil(numParticles / 64)); + passEncoder.end(); + } + { + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(renderPipeline); + passEncoder.setVertexBuffer(0, particleBuffers[(t + 1) % 2]); + passEncoder.setVertexBuffer(1, spriteVertexBuffer); + passEncoder.draw(3, numParticles, 0, 0); + passEncoder.end(); + } + + let resultBuffer: GPUBuffer | undefined = undefined; + if (hasTimestampQuery) { + resultBuffer = + spareResultBuffers.pop() || + device.createBuffer({ + size: 4 * BigInt64Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ, + }); + commandEncoder.resolveQuerySet(querySet, 0, 4, resolveBuffer, 0); + commandEncoder.copyBufferToBuffer( + resolveBuffer, + 0, + resultBuffer, + 0, + resultBuffer.size + ); + } + + device.queue.submit([commandEncoder.finish()]); + + if (hasTimestampQuery) { + resultBuffer.mapAsync(GPUMapMode.READ).then(() => { + const times = new BigInt64Array(resultBuffer.getMappedRange()); + const computePassDuration = Number(times[1] - times[0]); + const renderPassDuration = Number(times[3] - times[2]); + + // In some cases the timestamps may wrap around and produce a negative + // number as the GPU resets it's timings. These can safely be ignored. + if (computePassDuration > 0 && renderPassDuration > 0) { + computePassDurationSum += computePassDuration; + renderPassDurationSum += renderPassDuration; + timerSamples++; + } + resultBuffer.unmap(); + + // Periodically update the text for the timer stats + const kNumTimerSamplesPerUpdate = 100; + if (timerSamples >= kNumTimerSamplesPerUpdate) { + const avgComputeMicroseconds = Math.round( + computePassDurationSum / timerSamples / 1000 + ); + const avgRenderMicroseconds = Math.round( + renderPassDurationSum / timerSamples / 1000 + ); + perfDisplay.textContent = `\ +avg compute pass duration: ${avgComputeMicroseconds}µs +avg render pass duration: ${avgRenderMicroseconds}µs +spare readback buffers: ${spareResultBuffers.length}`; + computePassDurationSum = 0; + renderPassDurationSum = 0; + timerSamples = 0; + } + spareResultBuffers.push(resultBuffer); + }); + } + + ++t; + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/meta.ts new file mode 100644 index 00000000..0729803b --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/meta.ts @@ -0,0 +1,14 @@ +export default { + name: 'Compute Boids', + description: + 'A GPU compute particle simulation that mimics \ + the flocking behavior of birds. A compute shader updates \ + two ping-pong buffers which store particle data. The data \ + is used to draw instanced particles.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'updateSprites.wgsl'}, + {path: 'sprite.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/sprite.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/sprite.wgsl new file mode 100644 index 00000000..ec58780a --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/sprite.wgsl @@ -0,0 +1,31 @@ +struct VertexOutput { + @builtin(position) position : vec4f, + @location(4) color : vec4f, +} + +@vertex +fn vert_main( + @location(0) a_particlePos : vec2f, + @location(1) a_particleVel : vec2f, + @location(2) a_pos : vec2f +) -> VertexOutput { + let angle = -atan2(a_particleVel.x, a_particleVel.y); + let pos = vec2( + (a_pos.x * cos(angle)) - (a_pos.y * sin(angle)), + (a_pos.x * sin(angle)) + (a_pos.y * cos(angle)) + ); + + var output : VertexOutput; + output.position = vec4(pos + a_particlePos, 0.0, 1.0); + output.color = vec4( + 1.0 - sin(angle + 1.0) - a_particleVel.y, + pos.x * 100.0 - a_particleVel.y + 0.1, + a_particleVel.x + cos(angle + 0.5), + 1.0); + return output; +} + +@fragment +fn frag_main(@location(4) color : vec4f) -> @location(0) vec4f { + return color; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/updateSprites.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/updateSprites.wgsl new file mode 100644 index 00000000..afc68956 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/computeBoids/updateSprites.wgsl @@ -0,0 +1,83 @@ +struct Particle { + pos : vec2f, + vel : vec2f, +} +struct SimParams { + deltaT : f32, + rule1Distance : f32, + rule2Distance : f32, + rule3Distance : f32, + rule1Scale : f32, + rule2Scale : f32, + rule3Scale : f32, +} +struct Particles { + particles : array, +} +@binding(0) @group(0) var params : SimParams; +@binding(1) @group(0) var particlesA : Particles; +@binding(2) @group(0) var particlesB : Particles; + +// https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp +@compute @workgroup_size(64) +fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3u) { + var index = GlobalInvocationID.x; + + var vPos = particlesA.particles[index].pos; + var vVel = particlesA.particles[index].vel; + var cMass = vec2(0.0); + var cVel = vec2(0.0); + var colVel = vec2(0.0); + var cMassCount = 0u; + var cVelCount = 0u; + var pos : vec2f; + var vel : vec2f; + + for (var i = 0u; i < arrayLength(&particlesA.particles); i++) { + if (i == index) { + continue; + } + + pos = particlesA.particles[i].pos.xy; + vel = particlesA.particles[i].vel.xy; + if (distance(pos, vPos) < params.rule1Distance) { + cMass += pos; + cMassCount++; + } + if (distance(pos, vPos) < params.rule2Distance) { + colVel -= pos - vPos; + } + if (distance(pos, vPos) < params.rule3Distance) { + cVel += vel; + cVelCount++; + } + } + if (cMassCount > 0) { + cMass = (cMass / vec2(f32(cMassCount))) - vPos; + } + if (cVelCount > 0) { + cVel /= f32(cVelCount); + } + vVel += (cMass * params.rule1Scale) + (colVel * params.rule2Scale) + (cVel * params.rule3Scale); + + // clamp velocity for a more pleasing simulation + vVel = normalize(vVel) * clamp(length(vVel), 0.0, 0.1); + // kinematic update + vPos = vPos + (vVel * params.deltaT); + // Wrap around boundary + if (vPos.x < -1.0) { + vPos.x = 1.0; + } + if (vPos.x > 1.0) { + vPos.x = -1.0; + } + if (vPos.y < -1.0) { + vPos.y = 1.0; + } + if (vPos.y > 1.0) { + vPos.y = -1.0; + } + // Write back + particlesB.particles[index].pos = vPos; + particlesB.particles[index].vel = vVel; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/common.ts b/bindings/wgpu/webgpu-samples-ts/sample/cornell/common.ts new file mode 100644 index 00000000..93669383 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/common.ts @@ -0,0 +1,124 @@ +import {mat4, vec3} from 'wgpu-matrix'; +import commonWGSL from './common.wgsl'; + +/** + * Common holds the shared WGSL between the shaders, including the common uniform buffer. + */ +export default class Common { + /** The WGSL of the common shader */ + readonly wgsl = commonWGSL; + /** The common uniform buffer bind group and layout */ + readonly uniforms: { + bindGroupLayout: GPUBindGroupLayout; + bindGroup: GPUBindGroup; + }; + + private readonly device: GPUDevice; + private readonly uniformBuffer: GPUBuffer; + + private frame = 0; + + constructor(device: GPUDevice, quads: GPUBuffer) { + this.device = device; + this.uniformBuffer = device.createBuffer({ + label: 'Common.uniformBuffer', + size: + 0 + // + 4 * 16 + // mvp + 4 * 16 + // inv_mvp + 4 * 4, // seed + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); + + const bindGroupLayout = device.createBindGroupLayout({ + label: 'Common.bindGroupLayout', + entries: [ + { + // common_uniforms + binding: 0, + visibility: GPUShaderStage.VERTEX | GPUShaderStage.COMPUTE, + buffer: {type: 'uniform'}, + }, + { + // quads + binding: 1, + visibility: GPUShaderStage.COMPUTE, + buffer: {type: 'read-only-storage'}, + }, + ], + }); + + const bindGroup = device.createBindGroup({ + label: 'Common.bindGroup', + layout: bindGroupLayout, + entries: [ + { + // common_uniforms + binding: 0, + resource: { + buffer: this.uniformBuffer, + offset: 0, + size: this.uniformBuffer.size, + }, + }, + { + // quads + binding: 1, + resource: { + buffer: quads, + offset: 0, + size: quads.size, + }, + }, + ], + }); + + this.uniforms = {bindGroupLayout, bindGroup}; + } + + /** Updates the uniform buffer data */ + update(params: { rotateCamera: boolean; aspect: number }) { + const projectionMatrix = mat4.perspective( + (2 * Math.PI) / 8, + params.aspect, + 0.5, + 100 + ); + + const viewRotation = params.rotateCamera ? this.frame / 1000 : 0; + + const viewMatrix = mat4.lookAt( + vec3.fromValues( + Math.sin(viewRotation) * 15, + 5, + Math.cos(viewRotation) * 15 + ), + vec3.fromValues(0, 5, 0), + vec3.fromValues(0, 1, 0) + ); + const mvp = mat4.multiply(projectionMatrix, viewMatrix); + const invMVP = mat4.invert(mvp); + + const uniformDataF32 = new Float32Array(this.uniformBuffer.size / 4); + const uniformDataU32 = new Uint32Array(uniformDataF32.buffer); + for (let i = 0; i < 16; i++) { + uniformDataF32[i] = mvp[i]; + } + for (let i = 0; i < 16; i++) { + uniformDataF32[i + 16] = invMVP[i]; + } + uniformDataU32[32] = 0xffffffff * Math.random(); + uniformDataU32[33] = 0xffffffff * Math.random(); + uniformDataU32[34] = 0xffffffff * Math.random(); + + this.device.queue.writeBuffer( + this.uniformBuffer, + 0, + uniformDataF32.buffer, + uniformDataF32.byteOffset, + uniformDataF32.byteLength + ); + + this.frame++; + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/common.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/cornell/common.wgsl new file mode 100644 index 00000000..0d962b7b --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/common.wgsl @@ -0,0 +1,155 @@ +const pi = 3.14159265359; + +// Quad describes 2D rectangle on a plane +struct Quad { + // The surface plane + plane : vec4f, + // A plane with a normal in the 'u' direction, intersecting the origin, at + // right-angles to the surface plane. + // The dot product of 'right' with a 'vec4(pos, 1)' will range between [-1..1] + // if the projected point is within the quad. + right : vec4f, + // A plane with a normal in the 'v' direction, intersecting the origin, at + // right-angles to the surface plane. + // The dot product of 'up' with a 'vec4(pos, 1)' will range between [-1..1] + // if the projected point is within the quad. + up : vec4f, + // The diffuse color of the quad + color : vec3f, + // Emissive value. 0=no emissive, 1=full emissive. + emissive : f32, +}; + +// Ray is a start point and direction. +struct Ray { + start : vec3f, + dir : vec3f, +} + +// Value for HitInfo.quad if no intersection occured. +const kNoHit = 0xffffffff; + +// HitInfo describes the hit location of a ray-quad intersection +struct HitInfo { + // Distance along the ray to the intersection + dist : f32, + // The quad index that was hit + quad : u32, + // The position of the intersection + pos : vec3f, + // The UVs of the quad at the point of intersection + uv : vec2f, +} + +// CommonUniforms uniform buffer data +struct CommonUniforms { + // Model View Projection matrix + mvp : mat4x4f, + // Inverse of mvp + inv_mvp : mat4x4f, + // Random seed for the workgroup + seed : vec3u, +} + +// The common uniform buffer binding. +@group(0) @binding(0) var common_uniforms : CommonUniforms; + +// The quad buffer binding. +@group(0) @binding(1) var quads : array; + +// intersect_ray_quad will check to see if the ray 'r' intersects the quad 'q'. +// If an intersection occurs, and the intersection is closer than 'closest' then +// the intersection information is returned, otherwise 'closest' is returned. +fn intersect_ray_quad(r : Ray, quad : u32, closest : HitInfo) -> HitInfo { + let q = quads[quad]; + let plane_dist = dot(q.plane, vec4(r.start, 1)); + let ray_dist = plane_dist / -dot(q.plane.xyz, r.dir); + let pos = r.start + r.dir * ray_dist; + let uv = vec2(dot(vec4f(pos, 1), q.right), + dot(vec4f(pos, 1), q.up)) * 0.5 + 0.5; + let hit = plane_dist > 0 && + ray_dist > 0 && + ray_dist < closest.dist && + all((uv > vec2f()) & (uv < vec2f(1))); + return HitInfo( + select(closest.dist, ray_dist, hit), + select(closest.quad, quad, hit), + select(closest.pos, pos, hit), + select(closest.uv, uv, hit), + ); +} + +// raytrace finds the closest intersecting quad for the given ray +fn raytrace(ray : Ray) -> HitInfo { + var hit = HitInfo(); + hit.dist = 1e20; + hit.quad = kNoHit; + for (var quad = 0u; quad < arrayLength(&quads); quad++) { + hit = intersect_ray_quad(ray, quad, hit); + } + return hit; +} + +// A psuedo random number. Initialized with init_rand(), updated with rand(). +var rnd : vec3u; + +// Initializes the random number generator. +fn init_rand(invocation_id : vec3u) { + const A = vec3(1741651 * 1009, + 140893 * 1609 * 13, + 6521 * 983 * 7 * 2); + rnd = (invocation_id * A) ^ common_uniforms.seed; +} + +// Returns a random number between 0 and 1. +fn rand() -> f32 { + const C = vec3(60493 * 9377, + 11279 * 2539 * 23, + 7919 * 631 * 5 * 3); + + rnd = (rnd * C) ^ (rnd.yzx >> vec3(4u)); + return f32(rnd.x ^ rnd.y) / f32(0xffffffff); +} + +// Returns a random point within a unit sphere centered at (0,0,0). +fn rand_unit_sphere() -> vec3f { + var u = rand(); + var v = rand(); + var theta = u * 2.0 * pi; + var phi = acos(2.0 * v - 1.0); + var r = pow(rand(), 1.0/3.0); + var sin_theta = sin(theta); + var cos_theta = cos(theta); + var sin_phi = sin(phi); + var cos_phi = cos(phi); + var x = r * sin_phi * sin_theta; + var y = r * sin_phi * cos_theta; + var z = r * cos_phi; + return vec3f(x, y, z); +} + +fn rand_concentric_disk() -> vec2f { + let u = vec2f(rand(), rand()); + let uOffset = 2.f * u - vec2f(1, 1); + + if (uOffset.x == 0 && uOffset.y == 0){ + return vec2f(0, 0); + } + + var theta = 0.0; + var r = 0.0; + if (abs(uOffset.x) > abs(uOffset.y)) { + r = uOffset.x; + theta = (pi / 4) * (uOffset.y / uOffset.x); + } else { + r = uOffset.y; + theta = (pi / 2) - (pi / 4) * (uOffset.x / uOffset.y); + } + return r * vec2f(cos(theta), sin(theta)); +} + +fn rand_cosine_weighted_hemisphere() -> vec3f { + let d = rand_concentric_disk(); + let z = sqrt(max(0.0, 1.0 - d.x * d.x - d.y * d.y)); + return vec3f(d.x, d.y, z); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/index.html b/bindings/wgpu/webgpu-samples-ts/sample/cornell/index.html new file mode 100644 index 00000000..b45e1b3e --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: cornell + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/cornell/main.ts new file mode 100644 index 00000000..258d74b6 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/main.ts @@ -0,0 +1,99 @@ +import {GUI} from 'dat.gui'; +import Scene from './scene'; +import Common from './common'; +import Radiosity from './radiosity'; +import Rasterizer from './rasterizer'; +import Tonemapper from './tonemapper'; +import Raytracer from './raytracer'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; + +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); +const requiredFeatures: GPUFeatureName[] = + presentationFormat === 'bgra8unorm' ? ['bgra8unorm-storage'] : []; +const adapter = await navigator.gpu.requestAdapter(); +for (const feature of requiredFeatures) { + if (!adapter.features.has(feature)) { + throw new Error( + `sample requires ${feature}, but is not supported by the adapter` + ); + } +} +const device = await adapter.requestDevice({requiredFeatures}); + +const params: { + renderer: 'rasterizer' | 'raytracer'; + rotateCamera: boolean; +} = { + renderer: 'rasterizer', + rotateCamera: true, +}; + +const gui = new GUI(); +gui.add(params, 'renderer', ['rasterizer', 'raytracer']); +gui.add(params, 'rotateCamera', true); + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; + +const context = canvas.getContext('webgpu') as GPUCanvasContext; +context.configure({ + device, + format: presentationFormat, + usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.STORAGE_BINDING, + alphaMode: 'premultiplied', +}); + +const framebuffer = device.createTexture({ + label: 'framebuffer', + size: [canvas.width, canvas.height], + format: 'rgba16float', + usage: + GPUTextureUsage.RENDER_ATTACHMENT | + GPUTextureUsage.STORAGE_BINDING | + GPUTextureUsage.TEXTURE_BINDING, +}); + +const scene = new Scene(device); +const common = new Common(device, scene.quadBuffer); +const radiosity = new Radiosity(device, common, scene); +const rasterizer = new Rasterizer( + device, + common, + scene, + radiosity, + framebuffer +); +const raytracer = new Raytracer(device, common, radiosity, framebuffer); + +function frame() { + const canvasTexture = context.getCurrentTexture(); + const commandEncoder = device.createCommandEncoder(); + + common.update({ + rotateCamera: params.rotateCamera, + aspect: canvas.width / canvas.height, + }); + radiosity.run(commandEncoder); + + switch (params.renderer) { + case 'rasterizer': { + rasterizer.run(commandEncoder); + break; + } + case 'raytracer': { + raytracer.run(commandEncoder); + break; + } + } + + const tonemapper = new Tonemapper(device, common, framebuffer, canvasTexture); + tonemapper.run(commandEncoder); + + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/cornell/meta.ts new file mode 100644 index 00000000..318638ae --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/meta.ts @@ -0,0 +1,20 @@ +export default { + name: 'Cornell box', + description: + 'A classic Cornell box, using a lightmap generated using software ray-tracing.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'common.ts'}, + {path: 'scene.ts'}, + {path: 'radiosity.ts'}, + {path: 'rasterizer.ts'}, + {path: 'raytracer.ts'}, + {path: 'tonemapper.ts'}, + {path: 'radiosity.wgsl'}, + {path: 'rasterizer.wgsl'}, + {path: 'raytracer.wgsl'}, + {path: 'tonemapper.wgsl'}, + {path: 'common.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/radiosity.ts b/bindings/wgpu/webgpu-samples-ts/sample/cornell/radiosity.ts new file mode 100644 index 00000000..8926bc35 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/radiosity.ts @@ -0,0 +1,222 @@ +import Common from './common'; +import radiosityWGSL from './radiosity.wgsl'; +import Scene from './scene'; + +/** + * Radiosity computes lightmaps, calculated by software raytracing of light in + * the scene. + */ +export default class Radiosity { + // The output lightmap format and dimensions + static readonly lightmapFormat = 'rgba16float'; + static readonly lightmapWidth = 256; + static readonly lightmapHeight = 256; + + // The output lightmap. + readonly lightmap: GPUTexture; + + // Number of photons emitted per workgroup. + // This is equal to the workgroup size (one photon per invocation) + private readonly kPhotonsPerWorkgroup = 256; + // Number of radiosity workgroups dispatched per frame. + private readonly kWorkgroupsPerFrame = 1024; + private readonly kPhotonsPerFrame = + this.kPhotonsPerWorkgroup * this.kWorkgroupsPerFrame; + // Maximum value that can be added to the 'accumulation' buffer, per photon, + // across all texels. + private readonly kPhotonEnergy = 100000; + // The total number of lightmap texels for all quads. + private readonly kTotalLightmapTexels; + + private readonly kAccumulationToLightmapWorkgroupSizeX = 16; + private readonly kAccumulationToLightmapWorkgroupSizeY = 16; + + private readonly device: GPUDevice; + private readonly common: Common; + private readonly scene: Scene; + private readonly radiosityPipeline: GPUComputePipeline; + private readonly accumulationToLightmapPipeline: GPUComputePipeline; + private readonly bindGroup: GPUBindGroup; + private readonly accumulationBuffer: GPUBuffer; + private readonly uniformBuffer: GPUBuffer; + + // The 'accumulation' buffer average value + private accumulationMean = 0; + + // The maximum value of 'accumulationAverage' before all values in + // 'accumulation' are reduced to avoid integer overflows. + private readonly kAccumulationMeanMax = 0x10000000; + + constructor(device: GPUDevice, common: Common, scene: Scene) { + this.device = device; + this.common = common; + this.scene = scene; + this.lightmap = device.createTexture({ + label: 'Radiosity.lightmap', + size: { + width: Radiosity.lightmapWidth, + height: Radiosity.lightmapHeight, + depthOrArrayLayers: scene.quads.length, + }, + format: Radiosity.lightmapFormat, + usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.STORAGE_BINDING, + }); + this.accumulationBuffer = device.createBuffer({ + label: 'Radiosity.accumulationBuffer', + size: + Radiosity.lightmapWidth * + Radiosity.lightmapHeight * + scene.quads.length * + 16, + usage: GPUBufferUsage.STORAGE, + }); + this.kTotalLightmapTexels = + Radiosity.lightmapWidth * Radiosity.lightmapHeight * scene.quads.length; + this.uniformBuffer = device.createBuffer({ + label: 'Radiosity.uniformBuffer', + size: 8 * 4, // 8 x f32 + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); + const bindGroupLayout = device.createBindGroupLayout({ + label: 'Radiosity.bindGroupLayout', + entries: [ + { + // accumulation buffer + binding: 0, + visibility: GPUShaderStage.COMPUTE, + buffer: {type: 'storage'}, + }, + { + // lightmap + binding: 1, + visibility: GPUShaderStage.COMPUTE, + storageTexture: { + access: 'write-only', + format: Radiosity.lightmapFormat, + viewDimension: '2d-array', + }, + }, + { + // radiosity_uniforms + binding: 2, + visibility: GPUShaderStage.COMPUTE, + buffer: {type: 'uniform'}, + }, + ], + }); + this.bindGroup = device.createBindGroup({ + label: 'Radiosity.bindGroup', + layout: bindGroupLayout, + entries: [ + { + // accumulation buffer + binding: 0, + resource: { + buffer: this.accumulationBuffer, + size: this.accumulationBuffer.size, + }, + }, + { + // lightmap + binding: 1, + resource: this.lightmap.createView(), + }, + { + // radiosity_uniforms + binding: 2, + resource: { + buffer: this.uniformBuffer, + size: this.uniformBuffer.size, + }, + }, + ], + }); + + const mod = device.createShaderModule({ + code: radiosityWGSL + common.wgsl, + }); + const pipelineLayout = device.createPipelineLayout({ + label: 'Radiosity.accumulatePipelineLayout', + bindGroupLayouts: [common.uniforms.bindGroupLayout, bindGroupLayout], + }); + + this.radiosityPipeline = device.createComputePipeline({ + label: 'Radiosity.radiosityPipeline', + layout: pipelineLayout, + compute: { + module: mod, + entryPoint: 'radiosity', + constants: { + PhotonsPerWorkgroup: this.kPhotonsPerWorkgroup, + PhotonEnergy: this.kPhotonEnergy, + }, + }, + }); + + this.accumulationToLightmapPipeline = device.createComputePipeline({ + label: 'Radiosity.accumulationToLightmapPipeline', + layout: pipelineLayout, + compute: { + module: mod, + entryPoint: 'accumulation_to_lightmap', + constants: { + AccumulationToLightmapWorkgroupSizeX: + this.kAccumulationToLightmapWorkgroupSizeX, + AccumulationToLightmapWorkgroupSizeY: + this.kAccumulationToLightmapWorkgroupSizeY, + }, + }, + }); + } + + run(commandEncoder: GPUCommandEncoder) { + // Calculate the new mean value for the accumulation buffer + this.accumulationMean += + (this.kPhotonsPerFrame * this.kPhotonEnergy) / this.kTotalLightmapTexels; + + // Calculate the 'accumulation' -> 'lightmap' scale factor from 'accumulationMean' + const accumulationToLightmapScale = 1 / this.accumulationMean; + // If 'accumulationMean' is greater than 'kAccumulationMeanMax', then reduce + // the 'accumulation' buffer values to prevent u32 overflow. + const accumulationBufferScale = + this.accumulationMean > 2 * this.kAccumulationMeanMax ? 0.5 : 1; + this.accumulationMean *= accumulationBufferScale; + + // Update the radiosity uniform buffer data. + const uniformDataF32 = new Float32Array(this.uniformBuffer.size / 4); + uniformDataF32[0] = accumulationToLightmapScale; + uniformDataF32[1] = accumulationBufferScale; + uniformDataF32[2] = this.scene.lightWidth; + uniformDataF32[3] = this.scene.lightHeight; + uniformDataF32[4] = this.scene.lightCenter[0]; + uniformDataF32[5] = this.scene.lightCenter[1]; + uniformDataF32[6] = this.scene.lightCenter[2]; + this.device.queue.writeBuffer( + this.uniformBuffer, + 0, + uniformDataF32.buffer, + uniformDataF32.byteOffset, + uniformDataF32.byteLength + ); + + // Dispatch the radiosity workgroups + const passEncoder = commandEncoder.beginComputePass(); + passEncoder.setBindGroup(0, this.common.uniforms.bindGroup); + passEncoder.setBindGroup(1, this.bindGroup); + passEncoder.setPipeline(this.radiosityPipeline); + passEncoder.dispatchWorkgroups(this.kWorkgroupsPerFrame); + + // Then copy the 'accumulation' data to 'lightmap' + passEncoder.setPipeline(this.accumulationToLightmapPipeline); + passEncoder.dispatchWorkgroups( + Math.ceil( + Radiosity.lightmapWidth / this.kAccumulationToLightmapWorkgroupSizeX + ), + Math.ceil( + Radiosity.lightmapHeight / this.kAccumulationToLightmapWorkgroupSizeY + ), + this.lightmap.depthOrArrayLayers + ); + passEncoder.end(); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/radiosity.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/cornell/radiosity.wgsl new file mode 100644 index 00000000..725c26c2 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/radiosity.wgsl @@ -0,0 +1,139 @@ +// A storage buffer holding an array of atomic. +// The array elements are a sequence of red, green, blue components, for each +// lightmap texel, for each quad surface. +@group(1) @binding(0) +var accumulation : array>; + +// The output lightmap texture. +@group(1) @binding(1) +var lightmap : texture_storage_2d_array; + +// Uniform data used by the accumulation_to_lightmap entry point +struct Uniforms { + // Scalar for converting accumulation values to output lightmap values + accumulation_to_lightmap_scale : f32, + // Accumulation buffer rescaling value + accumulation_buffer_scale : f32, + // The width of the light + light_width : f32, + // The height of the light + light_height : f32, + // The center of the light + light_center : vec3f, +} + +// accumulation_to_lightmap uniforms binding point +@group(1) @binding(2) var uniforms : Uniforms; + +// Number of photons emitted per workgroup +override PhotonsPerWorkgroup : u32; + +// Maximum value that can be added to the accumulation buffer from a single photon +override PhotonEnergy : f32; + +// Number of bounces of each photon +const PhotonBounces = 4; + +// Amount of light absorbed with each photon bounce (0: 0%, 1: 100%) +const LightAbsorbtion = 0.5; + +// Radiosity compute shader. +// Each invocation creates a photon from the light source, and accumulates +// bounce lighting into the 'accumulation' buffer. +@compute @workgroup_size(PhotonsPerWorkgroup) +fn radiosity(@builtin(global_invocation_id) invocation_id : vec3u) { + init_rand(invocation_id); + photon(); +} + +// Spawns a photon at the light source, performs ray tracing in the scene, +// accumulating light values into 'accumulation' for each quad surface hit. +fn photon() { + // Create a random ray from the light. + var ray = new_light_ray(); + // Give the photon an initial energy value. + var color = PhotonEnergy * vec3f(1, 0.8, 0.6); + + // Start bouncing. + for (var i = 0; i < (PhotonBounces+1); i++) { + // Find the closest hit of the ray with the scene's quads. + let hit = raytrace(ray); + let quad = quads[hit.quad]; + + // Bounce the ray. + ray.start = hit.pos + quad.plane.xyz * 1e-5; + ray.dir = normalize(reflect(ray.dir, quad.plane.xyz) + rand_unit_sphere() * 0.75); + + // Photon color is multiplied by the quad's color. + color *= quad.color; + + // Accumulate the aborbed light into the 'accumulation' buffer. + accumulate(hit.uv, hit.quad, color * LightAbsorbtion); + + // What wasn't absorbed is reflected. + color *= 1 - LightAbsorbtion; + } +} + +// Performs an atomicAdd() with 'color' into the 'accumulation' buffer at 'uv' +// and 'quad'. +fn accumulate(uv : vec2f, quad : u32, color : vec3f) { + let dims = textureDimensions(lightmap); + let base_idx = accumulation_base_index(vec2u(uv * vec2f(dims)), quad); + atomicAdd(&accumulation[base_idx + 0], u32(color.r + 0.5)); + atomicAdd(&accumulation[base_idx + 1], u32(color.g + 0.5)); + atomicAdd(&accumulation[base_idx + 2], u32(color.b + 0.5)); +} + +// Returns the base element index for the texel at 'coord' for 'quad' +fn accumulation_base_index(coord : vec2u, quad : u32) -> u32 { + let dims = textureDimensions(lightmap); + let c = min(vec2u(dims) - 1, coord); + return 3 * (c.x + dims.x * c.y + dims.x * dims.y * quad); +} + +// Returns a new Ray at a random point on the light, in a random downwards +// direction. +fn new_light_ray() -> Ray { + let center = uniforms.light_center; + let pos = center + vec3f(uniforms.light_width * (rand() - 0.5), + 0, + uniforms.light_height * (rand() - 0.5)); + var dir = rand_cosine_weighted_hemisphere().xzy; + dir.y = -dir.y; + return Ray(pos, dir); +} + +override AccumulationToLightmapWorkgroupSizeX : u32; +override AccumulationToLightmapWorkgroupSizeY : u32; + +// Compute shader used to copy the atomic data in 'accumulation' to +// 'lightmap'. 'accumulation' might also be scaled to reduce integer overflow. +@compute @workgroup_size(AccumulationToLightmapWorkgroupSizeX, AccumulationToLightmapWorkgroupSizeY) +fn accumulation_to_lightmap(@builtin(global_invocation_id) invocation_id : vec3u, + @builtin(workgroup_id) workgroup_id : vec3u) { + let dims = textureDimensions(lightmap); + let quad = workgroup_id.z; // The workgroup 'z' value holds the quad index. + let coord = invocation_id.xy; + if (all(coord < dims)) { + // Load the color value out of 'accumulation' + let base_idx = accumulation_base_index(coord, quad); + let color = vec3(f32(atomicLoad(&accumulation[base_idx + 0])), + f32(atomicLoad(&accumulation[base_idx + 1])), + f32(atomicLoad(&accumulation[base_idx + 2]))); + + // Multiply the color by 'uniforms.accumulation_to_lightmap_scale' and write it to + // the lightmap. + textureStore(lightmap, coord, quad, vec4(color * uniforms.accumulation_to_lightmap_scale, 1)); + + // If the 'accumulation' buffer is nearing saturation, then + // 'uniforms.accumulation_buffer_scale' will be less than 1, scaling the values + // to something less likely to overflow the u32. + if (uniforms.accumulation_buffer_scale != 1.0) { + let scaled = color * uniforms.accumulation_buffer_scale + 0.5; + atomicStore(&accumulation[base_idx + 0], u32(scaled.r)); + atomicStore(&accumulation[base_idx + 1], u32(scaled.g)); + atomicStore(&accumulation[base_idx + 2], u32(scaled.b)); + } + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/rasterizer.ts b/bindings/wgpu/webgpu-samples-ts/sample/cornell/rasterizer.ts new file mode 100644 index 00000000..c1e39f34 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/rasterizer.ts @@ -0,0 +1,134 @@ +import rasterizerWGSL from './rasterizer.wgsl'; + +import Common from './common'; +import Radiosity from './radiosity'; +import Scene from './scene'; + +/** + * Rasterizer renders the scene using a regular raserization graphics pipeline. + */ +export default class Rasterizer { + private readonly common: Common; + private readonly scene: Scene; + private readonly renderPassDescriptor: GPURenderPassDescriptor; + private readonly pipeline: GPURenderPipeline; + private readonly bindGroup: GPUBindGroup; + + constructor( + device: GPUDevice, + common: Common, + scene: Scene, + radiosity: Radiosity, + framebuffer: GPUTexture + ) { + this.common = common; + this.scene = scene; + + const depthTexture = device.createTexture({ + label: 'RasterizerRenderer.depthTexture', + size: [framebuffer.width, framebuffer.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, + }); + + this.renderPassDescriptor = { + label: 'RasterizerRenderer.renderPassDescriptor', + colorAttachments: [ + { + view: framebuffer.createView(), + clearValue: [0.1, 0.2, 0.3, 1], + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, + }; + + const bindGroupLayout = device.createBindGroupLayout({ + label: 'RasterizerRenderer.bindGroupLayout', + entries: [ + { + // lightmap + binding: 0, + visibility: GPUShaderStage.FRAGMENT | GPUShaderStage.COMPUTE, + texture: {viewDimension: '2d-array'}, + }, + { + // sampler + binding: 1, + visibility: GPUShaderStage.FRAGMENT | GPUShaderStage.COMPUTE, + sampler: {}, + }, + ], + }); + + this.bindGroup = device.createBindGroup({ + label: 'RasterizerRenderer.bindGroup', + layout: bindGroupLayout, + entries: [ + { + // lightmap + binding: 0, + resource: radiosity.lightmap.createView(), + }, + { + // sampler + binding: 1, + resource: device.createSampler({ + addressModeU: 'clamp-to-edge', + addressModeV: 'clamp-to-edge', + magFilter: 'linear', + minFilter: 'linear', + }), + }, + ], + }); + + const mod = device.createShaderModule({ + label: 'RasterizerRenderer.module', + code: rasterizerWGSL + common.wgsl, + }); + + this.pipeline = device.createRenderPipeline({ + label: 'RasterizerRenderer.pipeline', + layout: device.createPipelineLayout({ + bindGroupLayouts: [common.uniforms.bindGroupLayout, bindGroupLayout], + }), + vertex: { + module: mod, + buffers: scene.vertexBufferLayout, + }, + fragment: { + module: mod, + targets: [{format: framebuffer.format}], + }, + primitive: { + topology: 'triangle-list', + cullMode: 'back', + }, + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus', + }, + }); + } + + run(commandEncoder: GPUCommandEncoder) { + const passEncoder = commandEncoder.beginRenderPass( + this.renderPassDescriptor + ); + passEncoder.setPipeline(this.pipeline); + passEncoder.setVertexBuffer(0, this.scene.vertices); + passEncoder.setIndexBuffer(this.scene.indices, 'uint16'); + passEncoder.setBindGroup(0, this.common.uniforms.bindGroup); + passEncoder.setBindGroup(1, this.bindGroup); + passEncoder.drawIndexed(this.scene.indexCount); + passEncoder.end(); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/rasterizer.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/cornell/rasterizer.wgsl new file mode 100644 index 00000000..21eae420 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/rasterizer.wgsl @@ -0,0 +1,36 @@ +// The lightmap data +@group(1) @binding(0) var lightmap : texture_2d_array; + +// The sampler used to sample the lightmap +@group(1) @binding(1) var smpl : sampler; + +// Vertex shader input data +struct VertexIn { + @location(0) position : vec4f, + @location(1) uv : vec3f, + @location(2) emissive : vec3f, +} + +// Vertex shader output data +struct VertexOut { + @builtin(position) position : vec4f, + @location(0) uv : vec2f, + @location(1) emissive : vec3f, + @interpolate(flat) + @location(2) quad : u32, +} + +@vertex +fn vs_main(input : VertexIn) -> VertexOut { + var output : VertexOut; + output.position = common_uniforms.mvp * input.position; + output.uv = input.uv.xy; + output.quad = u32(input.uv.z + 0.5); + output.emissive = input.emissive; + return output; +} + +@fragment +fn fs_main(vertex_out : VertexOut) -> @location(0) vec4f { + return textureSample(lightmap, smpl, vertex_out.uv, vertex_out.quad) + vec4f(vertex_out.emissive, 1); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/raytracer.ts b/bindings/wgpu/webgpu-samples-ts/sample/cornell/raytracer.ts new file mode 100644 index 00000000..056d17d7 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/raytracer.ts @@ -0,0 +1,107 @@ +import raytracerWGSL from './raytracer.wgsl'; + +import Common from './common'; +import Radiosity from './radiosity'; + +/** + * Raytracer renders the scene using a software ray-tracing compute pipeline. + */ +export default class Raytracer { + private readonly common: Common; + private readonly framebuffer: GPUTexture; + private readonly pipeline: GPUComputePipeline; + private readonly bindGroup: GPUBindGroup; + + private readonly kWorkgroupSizeX = 16; + private readonly kWorkgroupSizeY = 16; + + constructor( + device: GPUDevice, + common: Common, + radiosity: Radiosity, + framebuffer: GPUTexture + ) { + this.common = common; + this.framebuffer = framebuffer; + const bindGroupLayout = device.createBindGroupLayout({ + label: 'Raytracer.bindGroupLayout', + entries: [ + { + // lightmap + binding: 0, + visibility: GPUShaderStage.FRAGMENT | GPUShaderStage.COMPUTE, + texture: {viewDimension: '2d-array'}, + }, + { + // sampler + binding: 1, + visibility: GPUShaderStage.FRAGMENT | GPUShaderStage.COMPUTE, + sampler: {}, + }, + { + // framebuffer + binding: 2, + visibility: GPUShaderStage.COMPUTE, + storageTexture: { + access: 'write-only', + format: framebuffer.format, + viewDimension: '2d', + }, + }, + ], + }); + + this.bindGroup = device.createBindGroup({ + label: 'rendererBindGroup', + layout: bindGroupLayout, + entries: [ + { + binding: 0, + resource: radiosity.lightmap.createView(), + }, + { + binding: 1, + resource: device.createSampler({ + addressModeU: 'clamp-to-edge', + addressModeV: 'clamp-to-edge', + addressModeW: 'clamp-to-edge', + magFilter: 'linear', + minFilter: 'linear', + }), + }, + { + binding: 2, + resource: framebuffer.createView(), + }, + ], + }); + + this.pipeline = device.createComputePipeline({ + label: 'raytracerPipeline', + layout: device.createPipelineLayout({ + bindGroupLayouts: [common.uniforms.bindGroupLayout, bindGroupLayout], + }), + compute: { + module: device.createShaderModule({ + code: raytracerWGSL + common.wgsl, + }), + constants: { + WorkgroupSizeX: this.kWorkgroupSizeX, + WorkgroupSizeY: this.kWorkgroupSizeY, + }, + }, + }); + } + + run(commandEncoder: GPUCommandEncoder) { + const passEncoder = commandEncoder.beginComputePass(); + passEncoder.setPipeline(this.pipeline); + passEncoder.setBindGroup(0, this.common.uniforms.bindGroup); + passEncoder.setBindGroup(1, this.bindGroup); + passEncoder.dispatchWorkgroups( + Math.ceil(this.framebuffer.width / this.kWorkgroupSizeX), + Math.ceil(this.framebuffer.height / this.kWorkgroupSizeY) + ); + passEncoder.end(); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/raytracer.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/cornell/raytracer.wgsl new file mode 100644 index 00000000..c6883c53 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/raytracer.wgsl @@ -0,0 +1,62 @@ +// The lightmap data +@group(1) @binding(0) var lightmap : texture_2d_array; + +// The sampler used to sample the lightmap +@group(1) @binding(1) var smpl : sampler; + +// The output framebuffer +@group(1) @binding(2) var framebuffer : texture_storage_2d; + +override WorkgroupSizeX : u32; +override WorkgroupSizeY : u32; + +const NumReflectionRays = 5; + +@compute @workgroup_size(WorkgroupSizeX, WorkgroupSizeY) +fn main(@builtin(global_invocation_id) invocation_id : vec3u) { + if (all(invocation_id.xy < textureDimensions(framebuffer))) { + init_rand(invocation_id); + + // Calculate the fragment's NDC coordinates for the intersection of the near + // clip plane and far clip plane + let uv = vec2f(invocation_id.xy) / vec2f(textureDimensions(framebuffer).xy); + let ndcXY = (uv - 0.5) * vec2(2, -2); + + // Transform the coordinates back into world space + var near = common_uniforms.inv_mvp * vec4f(ndcXY, 0.0, 1); + var far = common_uniforms.inv_mvp * vec4f(ndcXY, 1, 1); + near /= near.w; + far /= far.w; + + // Create a ray that starts at the near clip plane, heading in the fragment's + // z-direction, and raytrace to find the nearest quad that the ray intersects. + let ray = Ray(near.xyz, normalize(far.xyz - near.xyz)); + let hit = raytrace(ray); + + let hit_color = sample_hit(hit); + var normal = quads[hit.quad].plane.xyz; + + // Fire a few rays off the surface to collect some reflections + let bounce = reflect(ray.dir, normal); + var reflection : vec3f; + for (var i = 0; i < NumReflectionRays; i++) { + let reflection_dir = normalize(bounce + rand_unit_sphere()*0.1); + let reflection_ray = Ray(hit.pos + bounce * 1e-5, reflection_dir); + let reflection_hit = raytrace(reflection_ray); + reflection += sample_hit(reflection_hit); + } + let color = mix(reflection / NumReflectionRays, hit_color, 0.95); + + textureStore(framebuffer, invocation_id.xy, vec4(color, 1)); + } +} + + +// Returns the sampled hit quad's lightmap at 'hit.uv', and adds the quad's +// emissive value. +fn sample_hit(hit : HitInfo) -> vec3f { + let quad = quads[hit.quad]; + // Sample the quad's lightmap, and add emissive. + return textureSampleLevel(lightmap, smpl, hit.uv, hit.quad, 0).rgb + + quad.emissive * quad.color; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/scene.ts b/bindings/wgpu/webgpu-samples-ts/sample/cornell/scene.ts new file mode 100644 index 00000000..5502a42f --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/scene.ts @@ -0,0 +1,329 @@ +import {vec3} from 'wgpu-matrix'; + +type Vec3 = vec3.default; + +function reciprocal(v: Vec3) { + const s = 1 / vec3.lenSq(v); + return vec3.mul(vec3.fromValues(s, s, s), v); +} + +interface Quad { + center: Vec3; + right: Vec3; + up: Vec3; + color: Vec3; + emissive?: number; +} + +// ─────────┐ +// ╱ +Y ╱│ +// ┌────────┐ │ +// │ │+X +// │ +Z │ │ +// │ │╱ +// └────────┘ +enum CubeFace { + PositiveX, + PositiveY, + PositiveZ, + NegativeX, + NegativeY, + NegativeZ, +} + +function box(params: { + center: Vec3; + width: number; + height: number; + depth: number; + rotation: number; + color: Vec3 | Vec3[]; + type: 'convex' | 'concave'; +}): Quad[] { + // ─────────┐ + // ╱ +Y ╱│ + // ┌────────┐ │ y + // │ │+X ^ + // │ +Z │ │ │ -z + // │ │╱ │╱ + // └────────┘ └─────> x + const x = vec3.fromValues( + Math.cos(params.rotation) * (params.width / 2), + 0, + Math.sin(params.rotation) * (params.depth / 2) + ); + const y = vec3.fromValues(0, params.height / 2, 0); + const z = vec3.fromValues( + Math.sin(params.rotation) * (params.width / 2), + 0, + -Math.cos(params.rotation) * (params.depth / 2) + ); + const colors = + params.color instanceof Array + ? params.color + : new Array(6).fill(params.color); + const sign = (v: Vec3) => { + return params.type === 'concave' ? v : vec3.negate(v); + }; + return [ + { + // PositiveX + center: vec3.add(params.center, x), + right: sign(vec3.negate(z)), + up: y, + color: colors[CubeFace.PositiveX], + }, + { + // PositiveY + center: vec3.add(params.center, y), + right: sign(x), + up: vec3.negate(z), + color: colors[CubeFace.PositiveY], + }, + { + // PositiveZ + center: vec3.add(params.center, z), + right: sign(x), + up: y, + color: colors[CubeFace.PositiveZ], + }, + { + // NegativeX + center: vec3.sub(params.center, x), + right: sign(z), + up: y, + color: colors[CubeFace.NegativeX], + }, + { + // NegativeY + center: vec3.sub(params.center, y), + right: sign(x), + up: z, + color: colors[CubeFace.NegativeY], + }, + { + // NegativeZ + center: vec3.sub(params.center, z), + right: sign(vec3.negate(x)), + up: y, + color: colors[CubeFace.NegativeZ], + }, + ]; +} + +const light: Quad = { + center: vec3.fromValues(0, 9.95, 0), + right: vec3.fromValues(1, 0, 0), + up: vec3.fromValues(0, 0, 1), + color: vec3.fromValues(5.0, 5.0, 5.0), + emissive: 1.0, +}; + +/** + * Scene holds the cornell-box scene information. + */ +export default class Scene { + readonly vertexCount: number; + readonly indexCount: number; + readonly vertices: GPUBuffer; + readonly indices: GPUBuffer; + readonly vertexBufferLayout: GPUVertexBufferLayout[]; + readonly quadBuffer: GPUBuffer; + readonly quads = [ + ...box({ + center: vec3.fromValues(0, 5, 0), + width: 10, + height: 10, + depth: 10, + rotation: 0, + color: [ + vec3.fromValues(0.0, 0.5, 0.0), // PositiveX + vec3.fromValues(0.5, 0.5, 0.5), // PositiveY + vec3.fromValues(0.5, 0.5, 0.5), // PositiveZ + vec3.fromValues(0.5, 0.0, 0.0), // NegativeX + vec3.fromValues(0.5, 0.5, 0.5), // NegativeY + vec3.fromValues(0.5, 0.5, 0.5), // NegativeZ + ], + type: 'concave', + }), + ...box({ + center: vec3.fromValues(1.5, 1.5, 1), + width: 3, + height: 3, + depth: 3, + rotation: 0.3, + color: vec3.fromValues(0.8, 0.8, 0.8), + type: 'convex', + }), + ...box({ + center: vec3.fromValues(-2, 3, -2), + width: 3, + height: 6, + depth: 3, + rotation: -0.4, + color: vec3.fromValues(0.8, 0.8, 0.8), + type: 'convex', + }), + light, + ]; + readonly lightCenter = light.center; + readonly lightWidth = vec3.len(light.right) * 2; + readonly lightHeight = vec3.len(light.up) * 2; + + constructor(device: GPUDevice) { + const quadStride = 16 * 4; + const quadBuffer = device.createBuffer({ + size: quadStride * this.quads.length, + usage: GPUBufferUsage.STORAGE, + mappedAtCreation: true, + }); + const quadData = new Float32Array(quadBuffer.getMappedRange()); + const vertexStride = 4 * 10; + const vertexData = new Float32Array(this.quads.length * vertexStride); + const indexData = new Uint32Array(this.quads.length * 9); // TODO: 6? + let vertexCount = 0; + let indexCount = 0; + let quadDataOffset = 0; + let vertexDataOffset = 0; + let indexDataOffset = 0; + for (let quadIdx = 0; quadIdx < this.quads.length; quadIdx++) { + const quad = this.quads[quadIdx]; + const normal = vec3.normalize(vec3.cross(quad.right, quad.up)); + quadData[quadDataOffset++] = normal[0]; + quadData[quadDataOffset++] = normal[1]; + quadData[quadDataOffset++] = normal[2]; + quadData[quadDataOffset++] = -vec3.dot(normal, quad.center); + + const invRight = reciprocal(quad.right); + quadData[quadDataOffset++] = invRight[0]; + quadData[quadDataOffset++] = invRight[1]; + quadData[quadDataOffset++] = invRight[2]; + quadData[quadDataOffset++] = -vec3.dot(invRight, quad.center); + + const invUp = reciprocal(quad.up); + quadData[quadDataOffset++] = invUp[0]; + quadData[quadDataOffset++] = invUp[1]; + quadData[quadDataOffset++] = invUp[2]; + quadData[quadDataOffset++] = -vec3.dot(invUp, quad.center); + + quadData[quadDataOffset++] = quad.color[0]; + quadData[quadDataOffset++] = quad.color[1]; + quadData[quadDataOffset++] = quad.color[2]; + quadData[quadDataOffset++] = quad.emissive ?? 0; + + // a ----- b + // | | + // | m | + // | | + // c ----- d + const a = vec3.add(vec3.sub(quad.center, quad.right), quad.up); + const b = vec3.add(vec3.add(quad.center, quad.right), quad.up); + const c = vec3.sub(vec3.sub(quad.center, quad.right), quad.up); + const d = vec3.sub(vec3.add(quad.center, quad.right), quad.up); + + vertexData[vertexDataOffset++] = a[0]; + vertexData[vertexDataOffset++] = a[1]; + vertexData[vertexDataOffset++] = a[2]; + vertexData[vertexDataOffset++] = 1; + vertexData[vertexDataOffset++] = 0; // uv.x + vertexData[vertexDataOffset++] = 1; // uv.y + vertexData[vertexDataOffset++] = quadIdx; + vertexData[vertexDataOffset++] = quad.color[0] * (quad.emissive ?? 0); + vertexData[vertexDataOffset++] = quad.color[1] * (quad.emissive ?? 0); + vertexData[vertexDataOffset++] = quad.color[2] * (quad.emissive ?? 0); + + vertexData[vertexDataOffset++] = b[0]; + vertexData[vertexDataOffset++] = b[1]; + vertexData[vertexDataOffset++] = b[2]; + vertexData[vertexDataOffset++] = 1; + vertexData[vertexDataOffset++] = 1; // uv.x + vertexData[vertexDataOffset++] = 1; // uv.y + vertexData[vertexDataOffset++] = quadIdx; + vertexData[vertexDataOffset++] = quad.color[0] * (quad.emissive ?? 0); + vertexData[vertexDataOffset++] = quad.color[1] * (quad.emissive ?? 0); + vertexData[vertexDataOffset++] = quad.color[2] * (quad.emissive ?? 0); + + vertexData[vertexDataOffset++] = c[0]; + vertexData[vertexDataOffset++] = c[1]; + vertexData[vertexDataOffset++] = c[2]; + vertexData[vertexDataOffset++] = 1; + vertexData[vertexDataOffset++] = 0; // uv.x + vertexData[vertexDataOffset++] = 0; // uv.y + vertexData[vertexDataOffset++] = quadIdx; + vertexData[vertexDataOffset++] = quad.color[0] * (quad.emissive ?? 0); + vertexData[vertexDataOffset++] = quad.color[1] * (quad.emissive ?? 0); + vertexData[vertexDataOffset++] = quad.color[2] * (quad.emissive ?? 0); + + vertexData[vertexDataOffset++] = d[0]; + vertexData[vertexDataOffset++] = d[1]; + vertexData[vertexDataOffset++] = d[2]; + vertexData[vertexDataOffset++] = 1; + vertexData[vertexDataOffset++] = 1; // uv.x + vertexData[vertexDataOffset++] = 0; // uv.y + vertexData[vertexDataOffset++] = quadIdx; + vertexData[vertexDataOffset++] = quad.color[0] * (quad.emissive ?? 0); + vertexData[vertexDataOffset++] = quad.color[1] * (quad.emissive ?? 0); + vertexData[vertexDataOffset++] = quad.color[2] * (quad.emissive ?? 0); + + indexData[indexDataOffset++] = vertexCount + 0; // a + indexData[indexDataOffset++] = vertexCount + 2; // c + indexData[indexDataOffset++] = vertexCount + 1; // b + indexData[indexDataOffset++] = vertexCount + 1; // b + indexData[indexDataOffset++] = vertexCount + 2; // c + indexData[indexDataOffset++] = vertexCount + 3; // d + indexCount += 6; + vertexCount += 4; + } + + quadBuffer.unmap(); + + const vertices = device.createBuffer({ + size: vertexData.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, + }); + new Float32Array(vertices.getMappedRange()).set(vertexData); + vertices.unmap(); + + const indices = device.createBuffer({ + size: indexData.byteLength, + usage: GPUBufferUsage.INDEX, + mappedAtCreation: true, + }); + new Uint16Array(indices.getMappedRange()).set(indexData); + indices.unmap(); + + const vertexBufferLayout: GPUVertexBufferLayout[] = [ + { + arrayStride: vertexStride, + attributes: [ + { + // position + shaderLocation: 0, + offset: 0 * 4, + format: 'float32x4', + }, + { + // uv + shaderLocation: 1, + offset: 4 * 4, + format: 'float32x3', + }, + { + // color + shaderLocation: 2, + offset: 7 * 4, + format: 'float32x3', + }, + ], + }, + ]; + + this.vertexCount = vertexCount; + this.indexCount = indexCount; + this.vertices = vertices; + this.indices = indices; + this.vertexBufferLayout = vertexBufferLayout; + this.quadBuffer = quadBuffer; + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/tonemapper.ts b/bindings/wgpu/webgpu-samples-ts/sample/cornell/tonemapper.ts new file mode 100644 index 00000000..34e942dd --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/tonemapper.ts @@ -0,0 +1,96 @@ +import Common from './common'; +import tonemapperWGSL from './tonemapper.wgsl'; + +/** + * Tonemapper implements a tonemapper to convert a linear-light framebuffer to + * a gamma-correct, tonemapped framebuffer used for presentation. + */ +export default class Tonemapper { + private readonly bindGroup: GPUBindGroup; + private readonly pipeline: GPUComputePipeline; + private readonly width: number; + private readonly height: number; + private readonly kWorkgroupSizeX = 16; + private readonly kWorkgroupSizeY = 16; + + constructor( + device: GPUDevice, + common: Common, + input: GPUTexture, + output: GPUTexture + ) { + this.width = input.width; + this.height = input.height; + const bindGroupLayout = device.createBindGroupLayout({ + label: 'Tonemapper.bindGroupLayout', + entries: [ + { + // input + binding: 0, + visibility: GPUShaderStage.COMPUTE, + texture: { + viewDimension: '2d', + }, + }, + { + // output + binding: 1, + visibility: GPUShaderStage.COMPUTE, + storageTexture: { + access: 'write-only', + format: output.format, + viewDimension: '2d', + }, + }, + ], + }); + this.bindGroup = device.createBindGroup({ + label: 'Tonemapper.bindGroup', + layout: bindGroupLayout, + entries: [ + { + // input + binding: 0, + resource: input.createView(), + }, + { + // output + binding: 1, + resource: output.createView(), + }, + ], + }); + + const mod = device.createShaderModule({ + code: + tonemapperWGSL.replace('{OUTPUT_FORMAT}', output.format) + common.wgsl, + }); + const pipelineLayout = device.createPipelineLayout({ + label: 'Tonemap.pipelineLayout', + bindGroupLayouts: [bindGroupLayout], + }); + + this.pipeline = device.createComputePipeline({ + label: 'Tonemap.pipeline', + layout: pipelineLayout, + compute: { + module: mod, + constants: { + WorkgroupSizeX: this.kWorkgroupSizeX, + WorkgroupSizeY: this.kWorkgroupSizeY, + }, + }, + }); + } + + run(commandEncoder: GPUCommandEncoder) { + const passEncoder = commandEncoder.beginComputePass(); + passEncoder.setBindGroup(0, this.bindGroup); + passEncoder.setPipeline(this.pipeline); + passEncoder.dispatchWorkgroups( + Math.ceil(this.width / this.kWorkgroupSizeX), + Math.ceil(this.height / this.kWorkgroupSizeY) + ); + passEncoder.end(); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cornell/tonemapper.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/cornell/tonemapper.wgsl new file mode 100644 index 00000000..bfc9f04d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cornell/tonemapper.wgsl @@ -0,0 +1,25 @@ +// The linear-light input framebuffer +@group(0) @binding(0) var input : texture_2d; + +// The tonemapped, gamma-corrected output framebuffer +@group(0) @binding(1) var output : texture_storage_2d<{OUTPUT_FORMAT}, write>; + +const TonemapExposure = 0.5; + +const Gamma = 2.2; + +override WorkgroupSizeX : u32; +override WorkgroupSizeY : u32; + +@compute @workgroup_size(WorkgroupSizeX, WorkgroupSizeY) +fn main(@builtin(global_invocation_id) invocation_id : vec3u) { + let color = textureLoad(input, invocation_id.xy, 0).rgb; + let tonemapped = reinhard_tonemap(color); + textureStore(output, invocation_id.xy, vec4f(tonemapped, 1)); +} + +fn reinhard_tonemap(linearColor: vec3f) -> vec3f { + let color = linearColor * TonemapExposure; + let mapped = color / (1+color); + return pow(mapped, vec3f(1 / Gamma)); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cubemap/index.html b/bindings/wgpu/webgpu-samples-ts/sample/cubemap/index.html new file mode 100644 index 00000000..ef703357 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cubemap/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: cubemap + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cubemap/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/cubemap/main.ts new file mode 100644 index 00000000..efaaa5ac --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cubemap/main.ts @@ -0,0 +1,249 @@ +import {mat4, vec3} from 'wgpu-matrix'; + +import { + cubeVertexArray, + cubeVertexSize, + cubeUVOffset, + cubePositionOffset, + cubeVertexCount, +} from '../../meshes/cube'; + +import basicVertWGSL from '../../shaders/basic.vert.wgsl'; +import sampleCubemapWGSL from './sampleCubemap.frag.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +// Create a vertex buffer from the cube data. +const verticesBuffer = device.createBuffer({ + size: cubeVertexArray.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +new Float32Array(verticesBuffer.getMappedRange()).set(cubeVertexArray); +verticesBuffer.unmap(); + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: basicVertWGSL, + }), + buffers: [ + { + arrayStride: cubeVertexSize, + attributes: [ + { + // position + shaderLocation: 0, + offset: cubePositionOffset, + format: 'float32x4', + }, + { + // uv + shaderLocation: 1, + offset: cubeUVOffset, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + code: sampleCubemapWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + + // Since we are seeing from inside of the cube + // and we are using the regular cube geomtry data with outward-facing normals, + // the cullMode should be 'front' or 'none'. + cullMode: 'none', + }, + + // Enable depth testing so that the fragment closest to the camera + // is rendered in front. + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus', + }, +}); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +// Fetch the 6 separate images for negative/positive x, y, z axis of a cubemap +// and upload it into a GPUTexture. +let cubemapTexture: GPUTexture; +{ + // The order of the array layers is [+X, -X, +Y, -Y, +Z, -Z] + const imgSrcs = [ + '../../assets/img/cubemap/posx.jpg', + '../../assets/img/cubemap/negx.jpg', + '../../assets/img/cubemap/posy.jpg', + '../../assets/img/cubemap/negy.jpg', + '../../assets/img/cubemap/posz.jpg', + '../../assets/img/cubemap/negz.jpg', + ]; + const promises = imgSrcs.map(async (src) => { + const response = await fetch(src); + return createImageBitmap(await response.blob()); + }); + const imageBitmaps = await Promise.all(promises); + + cubemapTexture = device.createTexture({ + dimension: '2d', + // Create a 2d array texture. + // Assume each image has the same size. + size: [imageBitmaps[0].width, imageBitmaps[0].height, 6], + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + + for (let i = 0; i < imageBitmaps.length; i++) { + const imageBitmap = imageBitmaps[i]; + device.queue.copyExternalImageToTexture( + {source: imageBitmap}, + {texture: cubemapTexture, origin: [0, 0, i]}, + [imageBitmap.width, imageBitmap.height] + ); + } +} + +const uniformBufferSize = 4 * 16; // 4x4 matrix +const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', +}); + +const uniformBindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + offset: 0, + size: uniformBufferSize, + }, + }, + { + binding: 1, + resource: sampler, + }, + { + binding: 2, + resource: cubemapTexture.createView({ + dimension: 'cube', + }), + }, + ], +}); + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +const aspect = canvas.width / canvas.height; +const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 3000); + +const modelMatrix = mat4.scaling(vec3.fromValues(1000, 1000, 1000)); +const modelViewProjectionMatrix = mat4.create() as Float32Array; +const viewMatrix = mat4.identity(); + +const tmpMat4 = mat4.create(); + +// Comppute camera movement: +// It rotates around Y axis with a slight pitch movement. +function updateTransformationMatrix() { + const now = Date.now() / 800; + + mat4.rotate( + viewMatrix, + vec3.fromValues(1, 0, 0), + (Math.PI / 10) * Math.sin(now), + tmpMat4 + ); + mat4.rotate(tmpMat4, vec3.fromValues(0, 1, 0), now * 0.2, tmpMat4); + + mat4.multiply(tmpMat4, modelMatrix, modelViewProjectionMatrix); + mat4.multiply( + projectionMatrix, + modelViewProjectionMatrix, + modelViewProjectionMatrix + ); +} + +function frame() { + updateTransformationMatrix(); + device.queue.writeBuffer( + uniformBuffer, + 0, + modelViewProjectionMatrix.buffer, + modelViewProjectionMatrix.byteOffset, + modelViewProjectionMatrix.byteLength + ); + + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.setVertexBuffer(0, verticesBuffer); + passEncoder.setBindGroup(0, uniformBindGroup); + passEncoder.draw(cubeVertexCount); + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cubemap/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/cubemap/meta.ts new file mode 100644 index 00000000..3a5207ab --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cubemap/meta.ts @@ -0,0 +1,12 @@ +export default { + name: 'Cubemap', + description: + 'This example shows how to render and sample from a cubemap texture.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: '../../shaders/basic.vert.wgsl'}, + {path: './sampleCubemap.frag.wgsl'}, + {path: '../../meshes/cube.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/cubemap/sampleCubemap.frag.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/cubemap/sampleCubemap.frag.wgsl new file mode 100644 index 00000000..757b42d0 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/cubemap/sampleCubemap.frag.wgsl @@ -0,0 +1,14 @@ +@group(0) @binding(1) var mySampler: sampler; +@group(0) @binding(2) var myTexture: texture_cube; + +@fragment +fn main( + @location(0) fragUV: vec2f, + @location(1) fragPosition: vec4f +) -> @location(0) vec4f { + // Our camera and the skybox cube are both centered at (0, 0, 0) + // so we can use the cube geomtry position to get viewing vector to sample the cube texture. + // The magnitude of the vector doesn't matter. + var cubemapVec = fragPosition.xyz - vec3(0.5); + return textureSample(myTexture, mySampler, cubemapVec); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/fragmentDeferredRendering.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/fragmentDeferredRendering.wgsl new file mode 100644 index 00000000..27031753 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/fragmentDeferredRendering.wgsl @@ -0,0 +1,82 @@ +@group(0) @binding(0) var gBufferNormal: texture_2d; +@group(0) @binding(1) var gBufferAlbedo: texture_2d; +@group(0) @binding(2) var gBufferDepth: texture_depth_2d; + +struct LightData { + position : vec4f, + color : vec3f, + radius : f32, +} +struct LightsBuffer { + lights: array, +} +@group(1) @binding(0) var lightsBuffer: LightsBuffer; + +struct Config { + numLights : u32, +} +struct Camera { + viewProjectionMatrix : mat4x4f, + invViewProjectionMatrix : mat4x4f, +} +@group(1) @binding(1) var config: Config; +@group(1) @binding(2) var camera: Camera; + +fn world_from_screen_coord(coord : vec2f, depth_sample: f32) -> vec3f { + // reconstruct world-space position from the screen coordinate. + let posClip = vec4(coord.x * 2.0 - 1.0, (1.0 - coord.y) * 2.0 - 1.0, depth_sample, 1.0); + let posWorldW = camera.invViewProjectionMatrix * posClip; + let posWorld = posWorldW.xyz / posWorldW.www; + return posWorld; +} + +@fragment +fn main( + @builtin(position) coord : vec4f +) -> @location(0) vec4f { + var result : vec3f; + + let depth = textureLoad( + gBufferDepth, + vec2i(floor(coord.xy)), + 0 + ); + + // Don't light the sky. + if (depth >= 1.0) { + discard; + } + + let bufferSize = textureDimensions(gBufferDepth); + let coordUV = coord.xy / vec2f(bufferSize); + let position = world_from_screen_coord(coordUV, depth); + + let normal = textureLoad( + gBufferNormal, + vec2i(floor(coord.xy)), + 0 + ).xyz; + + let albedo = textureLoad( + gBufferAlbedo, + vec2i(floor(coord.xy)), + 0 + ).rgb; + + for (var i = 0u; i < config.numLights; i++) { + let L = lightsBuffer.lights[i].position.xyz - position; + let distance = length(L); + if (distance > lightsBuffer.lights[i].radius) { + continue; + } + let lambert = max(dot(normal, normalize(L)), 0.0); + result += vec3f( + lambert * pow(1.0 - distance / lightsBuffer.lights[i].radius, 2.0) * lightsBuffer.lights[i].color * albedo + ); + } + + // some manual ambient + result += vec3(0.2); + + return vec4(result, 1.0); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/fragmentGBuffersDebugView.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/fragmentGBuffersDebugView.wgsl new file mode 100644 index 00000000..6e40e2e7 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/fragmentGBuffersDebugView.wgsl @@ -0,0 +1,40 @@ +@group(0) @binding(0) var gBufferNormal: texture_2d; +@group(0) @binding(1) var gBufferAlbedo: texture_2d; +@group(0) @binding(2) var gBufferDepth: texture_depth_2d; + +override canvasSizeWidth: f32; +override canvasSizeHeight: f32; + +@fragment +fn main( + @builtin(position) coord : vec4f +) -> @location(0) vec4f { + var result : vec4f; + let c = coord.xy / vec2f(canvasSizeWidth, canvasSizeHeight); + if (c.x < 0.33333) { + let rawDepth = textureLoad( + gBufferDepth, + vec2i(floor(coord.xy)), + 0 + ); + // remap depth into something a bit more visible + let depth = (1.0 - rawDepth) * 50.0; + result = vec4(depth); + } else if (c.x < 0.66667) { + result = textureLoad( + gBufferNormal, + vec2i(floor(coord.xy)), + 0 + ); + result.x = (result.x + 1.0) * 0.5; + result.y = (result.y + 1.0) * 0.5; + result.z = (result.z + 1.0) * 0.5; + } else { + result = textureLoad( + gBufferAlbedo, + vec2i(floor(coord.xy)), + 0 + ); + } + return result; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/fragmentWriteGBuffers.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/fragmentWriteGBuffers.wgsl new file mode 100644 index 00000000..3658313f --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/fragmentWriteGBuffers.wgsl @@ -0,0 +1,22 @@ +struct GBufferOutput { + @location(0) normal : vec4f, + + // Textures: diffuse color, specular color, smoothness, emissive etc. could go here + @location(1) albedo : vec4f, +} + +@fragment +fn main( + @location(0) fragNormal: vec3f, + @location(1) fragUV : vec2f +) -> GBufferOutput { + // faking some kind of checkerboard texture + let uv = floor(30.0 * fragUV); + let c = 0.2 + 0.5 * ((uv.x + uv.y) - 2.0 * floor((uv.x + uv.y) / 2.0)); + + var output : GBufferOutput; + output.normal = vec4(normalize(fragNormal), 1.0); + output.albedo = vec4(c, c, c, 1.0); + + return output; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/index.html b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/index.html new file mode 100644 index 00000000..fa143d31 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: deferredRendering + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/lightUpdate.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/lightUpdate.wgsl new file mode 100644 index 00000000..a2ca49e4 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/lightUpdate.wgsl @@ -0,0 +1,34 @@ +struct LightData { + position : vec4f, + color : vec3f, + radius : f32, +} +struct LightsBuffer { + lights: array, +} +@group(0) @binding(0) var lightsBuffer: LightsBuffer; + +struct Config { + numLights : u32, +} +@group(0) @binding(1) var config: Config; + +struct LightExtent { + min : vec4f, + max : vec4f, +} +@group(0) @binding(2) var lightExtent: LightExtent; + +@compute @workgroup_size(64, 1, 1) +fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3u) { + var index = GlobalInvocationID.x; + if (index >= config.numLights) { + return; + } + + lightsBuffer.lights[index].position.y = lightsBuffer.lights[index].position.y - 0.5 - 0.003 * (f32(index) - 64.0 * floor(f32(index) / 64.0)); + + if (lightsBuffer.lights[index].position.y < lightExtent.min.y) { + lightsBuffer.lights[index].position.y = lightExtent.max.y; + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/main.ts new file mode 100644 index 00000000..53f969f2 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/main.ts @@ -0,0 +1,585 @@ +import {mat4, vec3, vec4} from 'wgpu-matrix'; +import {GUI} from 'dat.gui'; +import {mesh} from '../../meshes/stanfordDragon'; + +import lightUpdate from './lightUpdate.wgsl'; +import vertexWriteGBuffers from './vertexWriteGBuffers.wgsl'; +import fragmentWriteGBuffers from './fragmentWriteGBuffers.wgsl'; +import vertexTextureQuad from './vertexTextureQuad.wgsl'; +import fragmentGBuffersDebugView from './fragmentGBuffersDebugView.wgsl'; +import fragmentDeferredRendering from './fragmentDeferredRendering.wgsl'; + +const kMaxNumLights = 1024; +const lightExtentMin = vec3.fromValues(-50, -30, -50); +const lightExtentMax = vec3.fromValues(50, 50, 50); + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const aspect = canvas.width / canvas.height; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +// Create the model vertex buffer. +const kVertexStride = 8; +const vertexBuffer = device.createBuffer({ + // position: vec3, normal: vec3, uv: vec2 + size: mesh.positions.length * kVertexStride * Float32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +{ + const mapping = new Float32Array(vertexBuffer.getMappedRange()); + for (let i = 0; i < mesh.positions.length; ++i) { + mapping.set(mesh.positions[i], kVertexStride * i); + mapping.set(mesh.normals[i], kVertexStride * i + 3); + mapping.set(mesh.uvs[i], kVertexStride * i + 6); + } + vertexBuffer.unmap(); +} + +// Create the model index buffer. +const indexCount = mesh.triangles.length * 3; +const indexBuffer = device.createBuffer({ + size: indexCount * Uint16Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.INDEX, + mappedAtCreation: true, +}); +{ + const mapping = new Uint16Array(indexBuffer.getMappedRange()); + for (let i = 0; i < mesh.triangles.length; ++i) { + mapping.set(mesh.triangles[i], 3 * i); + } + indexBuffer.unmap(); +} + +// GBuffer texture render targets +const gBufferTexture2DFloat16 = device.createTexture({ + size: [canvas.width, canvas.height], + usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING, + format: 'rgba16float', +}); +const gBufferTextureAlbedo = device.createTexture({ + size: [canvas.width, canvas.height], + usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING, + format: 'bgra8unorm', +}); +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING, +}); + +const gBufferTextureViews = [ + gBufferTexture2DFloat16.createView(), + gBufferTextureAlbedo.createView(), + depthTexture.createView(), +]; + +const vertexBuffers: Iterable = [ + { + arrayStride: Float32Array.BYTES_PER_ELEMENT * 8, + attributes: [ + { + // position + shaderLocation: 0, + offset: 0, + format: 'float32x3', + }, + { + // normal + shaderLocation: 1, + offset: Float32Array.BYTES_PER_ELEMENT * 3, + format: 'float32x3', + }, + { + // uv + shaderLocation: 2, + offset: Float32Array.BYTES_PER_ELEMENT * 6, + format: 'float32x2', + }, + ], + }, +]; + +const primitive: GPUPrimitiveState = { + topology: 'triangle-list', + cullMode: 'back', +}; + +const writeGBuffersPipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: vertexWriteGBuffers, + }), + buffers: vertexBuffers, + }, + fragment: { + module: device.createShaderModule({ + code: fragmentWriteGBuffers, + }), + targets: [ + // normal + {format: 'rgba16float'}, + // albedo + {format: 'bgra8unorm'}, + ], + }, + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus', + }, + primitive, +}); + +const gBufferTexturesBindGroupLayout = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.FRAGMENT, + texture: { + sampleType: 'unfilterable-float', + }, + }, + { + binding: 1, + visibility: GPUShaderStage.FRAGMENT, + texture: { + sampleType: 'unfilterable-float', + }, + }, + { + binding: 2, + visibility: GPUShaderStage.FRAGMENT, + texture: { + sampleType: 'depth', + }, + }, + ], +}); + +const lightsBufferBindGroupLayout = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.FRAGMENT | GPUShaderStage.COMPUTE, + buffer: { + type: 'read-only-storage', + }, + }, + { + binding: 1, + visibility: GPUShaderStage.FRAGMENT | GPUShaderStage.COMPUTE, + buffer: { + type: 'uniform', + }, + }, + { + binding: 2, + visibility: GPUShaderStage.FRAGMENT, + buffer: { + type: 'uniform', + }, + }, + ], +}); + +const gBuffersDebugViewPipeline = device.createRenderPipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [gBufferTexturesBindGroupLayout], + }), + vertex: { + module: device.createShaderModule({ + code: vertexTextureQuad, + }), + }, + fragment: { + module: device.createShaderModule({ + code: fragmentGBuffersDebugView, + }), + targets: [ + { + format: presentationFormat, + }, + ], + constants: { + canvasSizeWidth: canvas.width, + canvasSizeHeight: canvas.height, + }, + }, + primitive, +}); + +const deferredRenderPipeline = device.createRenderPipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [ + gBufferTexturesBindGroupLayout, + lightsBufferBindGroupLayout, + ], + }), + vertex: { + module: device.createShaderModule({ + code: vertexTextureQuad, + }), + }, + fragment: { + module: device.createShaderModule({ + code: fragmentDeferredRendering, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive, +}); + +const writeGBufferPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: gBufferTextureViews[0], + + clearValue: {r: 0.0, g: 0.0, b: 1.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + { + view: gBufferTextureViews[1], + + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +const textureQuadPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + // view is acquired and set in render loop. + view: undefined, + + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], +}; + +const settings = { + mode: 'rendering', + numLights: 128, +}; +const configUniformBuffer = (() => { + const buffer = device.createBuffer({ + size: Uint32Array.BYTES_PER_ELEMENT, + mappedAtCreation: true, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); + new Uint32Array(buffer.getMappedRange())[0] = settings.numLights; + buffer.unmap(); + return buffer; +})(); + +const gui = new GUI(); +gui.add(settings, 'mode', ['rendering', 'gBuffers view']); +gui + .add(settings, 'numLights', 1, kMaxNumLights) + .step(1) + .onChange(() => { + device.queue.writeBuffer( + configUniformBuffer, + 0, + new Uint32Array([settings.numLights]) + ); + }); + +const modelUniformBuffer = device.createBuffer({ + size: 4 * 16 * 2, // two 4x4 matrix + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const cameraUniformBuffer = device.createBuffer({ + size: 4 * 16 * 2, // two 4x4 matrix + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const sceneUniformBindGroup = device.createBindGroup({ + layout: writeGBuffersPipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: modelUniformBuffer, + }, + }, + { + binding: 1, + resource: { + buffer: cameraUniformBuffer, + }, + }, + ], +}); + +const gBufferTexturesBindGroup = device.createBindGroup({ + layout: gBufferTexturesBindGroupLayout, + entries: [ + { + binding: 0, + resource: gBufferTextureViews[0], + }, + { + binding: 1, + resource: gBufferTextureViews[1], + }, + { + binding: 2, + resource: gBufferTextureViews[2], + }, + ], +}); + +// Lights data are uploaded in a storage buffer +// which could be updated/culled/etc. with a compute shader +const extent = vec3.sub(lightExtentMax, lightExtentMin); +const lightDataStride = 8; +const bufferSizeInByte = + Float32Array.BYTES_PER_ELEMENT * lightDataStride * kMaxNumLights; +const lightsBuffer = device.createBuffer({ + size: bufferSizeInByte, + usage: GPUBufferUsage.STORAGE, + mappedAtCreation: true, +}); + +// We randomaly populate lights randomly in a box range +// And simply move them along y-axis per frame to show they are +// dynamic lightings +const lightData = new Float32Array(lightsBuffer.getMappedRange()); +const tmpVec4 = vec4.create(); +let offset = 0; +for (let i = 0; i < kMaxNumLights; i++) { + offset = lightDataStride * i; + // position + for (let i = 0; i < 3; i++) { + tmpVec4[i] = Math.random() * extent[i] + lightExtentMin[i]; + } + tmpVec4[3] = 1; + lightData.set(tmpVec4, offset); + // color + tmpVec4[0] = Math.random() * 2; + tmpVec4[1] = Math.random() * 2; + tmpVec4[2] = Math.random() * 2; + // radius + tmpVec4[3] = 20.0; + lightData.set(tmpVec4, offset + 4); +} +lightsBuffer.unmap(); + +const lightExtentBuffer = device.createBuffer({ + size: 4 * 8, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); +const lightExtentData = new Float32Array(8); +lightExtentData.set(lightExtentMin, 0); +lightExtentData.set(lightExtentMax, 4); +device.queue.writeBuffer( + lightExtentBuffer, + 0, + lightExtentData.buffer, + lightExtentData.byteOffset, + lightExtentData.byteLength +); + +const lightUpdateComputePipeline = device.createComputePipeline({ + layout: 'auto', + compute: { + module: device.createShaderModule({ + code: lightUpdate, + }), + }, +}); +const lightsBufferBindGroup = device.createBindGroup({ + layout: lightsBufferBindGroupLayout, + entries: [ + { + binding: 0, + resource: { + buffer: lightsBuffer, + }, + }, + { + binding: 1, + resource: { + buffer: configUniformBuffer, + }, + }, + { + binding: 2, + resource: { + buffer: cameraUniformBuffer, + }, + }, + ], +}); +const lightsBufferComputeBindGroup = device.createBindGroup({ + layout: lightUpdateComputePipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: lightsBuffer, + }, + }, + { + binding: 1, + resource: { + buffer: configUniformBuffer, + }, + }, + { + binding: 2, + resource: { + buffer: lightExtentBuffer, + }, + }, + ], +}); +//-------------------- + +// Scene matrices +const eyePosition = vec3.fromValues(0, 50, -100); +const upVector = vec3.fromValues(0, 1, 0); +const origin = vec3.fromValues(0, 0, 0); + +const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 2000.0); + +// Move the model so it's centered. +const modelMatrix = mat4.translation([0, -45, 0]); + +const modelData = modelMatrix as Float32Array; +device.queue.writeBuffer( + modelUniformBuffer, + 0, + modelData.buffer, + modelData.byteOffset, + modelData.byteLength +); +const invertTransposeModelMatrix = mat4.invert(modelMatrix); +mat4.transpose(invertTransposeModelMatrix, invertTransposeModelMatrix); +const normalModelData = invertTransposeModelMatrix as Float32Array; +device.queue.writeBuffer( + modelUniformBuffer, + 64, + normalModelData.buffer, + normalModelData.byteOffset, + normalModelData.byteLength +); + +// Rotates the camera around the origin based on time. +function getCameraViewProjMatrix() { + const rad = Math.PI * (Date.now() / 5000); + const rotation = mat4.rotateY(mat4.translation(origin), rad); + const rotatedEyePosition = vec3.transformMat4(eyePosition, rotation); + + const viewMatrix = mat4.lookAt(rotatedEyePosition, origin, upVector); + + return mat4.multiply(projectionMatrix, viewMatrix) as Float32Array; +} + +function frame() { + const cameraViewProj = getCameraViewProjMatrix(); + device.queue.writeBuffer( + cameraUniformBuffer, + 0, + cameraViewProj.buffer, + cameraViewProj.byteOffset, + cameraViewProj.byteLength + ); + const cameraInvViewProj = mat4.invert(cameraViewProj) as Float32Array; + device.queue.writeBuffer( + cameraUniformBuffer, + 64, + cameraInvViewProj.buffer, + cameraInvViewProj.byteOffset, + cameraInvViewProj.byteLength + ); + + const commandEncoder = device.createCommandEncoder(); + { + // Write position, normal, albedo etc. data to gBuffers + const gBufferPass = commandEncoder.beginRenderPass( + writeGBufferPassDescriptor + ); + gBufferPass.setPipeline(writeGBuffersPipeline); + gBufferPass.setBindGroup(0, sceneUniformBindGroup); + gBufferPass.setVertexBuffer(0, vertexBuffer); + gBufferPass.setIndexBuffer(indexBuffer, 'uint16'); + gBufferPass.drawIndexed(indexCount); + gBufferPass.end(); + } + { + // Update lights position + const lightPass = commandEncoder.beginComputePass(); + lightPass.setPipeline(lightUpdateComputePipeline); + lightPass.setBindGroup(0, lightsBufferComputeBindGroup); + lightPass.dispatchWorkgroups(Math.ceil(kMaxNumLights / 64)); + lightPass.end(); + } + { + if (settings.mode === 'gBuffers view') { + // GBuffers debug view + // Left: depth + // Middle: normal + // Right: albedo (use uv to mimic a checkerboard texture) + textureQuadPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + const debugViewPass = commandEncoder.beginRenderPass( + textureQuadPassDescriptor + ); + debugViewPass.setPipeline(gBuffersDebugViewPipeline); + debugViewPass.setBindGroup(0, gBufferTexturesBindGroup); + debugViewPass.draw(6); + debugViewPass.end(); + } else { + // Deferred rendering + textureQuadPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + const deferredRenderingPass = commandEncoder.beginRenderPass( + textureQuadPassDescriptor + ); + deferredRenderingPass.setPipeline(deferredRenderPipeline); + deferredRenderingPass.setBindGroup(0, gBufferTexturesBindGroup); + deferredRenderingPass.setBindGroup(1, lightsBufferBindGroup); + deferredRenderingPass.draw(6); + deferredRenderingPass.end(); + } + } + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/meta.ts new file mode 100644 index 00000000..e0091921 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/meta.ts @@ -0,0 +1,22 @@ +export default { + name: 'Deferred Rendering', + description: `This example shows how to do deferred rendering with webgpu. + Render geometry info to multiple targets in the gBuffers in the first pass. + In this sample we have 2 gBuffers for normals and albedo, along with a depth texture. + And then do the lighting in a second pass with per fragment data read from gBuffers so it's independent of scene complexity. + World-space positions are reconstructed from the depth texture and camera matrix. + We also update light position in a compute shader, where further operations like tile/cluster culling could happen. + The debug view shows the depth buffer on the left (flipped and scaled a bit to make it more visible), the normal G buffer + in the middle, and the albedo G-buffer on the right side of the screen. + `, + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'vertexWriteGBuffers.wgsl'}, + {path: 'fragmentWriteGBuffers.wgsl'}, + {path: 'vertexTextureQuad.wgsl'}, + {path: 'fragmentGBuffersDebugView.wgsl'}, + {path: 'fragmentDeferredRendering.wgsl'}, + {path: 'lightUpdate.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/vertexTextureQuad.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/vertexTextureQuad.wgsl new file mode 100644 index 00000000..c1802e7d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/vertexTextureQuad.wgsl @@ -0,0 +1,11 @@ +@vertex +fn main( + @builtin(vertex_index) VertexIndex : u32 +) -> @builtin(position) vec4f { + const pos = array( + vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0), + vec2(-1.0, 1.0), vec2(1.0, -1.0), vec2(1.0, 1.0), + ); + + return vec4f(pos[VertexIndex], 0.0, 1.0); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/vertexWriteGBuffers.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/vertexWriteGBuffers.wgsl new file mode 100644 index 00000000..6ffe79ef --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/deferredRendering/vertexWriteGBuffers.wgsl @@ -0,0 +1,30 @@ +struct Uniforms { + modelMatrix : mat4x4f, + normalModelMatrix : mat4x4f, +} +struct Camera { + viewProjectionMatrix : mat4x4f, + invViewProjectionMatrix : mat4x4f, +} +@group(0) @binding(0) var uniforms : Uniforms; +@group(0) @binding(1) var camera : Camera; + +struct VertexOutput { + @builtin(position) Position : vec4f, + @location(0) fragNormal: vec3f, // normal in world space + @location(1) fragUV: vec2f, +} + +@vertex +fn main( + @location(0) position : vec3f, + @location(1) normal : vec3f, + @location(2) uv : vec2f +) -> VertexOutput { + var output : VertexOutput; + let worldPosition = (uniforms.modelMatrix * vec4(position, 1.0)).xyz; + output.Position = camera.viewProjectionMatrix * vec4(worldPosition, 1.0); + output.fragNormal = normalize((uniforms.normalModelMatrix * vec4(normal, 1.0)).xyz); + output.fragUV = uv; + return output; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/index.html b/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/index.html new file mode 100644 index 00000000..3945fd73 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: fractalCube + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/main.ts new file mode 100644 index 00000000..32136737 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/main.ts @@ -0,0 +1,221 @@ +import {mat4, vec3} from 'wgpu-matrix'; + +import { + cubeVertexArray, + cubeVertexSize, + cubeUVOffset, + cubePositionOffset, + cubeVertexCount, +} from '../../meshes/cube'; + +import basicVertWGSL from '../../shaders/basic.vert.wgsl'; +import sampleSelfWGSL from './sampleSelf.frag.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + + // Specify we want both RENDER_ATTACHMENT and COPY_SRC since we + // will copy out of the swapchain texture. + usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC, + alphaMode: 'premultiplied', +}); + +// Create a vertex buffer from the cube data. +const verticesBuffer = device.createBuffer({ + size: cubeVertexArray.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +new Float32Array(verticesBuffer.getMappedRange()).set(cubeVertexArray); +verticesBuffer.unmap(); + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: basicVertWGSL, + }), + buffers: [ + { + arrayStride: cubeVertexSize, + attributes: [ + { + // position + shaderLocation: 0, + offset: cubePositionOffset, + format: 'float32x4', + }, + { + // uv + shaderLocation: 1, + offset: cubeUVOffset, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + code: sampleSelfWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + + // Backface culling since the cube is solid piece of geometry. + // Faces pointing away from the camera will be occluded by faces + // pointing toward the camera. + cullMode: 'back', + }, + + // Enable depth testing so that the fragment closest to the camera + // is rendered in front. + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus', + }, +}); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const uniformBufferSize = 4 * 16; // 4x4 matrix +const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +// We will copy the frame's rendering results into this texture and +// sample it on the next frame. +const cubeTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: presentationFormat, + usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST, +}); + +// Create a sampler with linear filtering for smooth interpolation. +const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', +}); + +const uniformBindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + { + binding: 1, + resource: sampler, + }, + { + binding: 2, + resource: cubeTexture.createView(), + }, + ], +}); + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: {r: 0.5, g: 0.5, b: 0.5, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +const aspect = canvas.width / canvas.height; +const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 100.0); +const modelViewProjectionMatrix = mat4.create(); + +function getTransformationMatrix() { + const viewMatrix = mat4.identity(); + mat4.translate(viewMatrix, vec3.fromValues(0, 0, -4), viewMatrix); + const now = Date.now() / 1000; + mat4.rotate( + viewMatrix, + vec3.fromValues(Math.sin(now), Math.cos(now), 0), + 1, + viewMatrix + ); + + mat4.multiply(projectionMatrix, viewMatrix, modelViewProjectionMatrix); + + return modelViewProjectionMatrix as Float32Array; +} + +function frame() { + const transformationMatrix = getTransformationMatrix(); + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix.buffer, + transformationMatrix.byteOffset, + transformationMatrix.byteLength + ); + + const swapChainTexture = context.getCurrentTexture(); + // prettier-ignore + renderPassDescriptor.colorAttachments[0].view = swapChainTexture.createView(); + + const commandEncoder = device.createCommandEncoder(); + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.setBindGroup(0, uniformBindGroup); + passEncoder.setVertexBuffer(0, verticesBuffer); + passEncoder.draw(cubeVertexCount); + passEncoder.end(); + + // Copy the rendering results from the swapchain into |cubeTexture|. + commandEncoder.copyTextureToTexture( + { + texture: swapChainTexture, + }, + { + texture: cubeTexture, + }, + [canvas.width, canvas.height] + ); + + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/meta.ts new file mode 100644 index 00000000..d6379aac --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/meta.ts @@ -0,0 +1,13 @@ +export default { + name: 'Fractal Cube', + description: + "This example uses the previous frame's rendering result \ + as the source texture for the next frame.", + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: '../../shaders/basic.vert.wgsl'}, + {path: './sampleSelf.frag.wgsl'}, + {path: '../../meshes/cube.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/sampleSelf.frag.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/sampleSelf.frag.wgsl new file mode 100644 index 00000000..f2c4c14b --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/fractalCube/sampleSelf.frag.wgsl @@ -0,0 +1,12 @@ +@binding(1) @group(0) var mySampler: sampler; +@binding(2) @group(0) var myTexture: texture_2d; + +@fragment +fn main( + @location(0) fragUV: vec2f, + @location(1) fragPosition: vec4f +) -> @location(0) vec4f { + let texColor = textureSample(myTexture, mySampler, fragUV * 0.8 + vec2(0.1)); + let f = select(1.0, 0.0, length(texColor.rgb - vec3(0.5)) < 0.01); + return f * texColor + (1.0 - f) * fragPosition; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/compute.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/compute.wgsl new file mode 100644 index 00000000..286ae7f6 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/compute.wgsl @@ -0,0 +1,30 @@ +@binding(0) @group(0) var size: vec2u; +@binding(1) @group(0) var current: array; +@binding(2) @group(0) var next: array; + +override blockSize = 8; + +fn getIndex(x: u32, y: u32) -> u32 { + let h = size.y; + let w = size.x; + + return (y % h) * w + (x % w); +} + +fn getCell(x: u32, y: u32) -> u32 { + return current[getIndex(x, y)]; +} + +fn countNeighbors(x: u32, y: u32) -> u32 { + return getCell(x - 1, y - 1) + getCell(x, y - 1) + getCell(x + 1, y - 1) + + getCell(x - 1, y) + getCell(x + 1, y) + + getCell(x - 1, y + 1) + getCell(x, y + 1) + getCell(x + 1, y + 1); +} + +@compute @workgroup_size(blockSize, blockSize) +fn main(@builtin(global_invocation_id) grid: vec3u) { + let x = grid.x; + let y = grid.y; + let n = countNeighbors(x, y); + next[getIndex(x, y)] = select(u32(n == 3u), u32(n == 2u || n == 3u), getCell(x, y) == 1u); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/frag.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/frag.wgsl new file mode 100644 index 00000000..d17c5889 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/frag.wgsl @@ -0,0 +1,4 @@ +@fragment +fn main(@location(0) cell: f32) -> @location(0) vec4f { + return vec4f(cell, cell, cell, 1.); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/index.html b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/index.html new file mode 100644 index 00000000..225a1301 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: gameOfLife + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/main.ts new file mode 100644 index 00000000..e9cc8304 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/main.ts @@ -0,0 +1,270 @@ +import {GUI} from 'dat.gui'; +import computeWGSL from './compute.wgsl'; +import vertWGSL from './vert.wgsl'; +import fragWGSL from './frag.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const GameOptions = { + width: 128, + height: 128, + timestep: 4, + workgroupSize: 8, +}; + +const computeShader = device.createShaderModule({code: computeWGSL}); +const bindGroupLayoutCompute = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.COMPUTE, + buffer: { + type: 'read-only-storage', + }, + }, + { + binding: 1, + visibility: GPUShaderStage.COMPUTE, + buffer: { + type: 'read-only-storage', + }, + }, + { + binding: 2, + visibility: GPUShaderStage.COMPUTE, + buffer: { + type: 'storage', + }, + }, + ], +}); + +const squareVertices = new Uint32Array([0, 0, 0, 1, 1, 0, 1, 1]); +const squareBuffer = device.createBuffer({ + size: squareVertices.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +new Uint32Array(squareBuffer.getMappedRange()).set(squareVertices); +squareBuffer.unmap(); + +const squareStride: GPUVertexBufferLayout = { + arrayStride: 2 * squareVertices.BYTES_PER_ELEMENT, + stepMode: 'vertex', + attributes: [ + { + shaderLocation: 1, + offset: 0, + format: 'uint32x2', + }, + ], +}; + +const vertexShader = device.createShaderModule({code: vertWGSL}); +const fragmentShader = device.createShaderModule({code: fragWGSL}); +let commandEncoder: GPUCommandEncoder; + +const bindGroupLayoutRender = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX, + buffer: { + type: 'uniform', + }, + }, + ], +}); + +const cellsStride: GPUVertexBufferLayout = { + arrayStride: Uint32Array.BYTES_PER_ELEMENT, + stepMode: 'instance', + attributes: [ + { + shaderLocation: 0, + offset: 0, + format: 'uint32', + }, + ], +}; + +function addGUI() { + const gui = new GUI(); + gui.add(GameOptions, 'timestep', 1, 60, 1); + gui.add(GameOptions, 'width', 16, 1024, 16).onFinishChange(resetGameData); + gui.add(GameOptions, 'height', 16, 1024, 16).onFinishChange(resetGameData); + gui + .add(GameOptions, 'workgroupSize', [4, 8, 16]) + .onFinishChange(resetGameData); +} + +let wholeTime = 0, + loopTimes = 0, + buffer0: GPUBuffer, + buffer1: GPUBuffer; +let render: () => void; + +function resetGameData() { + // compute pipeline + const computePipeline = device.createComputePipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [bindGroupLayoutCompute], + }), + compute: { + module: computeShader, + constants: { + blockSize: GameOptions.workgroupSize, + }, + }, + }); + const sizeBuffer = device.createBuffer({ + size: 2 * Uint32Array.BYTES_PER_ELEMENT, + usage: + GPUBufferUsage.STORAGE | + GPUBufferUsage.UNIFORM | + GPUBufferUsage.COPY_DST | + GPUBufferUsage.VERTEX, + mappedAtCreation: true, + }); + new Uint32Array(sizeBuffer.getMappedRange()).set([ + GameOptions.width, + GameOptions.height, + ]); + sizeBuffer.unmap(); + const length = GameOptions.width * GameOptions.height; + const cells = new Uint32Array(length); + for (let i = 0; i < length; i++) { + cells[i] = Math.random() < 0.25 ? 1 : 0; + } + + buffer0 = device.createBuffer({ + size: cells.byteLength, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.VERTEX, + mappedAtCreation: true, + }); + new Uint32Array(buffer0.getMappedRange()).set(cells); + buffer0.unmap(); + + buffer1 = device.createBuffer({ + size: cells.byteLength, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.VERTEX, + }); + + const bindGroup0 = device.createBindGroup({ + layout: bindGroupLayoutCompute, + entries: [ + {binding: 0, resource: {buffer: sizeBuffer}}, + {binding: 1, resource: {buffer: buffer0}}, + {binding: 2, resource: {buffer: buffer1}}, + ], + }); + + const bindGroup1 = device.createBindGroup({ + layout: bindGroupLayoutCompute, + entries: [ + {binding: 0, resource: {buffer: sizeBuffer}}, + {binding: 1, resource: {buffer: buffer1}}, + {binding: 2, resource: {buffer: buffer0}}, + ], + }); + + const renderPipeline = device.createRenderPipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [bindGroupLayoutRender], + }), + primitive: { + topology: 'triangle-strip', + }, + vertex: { + module: vertexShader, + buffers: [cellsStride, squareStride], + }, + fragment: { + module: fragmentShader, + targets: [ + { + format: presentationFormat, + }, + ], + }, + }); + + const uniformBindGroup = device.createBindGroup({ + layout: renderPipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: sizeBuffer, + offset: 0, + size: 2 * Uint32Array.BYTES_PER_ELEMENT, + }, + }, + ], + }); + + loopTimes = 0; + render = () => { + const view = context.getCurrentTexture().createView(); + const renderPass: GPURenderPassDescriptor = { + colorAttachments: [ + { + view, + loadOp: 'clear', + storeOp: 'store', + }, + ], + }; + commandEncoder = device.createCommandEncoder(); + + // compute + const passEncoderCompute = commandEncoder.beginComputePass(); + passEncoderCompute.setPipeline(computePipeline); + passEncoderCompute.setBindGroup(0, loopTimes ? bindGroup1 : bindGroup0); + passEncoderCompute.dispatchWorkgroups( + GameOptions.width / GameOptions.workgroupSize, + GameOptions.height / GameOptions.workgroupSize + ); + passEncoderCompute.end(); + // render + const passEncoderRender = commandEncoder.beginRenderPass(renderPass); + passEncoderRender.setPipeline(renderPipeline); + passEncoderRender.setVertexBuffer(0, loopTimes ? buffer1 : buffer0); + passEncoderRender.setVertexBuffer(1, squareBuffer); + passEncoderRender.setBindGroup(0, uniformBindGroup); + passEncoderRender.draw(4, length); + passEncoderRender.end(); + + device.queue.submit([commandEncoder.finish()]); + }; +} + +addGUI(); +resetGameData(); + +(function loop() { + if (GameOptions.timestep) { + wholeTime++; + if (wholeTime >= GameOptions.timestep) { + render(); + wholeTime -= GameOptions.timestep; + loopTimes = 1 - loopTimes; + } + } + + requestAnimationFrame(loop); +})(); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/meta.ts new file mode 100644 index 00000000..37176573 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/meta.ts @@ -0,0 +1,12 @@ +export default { + name: "Conway's Game of Life", + description: + "This example shows how to make Conway's game of life. First, use compute shader to calculate how cells grow or die. Then use render pipeline to draw cells by using instance mesh.", + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'compute.wgsl'}, + {path: 'vert.wgsl'}, + {path: 'frag.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/vert.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/vert.wgsl new file mode 100644 index 00000000..07649a14 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/gameOfLife/vert.wgsl @@ -0,0 +1,16 @@ +struct Out { + @builtin(position) pos: vec4f, + @location(0) cell: f32, +} + +@binding(0) @group(0) var size: vec2u; + +@vertex +fn main(@builtin(instance_index) i: u32, @location(0) cell: u32, @location(1) pos: vec2u) -> Out { + let w = size.x; + let h = size.y; + let x = (f32(i % w + pos.x) / f32(w) - 0.5) * 2. * f32(w) / f32(max(w, h)); + let y = (f32((i - (i % w)) / w + pos.y) / f32(h) - 0.5) * 2. * f32(h) / f32(max(w, h)); + + return Out(vec4f(x, y, 0., 1.), f32(cell)); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/helloTriangle/index.html b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangle/index.html new file mode 100644 index 00000000..424b65d3 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangle/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: helloTriangle + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/helloTriangle/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangle/main.ts new file mode 100644 index 00000000..1b569ec4 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangle/main.ts @@ -0,0 +1,67 @@ +import triangleVertWGSL from '../../shaders/triangle.vert.wgsl'; +import redFragWGSL from '../../shaders/red.frag.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: triangleVertWGSL, + }), + }, + fragment: { + module: device.createShaderModule({ + code: redFragWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, +}); + +function frame() { + const commandEncoder = device.createCommandEncoder(); + const textureView = context.getCurrentTexture().createView(); + + const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: textureView, + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + }; + + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.draw(3); + passEncoder.end(); + + device.queue.submit([commandEncoder.finish()]); + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/helloTriangle/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangle/meta.ts new file mode 100644 index 00000000..bdc3dbda --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangle/meta.ts @@ -0,0 +1,10 @@ +export default { + name: 'Hello Triangle', + description: 'Shows rendering a basic triangle.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: '../../shaders/triangle.vert.wgsl'}, + {path: '../../shaders/red.frag.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/helloTriangleMSAA/index.html b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangleMSAA/index.html new file mode 100644 index 00000000..518893cb --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangleMSAA/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: helloTriangleMSAA + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/helloTriangleMSAA/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangleMSAA/main.ts new file mode 100644 index 00000000..891f8749 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangleMSAA/main.ts @@ -0,0 +1,80 @@ +import triangleVertWGSL from '../../shaders/triangle.vert.wgsl'; +import redFragWGSL from '../../shaders/red.frag.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const sampleCount = 4; + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: triangleVertWGSL, + }), + }, + fragment: { + module: device.createShaderModule({ + code: redFragWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, + multisample: { + count: 4, + }, +}); + +const texture = device.createTexture({ + size: [canvas.width, canvas.height], + sampleCount, + format: presentationFormat, + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); +const view = texture.createView(); + +function frame() { + const commandEncoder = device.createCommandEncoder(); + + const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view, + resolveTarget: context.getCurrentTexture().createView(), + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'discard', + }, + ], + }; + + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.draw(3); + passEncoder.end(); + + device.queue.submit([commandEncoder.finish()]); + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/helloTriangleMSAA/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangleMSAA/meta.ts new file mode 100644 index 00000000..6288d61d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/helloTriangleMSAA/meta.ts @@ -0,0 +1,10 @@ +export default { + name: 'Hello Triangle MSAA', + description: 'Shows multisampled rendering a basic triangle.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: '../../shaders/triangle.vert.wgsl'}, + {path: '../../shaders/red.frag.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/blur.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/blur.wgsl new file mode 100644 index 00000000..ef4184f0 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/blur.wgsl @@ -0,0 +1,81 @@ +struct Params { + filterDim : i32, + blockDim : u32, +} + +@group(0) @binding(0) var samp : sampler; +@group(0) @binding(1) var params : Params; +@group(1) @binding(1) var inputTex : texture_2d; +@group(1) @binding(2) var outputTex : texture_storage_2d; + +struct Flip { + value : u32, +} +@group(1) @binding(3) var flip : Flip; + +// This shader blurs the input texture in one direction, depending on whether +// |flip.value| is 0 or 1. +// It does so by running (128 / 4) threads per workgroup to load 128 +// texels into 4 rows of shared memory. Each thread loads a +// 4 x 4 block of texels to take advantage of the texture sampling +// hardware. +// Then, each thread computes the blur result by averaging the adjacent texel values +// in shared memory. +// Because we're operating on a subset of the texture, we cannot compute all of the +// results since not all of the neighbors are available in shared memory. +// Specifically, with 128 x 128 tiles, we can only compute and write out +// square blocks of size 128 - (filterSize - 1). We compute the number of blocks +// needed in Javascript and dispatch that amount. + +var tile : array, 4>; + +@compute @workgroup_size(32, 1, 1) +fn main( + @builtin(workgroup_id) WorkGroupID : vec3u, + @builtin(local_invocation_id) LocalInvocationID : vec3u +) { + let filterOffset = (params.filterDim - 1) / 2; + let dims = vec2i(textureDimensions(inputTex, 0)); + let baseIndex = vec2i(WorkGroupID.xy * vec2(params.blockDim, 4) + + LocalInvocationID.xy * vec2(4, 1)) + - vec2(filterOffset, 0); + + for (var r = 0; r < 4; r++) { + for (var c = 0; c < 4; c++) { + var loadIndex = baseIndex + vec2(c, r); + if (flip.value != 0u) { + loadIndex = loadIndex.yx; + } + + tile[r][4 * LocalInvocationID.x + u32(c)] = textureSampleLevel( + inputTex, + samp, + (vec2f(loadIndex) + vec2f(0.25, 0.25)) / vec2f(dims), + 0.0 + ).rgb; + } + } + + workgroupBarrier(); + + for (var r = 0; r < 4; r++) { + for (var c = 0; c < 4; c++) { + var writeIndex = baseIndex + vec2(c, r); + if (flip.value != 0) { + writeIndex = writeIndex.yx; + } + + let center = i32(4 * LocalInvocationID.x) + c; + if (center >= filterOffset && + center < 128 - filterOffset && + all(writeIndex < dims)) { + var acc = vec3(0.0, 0.0, 0.0); + for (var f = 0; f < params.filterDim; f++) { + var i = center + f - filterOffset; + acc = acc + (1.0 / f32(params.filterDim)) * tile[r][i]; + } + textureStore(outputTex, writeIndex, vec4(acc, 1.0)); + } + } + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/index.html b/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/index.html new file mode 100644 index 00000000..38ef6d47 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: imageBlur + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/main.ts new file mode 100644 index 00000000..6b686590 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/main.ts @@ -0,0 +1,286 @@ +import {GUI} from 'dat.gui'; +import blurWGSL from './blur.wgsl'; +import fullscreenTexturedQuadWGSL from '../../shaders/fullscreenTexturedQuad.wgsl'; + +// Contants from the blur.wgsl shader. +const tileDim = 128; +const batch = [4, 4]; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const blurPipeline = device.createComputePipeline({ + layout: 'auto', + compute: { + module: device.createShaderModule({ + code: blurWGSL, + }), + }, +}); + +const fullscreenQuadPipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: fullscreenTexturedQuadWGSL, + }), + }, + fragment: { + module: device.createShaderModule({ + code: fullscreenTexturedQuadWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, +}); + +const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', +}); + +const response = await fetch('../../assets/img/Di-3d.png'); +const imageBitmap = await createImageBitmap(await response.blob()); + +const [srcWidth, srcHeight] = [imageBitmap.width, imageBitmap.height]; +const cubeTexture = device.createTexture({ + size: [srcWidth, srcHeight, 1], + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, +}); +device.queue.copyExternalImageToTexture( + {source: imageBitmap}, + {texture: cubeTexture}, + [imageBitmap.width, imageBitmap.height] +); + +const textures = [0, 1].map(() => { + return device.createTexture({ + size: { + width: srcWidth, + height: srcHeight, + }, + format: 'rgba8unorm', + usage: + GPUTextureUsage.COPY_DST | + GPUTextureUsage.STORAGE_BINDING | + GPUTextureUsage.TEXTURE_BINDING, + }); +}); + +const buffer0 = (() => { + const buffer = device.createBuffer({ + size: 4, + mappedAtCreation: true, + usage: GPUBufferUsage.UNIFORM, + }); + new Uint32Array(buffer.getMappedRange())[0] = 0; + buffer.unmap(); + return buffer; +})(); + +const buffer1 = (() => { + const buffer = device.createBuffer({ + size: 4, + mappedAtCreation: true, + usage: GPUBufferUsage.UNIFORM, + }); + new Uint32Array(buffer.getMappedRange())[0] = 1; + buffer.unmap(); + return buffer; +})(); + +const blurParamsBuffer = device.createBuffer({ + size: 8, + usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.UNIFORM, +}); + +const computeConstants = device.createBindGroup({ + layout: blurPipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: sampler, + }, + { + binding: 1, + resource: { + buffer: blurParamsBuffer, + }, + }, + ], +}); + +const computeBindGroup0 = device.createBindGroup({ + layout: blurPipeline.getBindGroupLayout(1), + entries: [ + { + binding: 1, + resource: cubeTexture.createView(), + }, + { + binding: 2, + resource: textures[0].createView(), + }, + { + binding: 3, + resource: { + buffer: buffer0, + }, + }, + ], +}); + +const computeBindGroup1 = device.createBindGroup({ + layout: blurPipeline.getBindGroupLayout(1), + entries: [ + { + binding: 1, + resource: textures[0].createView(), + }, + { + binding: 2, + resource: textures[1].createView(), + }, + { + binding: 3, + resource: { + buffer: buffer1, + }, + }, + ], +}); + +const computeBindGroup2 = device.createBindGroup({ + layout: blurPipeline.getBindGroupLayout(1), + entries: [ + { + binding: 1, + resource: textures[1].createView(), + }, + { + binding: 2, + resource: textures[0].createView(), + }, + { + binding: 3, + resource: { + buffer: buffer0, + }, + }, + ], +}); + +const showResultBindGroup = device.createBindGroup({ + layout: fullscreenQuadPipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: sampler, + }, + { + binding: 1, + resource: textures[1].createView(), + }, + ], +}); + +const settings = { + filterSize: 15, + iterations: 2, +}; + +let blockDim: number; +const updateSettings = () => { + blockDim = tileDim - (settings.filterSize - 1); + device.queue.writeBuffer( + blurParamsBuffer, + 0, + new Uint32Array([settings.filterSize, blockDim]) + ); +}; +const gui = new GUI(); +gui.add(settings, 'filterSize', 1, 33).step(2).onChange(updateSettings); +gui.add(settings, 'iterations', 1, 10).step(1); + +updateSettings(); + +function frame() { + const commandEncoder = device.createCommandEncoder(); + + const computePass = commandEncoder.beginComputePass(); + computePass.setPipeline(blurPipeline); + computePass.setBindGroup(0, computeConstants); + + computePass.setBindGroup(1, computeBindGroup0); + computePass.dispatchWorkgroups( + Math.ceil(srcWidth / blockDim), + Math.ceil(srcHeight / batch[1]) + ); + + computePass.setBindGroup(1, computeBindGroup1); + computePass.dispatchWorkgroups( + Math.ceil(srcHeight / blockDim), + Math.ceil(srcWidth / batch[1]) + ); + + for (let i = 0; i < settings.iterations - 1; ++i) { + computePass.setBindGroup(1, computeBindGroup2); + computePass.dispatchWorkgroups( + Math.ceil(srcWidth / blockDim), + Math.ceil(srcHeight / batch[1]) + ); + + computePass.setBindGroup(1, computeBindGroup1); + computePass.dispatchWorkgroups( + Math.ceil(srcHeight / blockDim), + Math.ceil(srcWidth / batch[1]) + ); + } + + computePass.end(); + + const passEncoder = commandEncoder.beginRenderPass({ + colorAttachments: [ + { + view: context.getCurrentTexture().createView(), + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + }); + + passEncoder.setPipeline(fullscreenQuadPipeline); + passEncoder.setBindGroup(0, showResultBindGroup); + passEncoder.draw(6); + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/meta.ts new file mode 100644 index 00000000..92fef440 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/imageBlur/meta.ts @@ -0,0 +1,11 @@ +export default { + name: 'Image Blur', + description: + 'This example shows how to blur an image using a WebGPU compute shader.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'blur.wgsl'}, + {path: '../../shaders/fullscreenTexturedQuad.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/index.html b/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/index.html new file mode 100644 index 00000000..fa495774 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: instancedCube + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/instanced.vert.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/instanced.vert.wgsl new file mode 100644 index 00000000..c1ccb98b --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/instanced.vert.wgsl @@ -0,0 +1,24 @@ +struct Uniforms { + modelViewProjectionMatrix : array, +} + +@binding(0) @group(0) var uniforms : Uniforms; + +struct VertexOutput { + @builtin(position) Position : vec4f, + @location(0) fragUV : vec2f, + @location(1) fragPosition: vec4f, +} + +@vertex +fn main( + @builtin(instance_index) instanceIdx : u32, + @location(0) position : vec4f, + @location(1) uv : vec2f +) -> VertexOutput { + var output : VertexOutput; + output.Position = uniforms.modelViewProjectionMatrix[instanceIdx] * position; + output.fragUV = uv; + output.fragPosition = 0.5 * (position + vec4(1.0)); + return output; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/main.ts new file mode 100644 index 00000000..24f66d66 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/main.ts @@ -0,0 +1,230 @@ +import {mat4, vec3} from 'wgpu-matrix'; + +import { + cubeVertexArray, + cubeVertexSize, + cubeUVOffset, + cubePositionOffset, + cubeVertexCount, +} from '../../meshes/cube'; + +import instancedVertWGSL from './instanced.vert.wgsl'; +import vertexPositionColorWGSL from '../../shaders/vertexPositionColor.frag.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +// Create a vertex buffer from the cube data. +const verticesBuffer = device.createBuffer({ + size: cubeVertexArray.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +new Float32Array(verticesBuffer.getMappedRange()).set(cubeVertexArray); +verticesBuffer.unmap(); + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: instancedVertWGSL, + }), + buffers: [ + { + arrayStride: cubeVertexSize, + attributes: [ + { + // position + shaderLocation: 0, + offset: cubePositionOffset, + format: 'float32x4', + }, + { + // uv + shaderLocation: 1, + offset: cubeUVOffset, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + code: vertexPositionColorWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + + // Backface culling since the cube is solid piece of geometry. + // Faces pointing away from the camera will be occluded by faces + // pointing toward the camera. + cullMode: 'back', + }, + + // Enable depth testing so that the fragment closest to the camera + // is rendered in front. + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus', + }, +}); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const xCount = 4; +const yCount = 4; +const numInstances = xCount * yCount; +const matrixFloatCount = 16; // 4x4 matrix +const matrixSize = 4 * matrixFloatCount; +const uniformBufferSize = numInstances * matrixSize; + +// Allocate a buffer large enough to hold transforms for every +// instance. +const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const uniformBindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + ], +}); + +const aspect = canvas.width / canvas.height; +const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 100.0); + +type Mat4 = mat4.default; +const modelMatrices = new Array(numInstances); +const mvpMatricesData = new Float32Array(matrixFloatCount * numInstances); + +const step = 4.0; + +// Initialize the matrix data for every instance. +let m = 0; +for (let x = 0; x < xCount; x++) { + for (let y = 0; y < yCount; y++) { + modelMatrices[m] = mat4.translation( + vec3.fromValues( + step * (x - xCount / 2 + 0.5), + step * (y - yCount / 2 + 0.5), + 0 + ) + ); + m++; + } +} + +const viewMatrix = mat4.translation(vec3.fromValues(0, 0, -12)); + +const tmpMat4 = mat4.create(); + +// Update the transformation matrix data for each instance. +function updateTransformationMatrix() { + const now = Date.now() / 1000; + + let m = 0, + i = 0; + for (let x = 0; x < xCount; x++) { + for (let y = 0; y < yCount; y++) { + mat4.rotate( + modelMatrices[i], + vec3.fromValues( + Math.sin((x + 0.5) * now), + Math.cos((y + 0.5) * now), + 0 + ), + 1, + tmpMat4 + ); + + mat4.multiply(viewMatrix, tmpMat4, tmpMat4); + mat4.multiply(projectionMatrix, tmpMat4, tmpMat4); + + mvpMatricesData.set(tmpMat4, m); + + i++; + m += matrixFloatCount; + } + } +} + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: {r: 0.5, g: 0.5, b: 0.5, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +function frame() { + // Update the matrix data. + updateTransformationMatrix(); + device.queue.writeBuffer( + uniformBuffer, + 0, + mvpMatricesData.buffer, + mvpMatricesData.byteOffset, + mvpMatricesData.byteLength + ); + + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.setBindGroup(0, uniformBindGroup); + passEncoder.setVertexBuffer(0, verticesBuffer); + passEncoder.draw(cubeVertexCount, numInstances, 0, 0); + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/meta.ts new file mode 100644 index 00000000..ae136b35 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/instancedCube/meta.ts @@ -0,0 +1,11 @@ +export default { + name: 'Instanced Cube', + description: 'This example shows the use of instancing.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'instanced.vert.wgsl'}, + {path: '../../shaders/vertexPositionColor.frag.wgsl'}, + {path: '../../meshes/cube.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/metaballs/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/metaballs/meta.ts new file mode 100644 index 00000000..c03af83c --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/metaballs/meta.ts @@ -0,0 +1,10 @@ +export default { + name: 'Metaballs', + description: `This example shows an implementation of metaballs with WebGPU. + +Source at https://github.com/toji/webgpu-metaballs/ +`, + filename: __DIRNAME__, + url: 'https://toji.github.io/webgpu-metaballs/', + sources: [], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/normalMap/index.html b/bindings/wgpu/webgpu-samples-ts/sample/normalMap/index.html new file mode 100644 index 00000000..ea5062b6 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/normalMap/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: normalMap + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/normalMap/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/normalMap/main.ts new file mode 100644 index 00000000..f710186d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/normalMap/main.ts @@ -0,0 +1,388 @@ +import {mat4, vec3} from 'wgpu-matrix'; +import {GUI} from 'dat.gui'; +import normalMapWGSL from './normalMap.wgsl'; +import {createMeshRenderable} from '../../meshes/mesh'; +import {createBoxMeshWithTangents} from '../../meshes/box'; +import { + createBindGroupDescriptor, + create3DRenderPipeline, + createTextureFromImage, +} from './utils'; + +const MAT4X4_BYTES = 64; + +enum TextureAtlas { + Spiral, + Toybox, + BrickWall, +} + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); +const context = canvas.getContext('webgpu') as GPUCanvasContext; +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +interface GUISettings { + 'Bump Mode': + | 'Albedo Texture' + | 'Normal Texture' + | 'Depth Texture' + | 'Normal Map' + | 'Parallax Scale' + | 'Steep Parallax'; + cameraPosX: number; + cameraPosY: number; + cameraPosZ: number; + lightPosX: number; + lightPosY: number; + lightPosZ: number; + lightIntensity: number; + depthScale: number; + depthLayers: number; + Texture: string; + 'Reset Light': () => void; +} + +const settings: GUISettings = { + 'Bump Mode': 'Normal Map', + cameraPosX: 0.0, + cameraPosY: 0.8, + cameraPosZ: -1.4, + lightPosX: 1.7, + lightPosY: 0.7, + lightPosZ: -1.9, + lightIntensity: 5.0, + depthScale: 0.05, + depthLayers: 16, + Texture: 'Spiral', + 'Reset Light': () => { + return; + }, +}; + +// Create normal mapping resources and pipeline +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const spaceTransformsBuffer = device.createBuffer({ + // Buffer holding projection, view, and model matrices plus padding bytes + size: MAT4X4_BYTES * 4, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const mapInfoBuffer = device.createBuffer({ + // Buffer holding mapping type, light uniforms, and depth uniforms + size: Float32Array.BYTES_PER_ELEMENT * 8, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); +const mapInfoArray = new ArrayBuffer(mapInfoBuffer.size); +const mapInfoView = new DataView(mapInfoArray, 0, mapInfoArray.byteLength); + +// Fetch the image and upload it into a GPUTexture. +let woodAlbedoTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/wood_albedo.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + woodAlbedoTexture = createTextureFromImage(device, imageBitmap); +} + +let spiralNormalTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/spiral_normal.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + spiralNormalTexture = createTextureFromImage(device, imageBitmap); +} + +let spiralHeightTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/spiral_height.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + spiralHeightTexture = createTextureFromImage(device, imageBitmap); +} + +let toyboxNormalTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/toybox_normal.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + toyboxNormalTexture = createTextureFromImage(device, imageBitmap); +} + +let toyboxHeightTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/toybox_height.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + toyboxHeightTexture = createTextureFromImage(device, imageBitmap); +} + +let brickwallAlbedoTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/brickwall_albedo.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + brickwallAlbedoTexture = createTextureFromImage(device, imageBitmap); +} + +let brickwallNormalTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/brickwall_normal.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + brickwallNormalTexture = createTextureFromImage(device, imageBitmap); +} + +let brickwallHeightTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/brickwall_height.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + brickwallHeightTexture = createTextureFromImage(device, imageBitmap); +} + +// Create a sampler with linear filtering for smooth interpolation. +const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', +}); + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +const box = createMeshRenderable( + device, + createBoxMeshWithTangents(1.0, 1.0, 1.0) +); + +// Uniform bindGroups and bindGroupLayout +const frameBGDescriptor = createBindGroupDescriptor( + [0, 1], + [ + GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, + GPUShaderStage.FRAGMENT | GPUShaderStage.VERTEX, + ], + ['buffer', 'buffer'], + [{type: 'uniform'}, {type: 'uniform'}], + [[{buffer: spaceTransformsBuffer}, {buffer: mapInfoBuffer}]], + 'Frame', + device +); + +// Texture bindGroups and bindGroupLayout +const surfaceBGDescriptor = createBindGroupDescriptor( + [0, 1, 2, 3], + [GPUShaderStage.FRAGMENT], + ['sampler', 'texture', 'texture', 'texture'], + [ + {type: 'filtering'}, + {sampleType: 'float'}, + {sampleType: 'float'}, + {sampleType: 'float'}, + ], + // Multiple bindgroups that accord to the layout defined above + [ + [ + sampler, + woodAlbedoTexture.createView(), + spiralNormalTexture.createView(), + spiralHeightTexture.createView(), + ], + [ + sampler, + woodAlbedoTexture.createView(), + toyboxNormalTexture.createView(), + toyboxHeightTexture.createView(), + ], + [ + sampler, + brickwallAlbedoTexture.createView(), + brickwallNormalTexture.createView(), + brickwallHeightTexture.createView(), + ], + ], + 'Surface', + device +); + +const aspect = canvas.width / canvas.height; +const projectionMatrix = mat4.perspective( + (2 * Math.PI) / 5, + aspect, + 0.1, + 10.0 +) as Float32Array; + +function getViewMatrix() { + return mat4.lookAt( + [settings.cameraPosX, settings.cameraPosY, settings.cameraPosZ], + [0, 0, 0], + [0, 1, 0] + ); +} + +function getModelMatrix() { + const modelMatrix = mat4.create(); + mat4.identity(modelMatrix); + const now = Date.now() / 1000; + mat4.rotateY(modelMatrix, now * -0.5, modelMatrix); + return modelMatrix; +} + +// Change the model mapping type +const getMode = (): number => { + switch (settings['Bump Mode']) { + case 'Albedo Texture': + return 0; + case 'Normal Texture': + return 1; + case 'Depth Texture': + return 2; + case 'Normal Map': + return 3; + case 'Parallax Scale': + return 4; + case 'Steep Parallax': + return 5; + } +}; + +const texturedCubePipeline = create3DRenderPipeline( + device, + 'NormalMappingRender', + [frameBGDescriptor.bindGroupLayout, surfaceBGDescriptor.bindGroupLayout], + normalMapWGSL, + // Position, normal uv tangent bitangent + ['float32x3', 'float32x3', 'float32x2', 'float32x3', 'float32x3'], + normalMapWGSL, + presentationFormat, + true +); + +let currentSurfaceBindGroup = 0; +const onChangeTexture = () => { + currentSurfaceBindGroup = TextureAtlas[settings.Texture]; +}; + +const gui = new GUI(); +gui.add(settings, 'Bump Mode', [ + 'Albedo Texture', + 'Normal Texture', + 'Depth Texture', + 'Normal Map', + 'Parallax Scale', + 'Steep Parallax', +]); +gui + .add(settings, 'Texture', ['Spiral', 'Toybox', 'BrickWall']) + .onChange(onChangeTexture); +const lightFolder = gui.addFolder('Light'); +const depthFolder = gui.addFolder('Depth'); +lightFolder.add(settings, 'Reset Light').onChange(() => { + lightPosXController.setValue(1.7); + lightPosYController.setValue(0.7); + lightPosZController.setValue(-1.9); + lightIntensityController.setValue(5.0); +}); +const lightPosXController = lightFolder + .add(settings, 'lightPosX', -5, 5) + .step(0.1); +const lightPosYController = lightFolder + .add(settings, 'lightPosY', -5, 5) + .step(0.1); +const lightPosZController = lightFolder + .add(settings, 'lightPosZ', -5, 5) + .step(0.1); +const lightIntensityController = lightFolder + .add(settings, 'lightIntensity', 0.0, 10) + .step(0.1); +depthFolder.add(settings, 'depthScale', 0.0, 0.1).step(0.01); +depthFolder.add(settings, 'depthLayers', 1, 32).step(1); + +function frame() { + // Update spaceTransformsBuffer + const viewMatrix = getViewMatrix(); + const worldViewMatrix = mat4.mul(viewMatrix, getModelMatrix()); + const worldViewProjMatrix = mat4.mul(projectionMatrix, worldViewMatrix); + const matrices = new Float32Array([ + ...worldViewProjMatrix, + ...worldViewMatrix, + ]); + + // Update mapInfoBuffer + const lightPosWS = vec3.create( + settings.lightPosX, + settings.lightPosY, + settings.lightPosZ + ); + const lightPosVS = vec3.transformMat4(lightPosWS, viewMatrix); + const mode = getMode(); + device.queue.writeBuffer( + spaceTransformsBuffer, + 0, + matrices.buffer, + matrices.byteOffset, + matrices.byteLength + ); + + // struct MapInfo { + // lightPosVS: vec3f, + // mode: u32, + // lightIntensity: f32, + // depthScale: f32, + // depthLayers: f32, + // } + mapInfoView.setFloat32(0, lightPosVS[0], true); + mapInfoView.setFloat32(4, lightPosVS[1], true); + mapInfoView.setFloat32(8, lightPosVS[2], true); + mapInfoView.setUint32(12, mode, true); + mapInfoView.setFloat32(16, settings.lightIntensity, true); + mapInfoView.setFloat32(20, settings.depthScale, true); + mapInfoView.setFloat32(24, settings.depthLayers, true); + device.queue.writeBuffer(mapInfoBuffer, 0, mapInfoArray); + + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + // Draw textured Cube + passEncoder.setPipeline(texturedCubePipeline); + passEncoder.setBindGroup(0, frameBGDescriptor.bindGroups[0]); + passEncoder.setBindGroup( + 1, + surfaceBGDescriptor.bindGroups[currentSurfaceBindGroup] + ); + passEncoder.setVertexBuffer(0, box.vertexBuffer); + passEncoder.setIndexBuffer(box.indexBuffer, 'uint16'); + passEncoder.drawIndexed(box.indexCount); + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/normalMap/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/normalMap/meta.ts new file mode 100644 index 00000000..63d82ee4 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/normalMap/meta.ts @@ -0,0 +1,13 @@ +export default { + name: 'Normal Mapping', + description: + 'This example demonstrates multiple different methods that employ fragment shaders to achieve additional perceptual depth on the surface of a cube mesh. Demonstrated methods include normal mapping, parallax mapping, and steep parallax mapping.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'normalMap.wgsl'}, + {path: '../../meshes/box.ts'}, + {path: '../../meshes/mesh.ts'}, + {path: 'utils.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/normalMap/normalMap.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/normalMap/normalMap.wgsl new file mode 100644 index 00000000..5a5a1373 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/normalMap/normalMap.wgsl @@ -0,0 +1,169 @@ +const modeAlbedoTexture = 0; +const modeNormalTexture = 1; +const modeDepthTexture = 2; +const modeNormalMap = 3; +const modeParallaxScale = 4; +const modeSteepParallax = 5; + +struct SpaceTransforms { + worldViewProjMatrix: mat4x4f, + worldViewMatrix: mat4x4f, +} + +struct MapInfo { + lightPosVS: vec3f, // Light position in view space + mode: u32, + lightIntensity: f32, + depthScale: f32, + depthLayers: f32, +} + +struct VertexInput { + // Shader assumes the missing 4th float is 1.0 + @location(0) position : vec4f, + @location(1) normal : vec3f, + @location(2) uv : vec2f, + @location(3) vert_tan: vec3f, + @location(4) vert_bitan: vec3f, +} + +struct VertexOutput { + @builtin(position) posCS : vec4f, // vertex position in clip space + @location(0) posVS : vec3f, // vertex position in view space + @location(1) tangentVS: vec3f, // vertex tangent in view space + @location(2) bitangentVS: vec3f, // vertex tangent in view space + @location(3) normalVS: vec3f, // vertex normal in view space + @location(5) uv : vec2f, // vertex texture coordinate +} + +// Uniforms +@group(0) @binding(0) var spaceTransform : SpaceTransforms; +@group(0) @binding(1) var mapInfo: MapInfo; + +// Texture info +@group(1) @binding(0) var textureSampler: sampler; +@group(1) @binding(1) var albedoTexture: texture_2d; +@group(1) @binding(2) var normalTexture: texture_2d; +@group(1) @binding(3) var depthTexture: texture_2d; + + +@vertex +fn vertexMain(input: VertexInput) -> VertexOutput { + var output : VertexOutput; + + output.posCS = spaceTransform.worldViewProjMatrix * input.position; + output.posVS = (spaceTransform.worldViewMatrix * input.position).xyz; + output.tangentVS = (spaceTransform.worldViewMatrix * vec4(input.vert_tan, 0)).xyz; + output.bitangentVS = (spaceTransform.worldViewMatrix * vec4(input.vert_bitan, 0)).xyz; + output.normalVS = (spaceTransform.worldViewMatrix * vec4(input.normal, 0)).xyz; + output.uv = input.uv; + + return output; +} + +@fragment +fn fragmentMain(input: VertexOutput) -> @location(0) vec4f { + // Build the matrix to convert from tangent space to view space + let tangentToView = mat3x3f( + input.tangentVS, + input.bitangentVS, + input.normalVS, + ); + + // The inverse of a non-scaling affine 3x3 matrix is it's transpose + let viewToTangent = transpose(tangentToView); + + // Calculate the normalized vector in tangent space from the camera to the fragment + let viewDirTS = normalize(viewToTangent * input.posVS); + + // Apply parallax to the texture coordinate, if parallax is enabled + var uv : vec2f; + switch (mapInfo.mode) { + case modeParallaxScale: { + uv = parallaxScale(input.uv, viewDirTS); + break; + } + case modeSteepParallax: { + uv = parallaxSteep(input.uv, viewDirTS); + break; + } + default: { + uv = input.uv; + break; + } + } + + // Sample the albedo texture + let albedoSample = textureSample(albedoTexture, textureSampler, uv); + + // Sample the normal texture + let normalSample = textureSample(normalTexture, textureSampler, uv); + + switch (mapInfo.mode) { + case modeAlbedoTexture: { // Output the albedo sample + return albedoSample; + } + case modeNormalTexture: { // Output the normal sample + return normalSample; + } + case modeDepthTexture: { // Output the depth map + return textureSample(depthTexture, textureSampler, input.uv); + } + default: { + // Transform the normal sample to a tangent space normal + let normalTS = normalSample.xyz * 2 - 1; + + // Convert normal from tangent space to view space, and normalize + let normalVS = normalize(tangentToView * normalTS); + + // Calculate the vector in view space from the light position to the fragment + let fragToLightVS = mapInfo.lightPosVS - input.posVS; + + // Calculate the square distance from the light to the fragment + let lightSqrDist = dot(fragToLightVS, fragToLightVS); + + // Calculate the normalized vector in view space from the fragment to the light + let lightDirVS = fragToLightVS * inverseSqrt(lightSqrDist); + + // Light strength is inversely proportional to square of distance from light + let diffuseLight = mapInfo.lightIntensity * max(dot(lightDirVS, normalVS), 0) / lightSqrDist; + + // The diffuse is the albedo color multiplied by the diffuseLight + let diffuse = albedoSample.rgb * diffuseLight; + + return vec4f(diffuse, 1.0); + } + } +} + + +// Returns the uv coordinate displaced in the view direction by a magnitude calculated by the depth +// sampled from the depthTexture and the angle between the surface normal and view direction. +fn parallaxScale(uv: vec2f, viewDirTS: vec3f) -> vec2f { + let depthSample = textureSample(depthTexture, textureSampler, uv).r; + return uv + viewDirTS.xy * (depthSample * mapInfo.depthScale) / -viewDirTS.z; +} + +// Returns the uv coordinates displaced in the view direction by ray-tracing the depth map. +fn parallaxSteep(startUV: vec2f, viewDirTS: vec3f) -> vec2f { + // Calculate derivatives of the texture coordinate, so we can sample the texture with non-uniform + // control flow. + let ddx = dpdx(startUV); + let ddy = dpdy(startUV); + + // Calculate the delta step in UV and depth per iteration + let uvDelta = viewDirTS.xy * mapInfo.depthScale / (-viewDirTS.z * mapInfo.depthLayers); + let depthDelta = 1.0 / f32(mapInfo.depthLayers); + let posDelta = vec3(uvDelta, depthDelta); + + // Walk the depth texture, and stop when the ray intersects the depth map + var pos = vec3(startUV, 0); + for (var i = 0; i < 32; i++) { + if (pos.z >= textureSampleGrad(depthTexture, textureSampler, pos.xy, ddx, ddy).r) { + break; // Hit the surface + } + pos += posDelta; + } + + return pos.xy; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/normalMap/utils.ts b/bindings/wgpu/webgpu-samples-ts/sample/normalMap/utils.ts new file mode 100644 index 00000000..d2f09079 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/normalMap/utils.ts @@ -0,0 +1,205 @@ +type BindGroupBindingLayout = + | GPUBufferBindingLayout + | GPUTextureBindingLayout + | GPUSamplerBindingLayout + | GPUStorageTextureBindingLayout + | GPUExternalTextureBindingLayout; + +export type BindGroupsObjectsAndLayout = { + bindGroups: GPUBindGroup[]; + bindGroupLayout: GPUBindGroupLayout; +}; + +type ResourceTypeName = + | 'buffer' + | 'texture' + | 'sampler' + | 'externalTexture' + | 'storageTexture'; + +/** + * @param {number[]} bindings - The binding value of each resource in the bind group. + * @param {number[]} visibilities - The GPUShaderStage visibility of the resource at the corresponding index. + * @param {ResourceTypeName[]} resourceTypes - The resourceType at the corresponding index. + * @returns {BindGroupsObjectsAndLayout} An object containing an array of bindGroups and the bindGroupLayout they implement. + */ +export const createBindGroupDescriptor = ( + bindings: number[], + visibilities: number[], + resourceTypes: ResourceTypeName[], + resourceLayouts: BindGroupBindingLayout[], + resources: GPUBindingResource[][], + label: string, + device: GPUDevice +): BindGroupsObjectsAndLayout => { + // Create layout of each entry within a bindGroup + const layoutEntries: GPUBindGroupLayoutEntry[] = []; + for (let i = 0; i < bindings.length; i++) { + layoutEntries.push({ + binding: bindings[i], + visibility: visibilities[i % visibilities.length], + [resourceTypes[i]]: resourceLayouts[i], + }); + } + + // Apply entry layouts to bindGroupLayout + const bindGroupLayout = device.createBindGroupLayout({ + label: `${label}.bindGroupLayout`, + entries: layoutEntries, + }); + + // Create bindGroups that conform to the layout + const bindGroups: GPUBindGroup[] = []; + for (let i = 0; i < resources.length; i++) { + const groupEntries: GPUBindGroupEntry[] = []; + for (let j = 0; j < resources[0].length; j++) { + groupEntries.push({ + binding: j, + resource: resources[i][j], + }); + } + const newBindGroup = device.createBindGroup({ + label: `${label}.bindGroup${i}`, + layout: bindGroupLayout, + entries: groupEntries, + }); + bindGroups.push(newBindGroup); + } + + return { + bindGroups, + bindGroupLayout, + }; +}; + +export type ShaderKeyInterface = { + [K in T[number]]: number; +}; + +interface AttribAcc { + attributes: GPUVertexAttribute[]; + arrayStride: number; +} + +/** + * @param {GPUVertexFormat} vf - A valid GPUVertexFormat, representing a per-vertex value that can be passed to the vertex shader. + * @returns {number} The number of bytes present in the value to be passed. + */ +export const convertVertexFormatToBytes = (vf: GPUVertexFormat): number => { + const splitFormat = vf.split('x'); + const bytesPerElement = parseInt(splitFormat[0].replace(/[^0-9]/g, '')) / 8; + + const bytesPerVec = + bytesPerElement * + (splitFormat[1] !== undefined ? parseInt(splitFormat[1]) : 1); + + return bytesPerVec; +}; + +/** Creates a GPUVertexBuffer Layout that maps to an interleaved vertex buffer. + * @param {GPUVertexFormat[]} vertexFormats - An array of valid GPUVertexFormats. + * @returns {GPUVertexBufferLayout} A GPUVertexBufferLayout representing an interleaved vertex buffer. + */ +export const createVBuffer = ( + vertexFormats: GPUVertexFormat[] +): GPUVertexBufferLayout => { + const initialValue: AttribAcc = {attributes: [], arrayStride: 0}; + + const vertexBuffer = vertexFormats.reduce( + (acc: AttribAcc, curr: GPUVertexFormat, idx: number) => { + const newAttribute: GPUVertexAttribute = { + shaderLocation: idx, + offset: acc.arrayStride, + format: curr, + }; + const nextOffset: number = + acc.arrayStride + convertVertexFormatToBytes(curr); + + const retVal: AttribAcc = { + attributes: [...acc.attributes, newAttribute], + arrayStride: nextOffset, + }; + return retVal; + }, + initialValue + ); + + const layout: GPUVertexBufferLayout = { + arrayStride: vertexBuffer.arrayStride, + attributes: vertexBuffer.attributes, + }; + + return layout; +}; + +export const create3DRenderPipeline = ( + device: GPUDevice, + label: string, + bgLayouts: GPUBindGroupLayout[], + vertexShader: string, + vBufferFormats: GPUVertexFormat[], + fragmentShader: string, + presentationFormat: GPUTextureFormat, + depthTest = false, + topology: GPUPrimitiveTopology = 'triangle-list', + cullMode: GPUCullMode = 'back' +) => { + const pipelineDescriptor: GPURenderPipelineDescriptor = { + label: `${label}.pipeline`, + layout: device.createPipelineLayout({ + label: `${label}.pipelineLayout`, + bindGroupLayouts: bgLayouts, + }), + vertex: { + module: device.createShaderModule({ + label: `${label}.vertexShader`, + code: vertexShader, + }), + buffers: + vBufferFormats.length !== 0 ? [createVBuffer(vBufferFormats)] : [], + }, + fragment: { + module: device.createShaderModule({ + label: `${label}.fragmentShader`, + code: fragmentShader, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: topology, + cullMode: cullMode, + }, + }; + if (depthTest) { + pipelineDescriptor.depthStencil = { + depthCompare: 'less', + depthWriteEnabled: true, + format: 'depth24plus', + }; + } + return device.createRenderPipeline(pipelineDescriptor); +}; + +export const createTextureFromImage = ( + device: GPUDevice, + bitmap: ImageBitmap +) => { + const texture: GPUTexture = device.createTexture({ + size: [bitmap.width, bitmap.height, 1], + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + device.queue.copyExternalImageToTexture( + {source: bitmap}, + {texture: texture}, + [bitmap.width, bitmap.height] + ); + return texture; +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/particles/index.html b/bindings/wgpu/webgpu-samples-ts/sample/particles/index.html new file mode 100644 index 00000000..777e1773 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/particles/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: particles + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/particles/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/particles/main.ts new file mode 100644 index 00000000..253bb6e4 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/particles/main.ts @@ -0,0 +1,440 @@ +import {mat4, vec3} from 'wgpu-matrix'; +import {GUI} from 'dat.gui'; + +import particleWGSL from './particle.wgsl'; +import probabilityMapWGSL from './probabilityMap.wgsl'; + +const numParticles = 50000; +const particlePositionOffset = 0; +const particleColorOffset = 4 * 4; +const particleInstanceByteSize = + 3 * 4 + // position + 1 * 4 + // lifetime + 4 * 4 + // color + 3 * 4 + // velocity + 1 * 4 + // padding + 0; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const particlesBuffer = device.createBuffer({ + size: numParticles * particleInstanceByteSize, + usage: GPUBufferUsage.VERTEX | GPUBufferUsage.STORAGE, +}); + +const renderPipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: particleWGSL, + }), + buffers: [ + { + // instanced particles buffer + arrayStride: particleInstanceByteSize, + stepMode: 'instance', + attributes: [ + { + // position + shaderLocation: 0, + offset: particlePositionOffset, + format: 'float32x3', + }, + { + // color + shaderLocation: 1, + offset: particleColorOffset, + format: 'float32x4', + }, + ], + }, + { + // quad vertex buffer + arrayStride: 2 * 4, // vec2f + stepMode: 'vertex', + attributes: [ + { + // vertex positions + shaderLocation: 2, + offset: 0, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + code: particleWGSL, + }), + targets: [ + { + format: presentationFormat, + blend: { + color: { + srcFactor: 'src-alpha', + dstFactor: 'one', + operation: 'add', + }, + alpha: { + srcFactor: 'zero', + dstFactor: 'one', + operation: 'add', + }, + }, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, + + depthStencil: { + depthWriteEnabled: false, + depthCompare: 'less', + format: 'depth24plus', + }, +}); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const uniformBufferSize = + 4 * 4 * 4 + // modelViewProjectionMatrix : mat4x4f + 3 * 4 + // right : vec3f + 4 + // padding + 3 * 4 + // up : vec3f + 4 + // padding + 0; +const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const uniformBindGroup = device.createBindGroup({ + layout: renderPipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + ], +}); + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +////////////////////////////////////////////////////////////////////////////// +// Quad vertex buffer +////////////////////////////////////////////////////////////////////////////// +const quadVertexBuffer = device.createBuffer({ + size: 6 * 2 * 4, // 6x vec2f + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +// prettier-ignore +const vertexData = [ + -1.0, -1.0, +1.0, -1.0, -1.0, +1.0, -1.0, +1.0, +1.0, -1.0, +1.0, +1.0, +]; +new Float32Array(quadVertexBuffer.getMappedRange()).set(vertexData); +quadVertexBuffer.unmap(); + +////////////////////////////////////////////////////////////////////////////// +// Texture +////////////////////////////////////////////////////////////////////////////// +let texture: GPUTexture; +let textureWidth = 1; +let textureHeight = 1; +let numMipLevels = 1; +{ + const response = await fetch('../../assets/img/webgpu.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + + // Calculate number of mip levels required to generate the probability map + while ( + textureWidth < imageBitmap.width || + textureHeight < imageBitmap.height + ) { + textureWidth *= 2; + textureHeight *= 2; + numMipLevels++; + } + texture = device.createTexture({ + size: [imageBitmap.width, imageBitmap.height, 1], + mipLevelCount: numMipLevels, + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.STORAGE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + device.queue.copyExternalImageToTexture( + {source: imageBitmap}, + {texture: texture}, + [imageBitmap.width, imageBitmap.height] + ); +} + +////////////////////////////////////////////////////////////////////////////// +// Probability map generation +// The 0'th mip level of texture holds the color data and spawn-probability in +// the alpha channel. The mip levels 1..N are generated to hold spawn +// probabilities up to the top 1x1 mip level. +////////////////////////////////////////////////////////////////////////////// +{ + const probabilityMapImportLevelPipeline = device.createComputePipeline({ + layout: 'auto', + compute: { + module: device.createShaderModule({code: probabilityMapWGSL}), + entryPoint: 'import_level', + }, + }); + const probabilityMapExportLevelPipeline = device.createComputePipeline({ + layout: 'auto', + compute: { + module: device.createShaderModule({code: probabilityMapWGSL}), + entryPoint: 'export_level', + }, + }); + + const probabilityMapUBOBufferSize = + 1 * 4 + // stride + 3 * 4 + // padding + 0; + const probabilityMapUBOBuffer = device.createBuffer({ + size: probabilityMapUBOBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); + const buffer_a = device.createBuffer({ + size: textureWidth * textureHeight * 4, + usage: GPUBufferUsage.STORAGE, + }); + const buffer_b = device.createBuffer({ + size: textureWidth * textureHeight * 4, + usage: GPUBufferUsage.STORAGE, + }); + device.queue.writeBuffer( + probabilityMapUBOBuffer, + 0, + new Int32Array([textureWidth]) + ); + const commandEncoder = device.createCommandEncoder(); + for (let level = 0; level < numMipLevels; level++) { + const levelWidth = textureWidth >> level; + const levelHeight = textureHeight >> level; + const pipeline = + level == 0 + ? probabilityMapImportLevelPipeline.getBindGroupLayout(0) + : probabilityMapExportLevelPipeline.getBindGroupLayout(0); + const probabilityMapBindGroup = device.createBindGroup({ + layout: pipeline, + entries: [ + { + // ubo + binding: 0, + resource: {buffer: probabilityMapUBOBuffer}, + }, + { + // buf_in + binding: 1, + resource: {buffer: level & 1 ? buffer_a : buffer_b}, + }, + { + // buf_out + binding: 2, + resource: {buffer: level & 1 ? buffer_b : buffer_a}, + }, + { + // tex_in / tex_out + binding: 3, + resource: texture.createView({ + format: 'rgba8unorm', + dimension: '2d', + baseMipLevel: level, + mipLevelCount: 1, + }), + }, + ], + }); + if (level == 0) { + const passEncoder = commandEncoder.beginComputePass(); + passEncoder.setPipeline(probabilityMapImportLevelPipeline); + passEncoder.setBindGroup(0, probabilityMapBindGroup); + passEncoder.dispatchWorkgroups(Math.ceil(levelWidth / 64), levelHeight); + passEncoder.end(); + } else { + const passEncoder = commandEncoder.beginComputePass(); + passEncoder.setPipeline(probabilityMapExportLevelPipeline); + passEncoder.setBindGroup(0, probabilityMapBindGroup); + passEncoder.dispatchWorkgroups(Math.ceil(levelWidth / 64), levelHeight); + passEncoder.end(); + } + } + device.queue.submit([commandEncoder.finish()]); +} + +////////////////////////////////////////////////////////////////////////////// +// Simulation compute pipeline +////////////////////////////////////////////////////////////////////////////// +const simulationParams = { + simulate: true, + deltaTime: 0.04, +}; + +const simulationUBOBufferSize = + 1 * 4 + // deltaTime + 3 * 4 + // padding + 4 * 4 + // seed + 0; +const simulationUBOBuffer = device.createBuffer({ + size: simulationUBOBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const gui = new GUI(); +gui.add(simulationParams, 'simulate'); +gui.add(simulationParams, 'deltaTime'); + +const computePipeline = device.createComputePipeline({ + layout: 'auto', + compute: { + module: device.createShaderModule({ + code: particleWGSL, + }), + entryPoint: 'simulate', + }, +}); +const computeBindGroup = device.createBindGroup({ + layout: computePipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: simulationUBOBuffer, + }, + }, + { + binding: 1, + resource: { + buffer: particlesBuffer, + offset: 0, + size: numParticles * particleInstanceByteSize, + }, + }, + { + binding: 2, + resource: texture.createView(), + }, + ], +}); + +const aspect = canvas.width / canvas.height; +const projection = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 100.0); +const view = mat4.create(); +const mvp = mat4.create(); + +function frame() { + device.queue.writeBuffer( + simulationUBOBuffer, + 0, + new Float32Array([ + simulationParams.simulate ? simulationParams.deltaTime : 0.0, + 0.0, + 0.0, + 0.0, // padding + Math.random() * 100, + Math.random() * 100, // seed.xy + 1 + Math.random(), + 1 + Math.random(), // seed.zw + ]) + ); + + mat4.identity(view); + mat4.translate(view, vec3.fromValues(0, 0, -3), view); + mat4.rotateX(view, Math.PI * -0.2, view); + mat4.multiply(projection, view, mvp); + + // prettier-ignore + device.queue.writeBuffer( + uniformBuffer, + 0, + new Float32Array([ + // modelViewProjectionMatrix + mvp[0], mvp[1], mvp[2], mvp[3], + mvp[4], mvp[5], mvp[6], mvp[7], + mvp[8], mvp[9], mvp[10], mvp[11], + mvp[12], mvp[13], mvp[14], mvp[15], + + view[0], view[4], view[8], // right + + 0, // padding + + view[1], view[5], view[9], // up + + 0, // padding + ]) + ); + const swapChainTexture = context.getCurrentTexture(); + // prettier-ignore + renderPassDescriptor.colorAttachments[0].view = swapChainTexture.createView(); + + const commandEncoder = device.createCommandEncoder(); + { + const passEncoder = commandEncoder.beginComputePass(); + passEncoder.setPipeline(computePipeline); + passEncoder.setBindGroup(0, computeBindGroup); + passEncoder.dispatchWorkgroups(Math.ceil(numParticles / 64)); + passEncoder.end(); + } + { + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(renderPipeline); + passEncoder.setBindGroup(0, uniformBindGroup); + passEncoder.setVertexBuffer(0, particlesBuffer); + passEncoder.setVertexBuffer(1, quadVertexBuffer); + passEncoder.draw(6, numParticles, 0, 0); + passEncoder.end(); + } + + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/particles/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/particles/meta.ts new file mode 100644 index 00000000..5a4c0b3b --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/particles/meta.ts @@ -0,0 +1,11 @@ +export default { + name: 'Particles', + description: + 'This example demonstrates rendering of particles simulated with compute shaders.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: './particle.wgsl'}, + {path: './probabilityMap.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/particles/particle.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/particles/particle.wgsl new file mode 100644 index 00000000..15c3f604 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/particles/particle.wgsl @@ -0,0 +1,136 @@ +//////////////////////////////////////////////////////////////////////////////// +// Utilities +//////////////////////////////////////////////////////////////////////////////// +var rand_seed : vec2f; + +fn init_rand(invocation_id : u32, seed : vec4f) { + rand_seed = seed.xz; + rand_seed = fract(rand_seed * cos(35.456+f32(invocation_id) * seed.yw)); + rand_seed = fract(rand_seed * cos(41.235+f32(invocation_id) * seed.xw)); +} + +fn rand() -> f32 { + rand_seed.x = fract(cos(dot(rand_seed, vec2f(23.14077926, 232.61690225))) * 136.8168); + rand_seed.y = fract(cos(dot(rand_seed, vec2f(54.47856553, 345.84153136))) * 534.7645); + return rand_seed.y; +} + +//////////////////////////////////////////////////////////////////////////////// +// Vertex shader +//////////////////////////////////////////////////////////////////////////////// +struct RenderParams { + modelViewProjectionMatrix : mat4x4f, + right : vec3f, + up : vec3f +} +@binding(0) @group(0) var render_params : RenderParams; + +struct VertexInput { + @location(0) position : vec3f, + @location(1) color : vec4f, + @location(2) quad_pos : vec2f, // -1..+1 +} + +struct VertexOutput { + @builtin(position) position : vec4f, + @location(0) color : vec4f, + @location(1) quad_pos : vec2f, // -1..+1 +} + +@vertex +fn vs_main(in : VertexInput) -> VertexOutput { + var quad_pos = mat2x3f(render_params.right, render_params.up) * in.quad_pos; + var position = in.position + quad_pos * 0.01; + var out : VertexOutput; + out.position = render_params.modelViewProjectionMatrix * vec4f(position, 1.0); + out.color = in.color; + out.quad_pos = in.quad_pos; + return out; +} + +//////////////////////////////////////////////////////////////////////////////// +// Fragment shader +//////////////////////////////////////////////////////////////////////////////// +@fragment +fn fs_main(in : VertexOutput) -> @location(0) vec4f { + var color = in.color; + // Apply a circular particle alpha mask + color.a = color.a * max(1.0 - length(in.quad_pos), 0.0); + return color; +} + +//////////////////////////////////////////////////////////////////////////////// +// Simulation Compute shader +//////////////////////////////////////////////////////////////////////////////// +struct SimulationParams { + deltaTime : f32, + seed : vec4f, +} + +struct Particle { + position : vec3f, + lifetime : f32, + color : vec4f, + velocity : vec3f, +} + +struct Particles { + particles : array, +} + +@binding(0) @group(0) var sim_params : SimulationParams; +@binding(1) @group(0) var data : Particles; +@binding(2) @group(0) var texture : texture_2d; + +@compute @workgroup_size(64) +fn simulate(@builtin(global_invocation_id) global_invocation_id : vec3u) { + let idx = global_invocation_id.x; + + init_rand(idx, sim_params.seed); + + var particle = data.particles[idx]; + + // Apply gravity + particle.velocity.z = particle.velocity.z - sim_params.deltaTime * 0.5; + + // Basic velocity integration + particle.position = particle.position + sim_params.deltaTime * particle.velocity; + + // Age each particle. Fade out before vanishing. + particle.lifetime = particle.lifetime - sim_params.deltaTime; + particle.color.a = smoothstep(0.0, 0.5, particle.lifetime); + + // If the lifetime has gone negative, then the particle is dead and should be + // respawned. + if (particle.lifetime < 0.0) { + // Use the probability map to find where the particle should be spawned. + // Starting with the 1x1 mip level. + var coord : vec2i; + for (var level = u32(textureNumLevels(texture) - 1); level > 0; level--) { + // Load the probability value from the mip-level + // Generate a random number and using the probabilty values, pick the + // next texel in the next largest mip level: + // + // 0.0 probabilites.r probabilites.g probabilites.b 1.0 + // | | | | | + // | TOP-LEFT | TOP-RIGHT | BOTTOM-LEFT | BOTTOM_RIGHT | + // + let probabilites = textureLoad(texture, coord, level); + let value = vec4f(rand()); + let mask = (value >= vec4f(0.0, probabilites.xyz)) & (value < probabilites); + coord = coord * 2; + coord.x = coord.x + select(0, 1, any(mask.yw)); // x y + coord.y = coord.y + select(0, 1, any(mask.zw)); // z w + } + let uv = vec2f(coord) / vec2f(textureDimensions(texture)); + particle.position = vec3f((uv - 0.5) * 3.0 * vec2f(1.0, -1.0), 0.0); + particle.color = textureLoad(texture, coord, 0); + particle.velocity.x = (rand() - 0.5) * 0.1; + particle.velocity.y = (rand() - 0.5) * 0.1; + particle.velocity.z = rand() * 0.3; + particle.lifetime = 0.5 + rand() * 3.0; + } + + // Store the new particle value + data.particles[idx] = particle; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/particles/probabilityMap.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/particles/probabilityMap.wgsl new file mode 100644 index 00000000..62d8b7d5 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/particles/probabilityMap.wgsl @@ -0,0 +1,54 @@ +struct UBO { + width : u32, +} + +struct Buffer { + weights : array, +} + +@binding(0) @group(0) var ubo : UBO; +@binding(1) @group(0) var buf_in : Buffer; +@binding(2) @group(0) var buf_out : Buffer; +@binding(3) @group(0) var tex_in : texture_2d; +@binding(3) @group(0) var tex_out : texture_storage_2d; + + +//////////////////////////////////////////////////////////////////////////////// +// import_level +// +// Loads the alpha channel from a texel of the source image, and writes it to +// the buf_out.weights. +//////////////////////////////////////////////////////////////////////////////// +@compute @workgroup_size(64) +fn import_level(@builtin(global_invocation_id) coord : vec3u) { + _ = &buf_in; + let offset = coord.x + coord.y * ubo.width; + buf_out.weights[offset] = textureLoad(tex_in, vec2i(coord.xy), 0).w; +} + +//////////////////////////////////////////////////////////////////////////////// +// export_level +// +// Loads 4 f32 weight values from buf_in.weights, and stores summed value into +// buf_out.weights, along with the calculated 'probabilty' vec4 values into the +// mip level of tex_out. See simulate() in particle.wgsl to understand the +// probability logic. +//////////////////////////////////////////////////////////////////////////////// +@compute @workgroup_size(64) +fn export_level(@builtin(global_invocation_id) coord : vec3u) { + if (all(coord.xy < vec2u(textureDimensions(tex_out)))) { + let dst_offset = coord.x + coord.y * ubo.width; + let src_offset = coord.x*2u + coord.y*2u * ubo.width; + + let a = buf_in.weights[src_offset + 0u]; + let b = buf_in.weights[src_offset + 1u]; + let c = buf_in.weights[src_offset + 0u + ubo.width]; + let d = buf_in.weights[src_offset + 1u + ubo.width]; + let sum = dot(vec4f(a, b, c, d), vec4f(1.0)); + + buf_out.weights[dst_offset] = sum / 4.0; + + let probabilities = vec4f(a, a+b, a+b+c, sum) / max(sum, 0.0001); + textureStore(tex_out, vec2i(coord.xy), probabilities); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/pristineGrid/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/pristineGrid/meta.ts new file mode 100644 index 00000000..4c62d66d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/pristineGrid/meta.ts @@ -0,0 +1,10 @@ +export default { + name: 'Pristine Grid', + description: `A simple WebGPU implementation of the "Pristine Grid" technique described in this wonderful little blog post: https://bgolus.medium.com/the-best-darn-grid-shader-yet-727f9278b9d8. + +Source at https://github.com/toji/pristine-grid-webgpu/ +`, + filename: __DIRNAME__, + url: 'https://toji.github.io/pristine-grid-webgpu/', + sources: [], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/index.html b/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/index.html new file mode 100644 index 00000000..f7e1c0a5 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: renderBundles + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/main.ts new file mode 100644 index 00000000..aa1e4271 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/main.ts @@ -0,0 +1,417 @@ +import {mat4, vec3} from 'wgpu-matrix'; +import {GUI} from 'dat.gui'; +import {createSphereMesh, SphereLayout} from '../../meshes/sphere'; +import Stats from 'stats.js'; + +import meshWGSL from './mesh.wgsl'; + +interface Renderable { + vertices: GPUBuffer; + indices: GPUBuffer; + indexCount: number; + bindGroup?: GPUBindGroup; +} + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const settings = { + useRenderBundles: true, + asteroidCount: 5000, +}; +const gui = new GUI(); +gui.add(settings, 'useRenderBundles'); +gui.add(settings, 'asteroidCount', 1000, 10000, 1000).onChange(() => { + // If the content of the scene changes the render bundle must be recreated. + ensureEnoughAsteroids(); + updateRenderBundle(); +}); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const shaderModule = device.createShaderModule({ + code: meshWGSL, +}); + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: shaderModule, + buffers: [ + { + arrayStride: SphereLayout.vertexStride, + attributes: [ + { + // position + shaderLocation: 0, + offset: SphereLayout.positionsOffset, + format: 'float32x3', + }, + { + // normal + shaderLocation: 1, + offset: SphereLayout.normalOffset, + format: 'float32x3', + }, + { + // uv + shaderLocation: 2, + offset: SphereLayout.uvOffset, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: shaderModule, + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + + // Backface culling since the sphere is solid piece of geometry. + // Faces pointing away from the camera will be occluded by faces + // pointing toward the camera. + cullMode: 'back', + }, + + // Enable depth testing so that the fragment closest to the camera + // is rendered in front. + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus', + }, +}); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const uniformBufferSize = 4 * 16; // 4x4 matrix +const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +// Fetch the images and upload them into a GPUTexture. +let planetTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/saturn.jpg'); + const imageBitmap = await createImageBitmap(await response.blob()); + + planetTexture = device.createTexture({ + size: [imageBitmap.width, imageBitmap.height, 1], + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + device.queue.copyExternalImageToTexture( + {source: imageBitmap}, + {texture: planetTexture}, + [imageBitmap.width, imageBitmap.height] + ); +} + +let moonTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/moon.jpg'); + const imageBitmap = await createImageBitmap(await response.blob()); + + moonTexture = device.createTexture({ + size: [imageBitmap.width, imageBitmap.height, 1], + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + device.queue.copyExternalImageToTexture( + {source: imageBitmap}, + {texture: moonTexture}, + [imageBitmap.width, imageBitmap.height] + ); +} + +const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', +}); + +// Helper functions to create the required meshes and bind groups for each sphere. +function createSphereRenderable( + radius: number, + widthSegments = 32, + heightSegments = 16, + randomness = 0 +): Renderable { + const sphereMesh = createSphereMesh( + radius, + widthSegments, + heightSegments, + randomness + ); + + // Create a vertex buffer from the sphere data. + const vertices = device.createBuffer({ + size: sphereMesh.vertices.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, + }); + new Float32Array(vertices.getMappedRange()).set(sphereMesh.vertices); + vertices.unmap(); + + const indices = device.createBuffer({ + size: sphereMesh.indices.byteLength, + usage: GPUBufferUsage.INDEX, + mappedAtCreation: true, + }); + new Uint16Array(indices.getMappedRange()).set(sphereMesh.indices); + indices.unmap(); + + return { + vertices, + indices, + indexCount: sphereMesh.indices.length, + }; +} + +function createSphereBindGroup( + texture: GPUTexture, + transform: Float32Array +): GPUBindGroup { + const uniformBufferSize = 4 * 16; // 4x4 matrix + const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + mappedAtCreation: true, + }); + new Float32Array(uniformBuffer.getMappedRange()).set(transform); + uniformBuffer.unmap(); + + const bindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(1), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + { + binding: 1, + resource: sampler, + }, + { + binding: 2, + resource: texture.createView(), + }, + ], + }); + + return bindGroup; +} + +const transform = mat4.create() as Float32Array; +mat4.identity(transform); + +// Create one large central planet surrounded by a large ring of asteroids +const planet = createSphereRenderable(1.0); +planet.bindGroup = createSphereBindGroup(planetTexture, transform); + +const asteroids = [ + createSphereRenderable(0.01, 8, 6, 0.15), + createSphereRenderable(0.013, 8, 6, 0.15), + createSphereRenderable(0.017, 8, 6, 0.15), + createSphereRenderable(0.02, 8, 6, 0.15), + createSphereRenderable(0.03, 16, 8, 0.15), +]; + +const renderables = [planet]; + +function ensureEnoughAsteroids() { + for (let i = renderables.length; i <= settings.asteroidCount; ++i) { + // Place copies of the asteroid in a ring. + const radius = Math.random() * 1.7 + 1.25; + const angle = Math.random() * Math.PI * 2; + const x = Math.sin(angle) * radius; + const y = (Math.random() - 0.5) * 0.015; + const z = Math.cos(angle) * radius; + + mat4.identity(transform); + mat4.translate(transform, [x, y, z], transform); + mat4.rotateX(transform, Math.random() * Math.PI, transform); + mat4.rotateY(transform, Math.random() * Math.PI, transform); + renderables.push({ + ...asteroids[i % asteroids.length], + bindGroup: createSphereBindGroup(moonTexture, transform), + }); + } +} + +ensureEnoughAsteroids(); + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +const aspect = canvas.width / canvas.height; +const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 100.0); +const modelViewProjectionMatrix = mat4.create(); + +const frameBindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + ], +}); + +function getTransformationMatrix() { + const viewMatrix = mat4.identity(); + mat4.translate(viewMatrix, vec3.fromValues(0, 0, -4), viewMatrix); + const now = Date.now() / 1000; + // Tilt the view matrix so the planet looks like it's off-axis. + mat4.rotateZ(viewMatrix, Math.PI * 0.1, viewMatrix); + mat4.rotateX(viewMatrix, Math.PI * 0.1, viewMatrix); + // Rotate the view matrix slowly so the planet appears to spin. + mat4.rotateY(viewMatrix, now * 0.05, viewMatrix); + + mat4.multiply(projectionMatrix, viewMatrix, modelViewProjectionMatrix); + + return modelViewProjectionMatrix as Float32Array; +} + +// Render bundles function as partial, limited render passes, so we can use the +// same code both to render the scene normally and to build the render bundle. +function renderScene( + passEncoder: GPURenderPassEncoder | GPURenderBundleEncoder +) { + passEncoder.setPipeline(pipeline); + passEncoder.setBindGroup(0, frameBindGroup); + + // Loop through every renderable object and draw them individually. + // (Because many of these meshes are repeated, with only the transforms + // differing, instancing would be highly effective here. This sample + // intentionally avoids using instancing in order to emulate a more complex + // scene, which helps demonstrate the potential time savings a render bundle + // can provide.) + let count = 0; + for (const renderable of renderables) { + passEncoder.setBindGroup(1, renderable.bindGroup); + passEncoder.setVertexBuffer(0, renderable.vertices); + passEncoder.setIndexBuffer(renderable.indices, 'uint16'); + passEncoder.drawIndexed(renderable.indexCount); + + if (++count > settings.asteroidCount) { + break; + } + } +} + +// The render bundle can be encoded once and re-used as many times as needed. +// Because it encodes all of the commands needed to render at the GPU level, +// those commands will not need to execute the associated JavaScript code upon +// execution or be re-validated, which can represent a significant time savings. +// +// However, because render bundles are immutable once created, they are only +// appropriate for rendering content where the same commands will be executed +// every time, with the only changes being the contents of the buffers and +// textures used. Cases where the executed commands differ from frame-to-frame, +// such as when using frustrum or occlusion culling, will not benefit from +// using render bundles as much. +let renderBundle; + +function updateRenderBundle() { + const renderBundleEncoder = device.createRenderBundleEncoder({ + colorFormats: [presentationFormat], + depthStencilFormat: 'depth24plus', + }); + renderScene(renderBundleEncoder); + renderBundle = renderBundleEncoder.finish(); +} + +updateRenderBundle(); + +const stats = new Stats(); +stats.showPanel(1); // 0: fps, 1: ms, 2: mb, 3+: custom +document.body.appendChild(stats.dom); + +function frame() { + stats.begin(); + + const transformationMatrix = getTransformationMatrix(); + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix.buffer, + transformationMatrix.byteOffset, + transformationMatrix.byteLength + ); + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + + if (settings.useRenderBundles) { + // Executing a bundle is equivalent to calling all of the commands encoded + // in the render bundle as part of the current render pass. + passEncoder.executeBundles([renderBundle]); + } else { + // Alternatively, the same render commands can be encoded manually, which + // can take longer since each command needs to be interpreted by the + // JavaScript virtual machine and re-validated each time. + renderScene(passEncoder); + } + + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + stats.end(); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/mesh.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/mesh.wgsl new file mode 100644 index 00000000..57abd59a --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/mesh.wgsl @@ -0,0 +1,45 @@ +struct Uniforms { + viewProjectionMatrix : mat4x4f +} +@group(0) @binding(0) var uniforms : Uniforms; + +@group(1) @binding(0) var modelMatrix : mat4x4f; + +struct VertexInput { + @location(0) position : vec4f, + @location(1) normal : vec3f, + @location(2) uv : vec2f +} + +struct VertexOutput { + @builtin(position) position : vec4f, + @location(0) normal: vec3f, + @location(1) uv : vec2f, +} + +@vertex +fn vertexMain(input: VertexInput) -> VertexOutput { + var output : VertexOutput; + output.position = uniforms.viewProjectionMatrix * modelMatrix * input.position; + output.normal = normalize((modelMatrix * vec4(input.normal, 0)).xyz); + output.uv = input.uv; + return output; +} + +@group(1) @binding(1) var meshSampler: sampler; +@group(1) @binding(2) var meshTexture: texture_2d; + +// Static directional lighting +const lightDir = vec3f(1, 1, 1); +const dirColor = vec3(1); +const ambientColor = vec3f(0.05); + +@fragment +fn fragmentMain(input: VertexOutput) -> @location(0) vec4f { + let textureColor = textureSample(meshTexture, meshSampler, input.uv); + + // Very simplified lighting algorithm. + let lightColor = saturate(ambientColor + max(dot(input.normal, lightDir), 0.0) * dirColor); + + return vec4f(textureColor.rgb * lightColor, textureColor.a); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/meta.ts new file mode 100644 index 00000000..ebcadad5 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/renderBundles/meta.ts @@ -0,0 +1,13 @@ +export default { + name: 'Render Bundles', + description: `This example shows how to use render bundles. It renders a large number of + meshes individually as a proxy for a more complex scene in order to demonstrate the reduction + in JavaScript time spent to issue render commands. (Typically a scene like this would make use + of instancing to reduce draw overhead.)`, + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'mesh.wgsl'}, + {path: '../../meshes/sphere.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/animatedCanvasSize.module.css b/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/animatedCanvasSize.module.css new file mode 100644 index 00000000..a636c764 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/animatedCanvasSize.module.css @@ -0,0 +1,21 @@ +@keyframes animated-size { + 0% { + width: 10px; + height: 600px; + } + 50% { + width: 100%; + height: 600px; + } + 100% { + width: 10px; + height: 600px; + } +} + +.animatedCanvasSize { + animation-duration: 3s; + animation-iteration-count: infinite; + animation-name: animated-size; + animation-timing-function: ease; +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/index.html b/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/index.html new file mode 100644 index 00000000..bceae859 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/index.html @@ -0,0 +1,27 @@ + + + + + + webgpu-samples: resizeCanvas + + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/main.ts new file mode 100644 index 00000000..3c586bfd --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/main.ts @@ -0,0 +1,113 @@ +import triangleVertWGSL from '../../shaders/triangle.vert.wgsl'; +import redFragWGSL from '../../shaders/red.frag.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const sampleCount = 4; + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: triangleVertWGSL, + }), + }, + fragment: { + module: device.createShaderModule({ + code: redFragWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, + multisample: { + count: 4, + }, +}); + +let renderTarget: GPUTexture | undefined = undefined; +let renderTargetView: GPUTextureView; + +function frame() { + const currentWidth = canvas.clientWidth * devicePixelRatio; + const currentHeight = canvas.clientHeight * devicePixelRatio; + + // The canvas size is animating via CSS. + // When the size changes, we need to reallocate the render target. + // We also need to set the physical size of the canvas to match the computed CSS size. + if ( + (currentWidth !== canvas.width || + currentHeight !== canvas.height || + !renderTargetView) && + currentWidth && + currentHeight + ) { + if (renderTarget !== undefined) { + // Destroy the previous render target + renderTarget.destroy(); + } + + // Setting the canvas width and height will automatically resize the textures returned + // when calling getCurrentTexture() on the context. + canvas.width = currentWidth; + canvas.height = currentHeight; + + // Resize the multisampled render target to match the new canvas size. + renderTarget = device.createTexture({ + size: [canvas.width, canvas.height], + sampleCount, + format: presentationFormat, + usage: GPUTextureUsage.RENDER_ATTACHMENT, + }); + + renderTargetView = renderTarget.createView(); + } + + if (renderTargetView) { + const commandEncoder = device.createCommandEncoder(); + + const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: renderTargetView, + resolveTarget: context.getCurrentTexture().createView(), + clearValue: {r: 0.2, g: 0.2, b: 0.2, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + }; + + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.draw(3); + passEncoder.end(); + + device.queue.submit([commandEncoder.finish()]); + } + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/meta.ts new file mode 100644 index 00000000..fcff46e8 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/resizeCanvas/meta.ts @@ -0,0 +1,12 @@ +export default { + name: 'Resize Canvas', + description: + 'Shows multisampled rendering a basic triangle on a dynamically sized canvas.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: '../../shaders/triangle.vert.wgsl'}, + {path: '../../shaders/red.frag.wgsl'}, + {path: 'animatedCanvasSize.module.css'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/checker.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/checker.wgsl new file mode 100644 index 00000000..1794fc6d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/checker.wgsl @@ -0,0 +1,25 @@ +struct Uniforms { + color0: vec4f, + color1: vec4f, + size: u32, +}; + +@group(0) @binding(0) var uni: Uniforms; + +@vertex +fn vs(@builtin(vertex_index) vertexIndex : u32) -> @builtin(position) vec4f { + const pos = array( + vec2f(-1.0, -1.0), + vec2f( 3.0, -1.0), + vec2f(-1.0, 3.0), + ); + return vec4f(pos[vertexIndex], 0.0, 1.0); +} + +@fragment +fn fs(@builtin(position) position: vec4f) -> @location(0) vec4f { + let grid = vec2u(position.xy) / uni.size; + let checker = (grid.x + grid.y) % 2 == 1; + return select(uni.color0, uni.color1, checker); +} + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/index.html b/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/index.html new file mode 100644 index 00000000..0de0a189 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/index.html @@ -0,0 +1,39 @@ + + + + + + webgpu-samples: resizeObserverHDDPI + + + + + +
+ +
+ + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/main.ts new file mode 100644 index 00000000..68964fbe --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/main.ts @@ -0,0 +1,164 @@ +import {GUI} from 'dat.gui'; +import checkerWGSL from './checker.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const module = device.createShaderModule({ + code: checkerWGSL, +}); +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: {module}, + fragment: { + module, + targets: [ + { + format: presentationFormat, + }, + ], + }, +}); + +// These offsets are in f32/u32 offset. +enum UniformOffset { + color0 = 0, + color1 = 4, + size = 8, +} + +const uniformValuesAsF32 = new Float32Array(12); // 2 vec4fs, 1 u32, 3 padding +const uniformValuesAsU32 = new Uint32Array(uniformValuesAsF32.buffer); +const uniformBuffer = device.createBuffer({ + size: uniformValuesAsF32.byteLength, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const bindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: {buffer: uniformBuffer}, + }, + ], +}); + +const settings = { + color0: '#FF0000', + color1: '#00FFFF', + size: 1, + resizable: false, + fullscreen() { + if (document.fullscreenElement) { + document.exitFullscreen(); + } else { + document.body.requestFullscreen(); + } + }, +}; + +const containerElem = document.querySelector('#container') as HTMLElement; + +const gui = new GUI(); +gui.addColor(settings, 'color0').onChange(frame); +gui.addColor(settings, 'color1').onChange(frame); +gui.add(settings, 'size', 1, 32, 1).name('checker size').onChange(frame); +gui.add(settings, 'fullscreen'); +gui.add(settings, 'resizable').onChange(() => { + const {resizable} = settings; + // Get these before we adjust the CSS because our canvas is sized in device pixels + // and so will expand if we stop constraining it with CSS + const width = containerElem.clientWidth; + const height = containerElem.clientHeight; + + containerElem.classList.toggle('resizable', resizable); + containerElem.classList.toggle('fit-container', !resizable); + + containerElem.style.width = resizable ? `${width}px` : ''; + containerElem.style.height = resizable ? `${height}px` : ''; +}); + +// Given a CSS color, returns the color in 0 to 1 RGBA values. +const cssColorToRGBA = (function () { + const ctx = new OffscreenCanvas(1, 1).getContext('2d', { + willReadFrequently: true, + }); + return function (color: string) { + ctx.clearRect(0, 0, 1, 1); + ctx.fillStyle = color; + ctx.fillRect(0, 0, 1, 1); + return [...ctx.getImageData(0, 0, 1, 1).data].map((v) => v / 255); + }; +})(); + +function frame() { + uniformValuesAsF32.set(cssColorToRGBA(settings.color0), UniformOffset.color0); + uniformValuesAsF32.set(cssColorToRGBA(settings.color1), UniformOffset.color1); + uniformValuesAsU32[UniformOffset.size] = settings.size; + + device.queue.writeBuffer(uniformBuffer, 0, uniformValuesAsF32); + + const commandEncoder = device.createCommandEncoder(); + + const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: context.getCurrentTexture().createView(), + clearValue: {r: 0.2, g: 0.2, b: 0.2, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + }; + + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.setBindGroup(0, bindGroup); + passEncoder.draw(3); + passEncoder.end(); + + device.queue.submit([commandEncoder.finish()]); +} + +function getDevicePixelContentBoxSize(entry: ResizeObserverEntry) { + // Safari does not support devicePixelContentBoxSize + if (entry.devicePixelContentBoxSize) { + return { + width: entry.devicePixelContentBoxSize[0].inlineSize, + height: entry.devicePixelContentBoxSize[0].blockSize, + }; + } else { + // These values not correct but they're as close as you can get in Safari + return { + width: entry.contentBoxSize[0].inlineSize * devicePixelRatio, + height: entry.contentBoxSize[0].blockSize * devicePixelRatio, + }; + } +} + +const {maxTextureDimension2D} = device.limits; +const observer = new ResizeObserver(([entry]) => { + // Note: If you are using requestAnimationFrame you should + // only record the size here but set it in the requestAnimationFrame callback + // otherwise you'll get flicker when resizing. + const {width, height} = getDevicePixelContentBoxSize(entry); + + // A size of 0 will cause an error when we call getCurrentTexture. + // A size > maxTextureDimension2D will also an error when we call getCurrentTexture. + canvas.width = Math.max(1, Math.min(width, maxTextureDimension2D)); + canvas.height = Math.max(1, Math.min(height, maxTextureDimension2D)); + frame(); +}); +observer.observe(canvas); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/meta.ts new file mode 100644 index 00000000..99b5c950 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/resizeObserverHDDPI/meta.ts @@ -0,0 +1,9 @@ +export default { + name: 'ResizeObserver HD-DPI Fullscreen', + description: `This example shows how to use ResizeObserver, handle HD-DPI correctly, and Fullscreen + +There should be no [Moiré patterns](https://www.google.com/search?q=Moir%C3%A9%20pattern) regardless of zoom level. +(except possibly in Safari)`, + filename: __DIRNAME__, + sources: [{path: 'main.ts'}, {path: 'checker.wgsl'}], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/fragment.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/fragment.wgsl new file mode 100644 index 00000000..2746f0c2 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/fragment.wgsl @@ -0,0 +1,6 @@ +@fragment +fn main( + @location(0) fragColor: vec4f +) -> @location(0) vec4f { + return fragColor; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/fragmentPrecisionErrorPass.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/fragmentPrecisionErrorPass.wgsl new file mode 100644 index 00000000..158130da --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/fragmentPrecisionErrorPass.wgsl @@ -0,0 +1,11 @@ +@group(1) @binding(0) var depthTexture: texture_depth_2d; + +@fragment +fn main( + @builtin(position) coord: vec4f, + @location(0) clipPos: vec4f +) -> @location(0) vec4f { + let depthValue = textureLoad(depthTexture, vec2i(floor(coord.xy)), 0); + let v : f32 = abs(clipPos.z / clipPos.w - depthValue) * 2000000.0; + return vec4f(v, v, v, 1.0); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/fragmentTextureQuad.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/fragmentTextureQuad.wgsl new file mode 100644 index 00000000..37f5f4dc --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/fragmentTextureQuad.wgsl @@ -0,0 +1,9 @@ +@group(0) @binding(0) var depthTexture: texture_depth_2d; + +@fragment +fn main( + @builtin(position) coord : vec4f +) -> @location(0) vec4f { + let depthValue = textureLoad(depthTexture, vec2i(floor(coord.xy)), 0); + return vec4f(depthValue, depthValue, depthValue, 1.0); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/index.html b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/index.html new file mode 100644 index 00000000..9a0bb921 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: samplerParameters + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/main.ts new file mode 100644 index 00000000..3de19079 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/main.ts @@ -0,0 +1,683 @@ +import {mat4, vec3} from 'wgpu-matrix'; +import {GUI} from 'dat.gui'; + +import vertexWGSL from './vertex.wgsl'; +import fragmentWGSL from './fragment.wgsl'; +import vertexDepthPrePassWGSL from './vertexDepthPrePass.wgsl'; +import vertexTextureQuadWGSL from './vertexTextureQuad.wgsl'; +import fragmentTextureQuadWGSL from './fragmentTextureQuad.wgsl'; +import vertexPrecisionErrorPassWGSL from './vertexPrecisionErrorPass.wgsl'; +import fragmentPrecisionErrorPassWGSL from './fragmentPrecisionErrorPass.wgsl'; + +// Two planes close to each other for depth precision test +const geometryVertexSize = 4 * 8; // Byte size of one geometry vertex. +const geometryPositionOffset = 0; +const geometryColorOffset = 4 * 4; // Byte offset of geometry vertex color attribute. +const geometryDrawCount = 6 * 2; + +const d = 0.0001; // half distance between two planes +const o = 0.5; // half x offset to shift planes so they are only partially overlaping + +// prettier-ignore +export const geometryVertexArray = new Float32Array([ + // float4 position, float4 color + -1 - o, -1, d, 1, 1, 0, 0, 1, + 1 - o, -1, d, 1, 1, 0, 0, 1, + -1 - o, 1, d, 1, 1, 0, 0, 1, + 1 - o, -1, d, 1, 1, 0, 0, 1, + 1 - o, 1, d, 1, 1, 0, 0, 1, + -1 - o, 1, d, 1, 1, 0, 0, 1, + + -1 + o, -1, -d, 1, 0, 1, 0, 1, + 1 + o, -1, -d, 1, 0, 1, 0, 1, + -1 + o, 1, -d, 1, 0, 1, 0, 1, + 1 + o, -1, -d, 1, 0, 1, 0, 1, + 1 + o, 1, -d, 1, 0, 1, 0, 1, + -1 + o, 1, -d, 1, 0, 1, 0, 1, +]); + +const xCount = 1; +const yCount = 5; +const numInstances = xCount * yCount; +const matrixFloatCount = 16; // 4x4 matrix +const matrixStride = 4 * matrixFloatCount; // 64; + +const depthRangeRemapMatrix = mat4.identity(); +depthRangeRemapMatrix[10] = -1; +depthRangeRemapMatrix[14] = 1; + +enum DepthBufferMode { + Default = 0, + Reversed, +} + +const depthBufferModes: DepthBufferMode[] = [ + DepthBufferMode.Default, + DepthBufferMode.Reversed, +]; +const depthCompareFuncs = { + [DepthBufferMode.Default]: 'less' as GPUCompareFunction, + [DepthBufferMode.Reversed]: 'greater' as GPUCompareFunction, +}; +const depthClearValues = { + [DepthBufferMode.Default]: 1.0, + [DepthBufferMode.Reversed]: 0.0, +}; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const verticesBuffer = device.createBuffer({ + size: geometryVertexArray.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +new Float32Array(verticesBuffer.getMappedRange()).set(geometryVertexArray); +verticesBuffer.unmap(); + +const depthBufferFormat = 'depth32float'; + +const depthTextureBindGroupLayout = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.FRAGMENT, + texture: { + sampleType: 'depth', + }, + }, + ], +}); + +// Model, view, projection matrices +const uniformBindGroupLayout = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX, + buffer: { + type: 'uniform', + }, + }, + { + binding: 1, + visibility: GPUShaderStage.VERTEX, + buffer: { + type: 'uniform', + }, + }, + ], +}); + +const depthPrePassRenderPipelineLayout = device.createPipelineLayout({ + bindGroupLayouts: [uniformBindGroupLayout], +}); + +// depthPrePass is used to render scene to the depth texture +// this is not needed if you just want to use reversed z to render a scene +const depthPrePassRenderPipelineDescriptorBase = { + layout: depthPrePassRenderPipelineLayout, + vertex: { + module: device.createShaderModule({ + code: vertexDepthPrePassWGSL, + }), + buffers: [ + { + arrayStride: geometryVertexSize, + attributes: [ + { + // position + shaderLocation: 0, + offset: geometryPositionOffset, + format: 'float32x4', + }, + ], + }, + ], + }, + primitive: { + topology: 'triangle-list', + cullMode: 'back', + }, + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: depthBufferFormat, + }, +} as GPURenderPipelineDescriptor; + +// we need the depthCompare to fit the depth buffer mode we are using. +// this is the same for other passes +const depthPrePassPipelines: GPURenderPipeline[] = []; +depthPrePassRenderPipelineDescriptorBase.depthStencil.depthCompare = + depthCompareFuncs[DepthBufferMode.Default]; +depthPrePassPipelines[DepthBufferMode.Default] = device.createRenderPipeline( + depthPrePassRenderPipelineDescriptorBase +); +depthPrePassRenderPipelineDescriptorBase.depthStencil.depthCompare = + depthCompareFuncs[DepthBufferMode.Reversed]; +depthPrePassPipelines[DepthBufferMode.Reversed] = device.createRenderPipeline( + depthPrePassRenderPipelineDescriptorBase +); + +// precisionPass is to draw precision error as color of depth value stored in depth buffer +// compared to that directly calcualated in the shader +const precisionPassRenderPipelineLayout = device.createPipelineLayout({ + bindGroupLayouts: [uniformBindGroupLayout, depthTextureBindGroupLayout], +}); +const precisionPassRenderPipelineDescriptorBase = { + layout: precisionPassRenderPipelineLayout, + vertex: { + module: device.createShaderModule({ + code: vertexPrecisionErrorPassWGSL, + }), + buffers: [ + { + arrayStride: geometryVertexSize, + attributes: [ + { + // position + shaderLocation: 0, + offset: geometryPositionOffset, + format: 'float32x4', + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + code: fragmentPrecisionErrorPassWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + cullMode: 'back', + }, + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: depthBufferFormat, + }, +} as GPURenderPipelineDescriptor; +const precisionPassPipelines: GPURenderPipeline[] = []; +precisionPassRenderPipelineDescriptorBase.depthStencil.depthCompare = + depthCompareFuncs[DepthBufferMode.Default]; +precisionPassPipelines[DepthBufferMode.Default] = device.createRenderPipeline( + precisionPassRenderPipelineDescriptorBase +); +precisionPassRenderPipelineDescriptorBase.depthStencil.depthCompare = + depthCompareFuncs[DepthBufferMode.Reversed]; +// prettier-ignore +precisionPassPipelines[DepthBufferMode.Reversed] = device.createRenderPipeline( + precisionPassRenderPipelineDescriptorBase +); + +// colorPass is the regular render pass to render the scene +const colorPassRenderPiplineLayout = device.createPipelineLayout({ + bindGroupLayouts: [uniformBindGroupLayout], +}); +const colorPassRenderPipelineDescriptorBase: GPURenderPipelineDescriptor = { + layout: colorPassRenderPiplineLayout, + vertex: { + module: device.createShaderModule({ + code: vertexWGSL, + }), + buffers: [ + { + arrayStride: geometryVertexSize, + attributes: [ + { + // position + shaderLocation: 0, + offset: geometryPositionOffset, + format: 'float32x4', + }, + { + // color + shaderLocation: 1, + offset: geometryColorOffset, + format: 'float32x4', + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + code: fragmentWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + cullMode: 'back', + }, + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: depthBufferFormat, + }, +}; +const colorPassPipelines: GPURenderPipeline[] = []; +colorPassRenderPipelineDescriptorBase.depthStencil.depthCompare = + depthCompareFuncs[DepthBufferMode.Default]; +colorPassPipelines[DepthBufferMode.Default] = device.createRenderPipeline( + colorPassRenderPipelineDescriptorBase +); +colorPassRenderPipelineDescriptorBase.depthStencil.depthCompare = + depthCompareFuncs[DepthBufferMode.Reversed]; +colorPassPipelines[DepthBufferMode.Reversed] = device.createRenderPipeline( + colorPassRenderPipelineDescriptorBase +); + +// textureQuadPass is draw a full screen quad of depth texture +// to see the difference of depth value using reversed z compared to default depth buffer usage +// 0.0 will be the furthest and 1.0 will be the closest +const textureQuadPassPiplineLayout = device.createPipelineLayout({ + bindGroupLayouts: [depthTextureBindGroupLayout], +}); +const textureQuadPassPipline = device.createRenderPipeline({ + layout: textureQuadPassPiplineLayout, + vertex: { + module: device.createShaderModule({ + code: vertexTextureQuadWGSL, + }), + }, + fragment: { + module: device.createShaderModule({ + code: fragmentTextureQuadWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, +}); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: depthBufferFormat, + usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING, +}); +const depthTextureView = depthTexture.createView(); + +const defaultDepthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: depthBufferFormat, + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); +const defaultDepthTextureView = defaultDepthTexture.createView(); + +const depthPrePassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [], + depthStencilAttachment: { + view: depthTextureView, + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +// drawPassDescriptor and drawPassLoadDescriptor are used for drawing +// the scene twice using different depth buffer mode on splitted viewport +// of the same canvas +// see the difference of the loadOp of the colorAttachments +const drawPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + // view is acquired and set in render loop. + view: undefined, + + clearValue: {r: 0.0, g: 0.0, b: 0.5, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: defaultDepthTextureView, + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; +const drawPassLoadDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + // attachment is acquired and set in render loop. + view: undefined, + + loadOp: 'load', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: defaultDepthTextureView, + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; +const drawPassDescriptors = [drawPassDescriptor, drawPassLoadDescriptor]; + +const textureQuadPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + // view is acquired and set in render loop. + view: undefined, + + clearValue: {r: 0.0, g: 0.0, b: 0.5, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], +}; +const textureQuadPassLoadDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + // view is acquired and set in render loop. + view: undefined, + + loadOp: 'load', + storeOp: 'store', + }, + ], +}; +const textureQuadPassDescriptors = [ + textureQuadPassDescriptor, + textureQuadPassLoadDescriptor, +]; + +const depthTextureBindGroup = device.createBindGroup({ + layout: depthTextureBindGroupLayout, + entries: [ + { + binding: 0, + resource: depthTextureView, + }, + ], +}); + +const uniformBufferSize = numInstances * matrixStride; + +const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); +const cameraMatrixBuffer = device.createBuffer({ + size: 4 * 16, // 4x4 matrix + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); +const cameraMatrixReversedDepthBuffer = device.createBuffer({ + size: 4 * 16, // 4x4 matrix + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const uniformBindGroups = [ + device.createBindGroup({ + layout: uniformBindGroupLayout, + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + { + binding: 1, + resource: { + buffer: cameraMatrixBuffer, + }, + }, + ], + }), + device.createBindGroup({ + layout: uniformBindGroupLayout, + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + { + binding: 1, + resource: { + buffer: cameraMatrixReversedDepthBuffer, + }, + }, + ], + }), +]; + +type Mat4 = mat4.default; +const modelMatrices = new Array(numInstances); +const mvpMatricesData = new Float32Array(matrixFloatCount * numInstances); + +let m = 0; +for (let x = 0; x < xCount; x++) { + for (let y = 0; y < yCount; y++) { + const z = -800 * m; + const s = 1 + 50 * m; + + modelMatrices[m] = mat4.translation( + vec3.fromValues( + x - xCount / 2 + 0.5, + (4.0 - 0.2 * z) * (y - yCount / 2 + 1.0), + z + ) + ); + mat4.scale(modelMatrices[m], vec3.fromValues(s, s, s), modelMatrices[m]); + + m++; + } +} + +const viewMatrix = mat4.translation(vec3.fromValues(0, 0, -12)); + +const aspect = (0.5 * canvas.width) / canvas.height; +// wgpu-matrix perspective doesn't handle zFar === Infinity now. +// https://github.com/greggman/wgpu-matrix/issues/9 +const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 5, 9999); + +const viewProjectionMatrix = mat4.multiply(projectionMatrix, viewMatrix); +// to use 1/z we just multiple depthRangeRemapMatrix to our default camera view projection matrix +const reversedRangeViewProjectionMatrix = mat4.multiply( + depthRangeRemapMatrix, + viewProjectionMatrix +); + +let bufferData = viewProjectionMatrix as Float32Array; +device.queue.writeBuffer( + cameraMatrixBuffer, + 0, + bufferData.buffer, + bufferData.byteOffset, + bufferData.byteLength +); +bufferData = reversedRangeViewProjectionMatrix as Float32Array; +device.queue.writeBuffer( + cameraMatrixReversedDepthBuffer, + 0, + bufferData.buffer, + bufferData.byteOffset, + bufferData.byteLength +); + +const tmpMat4 = mat4.create(); + +function updateTransformationMatrix() { + const now = Date.now() / 1000; + + for (let i = 0, m = 0; i < numInstances; i++, m += matrixFloatCount) { + mat4.rotate( + modelMatrices[i], + vec3.fromValues(Math.sin(now), Math.cos(now), 0), + (Math.PI / 180) * 30, + tmpMat4 + ); + mvpMatricesData.set(tmpMat4, m); + } +} + +const settings = { + mode: 'color', +}; +const gui = new GUI(); +gui.add(settings, 'mode', ['color', 'precision-error', 'depth-texture']); + +function frame() { + updateTransformationMatrix(); + device.queue.writeBuffer( + uniformBuffer, + 0, + mvpMatricesData.buffer, + mvpMatricesData.byteOffset, + mvpMatricesData.byteLength + ); + + const attachment = context.getCurrentTexture().createView(); + const commandEncoder = device.createCommandEncoder(); + if (settings.mode === 'color') { + for (const m of depthBufferModes) { + drawPassDescriptors[m].colorAttachments[0].view = attachment; + drawPassDescriptors[m].depthStencilAttachment.depthClearValue = + depthClearValues[m]; + const colorPass = commandEncoder.beginRenderPass(drawPassDescriptors[m]); + colorPass.setPipeline(colorPassPipelines[m]); + colorPass.setBindGroup(0, uniformBindGroups[m]); + colorPass.setVertexBuffer(0, verticesBuffer); + colorPass.setViewport( + (canvas.width * m) / 2, + 0, + canvas.width / 2, + canvas.height, + 0, + 1 + ); + colorPass.draw(geometryDrawCount, numInstances, 0, 0); + colorPass.end(); + } + } else if (settings.mode === 'precision-error') { + for (const m of depthBufferModes) { + { + depthPrePassDescriptor.depthStencilAttachment.depthClearValue = + depthClearValues[m]; + const depthPrePass = commandEncoder.beginRenderPass( + depthPrePassDescriptor + ); + depthPrePass.setPipeline(depthPrePassPipelines[m]); + depthPrePass.setBindGroup(0, uniformBindGroups[m]); + depthPrePass.setVertexBuffer(0, verticesBuffer); + depthPrePass.setViewport( + (canvas.width * m) / 2, + 0, + canvas.width / 2, + canvas.height, + 0, + 1 + ); + depthPrePass.draw(geometryDrawCount, numInstances, 0, 0); + depthPrePass.end(); + } + { + drawPassDescriptors[m].colorAttachments[0].view = attachment; + drawPassDescriptors[m].depthStencilAttachment.depthClearValue = + depthClearValues[m]; + const precisionErrorPass = commandEncoder.beginRenderPass( + drawPassDescriptors[m] + ); + precisionErrorPass.setPipeline(precisionPassPipelines[m]); + precisionErrorPass.setBindGroup(0, uniformBindGroups[m]); + precisionErrorPass.setBindGroup(1, depthTextureBindGroup); + precisionErrorPass.setVertexBuffer(0, verticesBuffer); + precisionErrorPass.setViewport( + (canvas.width * m) / 2, + 0, + canvas.width / 2, + canvas.height, + 0, + 1 + ); + precisionErrorPass.draw(geometryDrawCount, numInstances, 0, 0); + precisionErrorPass.end(); + } + } + } else { + // depth texture quad + for (const m of depthBufferModes) { + { + depthPrePassDescriptor.depthStencilAttachment.depthClearValue = + depthClearValues[m]; + const depthPrePass = commandEncoder.beginRenderPass( + depthPrePassDescriptor + ); + depthPrePass.setPipeline(depthPrePassPipelines[m]); + depthPrePass.setBindGroup(0, uniformBindGroups[m]); + depthPrePass.setVertexBuffer(0, verticesBuffer); + depthPrePass.setViewport( + (canvas.width * m) / 2, + 0, + canvas.width / 2, + canvas.height, + 0, + 1 + ); + depthPrePass.draw(geometryDrawCount, numInstances, 0, 0); + depthPrePass.end(); + } + { + textureQuadPassDescriptors[m].colorAttachments[0].view = attachment; + const depthTextureQuadPass = commandEncoder.beginRenderPass( + textureQuadPassDescriptors[m] + ); + depthTextureQuadPass.setPipeline(textureQuadPassPipline); + depthTextureQuadPass.setBindGroup(0, depthTextureBindGroup); + depthTextureQuadPass.setViewport( + (canvas.width * m) / 2, + 0, + canvas.width / 2, + canvas.height, + 0, + 1 + ); + depthTextureQuadPass.draw(6); + depthTextureQuadPass.end(); + } + } + } + device.queue.submit([commandEncoder.finish()]); + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/meta.ts new file mode 100644 index 00000000..298a5bbe --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/meta.ts @@ -0,0 +1,26 @@ +export default { + name: 'Reversed Z', + description: `This example shows the use of reversed z technique for better utilization of depth buffer precision. +The left column uses regular method, while the right one uses reversed z technique. +Both are using depth32float as their depth buffer format. A set of red and green planes are positioned very close to each other. +Higher sets are placed further from camera (and are scaled for better visual purpose). +To use reversed z to render your scene, you will need depth store value to be 0.0, depth compare function to be greater, +and remap depth range by multiplying an additional matrix to your projection matrix. + +Related reading: + - https://developer.nvidia.com/content/depth-precision-visualized + - https://web.archive.org/web/20220724174000/ + - https://thxforthefish.com/posts/reverse_z/ + `, + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'vertex.wgsl'}, + {path: 'fragment.wgsl'}, + {path: 'vertexDepthPrePass.wgsl'}, + {path: 'vertexTextureQuad.wgsl'}, + {path: 'fragmentTextureQuad.wgsl'}, + {path: 'vertexPrecisionErrorPass.wgsl'}, + {path: 'fragmentPrecisionErrorPass.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertex.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertex.wgsl new file mode 100644 index 00000000..9613a5a5 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertex.wgsl @@ -0,0 +1,26 @@ +struct Uniforms { + modelMatrix : array, +} +struct Camera { + viewProjectionMatrix : mat4x4f, +} + +@binding(0) @group(0) var uniforms : Uniforms; +@binding(1) @group(0) var camera : Camera; + +struct VertexOutput { + @builtin(position) Position : vec4f, + @location(0) fragColor : vec4f, +} + +@vertex +fn main( + @builtin(instance_index) instanceIdx : u32, + @location(0) position : vec4f, + @location(1) color : vec4f +) -> VertexOutput { + var output : VertexOutput; + output.Position = camera.viewProjectionMatrix * uniforms.modelMatrix[instanceIdx] * position; + output.fragColor = color; + return output; +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertexDepthPrePass.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertexDepthPrePass.wgsl new file mode 100644 index 00000000..dc40cbc2 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertexDepthPrePass.wgsl @@ -0,0 +1,17 @@ +struct Uniforms { + modelMatrix : array, +} +struct Camera { + viewProjectionMatrix : mat4x4f, +} + +@binding(0) @group(0) var uniforms : Uniforms; +@binding(1) @group(0) var camera : Camera; + +@vertex +fn main( + @builtin(instance_index) instanceIdx : u32, + @location(0) position : vec4f +) -> @builtin(position) vec4f { + return camera.viewProjectionMatrix * uniforms.modelMatrix[instanceIdx] * position; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertexPrecisionErrorPass.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertexPrecisionErrorPass.wgsl new file mode 100644 index 00000000..19cad8bd --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertexPrecisionErrorPass.wgsl @@ -0,0 +1,25 @@ +struct Uniforms { + modelMatrix : array, +} +struct Camera { + viewProjectionMatrix : mat4x4f, +} + +@binding(0) @group(0) var uniforms : Uniforms; +@binding(1) @group(0) var camera : Camera; + +struct VertexOutput { + @builtin(position) Position : vec4f, + @location(0) clipPos : vec4f, +} + +@vertex +fn main( + @builtin(instance_index) instanceIdx : u32, + @location(0) position : vec4f +) -> VertexOutput { + var output : VertexOutput; + output.Position = camera.viewProjectionMatrix * uniforms.modelMatrix[instanceIdx] * position; + output.clipPos = output.Position; + return output; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertexTextureQuad.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertexTextureQuad.wgsl new file mode 100644 index 00000000..a8f03007 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/reversedZ/vertexTextureQuad.wgsl @@ -0,0 +1,11 @@ +@vertex +fn main( + @builtin(vertex_index) VertexIndex : u32 +) -> @builtin(position) vec4f { + const pos = array( + vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0), + vec2(-1.0, 1.0), vec2(1.0, -1.0), vec2(1.0, 1.0), + ); + + return vec4(pos[VertexIndex], 0.0, 1.0); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/rotatingCube/index.html b/bindings/wgpu/webgpu-samples-ts/sample/rotatingCube/index.html new file mode 100644 index 00000000..1928ce8d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/rotatingCube/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: a-buffer + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/rotatingCube/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/rotatingCube/main.ts new file mode 100644 index 00000000..737a8e9e --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/rotatingCube/main.ts @@ -0,0 +1,8 @@ +import {io} from "../../out/kotlin-libs/wgpu-webgpu-samples-ts"; +import RotatingCubeScene = io.ygdrasil.wgpu.examples.scenes.basic.RotatingCubeScene; +import jsApplication = io.ygdrasil.wgpu.examples.jsApplication; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const application = await jsApplication(canvas) +application.changeScene(new RotatingCubeScene()) +application.run() diff --git a/bindings/wgpu/webgpu-samples-ts/sample/rotatingCube/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/rotatingCube/meta.ts new file mode 100644 index 00000000..e45fb797 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/rotatingCube/meta.ts @@ -0,0 +1,12 @@ +export default { + name: 'Rotating Cube', + description: + 'This example shows how to upload uniform data every frame to render a rotating object.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: '../../shaders/basic.vert.wgsl'}, + {path: '../../shaders/vertexPositionColor.frag.wgsl'}, + {path: '../../meshes/cube.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/index.html b/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/index.html new file mode 100644 index 00000000..1928ce8d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: a-buffer + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/main.ts new file mode 100644 index 00000000..1cf3cf43 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/main.ts @@ -0,0 +1,355 @@ +import {mat4} from 'wgpu-matrix'; +import {GUI} from 'dat.gui'; + +import texturedSquareWGSL from './texturedSquare.wgsl'; +import showTextureWGSL from './showTexture.wgsl'; + +const kMatrices: Readonly = new Float32Array([ + // Row 1: Scale by 2 + ...mat4.scale(mat4.rotationZ(Math.PI / 16), [2, 2, 1]), + ...mat4.scale(mat4.identity(), [2, 2, 1]), + ...mat4.scale(mat4.rotationX(-Math.PI * 0.3), [2, 2, 1]), + ...mat4.scale(mat4.rotationX(-Math.PI * 0.42), [2, 2, 1]), + // Row 2: Scale by 1 + ...mat4.rotationZ(Math.PI / 16), + ...mat4.identity(), + ...mat4.rotationX(-Math.PI * 0.3), + ...mat4.rotationX(-Math.PI * 0.42), + // Row 3: Scale by 0.9 + ...mat4.scale(mat4.rotationZ(Math.PI / 16), [0.9, 0.9, 1]), + ...mat4.scale(mat4.identity(), [0.9, 0.9, 1]), + ...mat4.scale(mat4.rotationX(-Math.PI * 0.3), [0.9, 0.9, 1]), + ...mat4.scale(mat4.rotationX(-Math.PI * 0.42), [0.9, 0.9, 1]), + // Row 4: Scale by 0.3 + ...mat4.scale(mat4.rotationZ(Math.PI / 16), [0.3, 0.3, 1]), + ...mat4.scale(mat4.identity(), [0.3, 0.3, 1]), + ...mat4.scale(mat4.rotationX(-Math.PI * 0.3), [0.3, 0.3, 1]), +]); + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +// +// GUI controls +// + +const kInitConfig = { + flangeLogSize: 1.0, + highlightFlange: false, + animation: 0.1, +} as const; +const config = {...kInitConfig}; +const updateConfigBuffer = () => { + const t = (performance.now() / 1000) * 0.5; + const data = new Float32Array([ + Math.cos(t) * config.animation, + Math.sin(t) * config.animation, + (2 ** config.flangeLogSize - 1) / 2, + Number(config.highlightFlange), + ]); + device.queue.writeBuffer(bufConfig, 64, data); +}; + +const kInitSamplerDescriptor = { + addressModeU: 'clamp-to-edge', + addressModeV: 'clamp-to-edge', + magFilter: 'linear', + minFilter: 'linear', + mipmapFilter: 'linear', + lodMinClamp: 0, + lodMaxClamp: 4, + maxAnisotropy: 1, +} as const; +const samplerDescriptor: GPUSamplerDescriptor = {...kInitSamplerDescriptor}; + +const gui = new GUI(); +{ + const buttons = { + initial() { + Object.assign(config, kInitConfig); + Object.assign(samplerDescriptor, kInitSamplerDescriptor); + gui.updateDisplay(); + }, + checkerboard() { + Object.assign(config, {flangeLogSize: 10}); + Object.assign(samplerDescriptor, { + addressModeU: 'repeat', + addressModeV: 'repeat', + }); + gui.updateDisplay(); + }, + smooth() { + Object.assign(samplerDescriptor, { + magFilter: 'linear', + minFilter: 'linear', + mipmapFilter: 'linear', + }); + gui.updateDisplay(); + }, + crunchy() { + Object.assign(samplerDescriptor, { + magFilter: 'nearest', + minFilter: 'nearest', + mipmapFilter: 'nearest', + }); + gui.updateDisplay(); + }, + }; + const presets = gui.addFolder('Presets'); + presets.open(); + presets.add(buttons, 'initial').name('reset to initial'); + presets.add(buttons, 'checkerboard').name('checkered floor'); + presets.add(buttons, 'smooth').name('smooth (linear)'); + presets.add(buttons, 'crunchy').name('crunchy (nearest)'); + + const flangeFold = gui.addFolder('Plane settings'); + flangeFold.open(); + flangeFold.add(config, 'flangeLogSize', 0, 10.0, 0.1).name('size = 2**'); + flangeFold.add(config, 'highlightFlange'); + flangeFold.add(config, 'animation', 0, 0.5); + + gui.width = 280; + { + const folder = gui.addFolder('GPUSamplerDescriptor'); + folder.open(); + + const kAddressModes = ['clamp-to-edge', 'repeat', 'mirror-repeat']; + folder.add(samplerDescriptor, 'addressModeU', kAddressModes); + folder.add(samplerDescriptor, 'addressModeV', kAddressModes); + + const kFilterModes = ['nearest', 'linear']; + folder.add(samplerDescriptor, 'magFilter', kFilterModes); + folder.add(samplerDescriptor, 'minFilter', kFilterModes); + const kMipmapFilterModes = ['nearest', 'linear'] as const; + folder.add(samplerDescriptor, 'mipmapFilter', kMipmapFilterModes); + + const ctlMin = folder.add(samplerDescriptor, 'lodMinClamp', 0, 4, 0.1); + const ctlMax = folder.add(samplerDescriptor, 'lodMaxClamp', 0, 4, 0.1); + ctlMin.onChange((value: number) => { + if (samplerDescriptor.lodMaxClamp < value) ctlMax.setValue(value); + }); + ctlMax.onChange((value: number) => { + if (samplerDescriptor.lodMinClamp > value) ctlMin.setValue(value); + }); + + { + const folder2 = folder.addFolder( + 'maxAnisotropy (set only if all "linear")' + ); + folder2.open(); + const kMaxAnisotropy = 16; + folder2.add(samplerDescriptor, 'maxAnisotropy', 1, kMaxAnisotropy, 1); + } + } +} + +// +// Canvas setup +// + +// Low-res, pixelated render target so it's easier to see fine details. +const kCanvasSize = 200; +const kViewportGridSize = 4; +const kViewportGridStride = Math.floor(kCanvasSize / kViewportGridSize); +const kViewportSize = kViewportGridStride - 2; + +// The canvas buffer size is 200x200. +// Compute a canvas CSS size such that there's an integer number of device +// pixels per canvas pixel ("integer" or "pixel-perfect" scaling). +// Note the result may be 1 pixel off since ResizeObserver is not used. +const kCanvasLayoutCSSSize = 600; // set by template styles +const kCanvasLayoutDevicePixels = kCanvasLayoutCSSSize * devicePixelRatio; +const kScaleFactor = Math.floor(kCanvasLayoutDevicePixels / kCanvasSize); +const kCanvasDevicePixels = kScaleFactor * kCanvasSize; +const kCanvasCSSSize = kCanvasDevicePixels / devicePixelRatio; +canvas.style.imageRendering = 'pixelated'; +canvas.width = canvas.height = kCanvasSize; +canvas.style.minWidth = canvas.style.maxWidth = kCanvasCSSSize + 'px'; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +// +// Initialize test texture +// + +// Set up a texture with 4 mip levels, each containing a differently-colored +// checkerboard with 1x1 pixels (so when rendered the checkerboards are +// different sizes). This is different from a normal mipmap where each level +// would look like a lower-resolution version of the previous one. +// Level 0 is 16x16 white/black +// Level 1 is 8x8 blue/black +// Level 2 is 4x4 yellow/black +// Level 3 is 2x2 pink/black +const kTextureMipLevels = 4; +const kTextureBaseSize = 16; +const checkerboard = device.createTexture({ + format: 'rgba8unorm', + usage: GPUTextureUsage.COPY_DST | GPUTextureUsage.TEXTURE_BINDING, + size: [kTextureBaseSize, kTextureBaseSize], + mipLevelCount: 4, +}); +const checkerboardView = checkerboard.createView(); + +const kColorForLevel = [ + [255, 255, 255, 255], + [30, 136, 229, 255], // blue + [255, 193, 7, 255], // yellow + [216, 27, 96, 255], // pink +]; +for (let mipLevel = 0; mipLevel < kTextureMipLevels; ++mipLevel) { + const size = 2 ** (kTextureMipLevels - mipLevel); // 16, 8, 4, 2 + const data = new Uint8Array(size * size * 4); + for (let y = 0; y < size; ++y) { + for (let x = 0; x < size; ++x) { + data.set( + (x + y) % 2 ? kColorForLevel[mipLevel] : [0, 0, 0, 255], + (y * size + x) * 4 + ); + } + } + device.queue.writeTexture( + {texture: checkerboard, mipLevel}, + data, + {bytesPerRow: size * 4}, + [size, size] + ); +} + +// +// "Debug" view of the actual texture contents +// + +const showTextureModule = device.createShaderModule({ + code: showTextureWGSL, +}); +const showTexturePipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: {module: showTextureModule}, + fragment: { + module: showTextureModule, + targets: [{format: presentationFormat}], + }, + primitive: {topology: 'triangle-list'}, +}); + +const showTextureBG = device.createBindGroup({ + layout: showTexturePipeline.getBindGroupLayout(0), + entries: [{binding: 0, resource: checkerboardView}], +}); + +// +// Pipeline for drawing the test squares +// + +const texturedSquareModule = device.createShaderModule({ + code: texturedSquareWGSL, +}); + +const texturedSquarePipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: texturedSquareModule, + constants: {kTextureBaseSize, kViewportSize}, + }, + fragment: { + module: texturedSquareModule, + targets: [{format: presentationFormat}], + }, + primitive: {topology: 'triangle-list'}, +}); +const texturedSquareBGL = texturedSquarePipeline.getBindGroupLayout(0); + +const bufConfig = device.createBuffer({ + usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.UNIFORM, + size: 128, +}); +// View-projection matrix set up so it doesn't transform anything at z=0. +const kCameraDist = 3; +const viewProj = mat4.translate( + mat4.perspective(2 * Math.atan(1 / kCameraDist), 1, 0.1, 100), + [0, 0, -kCameraDist] +); +device.queue.writeBuffer(bufConfig, 0, viewProj as Float32Array); + +const bufMatrices = device.createBuffer({ + usage: GPUBufferUsage.STORAGE, + size: kMatrices.byteLength, + mappedAtCreation: true, +}); +new Float32Array(bufMatrices.getMappedRange()).set(kMatrices); +bufMatrices.unmap(); + +function frame() { + updateConfigBuffer(); + + const sampler = device.createSampler({ + ...samplerDescriptor, + maxAnisotropy: + samplerDescriptor.minFilter === 'linear' && + samplerDescriptor.magFilter === 'linear' && + samplerDescriptor.mipmapFilter === 'linear' + ? samplerDescriptor.maxAnisotropy + : 1, + }); + + const bindGroup = device.createBindGroup({ + layout: texturedSquareBGL, + entries: [ + {binding: 0, resource: {buffer: bufConfig}}, + {binding: 1, resource: {buffer: bufMatrices}}, + {binding: 2, resource: sampler}, + {binding: 3, resource: checkerboardView}, + ], + }); + + const textureView = context.getCurrentTexture().createView(); + + const commandEncoder = device.createCommandEncoder(); + + const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: textureView, + clearValue: {r: 0.2, g: 0.2, b: 0.2, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + }; + + const pass = commandEncoder.beginRenderPass(renderPassDescriptor); + // Draw test squares + pass.setPipeline(texturedSquarePipeline); + pass.setBindGroup(0, bindGroup); + for (let i = 0; i < kViewportGridSize ** 2 - 1; ++i) { + const vpX = kViewportGridStride * (i % kViewportGridSize) + 1; + const vpY = kViewportGridStride * Math.floor(i / kViewportGridSize) + 1; + pass.setViewport(vpX, vpY, kViewportSize, kViewportSize, 0, 1); + pass.draw(6, 1, 0, i); + } + // Show texture contents + pass.setPipeline(showTexturePipeline); + pass.setBindGroup(0, showTextureBG); + const kLastViewport = (kViewportGridSize - 1) * kViewportGridStride + 1; + pass.setViewport(kLastViewport, kLastViewport, 32, 32, 0, 1); + pass.draw(6, 1, 0, 0); + pass.setViewport(kLastViewport + 32, kLastViewport, 16, 16, 0, 1); + pass.draw(6, 1, 0, 1); + pass.setViewport(kLastViewport + 32, kLastViewport + 16, 8, 8, 0, 1); + pass.draw(6, 1, 0, 2); + pass.setViewport(kLastViewport + 32, kLastViewport + 24, 4, 4, 0, 1); + pass.draw(6, 1, 0, 3); + pass.end(); + + device.queue.submit([commandEncoder.finish()]); + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/meta.ts new file mode 100644 index 00000000..5eebb98e --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/meta.ts @@ -0,0 +1,11 @@ +export default { + name: 'Sampler Parameters', + description: + 'Visualizes what all the sampler parameters do. Shows a textured plane at various scales (rotated, head-on, in perspective, and in vanishing perspective). The bottom-right view shows the raw contents of the 4 mipmap levels of the test texture (16x16, 8x8, 4x4, and 2x2).', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: './texturedSquare.wgsl'}, + {path: './showTexture.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/showTexture.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/showTexture.wgsl new file mode 100644 index 00000000..a6bc7823 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/showTexture.wgsl @@ -0,0 +1,33 @@ +@group(0) @binding(0) var tex: texture_2d; + +struct Varying { + @builtin(position) pos: vec4f, + @location(0) texelCoord: vec2f, + @location(1) mipLevel: f32, +} + +const kMipLevels = 4; +const baseMipSize: u32 = 16; + +@vertex +fn vmain( + @builtin(instance_index) instance_index: u32, // used as mipLevel + @builtin(vertex_index) vertex_index: u32, +) -> Varying { + var square = array( + vec2f(0, 0), vec2f(0, 1), vec2f(1, 0), + vec2f(1, 0), vec2f(0, 1), vec2f(1, 1), + ); + let uv = square[vertex_index]; + let pos = vec4(uv * 2 - vec2(1, 1), 0.0, 1.0); + + let mipLevel = instance_index; + let mipSize = f32(1 << (kMipLevels - mipLevel)); + let texelCoord = uv * mipSize; + return Varying(pos, texelCoord, f32(mipLevel)); +} + +@fragment +fn fmain(vary: Varying) -> @location(0) vec4f { + return textureLoad(tex, vec2u(vary.texelCoord), u32(vary.mipLevel)); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/texturedSquare.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/texturedSquare.wgsl new file mode 100644 index 00000000..6babfe80 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/samplerParameters/texturedSquare.wgsl @@ -0,0 +1,54 @@ +struct Config { + viewProj: mat4x4f, + animationOffset: vec2f, + flangeSize: f32, + highlightFlange: f32, +}; +@group(0) @binding(0) var config: Config; +@group(0) @binding(1) var matrices: array; +@group(0) @binding(2) var samp: sampler; +@group(0) @binding(3) var tex: texture_2d; + +struct Varying { + @builtin(position) pos: vec4f, + @location(0) uv: vec2f, +} + +override kTextureBaseSize: f32; +override kViewportSize: f32; + +@vertex +fn vmain( + @builtin(instance_index) instance_index: u32, + @builtin(vertex_index) vertex_index: u32, +) -> Varying { + let flange = config.flangeSize; + var uvs = array( + vec2(-flange, -flange), vec2(-flange, 1 + flange), vec2(1 + flange, -flange), + vec2(1 + flange, -flange), vec2(-flange, 1 + flange), vec2(1 + flange, 1 + flange), + ); + // Default size (if matrix is the identity) makes 1 texel = 1 pixel. + let radius = (1 + 2 * flange) * kTextureBaseSize / kViewportSize; + var positions = array( + vec2(-radius, -radius), vec2(-radius, radius), vec2(radius, -radius), + vec2(radius, -radius), vec2(-radius, radius), vec2(radius, radius), + ); + + let modelMatrix = matrices[instance_index]; + let pos = config.viewProj * modelMatrix * vec4f(positions[vertex_index] + config.animationOffset, 0, 1); + return Varying(pos, uvs[vertex_index]); +} + +@fragment +fn fmain(vary: Varying) -> @location(0) vec4f { + let uv = vary.uv; + var color = textureSample(tex, samp, uv); + + let outOfBounds = uv.x < 0 || uv.x > 1 || uv.y < 0 || uv.y > 1; + if config.highlightFlange > 0 && outOfBounds { + color += vec4(0.7, 0, 0, 0); + } + + return color; +} + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/fragment.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/fragment.wgsl new file mode 100644 index 00000000..11e46a0d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/fragment.wgsl @@ -0,0 +1,44 @@ +override shadowDepthTextureSize: f32 = 1024.0; + +struct Scene { + lightViewProjMatrix : mat4x4f, + cameraViewProjMatrix : mat4x4f, + lightPos : vec3f, +} + +@group(0) @binding(0) var scene : Scene; +@group(0) @binding(1) var shadowMap: texture_depth_2d; +@group(0) @binding(2) var shadowSampler: sampler_comparison; + +struct FragmentInput { + @location(0) shadowPos : vec3f, + @location(1) fragPos : vec3f, + @location(2) fragNorm : vec3f, +} + +const albedo = vec3f(0.9); +const ambientFactor = 0.2; + +@fragment +fn main(input : FragmentInput) -> @location(0) vec4f { + // Percentage-closer filtering. Sample texels in the region + // to smooth the result. + var visibility = 0.0; + let oneOverShadowDepthTextureSize = 1.0 / shadowDepthTextureSize; + for (var y = -1; y <= 1; y++) { + for (var x = -1; x <= 1; x++) { + let offset = vec2f(vec2(x, y)) * oneOverShadowDepthTextureSize; + + visibility += textureSampleCompare( + shadowMap, shadowSampler, + input.shadowPos.xy + offset, input.shadowPos.z - 0.007 + ); + } + } + visibility /= 9.0; + + let lambertFactor = max(dot(normalize(scene.lightPos - input.fragPos), normalize(input.fragNorm)), 0.0); + let lightingFactor = min(ambientFactor + visibility * lambertFactor, 1.0); + + return vec4(lightingFactor * albedo, 1.0); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/index.html b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/index.html new file mode 100644 index 00000000..04085b1b --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: shadowMapping + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/main.ts new file mode 100644 index 00000000..fef9f1cc --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/main.ts @@ -0,0 +1,409 @@ +import {mat4, vec3} from 'wgpu-matrix'; +import {mesh} from '../../meshes/stanfordDragon'; + +import vertexShadowWGSL from './vertexShadow.wgsl'; +import vertexWGSL from './vertex.wgsl'; +import fragmentWGSL from './fragment.wgsl'; + +const shadowDepthTextureSize = 1024; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const aspect = canvas.width / canvas.height; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +// Create the model vertex buffer. +const vertexBuffer = device.createBuffer({ + size: mesh.positions.length * 3 * 2 * Float32Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +{ + const mapping = new Float32Array(vertexBuffer.getMappedRange()); + for (let i = 0; i < mesh.positions.length; ++i) { + mapping.set(mesh.positions[i], 6 * i); + mapping.set(mesh.normals[i], 6 * i + 3); + } + vertexBuffer.unmap(); +} + +// Create the model index buffer. +const indexCount = mesh.triangles.length * 3; +const indexBuffer = device.createBuffer({ + size: indexCount * Uint16Array.BYTES_PER_ELEMENT, + usage: GPUBufferUsage.INDEX, + mappedAtCreation: true, +}); +{ + const mapping = new Uint16Array(indexBuffer.getMappedRange()); + for (let i = 0; i < mesh.triangles.length; ++i) { + mapping.set(mesh.triangles[i], 3 * i); + } + indexBuffer.unmap(); +} + +// Create the depth texture for rendering/sampling the shadow map. +const shadowDepthTexture = device.createTexture({ + size: [shadowDepthTextureSize, shadowDepthTextureSize, 1], + usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING, + format: 'depth32float', +}); +const shadowDepthTextureView = shadowDepthTexture.createView(); + +// Create some common descriptors used for both the shadow pipeline +// and the color rendering pipeline. +const vertexBuffers: Iterable = [ + { + arrayStride: Float32Array.BYTES_PER_ELEMENT * 6, + attributes: [ + { + // position + shaderLocation: 0, + offset: 0, + format: 'float32x3', + }, + { + // normal + shaderLocation: 1, + offset: Float32Array.BYTES_PER_ELEMENT * 3, + format: 'float32x3', + }, + ], + }, +]; + +const primitive: GPUPrimitiveState = { + topology: 'triangle-list', + cullMode: 'back', +}; + +const uniformBufferBindGroupLayout = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX, + buffer: { + type: 'uniform', + }, + }, + ], +}); + +const shadowPipeline = device.createRenderPipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [ + uniformBufferBindGroupLayout, + uniformBufferBindGroupLayout, + ], + }), + vertex: { + module: device.createShaderModule({ + code: vertexShadowWGSL, + }), + buffers: vertexBuffers, + }, + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth32float', + }, + primitive, +}); + +// Create a bind group layout which holds the scene uniforms and +// the texture+sampler for depth. We create it manually because the WebPU +// implementation doesn't infer this from the shader (yet). +const bglForRender = device.createBindGroupLayout({ + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, + buffer: { + type: 'uniform', + }, + }, + { + binding: 1, + visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, + texture: { + sampleType: 'depth', + }, + }, + { + binding: 2, + visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, + sampler: { + type: 'comparison', + }, + }, + ], +}); + +const pipeline = device.createRenderPipeline({ + layout: device.createPipelineLayout({ + bindGroupLayouts: [bglForRender, uniformBufferBindGroupLayout], + }), + vertex: { + module: device.createShaderModule({ + code: vertexWGSL, + }), + buffers: vertexBuffers, + }, + fragment: { + module: device.createShaderModule({ + code: fragmentWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + constants: { + shadowDepthTextureSize, + }, + }, + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus-stencil8', + }, + primitive, +}); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus-stencil8', + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + // view is acquired and set in render loop. + view: undefined, + + clearValue: {r: 0.5, g: 0.5, b: 0.5, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + stencilClearValue: 0, + stencilLoadOp: 'clear', + stencilStoreOp: 'store', + }, +}; + +const modelUniformBuffer = device.createBuffer({ + size: 4 * 16, // 4x4 matrix + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const sceneUniformBuffer = device.createBuffer({ + // Two 4x4 viewProj matrices, + // one for the camera and one for the light. + // Then a vec3 for the light position. + // Rounded to the nearest multiple of 16. + size: 2 * 4 * 16 + 4 * 4, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const sceneBindGroupForShadow = device.createBindGroup({ + layout: uniformBufferBindGroupLayout, + entries: [ + { + binding: 0, + resource: { + buffer: sceneUniformBuffer, + }, + }, + ], +}); + +const sceneBindGroupForRender = device.createBindGroup({ + layout: bglForRender, + entries: [ + { + binding: 0, + resource: { + buffer: sceneUniformBuffer, + }, + }, + { + binding: 1, + resource: shadowDepthTextureView, + }, + { + binding: 2, + resource: device.createSampler({ + compare: 'less', + }), + }, + ], +}); + +const modelBindGroup = device.createBindGroup({ + layout: uniformBufferBindGroupLayout, + entries: [ + { + binding: 0, + resource: { + buffer: modelUniformBuffer, + }, + }, + ], +}); + +const eyePosition = vec3.fromValues(0, 50, -100); +const upVector = vec3.fromValues(0, 1, 0); +const origin = vec3.fromValues(0, 0, 0); + +const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 2000.0); + +const viewMatrix = mat4.lookAt(eyePosition, origin, upVector); + +const lightPosition = vec3.fromValues(50, 100, -100); +const lightViewMatrix = mat4.lookAt(lightPosition, origin, upVector); +const lightProjectionMatrix = mat4.create(); +{ + const left = -80; + const right = 80; + const bottom = -80; + const top = 80; + const near = -200; + const far = 300; + mat4.ortho(left, right, bottom, top, near, far, lightProjectionMatrix); +} + +const lightViewProjMatrix = mat4.multiply( + lightProjectionMatrix, + lightViewMatrix +); + +const viewProjMatrix = mat4.multiply(projectionMatrix, viewMatrix); + +// Move the model so it's centered. +const modelMatrix = mat4.translation([0, -45, 0]); + +// The camera/light aren't moving, so write them into buffers now. +{ + const lightMatrixData = lightViewProjMatrix as Float32Array; + device.queue.writeBuffer( + sceneUniformBuffer, + 0, + lightMatrixData.buffer, + lightMatrixData.byteOffset, + lightMatrixData.byteLength + ); + + const cameraMatrixData = viewProjMatrix as Float32Array; + device.queue.writeBuffer( + sceneUniformBuffer, + 64, + cameraMatrixData.buffer, + cameraMatrixData.byteOffset, + cameraMatrixData.byteLength + ); + + const lightData = lightPosition as Float32Array; + device.queue.writeBuffer( + sceneUniformBuffer, + 128, + lightData.buffer, + lightData.byteOffset, + lightData.byteLength + ); + + const modelData = modelMatrix as Float32Array; + device.queue.writeBuffer( + modelUniformBuffer, + 0, + modelData.buffer, + modelData.byteOffset, + modelData.byteLength + ); +} + +// Rotates the camera around the origin based on time. +function getCameraViewProjMatrix() { + const eyePosition = vec3.fromValues(0, 50, -100); + + const rad = Math.PI * (Date.now() / 2000); + const rotation = mat4.rotateY(mat4.translation(origin), rad); + vec3.transformMat4(eyePosition, rotation, eyePosition); + + const viewMatrix = mat4.lookAt(eyePosition, origin, upVector); + + mat4.multiply(projectionMatrix, viewMatrix, viewProjMatrix); + return viewProjMatrix as Float32Array; +} + +const shadowPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [], + depthStencilAttachment: { + view: shadowDepthTextureView, + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +function frame() { + const cameraViewProj = getCameraViewProjMatrix(); + device.queue.writeBuffer( + sceneUniformBuffer, + 64, + cameraViewProj.buffer, + cameraViewProj.byteOffset, + cameraViewProj.byteLength + ); + + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + { + const shadowPass = commandEncoder.beginRenderPass(shadowPassDescriptor); + shadowPass.setPipeline(shadowPipeline); + shadowPass.setBindGroup(0, sceneBindGroupForShadow); + shadowPass.setBindGroup(1, modelBindGroup); + shadowPass.setVertexBuffer(0, vertexBuffer); + shadowPass.setIndexBuffer(indexBuffer, 'uint16'); + shadowPass.drawIndexed(indexCount); + + shadowPass.end(); + } + { + const renderPass = commandEncoder.beginRenderPass(renderPassDescriptor); + renderPass.setPipeline(pipeline); + renderPass.setBindGroup(0, sceneBindGroupForRender); + renderPass.setBindGroup(1, modelBindGroup); + renderPass.setVertexBuffer(0, vertexBuffer); + renderPass.setIndexBuffer(indexBuffer, 'uint16'); + renderPass.drawIndexed(indexCount); + + renderPass.end(); + } + device.queue.submit([commandEncoder.finish()]); + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/meta.ts new file mode 100644 index 00000000..3204527f --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/meta.ts @@ -0,0 +1,12 @@ +export default { + name: 'Shadow Mapping', + description: + 'This example shows how to sample from a depth texture to render shadows.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'vertexShadow.wgsl'}, + {path: 'vertex.wgsl'}, + {path: 'fragment.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/vertex.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/vertex.wgsl new file mode 100644 index 00000000..797daf89 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/vertex.wgsl @@ -0,0 +1,43 @@ +struct Scene { + lightViewProjMatrix: mat4x4f, + cameraViewProjMatrix: mat4x4f, + lightPos: vec3f, +} + +struct Model { + modelMatrix: mat4x4f, +} + +@group(0) @binding(0) var scene : Scene; +@group(1) @binding(0) var model : Model; + +struct VertexOutput { + @location(0) shadowPos: vec3f, + @location(1) fragPos: vec3f, + @location(2) fragNorm: vec3f, + + @builtin(position) Position: vec4f, +} + +@vertex +fn main( + @location(0) position: vec3f, + @location(1) normal: vec3f +) -> VertexOutput { + var output : VertexOutput; + + // XY is in (-1, 1) space, Z is in (0, 1) space + let posFromLight = scene.lightViewProjMatrix * model.modelMatrix * vec4(position, 1.0); + + // Convert XY to (0, 1) + // Y is flipped because texture coords are Y-down. + output.shadowPos = vec3( + posFromLight.xy * vec2(0.5, -0.5) + vec2(0.5), + posFromLight.z + ); + + output.Position = scene.cameraViewProjMatrix * model.modelMatrix * vec4(position, 1.0); + output.fragPos = output.Position.xyz; + output.fragNorm = normal; + return output; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/vertexShadow.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/vertexShadow.wgsl new file mode 100644 index 00000000..97295ec9 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/shadowMapping/vertexShadow.wgsl @@ -0,0 +1,19 @@ +struct Scene { + lightViewProjMatrix: mat4x4f, + cameraViewProjMatrix: mat4x4f, + lightPos: vec3f, +} + +struct Model { + modelMatrix: mat4x4f, +} + +@group(0) @binding(0) var scene : Scene; +@group(1) @binding(0) var model : Model; + +@vertex +fn main( + @location(0) position: vec3f +) -> @builtin(position) vec4f { + return scene.lightViewProjMatrix * model.modelMatrix * vec4(position, 1.0); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/glbUtils.ts b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/glbUtils.ts new file mode 100644 index 00000000..783a3d07 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/glbUtils.ts @@ -0,0 +1,1018 @@ +import {Quat} from 'wgpu-matrix'; +import {Accessor, BufferView, GlTf, Scene} from './gltf'; +import {Mat4, Vec3, mat4} from 'wgpu-matrix'; + +//NOTE: GLTF code is not generally extensible to all gltf models +// Modified from Will Usher code found at this link https://www.willusher.io/graphics/2023/05/16/0-to-gltf-first-mesh + +// Associates the mode paramete of a gltf primitive object with the primitive's intended render mode +enum GLTFRenderMode { + POINTS = 0, + LINE = 1, + LINE_LOOP = 2, + LINE_STRIP = 3, + TRIANGLES = 4, + TRIANGLE_STRIP = 5, + TRIANGLE_FAN = 6, +} + +// Determines how to interpret each element of the structure that is accessed from our accessor +enum GLTFDataComponentType { + BYTE = 5120, + UNSIGNED_BYTE = 5121, + SHORT = 5122, + UNSIGNED_SHORT = 5123, + INT = 5124, + UNSIGNED_INT = 5125, + FLOAT = 5126, + DOUBLE = 5130, +} + +// Determines how to interpret the structure of the values accessed by an accessor +enum GLTFDataStructureType { + SCALAR = 0, + VEC2 = 1, + VEC3 = 2, + VEC4 = 3, + MAT2 = 4, + MAT3 = 5, + MAT4 = 6, +} + +export const alignTo = (val: number, align: number): number => { + return Math.floor((val + align - 1) / align) * align; +}; + +const parseGltfDataStructureType = (type: string) => { + switch (type) { + case 'SCALAR': + return GLTFDataStructureType.SCALAR; + case 'VEC2': + return GLTFDataStructureType.VEC2; + case 'VEC3': + return GLTFDataStructureType.VEC3; + case 'VEC4': + return GLTFDataStructureType.VEC4; + case 'MAT2': + return GLTFDataStructureType.MAT2; + case 'MAT3': + return GLTFDataStructureType.MAT3; + case 'MAT4': + return GLTFDataStructureType.MAT4; + default: + throw Error(`Unhandled glTF Type ${type}`); + } +}; + +const gltfDataStructureTypeNumComponents = (type: GLTFDataStructureType) => { + switch (type) { + case GLTFDataStructureType.SCALAR: + return 1; + case GLTFDataStructureType.VEC2: + return 2; + case GLTFDataStructureType.VEC3: + return 3; + case GLTFDataStructureType.VEC4: + case GLTFDataStructureType.MAT2: + return 4; + case GLTFDataStructureType.MAT3: + return 9; + case GLTFDataStructureType.MAT4: + return 16; + default: + throw Error(`Invalid glTF Type ${type}`); + } +}; + +// Note: only returns non-normalized type names, +// so byte/ubyte = sint8/uint8, not snorm8/unorm8, same for ushort +const gltfVertexType = ( + componentType: GLTFDataComponentType, + type: GLTFDataStructureType +) => { + let typeStr = null; + switch (componentType) { + case GLTFDataComponentType.BYTE: + typeStr = 'sint8'; + break; + case GLTFDataComponentType.UNSIGNED_BYTE: + typeStr = 'uint8'; + break; + case GLTFDataComponentType.SHORT: + typeStr = 'sint16'; + break; + case GLTFDataComponentType.UNSIGNED_SHORT: + typeStr = 'uint16'; + break; + case GLTFDataComponentType.INT: + typeStr = 'int32'; + break; + case GLTFDataComponentType.UNSIGNED_INT: + typeStr = 'uint32'; + break; + case GLTFDataComponentType.FLOAT: + typeStr = 'float32'; + break; + default: + throw Error(`Unrecognized or unsupported glTF type ${componentType}`); + } + + switch (gltfDataStructureTypeNumComponents(type)) { + case 1: + return typeStr; + case 2: + return typeStr + 'x2'; + case 3: + return typeStr + 'x3'; + case 4: + return typeStr + 'x4'; + // Vertex attributes should never be a matrix type, so we should not hit this + // unless we're passed an improperly created gltf file + default: + throw Error(`Invalid number of components for gltfType: ${type}`); + } +}; + +const gltfElementSize = ( + componentType: GLTFDataComponentType, + type: GLTFDataStructureType +) => { + let componentSize = 0; + switch (componentType) { + case GLTFDataComponentType.BYTE: + componentSize = 1; + break; + case GLTFDataComponentType.UNSIGNED_BYTE: + componentSize = 1; + break; + case GLTFDataComponentType.SHORT: + componentSize = 2; + break; + case GLTFDataComponentType.UNSIGNED_SHORT: + componentSize = 2; + break; + case GLTFDataComponentType.INT: + componentSize = 4; + break; + case GLTFDataComponentType.UNSIGNED_INT: + componentSize = 4; + break; + case GLTFDataComponentType.FLOAT: + componentSize = 4; + break; + case GLTFDataComponentType.DOUBLE: + componentSize = 8; + break; + default: + throw Error('Unrecognized GLTF Component Type?'); + } + return gltfDataStructureTypeNumComponents(type) * componentSize; +}; + +// Convert differently depending on if the shader is a vertex or compute shader +const convertGPUVertexFormatToWGSLFormat = (vertexFormat: GPUVertexFormat) => { + switch (vertexFormat) { + case 'float32': { + return 'f32'; + } + case 'float32x2': { + return 'vec2f'; + } + case 'float32x3': { + return 'vec3f'; + } + case 'float32x4': { + return 'vec4f'; + } + case 'uint32': { + return 'u32'; + } + case 'uint32x2': { + return 'vec2u'; + } + case 'uint32x3': { + return 'vec3u'; + } + case 'uint32x4': { + return 'vec4u'; + } + case 'uint8x2': { + return 'vec2u'; + } + case 'uint8x4': { + return 'vec4u'; + } + case 'uint16x4': { + return 'vec4u'; + } + case 'uint16x2': { + return 'vec2u'; + } + default: { + return 'f32'; + } + } +}; + +export class GLTFBuffer { + buffer: Uint8Array; + + constructor(buffer: ArrayBuffer, offset: number, size: number) { + this.buffer = new Uint8Array(buffer, offset, size); + } +} + +export class GLTFBufferView { + byteLength: number; + byteStride: number; + view: Uint8Array; + needsUpload: boolean; + gpuBuffer: GPUBuffer; + usage: number; + + constructor(buffer: GLTFBuffer, view: BufferView) { + this.byteLength = view['byteLength']; + this.byteStride = 0; + if (view['byteStride'] !== undefined) { + this.byteStride = view['byteStride']; + } + // Create the buffer view. Note that subarray creates a new typed + // view over the same array buffer, we do not make a copy here. + let viewOffset = 0; + if (view['byteOffset'] !== undefined) { + viewOffset = view['byteOffset']; + } + // NOTE: This creates a uint8array view into the buffer! + // When we call .buffer on this view, it will give us back the original array buffer + // Accordingly, when converting our buffer from a uint8array to a float32array representation + // we need to apply the byte offset of our view when creating our buffer + // ie new Float32Array(this.view.buffer, this.view.byteOffset, this.view.byteLength) + this.view = buffer.buffer.subarray( + viewOffset, + viewOffset + this.byteLength + ); + + this.needsUpload = false; + this.gpuBuffer = null; + this.usage = 0; + } + + addUsage(usage: number) { + this.usage = this.usage | usage; + } + + upload(device: GPUDevice) { + // Note: must align to 4 byte size when mapped at creation is true + const buf: GPUBuffer = device.createBuffer({ + size: alignTo(this.view.byteLength, 4), + usage: this.usage, + mappedAtCreation: true, + }); + new Uint8Array(buf.getMappedRange()).set(this.view); + buf.unmap(); + this.gpuBuffer = buf; + this.needsUpload = false; + } +} + +export class GLTFAccessor { + count: number; + componentType: GLTFDataComponentType; + structureType: GLTFDataStructureType; + view: GLTFBufferView; + byteOffset: number; + + constructor(view: GLTFBufferView, accessor: Accessor) { + this.count = accessor['count']; + this.componentType = accessor['componentType']; + this.structureType = parseGltfDataStructureType(accessor['type']); + this.view = view; + this.byteOffset = 0; + if (accessor['byteOffset'] !== undefined) { + this.byteOffset = accessor['byteOffset']; + } + } + + get byteStride() { + const elementSize = gltfElementSize(this.componentType, this.structureType); + return Math.max(elementSize, this.view.byteStride); + } + + get byteLength() { + return this.count * this.byteStride; + } + + // Get the vertex attribute type for accessors that are used as vertex attributes + get vertexType() { + return gltfVertexType(this.componentType, this.structureType); + } +} + +interface AttributeMapInterface { + [key: string]: GLTFAccessor; +} + +export class GLTFPrimitive { + topology: GLTFRenderMode; + renderPipeline: GPURenderPipeline; + private attributeMap: AttributeMapInterface; + private attributes: string[] = []; + + constructor( + topology: GLTFRenderMode, + attributeMap: AttributeMapInterface, + attributes: string[] + ) { + this.topology = topology; + this.renderPipeline = null; + // Maps attribute names to accessors + this.attributeMap = attributeMap; + this.attributes = attributes; + + for (const key in this.attributeMap) { + this.attributeMap[key].view.needsUpload = true; + if (key === 'INDICES') { + this.attributeMap['INDICES'].view.addUsage(GPUBufferUsage.INDEX); + continue; + } + this.attributeMap[key].view.addUsage(GPUBufferUsage.VERTEX); + } + } + + buildRenderPipeline( + device: GPUDevice, + vertexShader: string, + fragmentShader: string, + colorFormat: GPUTextureFormat, + depthFormat: GPUTextureFormat, + bgLayouts: GPUBindGroupLayout[], + label: string + ) { + // For now, just check if the attributeMap contains a given attribute using map.has(), and add it if it does + // POSITION, NORMAL, TEXCOORD_0, JOINTS_0, WEIGHTS_0 for order + // Vertex attribute state and shader stage + let VertexInputShaderString = `struct VertexInput {\n`; + const vertexBuffers: GPUVertexBufferLayout[] = this.attributes.map( + (attr, idx) => { + const vertexFormat: GPUVertexFormat = + this.attributeMap[attr].vertexType; + const attrString = attr.toLowerCase().replace(/_0$/, ''); + VertexInputShaderString += `\t@location(${idx}) ${attrString}: ${convertGPUVertexFormatToWGSLFormat( + vertexFormat + )},\n`; + return { + arrayStride: this.attributeMap[attr].byteStride, + attributes: [ + { + format: this.attributeMap[attr].vertexType, + offset: this.attributeMap[attr].byteOffset, + shaderLocation: idx, + }, + ], + } as GPUVertexBufferLayout; + } + ); + VertexInputShaderString += '}'; + + const vertexState: GPUVertexState = { + // Shader stage info + module: device.createShaderModule({ + code: VertexInputShaderString + vertexShader, + }), + buffers: vertexBuffers, + }; + + const fragmentState: GPUFragmentState = { + // Shader info + module: device.createShaderModule({ + code: VertexInputShaderString + fragmentShader, + }), + // Output render target info + targets: [{format: colorFormat}], + }; + + // Our loader only supports triangle lists and strips, so by default we set + // the primitive topology to triangle list, and check if it's instead a triangle strip + const primitive: GPUPrimitiveState = {topology: 'triangle-list'}; + if (this.topology == GLTFRenderMode.TRIANGLE_STRIP) { + primitive.topology = 'triangle-strip'; + primitive.stripIndexFormat = this.attributeMap['INDICES'].vertexType; + } + + const layout: GPUPipelineLayout = device.createPipelineLayout({ + bindGroupLayouts: bgLayouts, + label: `${label}.pipelineLayout`, + }); + + const rpDescript: GPURenderPipelineDescriptor = { + layout: layout, + label: `${label}.pipeline`, + vertex: vertexState, + fragment: fragmentState, + primitive: primitive, + depthStencil: { + format: depthFormat, + depthWriteEnabled: true, + depthCompare: 'less', + }, + }; + + this.renderPipeline = device.createRenderPipeline(rpDescript); + } + + render(renderPassEncoder: GPURenderPassEncoder, bindGroups: GPUBindGroup[]) { + renderPassEncoder.setPipeline(this.renderPipeline); + bindGroups.forEach((bg, idx) => { + renderPassEncoder.setBindGroup(idx, bg); + }); + + //if skin do something with bone bind group + this.attributes.map((attr, idx) => { + renderPassEncoder.setVertexBuffer( + idx, + this.attributeMap[attr].view.gpuBuffer, + this.attributeMap[attr].byteOffset, + this.attributeMap[attr].byteLength + ); + }); + + if (this.attributeMap['INDICES']) { + renderPassEncoder.setIndexBuffer( + this.attributeMap['INDICES'].view.gpuBuffer, + this.attributeMap['INDICES'].vertexType, + this.attributeMap['INDICES'].byteOffset, + this.attributeMap['INDICES'].byteLength + ); + renderPassEncoder.drawIndexed(this.attributeMap['INDICES'].count); + } else { + renderPassEncoder.draw(this.attributeMap['POSITION'].count); + } + } +} + +export class GLTFMesh { + name: string; + primitives: GLTFPrimitive[]; + + constructor(name: string, primitives: GLTFPrimitive[]) { + this.name = name; + this.primitives = primitives; + } + + buildRenderPipeline( + device: GPUDevice, + vertexShader: string, + fragmentShader: string, + colorFormat: GPUTextureFormat, + depthFormat: GPUTextureFormat, + bgLayouts: GPUBindGroupLayout[] + ) { + // We take a pretty simple approach to start. Just loop through all the primitives and + // build their respective render pipelines + for (let i = 0; i < this.primitives.length; ++i) { + this.primitives[i].buildRenderPipeline( + device, + vertexShader, + fragmentShader, + colorFormat, + depthFormat, + bgLayouts, + `PrimitivePipeline${i}` + ); + } + } + + render(renderPassEncoder: GPURenderPassEncoder, bindGroups: GPUBindGroup[]) { + // We take a pretty simple approach to start. Just loop through all the primitives and + // call their individual draw methods + for (let i = 0; i < this.primitives.length; ++i) { + this.primitives[i].render(renderPassEncoder, bindGroups); + } + } +} + +export const validateGLBHeader = (header: DataView) => { + if (header.getUint32(0, true) != 0x46546c67) { + throw Error('Provided file is not a glB file'); + } + if (header.getUint32(4, true) != 2) { + throw Error('Provided file is glTF 2.0 file'); + } +}; + +export const validateBinaryHeader = (header: Uint32Array) => { + if (header[1] != 0x004e4942) { + throw Error( + 'Invalid glB: The second chunk of the glB file is not a binary chunk!' + ); + } +}; + +type TempReturn = { + meshes: GLTFMesh[]; + nodes: GLTFNode[]; + scenes: GLTFScene[]; + skins: GLTFSkin[]; +}; + +export class BaseTransformation { + position: Vec3; + rotation: Quat; + scale: Vec3; + + constructor( + // Identity translation vec3 + position = [0, 0, 0], + // Identity quaternion + rotation = [0, 0, 0, 1], + // Identity scale vec3 + scale = [1, 1, 1] + ) { + this.position = position; + this.rotation = rotation; + this.scale = scale; + } + + getMatrix(): Mat4 { + // Analagous to let transformationMatrix: mat4x4f = translation * rotation * scale; + const dst = mat4.identity(); + // Scale the transformation Matrix + mat4.scale(dst, this.scale, dst); + // Calculate the rotationMatrix from the quaternion + const rotationMatrix = mat4.fromQuat(this.rotation); + // Apply the rotation Matrix to the scaleMatrix (rotMat * scaleMat) + mat4.multiply(rotationMatrix, dst, dst); + // Translate the transformationMatrix + mat4.translate(dst, this.position, dst); + return dst; + } +} + +export class GLTFNode { + name: string; + source: BaseTransformation; + parent: GLTFNode | null; + children: GLTFNode[]; + // Transforms all node's children in the node's local space, with node itself acting as the origin + localMatrix: Mat4; + worldMatrix: Mat4; + // List of Meshes associated with this node + drawables: GLTFMesh[]; + test = 0; + skin?: GLTFSkin; + private nodeTransformGPUBuffer: GPUBuffer; + private nodeTransformBindGroup: GPUBindGroup; + + constructor( + device: GPUDevice, + bgLayout: GPUBindGroupLayout, + source: BaseTransformation, + name?: string, + skin?: GLTFSkin + ) { + this.name = name + ? name + : `node_${source.position} ${source.rotation} ${source.scale}`; + this.source = source; + this.parent = null; + this.children = []; + this.localMatrix = mat4.identity(); + this.worldMatrix = mat4.identity(); + this.drawables = []; + this.nodeTransformGPUBuffer = device.createBuffer({ + size: Float32Array.BYTES_PER_ELEMENT * 16, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); + this.nodeTransformBindGroup = device.createBindGroup({ + layout: bgLayout, + entries: [ + { + binding: 0, + resource: { + buffer: this.nodeTransformGPUBuffer, + }, + }, + ], + }); + this.skin = skin; + } + + setParent(parent: GLTFNode) { + if (this.parent) { + this.parent.removeChild(this); + this.parent = null; + } + parent.addChild(this); + this.parent = parent; + } + + updateWorldMatrix(device: GPUDevice, parentWorldMatrix?: Mat4) { + // Get local transform of this particular node, and if the node has a parent, + // multiply it against the parent's transform matrix to get transformMatrix relative to world. + this.localMatrix = this.source.getMatrix(); + if (parentWorldMatrix) { + mat4.multiply(parentWorldMatrix, this.localMatrix, this.worldMatrix); + } else { + mat4.copy(this.localMatrix, this.worldMatrix); + } + const worldMatrix = this.worldMatrix as Float32Array; + device.queue.writeBuffer( + this.nodeTransformGPUBuffer, + 0, + worldMatrix.buffer, + worldMatrix.byteOffset, + worldMatrix.byteLength + ); + for (const child of this.children) { + child.updateWorldMatrix(device, worldMatrix); + } + } + + traverse(fn: (n: GLTFNode, ...args) => void) { + fn(this); + for (const child of this.children) { + child.traverse(fn); + } + } + + renderDrawables( + passEncoder: GPURenderPassEncoder, + bindGroups: GPUBindGroup[] + ) { + if (this.drawables !== undefined) { + for (const drawable of this.drawables) { + if (this.skin) { + drawable.render(passEncoder, [ + ...bindGroups, + this.nodeTransformBindGroup, + this.skin.skinBindGroup, + ]); + } else { + drawable.render(passEncoder, [ + ...bindGroups, + this.nodeTransformBindGroup, + ]); + } + } + } + // Render any of its children + for (const child of this.children) { + child.renderDrawables(passEncoder, bindGroups); + } + } + + private addChild(child: GLTFNode) { + this.children.push(child); + } + + private removeChild(child: GLTFNode) { + const ndx = this.children.indexOf(child); + this.children.splice(ndx, 1); + } +} + +export class GLTFScene { + nodes?: number[]; + root: GLTFNode; + name?: string; + + constructor( + device: GPUDevice, + nodeTransformBGL: GPUBindGroupLayout, + baseScene: Scene + ) { + this.nodes = baseScene.nodes; + this.name = baseScene.name; + this.root = new GLTFNode( + device, + nodeTransformBGL, + new BaseTransformation(), + baseScene.name + ); + } +} + +export class GLTFSkin { + // Nodes of the skin's joints + // [5, 2, 3] means our joint info is at nodes 5, 2, and 3 + joints: number[]; + // Bind Group for this skin's uniform buffer + skinBindGroup: GPUBindGroup; + // Static bindGroupLayout shared across all skins + // In a larger shader with more properties, certain bind groups + // would likely have to be combined due to device limitations in the number of bind groups + // allowed within a shader + // Inverse bind matrices parsed from the accessor + private inverseBindMatrices: Float32Array; + private jointMatricesUniformBuffer: GPUBuffer; + private inverseBindMatricesUniformBuffer: GPUBuffer; + static skinBindGroupLayout: GPUBindGroupLayout; + + static createSharedBindGroupLayout(device: GPUDevice) { + this.skinBindGroupLayout = device.createBindGroupLayout({ + label: 'StaticGLTFSkin.bindGroupLayout', + entries: [ + // Holds the initial joint matrices buffer + { + binding: 0, + buffer: { + type: 'read-only-storage', + }, + visibility: GPUShaderStage.VERTEX, + }, + // Holds the inverse bind matrices buffer + { + binding: 1, + buffer: { + type: 'read-only-storage', + }, + visibility: GPUShaderStage.VERTEX, + }, + ], + }); + } + + // For the sake of simplicity and easier debugging, we're going to convert our skin gpu accessor to a + // float32array, which should be performant enough for this example since there is only one skin (again, this) + // is not a comprehensive gltf parser + constructor( + device: GPUDevice, + inverseBindMatricesAccessor: GLTFAccessor, + joints: number[] + ) { + if ( + inverseBindMatricesAccessor.componentType !== + GLTFDataComponentType.FLOAT || + inverseBindMatricesAccessor.byteStride !== 64 + ) { + throw Error( + `This skin's provided accessor does not access a mat4x4f matrix, or does not access the provided mat4x4f data correctly` + ); + } + // NOTE: Come back to this uint8array to float32array conversion in case it is incorrect + this.inverseBindMatrices = new Float32Array( + inverseBindMatricesAccessor.view.view.buffer, + inverseBindMatricesAccessor.view.view.byteOffset, + inverseBindMatricesAccessor.view.view.byteLength / 4 + ); + this.joints = joints; + const skinGPUBufferUsage: GPUBufferDescriptor = { + size: Float32Array.BYTES_PER_ELEMENT * 16 * joints.length, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, + }; + this.jointMatricesUniformBuffer = device.createBuffer(skinGPUBufferUsage); + this.inverseBindMatricesUniformBuffer = + device.createBuffer(skinGPUBufferUsage); + device.queue.writeBuffer( + this.inverseBindMatricesUniformBuffer, + 0, + this.inverseBindMatrices + ); + this.skinBindGroup = device.createBindGroup({ + layout: GLTFSkin.skinBindGroupLayout, + label: 'StaticGLTFSkin.bindGroup', + entries: [ + { + binding: 0, + resource: { + buffer: this.jointMatricesUniformBuffer, + }, + }, + { + binding: 1, + resource: { + buffer: this.inverseBindMatricesUniformBuffer, + }, + }, + ], + }); + } + + update(device: GPUDevice, currentNodeIndex: number, nodes: GLTFNode[]) { + const globalWorldInverse = mat4.inverse( + nodes[currentNodeIndex].worldMatrix + ); + for (let j = 0; j < this.joints.length; j++) { + const joint = this.joints[j]; + const dstMatrix: Mat4 = mat4.identity(); + mat4.multiply(globalWorldInverse, nodes[joint].worldMatrix, dstMatrix); + const toWrite = dstMatrix as Float32Array; + device.queue.writeBuffer( + this.jointMatricesUniformBuffer, + j * 64, + toWrite.buffer, + toWrite.byteOffset, + toWrite.byteLength + ); + } + } +} + +// Upload a GLB model, parse its JSON and Binary components, and create the requisite GPU resources +// to render them. NOTE: Not extensible to all GLTF contexts at this point in time +export const convertGLBToJSONAndBinary = async ( + buffer: ArrayBuffer, + device: GPUDevice +): Promise => { + // Binary GLTF layout: https://cdn.willusher.io/webgpu-0-to-gltf/glb-layout.svg + const jsonHeader = new DataView(buffer, 0, 20); + validateGLBHeader(jsonHeader); + + // Length of the jsonChunk found at jsonHeader[12 - 15] + const jsonChunkLength = jsonHeader.getUint32(12, true); + + // Parse the JSON chunk of the glB file to a JSON object + const jsonChunk: GlTf = JSON.parse( + new TextDecoder('utf-8').decode(new Uint8Array(buffer, 20, jsonChunkLength)) + ); + + // Binary data located after jsonChunk + const binaryHeader = new Uint32Array(buffer, 20 + jsonChunkLength, 2); + validateBinaryHeader(binaryHeader); + + const binaryChunk = new GLTFBuffer( + buffer, + 28 + jsonChunkLength, + binaryHeader[0] + ); + + //Const populate missing properties of jsonChunk + for (const accessor of jsonChunk.accessors) { + accessor.byteOffset = accessor.byteOffset ?? 0; + accessor.normalized = accessor.normalized ?? false; + } + + for (const bufferView of jsonChunk.bufferViews) { + bufferView.byteOffset = bufferView.byteOffset ?? 0; + } + + if (jsonChunk.samplers) { + for (const sampler of jsonChunk.samplers) { + sampler.wrapS = sampler.wrapS ?? 10497; //GL.REPEAT + sampler.wrapT = sampler.wrapT ?? 10947; //GL.REPEAT + } + } + + //Mark each accessor with its intended usage within the vertexShader. + //Often necessary due to infrequencey with which the BufferView target field is populated. + for (const mesh of jsonChunk.meshes) { + for (const primitive of mesh.primitives) { + if ('indices' in primitive) { + const accessor = jsonChunk.accessors[primitive.indices]; + jsonChunk.accessors[primitive.indices].bufferViewUsage |= + GPUBufferUsage.INDEX; + jsonChunk.bufferViews[accessor.bufferView].usage |= + GPUBufferUsage.INDEX; + } + for (const attribute of Object.values(primitive.attributes)) { + const accessor = jsonChunk.accessors[attribute]; + jsonChunk.accessors[attribute].bufferViewUsage |= GPUBufferUsage.VERTEX; + jsonChunk.bufferViews[accessor.bufferView].usage |= + GPUBufferUsage.VERTEX; + } + } + } + + // Create GLTFBufferView objects for all the buffer views in the glTF file + const bufferViews: GLTFBufferView[] = []; + for (let i = 0; i < jsonChunk.bufferViews.length; ++i) { + bufferViews.push(new GLTFBufferView(binaryChunk, jsonChunk.bufferViews[i])); + } + + const accessors: GLTFAccessor[] = []; + for (let i = 0; i < jsonChunk.accessors.length; ++i) { + const accessorInfo = jsonChunk.accessors[i]; + const viewID = accessorInfo['bufferView']; + accessors.push(new GLTFAccessor(bufferViews[viewID], accessorInfo)); + } + // Load the first mesh + const meshes: GLTFMesh[] = []; + for (let i = 0; i < jsonChunk.meshes.length; i++) { + const mesh = jsonChunk.meshes[i]; + const meshPrimitives: GLTFPrimitive[] = []; + for (let j = 0; j < mesh.primitives.length; ++j) { + const prim = mesh.primitives[j]; + let topology = prim['mode']; + // Default is triangles if mode specified + if (topology === undefined) { + topology = GLTFRenderMode.TRIANGLES; + } + if ( + topology != GLTFRenderMode.TRIANGLES && + topology != GLTFRenderMode.TRIANGLE_STRIP + ) { + throw Error(`Unsupported primitive mode ${prim['mode']}`); + } + + const primitiveAttributeMap = {}; + const attributes = []; + if (jsonChunk['accessors'][prim['indices']] !== undefined) { + const indices = accessors[prim['indices']]; + primitiveAttributeMap['INDICES'] = indices; + } + + // Loop through all the attributes and store within our attributeMap + for (const attr in prim['attributes']) { + const accessor = accessors[prim['attributes'][attr]]; + primitiveAttributeMap[attr] = accessor; + if (accessor.structureType > 3) { + throw Error( + 'Vertex attribute accessor accessed an unsupported data type for vertex attribute' + ); + } + attributes.push(attr); + } + meshPrimitives.push( + new GLTFPrimitive(topology, primitiveAttributeMap, attributes) + ); + } + meshes.push(new GLTFMesh(mesh.name, meshPrimitives)); + } + + const skins: GLTFSkin[] = []; + for (const skin of jsonChunk.skins) { + const inverseBindMatrixAccessor = accessors[skin.inverseBindMatrices]; + inverseBindMatrixAccessor.view.addUsage( + GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST + ); + inverseBindMatrixAccessor.view.needsUpload = true; + } + + // Upload the buffer views used by mesh + for (let i = 0; i < bufferViews.length; ++i) { + if (bufferViews[i].needsUpload) { + bufferViews[i].upload(device); + } + } + + GLTFSkin.createSharedBindGroupLayout(device); + for (const skin of jsonChunk.skins) { + const inverseBindMatrixAccessor = accessors[skin.inverseBindMatrices]; + const joints = skin.joints; + skins.push(new GLTFSkin(device, inverseBindMatrixAccessor, joints)); + } + + const nodes: GLTFNode[] = []; + + // Access each node. If node references a mesh, add mesh to that node + const nodeUniformsBindGroupLayout = device.createBindGroupLayout({ + label: 'NodeUniforms.bindGroupLayout', + entries: [ + { + binding: 0, + buffer: { + type: 'uniform', + }, + visibility: GPUShaderStage.VERTEX, + }, + ], + }); + for (const currNode of jsonChunk.nodes) { + const baseTransformation = new BaseTransformation( + currNode.translation, + currNode.rotation, + currNode.scale + ); + const nodeToCreate = new GLTFNode( + device, + nodeUniformsBindGroupLayout, + baseTransformation, + currNode.name, + skins[currNode.skin] + ); + const meshToAdd = meshes[currNode.mesh]; + if (meshToAdd) { + nodeToCreate.drawables.push(meshToAdd); + } + nodes.push(nodeToCreate); + } + + // Assign each node its children + nodes.forEach((node, idx) => { + const children = jsonChunk.nodes[idx].children; + if (children) { + children.forEach((childIdx) => { + const child = nodes[childIdx]; + child.setParent(node); + }); + } + }); + + const scenes: GLTFScene[] = []; + + for (const jsonScene of jsonChunk.scenes) { + const scene = new GLTFScene(device, nodeUniformsBindGroupLayout, jsonScene); + const sceneChildren = scene.nodes; + sceneChildren.forEach((childIdx) => { + const child = nodes[childIdx]; + child.setParent(scene.root); + }); + scenes.push(scene); + } + return { + meshes, + nodes, + scenes, + skins, + }; +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gltf.ts b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gltf.ts new file mode 100644 index 00000000..fb107320 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gltf.ts @@ -0,0 +1,229 @@ +import {Mat4} from 'wgpu-matrix'; +import {GLTFNode} from './glbUtils'; + +/* eslint @typescript-eslint/no-explicit-any: "off" */ + +/* Sourced from https://github.com/bwasty/gltf-loader-ts/blob/master/source/gltf.ts */ +/* License for use can be found here: https://github.com/bwasty/gltf-loader-ts/blob/master/LICENSE */ +/* Comments and types have been excluded from original source for sake of cleanliness and brevity */ +export type GlTfId = number; + +export interface AccessorSparseIndices { + bufferView: GlTfId; + byteOffset?: number; + componentType: 5121 | 5123 | 5125 | number; +} + +export interface AccessorSparseValues { + bufferView: GlTfId; + byteOffset?: number; +} + +export interface AccessorSparse { + count: number; + indices: AccessorSparseIndices; + values: AccessorSparseValues; +} + +export interface Accessor { + bufferView?: GlTfId; + bufferViewUsage?: 34962 | 34963 | number; + byteOffset?: number; + componentType: 5120 | 5121 | 5122 | 5123 | 5125 | 5126 | number; + normalized?: boolean; + count: number; + type: 'SCALAR' | 'VEC2' | 'VEC3' | 'VEC4' | 'MAT2' | 'MAT3' | 'MAT4' | string; + max?: number[]; + min?: number[]; + sparse?: AccessorSparse; + name?: string; +} + +export interface AnimationChannelTarget { + node?: GlTfId; + path: 'translation' | 'rotation' | 'scale' | 'weights' | string; +} + +export interface AnimationChannel { + sampler: GlTfId; + target: AnimationChannelTarget; +} + +export interface AnimationSampler { + input: GlTfId; + interpolation?: 'LINEAR' | 'STEP' | 'CUBICSPLINE' | string; + output: GlTfId; +} + +export interface Animation { + channels: AnimationChannel[]; + samplers: AnimationSampler[]; + name?: string; +} + +export interface Asset { + copyright?: string; + generator?: string; + version: string; + minVersion?: string; +} + +export interface Buffer { + uri?: string; + byteLength: number; + name?: string; +} + +export interface BufferView { + buffer: GlTfId; + byteOffset?: number; + byteLength: number; + byteStride?: number; + target?: 34962 | 34963 | number; + name?: string; + usage?: number; +} + +export interface CameraOrthographic { + xmag: number; + ymag: number; + zfar: number; + znear: number; +} + +export interface CameraPerspective { + aspectRatio?: number; + yfov: number; + zfar?: number; + znear: number; +} + +export interface Camera { + orthographic?: CameraOrthographic; + perspective?: CameraPerspective; + type: 'perspective' | 'orthographic' | string; + name?: string; +} + +export interface Image { + uri?: string; + mimeType?: 'image/jpeg' | 'image/png' | string; + bufferView?: GlTfId; + name?: string; +} + +export interface TextureInfo { + index: GlTfId; + texCoord?: number; +} + +export interface MaterialPbrMetallicRoughness { + baseColorFactor?: number[]; + baseColorTexture?: TextureInfo; + metallicFactor?: number; + roughnessFactor?: number; + metallicRoughnessTexture?: TextureInfo; +} + +export interface MaterialNormalTextureInfo { + index?: number; + texCoord?: number; + scale?: number; +} + +export interface MaterialOcclusionTextureInfo { + index?: number; + texCoord?: number; + strength?: number; +} + +export interface Material { + name?: string; + pbrMetallicRoughness?: MaterialPbrMetallicRoughness; + normalTexture?: MaterialNormalTextureInfo; + occlusionTexture?: MaterialOcclusionTextureInfo; + emissiveTexture?: TextureInfo; + emissiveFactor?: number[]; + alphaMode?: 'OPAQUE' | 'MASK' | 'BLEND' | string; + alphaCutoff?: number; + doubleSided?: boolean; +} + +export interface MeshPrimitive { + attributes: { + [k: string]: GlTfId; + }; + indices?: GlTfId; + material?: GlTfId; + mode?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | number; + targets?: { + [k: string]: GlTfId; + }[]; +} + +export interface Mesh { + primitives: MeshPrimitive[]; + weights?: number[]; + name?: string; +} + +export interface Node { + camera?: GlTfId; + children?: GlTfId[]; + skin?: GlTfId; + matrix?: number[]; + worldTransformationMatrix?: Mat4; + mesh?: GlTfId; + rotation?: number[]; + scale?: number[]; + translation?: number[]; + weights?: number[]; + name?: string; +} + +export interface Sampler { + magFilter?: 9728 | 9729 | number; + minFilter?: 9728 | 9729 | 9984 | 9985 | 9986 | 9987 | number; + wrapS?: 33071 | 33648 | 10497 | number; + wrapT?: 33071 | 33648 | 10497 | number; + name?: string; +} + +export interface Scene { + nodes?: GlTfId[]; + name?: string; + root?: GLTFNode; +} + +export interface Skin { + inverseBindMatrices?: GlTfId; + skeleton?: GlTfId; + joints: GlTfId[]; + name?: string; +} + +export interface Texture { + sampler?: GlTfId; + source?: GlTfId; + name?: string; +} + +export interface GlTf { + extensionsUsed?: string[]; + extensionsRequired?: string[]; + accessors?: Accessor[]; + animations?: Animation[]; + asset: Asset; + buffers?: Buffer[]; + bufferViews?: BufferView[]; + cameras?: Camera[]; + images?: Image[]; + materials?: Material[]; + meshes?: Mesh[]; + nodes?: Node[]; + samplers?: Sampler[]; + scene?: GlTfId; + scenes?: Scene[]; + skins?: Skin[]; + textures?: Texture[]; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gltf.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gltf.wgsl new file mode 100644 index 00000000..7b107721 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gltf.wgsl @@ -0,0 +1,80 @@ +// Whale.glb Vertex attributes +// Read in VertexInput from attributes +// f32x3 f32x3 f32x2 u8x4 f32x4 +struct VertexOutput { + @builtin(position) Position: vec4f, + @location(0) normal: vec3f, + @location(1) joints: vec4f, + @location(2) weights: vec4f, +} + +struct CameraUniforms { + proj_matrix: mat4x4f, + view_matrix: mat4x4f, + model_matrix: mat4x4f, +} + +struct GeneralUniforms { + render_mode: u32, + skin_mode: u32, +} + +struct NodeUniforms { + world_matrix: mat4x4f, +} + +@group(0) @binding(0) var camera_uniforms: CameraUniforms; +@group(1) @binding(0) var general_uniforms: GeneralUniforms; +@group(2) @binding(0) var node_uniforms: NodeUniforms; +@group(3) @binding(0) var joint_matrices: array; +@group(3) @binding(1) var inverse_bind_matrices: array; + +@vertex +fn vertexMain(input: VertexInput) -> VertexOutput { + var output: VertexOutput; + // Compute joint_matrices * inverse_bind_matrices + let joint0 = joint_matrices[input.joints[0]] * inverse_bind_matrices[input.joints[0]]; + let joint1 = joint_matrices[input.joints[1]] * inverse_bind_matrices[input.joints[1]]; + let joint2 = joint_matrices[input.joints[2]] * inverse_bind_matrices[input.joints[2]]; + let joint3 = joint_matrices[input.joints[3]] * inverse_bind_matrices[input.joints[3]]; + // Compute influence of joint based on weight + let skin_matrix = + joint0 * input.weights[0] + + joint1 * input.weights[1] + + joint2 * input.weights[2] + + joint3 * input.weights[3]; + // Position of the vertex relative to our world + let world_position = vec4f(input.position.x, input.position.y, input.position.z, 1.0); + // Vertex position with model rotation, skinning, and the mesh's node transformation applied. + let skinned_position = camera_uniforms.model_matrix * skin_matrix * node_uniforms.world_matrix * world_position; + // Vertex position with only the model rotation applied. + let rotated_position = camera_uniforms.model_matrix * world_position; + // Determine which position to used based on whether skinMode is turnd on or off. + let transformed_position = select( + rotated_position, + skinned_position, + general_uniforms.skin_mode == 0 + ); + // Apply the camera and projection matrix transformations to our transformed position; + output.Position = camera_uniforms.proj_matrix * camera_uniforms.view_matrix * transformed_position; + output.normal = input.normal; + // Convert u32 joint data to f32s to prevent flat interpolation error. + output.joints = vec4f(f32(input.joints[0]), f32(input.joints[1]), f32(input.joints[2]), f32(input.joints[3])); + output.weights = input.weights; + return output; +} + +@fragment +fn fragmentMain(input: VertexOutput) -> @location(0) vec4f { + switch general_uniforms.render_mode { + case 1: { + return input.joints; + } + case 2: { + return input.weights; + } + default: { + return vec4f(input.normal, 1.0); + } + } +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/grid.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/grid.wgsl new file mode 100644 index 00000000..ee484117 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/grid.wgsl @@ -0,0 +1,74 @@ +struct VertexInput { + @location(0) vert_pos: vec2f, + @location(1) joints: vec4u, + @location(2) weights: vec4f +} + +struct VertexOutput { + @builtin(position) Position: vec4f, + @location(0) world_pos: vec3f, + @location(1) joints: vec4f, + @location(2) weights: vec4f, +} + +struct CameraUniforms { + projMatrix: mat4x4f, + viewMatrix: mat4x4f, + modelMatrix: mat4x4f, +} + +struct GeneralUniforms { + render_mode: u32, + skin_mode: u32, +} + +@group(0) @binding(0) var camera_uniforms: CameraUniforms; +@group(1) @binding(0) var general_uniforms: GeneralUniforms; +@group(2) @binding(0) var joint_matrices: array; +@group(2) @binding(1) var inverse_bind_matrices: array; + +@vertex +fn vertexMain(input: VertexInput) -> VertexOutput { + var output: VertexOutput; + var bones = vec4f(0.0, 0.0, 0.0, 0.0); + let position = vec4f(input.vert_pos.x, input.vert_pos.y, 0.0, 1.0); + // Get relevant 4 bone matrices + let joint0 = joint_matrices[input.joints[0]] * inverse_bind_matrices[input.joints[0]]; + let joint1 = joint_matrices[input.joints[1]] * inverse_bind_matrices[input.joints[1]]; + let joint2 = joint_matrices[input.joints[2]] * inverse_bind_matrices[input.joints[2]]; + let joint3 = joint_matrices[input.joints[3]] * inverse_bind_matrices[input.joints[3]]; + // Compute influence of joint based on weight + let skin_matrix = + joint0 * input.weights[0] + + joint1 * input.weights[1] + + joint2 * input.weights[2] + + joint3 * input.weights[3]; + // Bone transformed mesh + output.Position = select( + camera_uniforms.projMatrix * camera_uniforms.viewMatrix * camera_uniforms.modelMatrix * position, + camera_uniforms.projMatrix * camera_uniforms.viewMatrix * camera_uniforms.modelMatrix * skin_matrix * position, + general_uniforms.skin_mode == 0 + ); + + //Get unadjusted world coordinates + output.world_pos = position.xyz; + output.joints = vec4f(f32(input.joints.x), f32(input.joints.y), f32(input.joints.z), f32(input.joints.w)); + output.weights = input.weights; + return output; +} + + +@fragment +fn fragmentMain(input: VertexOutput) -> @location(0) vec4f { + switch general_uniforms.render_mode { + case 1: { + return input.joints; + } + case 2: { + return input.weights; + } + default: { + return vec4f(255.0, 0.0, 1.0, 1.0); + } + } +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gridData.ts b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gridData.ts new file mode 100644 index 00000000..2e9472f2 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gridData.ts @@ -0,0 +1,106 @@ +/* eslint-disable prettier/prettier */ +export const gridVertices = new Float32Array([ + // B0 + 0, 1, // 0 + 0, -1, // 1 + // CONNECTOR + 2, 1, // 2 + 2, -1, // 3 + // B1 + 4, 1, // 4 + 4, -1, // 5 + // CONNECTOR + 6, 1, // 6 + 6, -1, // 7 + // B2 + 8, 1, // 8 + 8, -1, // 9, + // CONNECTOR + 10, 1, //10 + 10, -1, //11 + // B3 + 12, 1, //12 + 12, -1, //13 +]); + +// Representing the indice of four bones that can influence each vertex +export const gridJoints = new Uint32Array([ + 0, 0, 0, 0, // Vertex 0 is influenced by bone 0 + 0, 0, 0, 0, // 1 + 0, 1, 0, 0, // 2 + 0, 1, 0, 0, // 3 + 1, 0, 0, 0, // 4 + 1, 0, 0, 0, // 5 + 1, 2, 0, 0, // Vertex 6 is influenced by bone 1 and bone 2 + 1, 2, 0, 0, // 7 + 2, 0, 0, 0, // 8 + 2, 0, 0, 0, // 9 + 1, 2, 3, 0, //10 + 1, 2, 3, 0, //11 + 2, 3, 0, 0, //12 + 2, 3, 0, 0, //13 +]) + +// The weights applied when ve +export const gridWeights = new Float32Array([ + // B0 + 1, 0, 0, 0, // 0 + 1, 0, 0, 0, // 1 + // CONNECTOR + .5, .5, 0, 0, // 2 + .5, .5, 0, 0, // 3 + // B1 + 1, 0, 0, 0, // 4 + 1, 0, 0, 0, // 5 + // CONNECTOR + .5, .5, 0, 0, // 6 + .5, .5, 0, 0, // 7 + // B2 + 1, 0, 0, 0, // 8 + 1, 0, 0, 0, // 9 + // CONNECTOR + .5, .5, 0, 0, // 10 + .5, .5, 0, 0, // 11 + // B3 + 1, 0, 0, 0, // 12 + 1, 0, 0, 0, // 13 +]); + +// Using data above... +// Vertex 0 is influenced by bone 0 with a weight of 1 +// Vertex 1 is influenced by bone 1 with a weight of 1 +// Vertex 2 is influenced by bone 0 and 1 with a weight of 0.5 each +// and so on.. +// Although a vertex can hypothetically be influenced by 4 bones, +// in this example, we stick to each vertex being infleunced by only two +// although there can be downstream effects of parent bones influencing child bones +// that influence their own children + +export const gridIndices = new Uint16Array([ + // B0 + 0, 1, + 0, 2, + 1, 3, + // CONNECTOR + 2, 3, // + 2, 4, + 3, 5, + // B1 + 4, 5, + 4, 6, + 5, 7, + // CONNECTOR + 6, 7, + 6, 8, + 7, 9, + // B2 + 8, 9, + 8, 10, + 9, 11, + // CONNECTOR + 10, 11, + 10, 12, + 11, 13, + // B3 + 12, 13, +]); \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gridUtils.ts b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gridUtils.ts new file mode 100644 index 00000000..01d5cd31 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/gridUtils.ts @@ -0,0 +1,112 @@ +import {gridVertices, gridIndices, gridJoints, gridWeights} from './gridData'; + +// Uses constant grid data to create appropriately sized GPU Buffers for our skinned grid +export const createSkinnedGridBuffers = (device: GPUDevice) => { + // Utility function that creates GPUBuffers from data + const createBuffer = ( + data: Float32Array | Uint32Array, + type: 'f32' | 'u32' + ) => { + const buffer = device.createBuffer({ + size: data.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, + }); + if (type === 'f32') { + new Float32Array(buffer.getMappedRange()).set(data); + } else { + new Uint32Array(buffer.getMappedRange()).set(data); + } + buffer.unmap(); + return buffer; + }; + const positionsBuffer = createBuffer(gridVertices, 'f32'); + const jointsBuffer = createBuffer(gridJoints, 'u32'); + const weightsBuffer = createBuffer(gridWeights, 'f32'); + const indicesBuffer = device.createBuffer({ + size: Uint16Array.BYTES_PER_ELEMENT * gridIndices.length, + usage: GPUBufferUsage.INDEX, + mappedAtCreation: true, + }); + new Uint16Array(indicesBuffer.getMappedRange()).set(gridIndices); + indicesBuffer.unmap(); + + return { + positions: positionsBuffer, + joints: jointsBuffer, + weights: weightsBuffer, + indices: indicesBuffer, + }; +}; + +export const createSkinnedGridRenderPipeline = ( + device: GPUDevice, + presentationFormat: GPUTextureFormat, + vertexShader: string, + fragmentShader: string, + bgLayouts: GPUBindGroupLayout[] +) => { + const pipeline = device.createRenderPipeline({ + label: 'SkinnedGridRenderer', + layout: device.createPipelineLayout({ + label: `SkinnedGridRenderer.pipelineLayout`, + bindGroupLayouts: bgLayouts, + }), + vertex: { + module: device.createShaderModule({ + label: `SkinnedGridRenderer.vertexShader`, + code: vertexShader, + }), + buffers: [ + // Vertex Positions (positions) + { + arrayStride: Float32Array.BYTES_PER_ELEMENT * 2, + attributes: [ + { + format: 'float32x2', + offset: 0, + shaderLocation: 0, + }, + ], + }, + // Bone Indices (joints) + { + arrayStride: Uint32Array.BYTES_PER_ELEMENT * 4, + attributes: [ + { + format: 'uint32x4', + offset: 0, + shaderLocation: 1, + }, + ], + }, + // Bone Weights (weights) + { + arrayStride: Float32Array.BYTES_PER_ELEMENT * 4, + attributes: [ + { + format: 'float32x4', + offset: 0, + shaderLocation: 2, + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + label: `SkinnedGridRenderer.fragmentShader`, + code: fragmentShader, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'line-list', + }, + }); + return pipeline; +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/index.html b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/index.html new file mode 100644 index 00000000..451ac86a --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: skinnedMesh + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/main.ts new file mode 100644 index 00000000..9e202d36 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/main.ts @@ -0,0 +1,556 @@ +import {GUI} from 'dat.gui'; +import {convertGLBToJSONAndBinary, GLTFSkin} from './glbUtils'; +import gltfWGSL from './gltf.wgsl'; +import gridWGSL from './grid.wgsl'; +import {Mat4, mat4, Quat, vec3} from 'wgpu-matrix'; +import {createBindGroupCluster} from '../bitonicSort/utils'; +import { + createSkinnedGridBuffers, + createSkinnedGridRenderPipeline, +} from './gridUtils'; +import {gridIndices} from './gridData'; + +const MAT4X4_BYTES = 64; + +interface BoneObject { + transforms: Mat4[]; + bindPoses: Mat4[]; + bindPosesInv: Mat4[]; +} + +enum RenderMode { + NORMAL, + JOINTS, + WEIGHTS, +} + +enum SkinMode { + ON, + OFF, +} + +// Copied from toji/gl-matrix +const getRotation = (mat: Mat4): Quat => { + // Initialize our output quaternion + const out = [0, 0, 0, 0]; + // Extract the scaling factor from the final matrix transformation + // to normalize our rotation; + const scaling = mat4.getScaling(mat); + const is1 = 1 / scaling[0]; + const is2 = 1 / scaling[1]; + const is3 = 1 / scaling[2]; + + // Scale the matrix elements by the scaling factors + const sm11 = mat[0] * is1; + const sm12 = mat[1] * is2; + const sm13 = mat[2] * is3; + const sm21 = mat[4] * is1; + const sm22 = mat[5] * is2; + const sm23 = mat[6] * is3; + const sm31 = mat[8] * is1; + const sm32 = mat[9] * is2; + const sm33 = mat[10] * is3; + + // The trace of a square matrix is the sum of its diagonal entries + // While the matrix trace has many interesting mathematical properties, + // the primary purpose of the trace is to assess the characteristics of the rotation. + const trace = sm11 + sm22 + sm33; + let S = 0; + + // If all matrix elements contribute equally to the rotation. + if (trace > 0) { + S = Math.sqrt(trace + 1.0) * 2; + out[3] = 0.25 * S; + out[0] = (sm23 - sm32) / S; + out[1] = (sm31 - sm13) / S; + out[2] = (sm12 - sm21) / S; + // If the rotation is primarily around the x-axis + } else if (sm11 > sm22 && sm11 > sm33) { + S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; + out[3] = (sm23 - sm32) / S; + out[0] = 0.25 * S; + out[1] = (sm12 + sm21) / S; + out[2] = (sm31 + sm13) / S; + // If rotation is primarily around the y-axis + } else if (sm22 > sm33) { + S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; + out[3] = (sm31 - sm13) / S; + out[0] = (sm12 + sm21) / S; + out[1] = 0.25 * S; + out[2] = (sm23 + sm32) / S; + // If the rotation is primarily around the z-axis + } else { + S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; + out[3] = (sm12 - sm21) / S; + out[0] = (sm31 + sm13) / S; + out[1] = (sm23 + sm32) / S; + out[2] = 0.25 * S; + } + + return out; +}; + +//Normal setup +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio || 1; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const settings = { + cameraX: 0, + cameraY: -5.1, + cameraZ: -14.6, + objectScale: 1, + angle: 0.2, + speed: 50, + object: 'Whale', + renderMode: 'NORMAL', + skinMode: 'ON', +}; + +const gui = new GUI(); + +// Determine whether we want to render our whale or our skinned grid +gui.add(settings, 'object', ['Whale', 'Skinned Grid']).onChange(() => { + if (settings.object === 'Skinned Grid') { + settings.cameraX = -10; + settings.cameraY = 0; + settings.objectScale = 1.27; + } else { + if (settings.skinMode === 'OFF') { + settings.cameraX = 0; + settings.cameraY = 0; + settings.cameraZ = -11; + } else { + settings.cameraX = 0; + settings.cameraY = -5.1; + settings.cameraZ = -14.6; + } + } +}); + +// Output the mesh normals, its joints, or the weights that influence the movement of the joints +gui + .add(settings, 'renderMode', ['NORMAL', 'JOINTS', 'WEIGHTS']) + .onChange(() => { + device.queue.writeBuffer( + generalUniformsBuffer, + 0, + new Uint32Array([RenderMode[settings.renderMode]]) + ); + }); +// Determine whether the mesh is static or whether skinning is activated +gui.add(settings, 'skinMode', ['ON', 'OFF']).onChange(() => { + if (settings.object === 'Whale') { + if (settings.skinMode === 'OFF') { + settings.cameraX = 0; + settings.cameraY = 0; + settings.cameraZ = -11; + } else { + settings.cameraX = 0; + settings.cameraY = -5.1; + settings.cameraZ = -14.6; + } + } + device.queue.writeBuffer( + generalUniformsBuffer, + 4, + new Uint32Array([SkinMode[settings.skinMode]]) + ); +}); +const animFolder = gui.addFolder('Animation Settings'); +animFolder.add(settings, 'angle', 0.05, 0.5).step(0.05); +animFolder.add(settings, 'speed', 10, 100).step(10); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const cameraBuffer = device.createBuffer({ + size: MAT4X4_BYTES * 3, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const cameraBGCluster = createBindGroupCluster( + [0], + [GPUShaderStage.VERTEX], + ['buffer'], + [{type: 'uniform'}], + [[{buffer: cameraBuffer}]], + 'Camera', + device +); + +const generalUniformsBuffer = device.createBuffer({ + size: Uint32Array.BYTES_PER_ELEMENT * 2, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const generalUniformsBGCLuster = createBindGroupCluster( + [0], + [GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT], + ['buffer'], + [{type: 'uniform'}], + [[{buffer: generalUniformsBuffer}]], + 'General', + device +); + +// Same bindGroupLayout as in main file. +const nodeUniformsBindGroupLayout = device.createBindGroupLayout({ + label: 'NodeUniforms.bindGroupLayout', + entries: [ + { + binding: 0, + buffer: { + type: 'uniform', + }, + visibility: GPUShaderStage.VERTEX, + }, + ], +}); + +// Fetch whale resources from the glb file +const whaleScene = await fetch('../../assets/gltf/whale.glb') + .then((res) => res.arrayBuffer()) + .then((buffer) => convertGLBToJSONAndBinary(buffer, device)); + +// Builds a render pipeline for our whale mesh +// Since we are building a lightweight gltf parser around a gltf scene with a known +// quantity of meshes, we only build a renderPipeline for the singular mesh present +// within our scene. A more robust gltf parser would loop through all the meshes, +// cache replicated pipelines, and perform other optimizations. +whaleScene.meshes[0].buildRenderPipeline( + device, + gltfWGSL, + gltfWGSL, + presentationFormat, + depthTexture.format, + [ + cameraBGCluster.bindGroupLayout, + generalUniformsBGCLuster.bindGroupLayout, + nodeUniformsBindGroupLayout, + GLTFSkin.skinBindGroupLayout, + ] +); + +// Create skinned grid resources +const skinnedGridVertexBuffers = createSkinnedGridBuffers(device); +// Buffer for our uniforms, joints, and inverse bind matrices +const skinnedGridUniformBufferUsage: GPUBufferDescriptor = { + // 5 4x4 matrices, one for each bone + size: MAT4X4_BYTES * 5, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, +}; +const skinnedGridJointUniformBuffer = device.createBuffer( + skinnedGridUniformBufferUsage +); +const skinnedGridInverseBindUniformBuffer = device.createBuffer( + skinnedGridUniformBufferUsage +); +const skinnedGridBoneBGCluster = createBindGroupCluster( + [0, 1], + [GPUShaderStage.VERTEX, GPUShaderStage.VERTEX], + ['buffer', 'buffer'], + [{type: 'read-only-storage'}, {type: 'read-only-storage'}], + [ + [ + {buffer: skinnedGridJointUniformBuffer}, + {buffer: skinnedGridInverseBindUniformBuffer}, + ], + ], + 'SkinnedGridJointUniforms', + device +); +const skinnedGridPipeline = createSkinnedGridRenderPipeline( + device, + presentationFormat, + gridWGSL, + gridWGSL, + [ + cameraBGCluster.bindGroupLayout, + generalUniformsBGCLuster.bindGroupLayout, + skinnedGridBoneBGCluster.bindGroupLayout, + ] +); + +// Global Calc +const aspect = canvas.width / canvas.height; +const perspectiveProjection = mat4.perspective( + (2 * Math.PI) / 5, + aspect, + 0.1, + 100.0 +); + +const orthographicProjection = mat4.ortho(-20, 20, -10, 10, -100, 100); + +function getProjectionMatrix() { + if (settings.object !== 'Skinned Grid') { + return perspectiveProjection as Float32Array; + } + return orthographicProjection as Float32Array; +} + +function getViewMatrix() { + const viewMatrix = mat4.identity(); + if (settings.object === 'Skinned Grid') { + mat4.translate( + viewMatrix, + vec3.fromValues( + settings.cameraX * settings.objectScale, + settings.cameraY * settings.objectScale, + settings.cameraZ + ), + viewMatrix + ); + } else { + mat4.translate( + viewMatrix, + vec3.fromValues(settings.cameraX, settings.cameraY, settings.cameraZ), + viewMatrix + ); + } + return viewMatrix as Float32Array; +} + +function getModelMatrix() { + const modelMatrix = mat4.identity(); + const scaleVector = vec3.fromValues( + settings.objectScale, + settings.objectScale, + settings.objectScale + ); + mat4.scale(modelMatrix, scaleVector, modelMatrix); + if (settings.object === 'Whale') { + mat4.rotateY(modelMatrix, (Date.now() / 1000) * 0.5, modelMatrix); + } + return modelMatrix as Float32Array; +} + +// Pass Descriptor for GLTFs +const gltfRenderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: {r: 0.3, g: 0.3, b: 0.3, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + depthLoadOp: 'clear', + depthClearValue: 1.0, + depthStoreOp: 'store', + }, +}; + +// Pass descriptor for grid with no depth testing +const skinnedGridRenderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: {r: 0.3, g: 0.3, b: 0.3, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], +}; + +const animSkinnedGrid = (boneTransforms: Mat4[], angle: number) => { + const m = mat4.identity(); + mat4.rotateZ(m, angle, boneTransforms[0]); + mat4.translate(boneTransforms[0], vec3.create(4, 0, 0), m); + mat4.rotateZ(m, angle, boneTransforms[1]); + mat4.translate(boneTransforms[1], vec3.create(4, 0, 0), m); + mat4.rotateZ(m, angle, boneTransforms[2]); +}; + +// Create a group of bones +// Each index associates an actual bone to its transforms, bindPoses, uniforms, etc +const createBoneCollection = (numBones: number): BoneObject => { + // Initial bone transformation + const transforms: Mat4[] = []; + // Bone bind poses, an extra matrix per joint/bone that represents the starting point + // of the bone before any transformations are applied + const bindPoses: Mat4[] = []; + // Create a transform, bind pose, and inverse bind pose for each bone + for (let i = 0; i < numBones; i++) { + transforms.push(mat4.identity()); + bindPoses.push(mat4.identity()); + } + + // Get initial bind pose positions + animSkinnedGrid(bindPoses, 0); + const bindPosesInv = bindPoses.map((bindPose) => { + return mat4.inverse(bindPose); + }); + + return { + transforms, + bindPoses, + bindPosesInv, + }; +}; + +// Create bones of the skinned grid and write the inverse bind positions to +// the skinned grid's inverse bind matrix array +const gridBoneCollection = createBoneCollection(5); +for (let i = 0; i < gridBoneCollection.bindPosesInv.length; i++) { + device.queue.writeBuffer( + skinnedGridInverseBindUniformBuffer, + i * 64, + gridBoneCollection.bindPosesInv[i] as Float32Array + ); +} + +// A map that maps a joint index to the original matrix transformation of a bone +const origMatrices = new Map(); +const animWhaleSkin = (skin: GLTFSkin, angle: number) => { + for (let i = 0; i < skin.joints.length; i++) { + // Index into the current joint + const joint = skin.joints[i]; + // If our map does + if (!origMatrices.has(joint)) { + origMatrices.set(joint, whaleScene.nodes[joint].source.getMatrix()); + } + // Get the original position, rotation, and scale of the current joint + const origMatrix = origMatrices.get(joint); + let m = mat4.create(); + // Depending on which bone we are accessing, apply a specific rotation to the bone's original + // transformation to animate it + if (joint === 1 || joint === 0) { + m = mat4.rotateY(origMatrix, -angle); + } else if (joint === 3 || joint === 4) { + m = mat4.rotateX(origMatrix, joint === 3 ? angle : -angle); + } else { + m = mat4.rotateZ(origMatrix, angle); + } + // Apply the current transformation to the transform values within the relevant nodes + // (these nodes, of course, each being nodes that represent joints/bones) + whaleScene.nodes[joint].source.position = mat4.getTranslation(m); + whaleScene.nodes[joint].source.scale = mat4.getScaling(m); + whaleScene.nodes[joint].source.rotation = getRotation(m); + } +}; + +function frame() { + // Calculate camera matrices + const projectionMatrix = getProjectionMatrix(); + const viewMatrix = getViewMatrix(); + const modelMatrix = getModelMatrix(); + + // Calculate bone transformation + const t = (Date.now() / 20000) * settings.speed; + const angle = Math.sin(t) * settings.angle; + // Compute Transforms when angle is applied + animSkinnedGrid(gridBoneCollection.transforms, angle); + + // Write to mvp to camera buffer + device.queue.writeBuffer( + cameraBuffer, + 0, + projectionMatrix.buffer, + projectionMatrix.byteOffset, + projectionMatrix.byteLength + ); + + device.queue.writeBuffer( + cameraBuffer, + 64, + viewMatrix.buffer, + viewMatrix.byteOffset, + viewMatrix.byteLength + ); + + device.queue.writeBuffer( + cameraBuffer, + 128, + modelMatrix.buffer, + modelMatrix.byteOffset, + modelMatrix.byteLength + ); + + // Write to skinned grid bone uniform buffer + for (let i = 0; i < gridBoneCollection.transforms.length; i++) { + device.queue.writeBuffer( + skinnedGridJointUniformBuffer, + i * 64, + gridBoneCollection.transforms[i] as Float32Array + ); + } + + // Difference between these two render passes is just the presence of depthTexture + gltfRenderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + skinnedGridRenderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + // Update node matrixes + for (const scene of whaleScene.scenes) { + scene.root.updateWorldMatrix(device); + } + + // Updates skins (we index into skins in the renderer, which is not the best approach but hey) + animWhaleSkin(whaleScene.skins[0], Math.sin(t) * settings.angle); + // Node 6 should be the only node with a drawable mesh so hopefully this works fine + whaleScene.skins[0].update(device, 6, whaleScene.nodes); + + const commandEncoder = device.createCommandEncoder(); + if (settings.object === 'Whale') { + const passEncoder = commandEncoder.beginRenderPass( + gltfRenderPassDescriptor + ); + for (const scene of whaleScene.scenes) { + scene.root.renderDrawables(passEncoder, [ + cameraBGCluster.bindGroups[0], + generalUniformsBGCLuster.bindGroups[0], + ]); + } + passEncoder.end(); + } else { + // Our skinned grid isn't checking for depth, so we pass it + // a separate render descriptor that does not take in a depth texture + const passEncoder = commandEncoder.beginRenderPass( + skinnedGridRenderPassDescriptor + ); + passEncoder.setPipeline(skinnedGridPipeline); + passEncoder.setBindGroup(0, cameraBGCluster.bindGroups[0]); + passEncoder.setBindGroup(1, generalUniformsBGCLuster.bindGroups[0]); + passEncoder.setBindGroup(2, skinnedGridBoneBGCluster.bindGroups[0]); + // Pass in vertex and index buffers generated from our static skinned grid + // data at ./gridData.ts + passEncoder.setVertexBuffer(0, skinnedGridVertexBuffers.positions); + passEncoder.setVertexBuffer(1, skinnedGridVertexBuffers.joints); + passEncoder.setVertexBuffer(2, skinnedGridVertexBuffers.weights); + passEncoder.setIndexBuffer(skinnedGridVertexBuffers.indices, 'uint16'); + passEncoder.drawIndexed(gridIndices.length, 1); + passEncoder.end(); + } + + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/meta.ts new file mode 100644 index 00000000..4b979505 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/skinnedMesh/meta.ts @@ -0,0 +1,15 @@ +export default { + name: 'Skinned Mesh', + description: + 'A demonstration of basic gltf loading and mesh skinning, ported from https://webgl2fundamentals.org/webgl/lessons/webgl-skinning.html. Mesh data, per vertex attributes, and skin inverseBindMatrices are taken from the json parsed from the binary output of the .glb file. Animations are generated progrmatically, with animated joint matrices updated and passed to shaders per frame via uniform buffers.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'gridData.ts'}, + {path: 'gridUtils.ts'}, + {path: 'grid.wgsl'}, + {path: 'gltf.ts'}, + {path: 'glbUtils.ts'}, + {path: 'gltf.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/spookyball/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/spookyball/meta.ts new file mode 100644 index 00000000..60cf532e --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/spookyball/meta.ts @@ -0,0 +1,10 @@ +export default { + name: 'Spookyball', + description: `This example shows a simple game made with WebGPU. + +Source at https://github.com/toji/spookyball +`, + filename: __DIRNAME__, + url: 'https://spookyball.com', + sources: [], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/index.html b/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/index.html new file mode 100644 index 00000000..311ccaba --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: textRenderingMsdf + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/main.ts new file mode 100644 index 00000000..607734ab --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/main.ts @@ -0,0 +1,329 @@ +import {mat4, vec3} from 'wgpu-matrix'; + +import { + cubeVertexArray, + cubeVertexSize, + cubeUVOffset, + cubePositionOffset, + cubeVertexCount, +} from '../../meshes/cube'; +import {MsdfTextRenderer} from './msdfText'; + +import basicVertWGSL from '../../shaders/basic.vert.wgsl'; +import vertexPositionColorWGSL from '../../shaders/vertexPositionColor.frag.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio || 1; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); +const depthFormat = 'depth24plus'; + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const textRenderer = new MsdfTextRenderer( + device, + presentationFormat, + depthFormat +); +const font = await textRenderer.createFont( + new URL( + '../../assets/font/ya-hei-ascii-msdf.json', + import.meta.url + ).toString() +); + +function getTextTransform( + position: [number, number, number], + rotation?: [number, number, number] +) { + const textTransform = mat4.create(); + mat4.identity(textTransform); + mat4.translate(textTransform, position, textTransform); + if (rotation && rotation[0] != 0) { + mat4.rotateX(textTransform, rotation[0], textTransform); + } + if (rotation && rotation[1] != 0) { + mat4.rotateY(textTransform, rotation[1], textTransform); + } + if (rotation && rotation[2] != 0) { + mat4.rotateZ(textTransform, rotation[2], textTransform); + } + return textTransform; +} + +const textTransforms = [ + getTextTransform([0, 0, 1.1]), + getTextTransform([0, 0, -1.1], [0, Math.PI, 0]), + getTextTransform([1.1, 0, 0], [0, Math.PI / 2, 0]), + getTextTransform([-1.1, 0, 0], [0, -Math.PI / 2, 0]), + getTextTransform([0, 1.1, 0], [-Math.PI / 2, 0, 0]), + getTextTransform([0, -1.1, 0], [Math.PI / 2, 0, 0]), +]; + +const titleText = textRenderer.formatText(font, `WebGPU`, { + centered: true, + pixelScale: 1 / 128, +}); +const largeText = textRenderer.formatText( + font, + ` +WebGPU exposes an API for performing operations, such as rendering +and computation, on a Graphics Processing Unit. + +Graphics Processing Units, or GPUs for short, have been essential +in enabling rich rendering and computational applications in personal +computing. WebGPU is an API that exposes the capabilities of GPU +hardware for the Web. The API is designed from the ground up to +efficiently map to (post-2014) native GPU APIs. WebGPU is not related +to WebGL and does not explicitly target OpenGL ES. + +WebGPU sees physical GPU hardware as GPUAdapters. It provides a +connection to an adapter via GPUDevice, which manages resources, and +the device’s GPUQueues, which execute commands. GPUDevice may have +its own memory with high-speed access to the processing units. +GPUBuffer and GPUTexture are the physical resources backed by GPU +memory. GPUCommandBuffer and GPURenderBundle are containers for +user-recorded commands. GPUShaderModule contains shader code. The +other resources, such as GPUSampler or GPUBindGroup, configure the +way physical resources are used by the GPU. + +GPUs execute commands encoded in GPUCommandBuffers by feeding data +through a pipeline, which is a mix of fixed-function and programmable +stages. Programmable stages execute shaders, which are special +programs designed to run on GPU hardware. Most of the state of a +pipeline is defined by a GPURenderPipeline or a GPUComputePipeline +object. The state not included in these pipeline objects is set +during encoding with commands, such as beginRenderPass() or +setBlendConstant().`, + {pixelScale: 1 / 256} +); + +const text = [ + textRenderer.formatText(font, 'Front', { + centered: true, + pixelScale: 1 / 128, + color: [1, 0, 0, 1], + }), + textRenderer.formatText(font, 'Back', { + centered: true, + pixelScale: 1 / 128, + color: [0, 1, 1, 1], + }), + textRenderer.formatText(font, 'Right', { + centered: true, + pixelScale: 1 / 128, + color: [0, 1, 0, 1], + }), + textRenderer.formatText(font, 'Left', { + centered: true, + pixelScale: 1 / 128, + color: [1, 0, 1, 1], + }), + textRenderer.formatText(font, 'Top', { + centered: true, + pixelScale: 1 / 128, + color: [0, 0, 1, 1], + }), + textRenderer.formatText(font, 'Bottom', { + centered: true, + pixelScale: 1 / 128, + color: [1, 1, 0, 1], + }), + + titleText, + largeText, +]; + +// Create a vertex buffer from the cube data. +const verticesBuffer = device.createBuffer({ + size: cubeVertexArray.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +new Float32Array(verticesBuffer.getMappedRange()).set(cubeVertexArray); +verticesBuffer.unmap(); + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: basicVertWGSL, + }), + buffers: [ + { + arrayStride: cubeVertexSize, + attributes: [ + { + // position + shaderLocation: 0, + offset: cubePositionOffset, + format: 'float32x4', + }, + { + // uv + shaderLocation: 1, + offset: cubeUVOffset, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + code: vertexPositionColorWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + // Backface culling since the cube is solid piece of geometry. + // Faces pointing away from the camera will be occluded by faces + // pointing toward the camera. + cullMode: 'back', + }, + + // Enable depth testing so that the fragment closest to the camera + // is rendered in front. + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: depthFormat, + }, +}); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: depthFormat, + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const uniformBufferSize = 4 * 16; // 4x4 matrix +const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +const uniformBindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + ], +}); + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: [0, 0, 0, 1], + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +const aspect = canvas.width / canvas.height; +const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 100.0); +const modelViewProjectionMatrix = mat4.create(); + +const start = Date.now(); + +function getTransformationMatrix() { + const now = Date.now() / 5000; + const viewMatrix = mat4.identity(); + mat4.translate(viewMatrix, vec3.fromValues(0, 0, -5), viewMatrix); + + const modelMatrix = mat4.identity(); + mat4.translate(modelMatrix, vec3.fromValues(0, 2, -3), modelMatrix); + mat4.rotate( + modelMatrix, + vec3.fromValues(Math.sin(now), Math.cos(now), 0), + 1, + modelMatrix + ); + + // Update the matrix for the cube + mat4.multiply(projectionMatrix, viewMatrix, modelViewProjectionMatrix); + mat4.multiply( + modelViewProjectionMatrix, + modelMatrix, + modelViewProjectionMatrix + ); + + // Update the projection and view matrices for the text + textRenderer.updateCamera(projectionMatrix, viewMatrix); + + // Update the transform of all the text surrounding the cube + const textMatrix = mat4.create(); + for (const [index, transform] of textTransforms.entries()) { + mat4.multiply(modelMatrix, transform, textMatrix); + text[index].setTransform(textMatrix); + } + + // Update the transform of the larger block of text + const crawl = ((Date.now() - start) / 2500) % 14; + mat4.identity(textMatrix); + mat4.rotateX(textMatrix, -Math.PI / 8, textMatrix); + mat4.translate(textMatrix, [0, crawl - 3, 0], textMatrix); + titleText.setTransform(textMatrix); + mat4.translate(textMatrix, [-3, -0.1, 0], textMatrix); + largeText.setTransform(textMatrix); + + return modelViewProjectionMatrix as Float32Array; +} + +function frame() { + const transformationMatrix = getTransformationMatrix(); + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix.buffer, + transformationMatrix.byteOffset, + transformationMatrix.byteLength + ); + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.setBindGroup(0, uniformBindGroup); + passEncoder.setVertexBuffer(0, verticesBuffer); + passEncoder.draw(cubeVertexCount, 1, 0, 0); + + textRenderer.render(passEncoder, ...text); + + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/meta.ts new file mode 100644 index 00000000..b5b07c7b --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/meta.ts @@ -0,0 +1,18 @@ +export default { + name: 'Text Rendering - MSDF', + description: `This example uses multichannel signed distance fields (MSDF) to render text. MSDF +fonts are more complex to implement than using Canvas 2D to generate text, but the resulting +text looks smoother while using less memory than the Canvas 2D approach, especially at high +zoom levels. They can be used to render larger amounts of text efficiently. + +The font texture is generated using [Don McCurdy's MSDF font generation tool](https://msdf-bmfont.donmccurdy.com/)`, + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'msdfText.ts'}, + {path: 'msdfText.wgsl'}, + {path: '../../shaders/basic.vert.wgsl'}, + {path: '../../shaders/vertexPositionColor.frag.wgsl'}, + {path: '../../meshes/cube.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/msdfText.ts b/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/msdfText.ts new file mode 100644 index 00000000..63f0d218 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/msdfText.ts @@ -0,0 +1,514 @@ +import {mat4} from 'wgpu-matrix'; + +import msdfTextWGSL from './msdfText.wgsl'; + +type Mat4 = mat4.default; + +// The kerning map stores a spare map of character ID pairs with an associated +// X offset that should be applied to the character spacing when the second +// character ID is rendered after the first. +type KerningMap = Map>; + +interface MsdfChar { + id: number; + index: number; + char: string; + width: number; + height: number; + xoffset: number; + yofsset: number; + xadvance: number; + chnl: number; + x: number; + y: number; + page: number; + charIndex: number; +} + +export class MsdfFont { + charCount: number; + defaultChar: MsdfChar; + + constructor( + public pipeline: GPURenderPipeline, + public bindGroup: GPUBindGroup, + public lineHeight: number, + public chars: { [x: number]: MsdfChar }, + public kernings: KerningMap + ) { + const charArray = Object.values(chars); + this.charCount = charArray.length; + this.defaultChar = charArray[0]; + } + + getChar(charCode: number): MsdfChar { + let char = this.chars[charCode]; + if (!char) { + char = this.defaultChar; + } + return char; + } + + // Gets the distance in pixels a line should advance for a given character code. If the upcoming + // character code is given any kerning between the two characters will be taken into account. + getXAdvance(charCode: number, nextCharCode: number = -1): number { + const char = this.getChar(charCode); + if (nextCharCode >= 0) { + const kerning = this.kernings.get(charCode); + if (kerning) { + return char.xadvance + (kerning.get(nextCharCode) ?? 0); + } + } + return char.xadvance; + } +} + +export interface MsdfTextMeasurements { + width: number; + height: number; + lineWidths: number[]; + printedCharCount: number; +} + +export class MsdfText { + private bufferArray = new Float32Array(24); + private bufferArrayDirty = true; + + constructor( + public device: GPUDevice, + private renderBundle: GPURenderBundle, + public measurements: MsdfTextMeasurements, + public font: MsdfFont, + public textBuffer: GPUBuffer + ) { + mat4.identity(this.bufferArray); + this.setColor(1, 1, 1, 1); + this.setPixelScale(1 / 512); + this.bufferArrayDirty = true; + } + + getRenderBundle() { + if (this.bufferArrayDirty) { + this.bufferArrayDirty = false; + this.device.queue.writeBuffer( + this.textBuffer, + 0, + this.bufferArray, + 0, + this.bufferArray.length + ); + } + return this.renderBundle; + } + + setTransform(matrix: Mat4) { + mat4.copy(matrix, this.bufferArray); + this.bufferArrayDirty = true; + } + + setColor(r: number, g: number, b: number, a: number = 1.0) { + this.bufferArray[16] = r; + this.bufferArray[17] = g; + this.bufferArray[18] = b; + this.bufferArray[19] = a; + this.bufferArrayDirty = true; + } + + setPixelScale(pixelScale: number) { + this.bufferArray[20] = pixelScale; + this.bufferArrayDirty = true; + } +} + +export interface MsdfTextFormattingOptions { + centered?: boolean; + pixelScale?: number; + color?: [number, number, number, number]; +} + +export class MsdfTextRenderer { + fontBindGroupLayout: GPUBindGroupLayout; + textBindGroupLayout: GPUBindGroupLayout; + pipelinePromise: Promise; + sampler: GPUSampler; + cameraUniformBuffer: GPUBuffer; + + renderBundleDescriptor: GPURenderBundleEncoderDescriptor; + cameraArray: Float32Array = new Float32Array(16 * 2); + + constructor( + public device: GPUDevice, + colorFormat: GPUTextureFormat, + depthFormat: GPUTextureFormat + ) { + this.renderBundleDescriptor = { + colorFormats: [colorFormat], + depthStencilFormat: depthFormat, + }; + + this.sampler = device.createSampler({ + label: 'MSDF text sampler', + minFilter: 'linear', + magFilter: 'linear', + mipmapFilter: 'linear', + maxAnisotropy: 16, + }); + + this.cameraUniformBuffer = device.createBuffer({ + label: 'MSDF camera uniform buffer', + size: this.cameraArray.byteLength, + usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.UNIFORM, + }); + + this.fontBindGroupLayout = device.createBindGroupLayout({ + label: 'MSDF font group layout', + entries: [ + { + binding: 0, + visibility: GPUShaderStage.FRAGMENT, + texture: {}, + }, + { + binding: 1, + visibility: GPUShaderStage.FRAGMENT, + sampler: {}, + }, + { + binding: 2, + visibility: GPUShaderStage.VERTEX, + buffer: {type: 'read-only-storage'}, + }, + ], + }); + + this.textBindGroupLayout = device.createBindGroupLayout({ + label: 'MSDF text group layout', + entries: [ + { + binding: 0, + visibility: GPUShaderStage.VERTEX, + buffer: {}, + }, + { + binding: 1, + visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, + buffer: {type: 'read-only-storage'}, + }, + ], + }); + + const shaderModule = device.createShaderModule({ + label: 'MSDF text shader', + code: msdfTextWGSL, + }); + + this.pipelinePromise = device.createRenderPipelineAsync({ + label: `msdf text pipeline`, + layout: device.createPipelineLayout({ + bindGroupLayouts: [this.fontBindGroupLayout, this.textBindGroupLayout], + }), + vertex: { + module: shaderModule, + entryPoint: 'vertexMain', + }, + fragment: { + module: shaderModule, + entryPoint: 'fragmentMain', + targets: [ + { + format: colorFormat, + blend: { + color: { + srcFactor: 'src-alpha', + dstFactor: 'one-minus-src-alpha', + }, + alpha: { + srcFactor: 'one', + dstFactor: 'one', + }, + }, + }, + ], + }, + primitive: { + topology: 'triangle-strip', + stripIndexFormat: 'uint32', + }, + depthStencil: { + depthWriteEnabled: false, + depthCompare: 'less', + format: depthFormat, + }, + }); + } + + async loadTexture(url: string) { + const response = await fetch(url); + const imageBitmap = await createImageBitmap(await response.blob()); + + const texture = this.device.createTexture({ + label: `MSDF font texture ${url}`, + size: [imageBitmap.width, imageBitmap.height, 1], + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + this.device.queue.copyExternalImageToTexture( + {source: imageBitmap}, + {texture}, + [imageBitmap.width, imageBitmap.height] + ); + return texture; + } + + async createFont(fontJsonUrl: string): Promise { + const response = await fetch(fontJsonUrl); + const json = await response.json(); + + const i = fontJsonUrl.lastIndexOf('/'); + const baseUrl = i !== -1 ? fontJsonUrl.substring(0, i + 1) : undefined; + + const pagePromises = []; + for (const pageUrl of json.pages) { + pagePromises.push(this.loadTexture(baseUrl + pageUrl)); + } + + const charCount = json.chars.length; + const charsBuffer = this.device.createBuffer({ + label: 'MSDF character layout buffer', + size: charCount * Float32Array.BYTES_PER_ELEMENT * 8, + usage: GPUBufferUsage.STORAGE, + mappedAtCreation: true, + }); + + const charsArray = new Float32Array(charsBuffer.getMappedRange()); + + const u = 1 / json.common.scaleW; + const v = 1 / json.common.scaleH; + + const chars: { [x: number]: MsdfChar } = {}; + + let offset = 0; + for (const [i, char] of json.chars.entries()) { + chars[char.id] = char; + chars[char.id].charIndex = i; + charsArray[offset] = char.x * u; // texOffset.x + charsArray[offset + 1] = char.y * v; // texOffset.y + charsArray[offset + 2] = char.width * u; // texExtent.x + charsArray[offset + 3] = char.height * v; // texExtent.y + charsArray[offset + 4] = char.width; // size.x + charsArray[offset + 5] = char.height; // size.y + charsArray[offset + 6] = char.xoffset; // offset.x + charsArray[offset + 7] = -char.yoffset; // offset.y + offset += 8; + } + + charsBuffer.unmap(); + + const pageTextures = await Promise.all(pagePromises); + + const bindGroup = this.device.createBindGroup({ + label: 'msdf font bind group', + layout: this.fontBindGroupLayout, + entries: [ + { + binding: 0, + // TODO: Allow multi-page fonts + resource: pageTextures[0].createView(), + }, + { + binding: 1, + resource: this.sampler, + }, + { + binding: 2, + resource: {buffer: charsBuffer}, + }, + ], + }); + + const kernings = new Map(); + + if (json.kernings) { + for (const kearning of json.kernings) { + let charKerning = kernings.get(kearning.first); + if (!charKerning) { + charKerning = new Map(); + kernings.set(kearning.first, charKerning); + } + charKerning.set(kearning.second, kearning.amount); + } + } + + return new MsdfFont( + await this.pipelinePromise, + bindGroup, + json.common.lineHeight, + chars, + kernings + ); + } + + formatText( + font: MsdfFont, + text: string, + options: MsdfTextFormattingOptions = {} + ): MsdfText { + const textBuffer = this.device.createBuffer({ + label: 'msdf text buffer', + size: (text.length + 6) * Float32Array.BYTES_PER_ELEMENT * 4, + usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST, + mappedAtCreation: true, + }); + + const textArray = new Float32Array(textBuffer.getMappedRange()); + let offset = 24; // Accounts for the values managed by MsdfText internally. + + let measurements: MsdfTextMeasurements; + if (options.centered) { + measurements = this.measureText(font, text); + + this.measureText( + font, + text, + (textX: number, textY: number, line: number, char: MsdfChar) => { + const lineOffset = + measurements.width * -0.5 - + (measurements.width - measurements.lineWidths[line]) * -0.5; + + textArray[offset] = textX + lineOffset; + textArray[offset + 1] = textY + measurements.height * 0.5; + textArray[offset + 2] = char.charIndex; + offset += 4; + } + ); + } else { + measurements = this.measureText( + font, + text, + (textX: number, textY: number, line: number, char: MsdfChar) => { + textArray[offset] = textX; + textArray[offset + 1] = textY; + textArray[offset + 2] = char.charIndex; + offset += 4; + } + ); + } + + textBuffer.unmap(); + + const bindGroup = this.device.createBindGroup({ + label: 'msdf text bind group', + layout: this.textBindGroupLayout, + entries: [ + { + binding: 0, + resource: {buffer: this.cameraUniformBuffer}, + }, + { + binding: 1, + resource: {buffer: textBuffer}, + }, + ], + }); + + const encoder = this.device.createRenderBundleEncoder( + this.renderBundleDescriptor + ); + encoder.setPipeline(font.pipeline); + encoder.setBindGroup(0, font.bindGroup); + encoder.setBindGroup(1, bindGroup); + encoder.draw(4, measurements.printedCharCount); + const renderBundle = encoder.finish(); + + const msdfText = new MsdfText( + this.device, + renderBundle, + measurements, + font, + textBuffer + ); + if (options.pixelScale !== undefined) { + msdfText.setPixelScale(options.pixelScale); + } + + if (options.color !== undefined) { + msdfText.setColor(...options.color); + } + + return msdfText; + } + + measureText( + font: MsdfFont, + text: string, + charCallback?: (x: number, y: number, line: number, char: MsdfChar) => void + ): MsdfTextMeasurements { + let maxWidth = 0; + const lineWidths: number[] = []; + + let textOffsetX = 0; + let textOffsetY = 0; + let line = 0; + let printedCharCount = 0; + let nextCharCode = text.charCodeAt(0); + for (let i = 0; i < text.length; ++i) { + const charCode = nextCharCode; + nextCharCode = i < text.length - 1 ? text.charCodeAt(i + 1) : -1; + + switch (charCode) { + case 10: // Newline + lineWidths.push(textOffsetX); + line++; + maxWidth = Math.max(maxWidth, textOffsetX); + textOffsetX = 0; + textOffsetY -= font.lineHeight; + case 13: // CR + break; + case 32: // Space + // For spaces, advance the offset without actually adding a character. + textOffsetX += font.getXAdvance(charCode); + break; + default: { + if (charCallback) { + charCallback( + textOffsetX, + textOffsetY, + line, + font.getChar(charCode) + ); + } + textOffsetX += font.getXAdvance(charCode, nextCharCode); + printedCharCount++; + } + } + } + + lineWidths.push(textOffsetX); + maxWidth = Math.max(maxWidth, textOffsetX); + + return { + width: maxWidth, + height: lineWidths.length * font.lineHeight, + lineWidths, + printedCharCount, + }; + } + + updateCamera(projection: Mat4, view: Mat4) { + this.cameraArray.set(projection, 0); + this.cameraArray.set(view, 16); + this.device.queue.writeBuffer( + this.cameraUniformBuffer, + 0, + this.cameraArray + ); + } + + render(renderPass: GPURenderPassEncoder, ...text: MsdfText[]) { + const renderBundles = text.map((t) => t.getRenderBundle()); + renderPass.executeBundles(renderBundles); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/msdfText.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/msdfText.wgsl new file mode 100644 index 00000000..87dfeb36 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/textRenderingMsdf/msdfText.wgsl @@ -0,0 +1,79 @@ +// Positions for simple quad geometry +const pos = array(vec2f(0, -1), vec2f(1, -1), vec2f(0, 0), vec2f(1, 0)); + +struct VertexInput { + @builtin(vertex_index) vertex : u32, + @builtin(instance_index) instance : u32, +}; + +struct VertexOutput { + @builtin(position) position : vec4f, + @location(0) texcoord : vec2f, +}; + +struct Char { + texOffset: vec2f, + texExtent: vec2f, + size: vec2f, + offset: vec2f, +}; + +struct FormattedText { + transform: mat4x4f, + color: vec4f, + scale: f32, + chars: array, +}; + +struct Camera { + projection: mat4x4f, + view: mat4x4f, +}; + +// Font bindings +@group(0) @binding(0) var fontTexture: texture_2d; +@group(0) @binding(1) var fontSampler: sampler; +@group(0) @binding(2) var chars: array; + +// Text bindings +@group(1) @binding(0) var camera: Camera; +@group(1) @binding(1) var text: FormattedText; + +@vertex +fn vertexMain(input : VertexInput) -> VertexOutput { + let textElement = text.chars[input.instance]; + let char = chars[u32(textElement.z)]; + let charPos = (pos[input.vertex] * char.size + textElement.xy + char.offset) * text.scale; + + var output : VertexOutput; + output.position = camera.projection * camera.view * text.transform * vec4f(charPos, 0, 1); + + output.texcoord = pos[input.vertex] * vec2f(1, -1); + output.texcoord *= char.texExtent; + output.texcoord += char.texOffset; + return output; +} + +fn sampleMsdf(texcoord: vec2f) -> f32 { + let c = textureSample(fontTexture, fontSampler, texcoord); + return max(min(c.r, c.g), min(max(c.r, c.g), c.b)); +} + +// Antialiasing technique from https://drewcassidy.me/2020/06/26/sdf-antialiasing/ +@fragment +fn fragmentMain(input : VertexOutput) -> @location(0) vec4f { + let dist = 0.5 - sampleMsdf(input.texcoord); + + // sdf distance per pixel (gradient vector) + let ddist = vec2f(dpdx(dist), dpdy(dist)); + + // distance to edge in pixels (scalar) + let pixelDist = dist / length(ddist); + + let alpha = saturate(0.5 - pixelDist); + if (alpha < 0.001) { + discard; + } + + return vec4f(text.color.rgb, text.color.a * alpha); +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/index.html b/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/index.html new file mode 100644 index 00000000..100aa9a0 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: texturedCube + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/main.ts new file mode 100644 index 00000000..500c63ad --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/main.ts @@ -0,0 +1,217 @@ +import {mat4, vec3} from 'wgpu-matrix'; + +import { + cubeVertexArray, + cubeVertexSize, + cubeUVOffset, + cubePositionOffset, + cubeVertexCount, +} from '../../meshes/cube'; + +import basicVertWGSL from '../../shaders/basic.vert.wgsl'; +import sampleTextureMixColorWGSL from './sampleTextureMixColor.frag.wgsl'; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const context = canvas.getContext('webgpu') as GPUCanvasContext; + +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +// Create a vertex buffer from the cube data. +const verticesBuffer = device.createBuffer({ + size: cubeVertexArray.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, +}); +new Float32Array(verticesBuffer.getMappedRange()).set(cubeVertexArray); +verticesBuffer.unmap(); + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: basicVertWGSL, + }), + buffers: [ + { + arrayStride: cubeVertexSize, + attributes: [ + { + // position + shaderLocation: 0, + offset: cubePositionOffset, + format: 'float32x4', + }, + { + // uv + shaderLocation: 1, + offset: cubeUVOffset, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + code: sampleTextureMixColorWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + + // Backface culling since the cube is solid piece of geometry. + // Faces pointing away from the camera will be occluded by faces + // pointing toward the camera. + cullMode: 'back', + }, + + // Enable depth testing so that the fragment closest to the camera + // is rendered in front. + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus', + }, +}); + +const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, +}); + +const uniformBufferSize = 4 * 16; // 4x4 matrix +const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, +}); + +// Fetch the image and upload it into a GPUTexture. +let cubeTexture: GPUTexture; +{ + const response = await fetch('../../assets/img/Di-3d.png'); + const imageBitmap = await createImageBitmap(await response.blob()); + + cubeTexture = device.createTexture({ + size: [imageBitmap.width, imageBitmap.height, 1], + format: 'rgba8unorm', + usage: + GPUTextureUsage.TEXTURE_BINDING | + GPUTextureUsage.COPY_DST | + GPUTextureUsage.RENDER_ATTACHMENT, + }); + device.queue.copyExternalImageToTexture( + {source: imageBitmap}, + {texture: cubeTexture}, + [imageBitmap.width, imageBitmap.height] + ); +} + +// Create a sampler with linear filtering for smooth interpolation. +const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', +}); + +const uniformBindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + { + binding: 1, + resource: sampler, + }, + { + binding: 2, + resource: cubeTexture.createView(), + }, + ], +}); + +const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: {r: 0.5, g: 0.5, b: 0.5, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, +}; + +const aspect = canvas.width / canvas.height; +const projectionMatrix = mat4.perspective((2 * Math.PI) / 5, aspect, 1, 100.0); +const modelViewProjectionMatrix = mat4.create(); + +function getTransformationMatrix() { + const viewMatrix = mat4.identity(); + mat4.translate(viewMatrix, vec3.fromValues(0, 0, -4), viewMatrix); + const now = Date.now() / 1000; + mat4.rotate( + viewMatrix, + vec3.fromValues(Math.sin(now), Math.cos(now), 0), + 1, + viewMatrix + ); + + mat4.multiply(projectionMatrix, viewMatrix, modelViewProjectionMatrix); + + return modelViewProjectionMatrix as Float32Array; +} + +function frame() { + const transformationMatrix = getTransformationMatrix(); + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix.buffer, + transformationMatrix.byteOffset, + transformationMatrix.byteLength + ); + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.setBindGroup(0, uniformBindGroup); + passEncoder.setVertexBuffer(0, verticesBuffer); + passEncoder.draw(cubeVertexCount); + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); +} + +requestAnimationFrame(frame); diff --git a/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/meta.ts new file mode 100644 index 00000000..eee91d43 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/meta.ts @@ -0,0 +1,11 @@ +export default { + name: 'Textured Cube', + description: 'This example shows how to bind and sample textures.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: '../../shaders/basic.vert.wgsl'}, + {path: 'sampleTextureMixColor.frag.wgsl'}, + {path: '../../meshes/cube.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/sampleTextureMixColor.frag.wgsl b/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/sampleTextureMixColor.frag.wgsl new file mode 100644 index 00000000..8f0165c3 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/texturedCube/sampleTextureMixColor.frag.wgsl @@ -0,0 +1,10 @@ +@group(0) @binding(1) var mySampler: sampler; +@group(0) @binding(2) var myTexture: texture_2d; + +@fragment +fn main( + @location(0) fragUV: vec2f, + @location(1) fragPosition: vec4f +) -> @location(0) vec4f { + return textureSample(myTexture, mySampler, fragUV) * fragPosition; +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/tsconfig.json b/bindings/wgpu/webgpu-samples-ts/sample/tsconfig.json new file mode 100644 index 00000000..0e2819ad --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "outDir": "../out/sample", + "rootDir": "../", + "moduleResolution": "Node", + "allowJs": true, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "isolatedModules": true, + "typeRoots": [ + "../node_modules/@webgpu/types", + "../node_modules/@types" + ] + }, + "include": [ + "../**/*.ts" + ], + "exclude": [ + "../out", + "../node_modules" + ] +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/sample/twoCubes/index.html b/bindings/wgpu/webgpu-samples-ts/sample/twoCubes/index.html new file mode 100644 index 00000000..c4e0c18d --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/twoCubes/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: twoCubes + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/twoCubes/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/twoCubes/main.ts new file mode 100644 index 00000000..9c591f5c --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/twoCubes/main.ts @@ -0,0 +1,8 @@ +import {io} from "../../out/kotlin-libs/wgpu-webgpu-samples-ts"; +import SceneClass = io.ygdrasil.wgpu.examples.scenes.basic.TwoCubesScene; +import jsApplication = io.ygdrasil.wgpu.examples.jsApplication; + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const application = await jsApplication(canvas) +application.changeScene(new SceneClass()) +application.run() diff --git a/bindings/wgpu/webgpu-samples-ts/sample/twoCubes/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/twoCubes/meta.ts new file mode 100644 index 00000000..946a7a77 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/twoCubes/meta.ts @@ -0,0 +1,15 @@ +export default { + name: 'Two Cubes', + description: + 'This example shows some of the alignment requirements \ + involved when updating and binding multiple slices of a \ + uniform buffer. It renders two rotating cubes which have transform \ + matrices at different offsets in a uniform buffer.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: '../../shaders/basic.vert.wgsl'}, + {path: '../../shaders/vertexPositionColor.frag.wgsl'}, + {path: '../../meshes/cube.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/index.html b/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/index.html new file mode 100644 index 00000000..0d1d5a15 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: videoUploading + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/main.ts new file mode 100644 index 00000000..3da2187b --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/main.ts @@ -0,0 +1,125 @@ +import {GUI} from 'dat.gui'; +import fullscreenTexturedQuadWGSL from '../../shaders/fullscreenTexturedQuad.wgsl'; +import sampleExternalTextureWGSL from '../../shaders/sampleExternalTexture.frag.wgsl'; + +// Set video element +const video = document.createElement('video'); +video.loop = true; +video.autoplay = true; +video.muted = true; +video.src = '../../assets/video/pano.webm'; +await video.play(); + +const adapter = await navigator.gpu.requestAdapter(); +const device = await adapter.requestDevice(); + +const canvas = document.querySelector('canvas') as HTMLCanvasElement; +const context = canvas.getContext('webgpu') as GPUCanvasContext; +const devicePixelRatio = window.devicePixelRatio; +canvas.width = canvas.clientWidth * devicePixelRatio; +canvas.height = canvas.clientHeight * devicePixelRatio; +const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + +context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', +}); + +const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: fullscreenTexturedQuadWGSL, + }), + }, + fragment: { + module: device.createShaderModule({ + code: sampleExternalTextureWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, +}); + +const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', +}); + +const params = new URLSearchParams(window.location.search); +const settings = { + requestFrame: 'requestAnimationFrame', + videoSource: params.get('videoSource') || 'videoElement', +}; + +const gui = new GUI(); +gui.add(settings, 'videoSource', ['videoElement', 'videoFrame']); +gui.add(settings, 'requestFrame', [ + 'requestAnimationFrame', + 'requestVideoFrameCallback', +]); + +function frame() { + const externalTextureSource = + settings.videoSource === 'videoFrame' ? new VideoFrame(video) : video; + + const uniformBindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 1, + resource: sampler, + }, + { + binding: 2, + resource: device.importExternalTexture({ + source: externalTextureSource, + }), + }, + ], + }); + + const commandEncoder = device.createCommandEncoder(); + const textureView = context.getCurrentTexture().createView(); + + const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: textureView, + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + }; + + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.setBindGroup(0, uniformBindGroup); + passEncoder.draw(6); + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + if (externalTextureSource instanceof VideoFrame) { + externalTextureSource.close(); + } + + if (settings.requestFrame == 'requestVideoFrameCallback') { + video.requestVideoFrameCallback(frame); + } else { + requestAnimationFrame(frame); + } +} + +if (settings.requestFrame == 'requestVideoFrameCallback') { + video.requestVideoFrameCallback(frame); +} else { + requestAnimationFrame(frame); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/meta.ts new file mode 100644 index 00000000..3a51079a --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/meta.ts @@ -0,0 +1,10 @@ +export default { + name: 'Video Uploading', + description: 'This example shows how to upload video frame to WebGPU.', + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: '../../shaders/fullscreenTexturedQuad.wgsl'}, + {path: '../../shaders/sampleExternalTexture.frag.wgsl'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/video.ts b/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/video.ts new file mode 100644 index 00000000..eb578554 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/videoUploading/video.ts @@ -0,0 +1,126 @@ +import {GUI} from 'dat.gui'; +import fullscreenTexturedQuadWGSL from '../../shaders/fullscreenTexturedQuad.wgsl'; +import sampleExternalTextureWGSL from '../../shaders/sampleExternalTexture.frag.wgsl'; + +export default async function ({useVideoFrame}: { useVideoFrame: boolean }) { + // Set video element + const video = document.createElement('video'); + video.loop = true; + video.autoplay = true; + video.muted = true; + video.src = '../../assets/video/pano.webm'; + await video.play(); + + const adapter = await navigator.gpu.requestAdapter(); + const device = await adapter.requestDevice(); + + const canvas = document.querySelector('canvas') as HTMLCanvasElement; + const context = canvas.getContext('webgpu') as GPUCanvasContext; + const devicePixelRatio = window.devicePixelRatio; + canvas.width = canvas.clientWidth * devicePixelRatio; + canvas.height = canvas.clientHeight * devicePixelRatio; + const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + + context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', + }); + + const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: fullscreenTexturedQuadWGSL, + }), + }, + fragment: { + module: device.createShaderModule({ + code: sampleExternalTextureWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + }, + }); + + const sampler = device.createSampler({ + magFilter: 'linear', + minFilter: 'linear', + }); + + const settings = { + requestFrame: 'requestAnimationFrame', + videoSource: useVideoFrame ? 'videoFrame' : 'videoElement', + }; + + const gui = new GUI(); + gui.add(settings, 'videoSource', ['videoElement', 'videoFrame']); + gui.add(settings, 'requestFrame', [ + 'requestAnimationFrame', + 'requestVideoFrameCallback', + ]); + + function frame() { + const externalTextureSource = + settings.videoSource === 'videoFrame' ? new VideoFrame(video) : video; + + const uniformBindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 1, + resource: sampler, + }, + { + binding: 2, + resource: device.importExternalTexture({ + source: externalTextureSource, + }), + }, + ], + }); + + const commandEncoder = device.createCommandEncoder(); + const textureView = context.getCurrentTexture().createView(); + + const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: textureView, + clearValue: {r: 0.0, g: 0.0, b: 0.0, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + }; + + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.setBindGroup(0, uniformBindGroup); + passEncoder.draw(6); + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + if (externalTextureSource instanceof VideoFrame) { + externalTextureSource.close(); + } + + if (settings.requestFrame == 'requestVideoFrameCallback') { + video.requestVideoFrameCallback(frame); + } else { + requestAnimationFrame(frame); + } + } + + if (settings.requestFrame == 'requestVideoFrameCallback') { + video.requestVideoFrameCallback(frame); + } else { + requestAnimationFrame(frame); + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/worker/index.html b/bindings/wgpu/webgpu-samples-ts/sample/worker/index.html new file mode 100644 index 00000000..d54cbd05 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/worker/index.html @@ -0,0 +1,28 @@ + + + + + + webgpu-samples: worker + + + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/sample/worker/main.ts b/bindings/wgpu/webgpu-samples-ts/sample/worker/main.ts new file mode 100644 index 00000000..32a8921f --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/worker/main.ts @@ -0,0 +1,41 @@ +const canvas = document.querySelector('canvas') as HTMLCanvasElement; + +// The web worker is created by passing a path to the worker's source file, which will then be +// executed on a separate thread. +const worker = new Worker(new URL('./worker.js', import.meta.url)); + +// The primary way to communicate with the worker is to send and receive messages. +worker.addEventListener('message', (ev) => { + // The format of the message can be whatever you'd like, but it's helpful to decide on a + // consistent convention so that you can tell the message types apart as your apps grow in + // complexity. Here we establish a convention that all messages to and from the worker will + // have a `type` field that we can use to determine the content of the message. + switch (ev.data.type) { + default: { + console.error(`Unknown Message Type: ${ev.data.type}`); + } + } +}); + +try { + // In order for the worker to display anything on the page, an OffscreenCanvas must be used. + // Here we can create one from our normal canvas by calling transferControlToOffscreen(). + // Anything drawn to the OffscreenCanvas that call returns will automatically be displayed on + // the source canvas on the page. + const offscreenCanvas = canvas.transferControlToOffscreen(); + const devicePixelRatio = window.devicePixelRatio; + offscreenCanvas.width = canvas.clientWidth * devicePixelRatio; + offscreenCanvas.height = canvas.clientHeight * devicePixelRatio; + + // Send a message to the worker telling it to initialize WebGPU with the OffscreenCanvas. The + // array passed as the second argument here indicates that the OffscreenCanvas is to be + // transferred to the worker, meaning this main thread will lose access to it and it will be + // fully owned by the worker. + worker.postMessage({type: 'init', offscreenCanvas}, [offscreenCanvas]); +} catch (err) { + // TODO: This catch is added here because React will call init twice with the same canvas, and + // the second time will fail the transferControlToOffscreen() because it's already been + // transferred. I'd love to know how to get around that. + console.warn(err.message); + worker.terminate(); +} diff --git a/bindings/wgpu/webgpu-samples-ts/sample/worker/meta.ts b/bindings/wgpu/webgpu-samples-ts/sample/worker/meta.ts new file mode 100644 index 00000000..b118a9d1 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/worker/meta.ts @@ -0,0 +1,14 @@ +export default { + name: 'WebGPU in a Worker', + description: `This example shows one method of using WebGPU in a web worker and presenting to + the main thread. It uses canvas.transferControlToOffscreen() to produce an offscreen canvas + which is then transferred to the worker where all the WebGPU calls are made.`, + filename: __DIRNAME__, + sources: [ + {path: 'main.ts'}, + {path: 'worker.ts'}, + {path: '../../shaders/basic.vert.wgsl'}, + {path: '../../shaders/vertexPositionColor.frag.wgsl'}, + {path: '../../meshes/cube.ts'}, + ], +}; diff --git a/bindings/wgpu/webgpu-samples-ts/sample/worker/worker.ts b/bindings/wgpu/webgpu-samples-ts/sample/worker/worker.ts new file mode 100644 index 00000000..808f11d3 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/sample/worker/worker.ts @@ -0,0 +1,212 @@ +import {mat4, vec3} from 'wgpu-matrix'; + +import { + cubeVertexArray, + cubeVertexSize, + cubeUVOffset, + cubePositionOffset, + cubeVertexCount, +} from '../../meshes/cube'; + +import basicVertWGSL from '../../shaders/basic.vert.wgsl'; +import vertexPositionColorWGSL from '../../shaders/vertexPositionColor.frag.wgsl'; + +// The worker process can instantiate a WebGPU device immediately, but it still needs an +// OffscreenCanvas to be able to display anything. Here we listen for an 'init' message from the +// main thread that will contain an OffscreenCanvas transferred from the page, and use that as the +// signal to begin WebGPU initialization. +self.addEventListener('message', (ev) => { + switch (ev.data.type) { + case 'init': { + try { + init(ev.data.offscreenCanvas); + } catch (err) { + console.error( + `Error while initializing WebGPU in worker process: ${err.message}` + ); + } + break; + } + } +}); + +// Once we receive the OffscreenCanvas this init() function is called, which functions similarly +// to the init() method for all the other samples. The remainder of this file is largely identical +// to the rotatingCube sample. +async function init(canvas) { + const adapter = await navigator.gpu.requestAdapter(); + const device = await adapter.requestDevice(); + const context = canvas.getContext('webgpu'); + + const presentationFormat = navigator.gpu.getPreferredCanvasFormat(); + + context.configure({ + device, + format: presentationFormat, + alphaMode: 'premultiplied', + }); + + // Create a vertex buffer from the cube data. + const verticesBuffer = device.createBuffer({ + size: cubeVertexArray.byteLength, + usage: GPUBufferUsage.VERTEX, + mappedAtCreation: true, + }); + new Float32Array(verticesBuffer.getMappedRange()).set(cubeVertexArray); + verticesBuffer.unmap(); + + const pipeline = device.createRenderPipeline({ + layout: 'auto', + vertex: { + module: device.createShaderModule({ + code: basicVertWGSL, + }), + buffers: [ + { + arrayStride: cubeVertexSize, + attributes: [ + { + // position + shaderLocation: 0, + offset: cubePositionOffset, + format: 'float32x4', + }, + { + // uv + shaderLocation: 1, + offset: cubeUVOffset, + format: 'float32x2', + }, + ], + }, + ], + }, + fragment: { + module: device.createShaderModule({ + code: vertexPositionColorWGSL, + }), + targets: [ + { + format: presentationFormat, + }, + ], + }, + primitive: { + topology: 'triangle-list', + + // Backface culling since the cube is solid piece of geometry. + // Faces pointing away from the camera will be occluded by faces + // pointing toward the camera. + cullMode: 'back', + }, + + // Enable depth testing so that the fragment closest to the camera + // is rendered in front. + depthStencil: { + depthWriteEnabled: true, + depthCompare: 'less', + format: 'depth24plus', + }, + }); + + const depthTexture = device.createTexture({ + size: [canvas.width, canvas.height], + format: 'depth24plus', + usage: GPUTextureUsage.RENDER_ATTACHMENT, + }); + + const uniformBufferSize = 4 * 16; // 4x4 matrix + const uniformBuffer = device.createBuffer({ + size: uniformBufferSize, + usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST, + }); + + const uniformBindGroup = device.createBindGroup({ + layout: pipeline.getBindGroupLayout(0), + entries: [ + { + binding: 0, + resource: { + buffer: uniformBuffer, + }, + }, + ], + }); + + const renderPassDescriptor: GPURenderPassDescriptor = { + colorAttachments: [ + { + view: undefined, // Assigned later + + clearValue: {r: 0.5, g: 0.5, b: 0.5, a: 1.0}, + loadOp: 'clear', + storeOp: 'store', + }, + ], + depthStencilAttachment: { + view: depthTexture.createView(), + + depthClearValue: 1.0, + depthLoadOp: 'clear', + depthStoreOp: 'store', + }, + }; + + const aspect = canvas.width / canvas.height; + const projectionMatrix = mat4.perspective( + (2 * Math.PI) / 5, + aspect, + 1, + 100.0 + ); + const modelViewProjectionMatrix = mat4.create(); + + function getTransformationMatrix() { + const viewMatrix = mat4.identity(); + mat4.translate(viewMatrix, vec3.fromValues(0, 0, -4), viewMatrix); + const now = Date.now() / 1000; + mat4.rotate( + viewMatrix, + vec3.fromValues(Math.sin(now), Math.cos(now), 0), + 1, + viewMatrix + ); + + mat4.multiply(projectionMatrix, viewMatrix, modelViewProjectionMatrix); + + return modelViewProjectionMatrix as Float32Array; + } + + function frame() { + const transformationMatrix = getTransformationMatrix(); + device.queue.writeBuffer( + uniformBuffer, + 0, + transformationMatrix.buffer, + transformationMatrix.byteOffset, + transformationMatrix.byteLength + ); + renderPassDescriptor.colorAttachments[0].view = context + .getCurrentTexture() + .createView(); + + const commandEncoder = device.createCommandEncoder(); + const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); + passEncoder.setPipeline(pipeline); + passEncoder.setBindGroup(0, uniformBindGroup); + passEncoder.setVertexBuffer(0, verticesBuffer); + passEncoder.draw(cubeVertexCount); + passEncoder.end(); + device.queue.submit([commandEncoder.finish()]); + + requestAnimationFrame(frame); + } + + // Note: It is important to return control to the browser regularly in order for the worker to + // process events. You shouldn't simply loop infinitely with while(true) or similar! Using a + // traditional requestAnimationFrame() loop in the worker is one way to ensure that events are + // handled correctly by the worker. + requestAnimationFrame(frame); +} + +export {}; diff --git a/bindings/wgpu/webgpu-samples-ts/samples/videoUploadingWebCodecs/index.html b/bindings/wgpu/webgpu-samples-ts/samples/videoUploadingWebCodecs/index.html new file mode 100644 index 00000000..c3115155 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/samples/videoUploadingWebCodecs/index.html @@ -0,0 +1,9 @@ + + + + + + diff --git a/bindings/wgpu/webgpu-samples-ts/shaders/basic.vert.wgsl b/bindings/wgpu/webgpu-samples-ts/shaders/basic.vert.wgsl new file mode 100644 index 00000000..64052407 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/shaders/basic.vert.wgsl @@ -0,0 +1,22 @@ +struct Uniforms { + modelViewProjectionMatrix : mat4x4f, +} +@binding(0) @group(0) var uniforms : Uniforms; + +struct VertexOutput { + @builtin(position) Position : vec4f, + @location(0) fragUV : vec2f, + @location(1) fragPosition: vec4f, +} + +@vertex +fn main( + @location(0) position : vec4f, + @location(1) uv : vec2f +) -> VertexOutput { + var output : VertexOutput; + output.Position = uniforms.modelViewProjectionMatrix * position; + output.fragUV = uv; + output.fragPosition = 0.5 * (position + vec4(1.0, 1.0, 1.0, 1.0)); + return output; +} diff --git a/bindings/wgpu/webgpu-samples-ts/shaders/fullscreenTexturedQuad.wgsl b/bindings/wgpu/webgpu-samples-ts/shaders/fullscreenTexturedQuad.wgsl new file mode 100644 index 00000000..b3656e23 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/shaders/fullscreenTexturedQuad.wgsl @@ -0,0 +1,38 @@ +@group(0) @binding(0) var mySampler : sampler; +@group(0) @binding(1) var myTexture : texture_2d; + +struct VertexOutput { + @builtin(position) Position : vec4f, + @location(0) fragUV : vec2f, +} + +@vertex +fn vert_main(@builtin(vertex_index) VertexIndex : u32) -> VertexOutput { + const pos = array( + vec2( 1.0, 1.0), + vec2( 1.0, -1.0), + vec2(-1.0, -1.0), + vec2( 1.0, 1.0), + vec2(-1.0, -1.0), + vec2(-1.0, 1.0), + ); + + const uv = array( + vec2(1.0, 0.0), + vec2(1.0, 1.0), + vec2(0.0, 1.0), + vec2(1.0, 0.0), + vec2(0.0, 1.0), + vec2(0.0, 0.0), + ); + + var output : VertexOutput; + output.Position = vec4(pos[VertexIndex], 0.0, 1.0); + output.fragUV = uv[VertexIndex]; + return output; +} + +@fragment +fn frag_main(@location(0) fragUV : vec2f) -> @location(0) vec4f { + return textureSample(myTexture, mySampler, fragUV); +} diff --git a/bindings/wgpu/webgpu-samples-ts/shaders/red.frag.wgsl b/bindings/wgpu/webgpu-samples-ts/shaders/red.frag.wgsl new file mode 100644 index 00000000..de720e85 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/shaders/red.frag.wgsl @@ -0,0 +1,4 @@ +@fragment +fn main() -> @location(0) vec4f { + return vec4(1.0, 0.0, 0.0, 1.0); +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/shaders/sampleExternalTexture.frag.wgsl b/bindings/wgpu/webgpu-samples-ts/shaders/sampleExternalTexture.frag.wgsl new file mode 100644 index 00000000..e5ff5693 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/shaders/sampleExternalTexture.frag.wgsl @@ -0,0 +1,7 @@ +@group(0) @binding(1) var mySampler: sampler; +@group(0) @binding(2) var myTexture: texture_external; + +@fragment +fn main(@location(0) fragUV : vec2f) -> @location(0) vec4f { + return textureSampleBaseClampToEdge(myTexture, mySampler, fragUV); +} diff --git a/bindings/wgpu/webgpu-samples-ts/shaders/triangle.vert.wgsl b/bindings/wgpu/webgpu-samples-ts/shaders/triangle.vert.wgsl new file mode 100644 index 00000000..0df4e5fc --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/shaders/triangle.vert.wgsl @@ -0,0 +1,12 @@ +@vertex +fn main( + @builtin(vertex_index) VertexIndex : u32 +) -> @builtin(position) vec4f { + var pos = array( + vec2(0.0, 0.5), + vec2(-0.5, -0.5), + vec2(0.5, -0.5) + ); + + return vec4f(pos[VertexIndex], 0.0, 1.0); +} diff --git a/bindings/wgpu/webgpu-samples-ts/shaders/vertexPositionColor.frag.wgsl b/bindings/wgpu/webgpu-samples-ts/shaders/vertexPositionColor.frag.wgsl new file mode 100644 index 00000000..a6032398 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/shaders/vertexPositionColor.frag.wgsl @@ -0,0 +1,7 @@ +@fragment +fn main( + @location(0) fragUV: vec2f, + @location(1) fragPosition: vec4f +) -> @location(0) vec4f { + return fragPosition; +} diff --git a/bindings/wgpu/webgpu-samples-ts/src/jsMain/kotlin/Dummy.kt b/bindings/wgpu/webgpu-samples-ts/src/jsMain/kotlin/Dummy.kt new file mode 100644 index 00000000..98146972 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/src/jsMain/kotlin/Dummy.kt @@ -0,0 +1,14 @@ +package my.dummy + +@JsExport +class Dummy { + + fun dumb() = dummy + + companion object { + val dummy: String = "dummy" + fun dumb() = dummy + + + } +} diff --git a/bindings/wgpu/webgpu-samples-ts/src/main.ts b/bindings/wgpu/webgpu-samples-ts/src/main.ts new file mode 100644 index 00000000..2aa8c6b9 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/src/main.ts @@ -0,0 +1,278 @@ +import {createElem as el} from './utils/elem'; +import {SampleInfo, SourceInfo, pageCategories} from './samples'; +import {monokai} from '@uiw/codemirror-theme-monokai'; +import {EditorView} from '@codemirror/view'; +import {EditorState} from '@codemirror/state'; +import {javascript} from '@codemirror/lang-javascript'; +import {basicSetup} from 'codemirror'; +import {Converter} from 'showdown'; + +const markdownConverter = new Converter({ + simplifiedAutoLink: true, +}); + +/** + * Gets an element unconditionally so TS doesn't complain. + */ +function getElem( + selector: string, + parent: HTMLElement | Document = document +): HTMLElement { + return parent.querySelector(selector)!; +} + +const sampleListElem = getElem('#samplelist'); +const sampleElem = getElem('#sample'); +const githubElem = getElem('#src') as HTMLAnchorElement; +const introElem = getElem('#intro'); +const codeTabsElem = getElem('#codeTabs'); +const sourcesElem = getElem('#sources'); +const sampleContainerElem = getElem('.sampleContainer', sampleElem); +const titleElem = getElem('#title', sampleElem); +const descriptionElem = getElem('#description', sampleElem); +const menuToggleElem = getElem('#menuToggle') as HTMLInputElement; + +// Get the parts of a string past the last `/` +const basename = (name: string) => name.substring(name.lastIndexOf('/') + 1); + +// Make a new codemirror editor +const readOnly = EditorState.readOnly.of(true); + +async function makeCodeMirrorEditor(parent: HTMLElement, filename: string) { + const source = await (await fetch(filename)).text(); + + new EditorView({ + extensions: [ + basicSetup, + monokai, + EditorView.lineWrapping, + javascript(), + readOnly, + ], + parent, + doc: source, + }); +} + +/** + * Set the current URL. + * + * This exists so we don't have to remember the first 2 parameters to pushState + * and so we can insert a console.log + */ +function setURL(url: string) { + history.pushState(null, '', url); +} + +// Handle when the URL changes (browser back / forward) +window.addEventListener('popstate', parseURL); + +/** + * Show/hide source tabs + */ +function setSourceTab(sourceInfo: SourceInfo) { + const name = basename(sourceInfo.path); + document.querySelectorAll('[data-name]').forEach((e) => { + const elem = e as HTMLElement; + elem.dataset.active = (elem.dataset.name === name).toString(); + }); +} + +/** + * Respond to the user clicking a source tab link. + */ +function setSourceTabHash(event: PointerEvent, sourceInfo: SourceInfo) { + event.preventDefault(); + const name = basename(sourceInfo.path); + const url = new URL(location.toString()); + url.hash = `#${name}`; + setURL(url.toString()); + + setSourceTab(sourceInfo); +} + +// Non authoritative test that url is for same domain +function isSameDomain(url: string) { + return new URL(url, window.location.href).origin === window.location.origin; +} + +// That current sample so we don't reload an iframe if the user picks the same sample. +let currentSampleInfo: SampleInfo | undefined; + +/** + * Change the iframe (and source editors) to the given sample or none + */ +function setSampleIFrame( + sampleInfo: SampleInfo | undefined, + search: string = '' +) { + menuToggleElem.checked = false; + + if (sampleInfo === currentSampleInfo) { + return; + } + sampleContainerElem.innerHTML = ''; + descriptionElem.innerHTML = ''; + + currentSampleInfo = sampleInfo; + const {name, description, filename, url, sources} = sampleInfo || { + name: '', + description: '', + filename: '', + sources: [], + }; + + titleElem.textContent = name; + descriptionElem.innerHTML = markdownConverter.makeHtml(description); + + // Replace the iframe because changing src adds to the user's history. + sampleContainerElem.innerHTML = ''; + if (filename) { + const src = url || `${filename}${search}`; + sampleContainerElem.appendChild(el('iframe', {src})); + sampleContainerElem.style.height = sources.length > 0 ? '600px' : '100%'; + + if (url) { + // If it's remote example, hide the github link and assume it's in the description. + githubElem.style.display = 'none'; + } else { + // It's a local sample so show the github link. + githubElem.style.display = ''; + githubElem.href = `https://github.com/webgpu/webgpu-samples/tree/main/${filename}`; + } + + // hide intro and show sample + introElem.style.display = 'none'; + sampleElem.style.display = ''; + } else { + // hide intro and show sample + introElem.style.display = ''; + sampleElem.style.display = 'none'; + } + + // create source tabs + codeTabsElem.innerHTML = ''; + sourcesElem.innerHTML = ''; + sourcesElem.style.display = sources.length > 0 ? '' : 'none'; + sources.forEach((source, i) => { + const {path} = source; + const active = (i === 0).toString(); + const name = basename(source.path); + codeTabsElem.appendChild( + el('li', {}, [ + el('a', { + href: `#${path}`, + textContent: name, + dataset: { + active, + name, + }, + onClick: (e: PointerEvent) => { + setSourceTabHash(e, source); + }, + }), + ]) + ); + const elem = el('div', { + className: 'sourceFileContainer', + dataset: { + active, + name, + }, + }); + sourcesElem.appendChild(elem); + const url = isSameDomain(path) ? `${filename}/${path}` : source.path; + makeCodeMirrorEditor(elem, url); + }); +} + +/** + * Respond to the user clicking sample link. + */ +function setSampleIFrameURL(e: PointerEvent, sampleInfo: SampleInfo) { + e.preventDefault(); + const {filename} = sampleInfo; + + const url = new URL(location.toString()); + url.hash = ''; + + url.searchParams.set('sample', basename(filename)); + setURL(url.toString()); + setSampleIFrame(sampleInfo); +} + +// Samples are looked up by `?sample=key` so this is a map +// from those keys to each sample. +const samplesByKey = new Map(); + +// Generate the list of samples +for (const {title, description, samples} of pageCategories) { + for (const [key, sampleInfo] of Object.entries(samples)) { + samplesByKey.set(key, sampleInfo); + } + + sampleListElem.appendChild( + el('ul', {className: 'exampleList'}, [ + el('div', {}, [ + el('div', {className: 'sampleCategory'}, [ + el('h3', { + style: {'margin-top': '5px'}, + textContent: title, + dataset: {tooltip: description}, + }), + ]), + ...Object.entries(samples).map(([key, sampleInfo]) => + el('li', {}, [ + el('a', { + href: sampleInfo.filename, + onClick: (e: PointerEvent) => { + setSampleIFrameURL(e, sampleInfo); + }, + textContent: sampleInfo.tocName || key, + }), + ]) + ), + ]), + ]) + ); +} + +/** + * Parse the page's current URL and then set the iframe appropriately. + */ +function parseURL() { + const url = new URL(location.toString()); + + const sample = url.searchParams.get('sample') || ''; + const sampleUrl = new URL(sample, location.href); + const sampleInfo = samplesByKey.get(basename(sampleUrl.pathname)); + setSampleIFrame(sampleInfo, sampleUrl.search); + if (sampleInfo) { + const hash = basename(url.hash.substring(1)); + const sourceInfo = + sampleInfo.sources.find(({path}) => basename(path) === hash) || + sampleInfo.sources[0]; + setSourceTab(sourceInfo); + } +} + +/** + * Respond to messages from iframes. We have no way of knowing the size + * of an example so there's a helper in `iframe-helper.js` that lets + * the iframe tell us the size it needs (and possibly other things). + * This lets us adjust the size of the iframe. + */ +window.addEventListener('message', (e) => { + const {cmd, data} = e.data; + switch (cmd) { + case 'resize': { + sampleContainerElem.style.height = `${data.height}px`; + break; + } + default: + throw new Error(`unknown message cmd: ${cmd}`); + } +}); + +// Parse the first URL. +parseURL(); diff --git a/bindings/wgpu/webgpu-samples-ts/src/samples.ts b/bindings/wgpu/webgpu-samples-ts/src/samples.ts new file mode 100644 index 00000000..9305a188 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/src/samples.ts @@ -0,0 +1,157 @@ +import aBuffer from '../sample/a-buffer/meta'; +import animometer from '../sample/animometer/meta'; +import bitonicSort from '../sample/bitonicSort/meta'; +import bundleCulling from '../sample/bundleCulling/meta'; +import cameras from '../sample/cameras/meta'; +import clusteredShading from '../sample/clusteredShading/meta'; +import cornell from '../sample/cornell/meta'; +import computeBoids from '../sample/computeBoids/meta'; +import cubemap from '../sample/cubemap/meta'; +import deferredRendering from '../sample/deferredRendering/meta'; +import fractalCube from '../sample/fractalCube/meta'; +import gameOfLife from '../sample/gameOfLife/meta'; +import helloTriangle from '../sample/helloTriangle/meta'; +import helloTriangleMSAA from '../sample/helloTriangleMSAA/meta'; +import imageBlur from '../sample/imageBlur/meta'; +import instancedCube from '../sample/instancedCube/meta'; +import metaballs from '../sample/metaballs/meta'; +import normalMap from '../sample/normalMap/meta'; +import particles from '../sample/particles/meta'; +import pristineGrid from '../sample/pristineGrid/meta'; +import renderBundles from '../sample/renderBundles/meta'; +import resizeCanvas from '../sample/resizeCanvas/meta'; +import resizeObserverHDDPI from '../sample/resizeObserverHDDPI/meta'; +import reversedZ from '../sample/reversedZ/meta'; +import rotatingCube from '../sample/rotatingCube/meta'; +import samplerParameters from '../sample/samplerParameters/meta'; +import shadowMapping from '../sample/shadowMapping/meta'; +import skinnedMesh from '../sample/skinnedMesh/meta'; +import spookyball from '../sample/spookyball/meta'; +import textRenderingMsdf from '../sample/textRenderingMsdf/meta'; +import texturedCube from '../sample/texturedCube/meta'; +import twoCubes from '../sample/twoCubes/meta'; +import videoUploading from '../sample/videoUploading/meta'; +import worker from '../sample/worker/meta'; + +export type SourceInfo = { + path: string; +}; + +export type SampleInfo = { + name: string; + tocName?: string; + description: string; + filename: string; // used if sample is local + url?: string; // used if sample is remote + sources: SourceInfo[]; +}; + +type PageCategory = { + title: string; + description: string; + samples: { [key: string]: SampleInfo }; +}; + +export const pageCategories: PageCategory[] = [ + // Samples that implement basic rendering functionality using the WebGPU API. + { + title: 'Basic Graphics', + description: + 'Basic rendering functionality implemented with the WebGPU API.', + samples: { + helloTriangle, + helloTriangleMSAA, + rotatingCube, + twoCubes, + texturedCube, + instancedCube, + fractalCube, + cubemap, + }, + }, + + // Samples that demonstrate functionality specific to WebGPU, or demonstrate the particularities + // of how WebGPU implements a particular feature within its api. For instance, while many of the + // sampler parameters in the 'samplerParameters' sample have direct analogues in other graphics api, + // the primary purpose of 'sampleParameters' is to demonstrate their specific nomenclature and + // functionality within the context of the WebGPU API. + { + title: 'WebGPU Features', + description: 'Highlights of important WebGPU features.', + samples: { + samplerParameters, + reversedZ, + renderBundles, + }, + }, + + // Samples that demonstrate the GPGPU functionality of WebGPU. These samples generally provide some + // user-facing representation (e.g. image, text, or audio) of the result of compute operations. + // Any rendering code is primarily for visualization, not key to the unique part of the sample; + // rendering could also be done using canvas2D without detracting from the sample's usefulness. + { + title: 'GPGPU Demos', + description: 'Visualizations of parallel GPU compute operations.', + samples: { + computeBoids, + gameOfLife, + bitonicSort, + }, + }, + + // A selection of samples demonstrating various graphics techniques, utilizing various features + // of the WebGPU API, and often executing render and compute pipelines in tandem to achieve their + // visual results. The techniques demonstrated may even be independent of WebGPU (e.g. 'cameras') + { + title: 'Graphics Techniques', + description: 'A collection of graphics techniques implemented with WebGPU.', + samples: { + cameras, + normalMap, + shadowMapping, + deferredRendering, + particles, + imageBlur, + cornell, + 'a-buffer': aBuffer, + skinnedMesh, + textRenderingMsdf, + }, + }, + + // Samples that demonstrate how to integrate WebGPU and/or WebGPU render operations with other + // functionalities provided by the web platform. + { + title: 'Web Platform Integration', + description: + 'Demos integrating WebGPU with other functionalities of the web platform.', + samples: { + resizeCanvas, + resizeObserverHDDPI, + videoUploading, + worker, + }, + }, + + // External examples + { + title: 'External Samples', + description: `Samples from around the net.`, + samples: { + bundleCulling, + metaballs, + pristineGrid, + clusteredShading, + spookyball, + }, + }, + + // Samples whose primary purpose is to benchmark WebGPU performance. + { + title: 'Benchmarks', + description: 'WebGPU Performance Benchmarks', + samples: { + animometer, + }, + }, +]; diff --git a/bindings/wgpu/webgpu-samples-ts/src/tsconfig.json b/bindings/wgpu/webgpu-samples-ts/src/tsconfig.json new file mode 100644 index 00000000..69950349 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/src/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "@tsconfig/recommended/tsconfig.json", + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "outDir": "../out", + "rootDir": "../", + "moduleResolution": "Node", + "typeRoots": [ + "../node_modules/@webgpu/types", + "../node_modules/@types" + ] + }, + "include": [ + "../other/korlibs.d.ts", + "../build/compileSync/js/main/productionExecutable/kotlin/wgpu-webgpu-samples-ts.d.ts", + "../src/**/*.ts", + "../sample/*.ts" + ], + "exclude": [ + "../out" + ] +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-samples-ts/src/types.d.ts b/bindings/wgpu/webgpu-samples-ts/src/types.d.ts new file mode 100644 index 00000000..e163f05f --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/src/types.d.ts @@ -0,0 +1,8 @@ +/// +declare const __DIRNAME__; + +declare module '*.wgsl' { + const shader: string; + export default shader; +} + diff --git a/bindings/wgpu/webgpu-samples-ts/src/utils/elem.ts b/bindings/wgpu/webgpu-samples-ts/src/utils/elem.ts new file mode 100644 index 00000000..58aacaa8 --- /dev/null +++ b/bindings/wgpu/webgpu-samples-ts/src/utils/elem.ts @@ -0,0 +1,57 @@ +// TODO: connect this to HTML's definition +type EventListener = (e: PointerEvent) => void; + +interface Attributes { + [key: string]: string | Attributes | EventListener; +} + +/** + * Creates an HTMLElement with optional attributes and children + * + * Examples: + * + * ```js + * br = createElem('br'); + * p = createElem('p', 'hello world'); + * a = createElem('a', {href: 'https://google.com', textContent: 'Google'}); + * ul = createElement('ul', {}, [ + * createElem('li', 'apple'), + * createElem('li', 'banana'), + * ]); + * h1 = createElem('h1', { style: { color: 'red' }, textContent: 'Title'}) + * ``` + */ +export function createElem( + tag: string, + attrs: Attributes | string = {}, + children: HTMLElement[] = [] +) { + const elem = document.createElement(tag) as HTMLElement; + if (typeof attrs === 'string') { + elem.textContent = attrs; + } else { + const elemAsAttribs = elem as unknown as Attributes; + for (const [key, value] of Object.entries(attrs)) { + if (typeof value === 'function' && key.startsWith('on')) { + const eventName = key.substring(2).toLowerCase(); + // TODO: make type safe or at least more type safe. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + elem.addEventListener(eventName as any, value as EventListener, { + passive: false, + }); + } else if (typeof value === 'object') { + for (const [k, v] of Object.entries(value)) { + (elemAsAttribs[key] as Attributes)[k] = v; + } + } else if (elemAsAttribs[key] === undefined) { + elem.setAttribute(key, value as string); + } else { + elemAsAttribs[key] = value; + } + } + } + for (const child of children) { + elem.appendChild(child); + } + return elem; +} diff --git a/bindings/wgpu/webgpu-ts/README.md b/bindings/wgpu/webgpu-ts/README.md new file mode 100644 index 00000000..15eaf007 --- /dev/null +++ b/bindings/wgpu/webgpu-ts/README.md @@ -0,0 +1,15 @@ +# WebGPU Definitions in Kotlin + +This sub project serves a unique purpose, it is specifically designed to convert TypeScript definition files into Kotlin in the context of WebGPU. + +# Prerequisite + +Install Dukat and NPM + +# Usage + +Run this script on Mac or Linux + +```Bash +./extract.sh +``` \ No newline at end of file diff --git a/bindings/wgpu/webgpu-ts/extract.sh b/bindings/wgpu/webgpu-ts/extract.sh new file mode 100644 index 00000000..9e39cfd4 --- /dev/null +++ b/bindings/wgpu/webgpu-ts/extract.sh @@ -0,0 +1,11 @@ +npm install + +DIR="./node_modules/@webgpu/types/dist/index.d.ts" + +if [ ! -f "$DIR" ]; then + echo "Typescript definition not found" + exit 1 +fi + +rm -r ./src +dukat -p "io.ygdrasil.wgpu.internal.js" -d ./src ./node_modules/@webgpu/types/dist/index.d.ts \ No newline at end of file diff --git a/bindings/wgpu/webgpu-ts/package-lock.json b/bindings/wgpu/webgpu-ts/package-lock.json new file mode 100644 index 00000000..ea1e0044 --- /dev/null +++ b/bindings/wgpu/webgpu-ts/package-lock.json @@ -0,0 +1,21 @@ +{ + "name": "webgpu-ts", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "webgpu-ts", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@webgpu/types": "^0.1.40" + } + }, + "node_modules/@webgpu/types": { + "version": "0.1.40", + "resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.40.tgz", + "integrity": "sha512-/BBkHLS6/eQjyWhY2H7Dx5DHcVrS2ICj9owvSRdgtQT6KcafLZA86tPze0xAOsd4FbsYKCUBUQyNi87q7gV7kw==" + } + } +} diff --git a/bindings/wgpu/webgpu-ts/package.json b/bindings/wgpu/webgpu-ts/package.json new file mode 100644 index 00000000..374ef604 --- /dev/null +++ b/bindings/wgpu/webgpu-ts/package.json @@ -0,0 +1,14 @@ +{ + "name": "webgpu-ts", + "version": "1.0.0", + "description": "simple project to get webgpu TS types", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "@webgpu/types": "^0.1.40" + } +} diff --git a/bindings/wgpu/webgpu-ts/src/index.module_@webgpu_types.kt b/bindings/wgpu/webgpu-ts/src/index.module_@webgpu_types.kt new file mode 100644 index 00000000..d67386c3 --- /dev/null +++ b/bindings/wgpu/webgpu-ts/src/index.module_@webgpu_types.kt @@ -0,0 +1,1285 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") + +import kotlin.js.* +import org.khronos.webgl.* +import org.w3c.dom.* +import org.w3c.dom.events.* +import org.w3c.dom.parsing.* +import org.w3c.dom.svg.* +import org.w3c.dom.url.* +import org.w3c.fetch.* +import org.w3c.files.* +import org.w3c.notifications.* +import org.w3c.performance.* +import org.w3c.workers.* +import org.w3c.xhr.* +import tsstdlib.Iterable +import tsstdlib.Record +import tsstdlib.DOMException +import tsstdlib.ReadonlySet + +external interface GPUOrigin2DDictStrict : GPUOrigin2DDict { + var z: Any? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUExtent3DDictStrict : GPUExtent3DDict { + var depth: Any? + get() = definedExternally + set(value) = definedExternally +} + +typealias GPUBufferDynamicOffset = Number + +typealias GPUBufferUsageFlags = Number + +typealias GPUColorWriteFlags = Number + +typealias GPUDepthBias = Number + +typealias GPUFlagsConstant = Number + +typealias GPUIndex32 = Number + +typealias GPUIntegerCoordinate = Number + +typealias GPUIntegerCoordinateOut = Number + +typealias GPUMapModeFlags = Number + +typealias GPUPipelineConstantValue = Number + +typealias GPUSampleMask = Number + +typealias GPUShaderStageFlags = Number + +typealias GPUSignedOffset32 = Number + +typealias GPUSize32 = Number + +typealias GPUSize32Out = Number + +typealias GPUSize64 = Number + +typealias GPUSize64Out = Number + +typealias GPUStencilValue = Number + +typealias GPUTextureUsageFlags = Number + +external interface GPUBindGroupDescriptor : GPUObjectDescriptorBase { + var layout: GPUBindGroupLayout + var entries: Iterable +} + +external interface GPUBindGroupEntry { + var binding: GPUIndex32 + var resource: dynamic /* GPUSampler | GPUTextureView | GPUBufferBinding | GPUExternalTexture */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase { + var entries: Iterable +} + +external interface GPUBindGroupLayoutEntry { + var binding: GPUIndex32 + var visibility: GPUShaderStageFlags + var buffer: GPUBufferBindingLayout? + get() = definedExternally + set(value) = definedExternally + var sampler: GPUSamplerBindingLayout? + get() = definedExternally + set(value) = definedExternally + var texture: GPUTextureBindingLayout? + get() = definedExternally + set(value) = definedExternally + var storageTexture: GPUStorageTextureBindingLayout? + get() = definedExternally + set(value) = definedExternally + var externalTexture: GPUExternalTextureBindingLayout? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBlendComponent { + var operation: String? /* "add" | "subtract" | "reverse-subtract" | "min" | "max" */ + get() = definedExternally + set(value) = definedExternally + var srcFactor: String? /* "zero" | "one" | "src" | "one-minus-src" | "src-alpha" | "one-minus-src-alpha" | "dst" | "one-minus-dst" | "dst-alpha" | "one-minus-dst-alpha" | "src-alpha-saturated" | "constant" | "one-minus-constant" */ + get() = definedExternally + set(value) = definedExternally + var dstFactor: String? /* "zero" | "one" | "src" | "one-minus-src" | "src-alpha" | "one-minus-src-alpha" | "dst" | "one-minus-dst" | "dst-alpha" | "one-minus-dst-alpha" | "src-alpha-saturated" | "constant" | "one-minus-constant" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBlendState { + var color: GPUBlendComponent + var alpha: GPUBlendComponent +} + +external interface GPUBufferBinding { + var buffer: GPUBuffer + var offset: GPUSize64? + get() = definedExternally + set(value) = definedExternally + var size: GPUSize64? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBufferBindingLayout { + var type: String? /* "uniform" | "storage" | "read-only-storage" */ + get() = definedExternally + set(value) = definedExternally + var hasDynamicOffset: Boolean? + get() = definedExternally + set(value) = definedExternally + var minBindingSize: GPUSize64? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBufferDescriptor : GPUObjectDescriptorBase { + var size: GPUSize64 + var usage: GPUBufferUsageFlags + var mappedAtCreation: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUCanvasConfiguration { + var device: GPUDevice + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var usage: GPUTextureUsageFlags? + get() = definedExternally + set(value) = definedExternally + var viewFormats: Iterable? + get() = definedExternally + set(value) = definedExternally + var colorSpace: Any? + get() = definedExternally + set(value) = definedExternally + var alphaMode: String? /* "opaque" | "premultiplied" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUColorDict { + var r: Number + var g: Number + var b: Number + var a: Number +} + +external interface GPUColorTargetState { + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var blend: GPUBlendState? + get() = definedExternally + set(value) = definedExternally + var writeMask: GPUColorWriteFlags? + get() = definedExternally + set(value) = definedExternally +} + +typealias GPUCommandBufferDescriptor = GPUObjectDescriptorBase + +typealias GPUCommandEncoderDescriptor = GPUObjectDescriptorBase + +external interface GPUComputePassDescriptor : GPUObjectDescriptorBase { + var timestampWrites: GPUComputePassTimestampWrites? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUComputePassTimestampWrites { + var querySet: GPUQuerySet + var beginningOfPassWriteIndex: GPUSize32? + get() = definedExternally + set(value) = definedExternally + var endOfPassWriteIndex: GPUSize32? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUComputePipelineDescriptor : GPUPipelineDescriptorBase { + var compute: GPUProgrammableStage +} + +external interface GPUDepthStencilState { + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var depthWriteEnabled: Boolean? + get() = definedExternally + set(value) = definedExternally + var depthCompare: String? /* "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always" */ + get() = definedExternally + set(value) = definedExternally + var stencilFront: GPUStencilFaceState? + get() = definedExternally + set(value) = definedExternally + var stencilBack: GPUStencilFaceState? + get() = definedExternally + set(value) = definedExternally + var stencilReadMask: GPUStencilValue? + get() = definedExternally + set(value) = definedExternally + var stencilWriteMask: GPUStencilValue? + get() = definedExternally + set(value) = definedExternally + var depthBias: GPUDepthBias? + get() = definedExternally + set(value) = definedExternally + var depthBiasSlopeScale: Number? + get() = definedExternally + set(value) = definedExternally + var depthBiasClamp: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUDeviceDescriptor : GPUObjectDescriptorBase { + var requiredFeatures: Iterable? + get() = definedExternally + set(value) = definedExternally + var requiredLimits: Record? + get() = definedExternally + set(value) = definedExternally + var defaultQueue: GPUQueueDescriptor? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUExtent3DDict { + var width: GPUIntegerCoordinate + var height: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var depthOrArrayLayers: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUExternalTextureBindingLayout + +external interface GPUExternalTextureDescriptor : GPUObjectDescriptorBase { + var source: dynamic /* HTMLVideoElement | VideoFrame */ + get() = definedExternally + set(value) = definedExternally + var colorSpace: Any? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUFragmentState : GPUProgrammableStage { + var targets: Iterable +} + +external interface GPUImageCopyBuffer : GPUImageDataLayout { + var buffer: GPUBuffer +} + +external interface GPUImageCopyExternalImage { + var source: dynamic /* ImageBitmap | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas */ + get() = definedExternally + set(value) = definedExternally + var origin: dynamic /* Iterable? | GPUOrigin2DDictStrict? */ + get() = definedExternally + set(value) = definedExternally + var flipY: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUImageCopyTexture { + var texture: GPUTexture + var mipLevel: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var origin: dynamic /* Iterable? | GPUOrigin3DDict? */ + get() = definedExternally + set(value) = definedExternally + var aspect: String? /* "all" | "stencil-only" | "depth-only" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUImageCopyTextureTagged : GPUImageCopyTexture { + var colorSpace: Any? + get() = definedExternally + set(value) = definedExternally + var premultipliedAlpha: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUImageDataLayout { + var offset: GPUSize64? + get() = definedExternally + set(value) = definedExternally + var bytesPerRow: GPUSize32? + get() = definedExternally + set(value) = definedExternally + var rowsPerImage: GPUSize32? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUMultisampleState { + var count: GPUSize32? + get() = definedExternally + set(value) = definedExternally + var mask: GPUSampleMask? + get() = definedExternally + set(value) = definedExternally + var alphaToCoverageEnabled: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUObjectDescriptorBase { + var label: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUOrigin2DDict { + var x: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var y: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUOrigin3DDict { + var x: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var y: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var z: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUPipelineDescriptorBase : GPUObjectDescriptorBase { + var layout: dynamic /* GPUPipelineLayout | "auto" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUPipelineErrorInit { + var reason: String /* "validation" | "internal" */ +} + +external interface GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase { + var bindGroupLayouts: Iterable +} + +external interface GPUPrimitiveState { + var topology: String? /* "point-list" | "line-list" | "line-strip" | "triangle-list" | "triangle-strip" */ + get() = definedExternally + set(value) = definedExternally + var stripIndexFormat: String? /* "uint16" | "uint32" */ + get() = definedExternally + set(value) = definedExternally + var frontFace: String? /* "ccw" | "cw" */ + get() = definedExternally + set(value) = definedExternally + var cullMode: String? /* "none" | "front" | "back" */ + get() = definedExternally + set(value) = definedExternally + var unclippedDepth: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUProgrammableStage { + var module: GPUShaderModule + var entryPoint: String? + get() = definedExternally + set(value) = definedExternally + var constants: Record? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUQuerySetDescriptor : GPUObjectDescriptorBase { + var type: String /* "occlusion" | "timestamp" */ + var count: GPUSize32 +} + +typealias GPUQueueDescriptor = GPUObjectDescriptorBase + +typealias GPURenderBundleDescriptor = GPUObjectDescriptorBase + +external interface GPURenderBundleEncoderDescriptor : GPURenderPassLayout { + var depthReadOnly: Boolean? + get() = definedExternally + set(value) = definedExternally + var stencilReadOnly: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURenderPassColorAttachment { + var view: GPUTextureView + var depthSlice: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var resolveTarget: GPUTextureView? + get() = definedExternally + set(value) = definedExternally + var clearValue: dynamic /* Iterable? | GPUColorDict? */ + get() = definedExternally + set(value) = definedExternally + var loadOp: String /* "load" | "clear" */ + var storeOp: String /* "store" | "discard" */ +} + +external interface GPURenderPassDepthStencilAttachment { + var view: GPUTextureView + var depthClearValue: Number? + get() = definedExternally + set(value) = definedExternally + var depthLoadOp: String? /* "load" | "clear" */ + get() = definedExternally + set(value) = definedExternally + var depthStoreOp: String? /* "store" | "discard" */ + get() = definedExternally + set(value) = definedExternally + var depthReadOnly: Boolean? + get() = definedExternally + set(value) = definedExternally + var stencilClearValue: GPUStencilValue? + get() = definedExternally + set(value) = definedExternally + var stencilLoadOp: String? /* "load" | "clear" */ + get() = definedExternally + set(value) = definedExternally + var stencilStoreOp: String? /* "store" | "discard" */ + get() = definedExternally + set(value) = definedExternally + var stencilReadOnly: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURenderPassDescriptor : GPUObjectDescriptorBase { + var colorAttachments: Iterable + var depthStencilAttachment: GPURenderPassDepthStencilAttachment? + get() = definedExternally + set(value) = definedExternally + var occlusionQuerySet: GPUQuerySet? + get() = definedExternally + set(value) = definedExternally + var timestampWrites: GPURenderPassTimestampWrites? + get() = definedExternally + set(value) = definedExternally + var maxDrawCount: GPUSize64? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURenderPassLayout : GPUObjectDescriptorBase { + var colorFormats: Iterable + var depthStencilFormat: String? /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + get() = definedExternally + set(value) = definedExternally + var sampleCount: GPUSize32? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURenderPassTimestampWrites { + var querySet: GPUQuerySet + var beginningOfPassWriteIndex: GPUSize32? + get() = definedExternally + set(value) = definedExternally + var endOfPassWriteIndex: GPUSize32? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURenderPipelineDescriptor : GPUPipelineDescriptorBase { + var vertex: GPUVertexState + var primitive: GPUPrimitiveState? + get() = definedExternally + set(value) = definedExternally + var depthStencil: GPUDepthStencilState? + get() = definedExternally + set(value) = definedExternally + var multisample: GPUMultisampleState? + get() = definedExternally + set(value) = definedExternally + var fragment: GPUFragmentState? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURequestAdapterOptions { + var powerPreference: String? /* "low-power" | "high-performance" */ + get() = definedExternally + set(value) = definedExternally + var forceFallbackAdapter: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUSamplerBindingLayout { + var type: String? /* "filtering" | "non-filtering" | "comparison" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUSamplerDescriptor : GPUObjectDescriptorBase { + var addressModeU: String? /* "clamp-to-edge" | "repeat" | "mirror-repeat" */ + get() = definedExternally + set(value) = definedExternally + var addressModeV: String? /* "clamp-to-edge" | "repeat" | "mirror-repeat" */ + get() = definedExternally + set(value) = definedExternally + var addressModeW: String? /* "clamp-to-edge" | "repeat" | "mirror-repeat" */ + get() = definedExternally + set(value) = definedExternally + var magFilter: String? /* "nearest" | "linear" */ + get() = definedExternally + set(value) = definedExternally + var minFilter: String? /* "nearest" | "linear" */ + get() = definedExternally + set(value) = definedExternally + var mipmapFilter: String? /* "nearest" | "linear" */ + get() = definedExternally + set(value) = definedExternally + var lodMinClamp: Number? + get() = definedExternally + set(value) = definedExternally + var lodMaxClamp: Number? + get() = definedExternally + set(value) = definedExternally + var compare: String? /* "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always" */ + get() = definedExternally + set(value) = definedExternally + var maxAnisotropy: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUShaderModuleCompilationHint { + var entryPoint: String + var layout: dynamic /* GPUPipelineLayout? | "auto" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUShaderModuleDescriptor : GPUObjectDescriptorBase { + var code: String + var sourceMap: Any? + get() = definedExternally + set(value) = definedExternally + var compilationHints: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUStencilFaceState { + var compare: String? /* "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always" */ + get() = definedExternally + set(value) = definedExternally + var failOp: String? /* "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap" */ + get() = definedExternally + set(value) = definedExternally + var depthFailOp: String? /* "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap" */ + get() = definedExternally + set(value) = definedExternally + var passOp: String? /* "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUStorageTextureBindingLayout { + var access: String? /* "write-only" | "read-only" | "read-write" */ + get() = definedExternally + set(value) = definedExternally + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var viewDimension: String? /* "1d" | "2d" | "2d-array" | "cube" | "cube-array" | "3d" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUTextureBindingLayout { + var sampleType: String? /* "float" | "unfilterable-float" | "depth" | "sint" | "uint" */ + get() = definedExternally + set(value) = definedExternally + var viewDimension: String? /* "1d" | "2d" | "2d-array" | "cube" | "cube-array" | "3d" */ + get() = definedExternally + set(value) = definedExternally + var multisampled: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUTextureDescriptor : GPUObjectDescriptorBase { + var size: dynamic /* Iterable | GPUExtent3DDictStrict */ + get() = definedExternally + set(value) = definedExternally + var mipLevelCount: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var sampleCount: GPUSize32? + get() = definedExternally + set(value) = definedExternally + var dimension: String? /* "1d" | "2d" | "3d" */ + get() = definedExternally + set(value) = definedExternally + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var usage: GPUTextureUsageFlags + var viewFormats: Iterable? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUTextureViewDescriptor : GPUObjectDescriptorBase { + var format: String? /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + get() = definedExternally + set(value) = definedExternally + var dimension: String? /* "1d" | "2d" | "2d-array" | "cube" | "cube-array" | "3d" */ + get() = definedExternally + set(value) = definedExternally + var aspect: String? /* "all" | "stencil-only" | "depth-only" */ + get() = definedExternally + set(value) = definedExternally + var baseMipLevel: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var mipLevelCount: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var baseArrayLayer: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var arrayLayerCount: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUUncapturedErrorEventInit : EventInit { + var error: GPUError +} + +external interface GPUVertexAttribute { + var format: String /* "uint8x2" | "uint8x4" | "sint8x2" | "sint8x4" | "unorm8x2" | "unorm8x4" | "snorm8x2" | "snorm8x4" | "uint16x2" | "uint16x4" | "sint16x2" | "sint16x4" | "unorm16x2" | "unorm16x4" | "snorm16x2" | "snorm16x4" | "float16x2" | "float16x4" | "float32" | "float32x2" | "float32x3" | "float32x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4" | "unorm10-10-10-2" */ + var offset: GPUSize64 + var shaderLocation: GPUIndex32 +} + +external interface GPUVertexBufferLayout { + var arrayStride: GPUSize64 + var stepMode: String? /* "vertex" | "instance" */ + get() = definedExternally + set(value) = definedExternally + var attributes: Iterable +} + +external interface GPUVertexState : GPUProgrammableStage { + var buffers: Iterable? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBindingCommandsMixin { + fun setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup?, dynamicOffsets: Iterable = definedExternally): Nothing? + fun setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup?): Nothing? + fun setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup?, dynamicOffsetsData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): Nothing? +} + +external interface GPUCommandsMixin + +external interface GPUDebugCommandsMixin { + fun pushDebugGroup(groupLabel: String): Nothing? + fun popDebugGroup(): Nothing? + fun insertDebugMarker(markerLabel: String): Nothing? +} + +external interface GPUObjectBase { + var label: String +} + +external interface GPUPipelineBase { + fun getBindGroupLayout(index: Number): GPUBindGroupLayout +} + +external interface GPURenderCommandsMixin { + fun setPipeline(pipeline: GPURenderPipeline): Nothing? + fun setIndexBuffer(buffer: GPUBuffer, indexFormat: String /* "uint16" | "uint32" */, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer?, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun draw(vertexCount: GPUSize32, instanceCount: GPUSize32 = definedExternally, firstVertex: GPUSize32 = definedExternally, firstInstance: GPUSize32 = definedExternally): Nothing? + fun drawIndexed(indexCount: GPUSize32, instanceCount: GPUSize32 = definedExternally, firstIndex: GPUSize32 = definedExternally, baseVertex: GPUSignedOffset32 = definedExternally, firstInstance: GPUSize32 = definedExternally): Nothing? + fun drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): Nothing? + fun drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): Nothing? +} + +external interface NavigatorGPU { + var gpu: GPU +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPU { + var __brand: String /* "GPU" */ + fun requestAdapter(options: GPURequestAdapterOptions = definedExternally): Promise + fun getPreferredCanvasFormat(): String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var wgslLanguageFeatures: WGSLLanguageFeatures + + companion object { + var prototype: GPU + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUAdapter { + var __brand: String /* "GPUAdapter" */ + var features: GPUSupportedFeatures + var limits: GPUSupportedLimits + var isFallbackAdapter: Boolean + fun requestDevice(descriptor: GPUDeviceDescriptor = definedExternally): Promise + fun requestAdapterInfo(): Promise + + companion object { + var prototype: GPUAdapter + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUAdapterInfo { + var __brand: String /* "GPUAdapterInfo" */ + var vendor: String + var architecture: String + var device: String + var description: String + + companion object { + var prototype: GPUAdapterInfo + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUBindGroup : GPUObjectBase { + var __brand: String /* "GPUBindGroup" */ + + companion object { + var prototype: GPUBindGroup + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUBindGroupLayout : GPUObjectBase { + var __brand: String /* "GPUBindGroupLayout" */ + + companion object { + var prototype: GPUBindGroupLayout + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUBuffer : GPUObjectBase { + var __brand: String /* "GPUBuffer" */ + var size: GPUSize64Out + var usage: GPUFlagsConstant + var mapState: String /* "unmapped" | "pending" | "mapped" */ + fun mapAsync(mode: GPUMapModeFlags, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Promise + fun getMappedRange(offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): ArrayBuffer + fun unmap(): Nothing? + fun destroy(): Nothing? + + companion object { + var prototype: GPUBuffer + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUCanvasContext { + var __brand: String /* "GPUCanvasContext" */ + var canvas: dynamic /* HTMLCanvasElement | OffscreenCanvas */ + get() = definedExternally + set(value) = definedExternally + fun configure(configuration: GPUCanvasConfiguration): Nothing? + fun unconfigure(): Nothing? + fun getCurrentTexture(): GPUTexture + + companion object { + var prototype: GPUCanvasContext + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUCommandBuffer : GPUObjectBase { + var __brand: String /* "GPUCommandBuffer" */ + + companion object { + var prototype: GPUCommandBuffer + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUCommandEncoder : GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin { + var __brand: String /* "GPUCommandEncoder" */ + fun beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder + fun beginComputePass(descriptor: GPUComputePassDescriptor = definedExternally): GPUComputePassEncoder + fun copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64): Nothing? + fun copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: Iterable): Nothing? + fun copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3DDictStrict): Nothing? + fun copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: Iterable): Nothing? + fun copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3DDictStrict): Nothing? + fun copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: Iterable): Nothing? + fun copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3DDictStrict): Nothing? + fun clearBuffer(buffer: GPUBuffer, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): Nothing? + fun finish(descriptor: GPUCommandBufferDescriptor = definedExternally): GPUCommandBuffer + + companion object { + var prototype: GPUCommandEncoder + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUCompilationInfo { + var __brand: String /* "GPUCompilationInfo" */ + var messages: Array + + companion object { + var prototype: GPUCompilationInfo + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUCompilationMessage { + var __brand: String /* "GPUCompilationMessage" */ + var message: String + var type: String /* "error" | "warning" | "info" */ + var lineNum: Number + var linePos: Number + var offset: Number + var length: Number + + companion object { + var prototype: GPUCompilationMessage + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUComputePassEncoder : GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin { + var __brand: String /* "GPUComputePassEncoder" */ + fun setPipeline(pipeline: GPUComputePipeline): Nothing? + fun dispatchWorkgroups(workgroupCountX: GPUSize32, workgroupCountY: GPUSize32 = definedExternally, workgroupCountZ: GPUSize32 = definedExternally): Nothing? + fun dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): Nothing? + fun end(): Nothing? + + companion object { + var prototype: GPUComputePassEncoder + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUComputePipeline : GPUObjectBase, GPUPipelineBase { + var __brand: String /* "GPUComputePipeline" */ + + companion object { + var prototype: GPUComputePipeline + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUDevice : EventTarget, GPUObjectBase { + var __brand: String /* "GPUDevice" */ + var features: GPUSupportedFeatures + var limits: GPUSupportedLimits + var queue: GPUQueue + fun destroy(): Nothing? + fun createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer + fun createTexture(descriptor: GPUTextureDescriptor): GPUTexture + fun createSampler(descriptor: GPUSamplerDescriptor = definedExternally): GPUSampler + fun importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture + fun createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout + fun createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor): GPUPipelineLayout + fun createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup + fun createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule + fun createComputePipeline(descriptor: GPUComputePipelineDescriptor): GPUComputePipeline + fun createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline + fun createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor): Promise + fun createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise + fun createCommandEncoder(descriptor: GPUCommandEncoderDescriptor = definedExternally): GPUCommandEncoder + fun createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder + fun createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet + var lost: Promise + fun pushErrorScope(filter: String /* "validation" | "out-of-memory" | "internal" */): Nothing? + fun popErrorScope(): Promise + var onuncapturederror: ((self: GPUDevice, ev: GPUUncapturedErrorEvent) -> Any)? + + companion object { + var prototype: GPUDevice + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUDeviceLostInfo { + var __brand: String /* "GPUDeviceLostInfo" */ + var reason: String /* "unknown" | "destroyed" */ + var message: String + + companion object { + var prototype: GPUDeviceLostInfo + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUError { + var message: String + + companion object { + var prototype: GPUError + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUExternalTexture : GPUObjectBase { + var __brand: String /* "GPUExternalTexture" */ + + companion object { + var prototype: GPUExternalTexture + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUInternalError : GPUError { + var __brand: String /* "GPUInternalError" */ + + companion object { + var prototype: GPUInternalError + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUOutOfMemoryError : GPUError { + var __brand: String /* "GPUOutOfMemoryError" */ + + companion object { + var prototype: GPUOutOfMemoryError + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUPipelineError : DOMException { + var __brand: String /* "GPUPipelineError" */ + var reason: String /* "validation" | "internal" */ + + companion object { + var prototype: GPUPipelineError + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUPipelineLayout : GPUObjectBase { + var __brand: String /* "GPUPipelineLayout" */ + + companion object { + var prototype: GPUPipelineLayout + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUQuerySet : GPUObjectBase { + var __brand: String /* "GPUQuerySet" */ + fun destroy(): Nothing? + var type: String /* "occlusion" | "timestamp" */ + var count: GPUSize32Out + + companion object { + var prototype: GPUQuerySet + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUQueue : GPUObjectBase { + var __brand: String /* "GPUQueue" */ + fun submit(commandBuffers: Iterable): Nothing? + fun onSubmittedWorkDone(): Promise + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBufferView, dataOffset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBufferView): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBufferView, dataOffset: GPUSize64 = definedExternally): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBuffer, dataOffset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBuffer): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBuffer, dataOffset: GPUSize64 = definedExternally): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: SharedArrayBuffer, dataOffset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: SharedArrayBuffer): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: SharedArrayBuffer, dataOffset: GPUSize64 = definedExternally): Nothing? + fun writeTexture(destination: GPUImageCopyTexture, data: ArrayBufferView, dataLayout: GPUImageDataLayout, size: Iterable): Nothing? + fun writeTexture(destination: GPUImageCopyTexture, data: ArrayBufferView, dataLayout: GPUImageDataLayout, size: GPUExtent3DDictStrict): Nothing? + fun writeTexture(destination: GPUImageCopyTexture, data: ArrayBuffer, dataLayout: GPUImageDataLayout, size: Iterable): Nothing? + fun writeTexture(destination: GPUImageCopyTexture, data: ArrayBuffer, dataLayout: GPUImageDataLayout, size: GPUExtent3DDictStrict): Nothing? + fun writeTexture(destination: GPUImageCopyTexture, data: SharedArrayBuffer, dataLayout: GPUImageDataLayout, size: Iterable): Nothing? + fun writeTexture(destination: GPUImageCopyTexture, data: SharedArrayBuffer, dataLayout: GPUImageDataLayout, size: GPUExtent3DDictStrict): Nothing? + fun copyExternalImageToTexture(source: GPUImageCopyExternalImage, destination: GPUImageCopyTextureTagged, copySize: Iterable): Nothing? + fun copyExternalImageToTexture(source: GPUImageCopyExternalImage, destination: GPUImageCopyTextureTagged, copySize: GPUExtent3DDictStrict): Nothing? + + companion object { + var prototype: GPUQueue + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPURenderBundle : GPUObjectBase { + var __brand: String /* "GPURenderBundle" */ + + companion object { + var prototype: GPURenderBundle + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPURenderBundleEncoder : GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin { + var __brand: String /* "GPURenderBundleEncoder" */ + fun finish(descriptor: GPURenderBundleDescriptor = definedExternally): GPURenderBundle + + companion object { + var prototype: GPURenderBundleEncoder + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPURenderPassEncoder : GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin { + var __brand: String /* "GPURenderPassEncoder" */ + fun setViewport(x: Number, y: Number, width: Number, height: Number, minDepth: Number, maxDepth: Number): Nothing? + fun setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate): Nothing? + fun setBlendConstant(color: Iterable): Nothing? + fun setBlendConstant(color: GPUColorDict): Nothing? + fun setStencilReference(reference: GPUStencilValue): Nothing? + fun beginOcclusionQuery(queryIndex: GPUSize32): Nothing? + fun endOcclusionQuery(): Nothing? + fun executeBundles(bundles: Iterable): Nothing? + fun end(): Nothing? + + companion object { + var prototype: GPURenderPassEncoder + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPURenderPipeline : GPUObjectBase, GPUPipelineBase { + var __brand: String /* "GPURenderPipeline" */ + + companion object { + var prototype: GPURenderPipeline + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUSampler : GPUObjectBase { + var __brand: String /* "GPUSampler" */ + + companion object { + var prototype: GPUSampler + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUShaderModule : GPUObjectBase { + var __brand: String /* "GPUShaderModule" */ + fun getCompilationInfo(): Promise + + companion object { + var prototype: GPUShaderModule + } +} + +typealias GPUSupportedFeatures = ReadonlySet + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUSupportedLimits { + var __brand: String /* "GPUSupportedLimits" */ + var maxTextureDimension1D: Number + var maxTextureDimension2D: Number + var maxTextureDimension3D: Number + var maxTextureArrayLayers: Number + var maxBindGroups: Number + var maxBindGroupsPlusVertexBuffers: Number + var maxBindingsPerBindGroup: Number + var maxDynamicUniformBuffersPerPipelineLayout: Number + var maxDynamicStorageBuffersPerPipelineLayout: Number + var maxSampledTexturesPerShaderStage: Number + var maxSamplersPerShaderStage: Number + var maxStorageBuffersPerShaderStage: Number + var maxStorageTexturesPerShaderStage: Number + var maxUniformBuffersPerShaderStage: Number + var maxUniformBufferBindingSize: Number + var maxStorageBufferBindingSize: Number + var minUniformBufferOffsetAlignment: Number + var minStorageBufferOffsetAlignment: Number + var maxVertexBuffers: Number + var maxBufferSize: Number + var maxVertexAttributes: Number + var maxVertexBufferArrayStride: Number + var maxInterStageShaderComponents: Number + var maxInterStageShaderVariables: Number + var maxColorAttachments: Number + var maxColorAttachmentBytesPerSample: Number + var maxComputeWorkgroupStorageSize: Number + var maxComputeInvocationsPerWorkgroup: Number + var maxComputeWorkgroupSizeX: Number + var maxComputeWorkgroupSizeY: Number + var maxComputeWorkgroupSizeZ: Number + var maxComputeWorkgroupsPerDimension: Number + + companion object { + var prototype: GPUSupportedLimits + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUTexture : GPUObjectBase { + var __brand: String /* "GPUTexture" */ + fun createView(descriptor: GPUTextureViewDescriptor = definedExternally): GPUTextureView + fun destroy(): Nothing? + var width: GPUIntegerCoordinateOut + var height: GPUIntegerCoordinateOut + var depthOrArrayLayers: GPUIntegerCoordinateOut + var mipLevelCount: GPUIntegerCoordinateOut + var sampleCount: GPUSize32Out + var dimension: String /* "1d" | "2d" | "3d" */ + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var usage: GPUFlagsConstant + + companion object { + var prototype: GPUTexture + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUTextureView : GPUObjectBase { + var __brand: String /* "GPUTextureView" */ + + companion object { + var prototype: GPUTextureView + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUUncapturedErrorEvent : Event { + var __brand: String /* "GPUUncapturedErrorEvent" */ + var error: GPUError + + companion object { + var prototype: GPUUncapturedErrorEvent + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUValidationError : GPUError { + var __brand: String /* "GPUValidationError" */ + + companion object { + var prototype: GPUValidationError + } +} + +typealias WGSLLanguageFeatures = ReadonlySet + +external interface WorkerNavigator : NavigatorGPU + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUBufferUsage { + var __brand: String /* "GPUBufferUsage" */ + var MAP_READ: GPUFlagsConstant + var MAP_WRITE: GPUFlagsConstant + var COPY_SRC: GPUFlagsConstant + var COPY_DST: GPUFlagsConstant + var INDEX: GPUFlagsConstant + var VERTEX: GPUFlagsConstant + var UNIFORM: GPUFlagsConstant + var STORAGE: GPUFlagsConstant + var INDIRECT: GPUFlagsConstant + var QUERY_RESOLVE: GPUFlagsConstant + + companion object { + var prototype: GPUBufferUsage + var MAP_READ: GPUFlagsConstant + var MAP_WRITE: GPUFlagsConstant + var COPY_SRC: GPUFlagsConstant + var COPY_DST: GPUFlagsConstant + var INDEX: GPUFlagsConstant + var VERTEX: GPUFlagsConstant + var UNIFORM: GPUFlagsConstant + var STORAGE: GPUFlagsConstant + var INDIRECT: GPUFlagsConstant + var QUERY_RESOLVE: GPUFlagsConstant + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUColorWrite { + var __brand: String /* "GPUColorWrite" */ + var RED: GPUFlagsConstant + var GREEN: GPUFlagsConstant + var BLUE: GPUFlagsConstant + var ALPHA: GPUFlagsConstant + var ALL: GPUFlagsConstant + + companion object { + var prototype: GPUColorWrite + var RED: GPUFlagsConstant + var GREEN: GPUFlagsConstant + var BLUE: GPUFlagsConstant + var ALPHA: GPUFlagsConstant + var ALL: GPUFlagsConstant + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUMapMode { + var __brand: String /* "GPUMapMode" */ + var READ: GPUFlagsConstant + var WRITE: GPUFlagsConstant + + companion object { + var prototype: GPUMapMode + var READ: GPUFlagsConstant + var WRITE: GPUFlagsConstant + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUShaderStage { + var __brand: String /* "GPUShaderStage" */ + var VERTEX: GPUFlagsConstant + var FRAGMENT: GPUFlagsConstant + var COMPUTE: GPUFlagsConstant + + companion object { + var prototype: GPUShaderStage + var VERTEX: GPUFlagsConstant + var FRAGMENT: GPUFlagsConstant + var COMPUTE: GPUFlagsConstant + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUTextureUsage { + var __brand: String /* "GPUTextureUsage" */ + var COPY_SRC: GPUFlagsConstant + var COPY_DST: GPUFlagsConstant + var TEXTURE_BINDING: GPUFlagsConstant + var STORAGE_BINDING: GPUFlagsConstant + var RENDER_ATTACHMENT: GPUFlagsConstant + + companion object { + var prototype: GPUTextureUsage + var COPY_SRC: GPUFlagsConstant + var COPY_DST: GPUFlagsConstant + var TEXTURE_BINDING: GPUFlagsConstant + var STORAGE_BINDING: GPUFlagsConstant + var RENDER_ATTACHMENT: GPUFlagsConstant + } +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-ts/src/lib.dom.kt b/bindings/wgpu/webgpu-ts/src/lib.dom.kt new file mode 100644 index 00000000..2fa0a51c --- /dev/null +++ b/bindings/wgpu/webgpu-ts/src/lib.dom.kt @@ -0,0 +1,7215 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package tsstdlib + +import kotlin.js.* +import org.khronos.webgl.* +import org.w3c.dom.* +import org.w3c.dom.events.* +import org.w3c.dom.parsing.* +import org.w3c.dom.svg.* +import org.w3c.dom.url.* +import org.w3c.fetch.* +import org.w3c.files.* +import org.w3c.notifications.* +import org.w3c.performance.* +import org.w3c.workers.* +import org.w3c.xhr.* + +external interface AesCbcParams : Algorithm { + var iv: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally +} + +external interface AesCtrParams : Algorithm { + var counter: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally + var length: Number +} + +external interface AesDerivedKeyParams : Algorithm { + var length: Number +} + +external interface AesGcmParams : Algorithm { + var additionalData: dynamic /* Int8Array? | Int16Array? | Int32Array? | Uint8Array? | Uint16Array? | Uint32Array? | Uint8ClampedArray? | Float32Array? | Float64Array? | DataView? | ArrayBuffer? */ + get() = definedExternally + set(value) = definedExternally + var iv: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally + var tagLength: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface AesKeyAlgorithm : KeyAlgorithm { + var length: Number +} + +external interface AesKeyGenParams : Algorithm { + var length: Number +} + +external interface Algorithm { + var name: String +} + +external interface AnimationEventInit : EventInit { + var animationName: String? + get() = definedExternally + set(value) = definedExternally + var elapsedTime: Number? + get() = definedExternally + set(value) = definedExternally + var pseudoElement: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface AnimationPlaybackEventInit : EventInit { + var currentTime: Number? + get() = definedExternally + set(value) = definedExternally + var timelineTime: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface AudioBufferOptions { + var length: Number + var numberOfChannels: Number? + get() = definedExternally + set(value) = definedExternally + var sampleRate: Number +} + +external interface AudioProcessingEventInit : EventInit { + var inputBuffer: AudioBuffer + var outputBuffer: AudioBuffer + var playbackTime: Number +} + +external interface AuthenticationExtensionsClientInputs { + var appid: String? + get() = definedExternally + set(value) = definedExternally + var authnSel: AuthenticatorSelectionList? + get() = definedExternally + set(value) = definedExternally + var exts: Boolean? + get() = definedExternally + set(value) = definedExternally + var loc: Boolean? + get() = definedExternally + set(value) = definedExternally + var txAuthGeneric: txAuthGenericArg? + get() = definedExternally + set(value) = definedExternally + var txAuthSimple: String? + get() = definedExternally + set(value) = definedExternally + var uvi: Boolean? + get() = definedExternally + set(value) = definedExternally + var uvm: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface AuthenticatorSelectionCriteria { + var authenticatorAttachment: String? /* "cross-platform" | "platform" */ + get() = definedExternally + set(value) = definedExternally + var requireResidentKey: Boolean? + get() = definedExternally + set(value) = definedExternally + var userVerification: String? /* "discouraged" | "preferred" | "required" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface ClipboardEventInit : EventInit { + var clipboardData: DataTransfer? + get() = definedExternally + set(value) = definedExternally +} + +external interface ComputedEffectTiming : EffectTiming { + var activeDuration: Number? + get() = definedExternally + set(value) = definedExternally + var currentIteration: Number? + get() = definedExternally + set(value) = definedExternally + var endTime: Number? + get() = definedExternally + set(value) = definedExternally + var localTime: Number? + get() = definedExternally + set(value) = definedExternally + var progress: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface ConfirmSiteSpecificExceptionsInformation : ExceptionInformation { + var arrayOfDomainStrings: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface ConstrainBooleanParameters { + var exact: Boolean? + get() = definedExternally + set(value) = definedExternally + var ideal: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface ConstrainDOMStringParameters { + var exact: dynamic /* String? | Array? */ + get() = definedExternally + set(value) = definedExternally + var ideal: dynamic /* String? | Array? */ + get() = definedExternally + set(value) = definedExternally +} + +external interface ConstrainDoubleRange : DoubleRange { + var exact: Number? + get() = definedExternally + set(value) = definedExternally + var ideal: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface ConstrainULongRange : ULongRange { + var exact: Number? + get() = definedExternally + set(value) = definedExternally + var ideal: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface CredentialCreationOptions { + var publicKey: PublicKeyCredentialCreationOptions? + get() = definedExternally + set(value) = definedExternally + var signal: AbortSignal? + get() = definedExternally + set(value) = definedExternally +} + +external interface CredentialRequestOptions { + var mediation: String? /* "optional" | "required" | "silent" */ + get() = definedExternally + set(value) = definedExternally + var publicKey: PublicKeyCredentialRequestOptions? + get() = definedExternally + set(value) = definedExternally + var signal: AbortSignal? + get() = definedExternally + set(value) = definedExternally +} + +external interface DOMMatrix2DInit { + var a: Number? + get() = definedExternally + set(value) = definedExternally + var b: Number? + get() = definedExternally + set(value) = definedExternally + var c: Number? + get() = definedExternally + set(value) = definedExternally + var d: Number? + get() = definedExternally + set(value) = definedExternally + var e: Number? + get() = definedExternally + set(value) = definedExternally + var f: Number? + get() = definedExternally + set(value) = definedExternally + var m11: Number? + get() = definedExternally + set(value) = definedExternally + var m12: Number? + get() = definedExternally + set(value) = definedExternally + var m21: Number? + get() = definedExternally + set(value) = definedExternally + var m22: Number? + get() = definedExternally + set(value) = definedExternally + var m41: Number? + get() = definedExternally + set(value) = definedExternally + var m42: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DOMMatrixInit : DOMMatrix2DInit { + var is2D: Boolean? + get() = definedExternally + set(value) = definedExternally + var m13: Number? + get() = definedExternally + set(value) = definedExternally + var m14: Number? + get() = definedExternally + set(value) = definedExternally + var m23: Number? + get() = definedExternally + set(value) = definedExternally + var m24: Number? + get() = definedExternally + set(value) = definedExternally + var m31: Number? + get() = definedExternally + set(value) = definedExternally + var m32: Number? + get() = definedExternally + set(value) = definedExternally + var m33: Number? + get() = definedExternally + set(value) = definedExternally + var m34: Number? + get() = definedExternally + set(value) = definedExternally + var m43: Number? + get() = definedExternally + set(value) = definedExternally + var m44: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DeviceLightEventInit : EventInit { + var value: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DeviceMotionEventAccelerationInit { + var x: Number? + get() = definedExternally + set(value) = definedExternally + var y: Number? + get() = definedExternally + set(value) = definedExternally + var z: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DeviceMotionEventInit : EventInit { + var acceleration: DeviceMotionEventAccelerationInit? + get() = definedExternally + set(value) = definedExternally + var accelerationIncludingGravity: DeviceMotionEventAccelerationInit? + get() = definedExternally + set(value) = definedExternally + var interval: Number? + get() = definedExternally + set(value) = definedExternally + var rotationRate: DeviceMotionEventRotationRateInit? + get() = definedExternally + set(value) = definedExternally +} + +external interface DeviceMotionEventRotationRateInit { + var alpha: Number? + get() = definedExternally + set(value) = definedExternally + var beta: Number? + get() = definedExternally + set(value) = definedExternally + var gamma: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DeviceOrientationEventInit : EventInit { + var absolute: Boolean? + get() = definedExternally + set(value) = definedExternally + var alpha: Number? + get() = definedExternally + set(value) = definedExternally + var beta: Number? + get() = definedExternally + set(value) = definedExternally + var gamma: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DevicePermissionDescriptor : PermissionDescriptor { + var deviceId: String? + get() = definedExternally + set(value) = definedExternally + override var name: String /* "camera" | "microphone" | "speaker" */ +} + +external interface DocumentTimelineOptions { + var originTime: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DoubleRange { + var max: Number? + get() = definedExternally + set(value) = definedExternally + var min: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface EcKeyGenParams : Algorithm { + var namedCurve: NamedCurve +} + +external interface EcKeyImportParams : Algorithm { + var namedCurve: NamedCurve +} + +external interface EcdhKeyDeriveParams : Algorithm { + var public: CryptoKey +} + +external interface EcdsaParams : Algorithm { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally +} + +external interface EffectTiming { + var delay: Number? + get() = definedExternally + set(value) = definedExternally + var direction: String? /* "alternate" | "alternate-reverse" | "normal" | "reverse" */ + get() = definedExternally + set(value) = definedExternally + var duration: dynamic /* Number? | String? */ + get() = definedExternally + set(value) = definedExternally + var easing: String? + get() = definedExternally + set(value) = definedExternally + var endDelay: Number? + get() = definedExternally + set(value) = definedExternally + var fill: String? /* "auto" | "backwards" | "both" | "forwards" | "none" */ + get() = definedExternally + set(value) = definedExternally + var iterationStart: Number? + get() = definedExternally + set(value) = definedExternally + var iterations: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface ExceptionInformation { + var domain: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface FocusNavigationEventInit : EventInit { + var navigationReason: String? + get() = definedExternally + set(value) = definedExternally + var originHeight: Number? + get() = definedExternally + set(value) = definedExternally + var originLeft: Number? + get() = definedExternally + set(value) = definedExternally + var originTop: Number? + get() = definedExternally + set(value) = definedExternally + var originWidth: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface FocusNavigationOrigin { + var originHeight: Number? + get() = definedExternally + set(value) = definedExternally + var originLeft: Number? + get() = definedExternally + set(value) = definedExternally + var originTop: Number? + get() = definedExternally + set(value) = definedExternally + var originWidth: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface FocusOptions { + var preventScroll: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface FullscreenOptions { + var navigationUI: String? /* "auto" | "hide" | "show" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GamepadEventInit : EventInit { + var gamepad: Gamepad +} + +external interface HmacImportParams : Algorithm { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally + var length: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface HmacKeyGenParams : Algorithm { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally + var length: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface IDBIndexParameters { + var multiEntry: Boolean? + get() = definedExternally + set(value) = definedExternally + var unique: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface IDBObjectStoreParameters { + var autoIncrement: Boolean? + get() = definedExternally + set(value) = definedExternally + var keyPath: dynamic /* String? | Array? */ + get() = definedExternally + set(value) = definedExternally +} + +external interface IDBVersionChangeEventInit : EventInit { + var newVersion: Number? + get() = definedExternally + set(value) = definedExternally + var oldVersion: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface ImageEncodeOptions { + var quality: Number? + get() = definedExternally + set(value) = definedExternally + var type: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface JsonWebKey { + var alg: String? + get() = definedExternally + set(value) = definedExternally + var crv: String? + get() = definedExternally + set(value) = definedExternally + var d: String? + get() = definedExternally + set(value) = definedExternally + var dp: String? + get() = definedExternally + set(value) = definedExternally + var dq: String? + get() = definedExternally + set(value) = definedExternally + var e: String? + get() = definedExternally + set(value) = definedExternally + var ext: Boolean? + get() = definedExternally + set(value) = definedExternally + var k: String? + get() = definedExternally + set(value) = definedExternally + var key_ops: Array? + get() = definedExternally + set(value) = definedExternally + var kty: String? + get() = definedExternally + set(value) = definedExternally + var n: String? + get() = definedExternally + set(value) = definedExternally + var oth: Array? + get() = definedExternally + set(value) = definedExternally + var p: String? + get() = definedExternally + set(value) = definedExternally + var q: String? + get() = definedExternally + set(value) = definedExternally + var qi: String? + get() = definedExternally + set(value) = definedExternally + var use: String? + get() = definedExternally + set(value) = definedExternally + var x: String? + get() = definedExternally + set(value) = definedExternally + var y: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface KeyAlgorithm { + var name: String +} + +external interface Keyframe { + var composite: String? /* "accumulate" | "add" | "auto" | "replace" */ + get() = definedExternally + set(value) = definedExternally + var easing: String? + get() = definedExternally + set(value) = definedExternally + var offset: Number? + get() = definedExternally + set(value) = definedExternally + @nativeGetter + operator fun get(property: String): dynamic /* String? | Number? */ + @nativeSetter + operator fun set(property: String, value: String?) + @nativeSetter + operator fun set(property: String, value: Number?) +} + +external interface KeyframeAnimationOptions : KeyframeEffectOptions { + var id: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface KeyframeEffectOptions : EffectTiming { + var composite: String? /* "accumulate" | "add" | "replace" */ + get() = definedExternally + set(value) = definedExternally + var iterationComposite: String? /* "accumulate" | "replace" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaEncryptedEventInit : EventInit { + var initData: ArrayBuffer? + get() = definedExternally + set(value) = definedExternally + var initDataType: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaKeyMessageEventInit : EventInit { + var message: ArrayBuffer + var messageType: String /* "individualization-request" | "license-release" | "license-renewal" | "license-request" */ +} + +external interface MediaKeySystemConfiguration { + var audioCapabilities: Array? + get() = definedExternally + set(value) = definedExternally + var distinctiveIdentifier: String? /* "not-allowed" | "optional" | "required" */ + get() = definedExternally + set(value) = definedExternally + var initDataTypes: Array? + get() = definedExternally + set(value) = definedExternally + var label: String? + get() = definedExternally + set(value) = definedExternally + var persistentState: String? /* "not-allowed" | "optional" | "required" */ + get() = definedExternally + set(value) = definedExternally + var sessionTypes: Array? + get() = definedExternally + set(value) = definedExternally + var videoCapabilities: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaKeySystemMediaCapability { + var contentType: String? + get() = definedExternally + set(value) = definedExternally + var robustness: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaStreamConstraints { + var audio: dynamic /* Boolean? | MediaTrackConstraints? */ + get() = definedExternally + set(value) = definedExternally + var peerIdentity: String? + get() = definedExternally + set(value) = definedExternally + var video: dynamic /* Boolean? | MediaTrackConstraints? */ + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaStreamErrorEventInit : EventInit { + var error: MediaStreamError? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaStreamEventInit : EventInit { + var stream: MediaStream? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaStreamTrackEventInit : EventInit { + var track: MediaStreamTrack +} + +external interface MediaTrackCapabilities { + var aspectRatio: DoubleRange? + get() = definedExternally + set(value) = definedExternally + var autoGainControl: Array? + get() = definedExternally + set(value) = definedExternally + var channelCount: ULongRange? + get() = definedExternally + set(value) = definedExternally + var deviceId: String? + get() = definedExternally + set(value) = definedExternally + var echoCancellation: Array? + get() = definedExternally + set(value) = definedExternally + var facingMode: Array? + get() = definedExternally + set(value) = definedExternally + var frameRate: DoubleRange? + get() = definedExternally + set(value) = definedExternally + var groupId: String? + get() = definedExternally + set(value) = definedExternally + var height: ULongRange? + get() = definedExternally + set(value) = definedExternally + var latency: DoubleRange? + get() = definedExternally + set(value) = definedExternally + var noiseSuppression: Array? + get() = definedExternally + set(value) = definedExternally + var resizeMode: Array? + get() = definedExternally + set(value) = definedExternally + var sampleRate: ULongRange? + get() = definedExternally + set(value) = definedExternally + var sampleSize: ULongRange? + get() = definedExternally + set(value) = definedExternally + var width: ULongRange? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaTrackConstraintSet { + var aspectRatio: dynamic /* Number? | ConstrainDoubleRange? */ + get() = definedExternally + set(value) = definedExternally + var autoGainControl: dynamic /* Boolean? | ConstrainBooleanParameters? */ + get() = definedExternally + set(value) = definedExternally + var channelCount: dynamic /* Number? | ConstrainULongRange? */ + get() = definedExternally + set(value) = definedExternally + var deviceId: dynamic /* String? | Array? | ConstrainDOMStringParameters? */ + get() = definedExternally + set(value) = definedExternally + var echoCancellation: dynamic /* Boolean? | ConstrainBooleanParameters? */ + get() = definedExternally + set(value) = definedExternally + var facingMode: dynamic /* String? | Array? | ConstrainDOMStringParameters? */ + get() = definedExternally + set(value) = definedExternally + var frameRate: dynamic /* Number? | ConstrainDoubleRange? */ + get() = definedExternally + set(value) = definedExternally + var groupId: dynamic /* String? | Array? | ConstrainDOMStringParameters? */ + get() = definedExternally + set(value) = definedExternally + var height: dynamic /* Number? | ConstrainULongRange? */ + get() = definedExternally + set(value) = definedExternally + var latency: dynamic /* Number? | ConstrainDoubleRange? */ + get() = definedExternally + set(value) = definedExternally + var noiseSuppression: dynamic /* Boolean? | ConstrainBooleanParameters? */ + get() = definedExternally + set(value) = definedExternally + var resizeMode: dynamic /* String? | Array? | ConstrainDOMStringParameters? */ + get() = definedExternally + set(value) = definedExternally + var sampleRate: dynamic /* Number? | ConstrainULongRange? */ + get() = definedExternally + set(value) = definedExternally + var sampleSize: dynamic /* Number? | ConstrainULongRange? */ + get() = definedExternally + set(value) = definedExternally + var width: dynamic /* Number? | ConstrainULongRange? */ + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaTrackConstraints : MediaTrackConstraintSet { + var advanced: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaTrackSettings { + var aspectRatio: Number? + get() = definedExternally + set(value) = definedExternally + var autoGainControl: Boolean? + get() = definedExternally + set(value) = definedExternally + var channelCount: Number? + get() = definedExternally + set(value) = definedExternally + var deviceId: String? + get() = definedExternally + set(value) = definedExternally + var echoCancellation: Boolean? + get() = definedExternally + set(value) = definedExternally + var facingMode: String? + get() = definedExternally + set(value) = definedExternally + var frameRate: Number? + get() = definedExternally + set(value) = definedExternally + var groupId: String? + get() = definedExternally + set(value) = definedExternally + var height: Number? + get() = definedExternally + set(value) = definedExternally + var latency: Number? + get() = definedExternally + set(value) = definedExternally + var noiseSuppression: Boolean? + get() = definedExternally + set(value) = definedExternally + var resizeMode: String? + get() = definedExternally + set(value) = definedExternally + var sampleRate: Number? + get() = definedExternally + set(value) = definedExternally + var sampleSize: Number? + get() = definedExternally + set(value) = definedExternally + var width: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaTrackSupportedConstraints { + var aspectRatio: Boolean? + get() = definedExternally + set(value) = definedExternally + var autoGainControl: Boolean? + get() = definedExternally + set(value) = definedExternally + var channelCount: Boolean? + get() = definedExternally + set(value) = definedExternally + var deviceId: Boolean? + get() = definedExternally + set(value) = definedExternally + var echoCancellation: Boolean? + get() = definedExternally + set(value) = definedExternally + var facingMode: Boolean? + get() = definedExternally + set(value) = definedExternally + var frameRate: Boolean? + get() = definedExternally + set(value) = definedExternally + var groupId: Boolean? + get() = definedExternally + set(value) = definedExternally + var height: Boolean? + get() = definedExternally + set(value) = definedExternally + var latency: Boolean? + get() = definedExternally + set(value) = definedExternally + var noiseSuppression: Boolean? + get() = definedExternally + set(value) = definedExternally + var resizeMode: Boolean? + get() = definedExternally + set(value) = definedExternally + var sampleRate: Boolean? + get() = definedExternally + set(value) = definedExternally + var sampleSize: Boolean? + get() = definedExternally + set(value) = definedExternally + var width: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface MidiPermissionDescriptor : PermissionDescriptor { + override var name: String /* "midi" */ + var sysex: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface MultiCacheQueryOptions : CacheQueryOptions { + var cacheName: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface NavigationPreloadState { + var enabled: Boolean? + get() = definedExternally + set(value) = definedExternally + var headerValue: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface OfflineAudioCompletionEventInit : EventInit { + var renderedBuffer: AudioBuffer +} + +external interface OptionalEffectTiming { + var delay: Number? + get() = definedExternally + set(value) = definedExternally + var direction: String? /* "alternate" | "alternate-reverse" | "normal" | "reverse" */ + get() = definedExternally + set(value) = definedExternally + var duration: dynamic /* Number? | String? */ + get() = definedExternally + set(value) = definedExternally + var easing: String? + get() = definedExternally + set(value) = definedExternally + var endDelay: Number? + get() = definedExternally + set(value) = definedExternally + var fill: String? /* "auto" | "backwards" | "both" | "forwards" | "none" */ + get() = definedExternally + set(value) = definedExternally + var iterationStart: Number? + get() = definedExternally + set(value) = definedExternally + var iterations: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface PaymentCurrencyAmount { + var currency: String + var currencySystem: String? + get() = definedExternally + set(value) = definedExternally + var value: String +} + +external interface PaymentDetailsBase { + var displayItems: Array? + get() = definedExternally + set(value) = definedExternally + var modifiers: Array? + get() = definedExternally + set(value) = definedExternally + var shippingOptions: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface PaymentDetailsModifier { + var additionalDisplayItems: Array? + get() = definedExternally + set(value) = definedExternally + var data: Any? + get() = definedExternally + set(value) = definedExternally + var supportedMethods: dynamic /* String | Array */ + get() = definedExternally + set(value) = definedExternally + var total: PaymentItem? + get() = definedExternally + set(value) = definedExternally +} + +external interface PaymentDetailsUpdate : PaymentDetailsBase { + var error: String? + get() = definedExternally + set(value) = definedExternally + var total: PaymentItem? + get() = definedExternally + set(value) = definedExternally +} + +external interface PaymentItem { + var amount: PaymentCurrencyAmount + var label: String + var pending: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface PaymentRequestUpdateEventInit : EventInit + +external interface PaymentShippingOption { + var amount: PaymentCurrencyAmount + var id: String + var label: String + var selected: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface Pbkdf2Params : Algorithm { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally + var iterations: Number + var salt: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally +} + +external interface PermissionDescriptor { + var name: String /* "accelerometer" | "ambient-light-sensor" | "background-sync" | "bluetooth" | "camera" | "clipboard" | "device-info" | "geolocation" | "gyroscope" | "magnetometer" | "microphone" | "midi" | "notifications" | "persistent-storage" | "push" | "speaker" */ +} + +external interface PipeOptions { + var preventAbort: Boolean? + get() = definedExternally + set(value) = definedExternally + var preventCancel: Boolean? + get() = definedExternally + set(value) = definedExternally + var preventClose: Boolean? + get() = definedExternally + set(value) = definedExternally + var signal: AbortSignal? + get() = definedExternally + set(value) = definedExternally +} + +external interface PointerEventInit : MouseEventInit { + var height: Number? + get() = definedExternally + set(value) = definedExternally + var isPrimary: Boolean? + get() = definedExternally + set(value) = definedExternally + var pointerId: Number? + get() = definedExternally + set(value) = definedExternally + var pointerType: String? + get() = definedExternally + set(value) = definedExternally + var pressure: Number? + get() = definedExternally + set(value) = definedExternally + var tangentialPressure: Number? + get() = definedExternally + set(value) = definedExternally + var tiltX: Number? + get() = definedExternally + set(value) = definedExternally + var tiltY: Number? + get() = definedExternally + set(value) = definedExternally + var twist: Number? + get() = definedExternally + set(value) = definedExternally + var width: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface PositionOptions { + var enableHighAccuracy: Boolean? + get() = definedExternally + set(value) = definedExternally + var maximumAge: Number? + get() = definedExternally + set(value) = definedExternally + var timeout: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface PostMessageOptions { + var transfer: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface PropertyIndexedKeyframes { + var composite: dynamic /* "accumulate" | "add" | "auto" | "replace" | Array? */ + get() = definedExternally + set(value) = definedExternally + var easing: dynamic /* String? | Array? */ + get() = definedExternally + set(value) = definedExternally + var offset: dynamic /* Number? | Array? */ + get() = definedExternally + set(value) = definedExternally + @nativeGetter + operator fun get(property: String): dynamic /* String? | Array? | Number? | Array? */ + @nativeSetter + operator fun set(property: String, value: String?) + @nativeSetter + operator fun set(property: String, value: Array?) + @nativeSetter + operator fun set(property: String, value: Number?) + @nativeSetter + operator fun set(property: String, value: Array?) +} + +external interface PublicKeyCredentialCreationOptions { + var attestation: String? /* "direct" | "indirect" | "none" */ + get() = definedExternally + set(value) = definedExternally + var authenticatorSelection: AuthenticatorSelectionCriteria? + get() = definedExternally + set(value) = definedExternally + var challenge: dynamic /* ArrayBufferView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally + var excludeCredentials: Array? + get() = definedExternally + set(value) = definedExternally + var extensions: AuthenticationExtensionsClientInputs? + get() = definedExternally + set(value) = definedExternally + var pubKeyCredParams: Array + var rp: PublicKeyCredentialRpEntity + var timeout: Number? + get() = definedExternally + set(value) = definedExternally + var user: PublicKeyCredentialUserEntity +} + +external interface PublicKeyCredentialDescriptor { + var id: dynamic /* ArrayBufferView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally + var transports: Array? + get() = definedExternally + set(value) = definedExternally + var type: String /* "public-key" */ +} + +external interface PublicKeyCredentialEntity { + var icon: String? + get() = definedExternally + set(value) = definedExternally + var name: String +} + +external interface PublicKeyCredentialParameters { + var alg: COSEAlgorithmIdentifier + var type: String /* "public-key" */ +} + +external interface PublicKeyCredentialRequestOptions { + var allowCredentials: Array? + get() = definedExternally + set(value) = definedExternally + var challenge: dynamic /* ArrayBufferView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally + var extensions: AuthenticationExtensionsClientInputs? + get() = definedExternally + set(value) = definedExternally + var rpId: String? + get() = definedExternally + set(value) = definedExternally + var timeout: Number? + get() = definedExternally + set(value) = definedExternally + var userVerification: String? /* "discouraged" | "preferred" | "required" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface PublicKeyCredentialRpEntity : PublicKeyCredentialEntity { + var id: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface PublicKeyCredentialUserEntity : PublicKeyCredentialEntity { + var displayName: String + var id: dynamic /* ArrayBufferView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally +} + +external interface PushPermissionDescriptor : PermissionDescriptor { + override var name: String /* "push" */ + var userVisibleOnly: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface PushSubscriptionJSON { + var endpoint: String? + get() = definedExternally + set(value) = definedExternally + var expirationTime: Number? + get() = definedExternally + set(value) = definedExternally + var keys: Record? + get() = definedExternally + set(value) = definedExternally +} + +external interface PushSubscriptionOptionsInit { + var applicationServerKey: dynamic /* ArrayBufferView? | ArrayBuffer? | String? */ + get() = definedExternally + set(value) = definedExternally + var userVisibleOnly: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface QueuingStrategy { + var highWaterMark: Number? + get() = definedExternally + set(value) = definedExternally + var size: QueuingStrategySizeCallback? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCDTMFToneChangeEventInit : EventInit { + var tone: String +} + +external interface RTCDataChannelEventInit : EventInit { + var channel: RTCDataChannel +} + +external interface RTCErrorEventInit : EventInit { + var error: RTCError +} + +external interface RTCErrorInit { + var errorDetail: String /* "data-channel-failure" | "dtls-failure" | "fingerprint-failure" | "hardware-encoder-error" | "hardware-encoder-not-available" | "idp-bad-script-failure" | "idp-execution-failure" | "idp-load-failure" | "idp-need-login" | "idp-timeout" | "idp-tls-failure" | "idp-token-expired" | "idp-token-invalid" | "sctp-failure" | "sdp-syntax-error" */ + var httpRequestStatusCode: Number? + get() = definedExternally + set(value) = definedExternally + var receivedAlert: Number? + get() = definedExternally + set(value) = definedExternally + var sctpCauseCode: Number? + get() = definedExternally + set(value) = definedExternally + var sdpLineNumber: Number? + get() = definedExternally + set(value) = definedExternally + var sentAlert: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCIceCandidateComplete + +external interface RTCIceCandidateDictionary { + var foundation: String? + get() = definedExternally + set(value) = definedExternally + var ip: String? + get() = definedExternally + set(value) = definedExternally + var msMTurnSessionId: String? + get() = definedExternally + set(value) = definedExternally + var port: Number? + get() = definedExternally + set(value) = definedExternally + var priority: Number? + get() = definedExternally + set(value) = definedExternally + var protocol: String? /* "tcp" | "udp" */ + get() = definedExternally + set(value) = definedExternally + var relatedAddress: String? + get() = definedExternally + set(value) = definedExternally + var relatedPort: Number? + get() = definedExternally + set(value) = definedExternally + var tcpType: String? /* "active" | "passive" | "so" */ + get() = definedExternally + set(value) = definedExternally + var type: String? /* "host" | "prflx" | "relay" | "srflx" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCIceCandidateInit { + var candidate: String? + get() = definedExternally + set(value) = definedExternally + var sdpMLineIndex: Number? + get() = definedExternally + set(value) = definedExternally + var sdpMid: String? + get() = definedExternally + set(value) = definedExternally + var usernameFragment: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCIceCandidatePair { + var local: RTCIceCandidate? + get() = definedExternally + set(value) = definedExternally + var remote: RTCIceCandidate? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCIceParameters { + var password: String? + get() = definedExternally + set(value) = definedExternally + var usernameFragment: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCPeerConnectionIceErrorEventInit : EventInit { + var errorCode: Number + var hostCandidate: String? + get() = definedExternally + set(value) = definedExternally + var statusText: String? + get() = definedExternally + set(value) = definedExternally + var url: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCPeerConnectionIceEventInit : EventInit { + var candidate: RTCIceCandidate? + get() = definedExternally + set(value) = definedExternally + var url: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtcpParameters { + var cname: String? + get() = definedExternally + set(value) = definedExternally + var reducedSize: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpCapabilities { + var codecs: Array + var headerExtensions: Array +} + +external interface RTCRtpCodecCapability { + var channels: Number? + get() = definedExternally + set(value) = definedExternally + var clockRate: Number + var mimeType: String + var sdpFmtpLine: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpCodecParameters { + var channels: Number? + get() = definedExternally + set(value) = definedExternally + var clockRate: Number + var mimeType: String + var payloadType: Number + var sdpFmtpLine: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpCodingParameters { + var rid: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpContributingSource { + var audioLevel: Number? + get() = definedExternally + set(value) = definedExternally + var rtpTimestamp: Number + var source: Number + var timestamp: Number +} + +external interface RTCRtpDecodingParameters : RTCRtpCodingParameters + +external interface RTCRtpEncodingParameters : RTCRtpCodingParameters { + var active: Boolean? + get() = definedExternally + set(value) = definedExternally + var codecPayloadType: Number? + get() = definedExternally + set(value) = definedExternally + var dtx: String? /* "disabled" | "enabled" */ + get() = definedExternally + set(value) = definedExternally + var maxBitrate: Number? + get() = definedExternally + set(value) = definedExternally + var maxFramerate: Number? + get() = definedExternally + set(value) = definedExternally + var ptime: Number? + get() = definedExternally + set(value) = definedExternally + var scaleResolutionDownBy: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpHeaderExtensionCapability { + var uri: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpHeaderExtensionParameters { + var encrypted: Boolean? + get() = definedExternally + set(value) = definedExternally + var id: Number + var uri: String +} + +external interface RTCRtpParameters { + var codecs: Array + var headerExtensions: Array + var rtcp: RTCRtcpParameters +} + +external interface RTCRtpReceiveParameters : RTCRtpParameters { + var encodings: Array +} + +external interface RTCRtpSendParameters : RTCRtpParameters { + var degradationPreference: String? /* "balanced" | "maintain-framerate" | "maintain-resolution" */ + get() = definedExternally + set(value) = definedExternally + var encodings: Array + var priority: String? /* "high" | "low" | "medium" | "very-low" */ + get() = definedExternally + set(value) = definedExternally + var transactionId: String +} + +external interface RTCRtpSynchronizationSource : RTCRtpContributingSource { + var voiceActivityFlag: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCStatsEventInit : EventInit { + var report: RTCStatsReport +} + +external interface RTCStatsReport : ReadonlyMap { + fun forEach(callbackfn: (value: Any, key: String, parent: RTCStatsReport) -> Unit, thisArg: Any = definedExternally) +} + +external interface RTCTrackEventInit : EventInit { + var receiver: RTCRtpReceiver + var streams: Array? + get() = definedExternally + set(value) = definedExternally + var track: MediaStreamTrack + var transceiver: RTCRtpTransceiver +} + +external interface ReadableStreamReadDoneResult { + var done: Boolean + var value: T? + get() = definedExternally + set(value) = definedExternally +} + +external interface ReadableStreamReadValueResult { + var done: Boolean + var value: T +} + +external interface RsaHashedImportParams : Algorithm { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally +} + +external interface RsaHashedKeyGenParams : RsaKeyGenParams { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally +} + +external interface RsaKeyGenParams : Algorithm { + var modulusLength: Number + var publicExponent: BigInteger +} + +external interface RsaOaepParams : Algorithm { + var label: dynamic /* Int8Array? | Int16Array? | Int32Array? | Uint8Array? | Uint16Array? | Uint32Array? | Uint8ClampedArray? | Float32Array? | Float64Array? | DataView? | ArrayBuffer? */ + get() = definedExternally + set(value) = definedExternally +} + +external interface RsaOtherPrimesInfo { + var d: String? + get() = definedExternally + set(value) = definedExternally + var r: String? + get() = definedExternally + set(value) = definedExternally + var t: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RsaPssParams : Algorithm { + var saltLength: Number +} + +external interface SecurityPolicyViolationEventInit : EventInit { + var blockedURI: String? + get() = definedExternally + set(value) = definedExternally + var columnNumber: Number? + get() = definedExternally + set(value) = definedExternally + var documentURI: String? + get() = definedExternally + set(value) = definedExternally + var effectiveDirective: String? + get() = definedExternally + set(value) = definedExternally + var lineNumber: Number? + get() = definedExternally + set(value) = definedExternally + var originalPolicy: String? + get() = definedExternally + set(value) = definedExternally + var referrer: String? + get() = definedExternally + set(value) = definedExternally + var sourceFile: String? + get() = definedExternally + set(value) = definedExternally + var statusCode: Number? + get() = definedExternally + set(value) = definedExternally + var violatedDirective: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface ShareData { + var text: String? + get() = definedExternally + set(value) = definedExternally + var title: String? + get() = definedExternally + set(value) = definedExternally + var url: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface SpeechSynthesisErrorEventInit : SpeechSynthesisEventInit { + var error: String /* "audio-busy" | "audio-hardware" | "canceled" | "interrupted" | "invalid-argument" | "language-unavailable" | "network" | "not-allowed" | "synthesis-failed" | "synthesis-unavailable" | "text-too-long" | "voice-unavailable" */ +} + +external interface SpeechSynthesisEventInit : EventInit { + var charIndex: Number? + get() = definedExternally + set(value) = definedExternally + var charLength: Number? + get() = definedExternally + set(value) = definedExternally + var elapsedTime: Number? + get() = definedExternally + set(value) = definedExternally + var name: String? + get() = definedExternally + set(value) = definedExternally + var utterance: SpeechSynthesisUtterance +} + +external interface StorageEstimate { + var quota: Number? + get() = definedExternally + set(value) = definedExternally + var usage: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface StoreExceptionsInformation : ExceptionInformation { + var detailURI: String? + get() = definedExternally + set(value) = definedExternally + var explanationString: String? + get() = definedExternally + set(value) = definedExternally + var siteName: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface StoreSiteSpecificExceptionsInformation : StoreExceptionsInformation { + var arrayOfDomainStrings: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface TouchEventInit : EventModifierInit { + var changedTouches: Array? + get() = definedExternally + set(value) = definedExternally + var targetTouches: Array? + get() = definedExternally + set(value) = definedExternally + var touches: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface TouchInit { + var altitudeAngle: Number? + get() = definedExternally + set(value) = definedExternally + var azimuthAngle: Number? + get() = definedExternally + set(value) = definedExternally + var clientX: Number? + get() = definedExternally + set(value) = definedExternally + var clientY: Number? + get() = definedExternally + set(value) = definedExternally + var force: Number? + get() = definedExternally + set(value) = definedExternally + var identifier: Number + var pageX: Number? + get() = definedExternally + set(value) = definedExternally + var pageY: Number? + get() = definedExternally + set(value) = definedExternally + var radiusX: Number? + get() = definedExternally + set(value) = definedExternally + var radiusY: Number? + get() = definedExternally + set(value) = definedExternally + var rotationAngle: Number? + get() = definedExternally + set(value) = definedExternally + var screenX: Number? + get() = definedExternally + set(value) = definedExternally + var screenY: Number? + get() = definedExternally + set(value) = definedExternally + var target: EventTarget + var touchType: String? /* "direct" | "stylus" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface TransitionEventInit : EventInit { + var elapsedTime: Number? + get() = definedExternally + set(value) = definedExternally + var propertyName: String? + get() = definedExternally + set(value) = definedExternally + var pseudoElement: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface ULongRange { + var max: Number? + get() = definedExternally + set(value) = definedExternally + var min: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface UnderlyingByteSource { + var autoAllocateChunkSize: Number? + get() = definedExternally + set(value) = definedExternally + var cancel: ReadableStreamErrorCallback? + get() = definedExternally + set(value) = definedExternally + var pull: ReadableByteStreamControllerCallback? + get() = definedExternally + set(value) = definedExternally + var start: ReadableByteStreamControllerCallback? + get() = definedExternally + set(value) = definedExternally + var type: String /* "bytes" */ +} + +external interface UnderlyingSink { + var abort: WritableStreamErrorCallback? + get() = definedExternally + set(value) = definedExternally + var close: WritableStreamDefaultControllerCloseCallback? + get() = definedExternally + set(value) = definedExternally + var start: WritableStreamDefaultControllerStartCallback? + get() = definedExternally + set(value) = definedExternally + var type: Any? + get() = definedExternally + set(value) = definedExternally + var write: WritableStreamDefaultControllerWriteCallback? + get() = definedExternally + set(value) = definedExternally +} + +external interface UnderlyingSource { + var cancel: ReadableStreamErrorCallback? + get() = definedExternally + set(value) = definedExternally + var pull: ReadableStreamDefaultControllerCallback? + get() = definedExternally + set(value) = definedExternally + var start: ReadableStreamDefaultControllerCallback? + get() = definedExternally + set(value) = definedExternally + var type: Any? + get() = definedExternally + set(value) = definedExternally +} + +external interface VRDisplayEventInit : EventInit { + var display: VRDisplay + var reason: String? /* "mounted" | "navigation" | "requested" | "unmounted" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface VRLayer { + var leftBounds: dynamic /* Array? | Float32Array? */ + get() = definedExternally + set(value) = definedExternally + var rightBounds: dynamic /* Array? | Float32Array? */ + get() = definedExternally + set(value) = definedExternally + var source: HTMLCanvasElement? + get() = definedExternally + set(value) = definedExternally +} + +external interface VRStageParameters { + var sittingToStandingTransform: Float32Array? + get() = definedExternally + set(value) = definedExternally + var sizeX: Number? + get() = definedExternally + set(value) = definedExternally + var sizeY: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface txAuthGenericArg { + var content: ArrayBuffer + var contentType: String +} + +external interface `T$2` { + fun lookupNamespaceURI(prefix: String?): String? +} + +external interface ANGLE_instanced_arrays { + fun drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei) + fun drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei) + fun vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint) + var VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum +} + +external interface AbortSignalEventMap { + var abort: Event +} + +external interface AbortSignal : EventTarget { + var aborted: Boolean + var onabort: ((self: AbortSignal, ev: Event) -> Any)? + fun addEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface AbstractRange { + var collapsed: Boolean + var endContainer: Node + var endOffset: Number + var startContainer: Node + var startOffset: Number +} + +external interface AbstractWorkerEventMap { + var error: ErrorEvent +} + +external interface AesCfbParams : Algorithm { + var iv: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally +} + +external interface AesCmacParams : Algorithm { + var length: Number +} + +external interface Animatable { + fun animate(keyframes: Array?, options: Number = definedExternally): Animation + fun animate(keyframes: Array?): Animation + fun animate(keyframes: Array?, options: KeyframeAnimationOptions = definedExternally): Animation + fun animate(keyframes: PropertyIndexedKeyframes?, options: Number = definedExternally): Animation + fun animate(keyframes: PropertyIndexedKeyframes?): Animation + fun animate(keyframes: PropertyIndexedKeyframes?, options: KeyframeAnimationOptions = definedExternally): Animation + fun getAnimations(): Array +} + +external interface AnimationEventMap { + var cancel: AnimationPlaybackEvent + var finish: AnimationPlaybackEvent +} + +external interface Animation : EventTarget { + var currentTime: Number? + var effect: AnimationEffect? + var finished: Promise + var id: String + var oncancel: ((self: Animation, ev: AnimationPlaybackEvent) -> Any)? + var onfinish: ((self: Animation, ev: AnimationPlaybackEvent) -> Any)? + var pending: Boolean + var playState: String /* "finished" | "idle" | "paused" | "running" */ + var playbackRate: Number + var ready: Promise + var startTime: Number? + var timeline: AnimationTimeline? + fun cancel() + fun finish() + fun pause() + fun play() + fun reverse() + fun updatePlaybackRate(playbackRate: Number) + fun addEventListener(type: K, listener: (self: Animation, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: Animation, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: Animation, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: Animation, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: Animation, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: Animation, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface AnimationEffect { + fun getComputedTiming(): ComputedEffectTiming + fun getTiming(): EffectTiming + fun updateTiming(timing: OptionalEffectTiming = definedExternally) +} + +external interface AnimationEvent : Event { + var animationName: String + var elapsedTime: Number + var pseudoElement: String +} + +external interface AnimationFrameProvider { + fun cancelAnimationFrame(handle: Number) + fun requestAnimationFrame(callback: FrameRequestCallback): Number +} + +external interface AnimationPlaybackEvent : Event { + var currentTime: Number? + var timelineTime: Number? +} + +external interface AnimationTimeline { + var currentTime: Number? +} + +external interface ApplicationCacheEventMap { + var cached: Event + var checking: Event + var downloading: Event + var error: Event + var noupdate: Event + var obsolete: Event + var progress: ProgressEvent + var updateready: Event +} + +external interface AudioBuffer { + var duration: Number + var length: Number + var numberOfChannels: Number + var sampleRate: Number + fun copyFromChannel(destination: Float32Array, channelNumber: Number, bufferOffset: Number = definedExternally) + fun copyToChannel(source: Float32Array, channelNumber: Number, bufferOffset: Number = definedExternally) + fun getChannelData(channel: Number): Float32Array +} + +external interface AudioProcessingEvent : Event { + var inputBuffer: AudioBuffer + var outputBuffer: AudioBuffer + var playbackTime: Number +} + +external interface CSSRule { + var cssText: String + var parentRule: CSSRule? + var parentStyleSheet: CSSStyleSheet? + var type: Number + var CHARSET_RULE: Number + var FONT_FACE_RULE: Number + var IMPORT_RULE: Number + var KEYFRAMES_RULE: Number + var KEYFRAME_RULE: Number + var MEDIA_RULE: Number + var NAMESPACE_RULE: Number + var PAGE_RULE: Number + var STYLE_RULE: Number + var SUPPORTS_RULE: Number +} + +external interface CSSRuleList { + var length: Number + fun item(index: Number): CSSRule? + @nativeGetter + operator fun get(index: Number): CSSRule? + @nativeSetter + operator fun set(index: Number, value: CSSRule) +} + +external interface CSSStyleDeclaration { + var alignContent: String + var alignItems: String + var alignSelf: String + var alignmentBaseline: String + var all: String + var animation: String + var animationDelay: String + var animationDirection: String + var animationDuration: String + var animationFillMode: String + var animationIterationCount: String + var animationName: String + var animationPlayState: String + var animationTimingFunction: String + var backfaceVisibility: String + var background: String + var backgroundAttachment: String + var backgroundClip: String + var backgroundColor: String + var backgroundImage: String + var backgroundOrigin: String + var backgroundPosition: String + var backgroundPositionX: String + var backgroundPositionY: String + var backgroundRepeat: String + var backgroundSize: String + var baselineShift: String + var blockSize: String + var border: String + var borderBlockEnd: String + var borderBlockEndColor: String + var borderBlockEndStyle: String + var borderBlockEndWidth: String + var borderBlockStart: String + var borderBlockStartColor: String + var borderBlockStartStyle: String + var borderBlockStartWidth: String + var borderBottom: String + var borderBottomColor: String + var borderBottomLeftRadius: String + var borderBottomRightRadius: String + var borderBottomStyle: String + var borderBottomWidth: String + var borderCollapse: String + var borderColor: String + var borderImage: String + var borderImageOutset: String + var borderImageRepeat: String + var borderImageSlice: String + var borderImageSource: String + var borderImageWidth: String + var borderInlineEnd: String + var borderInlineEndColor: String + var borderInlineEndStyle: String + var borderInlineEndWidth: String + var borderInlineStart: String + var borderInlineStartColor: String + var borderInlineStartStyle: String + var borderInlineStartWidth: String + var borderLeft: String + var borderLeftColor: String + var borderLeftStyle: String + var borderLeftWidth: String + var borderRadius: String + var borderRight: String + var borderRightColor: String + var borderRightStyle: String + var borderRightWidth: String + var borderSpacing: String + var borderStyle: String + var borderTop: String + var borderTopColor: String + var borderTopLeftRadius: String + var borderTopRightRadius: String + var borderTopStyle: String + var borderTopWidth: String + var borderWidth: String + var bottom: String + var boxShadow: String + var boxSizing: String + var breakAfter: String + var breakBefore: String + var breakInside: String + var captionSide: String + var caretColor: String + var clear: String + var clip: String + var clipPath: String + var clipRule: String + var color: String + var colorInterpolation: String + var colorInterpolationFilters: String + var columnCount: String + var columnFill: String + var columnGap: String + var columnRule: String + var columnRuleColor: String + var columnRuleStyle: String + var columnRuleWidth: String + var columnSpan: String + var columnWidth: String + var columns: String + var content: String + var counterIncrement: String + var counterReset: String + var cssFloat: String + var cssText: String + var cursor: String + var direction: String + var display: String + var dominantBaseline: String + var emptyCells: String + var fill: String + var fillOpacity: String + var fillRule: String + var filter: String + var flex: String + var flexBasis: String + var flexDirection: String + var flexFlow: String + var flexGrow: String + var flexShrink: String + var flexWrap: String + var float: String + var floodColor: String + var floodOpacity: String + var font: String + var fontFamily: String + var fontFeatureSettings: String + var fontKerning: String + var fontSize: String + var fontSizeAdjust: String + var fontStretch: String + var fontStyle: String + var fontSynthesis: String + var fontVariant: String + var fontVariantCaps: String + var fontVariantEastAsian: String + var fontVariantLigatures: String + var fontVariantNumeric: String + var fontVariantPosition: String + var fontWeight: String + var gap: String + var glyphOrientationVertical: String + var grid: String + var gridArea: String + var gridAutoColumns: String + var gridAutoFlow: String + var gridAutoRows: String + var gridColumn: String + var gridColumnEnd: String + var gridColumnGap: String + var gridColumnStart: String + var gridGap: String + var gridRow: String + var gridRowEnd: String + var gridRowGap: String + var gridRowStart: String + var gridTemplate: String + var gridTemplateAreas: String + var gridTemplateColumns: String + var gridTemplateRows: String + var height: String + var hyphens: String + var imageOrientation: String + var imageRendering: String + var inlineSize: String + var justifyContent: String + var justifyItems: String + var justifySelf: String + var left: String + var length: Number + var letterSpacing: String + var lightingColor: String + var lineBreak: String + var lineHeight: String + var listStyle: String + var listStyleImage: String + var listStylePosition: String + var listStyleType: String + var margin: String + var marginBlockEnd: String + var marginBlockStart: String + var marginBottom: String + var marginInlineEnd: String + var marginInlineStart: String + var marginLeft: String + var marginRight: String + var marginTop: String + var marker: String + var markerEnd: String + var markerMid: String + var markerStart: String + var mask: String + var maskComposite: String + var maskImage: String + var maskPosition: String + var maskRepeat: String + var maskSize: String + var maskType: String + var maxBlockSize: String + var maxHeight: String + var maxInlineSize: String + var maxWidth: String + var minBlockSize: String + var minHeight: String + var minInlineSize: String + var minWidth: String + var objectFit: String + var objectPosition: String + var opacity: String + var order: String + var orphans: String + var outline: String + var outlineColor: String + var outlineOffset: String + var outlineStyle: String + var outlineWidth: String + var overflow: String + var overflowAnchor: String + var overflowWrap: String + var overflowX: String + var overflowY: String + var padding: String + var paddingBlockEnd: String + var paddingBlockStart: String + var paddingBottom: String + var paddingInlineEnd: String + var paddingInlineStart: String + var paddingLeft: String + var paddingRight: String + var paddingTop: String + var pageBreakAfter: String + var pageBreakBefore: String + var pageBreakInside: String + var paintOrder: String + var parentRule: CSSRule? + var perspective: String + var perspectiveOrigin: String + var placeContent: String + var placeItems: String + var placeSelf: String + var pointerEvents: String + var position: String + var quotes: String + var resize: String + var right: String + var rotate: String + var rowGap: String + var rubyAlign: String + var rubyPosition: String + var scale: String + var scrollBehavior: String + var shapeRendering: String + var stopColor: String + var stopOpacity: String + var stroke: String + var strokeDasharray: String + var strokeDashoffset: String + var strokeLinecap: String + var strokeLinejoin: String + var strokeMiterlimit: String + var strokeOpacity: String + var strokeWidth: String + var tabSize: String + var tableLayout: String + var textAlign: String + var textAlignLast: String + var textAnchor: String + var textCombineUpright: String + var textDecoration: String + var textDecorationColor: String + var textDecorationLine: String + var textDecorationStyle: String + var textEmphasis: String + var textEmphasisColor: String + var textEmphasisPosition: String + var textEmphasisStyle: String + var textIndent: String + var textJustify: String + var textOrientation: String + var textOverflow: String + var textRendering: String + var textShadow: String + var textTransform: String + var textUnderlinePosition: String + var top: String + var touchAction: String + var transform: String + var transformBox: String + var transformOrigin: String + var transformStyle: String + var transition: String + var transitionDelay: String + var transitionDuration: String + var transitionProperty: String + var transitionTimingFunction: String + var translate: String + var unicodeBidi: String + var userSelect: String + var verticalAlign: String + var visibility: String + var webkitAlignContent: String + var webkitAlignItems: String + var webkitAlignSelf: String + var webkitAnimation: String + var webkitAnimationDelay: String + var webkitAnimationDirection: String + var webkitAnimationDuration: String + var webkitAnimationFillMode: String + var webkitAnimationIterationCount: String + var webkitAnimationName: String + var webkitAnimationPlayState: String + var webkitAnimationTimingFunction: String + var webkitAppearance: String + var webkitBackfaceVisibility: String + var webkitBackgroundClip: String + var webkitBackgroundOrigin: String + var webkitBackgroundSize: String + var webkitBorderBottomLeftRadius: String + var webkitBorderBottomRightRadius: String + var webkitBorderRadius: String + var webkitBorderTopLeftRadius: String + var webkitBorderTopRightRadius: String + var webkitBoxAlign: String + var webkitBoxFlex: String + var webkitBoxOrdinalGroup: String + var webkitBoxOrient: String + var webkitBoxPack: String + var webkitBoxShadow: String + var webkitBoxSizing: String + var webkitFilter: String + var webkitFlex: String + var webkitFlexBasis: String + var webkitFlexDirection: String + var webkitFlexFlow: String + var webkitFlexGrow: String + var webkitFlexShrink: String + var webkitFlexWrap: String + var webkitJustifyContent: String + var webkitLineClamp: String + var webkitMask: String + var webkitMaskBoxImage: String + var webkitMaskBoxImageOutset: String + var webkitMaskBoxImageRepeat: String + var webkitMaskBoxImageSlice: String + var webkitMaskBoxImageSource: String + var webkitMaskBoxImageWidth: String + var webkitMaskClip: String + var webkitMaskComposite: String + var webkitMaskImage: String + var webkitMaskOrigin: String + var webkitMaskPosition: String + var webkitMaskRepeat: String + var webkitMaskSize: String + var webkitOrder: String + var webkitPerspective: String + var webkitPerspectiveOrigin: String + var webkitTapHighlightColor: String + var webkitTextFillColor: String + var webkitTextSizeAdjust: String + var webkitTextStroke: String + var webkitTextStrokeColor: String + var webkitTextStrokeWidth: String + var webkitTransform: String + var webkitTransformOrigin: String + var webkitTransformStyle: String + var webkitTransition: String + var webkitTransitionDelay: String + var webkitTransitionDuration: String + var webkitTransitionProperty: String + var webkitTransitionTimingFunction: String + var webkitUserSelect: String + var whiteSpace: String + var widows: String + var width: String + var willChange: String + var wordBreak: String + var wordSpacing: String + var wordWrap: String + var writingMode: String + var zIndex: String + var zoom: String + fun getPropertyPriority(property: String): String + fun getPropertyValue(property: String): String + fun item(index: Number): String + fun removeProperty(property: String): String + fun setProperty(property: String, value: String?, priority: String = definedExternally) + @nativeGetter + operator fun get(index: Number): String? + @nativeSetter + operator fun set(index: Number, value: String) +} + +external interface CSSStyleSheet : StyleSheet { + var cssRules: CSSRuleList + var ownerRule: CSSRule? + var rules: CSSRuleList + fun addRule(selector: String = definedExternally, style: String = definedExternally, index: Number = definedExternally): Number + fun deleteRule(index: Number) + fun insertRule(rule: String, index: Number = definedExternally): Number + fun removeRule(index: Number = definedExternally) +} + +external interface Clipboard : EventTarget { + fun readText(): Promise + fun writeText(data: String): Promise +} + +external interface ClipboardEvent : Event { + var clipboardData: DataTransfer? +} + +external interface ConcatParams : Algorithm { + var algorithmId: Uint8Array + var hash: dynamic /* String? | Algorithm? */ + get() = definedExternally + set(value) = definedExternally + var partyUInfo: Uint8Array + var partyVInfo: Uint8Array + var privateInfo: Uint8Array? + get() = definedExternally + set(value) = definedExternally + var publicInfo: Uint8Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface Coordinates { + var accuracy: Number + var altitude: Number? + var altitudeAccuracy: Number? + var heading: Number? + var latitude: Number + var longitude: Number + var speed: Number? +} + +external interface Credential { + var id: String + var type: String +} + +external interface CredentialsContainer { + fun create(options: CredentialCreationOptions = definedExternally): Promise + fun get(options: CredentialRequestOptions = definedExternally): Promise + fun preventSilentAccess(): Promise + fun store(credential: Credential): Promise +} + +external interface Crypto { + var subtle: SubtleCrypto + fun getRandomValues(array: T): T +} + +external interface CryptoKey { + var algorithm: KeyAlgorithm + var extractable: Boolean + var type: String /* "private" | "public" | "secret" */ + var usages: Array +} + +external interface CryptoKeyPair { + var privateKey: CryptoKey + var publicKey: CryptoKey +} + +external interface CustomEvent__0 : CustomEvent + +external interface DOMException { + var code: Number + var message: String + var name: String + var ABORT_ERR: Number + var DATA_CLONE_ERR: Number + var DOMSTRING_SIZE_ERR: Number + var HIERARCHY_REQUEST_ERR: Number + var INDEX_SIZE_ERR: Number + var INUSE_ATTRIBUTE_ERR: Number + var INVALID_ACCESS_ERR: Number + var INVALID_CHARACTER_ERR: Number + var INVALID_MODIFICATION_ERR: Number + var INVALID_NODE_TYPE_ERR: Number + var INVALID_STATE_ERR: Number + var NAMESPACE_ERR: Number + var NETWORK_ERR: Number + var NOT_FOUND_ERR: Number + var NOT_SUPPORTED_ERR: Number + var NO_DATA_ALLOWED_ERR: Number + var NO_MODIFICATION_ALLOWED_ERR: Number + var QUOTA_EXCEEDED_ERR: Number + var SECURITY_ERR: Number + var SYNTAX_ERR: Number + var TIMEOUT_ERR: Number + var TYPE_MISMATCH_ERR: Number + var URL_MISMATCH_ERR: Number + var VALIDATION_ERR: Number + var WRONG_DOCUMENT_ERR: Number +} + +external interface DOML2DeprecatedColorProperty { + var color: String +} + +typealias SVGMatrix = DOMMatrix + +typealias SVGPoint = DOMPoint + +typealias SVGRect = DOMRect + +external interface DOMStringList { + var length: Number + fun contains(string: String): Boolean + fun item(index: Number): String? + @nativeGetter + operator fun get(index: Number): String? + @nativeSetter + operator fun set(index: Number, value: String) +} + +external interface DeferredPermissionRequest { + var id: Number + var type: String /* "geolocation" | "media" | "pointerlock" | "unlimitedIndexedDBQuota" | "webnotifications" */ + var uri: String + fun allow() + fun deny() +} + +external interface DeviceLightEvent : Event { + var value: Number +} + +external interface DeviceMotionEvent : Event { + var acceleration: DeviceMotionEventAcceleration? + var accelerationIncludingGravity: DeviceMotionEventAcceleration? + var interval: Number + var rotationRate: DeviceMotionEventRotationRate? +} + +external interface DeviceMotionEventAcceleration { + var x: Number? + var y: Number? + var z: Number? +} + +external interface DeviceMotionEventRotationRate { + var alpha: Number? + var beta: Number? + var gamma: Number? +} + +external interface DeviceOrientationEvent : Event { + var absolute: Boolean + var alpha: Number? + var beta: Number? + var gamma: Number? +} + +external interface DhImportKeyParams : Algorithm { + var generator: Uint8Array + var prime: Uint8Array +} + +external interface DhKeyDeriveParams : Algorithm { + var public: CryptoKey +} + +external interface DhKeyGenParams : Algorithm { + var generator: Uint8Array + var prime: Uint8Array +} + +external interface DocumentEventMap : GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap { + var fullscreenchange: Event + var fullscreenerror: Event + var pointerlockchange: Event + var pointerlockerror: Event + var readystatechange: Event + var visibilitychange: Event +} + +external interface DocumentAndElementEventHandlersEventMap { + var copy: ClipboardEvent + var cut: ClipboardEvent + var paste: ClipboardEvent +} + +external interface DocumentEvent { + fun createEvent(eventInterface: String /* "AnimationEvent" | "AnimationPlaybackEvent" | "AudioProcessingEvent" | "BeforeUnloadEvent" | "ClipboardEvent" | "CloseEvent" | "CompositionEvent" | "CustomEvent" | "DeviceLightEvent" | "DeviceMotionEvent" | "DeviceOrientationEvent" | "DragEvent" | "ErrorEvent" | "Event" | "Events" | "FocusEvent" | "FocusNavigationEvent" | "GamepadEvent" | "HashChangeEvent" | "IDBVersionChangeEvent" | "InputEvent" | "KeyboardEvent" | "ListeningStateChangedEvent" | "MSGestureEvent" | "MSMediaKeyMessageEvent" | "MSMediaKeyNeededEvent" | "MSPointerEvent" | "MediaEncryptedEvent" | "MediaKeyMessageEvent" | "MediaQueryListEvent" | "MediaStreamErrorEvent" | "MediaStreamEvent" | "MediaStreamTrackEvent" | "MessageEvent" | "MouseEvent" | "MouseEvents" | "MutationEvent" | "MutationEvents" | "OfflineAudioCompletionEvent" | "OverflowEvent" | "PageTransitionEvent" | "PaymentRequestUpdateEvent" | "PermissionRequestedEvent" | "PointerEvent" | "PopStateEvent" | "ProgressEvent" | "PromiseRejectionEvent" | "RTCDTMFToneChangeEvent" | "RTCDataChannelEvent" | "RTCDtlsTransportStateChangedEvent" | "RTCErrorEvent" | "RTCIceCandidatePairChangedEvent" | "RTCIceGathererEvent" | "RTCIceTransportStateChangedEvent" | "RTCPeerConnectionIceErrorEvent" | "RTCPeerConnectionIceEvent" | "RTCSsrcConflictEvent" | "RTCStatsEvent" | "RTCTrackEvent" | "SVGZoomEvent" | "SVGZoomEvents" | "SecurityPolicyViolationEvent" | "ServiceWorkerMessageEvent" | "SpeechRecognitionEvent" | "SpeechSynthesisErrorEvent" | "SpeechSynthesisEvent" | "StorageEvent" | "TextEvent" | "TouchEvent" | "TrackEvent" | "TransitionEvent" | "UIEvent" | "UIEvents" | "VRDisplayEvent" | "VRDisplayEvent " | "WebGLContextEvent" | "WheelEvent" */): dynamic /* Event */ +} + +external interface DocumentTimeline : AnimationTimeline + +external interface EXT_blend_minmax { + var MAX_EXT: GLenum + var MIN_EXT: GLenum +} + +external interface EXT_frag_depth + +external interface EXT_sRGB { + var FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum + var SRGB8_ALPHA8_EXT: GLenum + var SRGB_ALPHA_EXT: GLenum + var SRGB_EXT: GLenum +} + +external interface EXT_shader_texture_lod + +external interface EXT_texture_filter_anisotropic { + var MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum + var TEXTURE_MAX_ANISOTROPY_EXT: GLenum +} + +external interface ElementEventMap { + var fullscreenchange: Event + var fullscreenerror: Event +} + +external interface ElementCSSInlineStyle { + var style: CSSStyleDeclaration +} + +external interface EventListenerObject { + fun handleEvent(evt: Event) +} + +external interface ExtensionScriptApis { + fun extensionIdToShortId(extensionId: String): Number + fun fireExtensionApiTelemetry(functionName: String, isSucceeded: Boolean, isSupported: Boolean, errorString: String) + fun genericFunction(routerAddress: Any, parameters: String = definedExternally, callbackId: Number = definedExternally) + fun genericSynchronousFunction(functionId: Number, parameters: String = definedExternally): String + fun genericWebRuntimeCallout(to: Any, from: Any, payload: String) + fun getExtensionId(): String + fun registerGenericFunctionCallbackHandler(callbackHandler: Function<*>) + fun registerGenericPersistentCallbackHandler(callbackHandler: Function<*>) + fun registerWebRuntimeCallbackHandler(handler: Function<*>): Any +} + +external interface FocusNavigationEvent : Event { + var navigationReason: String /* "down" | "left" | "right" | "up" */ + var originHeight: Number + var originLeft: Number + var originTop: Number + var originWidth: Number + fun requestFocus() +} + +external interface Gamepad { + var axes: Array + var buttons: Array + var connected: Boolean + var hand: String /* "" | "left" | "right" */ + var hapticActuators: Array + var id: String + var index: Number + var mapping: String /* "" | "standard" */ + var pose: GamepadPose? + var timestamp: Number +} + +external interface GamepadButton { + var pressed: Boolean + var touched: Boolean + var value: Number +} + +external interface GamepadEvent : Event { + var gamepad: Gamepad +} + +external interface GamepadHapticActuator { + var type: String /* "vibration" */ + fun pulse(value: Number, duration: Number): Promise +} + +external interface GamepadPose { + var angularAcceleration: Float32Array? + var angularVelocity: Float32Array? + var hasOrientation: Boolean + var hasPosition: Boolean + var linearAcceleration: Float32Array? + var linearVelocity: Float32Array? + var orientation: Float32Array? + var position: Float32Array? +} + +external interface Geolocation { + fun clearWatch(watchId: Number) + fun getCurrentPosition(successCallback: PositionCallback, errorCallback: PositionErrorCallback = definedExternally, options: PositionOptions = definedExternally) + fun watchPosition(successCallback: PositionCallback, errorCallback: PositionErrorCallback = definedExternally, options: PositionOptions = definedExternally): Number +} + +external interface GlobalEventHandlersEventMap { + var abort: UIEvent + var animationcancel: AnimationEvent + var animationend: AnimationEvent + var animationiteration: AnimationEvent + var animationstart: AnimationEvent + var auxclick: MouseEvent + var blur: FocusEvent + var cancel: Event + var canplay: Event + var canplaythrough: Event + var change: Event + var click: MouseEvent + var close: Event + var contextmenu: MouseEvent + var cuechange: Event + var dblclick: MouseEvent + var drag: DragEvent + var dragend: DragEvent + var dragenter: DragEvent + var dragexit: Event + var dragleave: DragEvent + var dragover: DragEvent + var dragstart: DragEvent + var drop: DragEvent + var durationchange: Event + var emptied: Event + var ended: Event + var error: ErrorEvent + var focus: FocusEvent + var focusin: FocusEvent + var focusout: FocusEvent + var gotpointercapture: PointerEvent + var input: Event + var invalid: Event + var keydown: KeyboardEvent + var keypress: KeyboardEvent + var keyup: KeyboardEvent + var load: Event + var loadeddata: Event + var loadedmetadata: Event + var loadstart: Event + var lostpointercapture: PointerEvent + var mousedown: MouseEvent + var mouseenter: MouseEvent + var mouseleave: MouseEvent + var mousemove: MouseEvent + var mouseout: MouseEvent + var mouseover: MouseEvent + var mouseup: MouseEvent + var pause: Event + var play: Event + var playing: Event + var pointercancel: PointerEvent + var pointerdown: PointerEvent + var pointerenter: PointerEvent + var pointerleave: PointerEvent + var pointermove: PointerEvent + var pointerout: PointerEvent + var pointerover: PointerEvent + var pointerup: PointerEvent + var progress: ProgressEvent__0 + var ratechange: Event + var reset: Event + var resize: UIEvent + var scroll: Event + var securitypolicyviolation: SecurityPolicyViolationEvent + var seeked: Event + var seeking: Event + var select: Event + var selectionchange: Event + var selectstart: Event + var stalled: Event + var submit: Event + var suspend: Event + var timeupdate: Event + var toggle: Event + var touchcancel: TouchEvent + var touchend: TouchEvent + var touchmove: TouchEvent + var touchstart: TouchEvent + var transitioncancel: TransitionEvent + var transitionend: TransitionEvent + var transitionrun: TransitionEvent + var transitionstart: TransitionEvent + var volumechange: Event + var waiting: Event + var wheel: WheelEvent +} + +external interface HTMLBaseFontElement : HTMLElement, DOML2DeprecatedColorProperty { + var face: String + var size: Number + fun addEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface HTMLBodyElementEventMap : HTMLElementEventMap, WindowEventHandlersEventMap { + var orientationchange: Event +} + +external interface HTMLCollectionBase { + var length: Number + fun item(index: Number): Element? + @nativeGetter + operator fun get(index: Number): Element? + @nativeSetter + operator fun set(index: Number, value: Element) +} + +external interface HTMLCollectionOf : HTMLCollectionBase { + fun item(index: Number): T? + fun namedItem(name: String): T? + @nativeGetter + operator fun get(index: Number): T? + @nativeSetter + override operator fun set(index: Number, value: T) +} + +external interface HTMLElementEventMap : ElementEventMap, GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap + +external interface HTMLFrameSetElementEventMap : HTMLElementEventMap, WindowEventHandlersEventMap + +external interface HTMLMarqueeElementEventMap : HTMLElementEventMap { + var bounce: Event + var finish: Event + var start: Event +} + +external interface HTMLMediaElementEventMap : HTMLElementEventMap { + var encrypted: MediaEncryptedEvent + var waitingforkey: Event +} + +external interface HTMLOrSVGElement { + var autofocus: Boolean + var dataset: DOMStringMap + var nonce: String? + get() = definedExternally + set(value) = definedExternally + var tabIndex: Number + fun blur() + fun focus(options: FocusOptions = definedExternally) +} + +external interface HTMLTableDataCellElement : HTMLTableCellElement { + fun addEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface HTMLTableHeaderCellElement : HTMLTableCellElement { + override var scope: String + fun addEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface HkdfCtrParams : Algorithm { + var context: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally + var hash: dynamic /* String | Algorithm */ + get() = definedExternally + set(value) = definedExternally + var label: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally +} + +typealias IDBArrayKey = Array + +external interface IDBCursor { + var direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ + var key: dynamic /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */ + get() = definedExternally + set(value) = definedExternally + var primaryKey: dynamic /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */ + get() = definedExternally + set(value) = definedExternally + var source: dynamic /* IDBObjectStore | IDBIndex */ + get() = definedExternally + set(value) = definedExternally + fun advance(count: Number) + fun `continue`(key: Number = definedExternally) + fun `continue`() + fun `continue`(key: String = definedExternally) + fun `continue`(key: Date = definedExternally) + fun `continue`(key: ArrayBufferView = definedExternally) + fun `continue`(key: ArrayBuffer = definedExternally) + fun `continue`(key: IDBArrayKey = definedExternally) + fun continuePrimaryKey(key: Number, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun continuePrimaryKey(key: String, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun continuePrimaryKey(key: Date, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun continuePrimaryKey(key: ArrayBufferView, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun continuePrimaryKey(key: ArrayBuffer, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun continuePrimaryKey(key: IDBArrayKey, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun delete(): IDBRequest + fun update(value: Any): IDBRequest +} + +external interface IDBCursorWithValue : IDBCursor { + var value: Any +} + +external interface IDBDatabaseEventMap { + var abort: Event + var close: Event + var error: Event + var versionchange: IDBVersionChangeEvent +} + +external interface IDBDatabase : EventTarget { + var name: String + var objectStoreNames: DOMStringList + var onabort: ((self: IDBDatabase, ev: Event) -> Any)? + var onclose: ((self: IDBDatabase, ev: Event) -> Any)? + var onerror: ((self: IDBDatabase, ev: Event) -> Any)? + var onversionchange: ((self: IDBDatabase, ev: IDBVersionChangeEvent) -> Any)? + var version: Number + fun close() + fun createObjectStore(name: String, optionalParameters: IDBObjectStoreParameters = definedExternally): IDBObjectStore + fun deleteObjectStore(name: String) + fun transaction(storeNames: String, mode: String /* "readonly" | "readwrite" | "versionchange" */ = definedExternally): IDBTransaction + fun transaction(storeNames: String): IDBTransaction + fun transaction(storeNames: Array, mode: String /* "readonly" | "readwrite" | "versionchange" */ = definedExternally): IDBTransaction + fun transaction(storeNames: Array): IDBTransaction + fun addEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface IDBFactory { + fun cmp(first: Any, second: Any): Number + fun deleteDatabase(name: String): IDBOpenDBRequest + fun open(name: String, version: Number = definedExternally): IDBOpenDBRequest +} + +external interface IDBIndex { + var keyPath: dynamic /* String | Array */ + get() = definedExternally + set(value) = definedExternally + var multiEntry: Boolean + var name: String + var objectStore: IDBObjectStore + var unique: Boolean + fun count(key: Number = definedExternally): IDBRequest + fun count(): IDBRequest + fun count(key: String = definedExternally): IDBRequest + fun count(key: Date = definedExternally): IDBRequest + fun count(key: ArrayBufferView = definedExternally): IDBRequest + fun count(key: ArrayBuffer = definedExternally): IDBRequest + fun count(key: IDBArrayKey = definedExternally): IDBRequest + fun count(key: IDBKeyRange = definedExternally): IDBRequest + fun get(key: Number): IDBRequest + fun get(key: String): IDBRequest + fun get(key: Date): IDBRequest + fun get(key: ArrayBufferView): IDBRequest + fun get(key: ArrayBuffer): IDBRequest + fun get(key: IDBArrayKey): IDBRequest + fun get(key: IDBKeyRange): IDBRequest + fun getAll(query: Number? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(): IDBRequest> + fun getAll(query: Number? = definedExternally): IDBRequest> + fun getAll(query: String? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: String? = definedExternally): IDBRequest> + fun getAll(query: Date? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: Date? = definedExternally): IDBRequest> + fun getAll(query: ArrayBufferView? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: ArrayBufferView? = definedExternally): IDBRequest> + fun getAll(query: ArrayBuffer? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: ArrayBuffer? = definedExternally): IDBRequest> + fun getAll(query: IDBArrayKey? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: IDBArrayKey? = definedExternally): IDBRequest> + fun getAll(query: IDBKeyRange? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: IDBKeyRange? = definedExternally): IDBRequest> + fun getAllKeys(query: Number? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(): IDBRequest> + fun getAllKeys(query: Number? = definedExternally): IDBRequest> + fun getAllKeys(query: String? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: String? = definedExternally): IDBRequest> + fun getAllKeys(query: Date? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: Date? = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBufferView? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBufferView? = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBuffer? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBuffer? = definedExternally): IDBRequest> + fun getAllKeys(query: IDBArrayKey? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: IDBArrayKey? = definedExternally): IDBRequest> + fun getAllKeys(query: IDBKeyRange? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: IDBKeyRange? = definedExternally): IDBRequest> + fun getKey(key: Number): IDBRequest + fun getKey(key: String): IDBRequest + fun getKey(key: Date): IDBRequest + fun getKey(key: ArrayBufferView): IDBRequest + fun getKey(key: ArrayBuffer): IDBRequest + fun getKey(key: IDBArrayKey): IDBRequest + fun getKey(key: IDBKeyRange): IDBRequest + fun openCursor(query: Number? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(): IDBRequest + fun openCursor(query: Number? = definedExternally): IDBRequest + fun openCursor(query: String? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: String? = definedExternally): IDBRequest + fun openCursor(query: Date? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: Date? = definedExternally): IDBRequest + fun openCursor(query: ArrayBufferView? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: ArrayBufferView? = definedExternally): IDBRequest + fun openCursor(query: ArrayBuffer? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: ArrayBuffer? = definedExternally): IDBRequest + fun openCursor(query: IDBArrayKey? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: IDBArrayKey? = definedExternally): IDBRequest + fun openCursor(query: IDBKeyRange? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: IDBKeyRange? = definedExternally): IDBRequest + fun openKeyCursor(query: Number? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(): IDBRequest + fun openKeyCursor(query: Number? = definedExternally): IDBRequest + fun openKeyCursor(query: String? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: String? = definedExternally): IDBRequest + fun openKeyCursor(query: Date? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: Date? = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBufferView? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBufferView? = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBuffer? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBuffer? = definedExternally): IDBRequest + fun openKeyCursor(query: IDBArrayKey? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: IDBArrayKey? = definedExternally): IDBRequest + fun openKeyCursor(query: IDBKeyRange? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: IDBKeyRange? = definedExternally): IDBRequest +} + +external interface IDBKeyRange { + var lower: Any + var lowerOpen: Boolean + var upper: Any + var upperOpen: Boolean + fun includes(key: Any): Boolean +} + +external interface IDBObjectStore { + fun createIndex(name: String, keyPath: String, options: IDBIndexParameters = definedExternally): IDBIndex + fun createIndex(name: String, keyPath: String): IDBIndex + fun createIndex(name: String, keyPath: Iterable, options: IDBIndexParameters = definedExternally): IDBIndex + fun createIndex(name: String, keyPath: Iterable): IDBIndex + var autoIncrement: Boolean + var indexNames: DOMStringList + var keyPath: dynamic /* String | Array */ + get() = definedExternally + set(value) = definedExternally + var name: String + var transaction: IDBTransaction + fun add(value: Any, key: Number = definedExternally): IDBRequest + fun add(value: Any): IDBRequest + fun add(value: Any, key: String = definedExternally): IDBRequest + fun add(value: Any, key: Date = definedExternally): IDBRequest + fun add(value: Any, key: ArrayBufferView = definedExternally): IDBRequest + fun add(value: Any, key: ArrayBuffer = definedExternally): IDBRequest + fun add(value: Any, key: IDBArrayKey = definedExternally): IDBRequest + fun clear(): IDBRequest + fun count(key: Number = definedExternally): IDBRequest + fun count(): IDBRequest + fun count(key: String = definedExternally): IDBRequest + fun count(key: Date = definedExternally): IDBRequest + fun count(key: ArrayBufferView = definedExternally): IDBRequest + fun count(key: ArrayBuffer = definedExternally): IDBRequest + fun count(key: IDBArrayKey = definedExternally): IDBRequest + fun count(key: IDBKeyRange = definedExternally): IDBRequest + fun createIndex(name: String, keyPath: Array, options: IDBIndexParameters = definedExternally): IDBIndex + fun createIndex(name: String, keyPath: Array): IDBIndex + fun delete(key: Number): IDBRequest + fun delete(key: String): IDBRequest + fun delete(key: Date): IDBRequest + fun delete(key: ArrayBufferView): IDBRequest + fun delete(key: ArrayBuffer): IDBRequest + fun delete(key: IDBArrayKey): IDBRequest + fun delete(key: IDBKeyRange): IDBRequest + fun deleteIndex(name: String) + fun get(query: Number): IDBRequest + fun get(query: String): IDBRequest + fun get(query: Date): IDBRequest + fun get(query: ArrayBufferView): IDBRequest + fun get(query: ArrayBuffer): IDBRequest + fun get(query: IDBArrayKey): IDBRequest + fun get(query: IDBKeyRange): IDBRequest + fun getAll(query: Number? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(): IDBRequest> + fun getAll(query: Number? = definedExternally): IDBRequest> + fun getAll(query: String? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: String? = definedExternally): IDBRequest> + fun getAll(query: Date? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: Date? = definedExternally): IDBRequest> + fun getAll(query: ArrayBufferView? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: ArrayBufferView? = definedExternally): IDBRequest> + fun getAll(query: ArrayBuffer? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: ArrayBuffer? = definedExternally): IDBRequest> + fun getAll(query: IDBArrayKey? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: IDBArrayKey? = definedExternally): IDBRequest> + fun getAll(query: IDBKeyRange? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: IDBKeyRange? = definedExternally): IDBRequest> + fun getAllKeys(query: Number? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(): IDBRequest> + fun getAllKeys(query: Number? = definedExternally): IDBRequest> + fun getAllKeys(query: String? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: String? = definedExternally): IDBRequest> + fun getAllKeys(query: Date? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: Date? = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBufferView? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBufferView? = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBuffer? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBuffer? = definedExternally): IDBRequest> + fun getAllKeys(query: IDBArrayKey? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: IDBArrayKey? = definedExternally): IDBRequest> + fun getAllKeys(query: IDBKeyRange? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: IDBKeyRange? = definedExternally): IDBRequest> + fun getKey(query: Number): IDBRequest + fun getKey(query: String): IDBRequest + fun getKey(query: Date): IDBRequest + fun getKey(query: ArrayBufferView): IDBRequest + fun getKey(query: ArrayBuffer): IDBRequest + fun getKey(query: IDBArrayKey): IDBRequest + fun getKey(query: IDBKeyRange): IDBRequest + fun index(name: String): IDBIndex + fun openCursor(query: Number? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(): IDBRequest + fun openCursor(query: Number? = definedExternally): IDBRequest + fun openCursor(query: String? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: String? = definedExternally): IDBRequest + fun openCursor(query: Date? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: Date? = definedExternally): IDBRequest + fun openCursor(query: ArrayBufferView? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: ArrayBufferView? = definedExternally): IDBRequest + fun openCursor(query: ArrayBuffer? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: ArrayBuffer? = definedExternally): IDBRequest + fun openCursor(query: IDBArrayKey? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: IDBArrayKey? = definedExternally): IDBRequest + fun openCursor(query: IDBKeyRange? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: IDBKeyRange? = definedExternally): IDBRequest + fun openKeyCursor(query: Number? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(): IDBRequest + fun openKeyCursor(query: Number? = definedExternally): IDBRequest + fun openKeyCursor(query: String? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: String? = definedExternally): IDBRequest + fun openKeyCursor(query: Date? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: Date? = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBufferView? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBufferView? = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBuffer? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBuffer? = definedExternally): IDBRequest + fun openKeyCursor(query: IDBArrayKey? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: IDBArrayKey? = definedExternally): IDBRequest + fun openKeyCursor(query: IDBKeyRange? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: IDBKeyRange? = definedExternally): IDBRequest + fun put(value: Any, key: Number = definedExternally): IDBRequest + fun put(value: Any): IDBRequest + fun put(value: Any, key: String = definedExternally): IDBRequest + fun put(value: Any, key: Date = definedExternally): IDBRequest + fun put(value: Any, key: ArrayBufferView = definedExternally): IDBRequest + fun put(value: Any, key: ArrayBuffer = definedExternally): IDBRequest + fun put(value: Any, key: IDBArrayKey = definedExternally): IDBRequest +} + +external interface IDBOpenDBRequestEventMap : IDBRequestEventMap { + var blocked: Event + var upgradeneeded: IDBVersionChangeEvent +} + +external interface IDBOpenDBRequest : IDBRequest { + var onblocked: ((self: IDBOpenDBRequest, ev: Event) -> Any)? + var onupgradeneeded: ((self: IDBOpenDBRequest, ev: IDBVersionChangeEvent) -> Any)? + fun addEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface IDBRequestEventMap { + var error: Event + var success: Event +} + +external interface IDBRequest : EventTarget { + var error: DOMException? + var onerror: ((self: IDBRequest, ev: Event) -> Any)? + var onsuccess: ((self: IDBRequest, ev: Event) -> Any)? + var readyState: String /* "done" | "pending" */ + var result: T + var source: dynamic /* IDBObjectStore | IDBIndex | IDBCursor */ + get() = definedExternally + set(value) = definedExternally + var transaction: IDBTransaction? + fun addEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface IDBTransactionEventMap { + var abort: Event + var complete: Event + var error: Event +} + +external interface IDBTransaction : EventTarget { + var db: IDBDatabase + var error: DOMException + var mode: String /* "readonly" | "readwrite" | "versionchange" */ + var objectStoreNames: DOMStringList + var onabort: ((self: IDBTransaction, ev: Event) -> Any)? + var oncomplete: ((self: IDBTransaction, ev: Event) -> Any)? + var onerror: ((self: IDBTransaction, ev: Event) -> Any)? + fun abort() + fun objectStore(name: String): IDBObjectStore + fun addEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface IDBVersionChangeEvent : Event { + var newVersion: Number? + var oldVersion: Number +} + +external interface InnerHTML { + var innerHTML: String +} + +external interface LinkStyle { + var sheet: CSSStyleSheet? +} + +external interface ListeningStateChangedEvent : Event { + var label: String + var state: String /* "active" | "disambiguation" | "inactive" */ +} + +external interface MSFileSaver { + fun msSaveBlob(blob: Any, defaultName: String = definedExternally): Boolean + fun msSaveOrOpenBlob(blob: Any, defaultName: String = definedExternally): Boolean +} + +external interface MSGestureEvent : UIEvent { + var clientX: Number + var clientY: Number + var expansion: Number + var gestureObject: Any + var hwTimestamp: Number + var offsetX: Number + var offsetY: Number + var rotation: Number + var scale: Number + var screenX: Number + var screenY: Number + var translationX: Number + var translationY: Number + var velocityAngular: Number + var velocityExpansion: Number + var velocityX: Number + var velocityY: Number + fun initGestureEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, viewArg: Window, detailArg: Number, screenXArg: Number, screenYArg: Number, clientXArg: Number, clientYArg: Number, offsetXArg: Number, offsetYArg: Number, translationXArg: Number, translationYArg: Number, scaleArg: Number, expansionArg: Number, rotationArg: Number, velocityXArg: Number, velocityYArg: Number, velocityExpansionArg: Number, velocityAngularArg: Number, hwTimestampArg: Number) + var MSGESTURE_FLAG_BEGIN: Number + var MSGESTURE_FLAG_CANCEL: Number + var MSGESTURE_FLAG_END: Number + var MSGESTURE_FLAG_INERTIA: Number + var MSGESTURE_FLAG_NONE: Number +} + +external interface MSMediaKeyMessageEvent : Event { + var destinationURL: String? + var message: Uint8Array +} + +external interface MSMediaKeyNeededEvent : Event { + var initData: Uint8Array? +} + +external interface MSNavigatorDoNotTrack { + fun confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): Boolean + fun confirmWebWideTrackingException(args: ExceptionInformation): Boolean + fun removeSiteSpecificTrackingException(args: ExceptionInformation) + fun removeWebWideTrackingException(args: ExceptionInformation) + fun storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation) + fun storeWebWideTrackingException(args: StoreExceptionsInformation) +} + +external interface MSPointerEvent : MouseEvent { + var currentPoint: Any + var height: Number + var hwTimestamp: Number + var intermediatePoints: Any + var isPrimary: Boolean + var pointerId: Number + var pointerType: Any + var pressure: Number + var rotation: Number + var tiltX: Number + var tiltY: Number + var width: Number + fun getCurrentPoint(element: Element) + fun getIntermediatePoints(element: Element) + fun initPointerEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, viewArg: Window, detailArg: Number, screenXArg: Number, screenYArg: Number, clientXArg: Number, clientYArg: Number, ctrlKeyArg: Boolean, altKeyArg: Boolean, shiftKeyArg: Boolean, metaKeyArg: Boolean, buttonArg: Number, relatedTargetArg: EventTarget, offsetXArg: Number, offsetYArg: Number, widthArg: Number, heightArg: Number, pressure: Number, rotation: Number, tiltX: Number, tiltY: Number, pointerIdArg: Number, pointerType: Any, hwTimestampArg: Number, isPrimary: Boolean) +} + +external interface MediaDeviceInfo { + var deviceId: String + var groupId: String + var kind: String /* "audioinput" | "audiooutput" | "videoinput" */ + var label: String + fun toJSON(): Any +} + +external interface MediaDevicesEventMap { + var devicechange: Event +} + +external interface MediaDevices : EventTarget { + var ondevicechange: ((self: MediaDevices, ev: Event) -> Any)? + fun enumerateDevices(): Promise> + fun getSupportedConstraints(): MediaTrackSupportedConstraints + fun getUserMedia(constraints: MediaStreamConstraints = definedExternally): Promise + fun addEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface MediaEncryptedEvent : Event { + var initData: ArrayBuffer? + var initDataType: String +} + +external interface MediaKeyMessageEvent : Event { + var message: ArrayBuffer + var messageType: String /* "individualization-request" | "license-release" | "license-renewal" | "license-request" */ +} + +external interface MediaKeySessionEventMap { + var keystatuseschange: Event + var message: MediaKeyMessageEvent +} + +external interface MediaKeySession : EventTarget { + var closed: Promise + var expiration: Number + var keyStatuses: MediaKeyStatusMap + var onkeystatuseschange: ((self: MediaKeySession, ev: Event) -> Any)? + var onmessage: ((self: MediaKeySession, ev: MediaKeyMessageEvent) -> Any)? + var sessionId: String + fun close(): Promise + fun generateRequest(initDataType: String, initData: ArrayBufferView): Promise + fun generateRequest(initDataType: String, initData: ArrayBuffer): Promise + fun load(sessionId: String): Promise + fun remove(): Promise + fun update(response: ArrayBufferView): Promise + fun update(response: ArrayBuffer): Promise + fun addEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface MediaKeyStatusMap { + fun entries(): IterableIterator */> + fun keys(): IterableIterator + fun values(): IterableIterator + var size: Number + fun get(keyId: ArrayBufferView): String /* "expired" | "internal-error" | "output-downscaled" | "output-restricted" | "released" | "status-pending" | "usable" */ + fun get(keyId: ArrayBuffer): String /* "expired" | "internal-error" | "output-downscaled" | "output-restricted" | "released" | "status-pending" | "usable" */ + fun has(keyId: ArrayBufferView): Boolean + fun has(keyId: ArrayBuffer): Boolean + fun forEach(callbackfn: (value: String /* "expired" | "internal-error" | "output-downscaled" | "output-restricted" | "released" | "status-pending" | "usable" */, key: Any /* ArrayBufferView | ArrayBuffer */, parent: MediaKeyStatusMap) -> Unit, thisArg: Any = definedExternally) +} + +external interface MediaKeySystemAccess { + var keySystem: String + fun createMediaKeys(): Promise + fun getConfiguration(): MediaKeySystemConfiguration +} + +external interface MediaKeys { + fun createSession(sessionType: String /* "persistent-license" | "temporary" */ = definedExternally): MediaKeySession + fun setServerCertificate(serverCertificate: ArrayBufferView): Promise + fun setServerCertificate(serverCertificate: ArrayBuffer): Promise +} + +external interface MediaList { + var length: Number + var mediaText: String + override fun toString(): String + fun appendMedium(medium: String) + fun deleteMedium(medium: String) + fun item(index: Number): String? + @nativeGetter + operator fun get(index: Number): String? + @nativeSetter + operator fun set(index: Number, value: String) +} + +external interface MediaQueryListEventMap { + var change: MediaQueryListEvent +} + +external interface MediaSourceEventMap { + var sourceclose: Event + var sourceended: Event + var sourceopen: Event +} + +external interface MediaSource : EventTarget { + var activeSourceBuffers: SourceBufferList + var duration: Number + var onsourceclose: ((self: MediaSource, ev: Event) -> Any)? + var onsourceended: ((self: MediaSource, ev: Event) -> Any)? + var onsourceopen: ((self: MediaSource, ev: Event) -> Any)? + var readyState: String /* "closed" | "ended" | "open" */ + var sourceBuffers: SourceBufferList + fun addSourceBuffer(type: String): SourceBuffer + fun clearLiveSeekableRange() + fun endOfStream(error: String /* "decode" | "network" */ = definedExternally) + fun removeSourceBuffer(sourceBuffer: SourceBuffer) + fun setLiveSeekableRange(start: Number, end: Number) + fun addEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface MediaStreamEventMap { + var addtrack: MediaStreamTrackEvent + var removetrack: MediaStreamTrackEvent +} + +external interface MediaStream : EventTarget { + var active: Boolean + var id: String + var onaddtrack: ((self: MediaStream, ev: MediaStreamTrackEvent) -> Any)? + var onremovetrack: ((self: MediaStream, ev: MediaStreamTrackEvent) -> Any)? + fun addTrack(track: MediaStreamTrack) + fun clone(): MediaStream + fun getAudioTracks(): Array + fun getTrackById(trackId: String): MediaStreamTrack? + fun getTracks(): Array + fun getVideoTracks(): Array + fun removeTrack(track: MediaStreamTrack) + fun addEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface MediaStreamError { + var constraintName: String? + var message: String? + var name: String +} + +external interface MediaStreamErrorEvent : Event { + var error: MediaStreamError? +} + +external interface MediaStreamEvent : Event { + var stream: MediaStream? +} + +external interface MediaStreamTrackEventMap { + var ended: Event + var isolationchange: Event + var mute: Event + var unmute: Event +} + +external interface MediaStreamTrack : EventTarget { + var enabled: Boolean + var id: String + var isolated: Boolean + var kind: String + var label: String + var muted: Boolean + var onended: ((self: MediaStreamTrack, ev: Event) -> Any)? + var onisolationchange: ((self: MediaStreamTrack, ev: Event) -> Any)? + var onmute: ((self: MediaStreamTrack, ev: Event) -> Any)? + var onunmute: ((self: MediaStreamTrack, ev: Event) -> Any)? + var readyState: String /* "ended" | "live" */ + fun applyConstraints(constraints: MediaTrackConstraints = definedExternally): Promise + fun clone(): MediaStreamTrack + fun getCapabilities(): MediaTrackCapabilities + fun getConstraints(): MediaTrackConstraints + fun getSettings(): MediaTrackSettings + fun stop() + fun addEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface MediaStreamTrackEvent : Event { + var track: MediaStreamTrack +} + +external interface MessagePortEventMap { + var message: MessageEvent + var messageerror: MessageEvent +} + +external interface MutationEvent : Event { + var attrChange: Number + var attrName: String + var newValue: String + var prevValue: String + var relatedNode: Node + fun initMutationEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, relatedNodeArg: Node, prevValueArg: String, newValueArg: String, attrNameArg: String, attrChangeArg: Number) + var ADDITION: Number + var MODIFICATION: Number + var REMOVAL: Number +} + +external interface NavigationPreloadManager { + fun disable(): Promise + fun enable(): Promise + fun getState(): Promise + fun setHeaderValue(value: String): Promise +} + +external interface NavigatorAutomationInformation { + var webdriver: Boolean +} + +external interface NavigatorBeacon { + fun sendBeacon(url: String, data: Blob? = definedExternally): Boolean + fun sendBeacon(url: String): Boolean + fun sendBeacon(url: String, data: Int8Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Int16Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Int32Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Uint8Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Uint16Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Uint32Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Uint8ClampedArray? = definedExternally): Boolean + fun sendBeacon(url: String, data: Float32Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Float64Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: DataView? = definedExternally): Boolean + fun sendBeacon(url: String, data: ArrayBuffer? = definedExternally): Boolean + fun sendBeacon(url: String, data: FormData? = definedExternally): Boolean + fun sendBeacon(url: String, data: String? = definedExternally): Boolean +} + +external interface NavigatorStorage { + var storage: StorageManager +} + +external interface NodeListOf : NodeList { + override fun entries(): IterableIterator */> + override fun keys(): IterableIterator + override fun values(): IterableIterator + override var length: Number + fun item(index: Number): TNode + fun forEach(callbackfn: (value: TNode, key: Number, parent: NodeListOf) -> Unit, thisArg: Any = definedExternally) + @nativeGetter + operator fun get(index: Number): TNode? + @nativeSetter + override operator fun set(index: Number, value: TNode) +} + +external interface NotificationEventMap { + var click: Event + var close: Event + var error: Event + var show: Event +} + +external interface OES_element_index_uint + +external interface OES_standard_derivatives { + var FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum +} + +external interface OES_texture_float + +external interface OES_texture_float_linear + +external interface OES_texture_half_float { + var HALF_FLOAT_OES: GLenum +} + +external interface OES_texture_half_float_linear + +external interface OES_vertex_array_object { + fun bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) + fun createVertexArrayOES(): WebGLVertexArrayObjectOES? + fun deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) + fun isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?): GLboolean + var VERTEX_ARRAY_BINDING_OES: GLenum +} + +external interface OfflineAudioCompletionEvent : Event { + var renderedBuffer: AudioBuffer +} + +external interface OffscreenCanvas : EventTarget { + fun getContext(contextId: String /* "webgpu" | "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "2d" | "bitmaprenderer" | "webgl" | "webgl2" */): dynamic /* WebGL2RenderingContext | OffscreenCanvasRenderingContext2D? | ImageBitmapRenderingContext? | WebGLRenderingContext? | WebGL2RenderingContext? */ + var height: Number + var width: Number + fun convertToBlob(options: ImageEncodeOptions = definedExternally): Promise + fun getContext(contextId: String /* "2d" */, options: CanvasRenderingContext2DSettings = definedExternally): OffscreenCanvasRenderingContext2D? + fun getContext(contextId: String /* "bitmaprenderer" */, options: ImageBitmapRenderingContextSettings = definedExternally): ImageBitmapRenderingContext? + fun getContext(contextId: String /* "webgl" | "webgl2" */, options: WebGLContextAttributes = definedExternally): dynamic /* WebGLRenderingContext | WebGL2RenderingContext */ + fun getContext(contextId: String /* "2d" | "bitmaprenderer" | "webgl" | "webgl2" */, options: Any = definedExternally): dynamic /* OffscreenCanvasRenderingContext2D? | ImageBitmapRenderingContext? | WebGLRenderingContext? | WebGL2RenderingContext? */ + fun transferToImageBitmap(): ImageBitmap +} + +external interface OffscreenCanvasRenderingContext2D : CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform { + var canvas: OffscreenCanvas + fun commit() +} + +external interface OverflowEvent : UIEvent { + var horizontalOverflow: Boolean + var orient: Number + var verticalOverflow: Boolean + var BOTH: Number + var HORIZONTAL: Number + var VERTICAL: Number +} + +external interface PaymentRequestUpdateEvent : Event { + fun updateWith(detailsPromise: PaymentDetailsUpdate) + fun updateWith(detailsPromise: Promise) +} + +external interface PerformanceEventMap { + var resourcetimingbufferfull: Event +} + +external interface PerformanceEntry { + var duration: Number + var entryType: String + var name: String + var startTime: Number + fun toJSON(): Any +} + +external interface PermissionRequest : DeferredPermissionRequest { + var state: String /* "allow" | "defer" | "deny" | "unknown" */ + fun defer() +} + +external interface PermissionRequestedEvent : Event { + var permissionRequest: PermissionRequest +} + +external interface PermissionStatusEventMap { + var change: Event +} + +external interface PermissionStatus : EventTarget { + var onchange: ((self: PermissionStatus, ev: Event) -> Any)? + var state: String /* "denied" | "granted" | "prompt" */ + fun addEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface Permissions { + fun query(permissionDesc: PermissionDescriptor): Promise + fun query(permissionDesc: DevicePermissionDescriptor): Promise + fun query(permissionDesc: MidiPermissionDescriptor): Promise + fun query(permissionDesc: PushPermissionDescriptor): Promise +} + +external interface PointerEvent : MouseEvent { + var height: Number + var isPrimary: Boolean + var pointerId: Number + var pointerType: String + var pressure: Number + var tangentialPressure: Number + var tiltX: Number + var tiltY: Number + var twist: Number + var width: Number +} + +external interface Position { + var coords: Coordinates + var timestamp: Number +} + +external interface PositionError { + var code: Number + var message: String + var PERMISSION_DENIED: Number + var POSITION_UNAVAILABLE: Number + var TIMEOUT: Number +} + +external interface ProgressEvent__0 : ProgressEvent + +external interface PushManager { + fun getSubscription(): Promise + fun permissionState(options: PushSubscriptionOptionsInit = definedExternally): Promise + fun subscribe(options: PushSubscriptionOptionsInit = definedExternally): Promise +} + +external interface PushSubscription { + var endpoint: String + var expirationTime: Number? + var options: PushSubscriptionOptions + fun getKey(name: String /* "auth" | "p256dh" */): ArrayBuffer? + fun toJSON(): PushSubscriptionJSON + fun unsubscribe(): Promise +} + +external interface PushSubscriptionOptions { + var applicationServerKey: ArrayBuffer? + var userVisibleOnly: Boolean +} + +external interface RTCDTMFSenderEventMap { + var tonechange: RTCDTMFToneChangeEvent +} + +external interface RTCDTMFSender : EventTarget { + var canInsertDTMF: Boolean + var ontonechange: ((self: RTCDTMFSender, ev: RTCDTMFToneChangeEvent) -> Any)? + var toneBuffer: String + fun insertDTMF(tones: String, duration: Number = definedExternally, interToneGap: Number = definedExternally) + fun addEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface RTCDTMFToneChangeEvent : Event { + var tone: String +} + +external interface RTCDataChannelEventMap { + var bufferedamountlow: Event + var close: Event + var error: RTCErrorEvent + var message: MessageEvent + var open: Event +} + +external interface RTCDataChannel : EventTarget { + var binaryType: String + var bufferedAmount: Number + var bufferedAmountLowThreshold: Number + var id: Number? + var label: String + var maxPacketLifeTime: Number? + var maxRetransmits: Number? + var negotiated: Boolean + var onbufferedamountlow: ((self: RTCDataChannel, ev: Event) -> Any)? + var onclose: ((self: RTCDataChannel, ev: Event) -> Any)? + var onerror: ((self: RTCDataChannel, ev: RTCErrorEvent) -> Any)? + var onmessage: ((self: RTCDataChannel, ev: MessageEvent) -> Any)? + var onopen: ((self: RTCDataChannel, ev: Event) -> Any)? + var ordered: Boolean + var priority: String /* "high" | "low" | "medium" | "very-low" */ + var protocol: String + var readyState: String /* "closed" | "closing" | "connecting" | "open" */ + fun close() + fun send(data: String) + fun send(data: Blob) + fun send(data: ArrayBuffer) + fun send(data: ArrayBufferView) + fun addEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface RTCDataChannelEvent : Event { + var channel: RTCDataChannel +} + +external interface RTCDtlsTransportEventMap { + var error: RTCErrorEvent + var statechange: Event +} + +external interface RTCDtlsTransport : EventTarget { + var iceTransport: RTCIceTransport + var onerror: ((self: RTCDtlsTransport, ev: RTCErrorEvent) -> Any)? + var onstatechange: ((self: RTCDtlsTransport, ev: Event) -> Any)? + var state: String /* "closed" | "connected" | "connecting" | "failed" | "new" */ + fun getRemoteCertificates(): Array + fun addEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface RTCDtlsTransportStateChangedEvent : Event { + var state: String /* "closed" | "connected" | "connecting" | "failed" | "new" */ +} + +external interface RTCError : DOMException { + var errorDetail: String /* "data-channel-failure" | "dtls-failure" | "fingerprint-failure" | "hardware-encoder-error" | "hardware-encoder-not-available" | "idp-bad-script-failure" | "idp-execution-failure" | "idp-load-failure" | "idp-need-login" | "idp-timeout" | "idp-tls-failure" | "idp-token-expired" | "idp-token-invalid" | "sctp-failure" | "sdp-syntax-error" */ + var httpRequestStatusCode: Number? + var receivedAlert: Number? + var sctpCauseCode: Number? + var sdpLineNumber: Number? + var sentAlert: Number? +} + +external interface RTCErrorEvent : Event { + var error: RTCError +} + +external interface RTCIceCandidate { + var candidate: String + var component: String /* "rtcp" | "rtp" */ + var foundation: String? + var port: Number? + var priority: Number? + var protocol: String /* "tcp" | "udp" */ + var relatedAddress: String? + var relatedPort: Number? + var sdpMLineIndex: Number? + var sdpMid: String? + var tcpType: String /* "active" | "passive" | "so" */ + var type: String /* "host" | "prflx" | "relay" | "srflx" */ + var usernameFragment: String? + fun toJSON(): RTCIceCandidateInit +} + +external interface RTCIceCandidatePairChangedEvent : Event { + var pair: RTCIceCandidatePair +} + +external interface RTCIceGathererEvent : Event { + var candidate: dynamic /* RTCIceCandidateDictionary | RTCIceCandidateComplete */ + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCIceTransportEventMap { + var gatheringstatechange: Event + var selectedcandidatepairchange: Event + var statechange: Event +} + +external interface RTCIceTransport : EventTarget { + var component: String /* "rtcp" | "rtp" */ + var gatheringState: String /* "complete" | "gathering" | "new" */ + var ongatheringstatechange: ((self: RTCIceTransport, ev: Event) -> Any)? + var onselectedcandidatepairchange: ((self: RTCIceTransport, ev: Event) -> Any)? + var onstatechange: ((self: RTCIceTransport, ev: Event) -> Any)? + var role: String /* "controlled" | "controlling" | "unknown" */ + var state: String /* "checking" | "closed" | "completed" | "connected" | "disconnected" | "failed" | "new" */ + fun getLocalCandidates(): Array + fun getLocalParameters(): RTCIceParameters? + fun getRemoteCandidates(): Array + fun getRemoteParameters(): RTCIceParameters? + fun getSelectedCandidatePair(): RTCIceCandidatePair? + fun addEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface RTCIceTransportStateChangedEvent : Event { + var state: String /* "checking" | "closed" | "completed" | "connected" | "disconnected" | "failed" | "new" */ +} + +external interface RTCPeerConnectionIceErrorEvent : Event { + var errorCode: Number + var errorText: String + var hostCandidate: String + var url: String +} + +external interface RTCPeerConnectionIceEvent : Event { + var candidate: RTCIceCandidate? + var url: String? +} + +external interface RTCRtpReceiver { + var rtcpTransport: RTCDtlsTransport? + var track: MediaStreamTrack + var transport: RTCDtlsTransport? + fun getContributingSources(): Array + fun getParameters(): RTCRtpReceiveParameters + fun getStats(): Promise + fun getSynchronizationSources(): Array +} + +external interface RTCRtpSender { + var dtmf: RTCDTMFSender? + var rtcpTransport: RTCDtlsTransport? + var track: MediaStreamTrack? + var transport: RTCDtlsTransport? + fun getParameters(): RTCRtpSendParameters + fun getStats(): Promise + fun replaceTrack(withTrack: MediaStreamTrack?): Promise + fun setParameters(parameters: RTCRtpSendParameters): Promise + fun setStreams(vararg streams: MediaStream) +} + +external interface RTCRtpTransceiver { + fun setCodecPreferences(codecs: Iterable) + var currentDirection: String /* "inactive" | "recvonly" | "sendonly" | "sendrecv" | "stopped" */ + var direction: String /* "inactive" | "recvonly" | "sendonly" | "sendrecv" | "stopped" */ + var mid: String? + var receiver: RTCRtpReceiver + var sender: RTCRtpSender + fun setCodecPreferences(codecs: Array) + fun stop() +} + +external interface RTCSsrcConflictEvent : Event { + var ssrc: Number +} + +external interface RTCStatsEvent : Event { + var report: RTCStatsReport +} + +external interface RTCTrackEvent : Event { + var receiver: RTCRtpReceiver + var streams: Array + var track: MediaStreamTrack + var transceiver: RTCRtpTransceiver +} + +external interface ReadableByteStreamController { + var byobRequest: ReadableStreamBYOBRequest? + var desiredSize: Number? + fun close() + fun enqueue(chunk: ArrayBufferView) + fun error(error: Any = definedExternally) +} + +external interface `T$0` { + var mode: String /* "byob" */ +} + +external interface `T$1` { + var writable: WritableStream + var readable: ReadableStream +} + +external interface ReadableStream { + var locked: Boolean + fun cancel(reason: Any = definedExternally): Promise + fun getReader(options: `T$0`): ReadableStreamBYOBReader + fun getReader(): ReadableStreamDefaultReader + fun pipeThrough(__0: `T$1`, options: PipeOptions = definedExternally): ReadableStream + fun pipeTo(dest: WritableStream, options: PipeOptions = definedExternally): Promise + fun tee(): dynamic /* JsTuple, ReadableStream> */ +} + +external interface ReadableStream__0 : ReadableStream + +external interface ReadableStreamBYOBReader { + var closed: Promise + fun cancel(reason: Any = definedExternally): Promise + fun read(view: T): Promise | ReadableStreamReadDoneResult */> + fun releaseLock() +} + +external interface ReadableStreamBYOBRequest { + var view: ArrayBufferView + fun respond(bytesWritten: Number) + fun respondWithNewView(view: ArrayBufferView) +} + +external interface ReadableStreamDefaultController { + var desiredSize: Number? + fun close() + fun enqueue(chunk: R) + fun error(error: Any = definedExternally) +} + +external interface ReadableStreamDefaultReader { + var closed: Promise + fun cancel(reason: Any = definedExternally): Promise + fun read(): Promise | ReadableStreamReadDoneResult */> + fun releaseLock() +} + +external interface SVGClipPathElement : SVGElement { + var clipPathUnits: SVGAnimatedEnumeration + var transform: SVGAnimatedTransformList + fun addEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGComponentTransferFunctionElement : SVGElement { + var amplitude: SVGAnimatedNumber + var exponent: SVGAnimatedNumber + var intercept: SVGAnimatedNumber + var offset: SVGAnimatedNumber + var slope: SVGAnimatedNumber + var tableValues: SVGAnimatedNumberList + var type: SVGAnimatedEnumeration + var SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: Number + var SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: Number + var SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: Number + var SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: Number + var SVG_FECOMPONENTTRANSFER_TYPE_TABLE: Number + var SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGElementEventMap : ElementEventMap, GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap + +external interface SVGFEBlendElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var in2: SVGAnimatedString + var mode: SVGAnimatedEnumeration + var SVG_FEBLEND_MODE_COLOR: Number + var SVG_FEBLEND_MODE_COLOR_BURN: Number + var SVG_FEBLEND_MODE_COLOR_DODGE: Number + var SVG_FEBLEND_MODE_DARKEN: Number + var SVG_FEBLEND_MODE_DIFFERENCE: Number + var SVG_FEBLEND_MODE_EXCLUSION: Number + var SVG_FEBLEND_MODE_HARD_LIGHT: Number + var SVG_FEBLEND_MODE_HUE: Number + var SVG_FEBLEND_MODE_LIGHTEN: Number + var SVG_FEBLEND_MODE_LUMINOSITY: Number + var SVG_FEBLEND_MODE_MULTIPLY: Number + var SVG_FEBLEND_MODE_NORMAL: Number + var SVG_FEBLEND_MODE_OVERLAY: Number + var SVG_FEBLEND_MODE_SATURATION: Number + var SVG_FEBLEND_MODE_SCREEN: Number + var SVG_FEBLEND_MODE_SOFT_LIGHT: Number + var SVG_FEBLEND_MODE_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEColorMatrixElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var type: SVGAnimatedEnumeration + var values: SVGAnimatedNumberList + var SVG_FECOLORMATRIX_TYPE_HUEROTATE: Number + var SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: Number + var SVG_FECOLORMATRIX_TYPE_MATRIX: Number + var SVG_FECOLORMATRIX_TYPE_SATURATE: Number + var SVG_FECOLORMATRIX_TYPE_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEComponentTransferElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + fun addEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFECompositeElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var in2: SVGAnimatedString + var k1: SVGAnimatedNumber + var k2: SVGAnimatedNumber + var k3: SVGAnimatedNumber + var k4: SVGAnimatedNumber + var operator: SVGAnimatedEnumeration + var SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: Number + var SVG_FECOMPOSITE_OPERATOR_ATOP: Number + var SVG_FECOMPOSITE_OPERATOR_IN: Number + var SVG_FECOMPOSITE_OPERATOR_OUT: Number + var SVG_FECOMPOSITE_OPERATOR_OVER: Number + var SVG_FECOMPOSITE_OPERATOR_UNKNOWN: Number + var SVG_FECOMPOSITE_OPERATOR_XOR: Number + fun addEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEConvolveMatrixElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var bias: SVGAnimatedNumber + var divisor: SVGAnimatedNumber + var edgeMode: SVGAnimatedEnumeration + var in1: SVGAnimatedString + var kernelMatrix: SVGAnimatedNumberList + var kernelUnitLengthX: SVGAnimatedNumber + var kernelUnitLengthY: SVGAnimatedNumber + var orderX: SVGAnimatedInteger + var orderY: SVGAnimatedInteger + var preserveAlpha: SVGAnimatedBoolean + var targetX: SVGAnimatedInteger + var targetY: SVGAnimatedInteger + var SVG_EDGEMODE_DUPLICATE: Number + var SVG_EDGEMODE_NONE: Number + var SVG_EDGEMODE_UNKNOWN: Number + var SVG_EDGEMODE_WRAP: Number + fun addEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEDiffuseLightingElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var diffuseConstant: SVGAnimatedNumber + var in1: SVGAnimatedString + var kernelUnitLengthX: SVGAnimatedNumber + var kernelUnitLengthY: SVGAnimatedNumber + var surfaceScale: SVGAnimatedNumber + fun addEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEDisplacementMapElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var in2: SVGAnimatedString + var scale: SVGAnimatedNumber + var xChannelSelector: SVGAnimatedEnumeration + var yChannelSelector: SVGAnimatedEnumeration + var SVG_CHANNEL_A: Number + var SVG_CHANNEL_B: Number + var SVG_CHANNEL_G: Number + var SVG_CHANNEL_R: Number + var SVG_CHANNEL_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEDistantLightElement : SVGElement { + var azimuth: SVGAnimatedNumber + var elevation: SVGAnimatedNumber + fun addEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEFloodElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + fun addEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEFuncAElement : SVGComponentTransferFunctionElement { + fun addEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEFuncBElement : SVGComponentTransferFunctionElement { + fun addEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEFuncGElement : SVGComponentTransferFunctionElement { + fun addEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEFuncRElement : SVGComponentTransferFunctionElement { + fun addEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEGaussianBlurElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var stdDeviationX: SVGAnimatedNumber + var stdDeviationY: SVGAnimatedNumber + fun setStdDeviation(stdDeviationX: Number, stdDeviationY: Number) + fun addEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEImageElement : SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { + var preserveAspectRatio: SVGAnimatedPreserveAspectRatio + fun addEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEMergeElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + fun addEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEMergeNodeElement : SVGElement { + var in1: SVGAnimatedString + fun addEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEMorphologyElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var operator: SVGAnimatedEnumeration + var radiusX: SVGAnimatedNumber + var radiusY: SVGAnimatedNumber + var SVG_MORPHOLOGY_OPERATOR_DILATE: Number + var SVG_MORPHOLOGY_OPERATOR_ERODE: Number + var SVG_MORPHOLOGY_OPERATOR_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEOffsetElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var dx: SVGAnimatedNumber + var dy: SVGAnimatedNumber + var in1: SVGAnimatedString + fun addEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEPointLightElement : SVGElement { + var x: SVGAnimatedNumber + var y: SVGAnimatedNumber + var z: SVGAnimatedNumber + fun addEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFESpecularLightingElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var kernelUnitLengthX: SVGAnimatedNumber + var kernelUnitLengthY: SVGAnimatedNumber + var specularConstant: SVGAnimatedNumber + var specularExponent: SVGAnimatedNumber + var surfaceScale: SVGAnimatedNumber + fun addEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFESpotLightElement : SVGElement { + var limitingConeAngle: SVGAnimatedNumber + var pointsAtX: SVGAnimatedNumber + var pointsAtY: SVGAnimatedNumber + var pointsAtZ: SVGAnimatedNumber + var specularExponent: SVGAnimatedNumber + var x: SVGAnimatedNumber + var y: SVGAnimatedNumber + var z: SVGAnimatedNumber + fun addEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFETileElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + fun addEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFETurbulenceElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var baseFrequencyX: SVGAnimatedNumber + var baseFrequencyY: SVGAnimatedNumber + var numOctaves: SVGAnimatedInteger + var seed: SVGAnimatedNumber + var stitchTiles: SVGAnimatedEnumeration + var type: SVGAnimatedEnumeration + var SVG_STITCHTYPE_NOSTITCH: Number + var SVG_STITCHTYPE_STITCH: Number + var SVG_STITCHTYPE_UNKNOWN: Number + var SVG_TURBULENCE_TYPE_FRACTALNOISE: Number + var SVG_TURBULENCE_TYPE_TURBULENCE: Number + var SVG_TURBULENCE_TYPE_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFilterElement : SVGElement, SVGURIReference { + var filterUnits: SVGAnimatedEnumeration + var height: SVGAnimatedLength + var primitiveUnits: SVGAnimatedEnumeration + var width: SVGAnimatedLength + var x: SVGAnimatedLength + var y: SVGAnimatedLength + fun addEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFilterPrimitiveStandardAttributes { + var height: SVGAnimatedLength + var result: SVGAnimatedString + var width: SVGAnimatedLength + var x: SVGAnimatedLength + var y: SVGAnimatedLength +} + +external interface SVGMaskElement : SVGElement { + var height: SVGAnimatedLength + var maskContentUnits: SVGAnimatedEnumeration + var maskUnits: SVGAnimatedEnumeration + var width: SVGAnimatedLength + var x: SVGAnimatedLength + var y: SVGAnimatedLength + fun addEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGPathSeg { + var pathSegType: Number + var pathSegTypeAsLetter: String + var PATHSEG_ARC_ABS: Number + var PATHSEG_ARC_REL: Number + var PATHSEG_CLOSEPATH: Number + var PATHSEG_CURVETO_CUBIC_ABS: Number + var PATHSEG_CURVETO_CUBIC_REL: Number + var PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: Number + var PATHSEG_CURVETO_CUBIC_SMOOTH_REL: Number + var PATHSEG_CURVETO_QUADRATIC_ABS: Number + var PATHSEG_CURVETO_QUADRATIC_REL: Number + var PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: Number + var PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: Number + var PATHSEG_LINETO_ABS: Number + var PATHSEG_LINETO_HORIZONTAL_ABS: Number + var PATHSEG_LINETO_HORIZONTAL_REL: Number + var PATHSEG_LINETO_REL: Number + var PATHSEG_LINETO_VERTICAL_ABS: Number + var PATHSEG_LINETO_VERTICAL_REL: Number + var PATHSEG_MOVETO_ABS: Number + var PATHSEG_MOVETO_REL: Number + var PATHSEG_UNKNOWN: Number +} + +external interface SVGPathSegArcAbs : SVGPathSeg { + var angle: Number + var largeArcFlag: Boolean + var r1: Number + var r2: Number + var sweepFlag: Boolean + var x: Number + var y: Number +} + +external interface SVGPathSegArcRel : SVGPathSeg { + var angle: Number + var largeArcFlag: Boolean + var r1: Number + var r2: Number + var sweepFlag: Boolean + var x: Number + var y: Number +} + +external interface SVGPathSegClosePath : SVGPathSeg + +external interface SVGPathSegCurvetoCubicAbs : SVGPathSeg { + var x: Number + var x1: Number + var x2: Number + var y: Number + var y1: Number + var y2: Number +} + +external interface SVGPathSegCurvetoCubicRel : SVGPathSeg { + var x: Number + var x1: Number + var x2: Number + var y: Number + var y1: Number + var y2: Number +} + +external interface SVGPathSegCurvetoCubicSmoothAbs : SVGPathSeg { + var x: Number + var x2: Number + var y: Number + var y2: Number +} + +external interface SVGPathSegCurvetoCubicSmoothRel : SVGPathSeg { + var x: Number + var x2: Number + var y: Number + var y2: Number +} + +external interface SVGPathSegCurvetoQuadraticAbs : SVGPathSeg { + var x: Number + var x1: Number + var y: Number + var y1: Number +} + +external interface SVGPathSegCurvetoQuadraticRel : SVGPathSeg { + var x: Number + var x1: Number + var y: Number + var y1: Number +} + +external interface SVGPathSegCurvetoQuadraticSmoothAbs : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGPathSegCurvetoQuadraticSmoothRel : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGPathSegLinetoAbs : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGPathSegLinetoHorizontalAbs : SVGPathSeg { + var x: Number +} + +external interface SVGPathSegLinetoHorizontalRel : SVGPathSeg { + var x: Number +} + +external interface SVGPathSegLinetoRel : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGPathSegLinetoVerticalAbs : SVGPathSeg { + var y: Number +} + +external interface SVGPathSegLinetoVerticalRel : SVGPathSeg { + var y: Number +} + +external interface SVGPathSegList { + var numberOfItems: Number + fun appendItem(newItem: SVGPathSeg): SVGPathSeg + fun clear() + fun getItem(index: Number): SVGPathSeg + fun initialize(newItem: SVGPathSeg): SVGPathSeg + fun insertItemBefore(newItem: SVGPathSeg, index: Number): SVGPathSeg + fun removeItem(index: Number): SVGPathSeg + fun replaceItem(newItem: SVGPathSeg, index: Number): SVGPathSeg +} + +external interface SVGPathSegMovetoAbs : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGPathSegMovetoRel : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGSVGElementEventMap : SVGElementEventMap { + var SVGUnload: Event + var SVGZoom: SVGZoomEvent +} + +external interface SVGZoomEvent : UIEvent { + var newScale: Number + var newTranslate: SVGPoint + var previousScale: Number + var previousTranslate: SVGPoint + var zoomRectScreen: SVGRect +} + +external interface ScreenOrientationEventMap { + var change: Event +} + +external interface ScreenOrientation : EventTarget { + var angle: Number + var onchange: ((self: ScreenOrientation, ev: Event) -> Any)? + var type: String /* "landscape-primary" | "landscape-secondary" | "portrait-primary" | "portrait-secondary" */ + fun lock(orientation: String /* "any" | "landscape" | "landscape-primary" | "landscape-secondary" | "natural" | "portrait" | "portrait-primary" | "portrait-secondary" */): Promise + fun unlock() + fun addEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface SecurityPolicyViolationEvent : Event { + var blockedURI: String + var columnNumber: Number + var documentURI: String + var effectiveDirective: String + var lineNumber: Number + var originalPolicy: String + var referrer: String + var sourceFile: String + var statusCode: Number + var violatedDirective: String +} + +external interface Selection { + var anchorNode: Node? + var anchorOffset: Number + var focusNode: Node? + var focusOffset: Number + var isCollapsed: Boolean + var rangeCount: Number + var type: String + fun addRange(range: Range) + fun collapse(node: Node?, offset: Number = definedExternally) + fun collapseToEnd() + fun collapseToStart() + fun containsNode(node: Node, allowPartialContainment: Boolean = definedExternally): Boolean + fun deleteFromDocument() + fun empty() + fun extend(node: Node, offset: Number = definedExternally) + fun getRangeAt(index: Number): Range + fun removeAllRanges() + fun removeRange(range: Range) + fun selectAllChildren(node: Node) + fun setBaseAndExtent(anchorNode: Node, anchorOffset: Number, focusNode: Node, focusOffset: Number) + fun setPosition(node: Node?, offset: Number = definedExternally) + override fun toString(): String +} + +external interface ServiceWorkerEventMap : AbstractWorkerEventMap { + var statechange: Event +} + +external interface ServiceWorkerContainerEventMap { + var controllerchange: Event + var message: MessageEvent + var messageerror: MessageEvent +} + +external interface ServiceWorkerRegistrationEventMap { + var updatefound: Event +} + +external interface SourceBufferEventMap { + var abort: Event + var error: Event + var update: Event + var updateend: Event + var updatestart: Event +} + +external interface SourceBuffer : EventTarget { + var appendWindowEnd: Number + var appendWindowStart: Number + var buffered: TimeRanges + var mode: String /* "segments" | "sequence" */ + var onabort: ((self: SourceBuffer, ev: Event) -> Any)? + var onerror: ((self: SourceBuffer, ev: Event) -> Any)? + var onupdate: ((self: SourceBuffer, ev: Event) -> Any)? + var onupdateend: ((self: SourceBuffer, ev: Event) -> Any)? + var onupdatestart: ((self: SourceBuffer, ev: Event) -> Any)? + var timestampOffset: Number + var updating: Boolean + fun abort() + fun appendBuffer(data: ArrayBufferView) + fun appendBuffer(data: ArrayBuffer) + fun remove(start: Number, end: Number) + fun addEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface SourceBufferListEventMap { + var addsourcebuffer: Event + var removesourcebuffer: Event +} + +external interface SourceBufferList : EventTarget { + var length: Number + var onaddsourcebuffer: ((self: SourceBufferList, ev: Event) -> Any)? + var onremovesourcebuffer: ((self: SourceBufferList, ev: Event) -> Any)? + fun addEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) + @nativeGetter + operator fun get(index: Number): SourceBuffer? + @nativeSetter + operator fun set(index: Number, value: SourceBuffer) +} + +external interface SpeechRecognitionAlternative { + var confidence: Number + var transcript: String +} + +external interface SpeechRecognitionEvent : Event { + var resultIndex: Number + var results: SpeechRecognitionResultList +} + +external interface SpeechRecognitionResult { + var isFinal: Boolean + var length: Number + fun item(index: Number): SpeechRecognitionAlternative + @nativeGetter + operator fun get(index: Number): SpeechRecognitionAlternative? + @nativeSetter + operator fun set(index: Number, value: SpeechRecognitionAlternative) +} + +external interface SpeechRecognitionResultList { + var length: Number + fun item(index: Number): SpeechRecognitionResult + @nativeGetter + operator fun get(index: Number): SpeechRecognitionResult? + @nativeSetter + operator fun set(index: Number, value: SpeechRecognitionResult) +} + +external interface SpeechSynthesisEventMap { + var voiceschanged: Event +} + +external interface SpeechSynthesis : EventTarget { + var onvoiceschanged: ((self: SpeechSynthesis, ev: Event) -> Any)? + var paused: Boolean + var pending: Boolean + var speaking: Boolean + fun cancel() + fun getVoices(): Array + fun pause() + fun resume() + fun speak(utterance: SpeechSynthesisUtterance) + fun addEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface SpeechSynthesisErrorEvent : SpeechSynthesisEvent { + var error: String /* "audio-busy" | "audio-hardware" | "canceled" | "interrupted" | "invalid-argument" | "language-unavailable" | "network" | "not-allowed" | "synthesis-failed" | "synthesis-unavailable" | "text-too-long" | "voice-unavailable" */ +} + +external interface SpeechSynthesisEvent : Event { + var charIndex: Number + var charLength: Number + var elapsedTime: Number + var name: String + var utterance: SpeechSynthesisUtterance +} + +external interface SpeechSynthesisUtteranceEventMap { + var boundary: SpeechSynthesisEvent + var end: SpeechSynthesisEvent + var error: SpeechSynthesisErrorEvent + var mark: SpeechSynthesisEvent + var pause: SpeechSynthesisEvent + var resume: SpeechSynthesisEvent + var start: SpeechSynthesisEvent +} + +external interface SpeechSynthesisUtterance : EventTarget { + var lang: String + var onboundary: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var onend: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var onerror: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisErrorEvent) -> Any)? + var onmark: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var onpause: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var onresume: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var onstart: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var pitch: Number + var rate: Number + var text: String + var voice: SpeechSynthesisVoice? + var volume: Number + fun addEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface SpeechSynthesisVoice { + var default: Boolean + var lang: String + var localService: Boolean + var name: String + var voiceURI: String +} + +external interface StorageManager { + fun estimate(): Promise + fun persist(): Promise + fun persisted(): Promise +} + +external interface StyleMedia { + var type: String + fun matchMedium(mediaquery: String): Boolean +} + +external interface StyleSheet { + var disabled: Boolean + var href: String? + var media: MediaList + var ownerNode: dynamic /* Element? | ProcessingInstruction? */ + get() = definedExternally + set(value) = definedExternally + var parentStyleSheet: CSSStyleSheet? + var title: String? + var type: String +} + +external interface StyleSheetList { + var length: Number + fun item(index: Number): CSSStyleSheet? + @nativeGetter + operator fun get(index: Number): CSSStyleSheet? + @nativeSetter + operator fun set(index: Number, value: CSSStyleSheet) +} + +external interface SubtleCrypto { + fun decrypt(algorithm: String, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun decrypt(algorithm: Algorithm, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun decrypt(algorithm: RsaOaepParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun decrypt(algorithm: AesCtrParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun decrypt(algorithm: AesCbcParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun decrypt(algorithm: AesCmacParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun decrypt(algorithm: AesGcmParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun decrypt(algorithm: AesCfbParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun deriveBits(algorithm: String, baseKey: CryptoKey, length: Number): PromiseLike + fun deriveBits(algorithm: Algorithm, baseKey: CryptoKey, length: Number): PromiseLike + fun deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: Number): PromiseLike + fun deriveBits(algorithm: DhKeyDeriveParams, baseKey: CryptoKey, length: Number): PromiseLike + fun deriveBits(algorithm: ConcatParams, baseKey: CryptoKey, length: Number): PromiseLike + fun deriveBits(algorithm: HkdfCtrParams, baseKey: CryptoKey, length: Number): PromiseLike + fun deriveBits(algorithm: Pbkdf2Params, baseKey: CryptoKey, length: Number): PromiseLike + fun deriveKey(algorithm: String, baseKey: CryptoKey, derivedKeyType: Any /* String | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params */, extractable: Boolean, keyUsages: Array): PromiseLike + fun deriveKey(algorithm: Algorithm, baseKey: CryptoKey, derivedKeyType: Any /* String | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params */, extractable: Boolean, keyUsages: Array): PromiseLike + fun deriveKey(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: Any /* String | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params */, extractable: Boolean, keyUsages: Array): PromiseLike + fun deriveKey(algorithm: DhKeyDeriveParams, baseKey: CryptoKey, derivedKeyType: Any /* String | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params */, extractable: Boolean, keyUsages: Array): PromiseLike + fun deriveKey(algorithm: ConcatParams, baseKey: CryptoKey, derivedKeyType: Any /* String | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params */, extractable: Boolean, keyUsages: Array): PromiseLike + fun deriveKey(algorithm: HkdfCtrParams, baseKey: CryptoKey, derivedKeyType: Any /* String | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params */, extractable: Boolean, keyUsages: Array): PromiseLike + fun deriveKey(algorithm: Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: Any /* String | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params */, extractable: Boolean, keyUsages: Array): PromiseLike + fun digest(algorithm: String, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun digest(algorithm: Algorithm, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun encrypt(algorithm: String, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun encrypt(algorithm: Algorithm, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun encrypt(algorithm: RsaOaepParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun encrypt(algorithm: AesCtrParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun encrypt(algorithm: AesCbcParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun encrypt(algorithm: AesCmacParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun encrypt(algorithm: AesGcmParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun encrypt(algorithm: AesCfbParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun exportKey(format: String /* "jwk" | "raw" | "pkcs8" | "spki" */, key: CryptoKey): dynamic /* PromiseLike */ + fun generateKey(algorithm: String, extractable: Boolean, keyUsages: Array): PromiseLike + fun generateKey(algorithm: Algorithm, extractable: Boolean, keyUsages: Array): PromiseLike + fun generateKey(algorithm: RsaHashedKeyGenParams, extractable: Boolean, keyUsages: Array): PromiseLike + fun generateKey(algorithm: EcKeyGenParams, extractable: Boolean, keyUsages: Array): PromiseLike + fun generateKey(algorithm: DhKeyGenParams, extractable: Boolean, keyUsages: Array): PromiseLike + fun generateKey(algorithm: AesKeyGenParams, extractable: Boolean, keyUsages: Array): PromiseLike + fun generateKey(algorithm: HmacKeyGenParams, extractable: Boolean, keyUsages: Array): PromiseLike + fun generateKey(algorithm: Pbkdf2Params, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "jwk" */, keyData: JsonWebKey, algorithm: String, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "jwk" */, keyData: JsonWebKey, algorithm: Algorithm, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "jwk" */, keyData: JsonWebKey, algorithm: RsaHashedImportParams, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "jwk" */, keyData: JsonWebKey, algorithm: EcKeyImportParams, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "jwk" */, keyData: JsonWebKey, algorithm: HmacImportParams, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "jwk" */, keyData: JsonWebKey, algorithm: DhImportKeyParams, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "jwk" */, keyData: JsonWebKey, algorithm: AesKeyAlgorithm, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: Int8Array, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: Int16Array, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: Int32Array, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: Uint8Array, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: Uint16Array, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: Uint32Array, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: Uint8ClampedArray, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: Float32Array, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: Float64Array, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: DataView, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String /* "raw" | "pkcs8" | "spki" */, keyData: ArrayBuffer, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun importKey(format: String, keyData: JsonWebKey, algorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun sign(algorithm: String, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun sign(algorithm: Algorithm, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun sign(algorithm: RsaPssParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun sign(algorithm: EcdsaParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun sign(algorithm: AesCmacParams, key: CryptoKey, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: Int8Array, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: Int16Array, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: Int32Array, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: Uint8Array, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: Uint16Array, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: Uint32Array, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: Uint8ClampedArray, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: Float32Array, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: Float64Array, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: DataView, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun unwrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, wrappedKey: ArrayBuffer, unwrappingKey: CryptoKey, unwrapAlgorithm: Any /* String | Algorithm | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams */, unwrappedKeyAlgorithm: Any /* String | Algorithm | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams | AesKeyAlgorithm */, extractable: Boolean, keyUsages: Array): PromiseLike + fun verify(algorithm: String, key: CryptoKey, signature: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun verify(algorithm: Algorithm, key: CryptoKey, signature: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun verify(algorithm: RsaPssParams, key: CryptoKey, signature: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun verify(algorithm: EcdsaParams, key: CryptoKey, signature: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun verify(algorithm: AesCmacParams, key: CryptoKey, signature: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */, data: Any /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */): PromiseLike + fun wrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: String): PromiseLike + fun wrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: Algorithm): PromiseLike + fun wrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: RsaOaepParams): PromiseLike + fun wrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesCtrParams): PromiseLike + fun wrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesCbcParams): PromiseLike + fun wrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesCmacParams): PromiseLike + fun wrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesGcmParams): PromiseLike + fun wrapKey(format: String /* "raw" | "pkcs8" | "spki" | "jwk" | String */, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AesCfbParams): PromiseLike +} + +external interface SyncManager { + fun getTags(): Promise> + fun register(tag: String): Promise +} + +external interface TextEvent : UIEvent { + var data: String + fun initTextEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, viewArg: Window, dataArg: String, inputMethod: Number, locale: String) + var DOM_INPUT_METHOD_DROP: Number + var DOM_INPUT_METHOD_HANDWRITING: Number + var DOM_INPUT_METHOD_IME: Number + var DOM_INPUT_METHOD_KEYBOARD: Number + var DOM_INPUT_METHOD_MULTIMODAL: Number + var DOM_INPUT_METHOD_OPTION: Number + var DOM_INPUT_METHOD_PASTE: Number + var DOM_INPUT_METHOD_SCRIPT: Number + var DOM_INPUT_METHOD_UNKNOWN: Number + var DOM_INPUT_METHOD_VOICE: Number +} + +external interface TextTrackEventMap { + var cuechange: Event +} + +external interface TextTrackCueEventMap { + var enter: Event + var exit: Event +} + +external interface TextTrackListEventMap { + var addtrack: TrackEvent + var change: Event + var removetrack: TrackEvent +} + +external interface TransitionEvent : Event { + var elapsedTime: Number + var propertyName: String + var pseudoElement: String +} + +external interface VRDisplay : EventTarget { + fun requestPresent(layers: Iterable): Promise + var capabilities: VRDisplayCapabilities + var depthFar: Number + var depthNear: Number + var displayId: Number + var displayName: String + var isConnected: Boolean + var isPresenting: Boolean + var stageParameters: VRStageParameters? + fun cancelAnimationFrame(handle: Number) + fun exitPresent(): Promise + fun getEyeParameters(whichEye: String): VREyeParameters + fun getFrameData(frameData: VRFrameData): Boolean + fun getLayers(): Array + fun getPose(): VRPose + fun requestAnimationFrame(callback: FrameRequestCallback): Number + fun requestPresent(layers: Array): Promise + fun resetPose() + fun submitFrame(pose: VRPose = definedExternally) +} + +external interface VRDisplayCapabilities { + var canPresent: Boolean + var hasExternalDisplay: Boolean + var hasOrientation: Boolean + var hasPosition: Boolean + var maxLayers: Number +} + +external interface VRDisplayEvent : Event { + var display: VRDisplay + var reason: String /* "mounted" | "navigation" | "requested" | "unmounted" */ +} + +external interface VREyeParameters { + var fieldOfView: VRFieldOfView + var offset: Float32Array + var renderHeight: Number + var renderWidth: Number +} + +external interface VRFieldOfView { + var downDegrees: Number + var leftDegrees: Number + var rightDegrees: Number + var upDegrees: Number +} + +external interface VRFrameData { + var leftProjectionMatrix: Float32Array + var leftViewMatrix: Float32Array + var pose: VRPose + var rightProjectionMatrix: Float32Array + var rightViewMatrix: Float32Array + var timestamp: Number +} + +external interface VRPose { + var angularAcceleration: Float32Array? + var angularVelocity: Float32Array? + var linearAcceleration: Float32Array? + var linearVelocity: Float32Array? + var orientation: Float32Array? + var position: Float32Array? + var timestamp: Number +} + +external interface VideoPlaybackQuality { + var creationTime: Number + var droppedVideoFrames: Number + var totalVideoFrames: Number +} + +external interface WEBGL_color_buffer_float { + var FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum + var RGBA32F_EXT: GLenum + var UNSIGNED_NORMALIZED_EXT: GLenum +} + +external interface WEBGL_compressed_texture_astc { + fun getSupportedProfiles(): Array + var COMPRESSED_RGBA_ASTC_10x10_KHR: GLenum + var COMPRESSED_RGBA_ASTC_10x5_KHR: GLenum + var COMPRESSED_RGBA_ASTC_10x6_KHR: GLenum + var COMPRESSED_RGBA_ASTC_10x8_KHR: GLenum + var COMPRESSED_RGBA_ASTC_12x10_KHR: GLenum + var COMPRESSED_RGBA_ASTC_12x12_KHR: GLenum + var COMPRESSED_RGBA_ASTC_4x4_KHR: GLenum + var COMPRESSED_RGBA_ASTC_5x4_KHR: GLenum + var COMPRESSED_RGBA_ASTC_5x5_KHR: GLenum + var COMPRESSED_RGBA_ASTC_6x5_KHR: GLenum + var COMPRESSED_RGBA_ASTC_6x6_KHR: GLenum + var COMPRESSED_RGBA_ASTC_8x5_KHR: GLenum + var COMPRESSED_RGBA_ASTC_8x6_KHR: GLenum + var COMPRESSED_RGBA_ASTC_8x8_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: GLenum + var COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: GLenum +} + +external interface WEBGL_compressed_texture_s3tc { + var COMPRESSED_RGBA_S3TC_DXT1_EXT: GLenum + var COMPRESSED_RGBA_S3TC_DXT3_EXT: GLenum + var COMPRESSED_RGBA_S3TC_DXT5_EXT: GLenum + var COMPRESSED_RGB_S3TC_DXT1_EXT: GLenum +} + +external interface WEBGL_compressed_texture_s3tc_srgb { + var COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: GLenum + var COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: GLenum + var COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: GLenum + var COMPRESSED_SRGB_S3TC_DXT1_EXT: GLenum +} + +external interface WEBGL_debug_renderer_info { + var UNMASKED_RENDERER_WEBGL: GLenum + var UNMASKED_VENDOR_WEBGL: GLenum +} + +external interface WEBGL_debug_shaders { + fun getTranslatedShaderSource(shader: WebGLShader): String +} + +external interface WEBGL_depth_texture { + var UNSIGNED_INT_24_8_WEBGL: GLenum +} + +external interface WEBGL_draw_buffers { + fun drawBuffersWEBGL(buffers: Iterable) + fun drawBuffersWEBGL(buffers: Array) + var COLOR_ATTACHMENT0_WEBGL: GLenum + var COLOR_ATTACHMENT10_WEBGL: GLenum + var COLOR_ATTACHMENT11_WEBGL: GLenum + var COLOR_ATTACHMENT12_WEBGL: GLenum + var COLOR_ATTACHMENT13_WEBGL: GLenum + var COLOR_ATTACHMENT14_WEBGL: GLenum + var COLOR_ATTACHMENT15_WEBGL: GLenum + var COLOR_ATTACHMENT1_WEBGL: GLenum + var COLOR_ATTACHMENT2_WEBGL: GLenum + var COLOR_ATTACHMENT3_WEBGL: GLenum + var COLOR_ATTACHMENT4_WEBGL: GLenum + var COLOR_ATTACHMENT5_WEBGL: GLenum + var COLOR_ATTACHMENT6_WEBGL: GLenum + var COLOR_ATTACHMENT7_WEBGL: GLenum + var COLOR_ATTACHMENT8_WEBGL: GLenum + var COLOR_ATTACHMENT9_WEBGL: GLenum + var DRAW_BUFFER0_WEBGL: GLenum + var DRAW_BUFFER10_WEBGL: GLenum + var DRAW_BUFFER11_WEBGL: GLenum + var DRAW_BUFFER12_WEBGL: GLenum + var DRAW_BUFFER13_WEBGL: GLenum + var DRAW_BUFFER14_WEBGL: GLenum + var DRAW_BUFFER15_WEBGL: GLenum + var DRAW_BUFFER1_WEBGL: GLenum + var DRAW_BUFFER2_WEBGL: GLenum + var DRAW_BUFFER3_WEBGL: GLenum + var DRAW_BUFFER4_WEBGL: GLenum + var DRAW_BUFFER5_WEBGL: GLenum + var DRAW_BUFFER6_WEBGL: GLenum + var DRAW_BUFFER7_WEBGL: GLenum + var DRAW_BUFFER8_WEBGL: GLenum + var DRAW_BUFFER9_WEBGL: GLenum + var MAX_COLOR_ATTACHMENTS_WEBGL: GLenum + var MAX_DRAW_BUFFERS_WEBGL: GLenum +} + +external interface WEBGL_lose_context { + fun loseContext() + fun restoreContext() +} + +external interface WebGL2RenderingContext : WebGL2RenderingContextBase, WebGL2RenderingContextOverloads, WebGLRenderingContextBase + +external interface WebGL2RenderingContextBase { + fun clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset: GLuint = definedExternally) + fun clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Iterable) + fun clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset: GLuint = definedExternally) + fun clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Iterable) + fun clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable, srcOffset: GLuint = definedExternally) + fun clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Iterable) + fun drawBuffers(buffers: Iterable) + fun getActiveUniforms(program: WebGLProgram, uniformIndices: Iterable, pname: GLenum): Any + fun getUniformIndices(program: WebGLProgram, uniformNames: Iterable): Iterable? + fun invalidateFramebuffer(target: GLenum, attachments: Iterable) + fun invalidateSubFramebuffer(target: GLenum, attachments: Iterable, x: GLint, y: GLint, width: GLsizei, height: GLsizei) + fun transformFeedbackVaryings(program: WebGLProgram, varyings: Iterable, bufferMode: GLenum) + fun uniform1uiv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform1uiv(location: WebGLUniformLocation?, data: Iterable) + fun uniform1uiv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniform2uiv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform2uiv(location: WebGLUniformLocation?, data: Iterable) + fun uniform2uiv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniform3uiv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform3uiv(location: WebGLUniformLocation?, data: Iterable) + fun uniform3uiv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniform4uiv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform4uiv(location: WebGLUniformLocation?, data: Iterable) + fun uniform4uiv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable) + fun uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable) + fun uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable) + fun uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable) + fun uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable) + fun uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable) + fun uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally) + fun vertexAttribI4iv(index: GLuint, values: Iterable) + fun vertexAttribI4uiv(index: GLuint, values: Iterable) + fun beginQuery(target: GLenum, query: WebGLQuery) + fun beginTransformFeedback(primitiveMode: GLenum) + fun bindBufferBase(target: GLenum, index: GLuint, buffer: WebGLBuffer?) + fun bindBufferRange(target: GLenum, index: GLuint, buffer: WebGLBuffer?, offset: GLintptr, size: GLsizeiptr) + fun bindSampler(unit: GLuint, sampler: WebGLSampler?) + fun bindTransformFeedback(target: GLenum, tf: WebGLTransformFeedback?) + fun bindVertexArray(array: WebGLVertexArrayObject?) + fun blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum) + fun clearBufferfi(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint) + fun clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32Array, srcOffset: GLuint = definedExternally) + fun clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Float32Array) + fun clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Array, srcOffset: GLuint = definedExternally) + fun clearBufferfv(buffer: GLenum, drawbuffer: GLint, values: Array) + fun clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32Array, srcOffset: GLuint = definedExternally) + fun clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Int32Array) + fun clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Array, srcOffset: GLuint = definedExternally) + fun clearBufferiv(buffer: GLenum, drawbuffer: GLint, values: Array) + fun clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32Array, srcOffset: GLuint = definedExternally) + fun clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32Array) + fun clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Array, srcOffset: GLuint = definedExternally) + fun clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Array) + fun clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64): GLenum + fun compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) + fun compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint = definedExternally, srcLengthOverride: GLuint = definedExternally) + fun compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView) + fun compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint = definedExternally) + fun compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) + fun compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint = definedExternally, srcLengthOverride: GLuint = definedExternally) + fun compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView) + fun compressedTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint = definedExternally) + fun copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizeiptr) + fun copyTexSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei) + fun createQuery(): WebGLQuery? + fun createSampler(): WebGLSampler? + fun createTransformFeedback(): WebGLTransformFeedback? + fun createVertexArray(): WebGLVertexArrayObject? + fun deleteQuery(query: WebGLQuery?) + fun deleteSampler(sampler: WebGLSampler?) + fun deleteSync(sync: WebGLSync?) + fun deleteTransformFeedback(tf: WebGLTransformFeedback?) + fun deleteVertexArray(vertexArray: WebGLVertexArrayObject?) + fun drawArraysInstanced(mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei) + fun drawBuffers(buffers: Array) + fun drawElementsInstanced(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, instanceCount: GLsizei) + fun drawRangeElements(mode: GLenum, start: GLuint, end: GLuint, count: GLsizei, type: GLenum, offset: GLintptr) + fun endQuery(target: GLenum) + fun endTransformFeedback() + fun fenceSync(condition: GLenum, flags: GLbitfield): WebGLSync? + fun framebufferTextureLayer(target: GLenum, attachment: GLenum, texture: WebGLTexture?, level: GLint, layer: GLint) + fun getActiveUniformBlockName(program: WebGLProgram, uniformBlockIndex: GLuint): String? + fun getActiveUniformBlockParameter(program: WebGLProgram, uniformBlockIndex: GLuint, pname: GLenum): Any + fun getActiveUniforms(program: WebGLProgram, uniformIndices: Array, pname: GLenum): Any + fun getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstBuffer: ArrayBufferView, dstOffset: GLuint = definedExternally, length: GLuint = definedExternally) + fun getFragDataLocation(program: WebGLProgram, name: String): GLint + fun getIndexedParameter(target: GLenum, index: GLuint): Any + fun getInternalformatParameter(target: GLenum, internalformat: GLenum, pname: GLenum): Any + fun getQuery(target: GLenum, pname: GLenum): WebGLQuery? + fun getQueryParameter(query: WebGLQuery, pname: GLenum): Any + fun getSamplerParameter(sampler: WebGLSampler, pname: GLenum): Any + fun getSyncParameter(sync: WebGLSync, pname: GLenum): Any + fun getTransformFeedbackVarying(program: WebGLProgram, index: GLuint): WebGLActiveInfo? + fun getUniformBlockIndex(program: WebGLProgram, uniformBlockName: String): GLuint + fun getUniformIndices(program: WebGLProgram, uniformNames: Array): Array? + fun invalidateFramebuffer(target: GLenum, attachments: Array) + fun invalidateSubFramebuffer(target: GLenum, attachments: Array, x: GLint, y: GLint, width: GLsizei, height: GLsizei) + fun isQuery(query: WebGLQuery?): GLboolean + fun isSampler(sampler: WebGLSampler?): GLboolean + fun isSync(sync: WebGLSync?): GLboolean + fun isTransformFeedback(tf: WebGLTransformFeedback?): GLboolean + fun isVertexArray(vertexArray: WebGLVertexArrayObject?): GLboolean + fun pauseTransformFeedback() + fun readBuffer(src: GLenum) + fun renderbufferStorageMultisample(target: GLenum, samples: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) + fun resumeTransformFeedback() + fun samplerParameterf(sampler: WebGLSampler, pname: GLenum, param: GLfloat) + fun samplerParameteri(sampler: WebGLSampler, pname: GLenum, param: GLint) + fun texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) + fun texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: ImageBitmap) + fun texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: ImageData) + fun texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: HTMLImageElement) + fun texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: HTMLCanvasElement) + fun texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: HTMLVideoElement) + fun texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source: OffscreenCanvas) + fun texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView?) + fun texImage3D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) + fun texStorage2D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei) + fun texStorage3D(target: GLenum, levels: GLsizei, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei) + fun texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) + fun texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: ImageBitmap) + fun texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: ImageData) + fun texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: HTMLImageElement) + fun texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: HTMLCanvasElement) + fun texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: HTMLVideoElement) + fun texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, source: OffscreenCanvas) + fun texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView?, srcOffset: GLuint = definedExternally) + fun texSubImage3D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, zoffset: GLint, width: GLsizei, height: GLsizei, depth: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView?) + fun transformFeedbackVaryings(program: WebGLProgram, varyings: Array, bufferMode: GLenum) + fun uniform1ui(location: WebGLUniformLocation?, v0: GLuint) + fun uniform1uiv(location: WebGLUniformLocation?, data: Uint32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform1uiv(location: WebGLUniformLocation?, data: Uint32Array) + fun uniform1uiv(location: WebGLUniformLocation?, data: Uint32Array, srcOffset: GLuint = definedExternally) + fun uniform1uiv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform1uiv(location: WebGLUniformLocation?, data: Array) + fun uniform1uiv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniform2ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint) + fun uniform2uiv(location: WebGLUniformLocation?, data: Uint32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform2uiv(location: WebGLUniformLocation?, data: Uint32Array) + fun uniform2uiv(location: WebGLUniformLocation?, data: Uint32Array, srcOffset: GLuint = definedExternally) + fun uniform2uiv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform2uiv(location: WebGLUniformLocation?, data: Array) + fun uniform2uiv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniform3ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint) + fun uniform3uiv(location: WebGLUniformLocation?, data: Uint32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform3uiv(location: WebGLUniformLocation?, data: Uint32Array) + fun uniform3uiv(location: WebGLUniformLocation?, data: Uint32Array, srcOffset: GLuint = definedExternally) + fun uniform3uiv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform3uiv(location: WebGLUniformLocation?, data: Array) + fun uniform3uiv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniform4ui(location: WebGLUniformLocation?, v0: GLuint, v1: GLuint, v2: GLuint, v3: GLuint) + fun uniform4uiv(location: WebGLUniformLocation?, data: Uint32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform4uiv(location: WebGLUniformLocation?, data: Uint32Array) + fun uniform4uiv(location: WebGLUniformLocation?, data: Uint32Array, srcOffset: GLuint = definedExternally) + fun uniform4uiv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform4uiv(location: WebGLUniformLocation?, data: Array) + fun uniform4uiv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniformBlockBinding(program: WebGLProgram, uniformBlockIndex: GLuint, uniformBlockBinding: GLuint) + fun uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array) + fun uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array) + fun uniformMatrix2x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array) + fun uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array) + fun uniformMatrix2x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array) + fun uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array) + fun uniformMatrix3x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array) + fun uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array) + fun uniformMatrix3x4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array) + fun uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array) + fun uniformMatrix4x2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array) + fun uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array) + fun uniformMatrix4x3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally) + fun vertexAttribDivisor(index: GLuint, divisor: GLuint) + fun vertexAttribI4i(index: GLuint, x: GLint, y: GLint, z: GLint, w: GLint) + fun vertexAttribI4iv(index: GLuint, values: Int32Array) + fun vertexAttribI4iv(index: GLuint, values: Array) + fun vertexAttribI4ui(index: GLuint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) + fun vertexAttribI4uiv(index: GLuint, values: Uint32Array) + fun vertexAttribI4uiv(index: GLuint, values: Array) + fun vertexAttribIPointer(index: GLuint, size: GLint, type: GLenum, stride: GLsizei, offset: GLintptr) + fun waitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLint64) + var ACTIVE_UNIFORM_BLOCKS: GLenum + var ALREADY_SIGNALED: GLenum + var ANY_SAMPLES_PASSED: GLenum + var ANY_SAMPLES_PASSED_CONSERVATIVE: GLenum + var COLOR: GLenum + var COLOR_ATTACHMENT1: GLenum + var COLOR_ATTACHMENT10: GLenum + var COLOR_ATTACHMENT11: GLenum + var COLOR_ATTACHMENT12: GLenum + var COLOR_ATTACHMENT13: GLenum + var COLOR_ATTACHMENT14: GLenum + var COLOR_ATTACHMENT15: GLenum + var COLOR_ATTACHMENT2: GLenum + var COLOR_ATTACHMENT3: GLenum + var COLOR_ATTACHMENT4: GLenum + var COLOR_ATTACHMENT5: GLenum + var COLOR_ATTACHMENT6: GLenum + var COLOR_ATTACHMENT7: GLenum + var COLOR_ATTACHMENT8: GLenum + var COLOR_ATTACHMENT9: GLenum + var COMPARE_REF_TO_TEXTURE: GLenum + var CONDITION_SATISFIED: GLenum + var COPY_READ_BUFFER: GLenum + var COPY_READ_BUFFER_BINDING: GLenum + var COPY_WRITE_BUFFER: GLenum + var COPY_WRITE_BUFFER_BINDING: GLenum + var CURRENT_QUERY: GLenum + var DEPTH: GLenum + var DEPTH24_STENCIL8: GLenum + var DEPTH32F_STENCIL8: GLenum + var DEPTH_COMPONENT24: GLenum + var DEPTH_COMPONENT32F: GLenum + var DRAW_BUFFER0: GLenum + var DRAW_BUFFER1: GLenum + var DRAW_BUFFER10: GLenum + var DRAW_BUFFER11: GLenum + var DRAW_BUFFER12: GLenum + var DRAW_BUFFER13: GLenum + var DRAW_BUFFER14: GLenum + var DRAW_BUFFER15: GLenum + var DRAW_BUFFER2: GLenum + var DRAW_BUFFER3: GLenum + var DRAW_BUFFER4: GLenum + var DRAW_BUFFER5: GLenum + var DRAW_BUFFER6: GLenum + var DRAW_BUFFER7: GLenum + var DRAW_BUFFER8: GLenum + var DRAW_BUFFER9: GLenum + var DRAW_FRAMEBUFFER: GLenum + var DRAW_FRAMEBUFFER_BINDING: GLenum + var DYNAMIC_COPY: GLenum + var DYNAMIC_READ: GLenum + var FLOAT_32_UNSIGNED_INT_24_8_REV: GLenum + var FLOAT_MAT2x3: GLenum + var FLOAT_MAT2x4: GLenum + var FLOAT_MAT3x2: GLenum + var FLOAT_MAT3x4: GLenum + var FLOAT_MAT4x2: GLenum + var FLOAT_MAT4x3: GLenum + var FRAGMENT_SHADER_DERIVATIVE_HINT: GLenum + var FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: GLenum + var FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: GLenum + var FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: GLenum + var FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: GLenum + var FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: GLenum + var FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: GLenum + var FRAMEBUFFER_ATTACHMENT_RED_SIZE: GLenum + var FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: GLenum + var FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: GLenum + var FRAMEBUFFER_DEFAULT: GLenum + var FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: GLenum + var HALF_FLOAT: GLenum + var INTERLEAVED_ATTRIBS: GLenum + var INT_2_10_10_10_REV: GLenum + var INT_SAMPLER_2D: GLenum + var INT_SAMPLER_2D_ARRAY: GLenum + var INT_SAMPLER_3D: GLenum + var INT_SAMPLER_CUBE: GLenum + var INVALID_INDEX: GLenum + var MAX: GLenum + var MAX_3D_TEXTURE_SIZE: GLenum + var MAX_ARRAY_TEXTURE_LAYERS: GLenum + var MAX_CLIENT_WAIT_TIMEOUT_WEBGL: GLenum + var MAX_COLOR_ATTACHMENTS: GLenum + var MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: GLenum + var MAX_COMBINED_UNIFORM_BLOCKS: GLenum + var MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: GLenum + var MAX_DRAW_BUFFERS: GLenum + var MAX_ELEMENTS_INDICES: GLenum + var MAX_ELEMENTS_VERTICES: GLenum + var MAX_ELEMENT_INDEX: GLenum + var MAX_FRAGMENT_INPUT_COMPONENTS: GLenum + var MAX_FRAGMENT_UNIFORM_BLOCKS: GLenum + var MAX_FRAGMENT_UNIFORM_COMPONENTS: GLenum + var MAX_PROGRAM_TEXEL_OFFSET: GLenum + var MAX_SAMPLES: GLenum + var MAX_SERVER_WAIT_TIMEOUT: GLenum + var MAX_TEXTURE_LOD_BIAS: GLenum + var MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: GLenum + var MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: GLenum + var MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: GLenum + var MAX_UNIFORM_BLOCK_SIZE: GLenum + var MAX_UNIFORM_BUFFER_BINDINGS: GLenum + var MAX_VARYING_COMPONENTS: GLenum + var MAX_VERTEX_OUTPUT_COMPONENTS: GLenum + var MAX_VERTEX_UNIFORM_BLOCKS: GLenum + var MAX_VERTEX_UNIFORM_COMPONENTS: GLenum + var MIN: GLenum + var MIN_PROGRAM_TEXEL_OFFSET: GLenum + var OBJECT_TYPE: GLenum + var PACK_ROW_LENGTH: GLenum + var PACK_SKIP_PIXELS: GLenum + var PACK_SKIP_ROWS: GLenum + var PIXEL_PACK_BUFFER: GLenum + var PIXEL_PACK_BUFFER_BINDING: GLenum + var PIXEL_UNPACK_BUFFER: GLenum + var PIXEL_UNPACK_BUFFER_BINDING: GLenum + var QUERY_RESULT: GLenum + var QUERY_RESULT_AVAILABLE: GLenum + var R11F_G11F_B10F: GLenum + var R16F: GLenum + var R16I: GLenum + var R16UI: GLenum + var R32F: GLenum + var R32I: GLenum + var R32UI: GLenum + var R8: GLenum + var R8I: GLenum + var R8UI: GLenum + var R8_SNORM: GLenum + var RASTERIZER_DISCARD: GLenum + var READ_BUFFER: GLenum + var READ_FRAMEBUFFER: GLenum + var READ_FRAMEBUFFER_BINDING: GLenum + var RED: GLenum + var RED_INTEGER: GLenum + var RENDERBUFFER_SAMPLES: GLenum + var RG: GLenum + var RG16F: GLenum + var RG16I: GLenum + var RG16UI: GLenum + var RG32F: GLenum + var RG32I: GLenum + var RG32UI: GLenum + var RG8: GLenum + var RG8I: GLenum + var RG8UI: GLenum + var RG8_SNORM: GLenum + var RGB10_A2: GLenum + var RGB10_A2UI: GLenum + var RGB16F: GLenum + var RGB16I: GLenum + var RGB16UI: GLenum + var RGB32F: GLenum + var RGB32I: GLenum + var RGB32UI: GLenum + var RGB8: GLenum + var RGB8I: GLenum + var RGB8UI: GLenum + var RGB8_SNORM: GLenum + var RGB9_E5: GLenum + var RGBA16F: GLenum + var RGBA16I: GLenum + var RGBA16UI: GLenum + var RGBA32F: GLenum + var RGBA32I: GLenum + var RGBA32UI: GLenum + var RGBA8: GLenum + var RGBA8I: GLenum + var RGBA8UI: GLenum + var RGBA8_SNORM: GLenum + var RGBA_INTEGER: GLenum + var RGB_INTEGER: GLenum + var RG_INTEGER: GLenum + var SAMPLER_2D_ARRAY: GLenum + var SAMPLER_2D_ARRAY_SHADOW: GLenum + var SAMPLER_2D_SHADOW: GLenum + var SAMPLER_3D: GLenum + var SAMPLER_BINDING: GLenum + var SAMPLER_CUBE_SHADOW: GLenum + var SEPARATE_ATTRIBS: GLenum + var SIGNALED: GLenum + var SIGNED_NORMALIZED: GLenum + var SRGB: GLenum + var SRGB8: GLenum + var SRGB8_ALPHA8: GLenum + var STATIC_COPY: GLenum + var STATIC_READ: GLenum + var STENCIL: GLenum + var STREAM_COPY: GLenum + var STREAM_READ: GLenum + var SYNC_CONDITION: GLenum + var SYNC_FENCE: GLenum + var SYNC_FLAGS: GLenum + var SYNC_FLUSH_COMMANDS_BIT: GLenum + var SYNC_GPU_COMMANDS_COMPLETE: GLenum + var SYNC_STATUS: GLenum + var TEXTURE_2D_ARRAY: GLenum + var TEXTURE_3D: GLenum + var TEXTURE_BASE_LEVEL: GLenum + var TEXTURE_BINDING_2D_ARRAY: GLenum + var TEXTURE_BINDING_3D: GLenum + var TEXTURE_COMPARE_FUNC: GLenum + var TEXTURE_COMPARE_MODE: GLenum + var TEXTURE_IMMUTABLE_FORMAT: GLenum + var TEXTURE_IMMUTABLE_LEVELS: GLenum + var TEXTURE_MAX_LEVEL: GLenum + var TEXTURE_MAX_LOD: GLenum + var TEXTURE_MIN_LOD: GLenum + var TEXTURE_WRAP_R: GLenum + var TIMEOUT_EXPIRED: GLenum + var TIMEOUT_IGNORED: GLint64 + var TRANSFORM_FEEDBACK: GLenum + var TRANSFORM_FEEDBACK_ACTIVE: GLenum + var TRANSFORM_FEEDBACK_BINDING: GLenum + var TRANSFORM_FEEDBACK_BUFFER: GLenum + var TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum + var TRANSFORM_FEEDBACK_BUFFER_MODE: GLenum + var TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum + var TRANSFORM_FEEDBACK_BUFFER_START: GLenum + var TRANSFORM_FEEDBACK_PAUSED: GLenum + var TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: GLenum + var TRANSFORM_FEEDBACK_VARYINGS: GLenum + var UNIFORM_ARRAY_STRIDE: GLenum + var UNIFORM_BLOCK_ACTIVE_UNIFORMS: GLenum + var UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: GLenum + var UNIFORM_BLOCK_BINDING: GLenum + var UNIFORM_BLOCK_DATA_SIZE: GLenum + var UNIFORM_BLOCK_INDEX: GLenum + var UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: GLenum + var UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: GLenum + var UNIFORM_BUFFER: GLenum + var UNIFORM_BUFFER_BINDING: GLenum + var UNIFORM_BUFFER_OFFSET_ALIGNMENT: GLenum + var UNIFORM_BUFFER_SIZE: GLenum + var UNIFORM_BUFFER_START: GLenum + var UNIFORM_IS_ROW_MAJOR: GLenum + var UNIFORM_MATRIX_STRIDE: GLenum + var UNIFORM_OFFSET: GLenum + var UNIFORM_SIZE: GLenum + var UNIFORM_TYPE: GLenum + var UNPACK_IMAGE_HEIGHT: GLenum + var UNPACK_ROW_LENGTH: GLenum + var UNPACK_SKIP_IMAGES: GLenum + var UNPACK_SKIP_PIXELS: GLenum + var UNPACK_SKIP_ROWS: GLenum + var UNSIGNALED: GLenum + var UNSIGNED_INT_10F_11F_11F_REV: GLenum + var UNSIGNED_INT_24_8: GLenum + var UNSIGNED_INT_2_10_10_10_REV: GLenum + var UNSIGNED_INT_5_9_9_9_REV: GLenum + var UNSIGNED_INT_SAMPLER_2D: GLenum + var UNSIGNED_INT_SAMPLER_2D_ARRAY: GLenum + var UNSIGNED_INT_SAMPLER_3D: GLenum + var UNSIGNED_INT_SAMPLER_CUBE: GLenum + var UNSIGNED_INT_VEC2: GLenum + var UNSIGNED_INT_VEC3: GLenum + var UNSIGNED_INT_VEC4: GLenum + var UNSIGNED_NORMALIZED: GLenum + var VERTEX_ARRAY_BINDING: GLenum + var VERTEX_ATTRIB_ARRAY_DIVISOR: GLenum + var VERTEX_ATTRIB_ARRAY_INTEGER: GLenum + var WAIT_FAILED: GLenum +} + +external interface WebGL2RenderingContextOverloads { + fun uniform1fv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform1fv(location: WebGLUniformLocation?, data: Iterable) + fun uniform1fv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniform1iv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform1iv(location: WebGLUniformLocation?, data: Iterable) + fun uniform1iv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniform2fv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform2fv(location: WebGLUniformLocation?, data: Iterable) + fun uniform2fv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniform2iv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform2iv(location: WebGLUniformLocation?, data: Iterable) + fun uniform2iv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniform3fv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform3fv(location: WebGLUniformLocation?, data: Iterable) + fun uniform3fv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniform3iv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform3iv(location: WebGLUniformLocation?, data: Iterable) + fun uniform3iv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniform4fv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform4fv(location: WebGLUniformLocation?, data: Iterable) + fun uniform4fv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniform4iv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform4iv(location: WebGLUniformLocation?, data: Iterable) + fun uniform4iv(location: WebGLUniformLocation?, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Iterable, srcOffset: GLuint = definedExternally) + fun bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) + fun bufferData(target: GLenum, srcData: ArrayBufferView?, usage: GLenum) + fun bufferData(target: GLenum, srcData: ArrayBuffer?, usage: GLenum) + fun bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint, length: GLuint = definedExternally) + fun bufferData(target: GLenum, srcData: ArrayBufferView, usage: GLenum, srcOffset: GLuint) + fun bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView) + fun bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBuffer) + fun bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint, length: GLuint = definedExternally) + fun bufferSubData(target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView, srcOffset: GLuint) + fun compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr) + fun compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint = definedExternally, srcLengthOverride: GLuint = definedExternally) + fun compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView) + fun compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset: GLuint = definedExternally) + fun compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, imageSize: GLsizei, offset: GLintptr) + fun compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint = definedExternally, srcLengthOverride: GLuint = definedExternally) + fun compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView) + fun compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, srcData: ArrayBufferView, srcOffset: GLuint = definedExternally) + fun readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView?) + fun readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, offset: GLintptr) + fun readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, dstData: ArrayBufferView, dstOffset: GLuint) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: ImageBitmap) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: ImageData) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLImageElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLCanvasElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLVideoElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: OffscreenCanvas) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pboOffset: GLintptr) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: ImageBitmap) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: ImageData) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: HTMLImageElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: HTMLCanvasElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: HTMLVideoElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source: OffscreenCanvas) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: ImageBitmap) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: ImageData) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: HTMLImageElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: HTMLCanvasElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: HTMLVideoElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: OffscreenCanvas) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pboOffset: GLintptr) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: ImageBitmap) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: ImageData) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: HTMLImageElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: HTMLCanvasElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: HTMLVideoElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, source: OffscreenCanvas) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, srcData: ArrayBufferView, srcOffset: GLuint) + fun uniform1fv(location: WebGLUniformLocation?, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform1fv(location: WebGLUniformLocation?, data: Float32Array) + fun uniform1fv(location: WebGLUniformLocation?, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniform1fv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform1fv(location: WebGLUniformLocation?, data: Array) + fun uniform1fv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniform1iv(location: WebGLUniformLocation?, data: Int32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform1iv(location: WebGLUniformLocation?, data: Int32Array) + fun uniform1iv(location: WebGLUniformLocation?, data: Int32Array, srcOffset: GLuint = definedExternally) + fun uniform1iv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform1iv(location: WebGLUniformLocation?, data: Array) + fun uniform1iv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniform2fv(location: WebGLUniformLocation?, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform2fv(location: WebGLUniformLocation?, data: Float32Array) + fun uniform2fv(location: WebGLUniformLocation?, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniform2fv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform2fv(location: WebGLUniformLocation?, data: Array) + fun uniform2fv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniform2iv(location: WebGLUniformLocation?, data: Int32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform2iv(location: WebGLUniformLocation?, data: Int32Array) + fun uniform2iv(location: WebGLUniformLocation?, data: Int32Array, srcOffset: GLuint = definedExternally) + fun uniform2iv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform2iv(location: WebGLUniformLocation?, data: Array) + fun uniform2iv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniform3fv(location: WebGLUniformLocation?, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform3fv(location: WebGLUniformLocation?, data: Float32Array) + fun uniform3fv(location: WebGLUniformLocation?, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniform3fv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform3fv(location: WebGLUniformLocation?, data: Array) + fun uniform3fv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniform3iv(location: WebGLUniformLocation?, data: Int32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform3iv(location: WebGLUniformLocation?, data: Int32Array) + fun uniform3iv(location: WebGLUniformLocation?, data: Int32Array, srcOffset: GLuint = definedExternally) + fun uniform3iv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform3iv(location: WebGLUniformLocation?, data: Array) + fun uniform3iv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniform4fv(location: WebGLUniformLocation?, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform4fv(location: WebGLUniformLocation?, data: Float32Array) + fun uniform4fv(location: WebGLUniformLocation?, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniform4fv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform4fv(location: WebGLUniformLocation?, data: Array) + fun uniform4fv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniform4iv(location: WebGLUniformLocation?, data: Int32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform4iv(location: WebGLUniformLocation?, data: Int32Array) + fun uniform4iv(location: WebGLUniformLocation?, data: Int32Array, srcOffset: GLuint = definedExternally) + fun uniform4iv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniform4iv(location: WebGLUniformLocation?, data: Array) + fun uniform4iv(location: WebGLUniformLocation?, data: Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Float32Array, srcOffset: GLuint = definedExternally) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally, srcLength: GLuint = definedExternally) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, data: Array, srcOffset: GLuint = definedExternally) +} + +external interface WebGLQuery : WebGLObject + +external interface WebGLRenderingContextOverloads { + fun uniform1fv(location: WebGLUniformLocation?, v: Iterable) + fun uniform1iv(location: WebGLUniformLocation?, v: Iterable) + fun uniform2fv(location: WebGLUniformLocation?, v: Iterable) + fun uniform2iv(location: WebGLUniformLocation?, v: Iterable) + fun uniform3fv(location: WebGLUniformLocation?, v: Iterable) + fun uniform3iv(location: WebGLUniformLocation?, v: Iterable) + fun uniform4fv(location: WebGLUniformLocation?, v: Iterable) + fun uniform4iv(location: WebGLUniformLocation?, v: Iterable) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Iterable) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Iterable) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Iterable) + fun bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) + fun bufferData(target: GLenum, data: ArrayBufferView?, usage: GLenum) + fun bufferData(target: GLenum, data: ArrayBuffer?, usage: GLenum) + fun bufferSubData(target: GLenum, offset: GLintptr, data: ArrayBufferView) + fun bufferSubData(target: GLenum, offset: GLintptr, data: ArrayBuffer) + fun compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView) + fun compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView) + fun readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: ImageBitmap) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: ImageData) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLImageElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLCanvasElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLVideoElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: OffscreenCanvas) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: ImageBitmap) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: ImageData) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: HTMLImageElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: HTMLCanvasElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: HTMLVideoElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: OffscreenCanvas) + fun uniform1fv(location: WebGLUniformLocation?, v: Float32Array) + fun uniform1fv(location: WebGLUniformLocation?, v: Array) + fun uniform1iv(location: WebGLUniformLocation?, v: Int32Array) + fun uniform1iv(location: WebGLUniformLocation?, v: Array) + fun uniform2fv(location: WebGLUniformLocation?, v: Float32Array) + fun uniform2fv(location: WebGLUniformLocation?, v: Array) + fun uniform2iv(location: WebGLUniformLocation?, v: Int32Array) + fun uniform2iv(location: WebGLUniformLocation?, v: Array) + fun uniform3fv(location: WebGLUniformLocation?, v: Float32Array) + fun uniform3fv(location: WebGLUniformLocation?, v: Array) + fun uniform3iv(location: WebGLUniformLocation?, v: Int32Array) + fun uniform3iv(location: WebGLUniformLocation?, v: Array) + fun uniform4fv(location: WebGLUniformLocation?, v: Float32Array) + fun uniform4fv(location: WebGLUniformLocation?, v: Array) + fun uniform4iv(location: WebGLUniformLocation?, v: Int32Array) + fun uniform4iv(location: WebGLUniformLocation?, v: Array) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32Array) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Array) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32Array) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Array) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32Array) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Array) +} + +external interface WebGLSampler : WebGLObject + +external interface WebGLSync : WebGLObject + +external interface WebGLTransformFeedback : WebGLObject + +external interface WebGLVertexArrayObject : WebGLObject + +external interface WebGLVertexArrayObjectOES : WebGLObject + +external interface WebKitPoint { + var x: Number + var y: Number +} + +external interface WindowEventMap : GlobalEventHandlersEventMap, WindowEventHandlersEventMap { + override var abort: UIEvent + override var afterprint: Event + override var beforeprint: Event + override var beforeunload: BeforeUnloadEvent + override var blur: FocusEvent + override var canplay: Event + override var canplaythrough: Event + override var change: Event + override var click: MouseEvent + var compassneedscalibration: Event + override var contextmenu: MouseEvent + override var dblclick: MouseEvent + var devicelight: DeviceLightEvent + var devicemotion: DeviceMotionEvent + var deviceorientation: DeviceOrientationEvent + var deviceorientationabsolute: DeviceOrientationEvent + override var drag: DragEvent + override var dragend: DragEvent + override var dragenter: DragEvent + override var dragleave: DragEvent + override var dragover: DragEvent + override var dragstart: DragEvent + override var drop: DragEvent + override var durationchange: Event + override var emptied: Event + override var ended: Event + override var error: ErrorEvent + override var focus: FocusEvent + override var hashchange: HashChangeEvent + override var input: Event + override var invalid: Event + override var keydown: KeyboardEvent + override var keypress: KeyboardEvent + override var keyup: KeyboardEvent + override var load: Event + override var loadeddata: Event + override var loadedmetadata: Event + override var loadstart: Event + override var message: MessageEvent + override var mousedown: MouseEvent + override var mouseenter: MouseEvent + override var mouseleave: MouseEvent + override var mousemove: MouseEvent + override var mouseout: MouseEvent + override var mouseover: MouseEvent + override var mouseup: MouseEvent + var mousewheel: Event + var MSGestureChange: Event + var MSGestureDoubleTap: Event + var MSGestureEnd: Event + var MSGestureHold: Event + var MSGestureStart: Event + var MSGestureTap: Event + var MSInertiaStart: Event + var MSPointerCancel: Event + var MSPointerDown: Event + var MSPointerEnter: Event + var MSPointerLeave: Event + var MSPointerMove: Event + var MSPointerOut: Event + var MSPointerOver: Event + var MSPointerUp: Event + override var offline: Event + override var online: Event + var orientationchange: Event + override var pagehide: PageTransitionEvent + override var pageshow: PageTransitionEvent + override var pause: Event + override var play: Event + override var playing: Event + override var popstate: PopStateEvent + override var ratechange: Event + var readystatechange: ProgressEvent + override var reset: Event + override var resize: UIEvent + override var scroll: Event + override var seeked: Event + override var seeking: Event + override var select: Event + override var stalled: Event + override var storage: StorageEvent + override var submit: Event + override var suspend: Event + override var timeupdate: Event + override var unload: Event + override var volumechange: Event + var vrdisplayactivate: Event + var vrdisplayblur: Event + var vrdisplayconnect: Event + var vrdisplaydeactivate: Event + var vrdisplaydisconnect: Event + var vrdisplayfocus: Event + var vrdisplaypointerrestricted: Event + var vrdisplaypointerunrestricted: Event + var vrdisplaypresentchange: Event + override var waiting: Event +} + +external interface WindowEventHandlersEventMap { + var afterprint: Event + var beforeprint: Event + var beforeunload: BeforeUnloadEvent + var hashchange: HashChangeEvent + var languagechange: Event + var message: MessageEvent + var messageerror: MessageEvent + var offline: Event + var online: Event + var pagehide: PageTransitionEvent + var pageshow: PageTransitionEvent + var popstate: PopStateEvent + var rejectionhandled: PromiseRejectionEvent + var storage: StorageEvent + var unhandledrejection: PromiseRejectionEvent + var unload: Event +} + +external interface WritableStream { + var locked: Boolean + fun abort(reason: Any = definedExternally): Promise + fun getWriter(): WritableStreamDefaultWriter +} + +external interface WritableStreamDefaultController { + fun error(error: Any = definedExternally) +} + +external interface WritableStreamDefaultWriter { + var closed: Promise + var desiredSize: Number? + var ready: Promise + fun abort(reason: Any = definedExternally): Promise + fun close(): Promise + fun releaseLock() + fun write(chunk: W): Promise +} + +external interface XPathEvaluatorBase { + fun createExpression(expression: String, resolver: ((prefix: String?) -> String?)? = definedExternally): XPathExpression + fun createExpression(expression: String): XPathExpression + fun createExpression(expression: String, resolver: `T$2`? = definedExternally): XPathExpression + fun createNSResolver(nodeResolver: Node): dynamic /* (prefix: String?) -> String? | `T$2` */ + fun evaluate(expression: String, contextNode: Node, resolver: ((prefix: String?) -> String?)? = definedExternally, type: Number = definedExternally, result: XPathResult? = definedExternally): XPathResult + fun evaluate(expression: String, contextNode: Node): XPathResult + fun evaluate(expression: String, contextNode: Node, resolver: ((prefix: String?) -> String?)? = definedExternally): XPathResult + fun evaluate(expression: String, contextNode: Node, resolver: ((prefix: String?) -> String?)? = definedExternally, type: Number = definedExternally): XPathResult + fun evaluate(expression: String, contextNode: Node, resolver: `T$2`? = definedExternally, type: Number = definedExternally, result: XPathResult? = definedExternally): XPathResult + fun evaluate(expression: String, contextNode: Node, resolver: `T$2`? = definedExternally): XPathResult + fun evaluate(expression: String, contextNode: Node, resolver: `T$2`? = definedExternally, type: Number = definedExternally): XPathResult +} + +external interface XPathExpression { + fun evaluate(contextNode: Node, type: Number = definedExternally, result: XPathResult? = definedExternally): XPathResult +} + +external interface XPathResult { + var booleanValue: Boolean + var invalidIteratorState: Boolean + var numberValue: Number + var resultType: Number + var singleNodeValue: Node? + var snapshotLength: Number + var stringValue: String + fun iterateNext(): Node? + fun snapshotItem(index: Number): Node? + var ANY_TYPE: Number + var ANY_UNORDERED_NODE_TYPE: Number + var BOOLEAN_TYPE: Number + var FIRST_ORDERED_NODE_TYPE: Number + var NUMBER_TYPE: Number + var ORDERED_NODE_ITERATOR_TYPE: Number + var ORDERED_NODE_SNAPSHOT_TYPE: Number + var STRING_TYPE: Number + var UNORDERED_NODE_ITERATOR_TYPE: Number + var UNORDERED_NODE_SNAPSHOT_TYPE: Number +} + +external interface BlobCallback { + @nativeInvoke + operator fun invoke(blob: Blob?) +} + +external interface CustomElementConstructor + +external interface FrameRequestCallback { + @nativeInvoke + operator fun invoke(time: Number) +} + +external interface FunctionStringCallback { + @nativeInvoke + operator fun invoke(data: String) +} + +external interface MSLaunchUriCallback { + @nativeInvoke + operator fun invoke() +} + +external interface NavigatorUserMediaErrorCallback { + @nativeInvoke + operator fun invoke(error: MediaStreamError) +} + +external interface NavigatorUserMediaSuccessCallback { + @nativeInvoke + operator fun invoke(stream: MediaStream) +} + +external interface NotificationPermissionCallback { + @nativeInvoke + operator fun invoke(permission: String /* "default" | "denied" | "granted" */) +} + +external interface OnErrorEventHandlerNonNull { + @nativeInvoke + operator fun invoke(event: Event, source: String = definedExternally, lineno: Number = definedExternally, colno: Number = definedExternally, error: Error = definedExternally): Any + @nativeInvoke + operator fun invoke(event: Event): Any + @nativeInvoke + operator fun invoke(event: Event, source: String = definedExternally): Any + @nativeInvoke + operator fun invoke(event: Event, source: String = definedExternally, lineno: Number = definedExternally): Any + @nativeInvoke + operator fun invoke(event: Event, source: String = definedExternally, lineno: Number = definedExternally, colno: Number = definedExternally): Any + @nativeInvoke + operator fun invoke(event: String, source: String = definedExternally, lineno: Number = definedExternally, colno: Number = definedExternally, error: Error = definedExternally): Any + @nativeInvoke + operator fun invoke(event: String): Any + @nativeInvoke + operator fun invoke(event: String, source: String = definedExternally): Any + @nativeInvoke + operator fun invoke(event: String, source: String = definedExternally, lineno: Number = definedExternally): Any + @nativeInvoke + operator fun invoke(event: String, source: String = definedExternally, lineno: Number = definedExternally, colno: Number = definedExternally): Any +} + +external interface PositionCallback { + @nativeInvoke + operator fun invoke(position: Position) +} + +external interface PositionErrorCallback { + @nativeInvoke + operator fun invoke(positionError: PositionError) +} + +external interface QueuingStrategySizeCallback { + @nativeInvoke + operator fun invoke(chunk: T): Number +} + +external interface ReadableByteStreamControllerCallback { + @nativeInvoke + operator fun invoke(controller: ReadableByteStreamController): dynamic /* Unit | PromiseLike */ +} + +external interface ReadableStreamDefaultControllerCallback { + @nativeInvoke + operator fun invoke(controller: ReadableStreamDefaultController): dynamic /* Unit | PromiseLike */ +} + +external interface ReadableStreamErrorCallback { + @nativeInvoke + operator fun invoke(reason: Any): dynamic /* Unit | PromiseLike */ +} + +external interface VoidFunction { + @nativeInvoke + operator fun invoke() +} + +external interface WritableStreamDefaultControllerCloseCallback { + @nativeInvoke + operator fun invoke(): dynamic /* Unit | PromiseLike */ +} + +external interface WritableStreamDefaultControllerStartCallback { + @nativeInvoke + operator fun invoke(controller: WritableStreamDefaultController): dynamic /* Unit | PromiseLike */ +} + +external interface WritableStreamDefaultControllerWriteCallback { + @nativeInvoke + operator fun invoke(chunk: W, controller: WritableStreamDefaultController): dynamic /* Unit | PromiseLike */ +} + +external interface WritableStreamErrorCallback { + @nativeInvoke + operator fun invoke(reason: Any): dynamic /* Unit | PromiseLike */ +} + +external interface HTMLElementTagNameMap { + var a: HTMLAnchorElement + var abbr: HTMLElement + var address: HTMLElement + var applet: HTMLAppletElement + var area: HTMLAreaElement + var article: HTMLElement + var aside: HTMLElement + var audio: HTMLAudioElement + var b: HTMLElement + var base: HTMLBaseElement + var basefont: HTMLBaseFontElement + var bdi: HTMLElement + var bdo: HTMLElement + var blockquote: HTMLQuoteElement + var body: HTMLBodyElement + var br: HTMLBRElement + var button: HTMLButtonElement + var canvas: HTMLCanvasElement + var caption: HTMLTableCaptionElement + var cite: HTMLElement + var code: HTMLElement + var col: HTMLTableColElement + var colgroup: HTMLTableColElement + var data: HTMLDataElement + var datalist: HTMLDataListElement + var dd: HTMLElement + var del: HTMLModElement + var details: HTMLDetailsElement + var dfn: HTMLElement + var dialog: HTMLDialogElement + var dir: HTMLDirectoryElement + var div: HTMLDivElement + var dl: HTMLDListElement + var dt: HTMLElement + var em: HTMLElement + var embed: HTMLEmbedElement + var fieldset: HTMLFieldSetElement + var figcaption: HTMLElement + var figure: HTMLElement + var font: HTMLFontElement + var footer: HTMLElement + var form: HTMLFormElement + var frame: HTMLFrameElement + var frameset: HTMLFrameSetElement + var h1: HTMLHeadingElement + var h2: HTMLHeadingElement + var h3: HTMLHeadingElement + var h4: HTMLHeadingElement + var h5: HTMLHeadingElement + var h6: HTMLHeadingElement + var head: HTMLHeadElement + var header: HTMLElement + var hgroup: HTMLElement + var hr: HTMLHRElement + var html: HTMLHtmlElement + var i: HTMLElement + var iframe: HTMLIFrameElement + var img: HTMLImageElement + var input: HTMLInputElement + var ins: HTMLModElement + var kbd: HTMLElement + var label: HTMLLabelElement + var legend: HTMLLegendElement + var li: HTMLLIElement + var link: HTMLLinkElement + var main: HTMLElement + var map: HTMLMapElement + var mark: HTMLElement + var marquee: HTMLMarqueeElement + var menu: HTMLMenuElement + var meta: HTMLMetaElement + var meter: HTMLMeterElement + var nav: HTMLElement + var noscript: HTMLElement + var `object`: HTMLObjectElement + var ol: HTMLOListElement + var optgroup: HTMLOptGroupElement + var option: HTMLOptionElement + var output: HTMLOutputElement + var p: HTMLParagraphElement + var param: HTMLParamElement + var picture: HTMLPictureElement + var pre: HTMLPreElement + var progress: HTMLProgressElement + var q: HTMLQuoteElement + var rp: HTMLElement + var rt: HTMLElement + var ruby: HTMLElement + var s: HTMLElement + var samp: HTMLElement + var script: HTMLScriptElement + var section: HTMLElement + var select: HTMLSelectElement + var slot: HTMLSlotElement + var small: HTMLElement + var source: HTMLSourceElement + var span: HTMLSpanElement + var strong: HTMLElement + var style: HTMLStyleElement + var sub: HTMLElement + var summary: HTMLElement + var sup: HTMLElement + var table: HTMLTableElement + var tbody: HTMLTableSectionElement + var td: HTMLTableDataCellElement + var template: HTMLTemplateElement + var textarea: HTMLTextAreaElement + var tfoot: HTMLTableSectionElement + var th: HTMLTableHeaderCellElement + var thead: HTMLTableSectionElement + var time: HTMLTimeElement + var title: HTMLTitleElement + var tr: HTMLTableRowElement + var track: HTMLTrackElement + var u: HTMLElement + var ul: HTMLUListElement + var `var`: HTMLElement + var video: HTMLVideoElement + var wbr: HTMLElement +} + +external interface HTMLElementDeprecatedTagNameMap { + var listing: HTMLPreElement + var xmp: HTMLPreElement +} + +external interface SVGElementTagNameMap { + var a: SVGAElement + var circle: SVGCircleElement + var clipPath: SVGClipPathElement + var defs: SVGDefsElement + var desc: SVGDescElement + var ellipse: SVGEllipseElement + var feBlend: SVGFEBlendElement + var feColorMatrix: SVGFEColorMatrixElement + var feComponentTransfer: SVGFEComponentTransferElement + var feComposite: SVGFECompositeElement + var feConvolveMatrix: SVGFEConvolveMatrixElement + var feDiffuseLighting: SVGFEDiffuseLightingElement + var feDisplacementMap: SVGFEDisplacementMapElement + var feDistantLight: SVGFEDistantLightElement + var feFlood: SVGFEFloodElement + var feFuncA: SVGFEFuncAElement + var feFuncB: SVGFEFuncBElement + var feFuncG: SVGFEFuncGElement + var feFuncR: SVGFEFuncRElement + var feGaussianBlur: SVGFEGaussianBlurElement + var feImage: SVGFEImageElement + var feMerge: SVGFEMergeElement + var feMergeNode: SVGFEMergeNodeElement + var feMorphology: SVGFEMorphologyElement + var feOffset: SVGFEOffsetElement + var fePointLight: SVGFEPointLightElement + var feSpecularLighting: SVGFESpecularLightingElement + var feSpotLight: SVGFESpotLightElement + var feTile: SVGFETileElement + var feTurbulence: SVGFETurbulenceElement + var filter: SVGFilterElement + var foreignObject: SVGForeignObjectElement + var g: SVGGElement + var image: SVGImageElement + var line: SVGLineElement + var linearGradient: SVGLinearGradientElement + var marker: SVGMarkerElement + var mask: SVGMaskElement + var metadata: SVGMetadataElement + var path: SVGPathElement + var pattern: SVGPatternElement + var polygon: SVGPolygonElement + var polyline: SVGPolylineElement + var radialGradient: SVGRadialGradientElement + var rect: SVGRectElement + var script: SVGScriptElement + var stop: SVGStopElement + var style: SVGStyleElement + var svg: SVGSVGElement + var switch: SVGSwitchElement + var symbol: SVGSymbolElement + var text: SVGTextElement + var textPath: SVGTextPathElement + var title: SVGTitleElement + var tspan: SVGTSpanElement + var use: SVGUseElement + var view: SVGViewElement +} + +typealias PerformanceEntryList = Array + +typealias COSEAlgorithmIdentifier = Number + +typealias AuthenticatorSelectionList = Array + +typealias BigInteger = Uint8Array + +typealias NamedCurve = String + +typealias GLenum = Number + +typealias GLboolean = Boolean + +typealias GLbitfield = Number + +typealias GLint = Number + +typealias GLsizei = Number + +typealias GLintptr = Number + +typealias GLsizeiptr = Number + +typealias GLuint = Number + +typealias GLfloat = Number + +typealias GLclampf = Number + +typealias GLint64 = Number + +typealias GLuint64 = Number + +typealias WindowProxy = Window \ No newline at end of file diff --git a/bindings/wgpu/webgpu-ts/src/lib.es2015.collection.kt b/bindings/wgpu/webgpu-ts/src/lib.es2015.collection.kt new file mode 100644 index 00000000..e0682798 --- /dev/null +++ b/bindings/wgpu/webgpu-ts/src/lib.es2015.collection.kt @@ -0,0 +1,35 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package tsstdlib + +import kotlin.js.* +import org.khronos.webgl.* +import org.w3c.dom.* +import org.w3c.dom.events.* +import org.w3c.dom.parsing.* +import org.w3c.dom.svg.* +import org.w3c.dom.url.* +import org.w3c.fetch.* +import org.w3c.files.* +import org.w3c.notifications.* +import org.w3c.performance.* +import org.w3c.workers.* +import org.w3c.xhr.* + +external interface ReadonlyMap { + fun entries(): IterableIterator */> + fun keys(): IterableIterator + fun values(): IterableIterator + fun forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) -> Unit, thisArg: Any = definedExternally) + fun get(key: K): V? + fun has(key: K): Boolean + var size: Number +} + +external interface ReadonlySet { + fun entries(): IterableIterator */> + fun keys(): IterableIterator + fun values(): IterableIterator + fun forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) -> Unit, thisArg: Any = definedExternally) + fun has(value: T): Boolean + var size: Number +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-ts/src/lib.es2015.iterable.kt b/bindings/wgpu/webgpu-ts/src/lib.es2015.iterable.kt new file mode 100644 index 00000000..57fb640d --- /dev/null +++ b/bindings/wgpu/webgpu-ts/src/lib.es2015.iterable.kt @@ -0,0 +1,54 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package tsstdlib + +import kotlin.js.* +import org.khronos.webgl.* +import org.w3c.dom.* +import org.w3c.dom.events.* +import org.w3c.dom.parsing.* +import org.w3c.dom.svg.* +import org.w3c.dom.url.* +import org.w3c.fetch.* +import org.w3c.files.* +import org.w3c.notifications.* +import org.w3c.performance.* +import org.w3c.workers.* +import org.w3c.xhr.* + +external interface IteratorYieldResult { + var done: Boolean? + get() = definedExternally + set(value) = definedExternally + var value: TYield +} + +external interface IteratorReturnResult { + var done: Boolean + var value: TReturn +} + +external interface Iterator { + fun next(vararg args: Any /* JsTuple<> | JsTuple */): dynamic /* IteratorYieldResult | IteratorReturnResult */ + val `return`: ((value: TReturn) -> dynamic)? + val `throw`: ((e: Any) -> dynamic)? +} + +typealias Iterator__1 = Iterator + +external interface Iterable + +external interface IterableIterator : Iterator__1 + +external interface PromiseConstructor { + var prototype: Promise + fun all(values: Any /* JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple */): Promise | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple | JsTuple */> + fun all(values: Array */>): Promise> + fun race(values: Array): Promise + fun reject(reason: Any = definedExternally): Promise + fun resolve(value: T): Promise + fun resolve(value: PromiseLike): Promise + fun resolve(): Promise + fun all(values: Iterable */>): Promise> + fun race(values: Iterable): Promise + fun race(values: Iterable */>): Promise +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-ts/src/lib.es5.Intl.module_dukat.kt b/bindings/wgpu/webgpu-ts/src/lib.es5.Intl.module_dukat.kt new file mode 100644 index 00000000..62cbcc75 --- /dev/null +++ b/bindings/wgpu/webgpu-ts/src/lib.es5.Intl.module_dukat.kt @@ -0,0 +1,220 @@ +@file:JsQualifier("tsstdlib.Intl") +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package tsstdlib.Intl + +import kotlin.js.* +import org.khronos.webgl.* +import org.w3c.dom.* +import org.w3c.dom.events.* +import org.w3c.dom.parsing.* +import org.w3c.dom.svg.* +import org.w3c.dom.url.* +import org.w3c.fetch.* +import org.w3c.files.* +import org.w3c.notifications.* +import org.w3c.performance.* +import org.w3c.workers.* +import org.w3c.xhr.* + +external interface CollatorOptions { + var usage: String? + get() = definedExternally + set(value) = definedExternally + var localeMatcher: String? + get() = definedExternally + set(value) = definedExternally + var numeric: Boolean? + get() = definedExternally + set(value) = definedExternally + var caseFirst: String? + get() = definedExternally + set(value) = definedExternally + var sensitivity: String? + get() = definedExternally + set(value) = definedExternally + var ignorePunctuation: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface ResolvedCollatorOptions { + var locale: String + var usage: String + var sensitivity: String + var ignorePunctuation: Boolean + var collation: String + var caseFirst: String + var numeric: Boolean +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface Collator { + fun compare(x: String, y: String): Number + fun resolvedOptions(): ResolvedCollatorOptions + + companion object { + @nativeInvoke + operator fun invoke(locales: Any /* String | Array */ = definedExternally, options: CollatorOptions = definedExternally): Collator + fun supportedLocalesOf(locales: Any /* String | Array */, options: CollatorOptions = definedExternally): Array + } +} + +external interface NumberFormatOptions { + var localeMatcher: String? + get() = definedExternally + set(value) = definedExternally + var style: String? + get() = definedExternally + set(value) = definedExternally + var currency: String? + get() = definedExternally + set(value) = definedExternally + var currencyDisplay: String? + get() = definedExternally + set(value) = definedExternally + var useGrouping: Boolean? + get() = definedExternally + set(value) = definedExternally + var minimumIntegerDigits: Number? + get() = definedExternally + set(value) = definedExternally + var minimumFractionDigits: Number? + get() = definedExternally + set(value) = definedExternally + var maximumFractionDigits: Number? + get() = definedExternally + set(value) = definedExternally + var minimumSignificantDigits: Number? + get() = definedExternally + set(value) = definedExternally + var maximumSignificantDigits: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface ResolvedNumberFormatOptions { + var locale: String + var numberingSystem: String + var style: String + var currency: String? + get() = definedExternally + set(value) = definedExternally + var currencyDisplay: String? + get() = definedExternally + set(value) = definedExternally + var minimumIntegerDigits: Number + var minimumFractionDigits: Number + var maximumFractionDigits: Number + var minimumSignificantDigits: Number? + get() = definedExternally + set(value) = definedExternally + var maximumSignificantDigits: Number? + get() = definedExternally + set(value) = definedExternally + var useGrouping: Boolean +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface NumberFormat { + fun format(value: Number): String + fun resolvedOptions(): ResolvedNumberFormatOptions + + companion object { + @nativeInvoke + operator fun invoke(locales: Any /* String | Array */ = definedExternally, options: NumberFormatOptions = definedExternally): NumberFormat + fun supportedLocalesOf(locales: Any /* String | Array */, options: NumberFormatOptions = definedExternally): Array + } +} + +external interface DateTimeFormatOptions { + var localeMatcher: String? + get() = definedExternally + set(value) = definedExternally + var weekday: String? + get() = definedExternally + set(value) = definedExternally + var era: String? + get() = definedExternally + set(value) = definedExternally + var year: String? + get() = definedExternally + set(value) = definedExternally + var month: String? + get() = definedExternally + set(value) = definedExternally + var day: String? + get() = definedExternally + set(value) = definedExternally + var hour: String? + get() = definedExternally + set(value) = definedExternally + var minute: String? + get() = definedExternally + set(value) = definedExternally + var second: String? + get() = definedExternally + set(value) = definedExternally + var timeZoneName: String? + get() = definedExternally + set(value) = definedExternally + var formatMatcher: String? + get() = definedExternally + set(value) = definedExternally + var hour12: Boolean? + get() = definedExternally + set(value) = definedExternally + var timeZone: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface ResolvedDateTimeFormatOptions { + var locale: String + var calendar: String + var numberingSystem: String + var timeZone: String + var hour12: Boolean? + get() = definedExternally + set(value) = definedExternally + var weekday: String? + get() = definedExternally + set(value) = definedExternally + var era: String? + get() = definedExternally + set(value) = definedExternally + var year: String? + get() = definedExternally + set(value) = definedExternally + var month: String? + get() = definedExternally + set(value) = definedExternally + var day: String? + get() = definedExternally + set(value) = definedExternally + var hour: String? + get() = definedExternally + set(value) = definedExternally + var minute: String? + get() = definedExternally + set(value) = definedExternally + var second: String? + get() = definedExternally + set(value) = definedExternally + var timeZoneName: String? + get() = definedExternally + set(value) = definedExternally +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface DateTimeFormat { + fun format(date: Date = definedExternally): String + fun format(): String + fun format(date: Number = definedExternally): String + fun resolvedOptions(): ResolvedDateTimeFormatOptions + + companion object { + @nativeInvoke + operator fun invoke(locales: Any /* String | Array */ = definedExternally, options: DateTimeFormatOptions = definedExternally): DateTimeFormat + fun supportedLocalesOf(locales: Any /* String | Array */, options: DateTimeFormatOptions = definedExternally): Array + } +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-ts/src/lib.es5.kt b/bindings/wgpu/webgpu-ts/src/lib.es5.kt new file mode 100644 index 00000000..43c630be --- /dev/null +++ b/bindings/wgpu/webgpu-ts/src/lib.es5.kt @@ -0,0 +1,200 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package tsstdlib + +import kotlin.js.* +import org.khronos.webgl.* +import org.w3c.dom.* +import org.w3c.dom.events.* +import org.w3c.dom.parsing.* +import org.w3c.dom.svg.* +import org.w3c.dom.url.* +import org.w3c.fetch.* +import org.w3c.files.* +import org.w3c.notifications.* +import org.w3c.performance.* +import org.w3c.workers.* +import org.w3c.xhr.* + +external interface FunctionConstructor { + @nativeInvoke + operator fun invoke(vararg args: String): Function<*> + var prototype: Function<*> +} + +external interface DateConstructor { + @nativeInvoke + operator fun invoke(): String + var prototype: Date + fun parse(s: String): Number + fun UTC(year: Number, month: Number, date: Number = definedExternally, hours: Number = definedExternally, minutes: Number = definedExternally, seconds: Number = definedExternally, ms: Number = definedExternally): Number + fun now(): Number +} + +external interface ErrorConstructor { + @nativeInvoke + operator fun invoke(message: String = definedExternally): Error + var prototype: Error +} + +external interface ConcatArray { + var length: Number + @nativeGetter + operator fun get(n: Number): T? + @nativeSetter + operator fun set(n: Number, value: T) + fun join(separator: String = definedExternally): String + fun slice(start: Number = definedExternally, end: Number = definedExternally): Array +} + +external interface ArrayConstructor { + fun from(iterable: Iterable): Array + fun from(iterable: ArrayLike): Array + fun from(iterable: Iterable, mapfn: (v: T, k: Number) -> U, thisArg: Any = definedExternally): Array + fun from(iterable: Iterable, mapfn: (v: T, k: Number) -> U): Array + fun from(iterable: ArrayLike, mapfn: (v: T, k: Number) -> U, thisArg: Any = definedExternally): Array + fun from(iterable: ArrayLike, mapfn: (v: T, k: Number) -> U): Array + fun of(vararg items: T): Array + @nativeInvoke + operator fun invoke(arrayLength: Number = definedExternally): Array + @nativeInvoke + operator fun invoke(): Array + @nativeInvoke + operator fun invoke(arrayLength: Number): Array + @nativeInvoke + operator fun invoke(vararg items: T): Array + fun isArray(arg: Any): Boolean + var prototype: Array +} + +external interface PromiseLike { + fun then(onfulfilled: ((value: T) -> Any?)? = definedExternally, onrejected: ((reason: Any) -> Any?)? = definedExternally): PromiseLike +} + +external interface ArrayLike { + var length: Number + @nativeGetter + operator fun get(n: Number): T? + @nativeSetter + operator fun set(n: Number, value: T) +} + +typealias Record = Any + +external interface ArrayBufferTypes { + var ArrayBuffer: ArrayBuffer +} + +external interface ArrayBufferConstructor { + var prototype: ArrayBuffer + fun isView(arg: Any): Boolean +} + +external interface DataViewConstructor + +external interface Int8ArrayConstructor { + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Int8Array + fun from(arrayLike: Iterable): Int8Array + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Int8Array + var prototype: Int8Array + var BYTES_PER_ELEMENT: Number + fun of(vararg items: Number): Int8Array + fun from(arrayLike: ArrayLike): Int8Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Int8Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Int8Array +} + +external interface Uint8ArrayConstructor { + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Uint8Array + fun from(arrayLike: Iterable): Uint8Array + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Uint8Array + var prototype: Uint8Array + var BYTES_PER_ELEMENT: Number + fun of(vararg items: Number): Uint8Array + fun from(arrayLike: ArrayLike): Uint8Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Uint8Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Uint8Array +} + +external interface Uint8ClampedArrayConstructor { + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Uint8ClampedArray + fun from(arrayLike: Iterable): Uint8ClampedArray + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Uint8ClampedArray + var prototype: Uint8ClampedArray + var BYTES_PER_ELEMENT: Number + fun of(vararg items: Number): Uint8ClampedArray + fun from(arrayLike: ArrayLike): Uint8ClampedArray + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Uint8ClampedArray + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Uint8ClampedArray +} + +external interface Int16ArrayConstructor { + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Int16Array + fun from(arrayLike: Iterable): Int16Array + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Int16Array + var prototype: Int16Array + var BYTES_PER_ELEMENT: Number + fun of(vararg items: Number): Int16Array + fun from(arrayLike: ArrayLike): Int16Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Int16Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Int16Array +} + +external interface Uint16ArrayConstructor { + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Uint16Array + fun from(arrayLike: Iterable): Uint16Array + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Uint16Array + var prototype: Uint16Array + var BYTES_PER_ELEMENT: Number + fun of(vararg items: Number): Uint16Array + fun from(arrayLike: ArrayLike): Uint16Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Uint16Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Uint16Array +} + +external interface Int32ArrayConstructor { + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Int32Array + fun from(arrayLike: Iterable): Int32Array + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Int32Array + var prototype: Int32Array + var BYTES_PER_ELEMENT: Number + fun of(vararg items: Number): Int32Array + fun from(arrayLike: ArrayLike): Int32Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Int32Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Int32Array +} + +external interface Uint32ArrayConstructor { + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Uint32Array + fun from(arrayLike: Iterable): Uint32Array + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Uint32Array + var prototype: Uint32Array + var BYTES_PER_ELEMENT: Number + fun of(vararg items: Number): Uint32Array + fun from(arrayLike: ArrayLike): Uint32Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Uint32Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Uint32Array +} + +external interface Float32ArrayConstructor { + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Float32Array + fun from(arrayLike: Iterable): Float32Array + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Float32Array + var prototype: Float32Array + var BYTES_PER_ELEMENT: Number + fun of(vararg items: Number): Float32Array + fun from(arrayLike: ArrayLike): Float32Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Float32Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Float32Array +} + +external interface Float64ArrayConstructor { + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally, thisArg: Any = definedExternally): Float64Array + fun from(arrayLike: Iterable): Float64Array + fun from(arrayLike: Iterable, mapfn: (v: Number, k: Number) -> Number = definedExternally): Float64Array + var prototype: Float64Array + var BYTES_PER_ELEMENT: Number + fun of(vararg items: Number): Float64Array + fun from(arrayLike: ArrayLike): Float64Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number, thisArg: Any = definedExternally): Float64Array + fun from(arrayLike: ArrayLike, mapfn: (v: T, k: Number) -> Number): Float64Array +} \ No newline at end of file diff --git a/bindings/wgpu/webgpu-ts/src/lib.scripthost.kt b/bindings/wgpu/webgpu-ts/src/lib.scripthost.kt new file mode 100644 index 00000000..809347e7 --- /dev/null +++ b/bindings/wgpu/webgpu-ts/src/lib.scripthost.kt @@ -0,0 +1,20 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package tsstdlib + +import kotlin.js.* +import org.khronos.webgl.* +import org.w3c.dom.* +import org.w3c.dom.events.* +import org.w3c.dom.parsing.* +import org.w3c.dom.svg.* +import org.w3c.dom.url.* +import org.w3c.fetch.* +import org.w3c.files.* +import org.w3c.notifications.* +import org.w3c.performance.* +import org.w3c.workers.* +import org.w3c.xhr.* + +external open class VarDate { + open var VarDate_typekey: VarDate +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/build.gradle.kts b/bindings/wgpu/wgpu4k/build.gradle.kts new file mode 100644 index 00000000..37efc31d --- /dev/null +++ b/bindings/wgpu/wgpu4k/build.gradle.kts @@ -0,0 +1,192 @@ +import io.ygdrasil.ParsingMethod +import klang.domain.* +import org.jetbrains.kotlin.de.undercouch.gradle.tasks.download.Download +import org.jetbrains.kotlin.util.capitalizeDecapitalize.toLowerCaseAsciiOnly +import java.net.URL + +buildscript { + dependencies { + classpath("io.ygdrasil:klang:0.0.0") { + isChanging = true + } + classpath("io.ygdrasil:klang-gradle-plugin:0.0.0") { + isChanging = true + } + } +} + +plugins { + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.kotest) + alias(libs.plugins.klang) +} + +kotlin { + js { + binaries.executable() + browser() + nodejs() + //generateTypeScriptDefinitions() + } + jvm() + + /*androidTarget { + publishLibraryVariants("release") + compilations.all { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + iosX64() + iosArm64() + iosSimulatorArm64() + linuxX64()*/ + + sourceSets { + val jvmMain by getting { + dependencies { + implementation(kotlin("stdlib-common")) + api(libs.jna) + api("$group:sdl2-4k:$version") + api("$group:sdl2-binaries:$version") + implementation("dev.krud:shapeshift:0.8.0") + } + } + + val commonMain by getting { + dependencies { + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0") + implementation(kotlin("reflect")) + } + } + val commonTest by getting { + dependencies { + implementation(libs.bundles.kotest) + } + } + + val jvmTest by getting { + dependencies { + implementation("org.opentest4j:opentest4j:1.3.0") + } + + } + } +} + +/*android { + namespace = "org.jetbrains.kotlinx.multiplatform.library.template" + compileSdk = libs.versions.android.compileSdk.get().toInt() + defaultConfig { + minSdk = libs.versions.android.minSdk.get().toInt() + } +}*/ + + +val headerUrl = + URL("https://github.com/gfx-rs/wgpu-native/releases/download/${libs.versions.wgpu.get()}/wgpu-macos-x86_64-release.zip") + +klang { + + parsingMethod = ParsingMethod.Libclang + + download(headerUrl) + .let(::unpack) + .let { + parse(fileToParse = "wgpu.h", at = it) { + // Hardfixes until Callback are fixed + (findTypeAliasByName("WGPURequestDeviceCallback") ?: error("WGPURequestAdapterCallback should exist")) + .let { callback -> + (((callback.typeRef as? ResolvedTypeRef)?.type as? FunctionPointerType) + ?: error("should be resolved")) + .let { function -> + val arguments = function.arguments.toMutableList() + arguments[0] = typeOf("int").unchecked() + arguments[2] = typeOf("char *").unchecked() + arguments[3] = typeOf("void *").unchecked() + function.arguments = arguments.toList() + } + } + (findTypeAliasByName("WGPURequestAdapterCallback") ?: error("WGPURequestAdapterCallback should exist")) + .let { callback -> + (((callback.typeRef as? ResolvedTypeRef)?.type as? FunctionPointerType) + ?: error("should be resolved")) + .let { function -> + val arguments = function.arguments.toMutableList() + arguments[0] = typeOf("int").unchecked() + arguments[2] = typeOf("char *").unchecked() + arguments[3] = typeOf("void *").unchecked() + function.arguments = arguments.toList() + } + } + declarations.filterIsInstance() + .forEach { enumeration -> + enumeration.values = enumeration.values.map { (name, value) -> + name.removePrefix("${enumeration.name}_").toLowerCaseAsciiOnly() to value + } + } + } + } + + generateBinding("io.ygdrasil.wgpu.internal.jvm", "WGPU") +} + + +val resourcesDirectory = project.file("src").resolve("jvmMain").resolve("resources") +val zipBuildDirectory = project.file("build").resolve("zip") +val baseUrl = "https://github.com/gfx-rs/wgpu-native/releases/download/${libs.versions.wgpu.get()}/" +val fileToDownload = listOf( + NativeLibrary( + "wgpu-macos-aarch64-release.zip", + resourcesDirectory.resolve("darwin-aarch64").resolve("libWGPU.dylib"), + "libwgpu_native.dylib" + ), + NativeLibrary( + "wgpu-macos-x86_64-release.zip", + resourcesDirectory.resolve("darwin-x86-64").resolve("libWGPU.dylib"), + "libwgpu_native.dylib" + ), + NativeLibrary( + "wgpu-windows-x86_64-release.zip", + resourcesDirectory.resolve("win32").resolve("libWGPU.dll"), + "wgpu_native.dll" + ), +).forEach { (fileName, target, zipFilename) -> + val zipFile = zipBuildDirectory.resolve(fileName) + val downloadTask = downloadInto(fileName, zipFile) + val unzipTask = unzipTask(zipFile, target, zipFilename, downloadTask) + + tasks.withType() { + dependsOn(unzipTask) + } +} + + +fun downloadInto(fileName: String, target: File): Task { + val url = "$baseUrl$fileName" + val taskName = "downloadFile-$fileName" + return tasks.register(taskName) { + onlyIf { !target.exists() } + src(url) + dest(target) + }.get() +} + +fun unzipTask( + zipFile: File, + target: File, + zipFilename: String, + downloadTask: Task +) = tasks.register("unzip-${zipFile.name}") { + onlyIf { !target.exists() } + from(zipTree(zipFile)) + include(zipFilename) + into(target.parent) + rename { fileName -> + fileName.replace(zipFilename, target.name) + } + dependsOn(downloadTask) +}.get() + +data class NativeLibrary(val remoteFile: String, val targetFile: File, val zipFileName: String) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Adapter.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Adapter.kt new file mode 100644 index 00000000..1ce86222 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Adapter.kt @@ -0,0 +1,10 @@ +package io.ygdrasil.wgpu + +/** + * The GPUAdapter interface of the WebGPU API represents a GPU adapter. + * From this you can request a Device, adapter info, features, and limits. + */ +@OptIn(ExperimentalStdlibApi::class) +expect class Adapter: AutoCloseable { + suspend fun requestDevice(): Device? +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/BindGroup.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/BindGroup.kt new file mode 100644 index 00000000..86e9e179 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/BindGroup.kt @@ -0,0 +1,36 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +expect class BindGroup : AutoCloseable { +} + +data class BindGroupDescriptor( + var layout: BindGroupLayout, + var entries: Array, + var label: String? = null +) { + + data class BindGroupEntry( + var binding: GPUIndex32, + //TODO support GPUExternalTexture + var resource: BindGroupResource + ) + + sealed interface BindGroupResource + data class BufferBinding( + var buffer: Buffer, + var offset: GPUSize64? = null, + var size: GPUSize64? = buffer.size + ) : BindGroupResource + + data class SamplerBinding( + var sampler: Sampler + ) : BindGroupResource + + data class TextureViewBinding( + var view: TextureView + ) : BindGroupResource + +} + diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/BindGroupLayout.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/BindGroupLayout.kt new file mode 100644 index 00000000..116f9ca0 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/BindGroupLayout.kt @@ -0,0 +1,3 @@ +package io.ygdrasil.wgpu + +expect class BindGroupLayout \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Buffer.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Buffer.kt new file mode 100644 index 00000000..b450058d --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Buffer.kt @@ -0,0 +1,20 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +expect class Buffer : AutoCloseable { + + val size: GPUSize64 + + fun getMappedRange(offset: GPUSize64? = null, size: GPUSize64? = null): ByteArray + + fun unmap() + + fun map(buffer: FloatArray) +} + +data class BufferDescriptor( + var size: GPUSize64, + var usage: GPUBufferUsageFlags, + var mappedAtCreation: Boolean? = null +) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/CommandBuffer.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/CommandBuffer.kt new file mode 100644 index 00000000..84b3bc44 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/CommandBuffer.kt @@ -0,0 +1,5 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +expect class CommandBuffer : AutoCloseable \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/CommandEncoder.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/CommandEncoder.kt new file mode 100644 index 00000000..55785257 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/CommandEncoder.kt @@ -0,0 +1,23 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +expect class CommandEncoder : AutoCloseable { + + fun beginRenderPass(renderPassDescriptor: RenderPassDescriptor): RenderPassEncoder + + fun finish(): CommandBuffer + + fun copyTextureToTexture( + source: ImageCopyTexture, + destination: ImageCopyTexture, + copySize: GPUIntegerCoordinates + ) +} + +data class ImageCopyTexture( + var texture: Texture, + var mipLevel: GPUIntegerCoordinate? = null, + var origin: GPUIntegerCoordinates? = null, + var aspect: TextureAspect? = null, +) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Device.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Device.kt new file mode 100644 index 00000000..a0d8b055 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Device.kt @@ -0,0 +1,26 @@ +package io.ygdrasil.wgpu + +@OptIn(ExperimentalStdlibApi::class) +expect class Device: AutoCloseable { + + val queue: Queue + + fun createCommandEncoder(descriptor: CommandEncoderDescriptor? = null): CommandEncoder + + fun createShaderModule(descriptor: ShaderModuleDescriptor): ShaderModule + + fun createPipelineLayout(descriptor: PipelineLayoutDescriptor): PipelineLayout + + fun createRenderPipeline(descriptor: RenderPipelineDescriptor): RenderPipeline + + fun createBuffer(descriptor: BufferDescriptor): Buffer + + fun createTexture(descriptor: TextureDescriptor): Texture + + fun createBindGroup(descriptor: BindGroupDescriptor): BindGroup + + fun createSampler(descriptor: SamplerDescriptor = SamplerDescriptor()): Sampler +} + +// TODO +data class CommandEncoderDescriptor(var label: String? = null) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Enumerations.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Enumerations.kt new file mode 100644 index 00000000..08d94f62 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Enumerations.kt @@ -0,0 +1,1386 @@ +package io.ygdrasil.wgpu + +interface EnumerationWithValue { + public val value: Int +} + +public enum class AdapterType( + public val `value`: Int, +) { + discretegpu(0), + integratedgpu(1), + cpu(2), + unknown(3), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: AdapterType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): AdapterType? = entries.find { + it.value == value + } + } +} + +public enum class AddressMode( + public val `value`: Int, +) { + repeat(0), + mirrorrepeat(1), + clamptoedge(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: AddressMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): AddressMode? = entries.find { + it.value == value + } + } +} + +public enum class BackendType( + public val `value`: Int, +) { + undefined(0), + `null`(1), + webgpu(2), + d3d11(3), + d3d12(4), + metal(5), + vulkan(6), + opengl(7), + opengles(8), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: BackendType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): BackendType? = entries.find { + it.value == value + } + } +} + +public enum class BlendFactor( + public val `value`: Int, +) { + zero(0), + one(1), + src(2), + oneminussrc(3), + srcalpha(4), + oneminussrcalpha(5), + dst(6), + oneminusdst(7), + dstalpha(8), + oneminusdstalpha(9), + srcalphasaturated(10), + constant(11), + oneminusconstant(12), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: BlendFactor): Int = value or other.value + + public companion object { + public fun of(`value`: Int): BlendFactor? = entries.find { + it.value == value + } + } +} + +public enum class BlendOperation( + public val `value`: Int, +) { + add(0), + subtract(1), + reversesubtract(2), + min(3), + max(4), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: BlendOperation): Int = value or other.value + + public companion object { + public fun of(`value`: Int): BlendOperation? = entries.find { + it.value == value + } + } +} + +public enum class BufferBindingType( + public val `value`: Int, +) { + undefined(0), + uniform(1), + storage(2), + readonlystorage(3), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: BufferBindingType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): BufferBindingType? = entries.find { + it.value == value + } + } +} + +public enum class BufferMapAsyncStatus( + public val `value`: Int, +) { + success(0), + validationerror(1), + unknown(2), + devicelost(3), + destroyedbeforecallback(4), + unmappedbeforecallback(5), + mappingalreadypending(6), + offsetoutofrange(7), + sizeoutofrange(8), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: BufferMapAsyncStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): BufferMapAsyncStatus? = entries.find { + it.value == value + } + } +} + +public enum class BufferMapState( + public val `value`: Int, +) { + unmapped(0), + pending(1), + mapped(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: BufferMapState): Int = value or other.value + + public companion object { + public fun of(`value`: Int): BufferMapState? = entries.find { + it.value == value + } + } +} + +public enum class CompareFunction( + public val `value`: Int, +) { + undefined(0), + never(1), + less(2), + lessequal(3), + greater(4), + greaterequal(5), + equal(6), + notequal(7), + always(8), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: CompareFunction): Int = value or other.value + + public companion object { + public fun of(`value`: Int): CompareFunction? = entries.find { + it.value == value + } + } +} + +public enum class CompilationInfoRequestStatus( + public val `value`: Int, +) { + success(0), + error(1), + devicelost(2), + unknown(3), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: CompilationInfoRequestStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): CompilationInfoRequestStatus? = entries.find { + it.value == value + } + } +} + +public enum class CompilationMessageType( + public val `value`: Int, +) { + error(0), + warning(1), + info(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: CompilationMessageType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): CompilationMessageType? = entries.find { + it.value == value + } + } +} + +public enum class CompositeAlphaMode( + public val `value`: Int, +) { + auto(0), + opaque(1), + premultiplied(2), + unpremultiplied(3), + inherit(4), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: CompositeAlphaMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): CompositeAlphaMode? = entries.find { + it.value == value + } + } +} + +public enum class CreatePipelineAsyncStatus( + public val `value`: Int, +) { + success(0), + validationerror(1), + internalerror(2), + devicelost(3), + devicedestroyed(4), + unknown(5), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: CreatePipelineAsyncStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): CreatePipelineAsyncStatus? = entries.find { + it.value == value + } + } +} + +public enum class CullMode( + public val `value`: Int, +) { + none(0), + front(1), + back(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: CullMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): CullMode? = entries.find { + it.value == value + } + } +} + +public enum class DeviceLostReason( + public val `value`: Int, +) { + undefined(0), + destroyed(1), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: DeviceLostReason): Int = value or other.value + + public companion object { + public fun of(`value`: Int): DeviceLostReason? = entries.find { + it.value == value + } + } +} + +public enum class ErrorFilter( + public val `value`: Int, +) { + validation(0), + outofmemory(1), + `internal`(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: ErrorFilter): Int = value or other.value + + public companion object { + public fun of(`value`: Int): ErrorFilter? = entries.find { + it.value == value + } + } +} + +public enum class ErrorType( + public val `value`: Int, +) { + noerror(0), + validation(1), + outofmemory(2), + `internal`(3), + unknown(4), + devicelost(5), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: ErrorType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): ErrorType? = entries.find { + it.value == value + } + } +} + +public enum class FeatureName( + public val `value`: Int, +) { + undefined(0), + depthclipcontrol(1), + depth32floatstencil8(2), + timestampquery(3), + texturecompressionbc(4), + texturecompressionetc2(5), + texturecompressionastc(6), + indirectfirstinstance(7), + shaderf16(8), + rg11b10ufloatrenderable(9), + bgra8unormstorage(10), + float32filterable(11), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: FeatureName): Int = value or other.value + + public companion object { + public fun of(`value`: Int): FeatureName? = entries.find { + it.value == value + } + } +} + +public enum class FilterMode( + public val `value`: Int, +) { + nearest(0), + linear(1), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: FilterMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): FilterMode? = entries.find { + it.value == value + } + } +} + +public enum class FrontFace( + public val `value`: Int, +) { + ccw(0), + cw(1), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: FrontFace): Int = value or other.value + + public companion object { + public fun of(`value`: Int): FrontFace? = entries.find { + it.value == value + } + } +} + +public enum class IndexFormat( + public val `value`: Int, +) { + undefined(0), + uint16(1), + uint32(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: IndexFormat): Int = value or other.value + + public companion object { + public fun of(`value`: Int): IndexFormat? = entries.find { + it.value == value + } + } +} + +public enum class LoadOp( + public val `value`: Int, +) { + undefined(0), + clear(1), + load(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: LoadOp): Int = value or other.value + + public companion object { + public fun of(`value`: Int): LoadOp? = entries.find { + it.value == value + } + } +} + +public enum class MipmapFilterMode( + public val `value`: Int, +) { + nearest(0), + linear(1), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: MipmapFilterMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): MipmapFilterMode? = entries.find { + it.value == value + } + } +} + +public enum class PowerPreference( + public val `value`: Int, +) { + undefined(0), + lowpower(1), + highperformance(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: PowerPreference): Int = value or other.value + + public companion object { + public fun of(`value`: Int): PowerPreference? = entries.find { + it.value == value + } + } +} + +public enum class PresentMode( + public val `value`: Int, +) { + fifo(0), + fiforelaxed(1), + immediate(2), + mailbox(3), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: PresentMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): PresentMode? = entries.find { + it.value == value + } + } +} + +public enum class PrimitiveTopology( + public val `value`: Int, + public val stringValue: String, +) { + pointlist(0, "point-list"), + linelist(1, "line-list"), + linestrip(2, "line-strip"), + trianglelist(3, "triangle-list"), + trianglestrip(4, "triangle-strip"), + force32(2_147_483_647, "force32"), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: PrimitiveTopology): Int = value or other.value + + public companion object { + public fun of(`value`: Int): PrimitiveTopology? = entries.find { + it.value == value + } + } +} + +public enum class QueryType( + public val `value`: Int, +) { + occlusion(0), + timestamp(1), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: QueryType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): QueryType? = entries.find { + it.value == value + } + } +} + +public enum class QueueWorkDoneStatus( + public val `value`: Int, +) { + success(0), + error(1), + unknown(2), + devicelost(3), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: QueueWorkDoneStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): QueueWorkDoneStatus? = entries.find { + it.value == value + } + } +} + +public enum class RequestAdapterStatus( + public val `value`: Int, +) { + success(0), + unavailable(1), + error(2), + unknown(3), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: RequestAdapterStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): RequestAdapterStatus? = entries.find { + it.value == value + } + } +} + +public enum class RequestDeviceStatus( + public val `value`: Int, +) { + success(0), + error(1), + unknown(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: RequestDeviceStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): RequestDeviceStatus? = entries.find { + it.value == value + } + } +} + +public enum class SType( + public val `value`: Int, +) { + invalid(0), + surfacedescriptorfrommetallayer(1), + surfacedescriptorfromwindowshwnd(2), + surfacedescriptorfromxlibwindow(3), + surfacedescriptorfromcanvashtmlselector(4), + shadermodulespirvdescriptor(5), + shadermodulewgsldescriptor(6), + primitivedepthclipcontrol(7), + surfacedescriptorfromwaylandsurface(8), + surfacedescriptorfromandroidnativewindow(9), + surfacedescriptorfromxcbwindow(10), + renderpassdescriptormaxdrawcount(15), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: SType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): SType? = entries.find { + it.value == value + } + } +} + +public enum class SamplerBindingType( + public val `value`: Int, +) { + undefined(0), + filtering(1), + nonfiltering(2), + comparison(3), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: SamplerBindingType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): SamplerBindingType? = entries.find { + it.value == value + } + } +} + +public enum class StencilOperation( + public val `value`: Int, +) { + keep(0), + zero(1), + replace(2), + invert(3), + incrementclamp(4), + decrementclamp(5), + incrementwrap(6), + decrementwrap(7), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: StencilOperation): Int = value or other.value + + public companion object { + public fun of(`value`: Int): StencilOperation? = entries.find { + it.value == value + } + } +} + +public enum class StorageTextureAccess( + public val `value`: Int, +) { + undefined(0), + writeonly(1), + readonly(2), + readwrite(3), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: StorageTextureAccess): Int = value or other.value + + public companion object { + public fun of(`value`: Int): StorageTextureAccess? = entries.find { + it.value == value + } + } +} + +public enum class StoreOp( + public val `value`: Int, +) { + undefined(0), + store(1), + discard(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: StoreOp): Int = value or other.value + + public companion object { + public fun of(`value`: Int): StoreOp? = entries.find { + it.value == value + } + } +} + +public enum class SurfaceGetCurrentTextureStatus( + public val `value`: Int, +) { + success(0), + timeout(1), + outdated(2), + lost(3), + outofmemory(4), + devicelost(5), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: SurfaceGetCurrentTextureStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): SurfaceGetCurrentTextureStatus? = entries.find { + it.value == value + } + } +} + +public enum class TextureAspect( + public val `value`: Int, + public val stringValue: String, +) { + all(0, "all"), + stencilonly(1, "stencil-only"), + depthonly(2, "depth-only"), + force32(2_147_483_647, "force32"), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: TextureAspect): Int = value or other.value + + public companion object { + public fun of(`value`: Int): TextureAspect? = entries.find { + it.value == value + } + } +} + +public enum class TextureDimension( + public override val `value`: Int, + public val stringValue: String +) : EnumerationWithValue { + `_1d`(0, "1d"), + `_2d`(1, "2d"), + `_3d`(2, "3d"), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: TextureDimension): Int = value or other.value + + public companion object { + public fun of(`value`: Int): TextureDimension? = entries.find { + it.value == value + } + } +} + +public enum class TextureFormat( + public override val value: Int, +) : EnumerationWithValue { + undefined(0), + r8unorm(1), + r8snorm(2), + r8uint(3), + r8sint(4), + r16uint(5), + r16sint(6), + r16float(7), + rg8unorm(8), + rg8snorm(9), + rg8uint(10), + rg8sint(11), + r32float(12), + r32uint(13), + r32sint(14), + rg16uint(15), + rg16sint(16), + rg16float(17), + rgba8unorm(18), + rgba8unormsrgb(19), + rgba8snorm(20), + rgba8uint(21), + rgba8sint(22), + bgra8unorm(23), + bgra8unormsrgb(24), + rgb10a2uint(25), + rgb10a2unorm(26), + rg11b10ufloat(27), + rgb9e5ufloat(28), + rg32float(29), + rg32uint(30), + rg32sint(31), + rgba16uint(32), + rgba16sint(33), + rgba16float(34), + rgba32float(35), + rgba32uint(36), + rgba32sint(37), + stencil8(38), + depth16unorm(39), + depth24plus(40), + depth24plusstencil8(41), + depth32float(42), + depth32floatstencil8(43), + bc1rgbaunorm(44), + bc1rgbaunormsrgb(45), + bc2rgbaunorm(46), + bc2rgbaunormsrgb(47), + bc3rgbaunorm(48), + bc3rgbaunormsrgb(49), + bc4runorm(50), + bc4rsnorm(51), + bc5rgunorm(52), + bc5rgsnorm(53), + bc6hrgbufloat(54), + bc6hrgbfloat(55), + bc7rgbaunorm(56), + bc7rgbaunormsrgb(57), + etc2rgb8unorm(58), + etc2rgb8unormsrgb(59), + etc2rgb8a1unorm(60), + etc2rgb8a1unormsrgb(61), + etc2rgba8unorm(62), + etc2rgba8unormsrgb(63), + eacr11unorm(64), + eacr11snorm(65), + eacrg11unorm(66), + eacrg11snorm(67), + astc4x4unorm(68), + astc4x4unormsrgb(69), + astc5x4unorm(70), + astc5x4unormsrgb(71), + astc5x5unorm(72), + astc5x5unormsrgb(73), + astc6x5unorm(74), + astc6x5unormsrgb(75), + astc6x6unorm(76), + astc6x6unormsrgb(77), + astc8x5unorm(78), + astc8x5unormsrgb(79), + astc8x6unorm(80), + astc8x6unormsrgb(81), + astc8x8unorm(82), + astc8x8unormsrgb(83), + astc10x5unorm(84), + astc10x5unormsrgb(85), + astc10x6unorm(86), + astc10x6unormsrgb(87), + astc10x8unorm(88), + astc10x8unormsrgb(89), + astc10x10unorm(90), + astc10x10unormsrgb(91), + astc12x10unorm(92), + astc12x10unormsrgb(93), + astc12x12unorm(94), + astc12x12unormsrgb(95), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: TextureFormat): Int = value or other.value + + public companion object { + public fun of(`value`: Int): TextureFormat? = entries.find { + it.value == value + } + + fun of(value: String): TextureFormat? = entries.find { + it.name == value + } + } +} + +public enum class TextureSampleType( + public val `value`: Int, +) { + undefined(0), + float(1), + unfilterablefloat(2), + depth(3), + sint(4), + uint(5), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: TextureSampleType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): TextureSampleType? = entries.find { + it.value == value + } + } +} + +public enum class TextureViewDimension( + public val `value`: Int, +) { + undefined(0), + `_1d`(1), + `_2d`(2), + `_2darray`(3), + cube(4), + cubearray(5), + `_3d`(6), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: TextureViewDimension): Int = value or other.value + + public companion object { + public fun of(`value`: Int): TextureViewDimension? = entries.find { + it.value == value + } + } +} + +public enum class VertexFormat( + public val `value`: Int, +) { + undefined(0), + uint8x2(1), + uint8x4(2), + sint8x2(3), + sint8x4(4), + unorm8x2(5), + unorm8x4(6), + snorm8x2(7), + snorm8x4(8), + uint16x2(9), + uint16x4(10), + sint16x2(11), + sint16x4(12), + unorm16x2(13), + unorm16x4(14), + snorm16x2(15), + snorm16x4(16), + float16x2(17), + float16x4(18), + float32(19), + float32x2(20), + float32x3(21), + float32x4(22), + uint32(23), + uint32x2(24), + uint32x3(25), + uint32x4(26), + sint32(27), + sint32x2(28), + sint32x3(29), + sint32x4(30), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: VertexFormat): Int = value or other.value + + public companion object { + public fun of(`value`: Int): VertexFormat? = entries.find { + it.value == value + } + } +} + +public enum class VertexStepMode( + public val `value`: Int, +) { + vertex(0), + instance(1), + vertexbuffernotused(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: VertexStepMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): VertexStepMode? = entries.find { + it.value == value + } + } +} + +public enum class BufferUsage( + public val `value`: Int, +) { + none(0), + mapread(1), + mapwrite(2), + copysrc(4), + copydst(8), + index(16), + vertex(32), + uniform(64), + storage(128), + indirect(256), + queryresolve(512), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: BufferUsage): Int = value or other.value + + public companion object { + public fun of(`value`: Int): BufferUsage? = entries.find { + it.value == value + } + } +} + +public enum class ColorWriteMask( + public val `value`: Int, +) { + none(0), + red(1), + green(2), + blue(4), + alpha(8), + all(15), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: ColorWriteMask): Int = value or other.value + + public companion object { + public fun of(`value`: Int): ColorWriteMask? = entries.find { + it.value == value + } + } +} + +public enum class MapMode( + public val `value`: Int, +) { + none(0), + read(1), + write(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: MapMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): MapMode? = entries.find { + it.value == value + } + } +} + +public enum class ShaderStage( + public val `value`: Int, +) { + none(0), + vertex(1), + fragment(2), + compute(4), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: ShaderStage): Int = value or other.value + + public companion object { + public fun of(`value`: Int): ShaderStage? = entries.find { + it.value == value + } + } +} + +public enum class TextureUsage( + public val `value`: Int, +) { + none(0), + copysrc(1), + copydst(2), + texturebinding(4), + storagebinding(8), + renderattachment(16), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: TextureUsage): Int = value or other.value + + public companion object { + public fun of(`value`: Int): TextureUsage? = entries.find { + it.value == value + } + } +} + +public infix fun Int.or(other: TextureUsage): Int = this or other.value + +public enum class NativeSType( + public val `value`: Int, +) { + stype_deviceextras(196_609), + stype_requiredlimitsextras(196_610), + stype_pipelinelayoutextras(196_611), + stype_shadermoduleglsldescriptor(196_612), + stype_supportedlimitsextras(196_613), + stype_instanceextras(196_614), + stype_bindgroupentryextras(196_615), + stype_bindgrouplayoutentryextras(196_616), + stype_querysetdescriptorextras(196_617), + stype_surfaceconfigurationextras(196_618), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: NativeSType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): NativeSType? = entries.find { + it.value == value + } + } +} + +public enum class NativeFeature( + public val `value`: Int, +) { + pushconstants(196_609), + textureadapterspecificformatfeatures(196_610), + multidrawindirect(196_611), + multidrawindirectcount(196_612), + vertexwritablestorage(196_613), + texturebindingarray(196_614), + sampledtextureandstoragebufferarraynonuniformindexing(196_615), + pipelinestatisticsquery(196_616), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: NativeFeature): Int = value or other.value + + public companion object { + public fun of(`value`: Int): NativeFeature? = entries.find { + it.value == value + } + } +} + +public enum class LogLevel( + public val `value`: Int, +) { + off(0), + error(1), + warn(2), + info(3), + debug(4), + trace(5), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: LogLevel): Int = value or other.value + + public companion object { + public fun of(`value`: Int): LogLevel? = entries.find { + it.value == value + } + } +} + +public enum class InstanceBackend( + public val `value`: Int, +) { + all(0), + vulkan(1), + gl(2), + metal(4), + dx12(8), + dx11(16), + browserwebgpu(32), + primary(45), + secondary(18), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: InstanceBackend): Int = value or other.value + + public companion object { + public fun of(`value`: Int): InstanceBackend? = entries.find { + it.value == value + } + } +} + +public enum class InstanceFlag( + public val `value`: Int, +) { + default(0), + debug(1), + validation(2), + discardhallabels(4), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: InstanceFlag): Int = value or other.value + + public companion object { + public fun of(`value`: Int): InstanceFlag? = entries.find { + it.value == value + } + } +} + +public enum class Dx12Compiler( + public val `value`: Int, +) { + undefined(0), + fxc(1), + dxc(2), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: Dx12Compiler): Int = value or other.value + + public companion object { + public fun of(`value`: Int): Dx12Compiler? = entries.find { + it.value == value + } + } +} + +public enum class Gles3MinorVersion( + public val `value`: Int, +) { + automatic(0), + version0(1), + version1(2), + version2(3), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: Gles3MinorVersion): Int = value or other.value + + public companion object { + public fun of(`value`: Int): Gles3MinorVersion? = entries.find { + it.value == value + } + } +} + +public enum class PipelineStatisticName( + public val `value`: Int, +) { + vertexshaderinvocations(0), + clipperinvocations(1), + clipperprimitivesout(2), + fragmentshaderinvocations(3), + computeshaderinvocations(4), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: PipelineStatisticName): Int = value or other.value + + public companion object { + public fun of(`value`: Int): PipelineStatisticName? = entries.find { + it.value == value + } + } +} + +public enum class NativeQueryType( + public val `value`: Int, +) { + pipelinestatistics(196_608), + force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: NativeQueryType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): NativeQueryType? = entries.find { + it.value == value + } + } +} diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Pipeline.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Pipeline.kt new file mode 100644 index 00000000..03ebf047 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Pipeline.kt @@ -0,0 +1,126 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +expect class PipelineLayout + +expect class RenderPipeline : AutoCloseable { + fun getBindGroupLayout(index: Int): BindGroupLayout +} + +data class PipelineLayoutDescriptor( + var bindGroupLayouts: Array = arrayOf(), + var label: String? = null +) { + data class BindGroupLayout( + var label: String, + var brand: String + ) +} + +data class RenderPipelineDescriptor( + var vertex: VertexState, + var label: String? = null, + var layout: PipelineLayout? = null, + var primitive: PrimitiveState? = null, + var depthStencil: DepthStencilState? = null, + var fragment: FragmentState? = null, + var multisample: MultisampleState? = null, +) { + + data class VertexState( + var module: ShaderModule, + var entryPoint: String? = null, + var constants: Map? = null, + var buffers: Array? = null, + ) { + data class VertexBufferLayout( + var arrayStride: GPUSize64, + var attributes: Array = arrayOf(), + var stepMode: VertexStepMode? = null, + /* "vertex" | "instance" */ + ) { + data class VertexAttribute( + var format: VertexFormat, + var offset: GPUSize64, + var shaderLocation: GPUIndex32, + ) + + } + } + + + data class PrimitiveState( + var topology: PrimitiveTopology? = null, + /* "point-list" | "line-list" | "line-strip" | "triangle-list" | "triangle-strip" */ + var stripIndexFormat: IndexFormat? = null, + /* "uint16" | "uint32" */ + var frontFace: FrontFace? = null, + /* "ccw" | "cw" */ + var cullMode: CullMode? = null, + /* "none" | "front" | "back" */ + var unclippedDepth: Boolean? = null, + ) + + data class DepthStencilState( + var format: TextureFormat, + /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var depthWriteEnabled: Boolean? = null, + var depthCompare: String? = null, + /* "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always" */ + + var stencilFront: StencilFaceState? = null, + var stencilBack: StencilFaceState? = null, + var stencilReadMask: GPUStencilValue? = null, + var stencilWriteMask: GPUStencilValue? = null, + var depthBias: GPUDepthBias? = null, + var depthBiasSlopeScale: Float? = null, + var depthBiasClamp: Float? = null, + ) { + data class StencilFaceState( + var compare: String? = null, + /* "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always" */ + var failOp: String? = null, + /* "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap" */ + var depthFailOp: String? = null, + /* "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap" */ + var passOp: String? = null, + /* "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap" */ + ) + } + + + data class MultisampleState( + var count: GPUSize32? = null, + var mask: GPUSampleMask? = null, + var alphaToCoverageEnabled: Boolean? = null + ) + + data class FragmentState( + var module: ShaderModule, + var targets: Array = arrayOf(), + var entryPoint: String? = null + ) { + + data class ColorTargetState( + var format: TextureFormat, + var writeMask: ColorWriteMask? = null, + var blend: BlendState? = null + ) { + data class BlendState( + var color: BlendComponent, + var alpha: BlendComponent + ) { + data class BlendComponent( + var operation: String? = null, + /* "add" | "subtract" | "reverse-subtract" | "min" | "max" */ + var srcFactor: String? = null, + /* "zero" | "one" | "src" | "one-minus-src" | "src-alpha" | "one-minus-src-alpha" | "dst" | "one-minus-dst" | "dst-alpha" | "one-minus-dst-alpha" | "src-alpha-saturated" | "constant" | "one-minus-constant" */ + var dstFactor: String? = null + /* "zero" | "one" | "src" | "one-minus-src" | "src-alpha" | "one-minus-src-alpha" | "dst" | "one-minus-dst" | "dst-alpha" | "one-minus-dst-alpha" | "src-alpha-saturated" | "constant" | "one-minus-constant" */ + + ) + } + } + } +} diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Queue.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Queue.kt new file mode 100644 index 00000000..f3648d0c --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Queue.kt @@ -0,0 +1,42 @@ +package io.ygdrasil.wgpu + +expect class Queue { + + fun submit(commandsBuffer: Array) + + fun writeBuffer(buffer: Buffer, bufferOffset: GPUSize64, data: FloatArray, dataOffset: GPUSize64, size: GPUSize64) + + fun copyExternalImageToTexture( + source: ImageCopyExternalImage, + destination: ImageCopyTextureTagged, + copySize: GPUIntegerCoordinates + ) + +} + +expect sealed interface DrawableHolder +expect class ImageBitmapHolder : DrawableHolder { + val width: Int + val height: Int +} + +data class ImageCopyExternalImage( + var source: DrawableHolder, + /* ImageBitmap | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas */ + var origin: GPUIntegerCoordinates? = null, + /* Iterable? | GPUOrigin2DDictStrict? */ + var flipY: Boolean? = null + +) + +data class ImageCopyTextureTagged( + var colorSpace: Any? = null, + var premultipliedAlpha: Boolean? = null, + var texture: Texture, + var mipLevel: GPUIntegerCoordinate? = null, + var origin: GPUExtent3DDictStrict? = null, + /* Iterable? | GPUOrigin3DDict? */ + var aspect: String? = null, + /* "all" | "stencil-only" | "depth-only" */ + +) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/RenderPassDescriptor.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/RenderPassDescriptor.kt new file mode 100644 index 00000000..4dba38d1 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/RenderPassDescriptor.kt @@ -0,0 +1,39 @@ +package io.ygdrasil.wgpu + + +// TODO to implement +class GPUQuerySet + +// TODO to implement +class GPURenderPassTimestampWrites + +data class RenderPassDescriptor( + var colorAttachments: Array = arrayOf(), + var depthStencilAttachment: RenderPassDepthStencilAttachment? = null, + var occlusionQuerySet: GPUQuerySet? = null, + var timestampWrites: GPURenderPassTimestampWrites? = null, + var maxDrawCount: GPUSize64? = null, + var label: String? = null +) { + + data class RenderPassDepthStencilAttachment( + var view: TextureView, + var depthClearValue: Float? = null, + var depthLoadOp: LoadOp? = null, /* "load" | "clear" */ + var depthStoreOp: StoreOp? = null, /* "store" | "discard" */ + var depthReadOnly: Boolean? = null, + var stencilClearValue: GPUStencilValue? = null, + var stencilLoadOp: LoadOp? = null, /* "load" | "clear" */ + var stencilStoreOp: StoreOp? = null, /* "store" | "discard" */ + var stencilReadOnly: Boolean? = null + ) + + data class ColorAttachment( + var view: TextureView, + var loadOp: String, /* "load" | "clear" */ + var storeOp: String, /* "store" | "discard" */ + var depthSlice: GPUIntegerCoordinate? = null, + var resolveTarget: TextureView? = null, + var clearValue: Array? = null, + ) +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/RenderPassEncoder.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/RenderPassEncoder.kt new file mode 100644 index 00000000..e33e9fd9 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/RenderPassEncoder.kt @@ -0,0 +1,22 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +expect class RenderPassEncoder: AutoCloseable { + + fun end() + + fun setPipeline(renderPipeline: RenderPipeline) + + fun draw( + vertexCount: GPUSize32, + instanceCount: GPUSize32? = null, + firstVertex: GPUSize32? = null, + firstInstance: GPUSize32? = null + ) + + fun setBindGroup(index: Int, bindGroup: BindGroup) + + fun setVertexBuffer(slot: Int, buffer: Buffer) + +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/RenderingContext.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/RenderingContext.kt new file mode 100644 index 00000000..a7db64c8 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/RenderingContext.kt @@ -0,0 +1,36 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import kotlin.js.JsExport + +expect class RenderingContext: AutoCloseable { + + val width: Int + val height: Int + val textureFormat: TextureFormat + + fun getCurrentTexture(): Texture + + /** + * Schedule this texture to be presented on the owning surface. + * + * Needs to be called after any work on the texture is scheduled via Queue::submit. + * + * Platform dependent behavior + * On Wayland, present will attach a wl_buffer to the underlying wl_surface and commit the new surface state. If it is desired to do things such as request a frame callback, scale the surface using the viewporter or synchronize other double buffered state, then these operations should be done before the call to present. + */ + fun present() + + fun configure(canvasConfiguration: CanvasConfiguration) +} + +@JsExport +data class CanvasConfiguration( + var device: Device, + var format: TextureFormat? = null, + var usage: GPUTextureUsageFlags? = null, + var viewFormats: Array? = null, + var colorSpace: Any? = null, + var alphaMode: CompositeAlphaMode? = null +) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Sampler.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Sampler.kt new file mode 100644 index 00000000..5e39d125 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Sampler.kt @@ -0,0 +1,22 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +expect class Sampler : AutoCloseable { +} + + +class SamplerDescriptor( + var addressModeU: String? = null, /* "clamp-to-edge" | "repeat" | "mirror-repeat" */ + var addressModeV: String? = null, /* "clamp-to-edge" | "repeat" | "mirror-repeat" */ + var addressModeW: String? = null, /* "clamp-to-edge" | "repeat" | "mirror-repeat" */ + var magFilter: String? = null, /* "nearest" | "linear" */ + + var minFilter: String? = null, /* "nearest" | "linear" */ + var mipmapFilter: String? = null,/* "nearest" | "linear" */ + var lodMinClamp: Float? = null, + var lodMaxClamp: Float? = null, + var compare: String? = null, /* "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always" */ + var maxAnisotropy: Byte? = null, + var label: String? = null, +) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/ShaderModule.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/ShaderModule.kt new file mode 100644 index 00000000..bb288793 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/ShaderModule.kt @@ -0,0 +1,19 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +expect class ShaderModule : AutoCloseable { +} + +data class ShaderModuleDescriptor( + var code: String, + var label: String? = null, + var sourceMap: Any? = null, + var compilationHints: Array? = null +) { + data class CompilationHint( + var entryPoint: String, + // TODO + //var layout: dynamic /* GPUPipelineLayout? | "auto" */ + ) +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Texture.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Texture.kt new file mode 100644 index 00000000..21f8ba20 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Texture.kt @@ -0,0 +1,30 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +expect class Texture: AutoCloseable { + + fun createView(descriptor: TextureViewDescriptor? = null): TextureView +} + +/** + * @see https://www.w3.org/TR/webgpu/#gputexturedescriptor + */ +data class TextureDescriptor( + var size: GPUExtent3DDictStrict, + var format: TextureFormat, + var usage: GPUTextureUsageFlags, + /* Iterable | GPUExtent3DDictStrict */ + var mipLevelCount: GPUIntegerCoordinate = 1, + + var sampleCount: GPUSize32 = 1, + var dimension: TextureDimension = TextureDimension._2d, + /* "1d" | "2d" | "3d" */ + + /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + + var viewFormats: Array? = null, + /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + + var label: String? = null +) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/TextureView.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/TextureView.kt new file mode 100644 index 00000000..7bac17ec --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/TextureView.kt @@ -0,0 +1,20 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +expect class TextureView: AutoCloseable + +data class TextureViewDescriptor( + var label: String? = null, + var format: String? = null, /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var dimension: String? = null, /* "1d" | "2d" | "2d-array" | "cube" | "cube-array" | "3d" */ + var aspect: String? = null, /* "all" | "stencil-only" | "depth-only" */ + + var baseMipLevel: GPUIntegerCoordinate? = null, + + var mipLevelCount: GPUIntegerCoordinate? = null, + + var baseArrayLayer: GPUIntegerCoordinate? = null, + + var arrayLayerCount: GPUIntegerCoordinate? = null, +) diff --git a/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Types.kt b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Types.kt new file mode 100644 index 00000000..46f4e46f --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/commonMain/kotlin/io.ygdrasil.wgpu/Types.kt @@ -0,0 +1,50 @@ +package io.ygdrasil.wgpu + +import kotlin.js.JsExport + +typealias GPUBufferDynamicOffset = Number + +typealias GPUBufferUsageFlags = Int + +typealias GPUColorWriteFlags = Number + +typealias GPUDepthBias = Int + +typealias GPUFlagsConstant = Number + +typealias GPUIndex32 = Int + +typealias GPUIntegerCoordinate = Int + +typealias GPUIntegerCoordinates = Pair + +typealias GPUIntegerCoordinateOut = Int + +typealias GPUMapModeFlags = Number + +typealias GPUPipelineConstantValue = Number + +typealias GPUSampleMask = Int + +typealias GPUShaderStageFlags = Number + +typealias GPUSignedOffset32 = Number + +typealias GPUSize32 = Int + +typealias GPUSize32Out = Int + +typealias GPUSize64 = Long + +typealias GPUSize64Out = Long + +typealias GPUStencilValue = Int + +typealias GPUTextureUsageFlags = Int + +@JsExport +data class GPUExtent3DDictStrict( + var width: Int, + var height: Int? = null, + var depthOrArrayLayers: Int? = null +) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Adapter.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Adapter.js.kt new file mode 100644 index 00000000..0273dbdb --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Adapter.js.kt @@ -0,0 +1,31 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUAdapter +import io.ygdrasil.wgpu.internal.js.GPURequestAdapterOptions +import kotlinx.coroutines.await + +suspend fun requestAdapter(options: GPURequestAdapterOptions? = null): Adapter? { + // WebGPU device initialization + if (navigator.gpu == null) { + println("WebGPU not supported on this browser.") + return null + } + + return navigator.gpu.requestAdapter().await()?.let { + Adapter(it) + } +} + +actual class Adapter(val handler: GPUAdapter) : AutoCloseable { + override fun close() { + // Nothing to do on JS + } + + actual suspend fun requestDevice(): Device? { + return handler.requestDevice().await()?.let { + Device(it) + } + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/BindGroup.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/BindGroup.js.kt new file mode 100644 index 00000000..bb6e881f --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/BindGroup.js.kt @@ -0,0 +1,12 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUBindGroup + +@JsExport +actual class BindGroup(internal val handler: GPUBindGroup) : AutoCloseable { + override fun close() { + // Nothing to do on js + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/BindGroupLayout.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/BindGroupLayout.js.kt new file mode 100644 index 00000000..125242ae --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/BindGroupLayout.js.kt @@ -0,0 +1,6 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUBindGroupLayout + +@JsExport +actual class BindGroupLayout(internal val handler: GPUBindGroupLayout) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Buffer.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Buffer.js.kt new file mode 100644 index 00000000..83cf2561 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Buffer.js.kt @@ -0,0 +1,38 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUBuffer +import org.khronos.webgl.Float32Array + +@JsExport +actual class Buffer(internal val handler: GPUBuffer) : AutoCloseable { + + init { + check(handler != null) { "handler should not be null" } + } + + actual val size: GPUSize64 + get() = handler.size + + actual fun getMappedRange(offset: GPUSize64?, size: GPUSize64?): ByteArray = when { + size == null && offset != null -> handler.getMappedRange(offset) + size == null && offset == null -> handler.getMappedRange() + size != null && offset != null -> handler.getMappedRange(offset, size) + else -> error("size cannot be set without offset") + } + .unsafeCast() + + actual fun unmap() { + handler.unmap() + } + + actual fun map(buffer: FloatArray) { + Float32Array(handler.getMappedRange()) + .set(buffer.toTypedArray(), 0) + } + + override fun close() { + //Nothing to do on JS + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/CommandBuffer.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/CommandBuffer.js.kt new file mode 100644 index 00000000..06fc622c --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/CommandBuffer.js.kt @@ -0,0 +1,12 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUCommandBuffer + +@JsExport +actual class CommandBuffer(internal val handler: GPUCommandBuffer) : AutoCloseable { + override fun close() { + // Nothing to do + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/CommandEncoder.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/CommandEncoder.js.kt new file mode 100644 index 00000000..6f859c1c --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/CommandEncoder.js.kt @@ -0,0 +1,82 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.* + +@JsExport +actual class CommandEncoder(private val handler: GPUCommandEncoder) : AutoCloseable { + actual fun beginRenderPass(renderPassDescriptor: RenderPassDescriptor): RenderPassEncoder { + return RenderPassEncoder(handler.beginRenderPass(renderPassDescriptor.convert())) + } + + actual fun finish(): CommandBuffer { + return CommandBuffer(handler.finish()) + } + + actual fun copyTextureToTexture( + source: ImageCopyTexture, + destination: ImageCopyTexture, + copySize: GPUIntegerCoordinates + ) { + handler.copyTextureToTexture(source.convert(), destination.convert(), copySize.toList().toTypedArray()) + } + + override fun close() { + // Nothing to do + } +} + +private fun ImageCopyTexture.convert(): GPUImageCopyTexture = object : GPUImageCopyTexture { + override var texture: GPUTexture = this@convert.texture.handler + override var mipLevel: GPUIntegerCoordinate? = this@convert.mipLevel ?: undefined + override var origin: dynamic = this@convert.origin?.toList()?.toTypedArray() ?: undefined + override var aspect: String? = this@convert.aspect?.stringValue ?: undefined +} + + +private fun RenderPassDescriptor.convert(): GPURenderPassDescriptor = object : GPURenderPassDescriptor { + override var colorAttachments: Array = + this@convert.colorAttachments.map { it.convert() }.toTypedArray() + override var label: String? = this@convert.label ?: undefined + override var depthStencilAttachment: GPURenderPassDepthStencilAttachment? = + this@convert.depthStencilAttachment?.convert() ?: undefined + + /* + override var occlusionQuerySet: GPUQuerySet? + override var timestampWrites: GPURenderPassTimestampWrites? + */ + override var maxDrawCount: GPUSize64? = this@convert.maxDrawCount ?: undefined +} + +private fun RenderPassDescriptor.RenderPassDepthStencilAttachment.convert(): GPURenderPassDepthStencilAttachment = + object : GPURenderPassDepthStencilAttachment { + override var view: GPUTextureView = this@convert.view.handler + override var depthClearValue: Number? = this@convert.depthClearValue ?: undefined + + /* "load" | "clear" */ + override var depthLoadOp: String? = this@convert.depthLoadOp?.name ?: undefined + + /* "store" | "discard" */ + override var depthStoreOp: String? = this@convert.depthStoreOp?.name ?: undefined + override var depthReadOnly: Boolean? = this@convert.depthReadOnly ?: undefined + override var stencilClearValue: GPUStencilValue? = this@convert.stencilClearValue ?: undefined + + /* "load" | "clear" */ + override var stencilLoadOp: String? = this@convert.stencilLoadOp?.name ?: undefined + + /* "store" | "discard" */ + override var stencilStoreOp: String? = this@convert.stencilStoreOp?.name ?: undefined + override var stencilReadOnly: Boolean? = this@convert.stencilReadOnly ?: undefined + + } + +private fun RenderPassDescriptor.ColorAttachment.convert(): GPURenderPassColorAttachment = + object : GPURenderPassColorAttachment { + override var view: GPUTextureView = this@convert.view.handler + override var loadOp: String = this@convert.loadOp + override var storeOp: String = this@convert.storeOp + override var depthSlice: GPUIntegerCoordinate? = this@convert.depthSlice ?: undefined + override var resolveTarget: GPUTextureView? = this@convert.resolveTarget?.handler ?: undefined + override var clearValue: Array? = this@convert.clearValue ?: undefined + } diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Device.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Device.js.kt new file mode 100644 index 00000000..456614ba --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Device.js.kt @@ -0,0 +1,234 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.* + +@JsExport +actual class Device(val handler: GPUDevice) : AutoCloseable { + + actual val queue: Queue by lazy { Queue(handler.queue) } + + actual fun createCommandEncoder(descriptor: CommandEncoderDescriptor?): CommandEncoder { + return CommandEncoder( + when (descriptor) { + null -> handler.createCommandEncoder() + else -> handler.createCommandEncoder(descriptor.convert()) + } + + ) + } + + actual fun createShaderModule(descriptor: ShaderModuleDescriptor): ShaderModule { + return ShaderModule(handler.createShaderModule(descriptor.convert())) + } + + actual fun createPipelineLayout(descriptor: PipelineLayoutDescriptor): PipelineLayout = handler + .createPipelineLayout(descriptor.convert()) + .let(::PipelineLayout) + + actual fun createRenderPipeline(descriptor: RenderPipelineDescriptor): RenderPipeline = handler + .createRenderPipeline(descriptor.convert()) + .let(::RenderPipeline) + + + actual fun createBuffer(descriptor: BufferDescriptor): Buffer = handler + .createBuffer(descriptor.convert()) + .let(::Buffer) + + actual fun createTexture(descriptor: TextureDescriptor): Texture = handler + .createTexture(descriptor.convert()) + .let(::Texture) + + actual fun createBindGroup(descriptor: BindGroupDescriptor): BindGroup = + descriptor.convert() + .let { handler.createBindGroup(it) } + .let(::BindGroup) + + actual fun createSampler(descriptor: SamplerDescriptor): Sampler = + descriptor.convert() + .let { handler.createSampler(it) } + .let(::Sampler) + + override fun close() { + // Nothing on JS + } +} + +private fun SamplerDescriptor.convert(): GPUSamplerDescriptor = object : GPUSamplerDescriptor { + override var label: String? = this@convert.label ?: undefined + override var addressModeU: String? = this@convert.addressModeU ?: undefined + override var addressModeV: String? = this@convert.addressModeV ?: undefined + override var addressModeW: String? = this@convert.addressModeW ?: undefined + override var magFilter: String? = this@convert.magFilter ?: undefined + override var minFilter: String? = this@convert.minFilter ?: undefined + override var mipmapFilter: String? = this@convert.mipmapFilter ?: undefined + override var lodMinClamp: Number? = this@convert.lodMinClamp ?: undefined + override var lodMaxClamp: Number? = this@convert.lodMaxClamp ?: undefined + override var compare: String? = this@convert.compare ?: undefined + override var maxAnisotropy: Number? = this@convert.maxAnisotropy ?: undefined +} + +private fun BindGroupDescriptor.convert(): GPUBindGroupDescriptor = object : GPUBindGroupDescriptor { + override var label: String? = this@convert.label ?: undefined + override var layout: GPUBindGroupLayout = this@convert.layout.handler + override var entries: Array = this@convert.entries.map { it.convert() }.toTypedArray() +} + +private fun BindGroupDescriptor.BindGroupEntry.convert(): GPUBindGroupEntry = object : GPUBindGroupEntry { + override var binding: GPUIndex32 = this@convert.binding + override var resource: dynamic = this@convert.resource.let { + when (it) { + is SamplerBinding -> it.sampler.handler + is BufferBinding -> object : GPUBufferBinding { + override var buffer: GPUBuffer = it.buffer.handler + override var offset: GPUSize64? = it.offset ?: undefined + override var size: GPUSize64? = it.size ?: undefined + } + + is TextureViewBinding -> it.view.handler + } + } + +} + +private fun TextureDescriptor.convert(): GPUTextureDescriptor = object : GPUTextureDescriptor { + override var label: String? = this@convert.label ?: undefined + override var size: dynamic = this@convert.size.setJsCompliant() + override var mipLevelCount: GPUIntegerCoordinate? = this@convert.mipLevelCount ?: undefined + override var sampleCount: GPUSize32? = this@convert.sampleCount ?: undefined + override var dimension: String? = this@convert.dimension?.stringValue ?: undefined + override var format: String = this@convert.format.name + override var usage: GPUTextureUsageFlags = this@convert.usage + override var viewFormats: Array? = this@convert.viewFormats ?: undefined +} + +private fun BufferDescriptor.convert(): GPUBufferDescriptor = object : GPUBufferDescriptor { + override var size: GPUSize64 = this@convert.size + override var usage: GPUBufferUsageFlags = this@convert.usage + override var mappedAtCreation: Boolean? = this@convert.mappedAtCreation ?: undefined +} + +/*** RenderPipelineDescriptor ***/ + +private fun RenderPipelineDescriptor.convert(): GPURenderPipelineDescriptor = object : GPURenderPipelineDescriptor { + override var vertex: GPUVertexState = this@convert.vertex.convert() + override var layout: dynamic = this@convert.layout?.handler ?: "auto" + override var label: dynamic = this@convert.label ?: undefined + override var primitive: GPUPrimitiveState? = this@convert.primitive?.convert() ?: undefined + override var depthStencil: GPUDepthStencilState? = this@convert.depthStencil?.convert() ?: undefined + override var fragment: GPUFragmentState? = this@convert.fragment?.convert() ?: undefined + override var multisample: GPUMultisampleState? = this@convert.multisample?.convert() ?: undefined +} + +private fun RenderPipelineDescriptor.VertexState.convert(): GPUVertexState = + object : GPUVertexState { + override var module: GPUShaderModule = this@convert.module.handler + override var entryPoint: String? = this@convert.entryPoint ?: undefined + + //TODO check mapping + //override var constants: Map? = null + override var buffers: Array? = this@convert.buffers + ?.map { it?.convert() }?.toTypedArray() ?: undefined + } + +private fun RenderPipelineDescriptor.VertexState.VertexBufferLayout.convert(): GPUVertexBufferLayout = + object : GPUVertexBufferLayout { + override var arrayStride: GPUSize64 = this@convert.arrayStride + override var attributes: Array = this@convert.attributes + .map { it.convert() }.toTypedArray() + override var stepMode: String? = this@convert.stepMode?.name ?: undefined + } + +private fun RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute.convert(): GPUVertexAttribute = + object : GPUVertexAttribute { + override var format: String = this@convert.format.name + override var offset: GPUSize64 = this@convert.offset + override var shaderLocation: GPUIndex32 = this@convert.shaderLocation + } + +private fun RenderPipelineDescriptor.PrimitiveState.convert(): GPUPrimitiveState = + object : GPUPrimitiveState { + override var topology: String? = this@convert.topology?.stringValue ?: undefined + override var stripIndexFormat: String? = this@convert.stripIndexFormat?.name ?: undefined + override var frontFace: String? = this@convert.frontFace?.name ?: undefined + override var cullMode: String? = this@convert.cullMode?.name ?: undefined + override var unclippedDepth: Boolean? = this@convert.unclippedDepth ?: undefined + } + +private fun RenderPipelineDescriptor.DepthStencilState.convert(): GPUDepthStencilState = + object : GPUDepthStencilState { + override var format: String = this@convert.format.name + override var depthWriteEnabled: Boolean? = this@convert.depthWriteEnabled ?: undefined + override var depthCompare: String? = this@convert.depthCompare ?: undefined + override var stencilFront: GPUStencilFaceState? = this@convert.stencilFront?.convert() ?: undefined + override var stencilBack: GPUStencilFaceState? = this@convert.stencilBack?.convert() ?: undefined + override var stencilReadMask: GPUStencilValue? = this@convert.stencilReadMask ?: undefined + override var stencilWriteMask: GPUStencilValue? = this@convert.stencilWriteMask ?: undefined + override var depthBias: GPUDepthBias? = this@convert.depthBias ?: undefined + override var depthBiasSlopeScale: Float? = this@convert.depthBiasSlopeScale ?: undefined + override var depthBiasClamp: Float? = this@convert.depthBiasClamp ?: undefined + } + +private fun RenderPipelineDescriptor.DepthStencilState.StencilFaceState.convert(): GPUStencilFaceState = + object : GPUStencilFaceState { + override var compare: String? = this@convert.compare ?: undefined + override var failOp: String? = this@convert.failOp ?: undefined + override var depthFailOp: String? = this@convert.depthFailOp ?: undefined + override var passOp: String? = this@convert.passOp ?: undefined + } + +private fun RenderPipelineDescriptor.MultisampleState.convert(): GPUMultisampleState = + object : GPUMultisampleState { + override var count: dynamic = this@convert.count ?: undefined + override var mask: dynamic = this@convert.mask ?: undefined + override var alphaToCoverageEnabled: dynamic = this@convert.alphaToCoverageEnabled ?: undefined + } + +private fun RenderPipelineDescriptor.FragmentState.convert(): GPUFragmentState = + object : GPUFragmentState { + override var targets: Array = this@convert.targets.map { it?.convert() }.toTypedArray() + override var module: GPUShaderModule = this@convert.module.handler + override var entryPoint: String? = this@convert.entryPoint ?: undefined + // TODO not sure how to map this + //override var constants: Record? = TODO("Not yet implemented") + } + +private fun RenderPipelineDescriptor.FragmentState.ColorTargetState.convert(): GPUColorTargetState = + object : GPUColorTargetState { + override var format: String = this@convert.format.name + override var blend: GPUBlendState? = this@convert.blend?.convert() ?: undefined + override var writeMask: GPUColorWriteFlags? = this@convert.writeMask?.value ?: undefined + } + +private fun RenderPipelineDescriptor.FragmentState.ColorTargetState.BlendState.convert(): GPUBlendState = + object : GPUBlendState { + override var color: GPUBlendComponent = this@convert.color.convert() + override var alpha: GPUBlendComponent = this@convert.alpha.convert() + } + +private fun RenderPipelineDescriptor.FragmentState.ColorTargetState.BlendState.BlendComponent.convert(): GPUBlendComponent = + object : GPUBlendComponent { + override var operation: String? = this@convert.operation ?: undefined + override var srcFactor: String? = this@convert.srcFactor ?: undefined + override var dstFactor: String? = this@convert.dstFactor ?: undefined + } + +/*** PipelineLayoutDescriptor ***/ + +private fun PipelineLayoutDescriptor.convert(): GPUPipelineLayoutDescriptor = object : GPUPipelineLayoutDescriptor { + override var label: String? = this@convert.label ?: undefined + override var bindGroupLayouts: Array = this@convert.bindGroupLayouts + .map { it.convert() }.toTypedArray() +} + +private fun PipelineLayoutDescriptor.BindGroupLayout.convert(): GPUBindGroupLayout = + object : GPUBindGroupLayout { + override var label: String = this@convert.label + override var __brand: String = this@convert.brand + } + +private fun CommandEncoderDescriptor.convert(): GPUCommandEncoderDescriptor = object : GPUCommandEncoderDescriptor { + override var label: String? = this@convert.label ?: undefined +} + diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Pipeline.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Pipeline.js.kt new file mode 100644 index 00000000..18351cd1 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Pipeline.js.kt @@ -0,0 +1,23 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUPipelineLayout +import io.ygdrasil.wgpu.internal.js.GPURenderPipeline + +@JsExport +actual class PipelineLayout(internal var handler: GPUPipelineLayout) + +@JsExport +actual class RenderPipeline(internal var handler: GPURenderPipeline) : AutoCloseable { + + actual fun getBindGroupLayout(index: Int) = handler + .getBindGroupLayout(index) + .let { BindGroupLayout(it) } + + + override fun close() { + // Nothing to do on js + } + +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Queue.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Queue.js.kt new file mode 100644 index 00000000..c1e69e0e --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Queue.js.kt @@ -0,0 +1,74 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUImageCopyExternalImage +import io.ygdrasil.wgpu.internal.js.GPUImageCopyTextureTagged +import io.ygdrasil.wgpu.internal.js.GPUQueue +import io.ygdrasil.wgpu.internal.js.GPUTexture +import org.khronos.webgl.Float32Array +import org.w3c.dom.ImageBitmap + +@JsExport +actual class Queue(private val handler: GPUQueue) { + actual fun submit(commandsBuffer: Array) { + handler.submit(commandsBuffer.map { it.handler }.toTypedArray()) + } + + actual fun writeBuffer( + buffer: Buffer, + bufferOffset: GPUSize64, + data: FloatArray, + dataOffset: GPUSize64, + size: GPUSize64 + ) { + handler.writeBuffer( + buffer.handler, + bufferOffset, + data.unsafeCast(), + dataOffset, + size + ) + } + + actual fun copyExternalImageToTexture( + source: ImageCopyExternalImage, + destination: ImageCopyTextureTagged, + copySize: GPUIntegerCoordinates + ) { + handler.copyExternalImageToTexture( + source.convert(), + destination.convert(), + copySize.toList().toTypedArray() + ) + } +} + +private fun ImageCopyTextureTagged.convert(): GPUImageCopyTextureTagged = object : GPUImageCopyTextureTagged { + override var texture: GPUTexture = this@convert.texture.handler + override var mipLevel: GPUIntegerCoordinate? = this@convert.mipLevel ?: undefined + override var origin: dynamic = this@convert.origin?.setJsCompliant() ?: undefined + override var aspect: String? = this@convert.aspect ?: undefined + override var colorSpace: Any? = this@convert.colorSpace ?: undefined + override var premultipliedAlpha: Boolean? = this@convert.premultipliedAlpha ?: undefined +} + +private fun ImageCopyExternalImage.convert(): GPUImageCopyExternalImage = object : GPUImageCopyExternalImage { + override var source: dynamic = this@convert.source.convert() + override var origin: dynamic = this@convert.origin ?: undefined + override var flipY: Boolean? = this@convert.flipY ?: undefined +} + +private fun DrawableHolder.convert(): dynamic = let { holder -> + when (holder) { + is ImageBitmapHolder -> holder.handler + else -> error("unreachable statement") + } +} + +actual class ImageBitmapHolder(internal val handler: ImageBitmap) : DrawableHolder { + actual val width: Int + get() = handler.width + actual val height: Int + get() = handler.height + +} +actual sealed interface DrawableHolder \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/RenderPassEncoder.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/RenderPassEncoder.js.kt new file mode 100644 index 00000000..4ad13ab2 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/RenderPassEncoder.js.kt @@ -0,0 +1,50 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPURenderPassEncoder + +@JsExport +actual class RenderPassEncoder(private val handler: GPURenderPassEncoder) : AutoCloseable { + + actual fun end() { + handler.end() + } + + actual fun setPipeline(renderPipeline: RenderPipeline) { + handler.setPipeline(renderPipeline.handler) + } + + actual fun draw( + vertexCount: GPUSize32, + instanceCount: GPUSize32?, + firstVertex: GPUSize32?, + firstInstance: GPUSize32? + ) { + when { + instanceCount == null -> handler.draw(vertexCount) + firstVertex == null -> handler.draw(vertexCount, instanceCount ?: error("")) + firstInstance == null -> handler.draw(vertexCount, instanceCount ?: error(""), firstVertex ?: error("")) + instanceCount != null && firstVertex != null && firstInstance != null -> handler.draw( + vertexCount, + instanceCount, + firstVertex, + firstInstance + ) + + else -> error("illegal state") + } + } + + actual fun setBindGroup(index: Int, bindGroup: BindGroup) { + handler.setBindGroup(index, bindGroup.handler) + } + + actual fun setVertexBuffer(slot: Int, buffer: Buffer) { + handler.setVertexBuffer(slot, buffer.handler) + } + + override fun close() { + // Nothing to do + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/RenderingContext.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/RenderingContext.js.kt new file mode 100644 index 00000000..52e6e97d --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/RenderingContext.js.kt @@ -0,0 +1,52 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUCanvasConfiguration +import io.ygdrasil.wgpu.internal.js.GPUCanvasContext +import io.ygdrasil.wgpu.internal.js.GPUDevice +import org.w3c.dom.HTMLCanvasElement + +@JsExport +actual class RenderingContext(private val handler: GPUCanvasContext) : AutoCloseable { + + actual val width: Int + get() = handler.canvas.width + actual val height: Int + get() = handler.canvas.height + + actual val textureFormat: TextureFormat by lazy { + navigator.gpu + ?.getPreferredCanvasFormat() + ?.let { TextureFormat.of(it) } + ?: error("fail to get canvas prefered format") + } + + actual fun getCurrentTexture(): Texture { + return Texture(handler.getCurrentTexture()) + } + + override fun close() { + // Nothing to do on js + } + + actual fun present() { + // Nothing to do on js + } + + actual fun configure(canvasConfiguration: CanvasConfiguration) { + handler.configure(canvasConfiguration.convert()) + } + + fun CanvasConfiguration.convert(): GPUCanvasConfiguration = object : GPUCanvasConfiguration { + override var device: GPUDevice = this@convert.device.handler + override var format: String = this@convert.format?.name ?: textureFormat.name + override var usage: GPUTextureUsageFlags? = this@convert.usage ?: undefined + override var viewFormats: Array? = this@convert.viewFormats ?: undefined + override var colorSpace: Any? = this@convert.colorSpace ?: undefined + override var alphaMode: String? = this@convert.alphaMode?.name ?: undefined + } +} + +fun HTMLCanvasElement.getRenderingContext() = (getContext("webgpu") as? GPUCanvasContext)?.let { RenderingContext(it) } + diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Sampler.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Sampler.js.kt new file mode 100644 index 00000000..5724fa28 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Sampler.js.kt @@ -0,0 +1,11 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUSampler + +actual class Sampler(internal val handler: GPUSampler) : AutoCloseable { + override fun close() { + // Nothing to do on JS + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/ShaderModule.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/ShaderModule.js.kt new file mode 100644 index 00000000..1af8867f --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/ShaderModule.js.kt @@ -0,0 +1,31 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUShaderModule +import io.ygdrasil.wgpu.internal.js.GPUShaderModuleCompilationHint +import io.ygdrasil.wgpu.internal.js.GPUShaderModuleDescriptor + +@JsExport +actual class ShaderModule(internal val handler: GPUShaderModule) : AutoCloseable { + override fun close() { + // Nothing to do on JS + } +} + +fun ShaderModuleDescriptor.convert(): GPUShaderModuleDescriptor = object : GPUShaderModuleDescriptor { + override var code: String = this@convert.code + override var sourceMap: Any? = this@convert.sourceMap ?: undefined + override var compilationHints: Array? = this@convert + .compilationHints + ?.map { it.convert() } + ?.toTypedArray() + ?: undefined + override var label: String? = this@convert.label ?: undefined + +} + +private fun ShaderModuleDescriptor.CompilationHint.convert() = object : GPUShaderModuleCompilationHint { + override var entryPoint: String = this@convert.entryPoint + override var layout: dynamic = TODO("no yet implemented")//this@convert.layout ?: undefined +} diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Texture.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Texture.js.kt new file mode 100644 index 00000000..d5f899b3 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Texture.js.kt @@ -0,0 +1,33 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUTexture +import io.ygdrasil.wgpu.internal.js.GPUTextureViewDescriptor + +@JsExport +actual class Texture(internal val handler: GPUTexture) : AutoCloseable { + override fun close() { + // nothing to do + } + + actual fun createView(descriptor: TextureViewDescriptor?): TextureView { + return TextureView( + when (descriptor) { + null -> handler.createView() + else -> handler.createView(descriptor.convert()) + } + ) + } +} + +private fun TextureViewDescriptor.convert(): GPUTextureViewDescriptor = object : GPUTextureViewDescriptor { + override var label: String? = this@convert.label ?: undefined + override var format: String? = this@convert.format ?: undefined + override var dimension: String? = this@convert.dimension ?: undefined + override var aspect: String? = this@convert.aspect ?: undefined + override var baseMipLevel: GPUIntegerCoordinate? = this@convert.baseMipLevel ?: undefined + override var mipLevelCount: GPUIntegerCoordinate? = this@convert.mipLevelCount ?: undefined + override var baseArrayLayer: GPUIntegerCoordinate? = this@convert.baseArrayLayer ?: undefined + override var arrayLayerCount: GPUIntegerCoordinate? = this@convert.baseArrayLayer ?: undefined +} diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/TextureView.js.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/TextureView.js.kt new file mode 100644 index 00000000..fa779c0b --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/TextureView.js.kt @@ -0,0 +1,13 @@ +@file:OptIn(ExperimentalStdlibApi::class) + +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPUTextureView + +@JsExport +actual class TextureView(internal val handler: GPUTextureView) : AutoCloseable { + + override fun close() { + // Nothing to do + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Types.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Types.kt new file mode 100644 index 00000000..f1bdd5c8 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/Types.kt @@ -0,0 +1,6 @@ +package io.ygdrasil.wgpu + +internal fun GPUExtent3DDictStrict.setJsCompliant(): GPUExtent3DDictStrict = apply { + height = height ?: undefined + depthOrArrayLayers = depthOrArrayLayers ?: undefined +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/helpers.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/helpers.kt new file mode 100644 index 00000000..65b95927 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/helpers.kt @@ -0,0 +1,8 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.js.GPU + +external object navigator { + val gpu: GPU? +} + diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.dom.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.dom.kt new file mode 100644 index 00000000..f4c0f1a5 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.dom.kt @@ -0,0 +1,5988 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package io.ygdrasil.wgpu.internal.js + +import org.khronos.webgl.* +import org.w3c.dom.* +import org.w3c.dom.events.* +import org.w3c.dom.svg.* +import org.w3c.files.Blob +import org.w3c.workers.CacheQueryOptions +import org.w3c.xhr.FormData +import org.w3c.xhr.ProgressEvent +import kotlin.js.Date +import kotlin.js.Promise + +/* +external interface Algorithm { + var name: String +} + +external interface AuthenticationExtensionsClientInputs { + var appid: String? + get() = definedExternally + set(value) = definedExternally + var authnSel: AuthenticatorSelectionList? + get() = definedExternally + set(value) = definedExternally + var exts: Boolean? + get() = definedExternally + set(value) = definedExternally + var loc: Boolean? + get() = definedExternally + set(value) = definedExternally + var txAuthGeneric: txAuthGenericArg? + get() = definedExternally + set(value) = definedExternally + var txAuthSimple: String? + get() = definedExternally + set(value) = definedExternally + var uvi: Boolean? + get() = definedExternally + set(value) = definedExternally + var uvm: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface AuthenticatorSelectionCriteria { + var authenticatorAttachment: String? /* "cross-platform" | "platform" */ + get() = definedExternally + set(value) = definedExternally + var requireResidentKey: Boolean? + get() = definedExternally + set(value) = definedExternally + var userVerification: String? /* "discouraged" | "preferred" | "required" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface ClipboardEventInit : EventInit { + var clipboardData: DataTransfer? + get() = definedExternally + set(value) = definedExternally +} + +external interface ComputedEffectTiming : EffectTiming { + var activeDuration: Number? + get() = definedExternally + set(value) = definedExternally + var currentIteration: Number? + get() = definedExternally + set(value) = definedExternally + var endTime: Number? + get() = definedExternally + set(value) = definedExternally + var localTime: Number? + get() = definedExternally + set(value) = definedExternally + var progress: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface ConfirmSiteSpecificExceptionsInformation : ExceptionInformation { + var arrayOfDomainStrings: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface ConstrainBooleanParameters { + var exact: Boolean? + get() = definedExternally + set(value) = definedExternally + var ideal: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface ConstrainDOMStringParameters { + var exact: dynamic /* String? | Array? */ + get() = definedExternally + set(value) = definedExternally + var ideal: dynamic /* String? | Array? */ + get() = definedExternally + set(value) = definedExternally +} + +external interface ConstrainDoubleRange : DoubleRange { + var exact: Number? + get() = definedExternally + set(value) = definedExternally + var ideal: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface ConstrainULongRange : ULongRange { + var exact: Number? + get() = definedExternally + set(value) = definedExternally + var ideal: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface CredentialCreationOptions { + var publicKey: PublicKeyCredentialCreationOptions? + get() = definedExternally + set(value) = definedExternally + var signal: AbortSignal? + get() = definedExternally + set(value) = definedExternally +} + +external interface CredentialRequestOptions { + var mediation: String? /* "optional" | "required" | "silent" */ + get() = definedExternally + set(value) = definedExternally + var publicKey: PublicKeyCredentialRequestOptions? + get() = definedExternally + set(value) = definedExternally + var signal: AbortSignal? + get() = definedExternally + set(value) = definedExternally +} + +external interface DOMMatrix2DInit { + var a: Number? + get() = definedExternally + set(value) = definedExternally + var b: Number? + get() = definedExternally + set(value) = definedExternally + var c: Number? + get() = definedExternally + set(value) = definedExternally + var d: Number? + get() = definedExternally + set(value) = definedExternally + var e: Number? + get() = definedExternally + set(value) = definedExternally + var f: Number? + get() = definedExternally + set(value) = definedExternally + var m11: Number? + get() = definedExternally + set(value) = definedExternally + var m12: Number? + get() = definedExternally + set(value) = definedExternally + var m21: Number? + get() = definedExternally + set(value) = definedExternally + var m22: Number? + get() = definedExternally + set(value) = definedExternally + var m41: Number? + get() = definedExternally + set(value) = definedExternally + var m42: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DOMMatrixInit : DOMMatrix2DInit { + var is2D: Boolean? + get() = definedExternally + set(value) = definedExternally + var m13: Number? + get() = definedExternally + set(value) = definedExternally + var m14: Number? + get() = definedExternally + set(value) = definedExternally + var m23: Number? + get() = definedExternally + set(value) = definedExternally + var m24: Number? + get() = definedExternally + set(value) = definedExternally + var m31: Number? + get() = definedExternally + set(value) = definedExternally + var m32: Number? + get() = definedExternally + set(value) = definedExternally + var m33: Number? + get() = definedExternally + set(value) = definedExternally + var m34: Number? + get() = definedExternally + set(value) = definedExternally + var m43: Number? + get() = definedExternally + set(value) = definedExternally + var m44: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DeviceLightEventInit : EventInit { + var value: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DeviceMotionEventAccelerationInit { + var x: Number? + get() = definedExternally + set(value) = definedExternally + var y: Number? + get() = definedExternally + set(value) = definedExternally + var z: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DeviceMotionEventInit : EventInit { + var acceleration: DeviceMotionEventAccelerationInit? + get() = definedExternally + set(value) = definedExternally + var accelerationIncludingGravity: DeviceMotionEventAccelerationInit? + get() = definedExternally + set(value) = definedExternally + var interval: Number? + get() = definedExternally + set(value) = definedExternally + var rotationRate: DeviceMotionEventRotationRateInit? + get() = definedExternally + set(value) = definedExternally +} + +external interface DeviceMotionEventRotationRateInit { + var alpha: Number? + get() = definedExternally + set(value) = definedExternally + var beta: Number? + get() = definedExternally + set(value) = definedExternally + var gamma: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DeviceOrientationEventInit : EventInit { + var absolute: Boolean? + get() = definedExternally + set(value) = definedExternally + var alpha: Number? + get() = definedExternally + set(value) = definedExternally + var beta: Number? + get() = definedExternally + set(value) = definedExternally + var gamma: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DevicePermissionDescriptor : PermissionDescriptor { + var deviceId: String? + get() = definedExternally + set(value) = definedExternally + override var name: String /* "camera" | "microphone" | "speaker" */ +} + +external interface DocumentTimelineOptions { + var originTime: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface DoubleRange { + var max: Number? + get() = definedExternally + set(value) = definedExternally + var min: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface EffectTiming { + var delay: Number? + get() = definedExternally + set(value) = definedExternally + var direction: String? /* "alternate" | "alternate-reverse" | "normal" | "reverse" */ + get() = definedExternally + set(value) = definedExternally + var duration: dynamic /* Number? | String? */ + get() = definedExternally + set(value) = definedExternally + var easing: String? + get() = definedExternally + set(value) = definedExternally + var endDelay: Number? + get() = definedExternally + set(value) = definedExternally + var fill: String? /* "auto" | "backwards" | "both" | "forwards" | "none" */ + get() = definedExternally + set(value) = definedExternally + var iterationStart: Number? + get() = definedExternally + set(value) = definedExternally + var iterations: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface ExceptionInformation { + var domain: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface FocusNavigationEventInit : EventInit { + var navigationReason: String? + get() = definedExternally + set(value) = definedExternally + var originHeight: Number? + get() = definedExternally + set(value) = definedExternally + var originLeft: Number? + get() = definedExternally + set(value) = definedExternally + var originTop: Number? + get() = definedExternally + set(value) = definedExternally + var originWidth: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface FocusNavigationOrigin { + var originHeight: Number? + get() = definedExternally + set(value) = definedExternally + var originLeft: Number? + get() = definedExternally + set(value) = definedExternally + var originTop: Number? + get() = definedExternally + set(value) = definedExternally + var originWidth: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface FocusOptions { + var preventScroll: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface FullscreenOptions { + var navigationUI: String? /* "auto" | "hide" | "show" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GamepadEventInit : EventInit { + var gamepad: Gamepad +} + +external interface HmacImportParams : Algorithm { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally + var length: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface HmacKeyGenParams : Algorithm { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally + var length: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface IDBIndexParameters { + var multiEntry: Boolean? + get() = definedExternally + set(value) = definedExternally + var unique: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface IDBObjectStoreParameters { + var autoIncrement: Boolean? + get() = definedExternally + set(value) = definedExternally + var keyPath: dynamic /* String? | Array? */ + get() = definedExternally + set(value) = definedExternally +} + +external interface IDBVersionChangeEventInit : EventInit { + var newVersion: Number? + get() = definedExternally + set(value) = definedExternally + var oldVersion: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface ImageEncodeOptions { + var quality: Number? + get() = definedExternally + set(value) = definedExternally + var type: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface JsonWebKey { + var alg: String? + get() = definedExternally + set(value) = definedExternally + var crv: String? + get() = definedExternally + set(value) = definedExternally + var d: String? + get() = definedExternally + set(value) = definedExternally + var dp: String? + get() = definedExternally + set(value) = definedExternally + var dq: String? + get() = definedExternally + set(value) = definedExternally + var e: String? + get() = definedExternally + set(value) = definedExternally + var ext: Boolean? + get() = definedExternally + set(value) = definedExternally + var k: String? + get() = definedExternally + set(value) = definedExternally + var key_ops: Array? + get() = definedExternally + set(value) = definedExternally + var kty: String? + get() = definedExternally + set(value) = definedExternally + var n: String? + get() = definedExternally + set(value) = definedExternally + var oth: Array? + get() = definedExternally + set(value) = definedExternally + var p: String? + get() = definedExternally + set(value) = definedExternally + var q: String? + get() = definedExternally + set(value) = definedExternally + var qi: String? + get() = definedExternally + set(value) = definedExternally + var use: String? + get() = definedExternally + set(value) = definedExternally + var x: String? + get() = definedExternally + set(value) = definedExternally + var y: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface KeyAlgorithm { + var name: String +} + +external interface Keyframe { + var composite: String? /* "accumulate" | "add" | "auto" | "replace" */ + get() = definedExternally + set(value) = definedExternally + var easing: String? + get() = definedExternally + set(value) = definedExternally + var offset: Number? + get() = definedExternally + set(value) = definedExternally + @nativeGetter + operator fun get(property: String): dynamic /* String? | Number? */ + @nativeSetter + operator fun set(property: String, value: String?) + @nativeSetter + operator fun set(property: String, value: Number?) +} + +external interface KeyframeAnimationOptions : KeyframeEffectOptions { + var id: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface KeyframeEffectOptions : EffectTiming { + var composite: String? /* "accumulate" | "add" | "replace" */ + get() = definedExternally + set(value) = definedExternally + var iterationComposite: String? /* "accumulate" | "replace" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaEncryptedEventInit : EventInit { + var initData: ArrayBuffer? + get() = definedExternally + set(value) = definedExternally + var initDataType: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaKeyMessageEventInit : EventInit { + var message: ArrayBuffer + var messageType: String /* "individualization-request" | "license-release" | "license-renewal" | "license-request" */ +} + +external interface MediaKeySystemConfiguration { + var audioCapabilities: Array? + get() = definedExternally + set(value) = definedExternally + var distinctiveIdentifier: String? /* "not-allowed" | "optional" | "required" */ + get() = definedExternally + set(value) = definedExternally + var initDataTypes: Array? + get() = definedExternally + set(value) = definedExternally + var label: String? + get() = definedExternally + set(value) = definedExternally + var persistentState: String? /* "not-allowed" | "optional" | "required" */ + get() = definedExternally + set(value) = definedExternally + var sessionTypes: Array? + get() = definedExternally + set(value) = definedExternally + var videoCapabilities: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaKeySystemMediaCapability { + var contentType: String? + get() = definedExternally + set(value) = definedExternally + var robustness: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaStreamConstraints { + var audio: dynamic /* Boolean? | MediaTrackConstraints? */ + get() = definedExternally + set(value) = definedExternally + var peerIdentity: String? + get() = definedExternally + set(value) = definedExternally + var video: dynamic /* Boolean? | MediaTrackConstraints? */ + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaStreamErrorEventInit : EventInit { + var error: MediaStreamError? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaStreamEventInit : EventInit { + var stream: MediaStream? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaStreamTrackEventInit : EventInit { + var track: MediaStreamTrack +} + +external interface MediaTrackCapabilities { + var aspectRatio: DoubleRange? + get() = definedExternally + set(value) = definedExternally + var autoGainControl: Array? + get() = definedExternally + set(value) = definedExternally + var channelCount: ULongRange? + get() = definedExternally + set(value) = definedExternally + var deviceId: String? + get() = definedExternally + set(value) = definedExternally + var echoCancellation: Array? + get() = definedExternally + set(value) = definedExternally + var facingMode: Array? + get() = definedExternally + set(value) = definedExternally + var frameRate: DoubleRange? + get() = definedExternally + set(value) = definedExternally + var groupId: String? + get() = definedExternally + set(value) = definedExternally + var height: ULongRange? + get() = definedExternally + set(value) = definedExternally + var latency: DoubleRange? + get() = definedExternally + set(value) = definedExternally + var noiseSuppression: Array? + get() = definedExternally + set(value) = definedExternally + var resizeMode: Array? + get() = definedExternally + set(value) = definedExternally + var sampleRate: ULongRange? + get() = definedExternally + set(value) = definedExternally + var sampleSize: ULongRange? + get() = definedExternally + set(value) = definedExternally + var width: ULongRange? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaTrackConstraintSet { + var aspectRatio: dynamic /* Number? | ConstrainDoubleRange? */ + get() = definedExternally + set(value) = definedExternally + var autoGainControl: dynamic /* Boolean? | ConstrainBooleanParameters? */ + get() = definedExternally + set(value) = definedExternally + var channelCount: dynamic /* Number? | ConstrainULongRange? */ + get() = definedExternally + set(value) = definedExternally + var deviceId: dynamic /* String? | Array? | ConstrainDOMStringParameters? */ + get() = definedExternally + set(value) = definedExternally + var echoCancellation: dynamic /* Boolean? | ConstrainBooleanParameters? */ + get() = definedExternally + set(value) = definedExternally + var facingMode: dynamic /* String? | Array? | ConstrainDOMStringParameters? */ + get() = definedExternally + set(value) = definedExternally + var frameRate: dynamic /* Number? | ConstrainDoubleRange? */ + get() = definedExternally + set(value) = definedExternally + var groupId: dynamic /* String? | Array? | ConstrainDOMStringParameters? */ + get() = definedExternally + set(value) = definedExternally + var height: dynamic /* Number? | ConstrainULongRange? */ + get() = definedExternally + set(value) = definedExternally + var latency: dynamic /* Number? | ConstrainDoubleRange? */ + get() = definedExternally + set(value) = definedExternally + var noiseSuppression: dynamic /* Boolean? | ConstrainBooleanParameters? */ + get() = definedExternally + set(value) = definedExternally + var resizeMode: dynamic /* String? | Array? | ConstrainDOMStringParameters? */ + get() = definedExternally + set(value) = definedExternally + var sampleRate: dynamic /* Number? | ConstrainULongRange? */ + get() = definedExternally + set(value) = definedExternally + var sampleSize: dynamic /* Number? | ConstrainULongRange? */ + get() = definedExternally + set(value) = definedExternally + var width: dynamic /* Number? | ConstrainULongRange? */ + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaTrackConstraints : MediaTrackConstraintSet { + var advanced: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaTrackSettings { + var aspectRatio: Number? + get() = definedExternally + set(value) = definedExternally + var autoGainControl: Boolean? + get() = definedExternally + set(value) = definedExternally + var channelCount: Number? + get() = definedExternally + set(value) = definedExternally + var deviceId: String? + get() = definedExternally + set(value) = definedExternally + var echoCancellation: Boolean? + get() = definedExternally + set(value) = definedExternally + var facingMode: String? + get() = definedExternally + set(value) = definedExternally + var frameRate: Number? + get() = definedExternally + set(value) = definedExternally + var groupId: String? + get() = definedExternally + set(value) = definedExternally + var height: Number? + get() = definedExternally + set(value) = definedExternally + var latency: Number? + get() = definedExternally + set(value) = definedExternally + var noiseSuppression: Boolean? + get() = definedExternally + set(value) = definedExternally + var resizeMode: String? + get() = definedExternally + set(value) = definedExternally + var sampleRate: Number? + get() = definedExternally + set(value) = definedExternally + var sampleSize: Number? + get() = definedExternally + set(value) = definedExternally + var width: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface MediaTrackSupportedConstraints { + var aspectRatio: Boolean? + get() = definedExternally + set(value) = definedExternally + var autoGainControl: Boolean? + get() = definedExternally + set(value) = definedExternally + var channelCount: Boolean? + get() = definedExternally + set(value) = definedExternally + var deviceId: Boolean? + get() = definedExternally + set(value) = definedExternally + var echoCancellation: Boolean? + get() = definedExternally + set(value) = definedExternally + var facingMode: Boolean? + get() = definedExternally + set(value) = definedExternally + var frameRate: Boolean? + get() = definedExternally + set(value) = definedExternally + var groupId: Boolean? + get() = definedExternally + set(value) = definedExternally + var height: Boolean? + get() = definedExternally + set(value) = definedExternally + var latency: Boolean? + get() = definedExternally + set(value) = definedExternally + var noiseSuppression: Boolean? + get() = definedExternally + set(value) = definedExternally + var resizeMode: Boolean? + get() = definedExternally + set(value) = definedExternally + var sampleRate: Boolean? + get() = definedExternally + set(value) = definedExternally + var sampleSize: Boolean? + get() = definedExternally + set(value) = definedExternally + var width: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface MidiPermissionDescriptor : PermissionDescriptor { + override var name: String /* "midi" */ + var sysex: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface MultiCacheQueryOptions : CacheQueryOptions + + +external interface NavigationPreloadState { + var enabled: Boolean? + get() = definedExternally + set(value) = definedExternally + var headerValue: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface OfflineAudioCompletionEventInit : EventInit { + var renderedBuffer: AudioBuffer +} + +external interface OptionalEffectTiming { + var delay: Number? + get() = definedExternally + set(value) = definedExternally + var direction: String? /* "alternate" | "alternate-reverse" | "normal" | "reverse" */ + get() = definedExternally + set(value) = definedExternally + var duration: dynamic /* Number? | String? */ + get() = definedExternally + set(value) = definedExternally + var easing: String? + get() = definedExternally + set(value) = definedExternally + var endDelay: Number? + get() = definedExternally + set(value) = definedExternally + var fill: String? /* "auto" | "backwards" | "both" | "forwards" | "none" */ + get() = definedExternally + set(value) = definedExternally + var iterationStart: Number? + get() = definedExternally + set(value) = definedExternally + var iterations: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface PaymentCurrencyAmount { + var currency: String + var currencySystem: String? + get() = definedExternally + set(value) = definedExternally + var value: String +} + +external interface PaymentDetailsBase { + var displayItems: Array? + get() = definedExternally + set(value) = definedExternally + var modifiers: Array? + get() = definedExternally + set(value) = definedExternally + var shippingOptions: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface PaymentDetailsModifier { + var additionalDisplayItems: Array? + get() = definedExternally + set(value) = definedExternally + var data: Any? + get() = definedExternally + set(value) = definedExternally + var supportedMethods: dynamic /* String | Array */ + get() = definedExternally + set(value) = definedExternally + var total: PaymentItem? + get() = definedExternally + set(value) = definedExternally +} + +external interface PaymentDetailsUpdate : PaymentDetailsBase { + var error: String? + get() = definedExternally + set(value) = definedExternally + var total: PaymentItem? + get() = definedExternally + set(value) = definedExternally +} + +external interface PaymentItem { + var amount: PaymentCurrencyAmount + var label: String + var pending: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface PaymentRequestUpdateEventInit : EventInit + +external interface PaymentShippingOption { + var amount: PaymentCurrencyAmount + var id: String + var label: String + var selected: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface Pbkdf2Params : Algorithm { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally + var iterations: Number + var salt: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally +} + +external interface PermissionDescriptor { + var name: String /* "accelerometer" | "ambient-light-sensor" | "background-sync" | "bluetooth" | "camera" | "clipboard" | "device-info" | "geolocation" | "gyroscope" | "magnetometer" | "microphone" | "midi" | "notifications" | "persistent-storage" | "push" | "speaker" */ +} + +external interface PipeOptions { + var preventAbort: Boolean? + get() = definedExternally + set(value) = definedExternally + var preventCancel: Boolean? + get() = definedExternally + set(value) = definedExternally + var preventClose: Boolean? + get() = definedExternally + set(value) = definedExternally + var signal: AbortSignal? + get() = definedExternally + set(value) = definedExternally +} + +external interface PointerEventInit : MouseEventInit { + var height: Number? + get() = definedExternally + set(value) = definedExternally + var isPrimary: Boolean? + get() = definedExternally + set(value) = definedExternally + var pointerId: Number? + get() = definedExternally + set(value) = definedExternally + var pointerType: String? + get() = definedExternally + set(value) = definedExternally + var pressure: Number? + get() = definedExternally + set(value) = definedExternally + var tangentialPressure: Number? + get() = definedExternally + set(value) = definedExternally + var tiltX: Number? + get() = definedExternally + set(value) = definedExternally + var tiltY: Number? + get() = definedExternally + set(value) = definedExternally + var twist: Number? + get() = definedExternally + set(value) = definedExternally + var width: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface PositionOptions { + var enableHighAccuracy: Boolean? + get() = definedExternally + set(value) = definedExternally + var maximumAge: Number? + get() = definedExternally + set(value) = definedExternally + var timeout: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface PostMessageOptions { + var transfer: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface PropertyIndexedKeyframes { + var composite: dynamic /* "accumulate" | "add" | "auto" | "replace" | Array? */ + get() = definedExternally + set(value) = definedExternally + var easing: dynamic /* String? | Array? */ + get() = definedExternally + set(value) = definedExternally + var offset: dynamic /* Number? | Array? */ + get() = definedExternally + set(value) = definedExternally + @nativeGetter + operator fun get(property: String): dynamic /* String? | Array? | Number? | Array? */ + @nativeSetter + operator fun set(property: String, value: String?) + @nativeSetter + operator fun set(property: String, value: Array?) + @nativeSetter + operator fun set(property: String, value: Number?) + @nativeSetter + operator fun set(property: String, value: Array?) +} + +external interface PublicKeyCredentialCreationOptions { + var attestation: String? /* "direct" | "indirect" | "none" */ + get() = definedExternally + set(value) = definedExternally + var authenticatorSelection: AuthenticatorSelectionCriteria? + get() = definedExternally + set(value) = definedExternally + var challenge: dynamic /* ArrayBufferView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally + var excludeCredentials: Array? + get() = definedExternally + set(value) = definedExternally + var extensions: AuthenticationExtensionsClientInputs? + get() = definedExternally + set(value) = definedExternally + var pubKeyCredParams: Array + var rp: PublicKeyCredentialRpEntity + var timeout: Number? + get() = definedExternally + set(value) = definedExternally + var user: PublicKeyCredentialUserEntity +} + +external interface PublicKeyCredentialDescriptor { + var id: dynamic /* ArrayBufferView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally + var transports: Array? + get() = definedExternally + set(value) = definedExternally + var type: String /* "public-key" */ +} + +external interface PublicKeyCredentialEntity { + var icon: String? + get() = definedExternally + set(value) = definedExternally + var name: String +} + +external interface PublicKeyCredentialParameters { + var alg: COSEAlgorithmIdentifier + var type: String /* "public-key" */ +} + +external interface PublicKeyCredentialRequestOptions { + var allowCredentials: Array? + get() = definedExternally + set(value) = definedExternally + var challenge: dynamic /* ArrayBufferView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally + var extensions: AuthenticationExtensionsClientInputs? + get() = definedExternally + set(value) = definedExternally + var rpId: String? + get() = definedExternally + set(value) = definedExternally + var timeout: Number? + get() = definedExternally + set(value) = definedExternally + var userVerification: String? /* "discouraged" | "preferred" | "required" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface PublicKeyCredentialRpEntity : PublicKeyCredentialEntity { + var id: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface PublicKeyCredentialUserEntity : PublicKeyCredentialEntity { + var displayName: String + var id: dynamic /* ArrayBufferView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally +} + +external interface PushPermissionDescriptor : PermissionDescriptor { + override var name: String /* "push" */ + var userVisibleOnly: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface PushSubscriptionJSON { + var endpoint: String? + get() = definedExternally + set(value) = definedExternally + var expirationTime: Number? + get() = definedExternally + set(value) = definedExternally + var keys: Record? + get() = definedExternally + set(value) = definedExternally +} + +external interface PushSubscriptionOptionsInit { + var applicationServerKey: dynamic /* ArrayBufferView? | ArrayBuffer? | String? */ + get() = definedExternally + set(value) = definedExternally + var userVisibleOnly: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface QueuingStrategy { + var highWaterMark: Number? + get() = definedExternally + set(value) = definedExternally + var size: QueuingStrategySizeCallback? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCDTMFToneChangeEventInit : EventInit { + var tone: String +} + +external interface RTCDataChannelEventInit : EventInit { + var channel: RTCDataChannel +} + +external interface RTCErrorEventInit : EventInit { + var error: RTCError +} + +external interface RTCErrorInit { + var errorDetail: String /* "data-channel-failure" | "dtls-failure" | "fingerprint-failure" | "hardware-encoder-error" | "hardware-encoder-not-available" | "idp-bad-script-failure" | "idp-execution-failure" | "idp-load-failure" | "idp-need-login" | "idp-timeout" | "idp-tls-failure" | "idp-token-expired" | "idp-token-invalid" | "sctp-failure" | "sdp-syntax-error" */ + var httpRequestStatusCode: Number? + get() = definedExternally + set(value) = definedExternally + var receivedAlert: Number? + get() = definedExternally + set(value) = definedExternally + var sctpCauseCode: Number? + get() = definedExternally + set(value) = definedExternally + var sdpLineNumber: Number? + get() = definedExternally + set(value) = definedExternally + var sentAlert: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCIceCandidateComplete + +external interface RTCIceCandidateDictionary { + var foundation: String? + get() = definedExternally + set(value) = definedExternally + var ip: String? + get() = definedExternally + set(value) = definedExternally + var msMTurnSessionId: String? + get() = definedExternally + set(value) = definedExternally + var port: Number? + get() = definedExternally + set(value) = definedExternally + var priority: Number? + get() = definedExternally + set(value) = definedExternally + var protocol: String? /* "tcp" | "udp" */ + get() = definedExternally + set(value) = definedExternally + var relatedAddress: String? + get() = definedExternally + set(value) = definedExternally + var relatedPort: Number? + get() = definedExternally + set(value) = definedExternally + var tcpType: String? /* "active" | "passive" | "so" */ + get() = definedExternally + set(value) = definedExternally + var type: String? /* "host" | "prflx" | "relay" | "srflx" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCIceCandidateInit { + var candidate: String? + get() = definedExternally + set(value) = definedExternally + var sdpMLineIndex: Number? + get() = definedExternally + set(value) = definedExternally + var sdpMid: String? + get() = definedExternally + set(value) = definedExternally + var usernameFragment: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCIceCandidatePair { + var local: RTCIceCandidate? + get() = definedExternally + set(value) = definedExternally + var remote: RTCIceCandidate? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCIceParameters { + var password: String? + get() = definedExternally + set(value) = definedExternally + var usernameFragment: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCPeerConnectionIceErrorEventInit : EventInit { + var errorCode: Number + var hostCandidate: String? + get() = definedExternally + set(value) = definedExternally + var statusText: String? + get() = definedExternally + set(value) = definedExternally + var url: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCPeerConnectionIceEventInit : EventInit { + var candidate: RTCIceCandidate? + get() = definedExternally + set(value) = definedExternally + var url: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtcpParameters { + var cname: String? + get() = definedExternally + set(value) = definedExternally + var reducedSize: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpCapabilities { + var codecs: Array + var headerExtensions: Array +} + +external interface RTCRtpCodecCapability { + var channels: Number? + get() = definedExternally + set(value) = definedExternally + var clockRate: Number + var mimeType: String + var sdpFmtpLine: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpCodecParameters { + var channels: Number? + get() = definedExternally + set(value) = definedExternally + var clockRate: Number + var mimeType: String + var payloadType: Number + var sdpFmtpLine: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpCodingParameters { + var rid: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpContributingSource { + var audioLevel: Number? + get() = definedExternally + set(value) = definedExternally + var rtpTimestamp: Number + var source: Number + var timestamp: Number +} + +external interface RTCRtpDecodingParameters : RTCRtpCodingParameters + +external interface RTCRtpEncodingParameters : RTCRtpCodingParameters { + var active: Boolean? + get() = definedExternally + set(value) = definedExternally + var codecPayloadType: Number? + get() = definedExternally + set(value) = definedExternally + var dtx: String? /* "disabled" | "enabled" */ + get() = definedExternally + set(value) = definedExternally + var maxBitrate: Number? + get() = definedExternally + set(value) = definedExternally + var maxFramerate: Number? + get() = definedExternally + set(value) = definedExternally + var ptime: Number? + get() = definedExternally + set(value) = definedExternally + var scaleResolutionDownBy: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpHeaderExtensionCapability { + var uri: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCRtpHeaderExtensionParameters { + var encrypted: Boolean? + get() = definedExternally + set(value) = definedExternally + var id: Number + var uri: String +} + +external interface RTCRtpParameters { + var codecs: Array + var headerExtensions: Array + var rtcp: RTCRtcpParameters +} + +external interface RTCRtpReceiveParameters : RTCRtpParameters { + var encodings: Array +} + +external interface RTCRtpSendParameters : RTCRtpParameters { + var degradationPreference: String? /* "balanced" | "maintain-framerate" | "maintain-resolution" */ + get() = definedExternally + set(value) = definedExternally + var encodings: Array + var priority: String? /* "high" | "low" | "medium" | "very-low" */ + get() = definedExternally + set(value) = definedExternally + var transactionId: String +} + +external interface RTCRtpSynchronizationSource : RTCRtpContributingSource { + var voiceActivityFlag: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCStatsReport : ReadonlyMap { + fun forEach(callbackfn: (value: Any, key: String, parent: RTCStatsReport) -> Unit, thisArg: Any = definedExternally) +} + +external interface ReadableStreamReadDoneResult { + var done: Boolean + var value: T? + get() = definedExternally + set(value) = definedExternally +} + +external interface ReadableStreamReadValueResult { + var done: Boolean + var value: T +} + +external interface RsaHashedImportParams : Algorithm { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally +} + +external interface RsaHashedKeyGenParams : RsaKeyGenParams { + var hash: dynamic /* typealias HashAlgorithmIdentifier = dynamic */ + get() = definedExternally + set(value) = definedExternally +} + +external interface RsaKeyGenParams : Algorithm { + var modulusLength: Number + var publicExponent: BigInteger +} + +external interface RsaOaepParams : Algorithm { + var label: dynamic /* Int8Array? | Int16Array? | Int32Array? | Uint8Array? | Uint16Array? | Uint32Array? | Uint8ClampedArray? | Float32Array? | Float64Array? | DataView? | ArrayBuffer? */ + get() = definedExternally + set(value) = definedExternally +} + +external interface RsaOtherPrimesInfo { + var d: String? + get() = definedExternally + set(value) = definedExternally + var r: String? + get() = definedExternally + set(value) = definedExternally + var t: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface RsaPssParams : Algorithm { + var saltLength: Number +} + +external interface SecurityPolicyViolationEventInit : EventInit { + var blockedURI: String? + get() = definedExternally + set(value) = definedExternally + var columnNumber: Number? + get() = definedExternally + set(value) = definedExternally + var documentURI: String? + get() = definedExternally + set(value) = definedExternally + var effectiveDirective: String? + get() = definedExternally + set(value) = definedExternally + var lineNumber: Number? + get() = definedExternally + set(value) = definedExternally + var originalPolicy: String? + get() = definedExternally + set(value) = definedExternally + var referrer: String? + get() = definedExternally + set(value) = definedExternally + var sourceFile: String? + get() = definedExternally + set(value) = definedExternally + var statusCode: Number? + get() = definedExternally + set(value) = definedExternally + var violatedDirective: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface ShareData { + var text: String? + get() = definedExternally + set(value) = definedExternally + var title: String? + get() = definedExternally + set(value) = definedExternally + var url: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface SpeechSynthesisErrorEventInit : SpeechSynthesisEventInit { + var error: String /* "audio-busy" | "audio-hardware" | "canceled" | "interrupted" | "invalid-argument" | "language-unavailable" | "network" | "not-allowed" | "synthesis-failed" | "synthesis-unavailable" | "text-too-long" | "voice-unavailable" */ +} + +external interface SpeechSynthesisEventInit : EventInit { + var charIndex: Number? + get() = definedExternally + set(value) = definedExternally + var charLength: Number? + get() = definedExternally + set(value) = definedExternally + var elapsedTime: Number? + get() = definedExternally + set(value) = definedExternally + var name: String? + get() = definedExternally + set(value) = definedExternally + var utterance: SpeechSynthesisUtterance +} + +external interface StorageEstimate { + var quota: Number? + get() = definedExternally + set(value) = definedExternally + var usage: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface StoreExceptionsInformation : ExceptionInformation { + var detailURI: String? + get() = definedExternally + set(value) = definedExternally + var explanationString: String? + get() = definedExternally + set(value) = definedExternally + var siteName: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface StoreSiteSpecificExceptionsInformation : StoreExceptionsInformation { + var arrayOfDomainStrings: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface TouchEventInit : EventModifierInit { + var changedTouches: Array? + get() = definedExternally + set(value) = definedExternally + var targetTouches: Array? + get() = definedExternally + set(value) = definedExternally + var touches: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface TouchInit { + var altitudeAngle: Number? + get() = definedExternally + set(value) = definedExternally + var azimuthAngle: Number? + get() = definedExternally + set(value) = definedExternally + var clientX: Number? + get() = definedExternally + set(value) = definedExternally + var clientY: Number? + get() = definedExternally + set(value) = definedExternally + var force: Number? + get() = definedExternally + set(value) = definedExternally + var identifier: Number + var pageX: Number? + get() = definedExternally + set(value) = definedExternally + var pageY: Number? + get() = definedExternally + set(value) = definedExternally + var radiusX: Number? + get() = definedExternally + set(value) = definedExternally + var radiusY: Number? + get() = definedExternally + set(value) = definedExternally + var rotationAngle: Number? + get() = definedExternally + set(value) = definedExternally + var screenX: Number? + get() = definedExternally + set(value) = definedExternally + var screenY: Number? + get() = definedExternally + set(value) = definedExternally + var target: EventTarget + var touchType: String? /* "direct" | "stylus" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface TransitionEventInit : EventInit { + var elapsedTime: Number? + get() = definedExternally + set(value) = definedExternally + var propertyName: String? + get() = definedExternally + set(value) = definedExternally + var pseudoElement: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface ULongRange { + var max: Number? + get() = definedExternally + set(value) = definedExternally + var min: Number? + get() = definedExternally + set(value) = definedExternally +} + + +external interface VRLayer { + var leftBounds: dynamic /* Array? | Float32Array? */ + get() = definedExternally + set(value) = definedExternally + var rightBounds: dynamic /* Array? | Float32Array? */ + get() = definedExternally + set(value) = definedExternally + var source: HTMLCanvasElement? + get() = definedExternally + set(value) = definedExternally +} + +external interface VRStageParameters { + var sittingToStandingTransform: Float32Array? + get() = definedExternally + set(value) = definedExternally + var sizeX: Number? + get() = definedExternally + set(value) = definedExternally + var sizeY: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface txAuthGenericArg { + var content: ArrayBuffer + var contentType: String +} + +external interface `T$2` { + fun lookupNamespaceURI(prefix: String?): String? +} + +external interface ANGLE_instanced_arrays { + fun drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei) + fun drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei) + fun vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint) + var VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum +} + +external interface AbortSignalEventMap { + var abort: Event +} + +external interface AbortSignal : EventTarget { + var aborted: Boolean + var onabort: ((self: AbortSignal, ev: Event) -> Any)? + fun addEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: AbortSignal, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface AbstractRange { + var collapsed: Boolean + var endContainer: Node + var endOffset: Number + var startContainer: Node + var startOffset: Number +} + +external interface AbstractWorkerEventMap { + var error: ErrorEvent +} + +external interface AesCfbParams : Algorithm { + var iv: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally +} + +external interface AesCmacParams : Algorithm { + var length: Number +} + +external interface Animatable { + fun animate(keyframes: Array?, options: Number = definedExternally): Animation + fun animate(keyframes: Array?): Animation + fun animate(keyframes: Array?, options: KeyframeAnimationOptions = definedExternally): Animation + fun animate(keyframes: PropertyIndexedKeyframes?, options: Number = definedExternally): Animation + fun animate(keyframes: PropertyIndexedKeyframes?): Animation + fun animate(keyframes: PropertyIndexedKeyframes?, options: KeyframeAnimationOptions = definedExternally): Animation + fun getAnimations(): Array +} + +external interface AnimationEventMap { + var cancel: AnimationPlaybackEvent + var finish: AnimationPlaybackEvent +} + +external interface Animation : EventTarget { + var currentTime: Number? + var effect: AnimationEffect? + var finished: Promise + var id: String + var oncancel: ((self: Animation, ev: AnimationPlaybackEvent) -> Any)? + var onfinish: ((self: Animation, ev: AnimationPlaybackEvent) -> Any)? + var pending: Boolean + var playState: String /* "finished" | "idle" | "paused" | "running" */ + var playbackRate: Number + var ready: Promise + var startTime: Number? + var timeline: AnimationTimeline? + fun cancel() + fun finish() + fun pause() + fun play() + fun reverse() + fun updatePlaybackRate(playbackRate: Number) + fun addEventListener(type: K, listener: (self: Animation, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: Animation, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: Animation, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: Animation, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: Animation, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: Animation, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface AnimationEffect { + fun getComputedTiming(): ComputedEffectTiming + fun getTiming(): EffectTiming + fun updateTiming(timing: OptionalEffectTiming = definedExternally) +} + +external interface AnimationEvent : Event { + var animationName: String + var elapsedTime: Number + var pseudoElement: String +} + +external interface AnimationFrameProvider { + fun cancelAnimationFrame(handle: Number) + fun requestAnimationFrame(callback: FrameRequestCallback): Number +} + +external interface AnimationPlaybackEvent : Event { + var currentTime: Number? + var timelineTime: Number? +} + +external interface AnimationTimeline { + var currentTime: Number? +} + +external interface ApplicationCacheEventMap { + var cached: Event + var checking: Event + var downloading: Event + var error: Event + var noupdate: Event + var obsolete: Event + var progress: ProgressEvent + var updateready: Event +} + +external interface AudioBuffer { + var duration: Number + var length: Number + var numberOfChannels: Number + var sampleRate: Number + fun copyFromChannel(destination: Float32Array, channelNumber: Number, bufferOffset: Number = definedExternally) + fun copyToChannel(source: Float32Array, channelNumber: Number, bufferOffset: Number = definedExternally) + fun getChannelData(channel: Number): Float32Array +} + +external interface AudioProcessingEvent : Event { + var inputBuffer: AudioBuffer + var outputBuffer: AudioBuffer + var playbackTime: Number +} + +external interface CSSRule { + var cssText: String + var parentRule: CSSRule? + var parentStyleSheet: CSSStyleSheet? + var type: Number + var CHARSET_RULE: Number + var FONT_FACE_RULE: Number + var IMPORT_RULE: Number + var KEYFRAMES_RULE: Number + var KEYFRAME_RULE: Number + var MEDIA_RULE: Number + var NAMESPACE_RULE: Number + var PAGE_RULE: Number + var STYLE_RULE: Number + var SUPPORTS_RULE: Number +} + +external interface CSSRuleList { + var length: Number + fun item(index: Number): CSSRule? + @nativeGetter + operator fun get(index: Number): CSSRule? + @nativeSetter + operator fun set(index: Number, value: CSSRule) +} + +external interface CSSStyleDeclaration { + var alignContent: String + var alignItems: String + var alignSelf: String + var alignmentBaseline: String + var all: String + var animation: String + var animationDelay: String + var animationDirection: String + var animationDuration: String + var animationFillMode: String + var animationIterationCount: String + var animationName: String + var animationPlayState: String + var animationTimingFunction: String + var backfaceVisibility: String + var background: String + var backgroundAttachment: String + var backgroundClip: String + var backgroundColor: String + var backgroundImage: String + var backgroundOrigin: String + var backgroundPosition: String + var backgroundPositionX: String + var backgroundPositionY: String + var backgroundRepeat: String + var backgroundSize: String + var baselineShift: String + var blockSize: String + var border: String + var borderBlockEnd: String + var borderBlockEndColor: String + var borderBlockEndStyle: String + var borderBlockEndWidth: String + var borderBlockStart: String + var borderBlockStartColor: String + var borderBlockStartStyle: String + var borderBlockStartWidth: String + var borderBottom: String + var borderBottomColor: String + var borderBottomLeftRadius: String + var borderBottomRightRadius: String + var borderBottomStyle: String + var borderBottomWidth: String + var borderCollapse: String + var borderColor: String + var borderImage: String + var borderImageOutset: String + var borderImageRepeat: String + var borderImageSlice: String + var borderImageSource: String + var borderImageWidth: String + var borderInlineEnd: String + var borderInlineEndColor: String + var borderInlineEndStyle: String + var borderInlineEndWidth: String + var borderInlineStart: String + var borderInlineStartColor: String + var borderInlineStartStyle: String + var borderInlineStartWidth: String + var borderLeft: String + var borderLeftColor: String + var borderLeftStyle: String + var borderLeftWidth: String + var borderRadius: String + var borderRight: String + var borderRightColor: String + var borderRightStyle: String + var borderRightWidth: String + var borderSpacing: String + var borderStyle: String + var borderTop: String + var borderTopColor: String + var borderTopLeftRadius: String + var borderTopRightRadius: String + var borderTopStyle: String + var borderTopWidth: String + var borderWidth: String + var bottom: String + var boxShadow: String + var boxSizing: String + var breakAfter: String + var breakBefore: String + var breakInside: String + var captionSide: String + var caretColor: String + var clear: String + var clip: String + var clipPath: String + var clipRule: String + var color: String + var colorInterpolation: String + var colorInterpolationFilters: String + var columnCount: String + var columnFill: String + var columnGap: String + var columnRule: String + var columnRuleColor: String + var columnRuleStyle: String + var columnRuleWidth: String + var columnSpan: String + var columnWidth: String + var columns: String + var content: String + var counterIncrement: String + var counterReset: String + var cssFloat: String + var cssText: String + var cursor: String + var direction: String + var display: String + var dominantBaseline: String + var emptyCells: String + var fill: String + var fillOpacity: String + var fillRule: String + var filter: String + var flex: String + var flexBasis: String + var flexDirection: String + var flexFlow: String + var flexGrow: String + var flexShrink: String + var flexWrap: String + var float: String + var floodColor: String + var floodOpacity: String + var font: String + var fontFamily: String + var fontFeatureSettings: String + var fontKerning: String + var fontSize: String + var fontSizeAdjust: String + var fontStretch: String + var fontStyle: String + var fontSynthesis: String + var fontVariant: String + var fontVariantCaps: String + var fontVariantEastAsian: String + var fontVariantLigatures: String + var fontVariantNumeric: String + var fontVariantPosition: String + var fontWeight: String + var gap: String + var glyphOrientationVertical: String + var grid: String + var gridArea: String + var gridAutoColumns: String + var gridAutoFlow: String + var gridAutoRows: String + var gridColumn: String + var gridColumnEnd: String + var gridColumnGap: String + var gridColumnStart: String + var gridGap: String + var gridRow: String + var gridRowEnd: String + var gridRowGap: String + var gridRowStart: String + var gridTemplate: String + var gridTemplateAreas: String + var gridTemplateColumns: String + var gridTemplateRows: String + var height: String + var hyphens: String + var imageOrientation: String + var imageRendering: String + var inlineSize: String + var justifyContent: String + var justifyItems: String + var justifySelf: String + var left: String + var length: Number + var letterSpacing: String + var lightingColor: String + var lineBreak: String + var lineHeight: String + var listStyle: String + var listStyleImage: String + var listStylePosition: String + var listStyleType: String + var margin: String + var marginBlockEnd: String + var marginBlockStart: String + var marginBottom: String + var marginInlineEnd: String + var marginInlineStart: String + var marginLeft: String + var marginRight: String + var marginTop: String + var marker: String + var markerEnd: String + var markerMid: String + var markerStart: String + var mask: String + var maskComposite: String + var maskImage: String + var maskPosition: String + var maskRepeat: String + var maskSize: String + var maskType: String + var maxBlockSize: String + var maxHeight: String + var maxInlineSize: String + var maxWidth: String + var minBlockSize: String + var minHeight: String + var minInlineSize: String + var minWidth: String + var objectFit: String + var objectPosition: String + var opacity: String + var order: String + var orphans: String + var outline: String + var outlineColor: String + var outlineOffset: String + var outlineStyle: String + var outlineWidth: String + var overflow: String + var overflowAnchor: String + var overflowWrap: String + var overflowX: String + var overflowY: String + var padding: String + var paddingBlockEnd: String + var paddingBlockStart: String + var paddingBottom: String + var paddingInlineEnd: String + var paddingInlineStart: String + var paddingLeft: String + var paddingRight: String + var paddingTop: String + var pageBreakAfter: String + var pageBreakBefore: String + var pageBreakInside: String + var paintOrder: String + var parentRule: CSSRule? + var perspective: String + var perspectiveOrigin: String + var placeContent: String + var placeItems: String + var placeSelf: String + var pointerEvents: String + var position: String + var quotes: String + var resize: String + var right: String + var rotate: String + var rowGap: String + var rubyAlign: String + var rubyPosition: String + var scale: String + var scrollBehavior: String + var shapeRendering: String + var stopColor: String + var stopOpacity: String + var stroke: String + var strokeDasharray: String + var strokeDashoffset: String + var strokeLinecap: String + var strokeLinejoin: String + var strokeMiterlimit: String + var strokeOpacity: String + var strokeWidth: String + var tabSize: String + var tableLayout: String + var textAlign: String + var textAlignLast: String + var textAnchor: String + var textCombineUpright: String + var textDecoration: String + var textDecorationColor: String + var textDecorationLine: String + var textDecorationStyle: String + var textEmphasis: String + var textEmphasisColor: String + var textEmphasisPosition: String + var textEmphasisStyle: String + var textIndent: String + var textJustify: String + var textOrientation: String + var textOverflow: String + var textRendering: String + var textShadow: String + var textTransform: String + var textUnderlinePosition: String + var top: String + var touchAction: String + var transform: String + var transformBox: String + var transformOrigin: String + var transformStyle: String + var transition: String + var transitionDelay: String + var transitionDuration: String + var transitionProperty: String + var transitionTimingFunction: String + var translate: String + var unicodeBidi: String + var userSelect: String + var verticalAlign: String + var visibility: String + var webkitAlignContent: String + var webkitAlignItems: String + var webkitAlignSelf: String + var webkitAnimation: String + var webkitAnimationDelay: String + var webkitAnimationDirection: String + var webkitAnimationDuration: String + var webkitAnimationFillMode: String + var webkitAnimationIterationCount: String + var webkitAnimationName: String + var webkitAnimationPlayState: String + var webkitAnimationTimingFunction: String + var webkitAppearance: String + var webkitBackfaceVisibility: String + var webkitBackgroundClip: String + var webkitBackgroundOrigin: String + var webkitBackgroundSize: String + var webkitBorderBottomLeftRadius: String + var webkitBorderBottomRightRadius: String + var webkitBorderRadius: String + var webkitBorderTopLeftRadius: String + var webkitBorderTopRightRadius: String + var webkitBoxAlign: String + var webkitBoxFlex: String + var webkitBoxOrdinalGroup: String + var webkitBoxOrient: String + var webkitBoxPack: String + var webkitBoxShadow: String + var webkitBoxSizing: String + var webkitFilter: String + var webkitFlex: String + var webkitFlexBasis: String + var webkitFlexDirection: String + var webkitFlexFlow: String + var webkitFlexGrow: String + var webkitFlexShrink: String + var webkitFlexWrap: String + var webkitJustifyContent: String + var webkitLineClamp: String + var webkitMask: String + var webkitMaskBoxImage: String + var webkitMaskBoxImageOutset: String + var webkitMaskBoxImageRepeat: String + var webkitMaskBoxImageSlice: String + var webkitMaskBoxImageSource: String + var webkitMaskBoxImageWidth: String + var webkitMaskClip: String + var webkitMaskComposite: String + var webkitMaskImage: String + var webkitMaskOrigin: String + var webkitMaskPosition: String + var webkitMaskRepeat: String + var webkitMaskSize: String + var webkitOrder: String + var webkitPerspective: String + var webkitPerspectiveOrigin: String + var webkitTapHighlightColor: String + var webkitTextFillColor: String + var webkitTextSizeAdjust: String + var webkitTextStroke: String + var webkitTextStrokeColor: String + var webkitTextStrokeWidth: String + var webkitTransform: String + var webkitTransformOrigin: String + var webkitTransformStyle: String + var webkitTransition: String + var webkitTransitionDelay: String + var webkitTransitionDuration: String + var webkitTransitionProperty: String + var webkitTransitionTimingFunction: String + var webkitUserSelect: String + var whiteSpace: String + var widows: String + var width: String + var willChange: String + var wordBreak: String + var wordSpacing: String + var wordWrap: String + var writingMode: String + var zIndex: String + var zoom: String + fun getPropertyPriority(property: String): String + fun getPropertyValue(property: String): String + fun item(index: Number): String + fun removeProperty(property: String): String + fun setProperty(property: String, value: String?, priority: String = definedExternally) + @nativeGetter + operator fun get(index: Number): String? + @nativeSetter + operator fun set(index: Number, value: String) +} + +external interface CSSStyleSheet : StyleSheet { + var cssRules: CSSRuleList + var ownerRule: CSSRule? + var rules: CSSRuleList + fun addRule(selector: String = definedExternally, style: String = definedExternally, index: Number = definedExternally): Number + fun deleteRule(index: Number) + fun insertRule(rule: String, index: Number = definedExternally): Number + fun removeRule(index: Number = definedExternally) +} + +external interface Clipboard : EventTarget { + fun readText(): Promise + fun writeText(data: String): Promise +} + +external interface ClipboardEvent : Event { + var clipboardData: DataTransfer? +} + +external interface ConcatParams : Algorithm { + var algorithmId: Uint8Array + var hash: dynamic /* String? | Algorithm? */ + get() = definedExternally + set(value) = definedExternally + var partyUInfo: Uint8Array + var partyVInfo: Uint8Array + var privateInfo: Uint8Array? + get() = definedExternally + set(value) = definedExternally + var publicInfo: Uint8Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface Coordinates { + var accuracy: Number + var altitude: Number? + var altitudeAccuracy: Number? + var heading: Number? + var latitude: Number + var longitude: Number + var speed: Number? +} + +external interface Credential { + var id: String + var type: String +} + +external interface CryptoKey { + var algorithm: KeyAlgorithm + var extractable: Boolean + var type: String /* "private" | "public" | "secret" */ + var usages: Array +} + +external interface CustomEvent__0 : CustomEvent + + + +external interface DOML2DeprecatedColorProperty { + var color: String +} + +typealias SVGMatrix = DOMMatrix + +typealias SVGPoint = DOMPoint + +typealias SVGRect = DOMRect + +external interface DOMStringList { + var length: Number + fun contains(string: String): Boolean + fun item(index: Number): String? + @nativeGetter + operator fun get(index: Number): String? + @nativeSetter + operator fun set(index: Number, value: String) +} + +external interface DeferredPermissionRequest { + var id: Number + var type: String /* "geolocation" | "media" | "pointerlock" | "unlimitedIndexedDBQuota" | "webnotifications" */ + var uri: String + fun allow() + fun deny() +} + +external interface DeviceLightEvent : Event { + var value: Number +} + +external interface DeviceMotionEvent : Event { + var acceleration: DeviceMotionEventAcceleration? + var accelerationIncludingGravity: DeviceMotionEventAcceleration? + var interval: Number + var rotationRate: DeviceMotionEventRotationRate? +} + +external interface DeviceMotionEventAcceleration { + var x: Number? + var y: Number? + var z: Number? +} + +external interface DeviceMotionEventRotationRate { + var alpha: Number? + var beta: Number? + var gamma: Number? +} + +external interface DeviceOrientationEvent : Event { + var absolute: Boolean + var alpha: Number? + var beta: Number? + var gamma: Number? +} + +external interface DocumentAndElementEventHandlersEventMap { + var copy: ClipboardEvent + var cut: ClipboardEvent + var paste: ClipboardEvent +} + +external interface DocumentEvent { + fun createEvent(eventInterface: String /* "AnimationEvent" | "AnimationPlaybackEvent" | "AudioProcessingEvent" | "BeforeUnloadEvent" | "ClipboardEvent" | "CloseEvent" | "CompositionEvent" | "CustomEvent" | "DeviceLightEvent" | "DeviceMotionEvent" | "DeviceOrientationEvent" | "DragEvent" | "ErrorEvent" | "Event" | "Events" | "FocusEvent" | "FocusNavigationEvent" | "GamepadEvent" | "HashChangeEvent" | "IDBVersionChangeEvent" | "InputEvent" | "KeyboardEvent" | "ListeningStateChangedEvent" | "MSGestureEvent" | "MSMediaKeyMessageEvent" | "MSMediaKeyNeededEvent" | "MSPointerEvent" | "MediaEncryptedEvent" | "MediaKeyMessageEvent" | "MediaQueryListEvent" | "MediaStreamErrorEvent" | "MediaStreamEvent" | "MediaStreamTrackEvent" | "MessageEvent" | "MouseEvent" | "MouseEvents" | "MutationEvent" | "MutationEvents" | "OfflineAudioCompletionEvent" | "OverflowEvent" | "PageTransitionEvent" | "PaymentRequestUpdateEvent" | "PermissionRequestedEvent" | "PointerEvent" | "PopStateEvent" | "ProgressEvent" | "PromiseRejectionEvent" | "RTCDTMFToneChangeEvent" | "RTCDataChannelEvent" | "RTCDtlsTransportStateChangedEvent" | "RTCErrorEvent" | "RTCIceCandidatePairChangedEvent" | "RTCIceGathererEvent" | "RTCIceTransportStateChangedEvent" | "RTCPeerConnectionIceErrorEvent" | "RTCPeerConnectionIceEvent" | "RTCSsrcConflictEvent" | "RTCStatsEvent" | "RTCTrackEvent" | "SVGZoomEvent" | "SVGZoomEvents" | "SecurityPolicyViolationEvent" | "ServiceWorkerMessageEvent" | "SpeechRecognitionEvent" | "SpeechSynthesisErrorEvent" | "SpeechSynthesisEvent" | "StorageEvent" | "TextEvent" | "TouchEvent" | "TrackEvent" | "TransitionEvent" | "UIEvent" | "UIEvents" | "VRDisplayEvent" | "VRDisplayEvent " | "WebGLContextEvent" | "WheelEvent" */): dynamic /* Event */ +} + +external interface DocumentTimeline : AnimationTimeline + +external interface EXT_blend_minmax { + var MAX_EXT: GLenum + var MIN_EXT: GLenum +} + +external interface EXT_frag_depth + +external interface EXT_sRGB { + var FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum + var SRGB8_ALPHA8_EXT: GLenum + var SRGB_ALPHA_EXT: GLenum + var SRGB_EXT: GLenum +} + +external interface EXT_shader_texture_lod + +external interface EXT_texture_filter_anisotropic { + var MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum + var TEXTURE_MAX_ANISOTROPY_EXT: GLenum +} + +external interface ElementEventMap { + var fullscreenchange: Event + var fullscreenerror: Event +} + +external interface ElementCSSInlineStyle { + var style: CSSStyleDeclaration +} + +external interface EventListenerObject { + fun handleEvent(evt: Event) +} + +external interface ExtensionScriptApis { + fun extensionIdToShortId(extensionId: String): Number + fun fireExtensionApiTelemetry(functionName: String, isSucceeded: Boolean, isSupported: Boolean, errorString: String) + fun genericFunction(routerAddress: Any, parameters: String = definedExternally, callbackId: Number = definedExternally) + fun genericSynchronousFunction(functionId: Number, parameters: String = definedExternally): String + fun genericWebRuntimeCallout(to: Any, from: Any, payload: String) + fun getExtensionId(): String + fun registerGenericFunctionCallbackHandler(callbackHandler: Function<*>) + fun registerGenericPersistentCallbackHandler(callbackHandler: Function<*>) + fun registerWebRuntimeCallbackHandler(handler: Function<*>): Any +} + +external interface FocusNavigationEvent : Event { + var navigationReason: String /* "down" | "left" | "right" | "up" */ + var originHeight: Number + var originLeft: Number + var originTop: Number + var originWidth: Number + fun requestFocus() +} + +external interface Gamepad { + var axes: Array + var buttons: Array + var connected: Boolean + var hand: String /* "" | "left" | "right" */ + var hapticActuators: Array + var id: String + var index: Number + var mapping: String /* "" | "standard" */ + var pose: GamepadPose? + var timestamp: Number +} + +external interface GamepadButton { + var pressed: Boolean + var touched: Boolean + var value: Number +} + +external interface GamepadEvent : Event { + var gamepad: Gamepad +} + +external interface GamepadHapticActuator { + var type: String /* "vibration" */ + fun pulse(value: Number, duration: Number): Promise +} + +external interface GamepadPose { + var angularAcceleration: Float32Array? + var angularVelocity: Float32Array? + var hasOrientation: Boolean + var hasPosition: Boolean + var linearAcceleration: Float32Array? + var linearVelocity: Float32Array? + var orientation: Float32Array? + var position: Float32Array? +} + +external interface Geolocation { + fun clearWatch(watchId: Number) + fun getCurrentPosition(successCallback: PositionCallback, errorCallback: PositionErrorCallback = definedExternally, options: PositionOptions = definedExternally) + fun watchPosition(successCallback: PositionCallback, errorCallback: PositionErrorCallback = definedExternally, options: PositionOptions = definedExternally): Number +} + +external interface GlobalEventHandlersEventMap { + var abort: UIEvent + var animationcancel: AnimationEvent + var animationend: AnimationEvent + var animationiteration: AnimationEvent + var animationstart: AnimationEvent + var auxclick: MouseEvent + var blur: FocusEvent + var cancel: Event + var canplay: Event + var canplaythrough: Event + var change: Event + var click: MouseEvent + var close: Event + var contextmenu: MouseEvent + var cuechange: Event + var dblclick: MouseEvent + var drag: DragEvent + var dragend: DragEvent + var dragenter: DragEvent + var dragexit: Event + var dragleave: DragEvent + var dragover: DragEvent + var dragstart: DragEvent + var drop: DragEvent + var durationchange: Event + var emptied: Event + var ended: Event + var error: ErrorEvent + var focus: FocusEvent + var focusin: FocusEvent + var focusout: FocusEvent + var gotpointercapture: PointerEvent + var input: Event + var invalid: Event + var keydown: KeyboardEvent + var keypress: KeyboardEvent + var keyup: KeyboardEvent + var load: Event + var loadeddata: Event + var loadedmetadata: Event + var loadstart: Event + var lostpointercapture: PointerEvent + var mousedown: MouseEvent + var mouseenter: MouseEvent + var mouseleave: MouseEvent + var mousemove: MouseEvent + var mouseout: MouseEvent + var mouseover: MouseEvent + var mouseup: MouseEvent + var pause: Event + var play: Event + var playing: Event + var pointercancel: PointerEvent + var pointerdown: PointerEvent + var pointerenter: PointerEvent + var pointerleave: PointerEvent + var pointermove: PointerEvent + var pointerout: PointerEvent + var pointerover: PointerEvent + var pointerup: PointerEvent + var progress: ProgressEvent__0 + var ratechange: Event + var reset: Event + var resize: UIEvent + var scroll: Event + var securitypolicyviolation: SecurityPolicyViolationEvent + var seeked: Event + var seeking: Event + var select: Event + var selectionchange: Event + var selectstart: Event + var stalled: Event + var submit: Event + var suspend: Event + var timeupdate: Event + var toggle: Event + var touchcancel: TouchEvent + var touchend: TouchEvent + var touchmove: TouchEvent + var touchstart: TouchEvent + var transitioncancel: TransitionEvent + var transitionend: TransitionEvent + var transitionrun: TransitionEvent + var transitionstart: TransitionEvent + var volumechange: Event + var waiting: Event + var wheel: WheelEvent +} + +external interface HTMLBaseFontElement : HTMLElement, DOML2DeprecatedColorProperty { + var face: String + var size: Number + fun addEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: HTMLBaseFontElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface HTMLCollectionBase { + var length: Number + fun item(index: Number): Element? + @nativeGetter + operator fun get(index: Number): Element? + @nativeSetter + operator fun set(index: Number, value: Element) +} + +external interface HTMLElementEventMap : ElementEventMap, GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap + +external interface HTMLOrSVGElement { + var autofocus: Boolean + var dataset: DOMStringMap + var nonce: String? + get() = definedExternally + set(value) = definedExternally + var tabIndex: Number + fun blur() + fun focus(options: FocusOptions = definedExternally) +} + +external interface HTMLTableDataCellElement : HTMLTableCellElement { + fun addEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: HTMLTableDataCellElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface HTMLTableHeaderCellElement : HTMLTableCellElement { + override var scope: String + fun addEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: HTMLTableHeaderCellElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface HkdfCtrParams : Algorithm { + var context: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally + var hash: dynamic /* String | Algorithm */ + get() = definedExternally + set(value) = definedExternally + var label: dynamic /* Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer */ + get() = definedExternally + set(value) = definedExternally +} + +typealias IDBArrayKey = Array + +external interface IDBCursor { + var direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ + var key: dynamic /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */ + get() = definedExternally + set(value) = definedExternally + var primaryKey: dynamic /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */ + get() = definedExternally + set(value) = definedExternally + var source: dynamic /* IDBObjectStore | IDBIndex */ + get() = definedExternally + set(value) = definedExternally + fun advance(count: Number) + fun `continue`(key: Number = definedExternally) + fun `continue`() + fun `continue`(key: String = definedExternally) + fun `continue`(key: Date = definedExternally) + fun `continue`(key: ArrayBufferView = definedExternally) + fun `continue`(key: ArrayBuffer = definedExternally) + fun `continue`(key: IDBArrayKey = definedExternally) + fun continuePrimaryKey(key: Number, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun continuePrimaryKey(key: String, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun continuePrimaryKey(key: Date, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun continuePrimaryKey(key: ArrayBufferView, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun continuePrimaryKey(key: ArrayBuffer, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun continuePrimaryKey(key: IDBArrayKey, primaryKey: Any /* Number | String | Date | ArrayBufferView | ArrayBuffer | IDBArrayKey */) + fun delete(): IDBRequest + fun update(value: Any): IDBRequest +} + +external interface IDBCursorWithValue : IDBCursor { + var value: Any +} + +external interface IDBDatabaseEventMap { + var abort: Event + var close: Event + var error: Event + var versionchange: IDBVersionChangeEvent +} + +external interface IDBDatabase : EventTarget { + var name: String + var objectStoreNames: DOMStringList + var onabort: ((self: IDBDatabase, ev: Event) -> Any)? + var onclose: ((self: IDBDatabase, ev: Event) -> Any)? + var onerror: ((self: IDBDatabase, ev: Event) -> Any)? + var onversionchange: ((self: IDBDatabase, ev: IDBVersionChangeEvent) -> Any)? + var version: Number + fun close() + fun createObjectStore(name: String, optionalParameters: IDBObjectStoreParameters = definedExternally): IDBObjectStore + fun deleteObjectStore(name: String) + fun transaction(storeNames: String, mode: String /* "readonly" | "readwrite" | "versionchange" */ = definedExternally): IDBTransaction + fun transaction(storeNames: String): IDBTransaction + fun transaction(storeNames: Array, mode: String /* "readonly" | "readwrite" | "versionchange" */ = definedExternally): IDBTransaction + fun transaction(storeNames: Array): IDBTransaction + fun addEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: IDBDatabase, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface IDBFactory { + fun cmp(first: Any, second: Any): Number + fun deleteDatabase(name: String): IDBOpenDBRequest + fun open(name: String, version: Number = definedExternally): IDBOpenDBRequest +} + +external interface IDBIndex { + var keyPath: dynamic /* String | Array */ + get() = definedExternally + set(value) = definedExternally + var multiEntry: Boolean + var name: String + var objectStore: IDBObjectStore + var unique: Boolean + fun count(key: Number = definedExternally): IDBRequest + fun count(): IDBRequest + fun count(key: String = definedExternally): IDBRequest + fun count(key: Date = definedExternally): IDBRequest + fun count(key: ArrayBufferView = definedExternally): IDBRequest + fun count(key: ArrayBuffer = definedExternally): IDBRequest + fun count(key: IDBArrayKey = definedExternally): IDBRequest + fun count(key: IDBKeyRange = definedExternally): IDBRequest + fun get(key: Number): IDBRequest + fun get(key: String): IDBRequest + fun get(key: Date): IDBRequest + fun get(key: ArrayBufferView): IDBRequest + fun get(key: ArrayBuffer): IDBRequest + fun get(key: IDBArrayKey): IDBRequest + fun get(key: IDBKeyRange): IDBRequest + fun getAll(query: Number? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(): IDBRequest> + fun getAll(query: Number? = definedExternally): IDBRequest> + fun getAll(query: String? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: String? = definedExternally): IDBRequest> + fun getAll(query: Date? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: Date? = definedExternally): IDBRequest> + fun getAll(query: ArrayBufferView? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: ArrayBufferView? = definedExternally): IDBRequest> + fun getAll(query: ArrayBuffer? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: ArrayBuffer? = definedExternally): IDBRequest> + fun getAll(query: IDBArrayKey? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: IDBArrayKey? = definedExternally): IDBRequest> + fun getAll(query: IDBKeyRange? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: IDBKeyRange? = definedExternally): IDBRequest> + fun getAllKeys(query: Number? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(): IDBRequest> + fun getAllKeys(query: Number? = definedExternally): IDBRequest> + fun getAllKeys(query: String? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: String? = definedExternally): IDBRequest> + fun getAllKeys(query: Date? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: Date? = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBufferView? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBufferView? = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBuffer? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBuffer? = definedExternally): IDBRequest> + fun getAllKeys(query: IDBArrayKey? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: IDBArrayKey? = definedExternally): IDBRequest> + fun getAllKeys(query: IDBKeyRange? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: IDBKeyRange? = definedExternally): IDBRequest> + fun getKey(key: Number): IDBRequest + fun getKey(key: String): IDBRequest + fun getKey(key: Date): IDBRequest + fun getKey(key: ArrayBufferView): IDBRequest + fun getKey(key: ArrayBuffer): IDBRequest + fun getKey(key: IDBArrayKey): IDBRequest + fun getKey(key: IDBKeyRange): IDBRequest + fun openCursor(query: Number? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(): IDBRequest + fun openCursor(query: Number? = definedExternally): IDBRequest + fun openCursor(query: String? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: String? = definedExternally): IDBRequest + fun openCursor(query: Date? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: Date? = definedExternally): IDBRequest + fun openCursor(query: ArrayBufferView? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: ArrayBufferView? = definedExternally): IDBRequest + fun openCursor(query: ArrayBuffer? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: ArrayBuffer? = definedExternally): IDBRequest + fun openCursor(query: IDBArrayKey? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: IDBArrayKey? = definedExternally): IDBRequest + fun openCursor(query: IDBKeyRange? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: IDBKeyRange? = definedExternally): IDBRequest + fun openKeyCursor(query: Number? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(): IDBRequest + fun openKeyCursor(query: Number? = definedExternally): IDBRequest + fun openKeyCursor(query: String? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: String? = definedExternally): IDBRequest + fun openKeyCursor(query: Date? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: Date? = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBufferView? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBufferView? = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBuffer? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBuffer? = definedExternally): IDBRequest + fun openKeyCursor(query: IDBArrayKey? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: IDBArrayKey? = definedExternally): IDBRequest + fun openKeyCursor(query: IDBKeyRange? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: IDBKeyRange? = definedExternally): IDBRequest +} + +external interface IDBKeyRange { + var lower: Any + var lowerOpen: Boolean + var upper: Any + var upperOpen: Boolean + fun includes(key: Any): Boolean +} + +external interface IDBObjectStore { + fun createIndex(name: String, keyPath: String, options: IDBIndexParameters = definedExternally): IDBIndex + fun createIndex(name: String, keyPath: String): IDBIndex + fun createIndex(name: String, keyPath: Iterable, options: IDBIndexParameters = definedExternally): IDBIndex + fun createIndex(name: String, keyPath: Iterable): IDBIndex + var autoIncrement: Boolean + var indexNames: DOMStringList + var keyPath: dynamic /* String | Array */ + get() = definedExternally + set(value) = definedExternally + var name: String + var transaction: IDBTransaction + fun add(value: Any, key: Number = definedExternally): IDBRequest + fun add(value: Any): IDBRequest + fun add(value: Any, key: String = definedExternally): IDBRequest + fun add(value: Any, key: Date = definedExternally): IDBRequest + fun add(value: Any, key: ArrayBufferView = definedExternally): IDBRequest + fun add(value: Any, key: ArrayBuffer = definedExternally): IDBRequest + fun add(value: Any, key: IDBArrayKey = definedExternally): IDBRequest + fun clear(): IDBRequest + fun count(key: Number = definedExternally): IDBRequest + fun count(): IDBRequest + fun count(key: String = definedExternally): IDBRequest + fun count(key: Date = definedExternally): IDBRequest + fun count(key: ArrayBufferView = definedExternally): IDBRequest + fun count(key: ArrayBuffer = definedExternally): IDBRequest + fun count(key: IDBArrayKey = definedExternally): IDBRequest + fun count(key: IDBKeyRange = definedExternally): IDBRequest + fun createIndex(name: String, keyPath: Array, options: IDBIndexParameters = definedExternally): IDBIndex + fun createIndex(name: String, keyPath: Array): IDBIndex + fun delete(key: Number): IDBRequest + fun delete(key: String): IDBRequest + fun delete(key: Date): IDBRequest + fun delete(key: ArrayBufferView): IDBRequest + fun delete(key: ArrayBuffer): IDBRequest + fun delete(key: IDBArrayKey): IDBRequest + fun delete(key: IDBKeyRange): IDBRequest + fun deleteIndex(name: String) + fun get(query: Number): IDBRequest + fun get(query: String): IDBRequest + fun get(query: Date): IDBRequest + fun get(query: ArrayBufferView): IDBRequest + fun get(query: ArrayBuffer): IDBRequest + fun get(query: IDBArrayKey): IDBRequest + fun get(query: IDBKeyRange): IDBRequest + fun getAll(query: Number? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(): IDBRequest> + fun getAll(query: Number? = definedExternally): IDBRequest> + fun getAll(query: String? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: String? = definedExternally): IDBRequest> + fun getAll(query: Date? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: Date? = definedExternally): IDBRequest> + fun getAll(query: ArrayBufferView? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: ArrayBufferView? = definedExternally): IDBRequest> + fun getAll(query: ArrayBuffer? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: ArrayBuffer? = definedExternally): IDBRequest> + fun getAll(query: IDBArrayKey? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: IDBArrayKey? = definedExternally): IDBRequest> + fun getAll(query: IDBKeyRange? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAll(query: IDBKeyRange? = definedExternally): IDBRequest> + fun getAllKeys(query: Number? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(): IDBRequest> + fun getAllKeys(query: Number? = definedExternally): IDBRequest> + fun getAllKeys(query: String? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: String? = definedExternally): IDBRequest> + fun getAllKeys(query: Date? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: Date? = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBufferView? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBufferView? = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBuffer? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: ArrayBuffer? = definedExternally): IDBRequest> + fun getAllKeys(query: IDBArrayKey? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: IDBArrayKey? = definedExternally): IDBRequest> + fun getAllKeys(query: IDBKeyRange? = definedExternally, count: Number = definedExternally): IDBRequest> + fun getAllKeys(query: IDBKeyRange? = definedExternally): IDBRequest> + fun getKey(query: Number): IDBRequest + fun getKey(query: String): IDBRequest + fun getKey(query: Date): IDBRequest + fun getKey(query: ArrayBufferView): IDBRequest + fun getKey(query: ArrayBuffer): IDBRequest + fun getKey(query: IDBArrayKey): IDBRequest + fun getKey(query: IDBKeyRange): IDBRequest + fun index(name: String): IDBIndex + fun openCursor(query: Number? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(): IDBRequest + fun openCursor(query: Number? = definedExternally): IDBRequest + fun openCursor(query: String? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: String? = definedExternally): IDBRequest + fun openCursor(query: Date? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: Date? = definedExternally): IDBRequest + fun openCursor(query: ArrayBufferView? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: ArrayBufferView? = definedExternally): IDBRequest + fun openCursor(query: ArrayBuffer? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: ArrayBuffer? = definedExternally): IDBRequest + fun openCursor(query: IDBArrayKey? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: IDBArrayKey? = definedExternally): IDBRequest + fun openCursor(query: IDBKeyRange? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openCursor(query: IDBKeyRange? = definedExternally): IDBRequest + fun openKeyCursor(query: Number? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(): IDBRequest + fun openKeyCursor(query: Number? = definedExternally): IDBRequest + fun openKeyCursor(query: String? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: String? = definedExternally): IDBRequest + fun openKeyCursor(query: Date? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: Date? = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBufferView? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBufferView? = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBuffer? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: ArrayBuffer? = definedExternally): IDBRequest + fun openKeyCursor(query: IDBArrayKey? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: IDBArrayKey? = definedExternally): IDBRequest + fun openKeyCursor(query: IDBKeyRange? = definedExternally, direction: String /* "next" | "nextunique" | "prev" | "prevunique" */ = definedExternally): IDBRequest + fun openKeyCursor(query: IDBKeyRange? = definedExternally): IDBRequest + fun put(value: Any, key: Number = definedExternally): IDBRequest + fun put(value: Any): IDBRequest + fun put(value: Any, key: String = definedExternally): IDBRequest + fun put(value: Any, key: Date = definedExternally): IDBRequest + fun put(value: Any, key: ArrayBufferView = definedExternally): IDBRequest + fun put(value: Any, key: ArrayBuffer = definedExternally): IDBRequest + fun put(value: Any, key: IDBArrayKey = definedExternally): IDBRequest +} + +external interface IDBOpenDBRequestEventMap : IDBRequestEventMap { + var blocked: Event + var upgradeneeded: IDBVersionChangeEvent +} + +external interface IDBOpenDBRequest : IDBRequest { + var onblocked: ((self: IDBOpenDBRequest, ev: Event) -> Any)? + var onupgradeneeded: ((self: IDBOpenDBRequest, ev: IDBVersionChangeEvent) -> Any)? + fun addEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: IDBOpenDBRequest, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface IDBRequestEventMap { + var error: Event + var success: Event +} + +external interface IDBRequest : EventTarget { + var error: DOMException? + var onerror: ((self: IDBRequest, ev: Event) -> Any)? + var onsuccess: ((self: IDBRequest, ev: Event) -> Any)? + var readyState: String /* "done" | "pending" */ + var result: T + var source: dynamic /* IDBObjectStore | IDBIndex | IDBCursor */ + get() = definedExternally + set(value) = definedExternally + var transaction: IDBTransaction? + fun addEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: IDBRequest, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface IDBTransactionEventMap { + var abort: Event + var complete: Event + var error: Event +} + +external interface IDBTransaction : EventTarget { + var db: IDBDatabase + var error: DOMException + var mode: String /* "readonly" | "readwrite" | "versionchange" */ + var objectStoreNames: DOMStringList + var onabort: ((self: IDBTransaction, ev: Event) -> Any)? + var oncomplete: ((self: IDBTransaction, ev: Event) -> Any)? + var onerror: ((self: IDBTransaction, ev: Event) -> Any)? + fun abort() + fun objectStore(name: String): IDBObjectStore + fun addEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: IDBTransaction, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface IDBVersionChangeEvent : Event { + var newVersion: Number? + var oldVersion: Number +} + +external interface InnerHTML { + var innerHTML: String +} + +external interface LinkStyle { + var sheet: CSSStyleSheet? +} + +external interface ListeningStateChangedEvent : Event { + var label: String + var state: String /* "active" | "disambiguation" | "inactive" */ +} + +external interface MSFileSaver { + fun msSaveBlob(blob: Any, defaultName: String = definedExternally): Boolean + fun msSaveOrOpenBlob(blob: Any, defaultName: String = definedExternally): Boolean +} + +external interface MSGestureEvent : UIEvent { + var clientX: Number + var clientY: Number + var expansion: Number + var gestureObject: Any + var hwTimestamp: Number + var offsetX: Number + var offsetY: Number + var rotation: Number + var scale: Number + var screenX: Number + var screenY: Number + var translationX: Number + var translationY: Number + var velocityAngular: Number + var velocityExpansion: Number + var velocityX: Number + var velocityY: Number + fun initGestureEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, viewArg: Window, detailArg: Number, screenXArg: Number, screenYArg: Number, clientXArg: Number, clientYArg: Number, offsetXArg: Number, offsetYArg: Number, translationXArg: Number, translationYArg: Number, scaleArg: Number, expansionArg: Number, rotationArg: Number, velocityXArg: Number, velocityYArg: Number, velocityExpansionArg: Number, velocityAngularArg: Number, hwTimestampArg: Number) + var MSGESTURE_FLAG_BEGIN: Number + var MSGESTURE_FLAG_CANCEL: Number + var MSGESTURE_FLAG_END: Number + var MSGESTURE_FLAG_INERTIA: Number + var MSGESTURE_FLAG_NONE: Number +} + +external interface MSMediaKeyMessageEvent : Event { + var destinationURL: String? + var message: Uint8Array +} + +external interface MSMediaKeyNeededEvent : Event { + var initData: Uint8Array? +} + +external interface MSNavigatorDoNotTrack { + fun confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): Boolean + fun confirmWebWideTrackingException(args: ExceptionInformation): Boolean + fun removeSiteSpecificTrackingException(args: ExceptionInformation) + fun removeWebWideTrackingException(args: ExceptionInformation) + fun storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation) + fun storeWebWideTrackingException(args: StoreExceptionsInformation) +} + +external interface MSPointerEvent : MouseEvent { + var currentPoint: Any + var height: Number + var hwTimestamp: Number + var intermediatePoints: Any + var isPrimary: Boolean + var pointerId: Number + var pointerType: Any + var pressure: Number + var rotation: Number + var tiltX: Number + var tiltY: Number + var width: Number + fun getCurrentPoint(element: Element) + fun getIntermediatePoints(element: Element) + fun initPointerEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, viewArg: Window, detailArg: Number, screenXArg: Number, screenYArg: Number, clientXArg: Number, clientYArg: Number, ctrlKeyArg: Boolean, altKeyArg: Boolean, shiftKeyArg: Boolean, metaKeyArg: Boolean, buttonArg: Number, relatedTargetArg: EventTarget, offsetXArg: Number, offsetYArg: Number, widthArg: Number, heightArg: Number, pressure: Number, rotation: Number, tiltX: Number, tiltY: Number, pointerIdArg: Number, pointerType: Any, hwTimestampArg: Number, isPrimary: Boolean) +} + +external interface MediaDeviceInfo { + var deviceId: String + var groupId: String + var kind: String /* "audioinput" | "audiooutput" | "videoinput" */ + var label: String + fun toJSON(): Any +} + +external interface MediaDevicesEventMap { + var devicechange: Event +} + +external interface MediaDevices : EventTarget { + var ondevicechange: ((self: MediaDevices, ev: Event) -> Any)? + fun enumerateDevices(): Promise> + fun getSupportedConstraints(): MediaTrackSupportedConstraints + fun getUserMedia(constraints: MediaStreamConstraints = definedExternally): Promise + fun addEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: MediaDevices, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface MediaEncryptedEvent : Event { + var initData: ArrayBuffer? + var initDataType: String +} + +external interface MediaKeyMessageEvent : Event { + var message: ArrayBuffer + var messageType: String /* "individualization-request" | "license-release" | "license-renewal" | "license-request" */ +} + +external interface MediaKeySessionEventMap { + var keystatuseschange: Event + var message: MediaKeyMessageEvent +} + +external interface MediaKeySession : EventTarget { + var closed: Promise + var expiration: Number + var keyStatuses: MediaKeyStatusMap + var onkeystatuseschange: ((self: MediaKeySession, ev: Event) -> Any)? + var onmessage: ((self: MediaKeySession, ev: MediaKeyMessageEvent) -> Any)? + var sessionId: String + fun close(): Promise + fun generateRequest(initDataType: String, initData: ArrayBufferView): Promise + fun generateRequest(initDataType: String, initData: ArrayBuffer): Promise + fun load(sessionId: String): Promise + fun remove(): Promise + fun update(response: ArrayBufferView): Promise + fun update(response: ArrayBuffer): Promise + fun addEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: MediaKeySession, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface MediaKeyStatusMap { + fun entries(): IterableIterator */> + fun keys(): IterableIterator + fun values(): IterableIterator + var size: Number + fun get(keyId: ArrayBufferView): String /* "expired" | "internal-error" | "output-downscaled" | "output-restricted" | "released" | "status-pending" | "usable" */ + fun get(keyId: ArrayBuffer): String /* "expired" | "internal-error" | "output-downscaled" | "output-restricted" | "released" | "status-pending" | "usable" */ + fun has(keyId: ArrayBufferView): Boolean + fun has(keyId: ArrayBuffer): Boolean + fun forEach(callbackfn: (value: String /* "expired" | "internal-error" | "output-downscaled" | "output-restricted" | "released" | "status-pending" | "usable" */, key: Any /* ArrayBufferView | ArrayBuffer */, parent: MediaKeyStatusMap) -> Unit, thisArg: Any = definedExternally) +} + +external interface MediaKeySystemAccess { + var keySystem: String + fun createMediaKeys(): Promise + fun getConfiguration(): MediaKeySystemConfiguration +} + +external interface MediaKeys { + fun createSession(sessionType: String /* "persistent-license" | "temporary" */ = definedExternally): MediaKeySession + fun setServerCertificate(serverCertificate: ArrayBufferView): Promise + fun setServerCertificate(serverCertificate: ArrayBuffer): Promise +} + +external interface MediaList { + var length: Number + var mediaText: String + override fun toString(): String + fun appendMedium(medium: String) + fun deleteMedium(medium: String) + fun item(index: Number): String? + @nativeGetter + operator fun get(index: Number): String? + @nativeSetter + operator fun set(index: Number, value: String) +} + +external interface MediaQueryListEventMap { + var change: MediaQueryListEvent +} + +external interface MediaSourceEventMap { + var sourceclose: Event + var sourceended: Event + var sourceopen: Event +} + +external interface MediaSource : EventTarget { + var activeSourceBuffers: SourceBufferList + var duration: Number + var onsourceclose: ((self: MediaSource, ev: Event) -> Any)? + var onsourceended: ((self: MediaSource, ev: Event) -> Any)? + var onsourceopen: ((self: MediaSource, ev: Event) -> Any)? + var readyState: String /* "closed" | "ended" | "open" */ + var sourceBuffers: SourceBufferList + fun addSourceBuffer(type: String): SourceBuffer + fun clearLiveSeekableRange() + fun endOfStream(error: String /* "decode" | "network" */ = definedExternally) + fun removeSourceBuffer(sourceBuffer: SourceBuffer) + fun setLiveSeekableRange(start: Number, end: Number) + fun addEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: MediaSource, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface MediaStreamEventMap { + var addtrack: MediaStreamTrackEvent + var removetrack: MediaStreamTrackEvent +} + +external interface MediaStream : EventTarget { + var active: Boolean + var id: String + var onaddtrack: ((self: MediaStream, ev: MediaStreamTrackEvent) -> Any)? + var onremovetrack: ((self: MediaStream, ev: MediaStreamTrackEvent) -> Any)? + fun addTrack(track: MediaStreamTrack) + fun clone(): MediaStream + fun getAudioTracks(): Array + fun getTrackById(trackId: String): MediaStreamTrack? + fun getTracks(): Array + fun getVideoTracks(): Array + fun removeTrack(track: MediaStreamTrack) + fun addEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: MediaStream, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface MediaStreamError { + var constraintName: String? + var message: String? + var name: String +} + +external interface MediaStreamErrorEvent : Event { + var error: MediaStreamError? +} + +external interface MediaStreamEvent : Event { + var stream: MediaStream? +} + +external interface MediaStreamTrackEventMap { + var ended: Event + var isolationchange: Event + var mute: Event + var unmute: Event +} + +external interface MediaStreamTrack : EventTarget { + var enabled: Boolean + var id: String + var isolated: Boolean + var kind: String + var label: String + var muted: Boolean + var onended: ((self: MediaStreamTrack, ev: Event) -> Any)? + var onisolationchange: ((self: MediaStreamTrack, ev: Event) -> Any)? + var onmute: ((self: MediaStreamTrack, ev: Event) -> Any)? + var onunmute: ((self: MediaStreamTrack, ev: Event) -> Any)? + var readyState: String /* "ended" | "live" */ + fun applyConstraints(constraints: MediaTrackConstraints = definedExternally): Promise + fun clone(): MediaStreamTrack + fun getCapabilities(): MediaTrackCapabilities + fun getConstraints(): MediaTrackConstraints + fun getSettings(): MediaTrackSettings + fun stop() + fun addEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: MediaStreamTrack, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface MediaStreamTrackEvent : Event { + var track: MediaStreamTrack +} + +external interface MessagePortEventMap { + var message: MessageEvent + var messageerror: MessageEvent +} + +external interface MutationEvent : Event { + var attrChange: Number + var attrName: String + var newValue: String + var prevValue: String + var relatedNode: Node + fun initMutationEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, relatedNodeArg: Node, prevValueArg: String, newValueArg: String, attrNameArg: String, attrChangeArg: Number) + var ADDITION: Number + var MODIFICATION: Number + var REMOVAL: Number +} + +external interface NavigationPreloadManager { + fun disable(): Promise + fun enable(): Promise + fun getState(): Promise + fun setHeaderValue(value: String): Promise +} + +external interface NavigatorAutomationInformation { + var webdriver: Boolean +} + +external interface NavigatorBeacon { + fun sendBeacon(url: String, data: Blob? = definedExternally): Boolean + fun sendBeacon(url: String): Boolean + fun sendBeacon(url: String, data: Int8Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Int16Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Int32Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Uint8Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Uint16Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Uint32Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Uint8ClampedArray? = definedExternally): Boolean + fun sendBeacon(url: String, data: Float32Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: Float64Array? = definedExternally): Boolean + fun sendBeacon(url: String, data: DataView? = definedExternally): Boolean + fun sendBeacon(url: String, data: ArrayBuffer? = definedExternally): Boolean + fun sendBeacon(url: String, data: FormData? = definedExternally): Boolean + fun sendBeacon(url: String, data: String? = definedExternally): Boolean +} + +external interface NavigatorStorage { + var storage: StorageManager +} + +external interface NodeListOf : NodeList { + fun entries(): IterableIterator */> + fun keys(): IterableIterator + fun values(): IterableIterator + fun item(index: Number): TNode + fun forEach(callbackfn: (value: TNode, key: Number, parent: NodeListOf) -> Unit, thisArg: Any = definedExternally) + @nativeGetter + operator fun get(index: Number): TNode? + @nativeSetter + operator fun set(index: Number, value: TNode) +} + +external interface NotificationEventMap { + var click: Event + var close: Event + var error: Event + var show: Event +} + +external interface OES_element_index_uint + +external interface OES_standard_derivatives { + var FRAGMENT_SHADER_DERIVATIVE_HINT_OES: GLenum +} + +external interface OES_texture_float + +external interface OES_texture_float_linear + +external interface OES_texture_half_float { + var HALF_FLOAT_OES: GLenum +} + +external interface OES_texture_half_float_linear + +external interface OES_vertex_array_object { + fun bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) + fun createVertexArrayOES(): WebGLVertexArrayObjectOES? + fun deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?) + fun isVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES?): GLboolean + var VERTEX_ARRAY_BINDING_OES: GLenum +} + +external interface OfflineAudioCompletionEvent : Event { + var renderedBuffer: AudioBuffer +} + +external interface OffscreenCanvas : EventTarget { + fun getContext(contextId: String /* "webgpu" | "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "2d" | "bitmaprenderer" | "webgl" | "webgl2" */): dynamic /* WebGL2RenderingContext | OffscreenCanvasRenderingContext2D? | ImageBitmapRenderingContext? | WebGLRenderingContext? | WebGL2RenderingContext? */ + var height: Number + var width: Number + fun convertToBlob(options: ImageEncodeOptions = definedExternally): Promise + fun getContext(contextId: String /* "2d" */, options: CanvasRenderingContext2DSettings = definedExternally): OffscreenCanvasRenderingContext2D? + fun getContext(contextId: String /* "bitmaprenderer" */, options: ImageBitmapRenderingContextSettings = definedExternally): ImageBitmapRenderingContext? + fun getContext(contextId: String /* "webgl" | "webgl2" */, options: WebGLContextAttributes = definedExternally): dynamic /* WebGLRenderingContext | WebGL2RenderingContext */ + fun getContext(contextId: String /* "2d" | "bitmaprenderer" | "webgl" | "webgl2" */, options: Any = definedExternally): dynamic /* OffscreenCanvasRenderingContext2D? | ImageBitmapRenderingContext? | WebGLRenderingContext? | WebGL2RenderingContext? */ + fun transferToImageBitmap(): ImageBitmap +} + +external interface OffscreenCanvasRenderingContext2D : CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform { + var canvas: OffscreenCanvas + fun commit() +} + +external interface OverflowEvent : UIEvent { + var horizontalOverflow: Boolean + var orient: Number + var verticalOverflow: Boolean + var BOTH: Number + var HORIZONTAL: Number + var VERTICAL: Number +} + +external interface PaymentRequestUpdateEvent : Event { + fun updateWith(detailsPromise: PaymentDetailsUpdate) + fun updateWith(detailsPromise: Promise) +} + +external interface PerformanceEventMap { + var resourcetimingbufferfull: Event +} + +external interface PerformanceEntry { + var duration: Number + var entryType: String + var name: String + var startTime: Number + fun toJSON(): Any +} + +external interface PermissionRequest : DeferredPermissionRequest { + var state: String /* "allow" | "defer" | "deny" | "unknown" */ + fun defer() +} + +external interface PermissionRequestedEvent : Event { + var permissionRequest: PermissionRequest +} + +external interface PermissionStatusEventMap { + var change: Event +} + +external interface PermissionStatus : EventTarget { + var onchange: ((self: PermissionStatus, ev: Event) -> Any)? + var state: String /* "denied" | "granted" | "prompt" */ + fun addEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: PermissionStatus, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface Permissions { + fun query(permissionDesc: PermissionDescriptor): Promise + fun query(permissionDesc: DevicePermissionDescriptor): Promise + fun query(permissionDesc: MidiPermissionDescriptor): Promise + fun query(permissionDesc: PushPermissionDescriptor): Promise +} + +external interface PointerEvent : MouseEvent { + var height: Number + var isPrimary: Boolean + var pointerId: Number + var pointerType: String + var pressure: Number + var tangentialPressure: Number + var tiltX: Number + var tiltY: Number + var twist: Number + var width: Number +} + +external interface Position { + var coords: Coordinates + var timestamp: Number +} + +external interface PositionError { + var code: Number + var message: String + var PERMISSION_DENIED: Number + var POSITION_UNAVAILABLE: Number + var TIMEOUT: Number +} + +external interface ProgressEvent__0 : ProgressEvent + +external interface PushManager { + fun getSubscription(): Promise + fun permissionState(options: PushSubscriptionOptionsInit = definedExternally): Promise + fun subscribe(options: PushSubscriptionOptionsInit = definedExternally): Promise +} + +external interface PushSubscription { + var endpoint: String + var expirationTime: Number? + var options: PushSubscriptionOptions + fun getKey(name: String /* "auth" | "p256dh" */): ArrayBuffer? + fun toJSON(): PushSubscriptionJSON + fun unsubscribe(): Promise +} + +external interface PushSubscriptionOptions { + var applicationServerKey: ArrayBuffer? + var userVisibleOnly: Boolean +} + +external interface RTCDTMFSenderEventMap { + var tonechange: RTCDTMFToneChangeEvent +} + +external interface RTCDTMFSender : EventTarget { + var canInsertDTMF: Boolean + var ontonechange: ((self: RTCDTMFSender, ev: RTCDTMFToneChangeEvent) -> Any)? + var toneBuffer: String + fun insertDTMF(tones: String, duration: Number = definedExternally, interToneGap: Number = definedExternally) + fun addEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: RTCDTMFSender, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface RTCDTMFToneChangeEvent : Event { + var tone: String +} + +external interface RTCDataChannelEventMap { + var bufferedamountlow: Event + var close: Event + var error: RTCErrorEvent + var message: MessageEvent + var open: Event +} + +external interface RTCDataChannel : EventTarget { + var binaryType: String + var bufferedAmount: Number + var bufferedAmountLowThreshold: Number + var id: Number? + var label: String + var maxPacketLifeTime: Number? + var maxRetransmits: Number? + var negotiated: Boolean + var onbufferedamountlow: ((self: RTCDataChannel, ev: Event) -> Any)? + var onclose: ((self: RTCDataChannel, ev: Event) -> Any)? + var onerror: ((self: RTCDataChannel, ev: RTCErrorEvent) -> Any)? + var onmessage: ((self: RTCDataChannel, ev: MessageEvent) -> Any)? + var onopen: ((self: RTCDataChannel, ev: Event) -> Any)? + var ordered: Boolean + var priority: String /* "high" | "low" | "medium" | "very-low" */ + var protocol: String + var readyState: String /* "closed" | "closing" | "connecting" | "open" */ + fun close() + fun send(data: String) + fun send(data: Blob) + fun send(data: ArrayBuffer) + fun send(data: ArrayBufferView) + fun addEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: RTCDataChannel, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface RTCDataChannelEvent : Event { + var channel: RTCDataChannel +} + +external interface RTCDtlsTransportEventMap { + var error: RTCErrorEvent + var statechange: Event +} + +external interface RTCDtlsTransport : EventTarget { + var iceTransport: RTCIceTransport + var onerror: ((self: RTCDtlsTransport, ev: RTCErrorEvent) -> Any)? + var onstatechange: ((self: RTCDtlsTransport, ev: Event) -> Any)? + var state: String /* "closed" | "connected" | "connecting" | "failed" | "new" */ + fun getRemoteCertificates(): Array + fun addEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: RTCDtlsTransport, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface RTCDtlsTransportStateChangedEvent : Event { + var state: String /* "closed" | "connected" | "connecting" | "failed" | "new" */ +} + +external interface RTCError : DOMException { + var errorDetail: String /* "data-channel-failure" | "dtls-failure" | "fingerprint-failure" | "hardware-encoder-error" | "hardware-encoder-not-available" | "idp-bad-script-failure" | "idp-execution-failure" | "idp-load-failure" | "idp-need-login" | "idp-timeout" | "idp-tls-failure" | "idp-token-expired" | "idp-token-invalid" | "sctp-failure" | "sdp-syntax-error" */ + var httpRequestStatusCode: Number? + var receivedAlert: Number? + var sctpCauseCode: Number? + var sdpLineNumber: Number? + var sentAlert: Number? +} + +external interface RTCErrorEvent : Event { + var error: RTCError +} + +external interface RTCIceCandidate { + var candidate: String + var component: String /* "rtcp" | "rtp" */ + var foundation: String? + var port: Number? + var priority: Number? + var protocol: String /* "tcp" | "udp" */ + var relatedAddress: String? + var relatedPort: Number? + var sdpMLineIndex: Number? + var sdpMid: String? + var tcpType: String /* "active" | "passive" | "so" */ + var type: String /* "host" | "prflx" | "relay" | "srflx" */ + var usernameFragment: String? + fun toJSON(): RTCIceCandidateInit +} + +external interface RTCIceCandidatePairChangedEvent : Event { + var pair: RTCIceCandidatePair +} + +external interface RTCIceGathererEvent : Event { + var candidate: dynamic /* RTCIceCandidateDictionary | RTCIceCandidateComplete */ + get() = definedExternally + set(value) = definedExternally +} + +external interface RTCIceTransportEventMap { + var gatheringstatechange: Event + var selectedcandidatepairchange: Event + var statechange: Event +} + +external interface RTCIceTransport : EventTarget { + var component: String /* "rtcp" | "rtp" */ + var gatheringState: String /* "complete" | "gathering" | "new" */ + var ongatheringstatechange: ((self: RTCIceTransport, ev: Event) -> Any)? + var onselectedcandidatepairchange: ((self: RTCIceTransport, ev: Event) -> Any)? + var onstatechange: ((self: RTCIceTransport, ev: Event) -> Any)? + var role: String /* "controlled" | "controlling" | "unknown" */ + var state: String /* "checking" | "closed" | "completed" | "connected" | "disconnected" | "failed" | "new" */ + fun getLocalCandidates(): Array + fun getLocalParameters(): RTCIceParameters? + fun getRemoteCandidates(): Array + fun getRemoteParameters(): RTCIceParameters? + fun getSelectedCandidatePair(): RTCIceCandidatePair? + fun addEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: RTCIceTransport, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface RTCIceTransportStateChangedEvent : Event { + var state: String /* "checking" | "closed" | "completed" | "connected" | "disconnected" | "failed" | "new" */ +} + +external interface RTCPeerConnectionIceErrorEvent : Event { + var errorCode: Number + var errorText: String + var hostCandidate: String + var url: String +} + +external interface RTCPeerConnectionIceEvent : Event { + var candidate: RTCIceCandidate? + var url: String? +} + +external interface RTCRtpReceiver { + var rtcpTransport: RTCDtlsTransport? + var track: MediaStreamTrack + var transport: RTCDtlsTransport? + fun getContributingSources(): Array + fun getParameters(): RTCRtpReceiveParameters + fun getStats(): Promise + fun getSynchronizationSources(): Array +} + +external interface RTCRtpSender { + var dtmf: RTCDTMFSender? + var rtcpTransport: RTCDtlsTransport? + var track: MediaStreamTrack? + var transport: RTCDtlsTransport? + fun getParameters(): RTCRtpSendParameters + fun getStats(): Promise + fun replaceTrack(withTrack: MediaStreamTrack?): Promise + fun setParameters(parameters: RTCRtpSendParameters): Promise + fun setStreams(vararg streams: MediaStream) +} + +external interface RTCRtpTransceiver { + fun setCodecPreferences(codecs: Iterable) + var currentDirection: String /* "inactive" | "recvonly" | "sendonly" | "sendrecv" | "stopped" */ + var direction: String /* "inactive" | "recvonly" | "sendonly" | "sendrecv" | "stopped" */ + var mid: String? + var receiver: RTCRtpReceiver + var sender: RTCRtpSender + fun setCodecPreferences(codecs: Array) + fun stop() +} + +external interface RTCSsrcConflictEvent : Event { + var ssrc: Number +} + +external interface RTCStatsEvent : Event { + var report: RTCStatsReport +} + +external interface RTCTrackEvent : Event { + var receiver: RTCRtpReceiver + var streams: Array + var track: MediaStreamTrack + var transceiver: RTCRtpTransceiver +} + +external interface ReadableByteStreamController { + var byobRequest: ReadableStreamBYOBRequest? + var desiredSize: Number? + fun close() + fun enqueue(chunk: ArrayBufferView) + fun error(error: Any = definedExternally) +} + +external interface `T$0` { + var mode: String /* "byob" */ +} + +external interface `T$1` { + var writable: WritableStream + var readable: ReadableStream +} + +external interface ReadableStream { + var locked: Boolean + fun cancel(reason: Any = definedExternally): Promise + fun getReader(options: `T$0`): ReadableStreamBYOBReader + fun getReader(): ReadableStreamDefaultReader + fun pipeThrough(__0: `T$1`, options: PipeOptions = definedExternally): ReadableStream + fun pipeTo(dest: WritableStream, options: PipeOptions = definedExternally): Promise + fun tee(): dynamic /* JsTuple, ReadableStream> */ +} + +external interface ReadableStream__0 : ReadableStream + +external interface ReadableStreamBYOBReader { + var closed: Promise + fun cancel(reason: Any = definedExternally): Promise + fun read(view: T): Promise | ReadableStreamReadDoneResult */> + fun releaseLock() +} + +external interface ReadableStreamBYOBRequest { + var view: ArrayBufferView + fun respond(bytesWritten: Number) + fun respondWithNewView(view: ArrayBufferView) +} + +external interface ReadableStreamDefaultController { + var desiredSize: Number? + fun close() + fun enqueue(chunk: R) + fun error(error: Any = definedExternally) +} + +external interface ReadableStreamDefaultReader { + var closed: Promise + fun cancel(reason: Any = definedExternally): Promise + fun read(): Promise | ReadableStreamReadDoneResult */> + fun releaseLock() +} + +external interface SVGClipPathElement : SVGElement { + var clipPathUnits: SVGAnimatedEnumeration + var transform: SVGAnimatedTransformList + fun addEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGClipPathElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGComponentTransferFunctionElement : SVGElement { + var amplitude: SVGAnimatedNumber + var exponent: SVGAnimatedNumber + var intercept: SVGAnimatedNumber + var offset: SVGAnimatedNumber + var slope: SVGAnimatedNumber + var tableValues: SVGAnimatedNumberList + var type: SVGAnimatedEnumeration + var SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: Number + var SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: Number + var SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: Number + var SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: Number + var SVG_FECOMPONENTTRANSFER_TYPE_TABLE: Number + var SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGComponentTransferFunctionElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGElementEventMap : ElementEventMap, GlobalEventHandlersEventMap, DocumentAndElementEventHandlersEventMap + +external interface SVGFEBlendElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var in2: SVGAnimatedString + var mode: SVGAnimatedEnumeration + var SVG_FEBLEND_MODE_COLOR: Number + var SVG_FEBLEND_MODE_COLOR_BURN: Number + var SVG_FEBLEND_MODE_COLOR_DODGE: Number + var SVG_FEBLEND_MODE_DARKEN: Number + var SVG_FEBLEND_MODE_DIFFERENCE: Number + var SVG_FEBLEND_MODE_EXCLUSION: Number + var SVG_FEBLEND_MODE_HARD_LIGHT: Number + var SVG_FEBLEND_MODE_HUE: Number + var SVG_FEBLEND_MODE_LIGHTEN: Number + var SVG_FEBLEND_MODE_LUMINOSITY: Number + var SVG_FEBLEND_MODE_MULTIPLY: Number + var SVG_FEBLEND_MODE_NORMAL: Number + var SVG_FEBLEND_MODE_OVERLAY: Number + var SVG_FEBLEND_MODE_SATURATION: Number + var SVG_FEBLEND_MODE_SCREEN: Number + var SVG_FEBLEND_MODE_SOFT_LIGHT: Number + var SVG_FEBLEND_MODE_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEBlendElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEColorMatrixElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var type: SVGAnimatedEnumeration + var values: SVGAnimatedNumberList + var SVG_FECOLORMATRIX_TYPE_HUEROTATE: Number + var SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: Number + var SVG_FECOLORMATRIX_TYPE_MATRIX: Number + var SVG_FECOLORMATRIX_TYPE_SATURATE: Number + var SVG_FECOLORMATRIX_TYPE_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEColorMatrixElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEComponentTransferElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + fun addEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEComponentTransferElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFECompositeElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var in2: SVGAnimatedString + var k1: SVGAnimatedNumber + var k2: SVGAnimatedNumber + var k3: SVGAnimatedNumber + var k4: SVGAnimatedNumber + var operator: SVGAnimatedEnumeration + var SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: Number + var SVG_FECOMPOSITE_OPERATOR_ATOP: Number + var SVG_FECOMPOSITE_OPERATOR_IN: Number + var SVG_FECOMPOSITE_OPERATOR_OUT: Number + var SVG_FECOMPOSITE_OPERATOR_OVER: Number + var SVG_FECOMPOSITE_OPERATOR_UNKNOWN: Number + var SVG_FECOMPOSITE_OPERATOR_XOR: Number + fun addEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFECompositeElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEConvolveMatrixElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var bias: SVGAnimatedNumber + var divisor: SVGAnimatedNumber + var edgeMode: SVGAnimatedEnumeration + var in1: SVGAnimatedString + var kernelMatrix: SVGAnimatedNumberList + var kernelUnitLengthX: SVGAnimatedNumber + var kernelUnitLengthY: SVGAnimatedNumber + var orderX: SVGAnimatedInteger + var orderY: SVGAnimatedInteger + var preserveAlpha: SVGAnimatedBoolean + var targetX: SVGAnimatedInteger + var targetY: SVGAnimatedInteger + var SVG_EDGEMODE_DUPLICATE: Number + var SVG_EDGEMODE_NONE: Number + var SVG_EDGEMODE_UNKNOWN: Number + var SVG_EDGEMODE_WRAP: Number + fun addEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEConvolveMatrixElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEDiffuseLightingElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var diffuseConstant: SVGAnimatedNumber + var in1: SVGAnimatedString + var kernelUnitLengthX: SVGAnimatedNumber + var kernelUnitLengthY: SVGAnimatedNumber + var surfaceScale: SVGAnimatedNumber + fun addEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEDiffuseLightingElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEDisplacementMapElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var in2: SVGAnimatedString + var scale: SVGAnimatedNumber + var xChannelSelector: SVGAnimatedEnumeration + var yChannelSelector: SVGAnimatedEnumeration + var SVG_CHANNEL_A: Number + var SVG_CHANNEL_B: Number + var SVG_CHANNEL_G: Number + var SVG_CHANNEL_R: Number + var SVG_CHANNEL_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEDisplacementMapElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEDistantLightElement : SVGElement { + var azimuth: SVGAnimatedNumber + var elevation: SVGAnimatedNumber + fun addEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEDistantLightElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEFloodElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + fun addEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEFloodElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEFuncAElement : SVGComponentTransferFunctionElement { + fun addEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEFuncAElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEFuncBElement : SVGComponentTransferFunctionElement { + fun addEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEFuncBElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEFuncGElement : SVGComponentTransferFunctionElement { + fun addEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEFuncGElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEFuncRElement : SVGComponentTransferFunctionElement { + fun addEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener, options: Boolean) + override fun addEventListener(type: String, listener: EventListener) + override fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + override fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun addEventListener(type: String, listener: EventListenerObject) + override fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEFuncRElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, listener: EventListener, options: Boolean) + override fun removeEventListener(type: String, listener: EventListener) + override fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + override fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + override fun removeEventListener(type: String, listener: EventListenerObject) + override fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEGaussianBlurElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var stdDeviationX: SVGAnimatedNumber + var stdDeviationY: SVGAnimatedNumber + fun setStdDeviation(stdDeviationX: Number, stdDeviationY: Number) + fun addEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEGaussianBlurElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEImageElement : SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference { + var preserveAspectRatio: SVGAnimatedPreserveAspectRatio + fun addEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEImageElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEMergeElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + fun addEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEMergeElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEMergeNodeElement : SVGElement { + var in1: SVGAnimatedString + fun addEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEMergeNodeElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEMorphologyElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var operator: SVGAnimatedEnumeration + var radiusX: SVGAnimatedNumber + var radiusY: SVGAnimatedNumber + var SVG_MORPHOLOGY_OPERATOR_DILATE: Number + var SVG_MORPHOLOGY_OPERATOR_ERODE: Number + var SVG_MORPHOLOGY_OPERATOR_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEMorphologyElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEOffsetElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var dx: SVGAnimatedNumber + var dy: SVGAnimatedNumber + var in1: SVGAnimatedString + fun addEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEOffsetElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFEPointLightElement : SVGElement { + var x: SVGAnimatedNumber + var y: SVGAnimatedNumber + var z: SVGAnimatedNumber + fun addEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFEPointLightElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFESpecularLightingElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + var kernelUnitLengthX: SVGAnimatedNumber + var kernelUnitLengthY: SVGAnimatedNumber + var specularConstant: SVGAnimatedNumber + var specularExponent: SVGAnimatedNumber + var surfaceScale: SVGAnimatedNumber + fun addEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFESpecularLightingElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFESpotLightElement : SVGElement { + var limitingConeAngle: SVGAnimatedNumber + var pointsAtX: SVGAnimatedNumber + var pointsAtY: SVGAnimatedNumber + var pointsAtZ: SVGAnimatedNumber + var specularExponent: SVGAnimatedNumber + var x: SVGAnimatedNumber + var y: SVGAnimatedNumber + var z: SVGAnimatedNumber + fun addEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFESpotLightElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFETileElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var in1: SVGAnimatedString + fun addEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFETileElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFETurbulenceElement : SVGElement, SVGFilterPrimitiveStandardAttributes { + var baseFrequencyX: SVGAnimatedNumber + var baseFrequencyY: SVGAnimatedNumber + var numOctaves: SVGAnimatedInteger + var seed: SVGAnimatedNumber + var stitchTiles: SVGAnimatedEnumeration + var type: SVGAnimatedEnumeration + var SVG_STITCHTYPE_NOSTITCH: Number + var SVG_STITCHTYPE_STITCH: Number + var SVG_STITCHTYPE_UNKNOWN: Number + var SVG_TURBULENCE_TYPE_FRACTALNOISE: Number + var SVG_TURBULENCE_TYPE_TURBULENCE: Number + var SVG_TURBULENCE_TYPE_UNKNOWN: Number + fun addEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFETurbulenceElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFilterElement : SVGElement, SVGURIReference { + var filterUnits: SVGAnimatedEnumeration + var height: SVGAnimatedLength + var primitiveUnits: SVGAnimatedEnumeration + var width: SVGAnimatedLength + var x: SVGAnimatedLength + var y: SVGAnimatedLength + fun addEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGFilterElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGFilterPrimitiveStandardAttributes { + var height: SVGAnimatedLength + var result: SVGAnimatedString + var width: SVGAnimatedLength + var x: SVGAnimatedLength + var y: SVGAnimatedLength +} + +external interface SVGMaskElement : SVGElement { + var height: SVGAnimatedLength + var maskContentUnits: SVGAnimatedEnumeration + var maskUnits: SVGAnimatedEnumeration + var width: SVGAnimatedLength + var x: SVGAnimatedLength + var y: SVGAnimatedLength + fun addEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SVGMaskElement, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions) +} + +external interface SVGPathSeg { + var pathSegType: Number + var pathSegTypeAsLetter: String + var PATHSEG_ARC_ABS: Number + var PATHSEG_ARC_REL: Number + var PATHSEG_CLOSEPATH: Number + var PATHSEG_CURVETO_CUBIC_ABS: Number + var PATHSEG_CURVETO_CUBIC_REL: Number + var PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: Number + var PATHSEG_CURVETO_CUBIC_SMOOTH_REL: Number + var PATHSEG_CURVETO_QUADRATIC_ABS: Number + var PATHSEG_CURVETO_QUADRATIC_REL: Number + var PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: Number + var PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: Number + var PATHSEG_LINETO_ABS: Number + var PATHSEG_LINETO_HORIZONTAL_ABS: Number + var PATHSEG_LINETO_HORIZONTAL_REL: Number + var PATHSEG_LINETO_REL: Number + var PATHSEG_LINETO_VERTICAL_ABS: Number + var PATHSEG_LINETO_VERTICAL_REL: Number + var PATHSEG_MOVETO_ABS: Number + var PATHSEG_MOVETO_REL: Number + var PATHSEG_UNKNOWN: Number +} + +external interface SVGPathSegArcAbs : SVGPathSeg { + var angle: Number + var largeArcFlag: Boolean + var r1: Number + var r2: Number + var sweepFlag: Boolean + var x: Number + var y: Number +} + +external interface SVGPathSegArcRel : SVGPathSeg { + var angle: Number + var largeArcFlag: Boolean + var r1: Number + var r2: Number + var sweepFlag: Boolean + var x: Number + var y: Number +} + +external interface SVGPathSegClosePath : SVGPathSeg + +external interface SVGPathSegCurvetoCubicAbs : SVGPathSeg { + var x: Number + var x1: Number + var x2: Number + var y: Number + var y1: Number + var y2: Number +} + +external interface SVGPathSegCurvetoCubicRel : SVGPathSeg { + var x: Number + var x1: Number + var x2: Number + var y: Number + var y1: Number + var y2: Number +} + +external interface SVGPathSegCurvetoCubicSmoothAbs : SVGPathSeg { + var x: Number + var x2: Number + var y: Number + var y2: Number +} + +external interface SVGPathSegCurvetoCubicSmoothRel : SVGPathSeg { + var x: Number + var x2: Number + var y: Number + var y2: Number +} + +external interface SVGPathSegCurvetoQuadraticAbs : SVGPathSeg { + var x: Number + var x1: Number + var y: Number + var y1: Number +} + +external interface SVGPathSegCurvetoQuadraticRel : SVGPathSeg { + var x: Number + var x1: Number + var y: Number + var y1: Number +} + +external interface SVGPathSegCurvetoQuadraticSmoothAbs : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGPathSegCurvetoQuadraticSmoothRel : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGPathSegLinetoAbs : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGPathSegLinetoHorizontalAbs : SVGPathSeg { + var x: Number +} + +external interface SVGPathSegLinetoHorizontalRel : SVGPathSeg { + var x: Number +} + +external interface SVGPathSegLinetoRel : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGPathSegLinetoVerticalAbs : SVGPathSeg { + var y: Number +} + +external interface SVGPathSegLinetoVerticalRel : SVGPathSeg { + var y: Number +} + +external interface SVGPathSegList { + var numberOfItems: Number + fun appendItem(newItem: SVGPathSeg): SVGPathSeg + fun clear() + fun getItem(index: Number): SVGPathSeg + fun initialize(newItem: SVGPathSeg): SVGPathSeg + fun insertItemBefore(newItem: SVGPathSeg, index: Number): SVGPathSeg + fun removeItem(index: Number): SVGPathSeg + fun replaceItem(newItem: SVGPathSeg, index: Number): SVGPathSeg +} + +external interface SVGPathSegMovetoAbs : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGPathSegMovetoRel : SVGPathSeg { + var x: Number + var y: Number +} + +external interface SVGSVGElementEventMap : SVGElementEventMap { + var SVGUnload: Event + var SVGZoom: SVGZoomEvent +} + +external interface SVGZoomEvent : UIEvent { + var newScale: Number + var newTranslate: SVGPoint + var previousScale: Number + var previousTranslate: SVGPoint + var zoomRectScreen: SVGRect +} + +external interface ScreenOrientationEventMap { + var change: Event +} + +external interface ScreenOrientation : EventTarget { + var angle: Number + var onchange: ((self: ScreenOrientation, ev: Event) -> Any)? + var type: String /* "landscape-primary" | "landscape-secondary" | "portrait-primary" | "portrait-secondary" */ + fun lock(orientation: String /* "any" | "landscape" | "landscape-primary" | "landscape-secondary" | "natural" | "portrait" | "portrait-primary" | "portrait-secondary" */): Promise + fun unlock() + fun addEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: ScreenOrientation, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface SecurityPolicyViolationEvent : Event { + var blockedURI: String + var columnNumber: Number + var documentURI: String + var effectiveDirective: String + var lineNumber: Number + var originalPolicy: String + var referrer: String + var sourceFile: String + var statusCode: Number + var violatedDirective: String +} + +external interface Selection { + var anchorNode: Node? + var anchorOffset: Number + var focusNode: Node? + var focusOffset: Number + var isCollapsed: Boolean + var rangeCount: Number + var type: String + fun addRange(range: Range) + fun collapse(node: Node?, offset: Number = definedExternally) + fun collapseToEnd() + fun collapseToStart() + fun containsNode(node: Node, allowPartialContainment: Boolean = definedExternally): Boolean + fun deleteFromDocument() + fun empty() + fun extend(node: Node, offset: Number = definedExternally) + fun getRangeAt(index: Number): Range + fun removeAllRanges() + fun removeRange(range: Range) + fun selectAllChildren(node: Node) + fun setBaseAndExtent(anchorNode: Node, anchorOffset: Number, focusNode: Node, focusOffset: Number) + fun setPosition(node: Node?, offset: Number = definedExternally) + override fun toString(): String +} + +external interface ServiceWorkerEventMap : AbstractWorkerEventMap { + var statechange: Event +} + +external interface ServiceWorkerContainerEventMap { + var controllerchange: Event + var message: MessageEvent + var messageerror: MessageEvent +} + +external interface ServiceWorkerRegistrationEventMap { + var updatefound: Event +} + +external interface SourceBufferEventMap { + var abort: Event + var error: Event + var update: Event + var updateend: Event + var updatestart: Event +} + +external interface SourceBuffer : EventTarget { + var appendWindowEnd: Number + var appendWindowStart: Number + var buffered: TimeRanges + var mode: String /* "segments" | "sequence" */ + var onabort: ((self: SourceBuffer, ev: Event) -> Any)? + var onerror: ((self: SourceBuffer, ev: Event) -> Any)? + var onupdate: ((self: SourceBuffer, ev: Event) -> Any)? + var onupdateend: ((self: SourceBuffer, ev: Event) -> Any)? + var onupdatestart: ((self: SourceBuffer, ev: Event) -> Any)? + var timestampOffset: Number + var updating: Boolean + fun abort() + fun appendBuffer(data: ArrayBufferView) + fun appendBuffer(data: ArrayBuffer) + fun remove(start: Number, end: Number) + fun addEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SourceBuffer, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface SourceBufferListEventMap { + var addsourcebuffer: Event + var removesourcebuffer: Event +} + +external interface SourceBufferList : EventTarget { + var length: Number + var onaddsourcebuffer: ((self: SourceBufferList, ev: Event) -> Any)? + var onremovesourcebuffer: ((self: SourceBufferList, ev: Event) -> Any)? + fun addEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SourceBufferList, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) + @nativeGetter + operator fun get(index: Number): SourceBuffer? + @nativeSetter + operator fun set(index: Number, value: SourceBuffer) +} + +external interface SpeechRecognitionAlternative { + var confidence: Number + var transcript: String +} + +external interface SpeechRecognitionEvent : Event { + var resultIndex: Number + var results: SpeechRecognitionResultList +} + +external interface SpeechRecognitionResult { + var isFinal: Boolean + var length: Number + fun item(index: Number): SpeechRecognitionAlternative + @nativeGetter + operator fun get(index: Number): SpeechRecognitionAlternative? + @nativeSetter + operator fun set(index: Number, value: SpeechRecognitionAlternative) +} + +external interface SpeechRecognitionResultList { + var length: Number + fun item(index: Number): SpeechRecognitionResult + @nativeGetter + operator fun get(index: Number): SpeechRecognitionResult? + @nativeSetter + operator fun set(index: Number, value: SpeechRecognitionResult) +} + +external interface SpeechSynthesisEventMap { + var voiceschanged: Event +} + +external interface SpeechSynthesis : EventTarget { + var onvoiceschanged: ((self: SpeechSynthesis, ev: Event) -> Any)? + var paused: Boolean + var pending: Boolean + var speaking: Boolean + fun cancel() + fun getVoices(): Array + fun pause() + fun resume() + fun speak(utterance: SpeechSynthesisUtterance) + fun addEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SpeechSynthesis, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface SpeechSynthesisErrorEvent : SpeechSynthesisEvent { + var error: String /* "audio-busy" | "audio-hardware" | "canceled" | "interrupted" | "invalid-argument" | "language-unavailable" | "network" | "not-allowed" | "synthesis-failed" | "synthesis-unavailable" | "text-too-long" | "voice-unavailable" */ +} + +external interface SpeechSynthesisEvent : Event { + var charIndex: Number + var charLength: Number + var elapsedTime: Number + var name: String + var utterance: SpeechSynthesisUtterance +} + +external interface SpeechSynthesisUtteranceEventMap { + var boundary: SpeechSynthesisEvent + var end: SpeechSynthesisEvent + var error: SpeechSynthesisErrorEvent + var mark: SpeechSynthesisEvent + var pause: SpeechSynthesisEvent + var resume: SpeechSynthesisEvent + var start: SpeechSynthesisEvent +} + +external interface SpeechSynthesisUtterance : EventTarget { + var lang: String + var onboundary: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var onend: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var onerror: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisErrorEvent) -> Any)? + var onmark: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var onpause: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var onresume: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var onstart: ((self: SpeechSynthesisUtterance, ev: SpeechSynthesisEvent) -> Any)? + var pitch: Number + var rate: Number + var text: String + var voice: SpeechSynthesisVoice? + var volume: Number + fun addEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any, options: Boolean = definedExternally) + fun addEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any) + fun addEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: Boolean) + fun addEventListener(type: String, listener: EventListener) + fun addEventListener(type: String, listener: EventListener?) + fun addEventListener(type: String, listener: EventListener, options: AddEventListenerOptions = definedExternally) + override fun addEventListener(type: String, listener: EventListener?, options: AddEventListenerOptions) + fun addEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: Boolean) + fun addEventListener(type: String, listener: EventListenerObject) + fun addEventListener(type: String, listener: EventListenerObject?) + fun addEventListener(type: String, listener: EventListenerObject, options: AddEventListenerOptions = definedExternally) + fun addEventListener(type: String, listener: EventListenerObject?, options: AddEventListenerOptions) + fun removeEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any, options: Boolean = definedExternally) + fun removeEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any) + fun removeEventListener(type: K, listener: (self: SpeechSynthesisUtterance, ev: Any) -> Any, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, listener: EventListener, options: Boolean = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: Boolean) + fun removeEventListener(type: String, listener: EventListener) + fun removeEventListener(type: String, callback: EventListener?) + fun removeEventListener(type: String, listener: EventListener, options: EventListenerOptions = definedExternally) + override fun removeEventListener(type: String, callback: EventListener?, options: EventListenerOptions) + fun removeEventListener(type: String, listener: EventListenerObject, options: Boolean = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: Boolean) + fun removeEventListener(type: String, listener: EventListenerObject) + fun removeEventListener(type: String, callback: EventListenerObject?) + fun removeEventListener(type: String, listener: EventListenerObject, options: EventListenerOptions = definedExternally) + fun removeEventListener(type: String, callback: EventListenerObject?, options: EventListenerOptions) +} + +external interface SpeechSynthesisVoice { + var default: Boolean + var lang: String + var localService: Boolean + var name: String + var voiceURI: String +} + +external interface StorageManager { + fun estimate(): Promise + fun persist(): Promise + fun persisted(): Promise +} + +external interface StyleMedia { + var type: String + fun matchMedium(mediaquery: String): Boolean +} + +external interface StyleSheet { + var disabled: Boolean + var href: String? + var media: MediaList + var ownerNode: dynamic /* Element? | ProcessingInstruction? */ + get() = definedExternally + set(value) = definedExternally + var parentStyleSheet: CSSStyleSheet? + var title: String? + var type: String +} + +external interface StyleSheetList { + var length: Number + fun item(index: Number): CSSStyleSheet? + @nativeGetter + operator fun get(index: Number): CSSStyleSheet? + @nativeSetter + operator fun set(index: Number, value: CSSStyleSheet) +} + +external interface SyncManager { + fun getTags(): Promise> + fun register(tag: String): Promise +} + +external interface TextEvent : UIEvent { + var data: String + fun initTextEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, viewArg: Window, dataArg: String, inputMethod: Number, locale: String) + var DOM_INPUT_METHOD_DROP: Number + var DOM_INPUT_METHOD_HANDWRITING: Number + var DOM_INPUT_METHOD_IME: Number + var DOM_INPUT_METHOD_KEYBOARD: Number + var DOM_INPUT_METHOD_MULTIMODAL: Number + var DOM_INPUT_METHOD_OPTION: Number + var DOM_INPUT_METHOD_PASTE: Number + var DOM_INPUT_METHOD_SCRIPT: Number + var DOM_INPUT_METHOD_UNKNOWN: Number + var DOM_INPUT_METHOD_VOICE: Number +} + +external interface TextTrackEventMap { + var cuechange: Event +} + +external interface TextTrackCueEventMap { + var enter: Event + var exit: Event +} + +external interface TextTrackListEventMap { + var addtrack: TrackEvent + var change: Event + var removetrack: TrackEvent +} + +external interface TransitionEvent : Event { + var elapsedTime: Number + var propertyName: String + var pseudoElement: String +} + +external interface VRPose { + var angularAcceleration: Float32Array? + var angularVelocity: Float32Array? + var linearAcceleration: Float32Array? + var linearVelocity: Float32Array? + var orientation: Float32Array? + var position: Float32Array? + var timestamp: Number +} + +external interface WebGLQuery : WebGLObject + +external interface WebGLRenderingContextOverloads { + fun uniform1fv(location: WebGLUniformLocation?, v: Iterable) + fun uniform1iv(location: WebGLUniformLocation?, v: Iterable) + fun uniform2fv(location: WebGLUniformLocation?, v: Iterable) + fun uniform2iv(location: WebGLUniformLocation?, v: Iterable) + fun uniform3fv(location: WebGLUniformLocation?, v: Iterable) + fun uniform3iv(location: WebGLUniformLocation?, v: Iterable) + fun uniform4fv(location: WebGLUniformLocation?, v: Iterable) + fun uniform4iv(location: WebGLUniformLocation?, v: Iterable) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Iterable) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Iterable) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Iterable) + fun bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum) + fun bufferData(target: GLenum, data: ArrayBufferView?, usage: GLenum) + fun bufferData(target: GLenum, data: ArrayBuffer?, usage: GLenum) + fun bufferSubData(target: GLenum, offset: GLintptr, data: ArrayBufferView) + fun bufferSubData(target: GLenum, offset: GLintptr, data: ArrayBuffer) + fun compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView) + fun compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView) + fun readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView?) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: ImageBitmap) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: ImageData) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLImageElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLCanvasElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: HTMLVideoElement) + fun texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: OffscreenCanvas) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView?) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: ImageBitmap) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: ImageData) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: HTMLImageElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: HTMLCanvasElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: HTMLVideoElement) + fun texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: OffscreenCanvas) + fun uniform1fv(location: WebGLUniformLocation?, v: Float32Array) + fun uniform1fv(location: WebGLUniformLocation?, v: Array) + fun uniform1iv(location: WebGLUniformLocation?, v: Int32Array) + fun uniform1iv(location: WebGLUniformLocation?, v: Array) + fun uniform2fv(location: WebGLUniformLocation?, v: Float32Array) + fun uniform2fv(location: WebGLUniformLocation?, v: Array) + fun uniform2iv(location: WebGLUniformLocation?, v: Int32Array) + fun uniform2iv(location: WebGLUniformLocation?, v: Array) + fun uniform3fv(location: WebGLUniformLocation?, v: Float32Array) + fun uniform3fv(location: WebGLUniformLocation?, v: Array) + fun uniform3iv(location: WebGLUniformLocation?, v: Int32Array) + fun uniform3iv(location: WebGLUniformLocation?, v: Array) + fun uniform4fv(location: WebGLUniformLocation?, v: Float32Array) + fun uniform4fv(location: WebGLUniformLocation?, v: Array) + fun uniform4iv(location: WebGLUniformLocation?, v: Int32Array) + fun uniform4iv(location: WebGLUniformLocation?, v: Array) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32Array) + fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Array) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32Array) + fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Array) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Float32Array) + fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: GLboolean, value: Array) +} + +external interface WebGLSampler : WebGLObject + +external interface WebGLSync : WebGLObject + +external interface WebGLTransformFeedback : WebGLObject + +external interface WebGLVertexArrayObject : WebGLObject + +external interface WebGLVertexArrayObjectOES : WebGLObject + +external interface WebKitPoint { + var x: Number + var y: Number +} + +external interface WindowEventHandlersEventMap { + var afterprint: Event + var beforeprint: Event + var beforeunload: BeforeUnloadEvent + var hashchange: HashChangeEvent + var languagechange: Event + var message: MessageEvent + var messageerror: MessageEvent + var offline: Event + var online: Event + var pagehide: PageTransitionEvent + var pageshow: PageTransitionEvent + var popstate: PopStateEvent + var rejectionhandled: PromiseRejectionEvent + var storage: StorageEvent + var unhandledrejection: PromiseRejectionEvent + var unload: Event +} + +external interface WritableStream { + var locked: Boolean + fun abort(reason: Any = definedExternally): Promise + fun getWriter(): WritableStreamDefaultWriter +} + +external interface WritableStreamDefaultController { + fun error(error: Any = definedExternally) +} + +external interface WritableStreamDefaultWriter { + var closed: Promise + var desiredSize: Number? + var ready: Promise + fun abort(reason: Any = definedExternally): Promise + fun close(): Promise + fun releaseLock() + fun write(chunk: W): Promise +} + +external interface XPathEvaluatorBase { + fun createExpression(expression: String, resolver: ((prefix: String?) -> String?)? = definedExternally): XPathExpression + fun createExpression(expression: String): XPathExpression + fun createExpression(expression: String, resolver: `T$2`? = definedExternally): XPathExpression + fun createNSResolver(nodeResolver: Node): dynamic /* (prefix: String?) -> String? | `T$2` */ + fun evaluate(expression: String, contextNode: Node, resolver: ((prefix: String?) -> String?)? = definedExternally, type: Number = definedExternally, result: XPathResult? = definedExternally): XPathResult + fun evaluate(expression: String, contextNode: Node): XPathResult + fun evaluate(expression: String, contextNode: Node, resolver: ((prefix: String?) -> String?)? = definedExternally): XPathResult + fun evaluate(expression: String, contextNode: Node, resolver: ((prefix: String?) -> String?)? = definedExternally, type: Number = definedExternally): XPathResult + fun evaluate(expression: String, contextNode: Node, resolver: `T$2`? = definedExternally, type: Number = definedExternally, result: XPathResult? = definedExternally): XPathResult + fun evaluate(expression: String, contextNode: Node, resolver: `T$2`? = definedExternally): XPathResult + fun evaluate(expression: String, contextNode: Node, resolver: `T$2`? = definedExternally, type: Number = definedExternally): XPathResult +} + +external interface XPathExpression { + fun evaluate(contextNode: Node, type: Number = definedExternally, result: XPathResult? = definedExternally): XPathResult +} + +external interface XPathResult { + var booleanValue: Boolean + var invalidIteratorState: Boolean + var numberValue: Number + var resultType: Number + var singleNodeValue: Node? + var snapshotLength: Number + var stringValue: String + fun iterateNext(): Node? + fun snapshotItem(index: Number): Node? + var ANY_TYPE: Number + var ANY_UNORDERED_NODE_TYPE: Number + var BOOLEAN_TYPE: Number + var FIRST_ORDERED_NODE_TYPE: Number + var NUMBER_TYPE: Number + var ORDERED_NODE_ITERATOR_TYPE: Number + var ORDERED_NODE_SNAPSHOT_TYPE: Number + var STRING_TYPE: Number + var UNORDERED_NODE_ITERATOR_TYPE: Number + var UNORDERED_NODE_SNAPSHOT_TYPE: Number +} + +external interface BlobCallback { + @nativeInvoke + operator fun invoke(blob: Blob?) +} + +external interface CustomElementConstructor + +external interface FrameRequestCallback { + @nativeInvoke + operator fun invoke(time: Number) +} + +external interface FunctionStringCallback { + @nativeInvoke + operator fun invoke(data: String) +} + +external interface MSLaunchUriCallback { + @nativeInvoke + operator fun invoke() +} + +external interface NavigatorUserMediaErrorCallback { + @nativeInvoke + operator fun invoke(error: MediaStreamError) +} + +external interface NavigatorUserMediaSuccessCallback { + @nativeInvoke + operator fun invoke(stream: MediaStream) +} + +external interface NotificationPermissionCallback { + @nativeInvoke + operator fun invoke(permission: String /* "default" | "denied" | "granted" */) +} + +external interface OnErrorEventHandlerNonNull { + @nativeInvoke + operator fun invoke(event: Event, source: String = definedExternally, lineno: Number = definedExternally, colno: Number = definedExternally, error: Error = definedExternally): Any + @nativeInvoke + operator fun invoke(event: Event): Any + @nativeInvoke + operator fun invoke(event: Event, source: String = definedExternally): Any + @nativeInvoke + operator fun invoke(event: Event, source: String = definedExternally, lineno: Number = definedExternally): Any + @nativeInvoke + operator fun invoke(event: Event, source: String = definedExternally, lineno: Number = definedExternally, colno: Number = definedExternally): Any + @nativeInvoke + operator fun invoke(event: String, source: String = definedExternally, lineno: Number = definedExternally, colno: Number = definedExternally, error: Error = definedExternally): Any + @nativeInvoke + operator fun invoke(event: String): Any + @nativeInvoke + operator fun invoke(event: String, source: String = definedExternally): Any + @nativeInvoke + operator fun invoke(event: String, source: String = definedExternally, lineno: Number = definedExternally): Any + @nativeInvoke + operator fun invoke(event: String, source: String = definedExternally, lineno: Number = definedExternally, colno: Number = definedExternally): Any +} + +external interface PositionCallback { + @nativeInvoke + operator fun invoke(position: Position) +} + +external interface PositionErrorCallback { + @nativeInvoke + operator fun invoke(positionError: PositionError) +} + +external interface QueuingStrategySizeCallback { + @nativeInvoke + operator fun invoke(chunk: T): Number +} + +external interface ReadableByteStreamControllerCallback { + @nativeInvoke + operator fun invoke(controller: ReadableByteStreamController): dynamic /* Unit | PromiseLike */ +} + +external interface ReadableStreamDefaultControllerCallback { + @nativeInvoke + operator fun invoke(controller: ReadableStreamDefaultController): dynamic /* Unit | PromiseLike */ +} + +external interface ReadableStreamErrorCallback { + @nativeInvoke + operator fun invoke(reason: Any): dynamic /* Unit | PromiseLike */ +} + +external interface VoidFunction { + @nativeInvoke + operator fun invoke() +} + +external interface WritableStreamDefaultControllerCloseCallback { + @nativeInvoke + operator fun invoke(): dynamic /* Unit | PromiseLike */ +} + +external interface WritableStreamDefaultControllerStartCallback { + @nativeInvoke + operator fun invoke(controller: WritableStreamDefaultController): dynamic /* Unit | PromiseLike */ +} + +external interface WritableStreamDefaultControllerWriteCallback { + @nativeInvoke + operator fun invoke(chunk: W, controller: WritableStreamDefaultController): dynamic /* Unit | PromiseLike */ +} + +external interface WritableStreamErrorCallback { + @nativeInvoke + operator fun invoke(reason: Any): dynamic /* Unit | PromiseLike */ +} + +external interface HTMLElementTagNameMap { + var a: HTMLAnchorElement + var abbr: HTMLElement + var address: HTMLElement + var applet: HTMLAppletElement + var area: HTMLAreaElement + var article: HTMLElement + var aside: HTMLElement + var audio: HTMLAudioElement + var b: HTMLElement + var base: HTMLBaseElement + var basefont: HTMLBaseFontElement + var bdi: HTMLElement + var bdo: HTMLElement + var blockquote: HTMLQuoteElement + var body: HTMLBodyElement + var br: HTMLBRElement + var button: HTMLButtonElement + var canvas: HTMLCanvasElement + var caption: HTMLTableCaptionElement + var cite: HTMLElement + var code: HTMLElement + var col: HTMLTableColElement + var colgroup: HTMLTableColElement + var data: HTMLDataElement + var datalist: HTMLDataListElement + var dd: HTMLElement + var del: HTMLModElement + var details: HTMLDetailsElement + var dfn: HTMLElement + var dialog: HTMLDialogElement + var dir: HTMLDirectoryElement + var div: HTMLDivElement + var dl: HTMLDListElement + var dt: HTMLElement + var em: HTMLElement + var embed: HTMLEmbedElement + var fieldset: HTMLFieldSetElement + var figcaption: HTMLElement + var figure: HTMLElement + var font: HTMLFontElement + var footer: HTMLElement + var form: HTMLFormElement + var frame: HTMLFrameElement + var frameset: HTMLFrameSetElement + var h1: HTMLHeadingElement + var h2: HTMLHeadingElement + var h3: HTMLHeadingElement + var h4: HTMLHeadingElement + var h5: HTMLHeadingElement + var h6: HTMLHeadingElement + var head: HTMLHeadElement + var header: HTMLElement + var hgroup: HTMLElement + var hr: HTMLHRElement + var html: HTMLHtmlElement + var i: HTMLElement + var iframe: HTMLIFrameElement + var img: HTMLImageElement + var input: HTMLInputElement + var ins: HTMLModElement + var kbd: HTMLElement + var label: HTMLLabelElement + var legend: HTMLLegendElement + var li: HTMLLIElement + var link: HTMLLinkElement + var main: HTMLElement + var map: HTMLMapElement + var mark: HTMLElement + var marquee: HTMLMarqueeElement + var menu: HTMLMenuElement + var meta: HTMLMetaElement + var meter: HTMLMeterElement + var nav: HTMLElement + var noscript: HTMLElement + var `object`: HTMLObjectElement + var ol: HTMLOListElement + var optgroup: HTMLOptGroupElement + var option: HTMLOptionElement + var output: HTMLOutputElement + var p: HTMLParagraphElement + var param: HTMLParamElement + var picture: HTMLPictureElement + var pre: HTMLPreElement + var progress: HTMLProgressElement + var q: HTMLQuoteElement + var rp: HTMLElement + var rt: HTMLElement + var ruby: HTMLElement + var s: HTMLElement + var samp: HTMLElement + var script: HTMLScriptElement + var section: HTMLElement + var select: HTMLSelectElement + var slot: HTMLSlotElement + var small: HTMLElement + var source: HTMLSourceElement + var span: HTMLSpanElement + var strong: HTMLElement + var style: HTMLStyleElement + var sub: HTMLElement + var summary: HTMLElement + var sup: HTMLElement + var table: HTMLTableElement + var tbody: HTMLTableSectionElement + var td: HTMLTableDataCellElement + var template: HTMLTemplateElement + var textarea: HTMLTextAreaElement + var tfoot: HTMLTableSectionElement + var th: HTMLTableHeaderCellElement + var thead: HTMLTableSectionElement + var time: HTMLTimeElement + var title: HTMLTitleElement + var tr: HTMLTableRowElement + var track: HTMLTrackElement + var u: HTMLElement + var ul: HTMLUListElement + var `var`: HTMLElement + var video: HTMLVideoElement + var wbr: HTMLElement +} + +external interface HTMLElementDeprecatedTagNameMap { + var listing: HTMLPreElement + var xmp: HTMLPreElement +} + +external interface SVGElementTagNameMap { + var a: SVGAElement + var circle: SVGCircleElement + var clipPath: SVGClipPathElement + var defs: SVGDefsElement + var desc: SVGDescElement + var ellipse: SVGEllipseElement + var feBlend: SVGFEBlendElement + var feColorMatrix: SVGFEColorMatrixElement + var feComponentTransfer: SVGFEComponentTransferElement + var feComposite: SVGFECompositeElement + var feConvolveMatrix: SVGFEConvolveMatrixElement + var feDiffuseLighting: SVGFEDiffuseLightingElement + var feDisplacementMap: SVGFEDisplacementMapElement + var feDistantLight: SVGFEDistantLightElement + var feFlood: SVGFEFloodElement + var feFuncA: SVGFEFuncAElement + var feFuncB: SVGFEFuncBElement + var feFuncG: SVGFEFuncGElement + var feFuncR: SVGFEFuncRElement + var feGaussianBlur: SVGFEGaussianBlurElement + var feImage: SVGFEImageElement + var feMerge: SVGFEMergeElement + var feMergeNode: SVGFEMergeNodeElement + var feMorphology: SVGFEMorphologyElement + var feOffset: SVGFEOffsetElement + var fePointLight: SVGFEPointLightElement + var feSpecularLighting: SVGFESpecularLightingElement + var feSpotLight: SVGFESpotLightElement + var feTile: SVGFETileElement + var feTurbulence: SVGFETurbulenceElement + var filter: SVGFilterElement + var foreignObject: SVGForeignObjectElement + var g: SVGGElement + var image: SVGImageElement + var line: SVGLineElement + var linearGradient: SVGLinearGradientElement + var marker: SVGMarkerElement + var mask: SVGMaskElement + var metadata: SVGMetadataElement + var path: SVGPathElement + var pattern: SVGPatternElement + var polygon: SVGPolygonElement + var polyline: SVGPolylineElement + var radialGradient: SVGRadialGradientElement + var rect: SVGRectElement + var script: SVGScriptElement + var stop: SVGStopElement + var style: SVGStyleElement + var svg: SVGSVGElement + var switch: SVGSwitchElement + var symbol: SVGSymbolElement + var text: SVGTextElement + var textPath: SVGTextPathElement + var title: SVGTitleElement + var tspan: SVGTSpanElement + var use: SVGUseElement + var view: SVGViewElement +} + +typealias PerformanceEntryList = Array + +typealias COSEAlgorithmIdentifier = Number + +typealias AuthenticatorSelectionList = Array + +typealias BigInteger = Uint8Array + +typealias NamedCurve = String + +typealias GLenum = Number + +typealias GLboolean = Boolean + +typealias GLbitfield = Number + +typealias GLint = Number + +typealias GLsizei = Number + +typealias GLintptr = Number + +typealias GLsizeiptr = Number + +typealias GLuint = Number + +typealias GLfloat = Number + +typealias GLclampf = Number + +typealias GLint64 = Number + +typealias GLuint64 = Number + +typealias WindowProxy = Window*/ + +external interface DOMException { + var code: Number + var message: String + var name: String + var ABORT_ERR: Number + var DATA_CLONE_ERR: Number + var DOMSTRING_SIZE_ERR: Number + var HIERARCHY_REQUEST_ERR: Number + var INDEX_SIZE_ERR: Number + var INUSE_ATTRIBUTE_ERR: Number + var INVALID_ACCESS_ERR: Number + var INVALID_CHARACTER_ERR: Number + var INVALID_MODIFICATION_ERR: Number + var INVALID_NODE_TYPE_ERR: Number + var INVALID_STATE_ERR: Number + var NAMESPACE_ERR: Number + var NETWORK_ERR: Number + var NOT_FOUND_ERR: Number + var NOT_SUPPORTED_ERR: Number + var NO_DATA_ALLOWED_ERR: Number + var NO_MODIFICATION_ALLOWED_ERR: Number + var QUOTA_EXCEEDED_ERR: Number + var SECURITY_ERR: Number + var SYNTAX_ERR: Number + var TIMEOUT_ERR: Number + var TYPE_MISMATCH_ERR: Number + var URL_MISMATCH_ERR: Number + var VALIDATION_ERR: Number + var WRONG_DOCUMENT_ERR: Number +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.es2015.collection.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.es2015.collection.kt new file mode 100644 index 00000000..8ef81855 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.es2015.collection.kt @@ -0,0 +1,11 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package io.ygdrasil.wgpu.internal.js + +external interface ReadonlySet { + fun entries(): IterableIterator */> + fun keys(): IterableIterator + fun values(): IterableIterator + fun forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) -> Unit, thisArg: Any = definedExternally) + fun has(value: T): Boolean + var size: Number +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.es2015.iterable.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.es2015.iterable.kt new file mode 100644 index 00000000..cb31fd63 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.es2015.iterable.kt @@ -0,0 +1,15 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package io.ygdrasil.wgpu.internal.js + +external interface Iterator { + fun next(vararg args: Any /* JsTuple<> | JsTuple */): dynamic /* IteratorYieldResult | IteratorReturnResult */ + val `return`: ((value: TReturn) -> dynamic)? + val `throw`: ((e: Any) -> dynamic)? +} + +typealias Iterator__1 = Iterator + +external interface Iterable + +external interface IterableIterator : Iterator__1 + diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.es5.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.es5.kt new file mode 100644 index 00000000..5b6ade0b --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.es5.kt @@ -0,0 +1,11 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package io.ygdrasil.wgpu.internal.js + +external interface PromiseLike { + fun then(onfulfilled: ((value: T) -> Any?)? = definedExternally, onrejected: ((reason: Any) -> Any?)? = definedExternally): PromiseLike +} + +typealias Record = Any + + + diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.scripthost.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.scripthost.kt new file mode 100644 index 00000000..0a87baaa --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/lib.scripthost.kt @@ -0,0 +1,6 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") +package io.ygdrasil.wgpu.internal.js + +external open class VarDate { + open var VarDate_typekey: VarDate +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/webgpu_types.kt b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/webgpu_types.kt new file mode 100644 index 00000000..3b03256a --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jsMain/kotlin/io.ygdrasil.wgpu/internal.js/webgpu_types.kt @@ -0,0 +1,1247 @@ +@file:Suppress("INTERFACE_WITH_SUPERCLASS", "OVERRIDING_FINAL_MEMBER", "RETURN_TYPE_MISMATCH_ON_OVERRIDE", "CONFLICTING_OVERLOADS") + +package io.ygdrasil.wgpu.internal.js + +import io.ygdrasil.wgpu.* +import org.khronos.webgl.ArrayBuffer +import org.khronos.webgl.ArrayBufferView +import org.khronos.webgl.Uint32Array +import org.w3c.dom.EventInit +import org.w3c.dom.events.Event +import org.w3c.dom.events.EventTarget +import kotlin.js.Promise + +external interface GPUOrigin2DDictStrict : GPUOrigin2DDict + +external interface GPUExtent3DDictStrict : GPUExtent3DDict + +external interface GPUBindGroupDescriptor : GPUObjectDescriptorBase { + var layout: GPUBindGroupLayout + var entries: Array +} + +external interface GPUBindGroupEntry { + var binding: GPUIndex32 + var resource: dynamic /* GPUSampler | GPUTextureView | GPUBufferBinding | GPUExternalTexture */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBindGroupLayoutDescriptor : GPUObjectDescriptorBase { + var entries: Iterable +} + +external interface GPUBindGroupLayoutEntry { + var binding: GPUIndex32 + var visibility: GPUShaderStageFlags + var buffer: GPUBufferBindingLayout? + get() = definedExternally + set(value) = definedExternally + var sampler: GPUSamplerBindingLayout? + get() = definedExternally + set(value) = definedExternally + var texture: GPUTextureBindingLayout? + get() = definedExternally + set(value) = definedExternally + var storageTexture: GPUStorageTextureBindingLayout? + get() = definedExternally + set(value) = definedExternally + var externalTexture: GPUExternalTextureBindingLayout? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBlendComponent { + var operation: String? /* "add" | "subtract" | "reverse-subtract" | "min" | "max" */ + get() = definedExternally + set(value) = definedExternally + var srcFactor: String? /* "zero" | "one" | "src" | "one-minus-src" | "src-alpha" | "one-minus-src-alpha" | "dst" | "one-minus-dst" | "dst-alpha" | "one-minus-dst-alpha" | "src-alpha-saturated" | "constant" | "one-minus-constant" */ + get() = definedExternally + set(value) = definedExternally + var dstFactor: String? /* "zero" | "one" | "src" | "one-minus-src" | "src-alpha" | "one-minus-src-alpha" | "dst" | "one-minus-dst" | "dst-alpha" | "one-minus-dst-alpha" | "src-alpha-saturated" | "constant" | "one-minus-constant" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBlendState { + var color: GPUBlendComponent + var alpha: GPUBlendComponent +} + +external interface GPUBufferBinding { + var buffer: GPUBuffer + var offset: GPUSize64? + get() = definedExternally + set(value) = definedExternally + var size: GPUSize64? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBufferBindingLayout { + var type: String? /* "uniform" | "storage" | "read-only-storage" */ + get() = definedExternally + set(value) = definedExternally + var hasDynamicOffset: Boolean? + get() = definedExternally + set(value) = definedExternally + var minBindingSize: GPUSize64? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBufferDescriptor : GPUObjectDescriptorBase { + var size: GPUSize64 + var usage: GPUBufferUsageFlags + var mappedAtCreation: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUCanvasConfiguration { + var device: GPUDevice + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var usage: GPUTextureUsageFlags? + get() = definedExternally + set(value) = definedExternally + var viewFormats: Array? + get() = definedExternally + set(value) = definedExternally + var colorSpace: Any? + get() = definedExternally + set(value) = definedExternally + var alphaMode: String? /* "opaque" | "premultiplied" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUColorDict { + var r: Number + var g: Number + var b: Number + var a: Number +} + +external interface GPUColorTargetState { + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var blend: GPUBlendState? + get() = definedExternally + set(value) = definedExternally + var writeMask: GPUColorWriteFlags? + get() = definedExternally + set(value) = definedExternally +} + +typealias GPUCommandBufferDescriptor = GPUObjectDescriptorBase + +typealias GPUCommandEncoderDescriptor = GPUObjectDescriptorBase + +external interface GPUComputePassDescriptor : GPUObjectDescriptorBase { + var timestampWrites: GPUComputePassTimestampWrites? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUComputePassTimestampWrites { + var querySet: GPUQuerySet + var beginningOfPassWriteIndex: GPUSize32? + get() = definedExternally + set(value) = definedExternally + var endOfPassWriteIndex: GPUSize32? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUComputePipelineDescriptor : GPUPipelineDescriptorBase { + var compute: GPUProgrammableStage +} + +external interface GPUDepthStencilState { + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var depthWriteEnabled: Boolean? + get() = definedExternally + set(value) = definedExternally + var depthCompare: String? /* "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always" */ + get() = definedExternally + set(value) = definedExternally + var stencilFront: GPUStencilFaceState? + get() = definedExternally + set(value) = definedExternally + var stencilBack: GPUStencilFaceState? + get() = definedExternally + set(value) = definedExternally + var stencilReadMask: GPUStencilValue? + get() = definedExternally + set(value) = definedExternally + var stencilWriteMask: GPUStencilValue? + get() = definedExternally + set(value) = definedExternally + var depthBias: GPUDepthBias? + get() = definedExternally + set(value) = definedExternally + var depthBiasSlopeScale: Float? + get() = definedExternally + set(value) = definedExternally + var depthBiasClamp: Float? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUDeviceDescriptor : GPUObjectDescriptorBase { + var requiredFeatures: Iterable? + get() = definedExternally + set(value) = definedExternally + var requiredLimits: Record? + get() = definedExternally + set(value) = definedExternally + var defaultQueue: GPUQueueDescriptor? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUExtent3DDict { + var width: GPUIntegerCoordinate + var height: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var depthOrArrayLayers: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUExternalTextureBindingLayout + +external interface GPUExternalTextureDescriptor : GPUObjectDescriptorBase { + var source: dynamic /* HTMLVideoElement | VideoFrame */ + get() = definedExternally + set(value) = definedExternally + var colorSpace: Any? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUFragmentState : GPUProgrammableStage { + var targets: Array +} + +external interface GPUImageCopyBuffer : GPUImageDataLayout { + var buffer: GPUBuffer +} + +external interface GPUImageCopyExternalImage { + var source: dynamic /* ImageBitmap | ImageData | HTMLImageElement | HTMLVideoElement | VideoFrame | HTMLCanvasElement | OffscreenCanvas */ + get() = definedExternally + set(value) = definedExternally + var origin: dynamic /* Iterable? | GPUOrigin2DDictStrict? */ + get() = definedExternally + set(value) = definedExternally + var flipY: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUImageCopyTexture { + var texture: GPUTexture + var mipLevel: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var origin: dynamic /* Iterable? | GPUOrigin3DDict? */ + get() = definedExternally + set(value) = definedExternally + var aspect: String? /* "all" | "stencil-only" | "depth-only" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUImageCopyTextureTagged : GPUImageCopyTexture { + var colorSpace: Any? + get() = definedExternally + set(value) = definedExternally + var premultipliedAlpha: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUImageDataLayout { + var offset: GPUSize64? + get() = definedExternally + set(value) = definedExternally + var bytesPerRow: GPUSize32? + get() = definedExternally + set(value) = definedExternally + var rowsPerImage: GPUSize32? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUMultisampleState { + var count: GPUSize32? + get() = definedExternally + set(value) = definedExternally + var mask: GPUSampleMask? + get() = definedExternally + set(value) = definedExternally + var alphaToCoverageEnabled: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUObjectDescriptorBase { + var label: String? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUOrigin2DDict { + var x: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var y: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUOrigin3DDict { + var x: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var y: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var z: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUPipelineDescriptorBase : GPUObjectDescriptorBase { + var layout: dynamic /* GPUPipelineLayout | "auto" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUPipelineErrorInit { + var reason: String /* "validation" | "internal" */ +} + +external interface GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase { + var bindGroupLayouts: Array +} + +external interface GPUPrimitiveState { + var topology: String? /* "point-list" | "line-list" | "line-strip" | "triangle-list" | "triangle-strip" */ + get() = definedExternally + set(value) = definedExternally + var stripIndexFormat: String? /* "uint16" | "uint32" */ + get() = definedExternally + set(value) = definedExternally + var frontFace: String? /* "ccw" | "cw" */ + get() = definedExternally + set(value) = definedExternally + var cullMode: String? /* "none" | "front" | "back" */ + get() = definedExternally + set(value) = definedExternally + var unclippedDepth: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUProgrammableStage { + var module: GPUShaderModule + var entryPoint: String? + get() = definedExternally + set(value) = definedExternally + var constants: Record? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUQuerySetDescriptor : GPUObjectDescriptorBase { + var type: String /* "occlusion" | "timestamp" */ + var count: GPUSize32 +} + +typealias GPUQueueDescriptor = GPUObjectDescriptorBase + +typealias GPURenderBundleDescriptor = GPUObjectDescriptorBase + +external interface GPURenderBundleEncoderDescriptor : GPURenderPassLayout { + var depthReadOnly: Boolean? + get() = definedExternally + set(value) = definedExternally + var stencilReadOnly: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURenderPassColorAttachment { + var view: GPUTextureView + var depthSlice: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var resolveTarget: GPUTextureView? + get() = definedExternally + set(value) = definedExternally + var clearValue: Array? /* Iterable? | GPUColorDict? */ + get() = definedExternally + set(value) = definedExternally + var loadOp: String /* "load" | "clear" */ + var storeOp: String /* "store" | "discard" */ +} + +external interface GPURenderPassDepthStencilAttachment { + var view: GPUTextureView + var depthClearValue: Number? + get() = definedExternally + set(value) = definedExternally + var depthLoadOp: String? /* "load" | "clear" */ + get() = definedExternally + set(value) = definedExternally + var depthStoreOp: String? /* "store" | "discard" */ + get() = definedExternally + set(value) = definedExternally + var depthReadOnly: Boolean? + get() = definedExternally + set(value) = definedExternally + var stencilClearValue: GPUStencilValue? + get() = definedExternally + set(value) = definedExternally + var stencilLoadOp: String? /* "load" | "clear" */ + get() = definedExternally + set(value) = definedExternally + var stencilStoreOp: String? /* "store" | "discard" */ + get() = definedExternally + set(value) = definedExternally + var stencilReadOnly: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURenderPassDescriptor : GPUObjectDescriptorBase { + var colorAttachments: Array + var depthStencilAttachment: GPURenderPassDepthStencilAttachment? + get() = definedExternally + set(value) = definedExternally + var occlusionQuerySet: GPUQuerySet? + get() = definedExternally + set(value) = definedExternally + var timestampWrites: GPURenderPassTimestampWrites? + get() = definedExternally + set(value) = definedExternally + var maxDrawCount: GPUSize64? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURenderPassLayout : GPUObjectDescriptorBase { + var colorFormats: Iterable + var depthStencilFormat: String? /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + get() = definedExternally + set(value) = definedExternally + var sampleCount: GPUSize32? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURenderPassTimestampWrites { + var querySet: GPUQuerySet + var beginningOfPassWriteIndex: GPUSize32? + get() = definedExternally + set(value) = definedExternally + var endOfPassWriteIndex: GPUSize32? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURenderPipelineDescriptor : GPUPipelineDescriptorBase { + var vertex: GPUVertexState + var primitive: GPUPrimitiveState? + get() = definedExternally + set(value) = definedExternally + var depthStencil: GPUDepthStencilState? + get() = definedExternally + set(value) = definedExternally + var multisample: GPUMultisampleState? + get() = definedExternally + set(value) = definedExternally + var fragment: GPUFragmentState? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPURequestAdapterOptions { + var powerPreference: String? /* "low-power" | "high-performance" */ + get() = definedExternally + set(value) = definedExternally + var forceFallbackAdapter: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUSamplerBindingLayout { + var type: String? /* "filtering" | "non-filtering" | "comparison" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUSamplerDescriptor : GPUObjectDescriptorBase { + var addressModeU: String? /* "clamp-to-edge" | "repeat" | "mirror-repeat" */ + get() = definedExternally + set(value) = definedExternally + var addressModeV: String? /* "clamp-to-edge" | "repeat" | "mirror-repeat" */ + get() = definedExternally + set(value) = definedExternally + var addressModeW: String? /* "clamp-to-edge" | "repeat" | "mirror-repeat" */ + get() = definedExternally + set(value) = definedExternally + var magFilter: String? /* "nearest" | "linear" */ + get() = definedExternally + set(value) = definedExternally + var minFilter: String? /* "nearest" | "linear" */ + get() = definedExternally + set(value) = definedExternally + var mipmapFilter: String? /* "nearest" | "linear" */ + get() = definedExternally + set(value) = definedExternally + var lodMinClamp: Number? + get() = definedExternally + set(value) = definedExternally + var lodMaxClamp: Number? + get() = definedExternally + set(value) = definedExternally + var compare: String? /* "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always" */ + get() = definedExternally + set(value) = definedExternally + var maxAnisotropy: Number? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUShaderModuleCompilationHint { + var entryPoint: String + var layout: dynamic /* GPUPipelineLayout? | "auto" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUShaderModuleDescriptor : GPUObjectDescriptorBase { + var code: String + var sourceMap: Any? + get() = definedExternally + set(value) = definedExternally + var compilationHints: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUStencilFaceState { + var compare: String? /* "never" | "less" | "equal" | "less-equal" | "greater" | "not-equal" | "greater-equal" | "always" */ + get() = definedExternally + set(value) = definedExternally + var failOp: String? /* "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap" */ + get() = definedExternally + set(value) = definedExternally + var depthFailOp: String? /* "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap" */ + get() = definedExternally + set(value) = definedExternally + var passOp: String? /* "keep" | "zero" | "replace" | "invert" | "increment-clamp" | "decrement-clamp" | "increment-wrap" | "decrement-wrap" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUStorageTextureBindingLayout { + var access: String? /* "write-only" | "read-only" | "read-write" */ + get() = definedExternally + set(value) = definedExternally + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var viewDimension: String? /* "1d" | "2d" | "2d-array" | "cube" | "cube-array" | "3d" */ + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUTextureBindingLayout { + var sampleType: String? /* "float" | "unfilterable-float" | "depth" | "sint" | "uint" */ + get() = definedExternally + set(value) = definedExternally + var viewDimension: String? /* "1d" | "2d" | "2d-array" | "cube" | "cube-array" | "3d" */ + get() = definedExternally + set(value) = definedExternally + var multisampled: Boolean? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUTextureDescriptor : GPUObjectDescriptorBase { + var size: dynamic /* Iterable | GPUExtent3DDictStrict */ + get() = definedExternally + set(value) = definedExternally + var mipLevelCount: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var sampleCount: GPUSize32? + get() = definedExternally + set(value) = definedExternally + var dimension: String? /* "1d" | "2d" | "3d" */ + get() = definedExternally + set(value) = definedExternally + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var usage: GPUTextureUsageFlags + var viewFormats: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUTextureViewDescriptor : GPUObjectDescriptorBase { + var format: String? /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + get() = definedExternally + set(value) = definedExternally + var dimension: String? /* "1d" | "2d" | "2d-array" | "cube" | "cube-array" | "3d" */ + get() = definedExternally + set(value) = definedExternally + var aspect: String? /* "all" | "stencil-only" | "depth-only" */ + get() = definedExternally + set(value) = definedExternally + var baseMipLevel: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var mipLevelCount: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var baseArrayLayer: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally + var arrayLayerCount: GPUIntegerCoordinate? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUUncapturedErrorEventInit : EventInit { + var error: GPUError +} + +external interface GPUVertexAttribute { + var format: String + + /* "uint8x2" | "uint8x4" | "sint8x2" | "sint8x4" | "unorm8x2" | "unorm8x4" | "snorm8x2" | "snorm8x4" | "uint16x2" | "uint16x4" | "sint16x2" | "sint16x4" | "unorm16x2" | "unorm16x4" | "snorm16x2" | "snorm16x4" | "float16x2" | "float16x4" | "float32" | "float32x2" | "float32x3" | "float32x4" | "uint32" | "uint32x2" | "uint32x3" | "uint32x4" | "sint32" | "sint32x2" | "sint32x3" | "sint32x4" | "unorm10-10-10-2" */ + var offset: GPUSize64 + var shaderLocation: GPUIndex32 +} + +external interface GPUVertexBufferLayout { + var arrayStride: GPUSize64 + var stepMode: String? /* "vertex" | "instance" */ + get() = definedExternally + set(value) = definedExternally + var attributes: Array +} + +external interface GPUVertexState : GPUProgrammableStage { + var buffers: Array? + get() = definedExternally + set(value) = definedExternally +} + +external interface GPUBindingCommandsMixin { + fun setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup?, dynamicOffsets: Iterable = definedExternally): Nothing? + fun setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup?): Nothing? + fun setBindGroup(index: GPUIndex32, bindGroup: GPUBindGroup?, dynamicOffsetsData: Uint32Array, dynamicOffsetsDataStart: GPUSize64, dynamicOffsetsDataLength: GPUSize32): Nothing? +} + +external interface GPUCommandsMixin + +external interface GPUDebugCommandsMixin { + fun pushDebugGroup(groupLabel: String): Nothing? + fun popDebugGroup(): Nothing? + fun insertDebugMarker(markerLabel: String): Nothing? +} + +external interface GPUObjectBase { + var label: String +} + +external interface GPUPipelineBase { + fun getBindGroupLayout(index: Number): GPUBindGroupLayout +} + +external interface GPURenderCommandsMixin { + fun setPipeline(pipeline: GPURenderPipeline): Nothing? + fun setIndexBuffer(buffer: GPUBuffer, indexFormat: String /* "uint16" | "uint32" */, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun setVertexBuffer(slot: GPUIndex32, buffer: GPUBuffer?, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun draw(vertexCount: GPUSize32, instanceCount: GPUSize32 = definedExternally, firstVertex: GPUSize32 = definedExternally, firstInstance: GPUSize32 = definedExternally): Nothing? + fun drawIndexed(indexCount: GPUSize32, instanceCount: GPUSize32 = definedExternally, firstIndex: GPUSize32 = definedExternally, baseVertex: GPUSignedOffset32 = definedExternally, firstInstance: GPUSize32 = definedExternally): Nothing? + fun drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): Nothing? + fun drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): Nothing? +} + +external interface NavigatorGPU { + var gpu: GPU +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPU { + var __brand: String /* "GPU" */ + fun requestAdapter(options: GPURequestAdapterOptions = definedExternally): Promise + fun getPreferredCanvasFormat(): String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var wgslLanguageFeatures: WGSLLanguageFeatures + + companion object { + var prototype: GPU + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUAdapter { + var __brand: String /* "GPUAdapter" */ + var features: GPUSupportedFeatures + var limits: GPUSupportedLimits + var isFallbackAdapter: Boolean + fun requestDevice(descriptor: GPUDeviceDescriptor = definedExternally): Promise + fun requestAdapterInfo(): Promise + + companion object { + var prototype: GPUAdapter + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUAdapterInfo { + var __brand: String /* "GPUAdapterInfo" */ + var vendor: String + var architecture: String + var device: String + var description: String + + companion object { + var prototype: GPUAdapterInfo + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUBindGroup : GPUObjectBase { + var __brand: String /* "GPUBindGroup" */ + + companion object { + var prototype: GPUBindGroup + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUBindGroupLayout : GPUObjectBase { + var __brand: String /* "GPUBindGroupLayout" */ + + companion object { + var prototype: GPUBindGroupLayout + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUBuffer : GPUObjectBase { + var __brand: String /* "GPUBuffer" */ + var size: GPUSize64Out + var usage: GPUFlagsConstant + var mapState: String /* "unmapped" | "pending" | "mapped" */ + fun mapAsync(mode: GPUMapModeFlags, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Promise + fun getMappedRange(offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): ArrayBuffer + fun unmap(): Nothing? + fun destroy(): Nothing? + + companion object { + var prototype: GPUBuffer + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUCanvasContext { + var __brand: String /* "GPUCanvasContext" */ + var canvas: dynamic /* HTMLCanvasElement | OffscreenCanvas */ + get() = definedExternally + set(value) = definedExternally + fun configure(configuration: GPUCanvasConfiguration): Nothing? + fun unconfigure(): Nothing? + fun getCurrentTexture(): GPUTexture + + companion object { + var prototype: GPUCanvasContext + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUCommandBuffer : GPUObjectBase { + var __brand: String /* "GPUCommandBuffer" */ + + companion object { + var prototype: GPUCommandBuffer + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUCommandEncoder : GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin { + var __brand: String /* "GPUCommandEncoder" */ + fun beginRenderPass(descriptor: GPURenderPassDescriptor): GPURenderPassEncoder + fun beginComputePass(descriptor: GPUComputePassDescriptor = definedExternally): GPUComputePassEncoder + fun copyBufferToBuffer(source: GPUBuffer, sourceOffset: GPUSize64, destination: GPUBuffer, destinationOffset: GPUSize64, size: GPUSize64): Nothing? + fun copyBufferToTexture( + source: GPUImageCopyBuffer, + destination: GPUImageCopyTexture, + copySize: Array + ): Nothing? + fun copyBufferToTexture(source: GPUImageCopyBuffer, destination: GPUImageCopyTexture, copySize: GPUExtent3DDictStrict): Nothing? + fun copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: Iterable): Nothing? + fun copyTextureToBuffer(source: GPUImageCopyTexture, destination: GPUImageCopyBuffer, copySize: GPUExtent3DDictStrict): Nothing? + fun copyTextureToTexture( + source: GPUImageCopyTexture, + destination: GPUImageCopyTexture, + copySize: Array + ): Nothing? + fun copyTextureToTexture(source: GPUImageCopyTexture, destination: GPUImageCopyTexture, copySize: GPUExtent3DDictStrict): Nothing? + fun clearBuffer(buffer: GPUBuffer, offset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun resolveQuerySet(querySet: GPUQuerySet, firstQuery: GPUSize32, queryCount: GPUSize32, destination: GPUBuffer, destinationOffset: GPUSize64): Nothing? + fun finish(descriptor: GPUCommandBufferDescriptor = definedExternally): GPUCommandBuffer + + companion object { + var prototype: GPUCommandEncoder + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUCompilationInfo { + var __brand: String /* "GPUCompilationInfo" */ + var messages: Array + + companion object { + var prototype: GPUCompilationInfo + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUCompilationMessage { + var __brand: String /* "GPUCompilationMessage" */ + var message: String + var type: String /* "error" | "warning" | "info" */ + var lineNum: Number + var linePos: Number + var offset: Number + var length: Number + + companion object { + var prototype: GPUCompilationMessage + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUComputePassEncoder : GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin { + var __brand: String /* "GPUComputePassEncoder" */ + fun setPipeline(pipeline: GPUComputePipeline): Nothing? + fun dispatchWorkgroups(workgroupCountX: GPUSize32, workgroupCountY: GPUSize32 = definedExternally, workgroupCountZ: GPUSize32 = definedExternally): Nothing? + fun dispatchWorkgroupsIndirect(indirectBuffer: GPUBuffer, indirectOffset: GPUSize64): Nothing? + fun end(): Nothing? + + companion object { + var prototype: GPUComputePassEncoder + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUComputePipeline : GPUObjectBase, GPUPipelineBase { + var __brand: String /* "GPUComputePipeline" */ + + companion object { + var prototype: GPUComputePipeline + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUDevice : EventTarget, GPUObjectBase { + var __brand: String /* "GPUDevice" */ + var features: GPUSupportedFeatures + var limits: GPUSupportedLimits + var queue: GPUQueue + fun destroy(): Nothing? + fun createBuffer(descriptor: GPUBufferDescriptor): GPUBuffer + fun createTexture(descriptor: GPUTextureDescriptor): GPUTexture + fun createSampler(descriptor: GPUSamplerDescriptor = definedExternally): GPUSampler + fun importExternalTexture(descriptor: GPUExternalTextureDescriptor): GPUExternalTexture + fun createBindGroupLayout(descriptor: GPUBindGroupLayoutDescriptor): GPUBindGroupLayout + fun createPipelineLayout(descriptor: GPUPipelineLayoutDescriptor): GPUPipelineLayout + fun createBindGroup(descriptor: GPUBindGroupDescriptor): GPUBindGroup + fun createShaderModule(descriptor: GPUShaderModuleDescriptor): GPUShaderModule + fun createComputePipeline(descriptor: GPUComputePipelineDescriptor): GPUComputePipeline + fun createRenderPipeline(descriptor: GPURenderPipelineDescriptor): GPURenderPipeline + fun createComputePipelineAsync(descriptor: GPUComputePipelineDescriptor): Promise + fun createRenderPipelineAsync(descriptor: GPURenderPipelineDescriptor): Promise + fun createCommandEncoder(descriptor: GPUCommandEncoderDescriptor = definedExternally): GPUCommandEncoder + fun createRenderBundleEncoder(descriptor: GPURenderBundleEncoderDescriptor): GPURenderBundleEncoder + fun createQuerySet(descriptor: GPUQuerySetDescriptor): GPUQuerySet + var lost: Promise + fun pushErrorScope(filter: String /* "validation" | "out-of-memory" | "internal" */): Nothing? + fun popErrorScope(): Promise + var onuncapturederror: ((self: GPUDevice, ev: GPUUncapturedErrorEvent) -> Any)? + + companion object { + var prototype: GPUDevice + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUDeviceLostInfo { + var __brand: String /* "GPUDeviceLostInfo" */ + var reason: String /* "unknown" | "destroyed" */ + var message: String + + companion object { + var prototype: GPUDeviceLostInfo + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUError { + var message: String + + companion object { + var prototype: GPUError + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUExternalTexture : GPUObjectBase { + var __brand: String /* "GPUExternalTexture" */ + + companion object { + var prototype: GPUExternalTexture + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUInternalError : GPUError { + var __brand: String /* "GPUInternalError" */ + + companion object { + var prototype: GPUInternalError + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUOutOfMemoryError : GPUError { + var __brand: String /* "GPUOutOfMemoryError" */ + + companion object { + var prototype: GPUOutOfMemoryError + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUPipelineError : DOMException { + var __brand: String /* "GPUPipelineError" */ + var reason: String /* "validation" | "internal" */ + + companion object { + var prototype: GPUPipelineError + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUPipelineLayout : GPUObjectBase { + var __brand: String /* "GPUPipelineLayout" */ + + companion object { + var prototype: GPUPipelineLayout + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUQuerySet : GPUObjectBase { + var __brand: String /* "GPUQuerySet" */ + fun destroy(): Nothing? + var type: String /* "occlusion" | "timestamp" */ + var count: GPUSize32Out + + companion object { + var prototype: GPUQuerySet + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUQueue : GPUObjectBase { + var __brand: String /* "GPUQueue" */ + fun submit(commandBuffers: Array): Nothing? + fun onSubmittedWorkDone(): Promise + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBufferView, dataOffset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBufferView): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBufferView, dataOffset: GPUSize64 = definedExternally): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBuffer, dataOffset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBuffer): Nothing? + /*fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: ArrayBuffer, dataOffset: GPUSize64 = definedExternally): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: SharedArrayBuffer, dataOffset: GPUSize64 = definedExternally, size: GPUSize64 = definedExternally): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: SharedArrayBuffer): Nothing? + fun writeBuffer(buffer: GPUBuffer, bufferOffset: GPUSize64, data: SharedArrayBuffer, dataOffset: GPUSize64 = definedExternally): Nothing?*/ + fun writeTexture(destination: GPUImageCopyTexture, data: ArrayBufferView, dataLayout: GPUImageDataLayout, size: Iterable): Nothing? + fun writeTexture(destination: GPUImageCopyTexture, data: ArrayBufferView, dataLayout: GPUImageDataLayout, size: GPUExtent3DDictStrict): Nothing? + fun writeTexture(destination: GPUImageCopyTexture, data: ArrayBuffer, dataLayout: GPUImageDataLayout, size: Iterable): Nothing? + fun writeTexture(destination: GPUImageCopyTexture, data: ArrayBuffer, dataLayout: GPUImageDataLayout, size: GPUExtent3DDictStrict): Nothing? + + /*fun writeTexture(destination: GPUImageCopyTexture, data: SharedArrayBuffer, dataLayout: GPUImageDataLayout, size: Iterable): Nothing? + fun writeTexture(destination: GPUImageCopyTexture, data: SharedArrayBuffer, dataLayout: GPUImageDataLayout, size: GPUExtent3DDictStrict): Nothing?*/ + fun copyExternalImageToTexture( + source: GPUImageCopyExternalImage, + destination: GPUImageCopyTextureTagged, + copySize: Array + ): Nothing? + fun copyExternalImageToTexture(source: GPUImageCopyExternalImage, destination: GPUImageCopyTextureTagged, copySize: GPUExtent3DDictStrict): Nothing? + + companion object { + var prototype: GPUQueue + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPURenderBundle : GPUObjectBase { + var __brand: String /* "GPURenderBundle" */ + + companion object { + var prototype: GPURenderBundle + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPURenderBundleEncoder : GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin { + var __brand: String /* "GPURenderBundleEncoder" */ + fun finish(descriptor: GPURenderBundleDescriptor = definedExternally): GPURenderBundle + + companion object { + var prototype: GPURenderBundleEncoder + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPURenderPassEncoder : GPUObjectBase, GPUCommandsMixin, GPUDebugCommandsMixin, GPUBindingCommandsMixin, GPURenderCommandsMixin { + var __brand: String /* "GPURenderPassEncoder" */ + fun setViewport(x: Number, y: Number, width: Number, height: Number, minDepth: Number, maxDepth: Number): Nothing? + fun setScissorRect(x: GPUIntegerCoordinate, y: GPUIntegerCoordinate, width: GPUIntegerCoordinate, height: GPUIntegerCoordinate): Nothing? + fun setBlendConstant(color: Iterable): Nothing? + fun setBlendConstant(color: GPUColorDict): Nothing? + fun setStencilReference(reference: GPUStencilValue): Nothing? + fun beginOcclusionQuery(queryIndex: GPUSize32): Nothing? + fun endOcclusionQuery(): Nothing? + fun executeBundles(bundles: Iterable): Nothing? + fun end(): Nothing? + + companion object { + var prototype: GPURenderPassEncoder + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPURenderPipeline : GPUObjectBase, GPUPipelineBase { + var __brand: String /* "GPURenderPipeline" */ + + companion object { + var prototype: GPURenderPipeline + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUSampler : GPUObjectBase { + var __brand: String /* "GPUSampler" */ + + companion object { + var prototype: GPUSampler + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUShaderModule : GPUObjectBase { + var __brand: String /* "GPUShaderModule" */ + fun getCompilationInfo(): Promise + + companion object { + var prototype: GPUShaderModule + } +} + +typealias GPUSupportedFeatures = ReadonlySet + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUSupportedLimits { + var __brand: String /* "GPUSupportedLimits" */ + var maxTextureDimension1D: Number + var maxTextureDimension2D: Number + var maxTextureDimension3D: Number + var maxTextureArrayLayers: Number + var maxBindGroups: Number + var maxBindGroupsPlusVertexBuffers: Number + var maxBindingsPerBindGroup: Number + var maxDynamicUniformBuffersPerPipelineLayout: Number + var maxDynamicStorageBuffersPerPipelineLayout: Number + var maxSampledTexturesPerShaderStage: Number + var maxSamplersPerShaderStage: Number + var maxStorageBuffersPerShaderStage: Number + var maxStorageTexturesPerShaderStage: Number + var maxUniformBuffersPerShaderStage: Number + var maxUniformBufferBindingSize: Number + var maxStorageBufferBindingSize: Number + var minUniformBufferOffsetAlignment: Number + var minStorageBufferOffsetAlignment: Number + var maxVertexBuffers: Number + var maxBufferSize: Number + var maxVertexAttributes: Number + var maxVertexBufferArrayStride: Number + var maxInterStageShaderComponents: Number + var maxInterStageShaderVariables: Number + var maxColorAttachments: Number + var maxColorAttachmentBytesPerSample: Number + var maxComputeWorkgroupStorageSize: Number + var maxComputeInvocationsPerWorkgroup: Number + var maxComputeWorkgroupSizeX: Number + var maxComputeWorkgroupSizeY: Number + var maxComputeWorkgroupSizeZ: Number + var maxComputeWorkgroupsPerDimension: Number + + companion object { + var prototype: GPUSupportedLimits + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUTexture : GPUObjectBase { + var __brand: String /* "GPUTexture" */ + fun createView(descriptor: GPUTextureViewDescriptor = definedExternally): GPUTextureView + fun destroy(): Nothing? + var width: GPUIntegerCoordinateOut + var height: GPUIntegerCoordinateOut + var depthOrArrayLayers: GPUIntegerCoordinateOut + var mipLevelCount: GPUIntegerCoordinateOut + var sampleCount: GPUSize32Out + var dimension: String /* "1d" | "2d" | "3d" */ + var format: String /* "r8unorm" | "r8snorm" | "r8uint" | "r8sint" | "r16uint" | "r16sint" | "r16float" | "rg8unorm" | "rg8snorm" | "rg8uint" | "rg8sint" | "r32uint" | "r32sint" | "r32float" | "rg16uint" | "rg16sint" | "rg16float" | "rgba8unorm" | "rgba8unorm-srgb" | "rgba8snorm" | "rgba8uint" | "rgba8sint" | "bgra8unorm" | "bgra8unorm-srgb" | "rgb9e5ufloat" | "rgb10a2uint" | "rgb10a2unorm" | "rg11b10ufloat" | "rg32uint" | "rg32sint" | "rg32float" | "rgba16uint" | "rgba16sint" | "rgba16float" | "rgba32uint" | "rgba32sint" | "rgba32float" | "stencil8" | "depth16unorm" | "depth24plus" | "depth24plus-stencil8" | "depth32float" | "depth32float-stencil8" | "bc1-rgba-unorm" | "bc1-rgba-unorm-srgb" | "bc2-rgba-unorm" | "bc2-rgba-unorm-srgb" | "bc3-rgba-unorm" | "bc3-rgba-unorm-srgb" | "bc4-r-unorm" | "bc4-r-snorm" | "bc5-rg-unorm" | "bc5-rg-snorm" | "bc6h-rgb-ufloat" | "bc6h-rgb-float" | "bc7-rgba-unorm" | "bc7-rgba-unorm-srgb" | "etc2-rgb8unorm" | "etc2-rgb8unorm-srgb" | "etc2-rgb8a1unorm" | "etc2-rgb8a1unorm-srgb" | "etc2-rgba8unorm" | "etc2-rgba8unorm-srgb" | "eac-r11unorm" | "eac-r11snorm" | "eac-rg11unorm" | "eac-rg11snorm" | "astc-4x4-unorm" | "astc-4x4-unorm-srgb" | "astc-5x4-unorm" | "astc-5x4-unorm-srgb" | "astc-5x5-unorm" | "astc-5x5-unorm-srgb" | "astc-6x5-unorm" | "astc-6x5-unorm-srgb" | "astc-6x6-unorm" | "astc-6x6-unorm-srgb" | "astc-8x5-unorm" | "astc-8x5-unorm-srgb" | "astc-8x6-unorm" | "astc-8x6-unorm-srgb" | "astc-8x8-unorm" | "astc-8x8-unorm-srgb" | "astc-10x5-unorm" | "astc-10x5-unorm-srgb" | "astc-10x6-unorm" | "astc-10x6-unorm-srgb" | "astc-10x8-unorm" | "astc-10x8-unorm-srgb" | "astc-10x10-unorm" | "astc-10x10-unorm-srgb" | "astc-12x10-unorm" | "astc-12x10-unorm-srgb" | "astc-12x12-unorm" | "astc-12x12-unorm-srgb" */ + var usage: GPUFlagsConstant + + companion object { + var prototype: GPUTexture + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUTextureView : GPUObjectBase { + var __brand: String /* "GPUTextureView" */ + + companion object { + var prototype: GPUTextureView + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUUncapturedErrorEvent : Event { + var __brand: String /* "GPUUncapturedErrorEvent" */ + var error: GPUError + + companion object { + var prototype: GPUUncapturedErrorEvent + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUValidationError : GPUError { + var __brand: String /* "GPUValidationError" */ + + companion object { + var prototype: GPUValidationError + } +} + +typealias WGSLLanguageFeatures = ReadonlySet + +external interface WorkerNavigator : NavigatorGPU + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUBufferUsage { + var __brand: String /* "GPUBufferUsage" */ + var MAP_READ: GPUFlagsConstant + var MAP_WRITE: GPUFlagsConstant + var COPY_SRC: GPUFlagsConstant + var COPY_DST: GPUFlagsConstant + var INDEX: GPUFlagsConstant + var VERTEX: GPUFlagsConstant + var UNIFORM: GPUFlagsConstant + var STORAGE: GPUFlagsConstant + var INDIRECT: GPUFlagsConstant + var QUERY_RESOLVE: GPUFlagsConstant + + companion object { + var prototype: GPUBufferUsage + var MAP_READ: GPUFlagsConstant + var MAP_WRITE: GPUFlagsConstant + var COPY_SRC: GPUFlagsConstant + var COPY_DST: GPUFlagsConstant + var INDEX: GPUFlagsConstant + var VERTEX: GPUFlagsConstant + var UNIFORM: GPUFlagsConstant + var STORAGE: GPUFlagsConstant + var INDIRECT: GPUFlagsConstant + var QUERY_RESOLVE: GPUFlagsConstant + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUColorWrite { + var __brand: String /* "GPUColorWrite" */ + var RED: GPUFlagsConstant + var GREEN: GPUFlagsConstant + var BLUE: GPUFlagsConstant + var ALPHA: GPUFlagsConstant + var ALL: GPUFlagsConstant + + companion object { + var prototype: GPUColorWrite + var RED: GPUFlagsConstant + var GREEN: GPUFlagsConstant + var BLUE: GPUFlagsConstant + var ALPHA: GPUFlagsConstant + var ALL: GPUFlagsConstant + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUMapMode { + var __brand: String /* "GPUMapMode" */ + var READ: GPUFlagsConstant + var WRITE: GPUFlagsConstant + + companion object { + var prototype: GPUMapMode + var READ: GPUFlagsConstant + var WRITE: GPUFlagsConstant + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUShaderStage { + var __brand: String /* "GPUShaderStage" */ + var VERTEX: GPUFlagsConstant + var FRAGMENT: GPUFlagsConstant + var COMPUTE: GPUFlagsConstant + + companion object { + var prototype: GPUShaderStage + var VERTEX: GPUFlagsConstant + var FRAGMENT: GPUFlagsConstant + var COMPUTE: GPUFlagsConstant + } +} + +@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE") +external interface GPUTextureUsage { + var __brand: String /* "GPUTextureUsage" */ + var COPY_SRC: GPUFlagsConstant + var COPY_DST: GPUFlagsConstant + var TEXTURE_BINDING: GPUFlagsConstant + var STORAGE_BINDING: GPUFlagsConstant + var RENDER_ATTACHMENT: GPUFlagsConstant + + companion object { + var prototype: GPUTextureUsage + var COPY_SRC: GPUFlagsConstant + var COPY_DST: GPUFlagsConstant + var TEXTURE_BINDING: GPUFlagsConstant + var STORAGE_BINDING: GPUFlagsConstant + var RENDER_ATTACHMENT: GPUFlagsConstant + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Adapter.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Adapter.jvm.kt new file mode 100644 index 00000000..af88a589 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Adapter.jvm.kt @@ -0,0 +1,32 @@ +package io.ygdrasil.wgpu + +import com.sun.jna.Pointer +import io.ygdrasil.wgpu.internal.jvm.* +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.update + +actual class Adapter(internal val handler: WGPUAdapterImpl) : AutoCloseable { + + actual suspend fun requestDevice(): Device? { + val deviceState = MutableStateFlow(null) + + val handleRequestDevice = object : WGPURequestDeviceCallback { + override fun invoke(statusAsInt: Int, device: WGPUDeviceImpl, message: String?, param4: Pointer?) { + val status = WGPURequestDeviceStatus.of(statusAsInt) + if (status == WGPURequestDeviceStatus.WGPURequestDeviceStatus_Success) { + deviceState.update { device } + } else { + println(" request_device status=%#.8x message=%s\n".format(status, message)) + } + } + } + + wgpuAdapterRequestDevice(handler, null, handleRequestDevice, null) + + return deviceState.value?.let { Device(it) } + } + + override fun close() { + wgpuAdapterRelease(handler) + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/BindGroup.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/BindGroup.jvm.kt new file mode 100644 index 00000000..b24f3a27 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/BindGroup.jvm.kt @@ -0,0 +1,11 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.jvm.WGPUBindGroup +import io.ygdrasil.wgpu.internal.jvm.wgpuBindGroupRelease + +actual class BindGroup(internal val handler: WGPUBindGroup) : AutoCloseable { + + override fun close() { + wgpuBindGroupRelease(handler) + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/BindGroupLayout.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/BindGroupLayout.jvm.kt new file mode 100644 index 00000000..53742ca8 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/BindGroupLayout.jvm.kt @@ -0,0 +1,5 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.jvm.WGPUBindGroupLayout + +actual class BindGroupLayout(internal val handler: WGPUBindGroupLayout) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Buffer.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Buffer.jvm.kt new file mode 100644 index 00000000..c2e9cf83 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Buffer.jvm.kt @@ -0,0 +1,32 @@ +package io.ygdrasil.wgpu + +import com.sun.jna.NativeLong +import io.ygdrasil.wgpu.internal.jvm.* + +actual class Buffer(internal val handler: WGPUBuffer) : AutoCloseable { + + actual val size: GPUSize64 + get() = wgpuBufferGetSize(handler) + + actual fun getMappedRange(offset: GPUSize64?, size: GPUSize64?): ByteArray { + wgpuBufferGetMappedRange(handler, offset?.toNativeLong(), size?.toNativeLong()) + TODO() + } + + actual fun unmap() { + wgpuBufferUnmap(handler) + } + + actual fun map(buffer: FloatArray) { + (wgpuBufferGetMappedRange(handler, NativeLong(0), (buffer.size * Float.SIZE_BYTES).toNativeLong()) + ?: error("fail to get mapped range")) + .write(0L, buffer, 0, buffer.size) + } + + override fun close() { + wgpuBufferRelease(handler) + } + +} + + diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/CommandBuffer.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/CommandBuffer.jvm.kt new file mode 100644 index 00000000..1af8c2ae --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/CommandBuffer.jvm.kt @@ -0,0 +1,10 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.jvm.WGPUCommandBuffer +import io.ygdrasil.wgpu.internal.jvm.wgpuCommandBufferRelease + +actual class CommandBuffer(internal val handler: WGPUCommandBuffer) : AutoCloseable { + override fun close() { + wgpuCommandBufferRelease(handler) + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/CommandEncoder.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/CommandEncoder.jvm.kt new file mode 100644 index 00000000..7abf1aa9 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/CommandEncoder.jvm.kt @@ -0,0 +1,82 @@ +package io.ygdrasil.wgpu + +import com.sun.jna.NativeLong +import io.ygdrasil.wgpu.internal.jvm.* + +actual class CommandEncoder(internal val handler: WGPUCommandEncoder) : AutoCloseable { + actual fun beginRenderPass(renderPassDescriptor: RenderPassDescriptor): RenderPassEncoder { + return RenderPassEncoder( + wgpuCommandEncoderBeginRenderPass(handler, renderPassDescriptor.convert()) + ?: error("fail to get RenderPassEncoder") + ) + } + + actual fun finish(): CommandBuffer { + return CommandBuffer( + wgpuCommandEncoderFinish(handler, WGPUCommandBufferDescriptor()) + ?: error("fail to get CommandBuffer") + ) + } + + actual fun copyTextureToTexture( + source: ImageCopyTexture, + destination: ImageCopyTexture, + copySize: GPUIntegerCoordinates + ) { + wgpuCommandEncoderCopyTextureToTexture( + handler, + source.convert(), + destination.convert(), + copySize.convert() + ) + } + + override fun close() { + wgpuCommandEncoderRelease(handler) + } + +} + +private fun Pair.convert(): WGPUExtent3D = WGPUExtent3D().also { + it.height = first + it.width = second +} + +private fun ImageCopyTexture.convert(): WGPUImageCopyTexture = WGPUImageCopyTexture().also { + + it.texture = texture.handler + it.mipLevel = mipLevel + it.origin = origin?.let { (x, y) -> + WGPUOrigin3D().also { + it.x = x + it.y = y + } + } + it.aspect = aspect?.value +} + +private fun RenderPassDescriptor.convert(): WGPURenderPassDescriptor = WGPURenderPassDescriptor().also { + it.colorAttachmentCount = NativeLong(colorAttachments.size.toLong()) + it.colorAttachments = colorAttachments.map { it.convert() }.toTypedArray() + it.label = label + /*override var depthStencilAttachment: GPURenderPassDepthStencilAttachment? +override var occlusionQuerySet: GPUQuerySet? +override var timestampWrites: GPURenderPassTimestampWrites? +override var maxDrawCount: GPUSize64?*/ +} + +private fun RenderPassDescriptor.ColorAttachment.convert(): WGPURenderPassColorAttachment.ByReference = + WGPURenderPassColorAttachment.ByReference().also { + it.view = view.handler + it.loadOp = WGPULoadOp.WGPULoadOp_Clear.value + it.storeOp = WGPUStoreOp.WGPUStoreOp_Store.value + it.resolveTarget = resolveTarget?.handler + it.clearValue = clearValue?.let { clearValue -> + WGPUColor().apply { + r = clearValue.get(0).toDouble() + g = clearValue.get(1).toDouble() + b = clearValue.get(2).toDouble() + a = clearValue.get(3).toDouble() + } + } + } diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Device.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Device.jvm.kt new file mode 100644 index 00000000..1c29ced9 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Device.jvm.kt @@ -0,0 +1,174 @@ +package io.ygdrasil.wgpu + +import com.sun.jna.NativeLong +import com.sun.jna.Pointer +import dev.krud.shapeshift.transformer.base.MappingTransformer +import io.ygdrasil.wgpu.internal.jvm.* + +actual class Device(internal val handler: WGPUDeviceImpl) : AutoCloseable { + + actual val queue: Queue by lazy { Queue(wgpuDeviceGetQueue(handler) ?: error("fail to get device queue")) } + + actual fun createCommandEncoder(descriptor: CommandEncoderDescriptor?): CommandEncoder = + wgpuDeviceCreateCommandEncoder(handler, descriptor?.convert()) + ?.let(::CommandEncoder) ?: error("fail to create command encoder") + + + actual fun createShaderModule(descriptor: ShaderModuleDescriptor): ShaderModule = + wgpuDeviceCreateShaderModule(handler, descriptor.convert()) + ?.let(::ShaderModule) ?: error("fail to create shader module") + + + actual fun createPipelineLayout(descriptor: PipelineLayoutDescriptor): PipelineLayout = + wgpuDeviceCreatePipelineLayout(handler, descriptor.convert()) + ?.let(::PipelineLayout) ?: error("fail to create pipeline layout") + + actual fun createRenderPipeline(descriptor: RenderPipelineDescriptor): RenderPipeline = + descriptor.convert() + .let { wgpuDeviceCreateRenderPipeline(handler, it) } + ?.let(::RenderPipeline) ?: error("fail to create render pipeline") + + actual fun createBuffer(descriptor: BufferDescriptor): Buffer = + descriptor.convert() + .let { wgpuDeviceCreateBuffer(handler, it) } + ?.let(::Buffer) ?: error("fail to create buffer") + + actual fun createBindGroup(descriptor: BindGroupDescriptor): BindGroup = + bindGroupDescriptorMapper.map(descriptor) + .let { wgpuDeviceCreateBindGroup(handler, it) } + ?.let(::BindGroup) ?: error("fail to create bind group") + + actual fun createTexture(descriptor: TextureDescriptor): Texture = + textureDescriptorMapper.map(descriptor) + .let { wgpuDeviceCreateTexture(handler, it) } + ?.let(::Texture) ?: error("fail to create texture") + + actual fun createSampler(descriptor: SamplerDescriptor): Sampler = + samplerDescriptorMapper.map(descriptor) + .let { wgpuDeviceCreateSampler(handler, it) } + ?.let(::Sampler) ?: error("fail to create texture") + + override fun close() { + wgpuDeviceRelease(handler) + } + +} + +private val textureDescriptorMapper = mapper { + TextureDescriptor::format mappedTo WGPUTextureDescriptor::format withTransformer EnumerationTransformer() + TextureDescriptor::dimension mappedTo WGPUTextureDescriptor::dimension withTransformer EnumerationTransformer() + TextureDescriptor::size mappedTo WGPUTextureDescriptor::size withTransformer GPUExtent3DDictStrictTransformer() +} + +private val samplerDescriptorMapper = mapper { } + +private val bindGroupDescriptorMapper = mapper { + BindGroupDescriptor::layout mappedTo WGPUBindGroupDescriptor::layout withTransformer BindGroupLayoutTransformer() + BindGroupDescriptor::entries mappedTo WGPUBindGroupDescriptor::entries withTransformer MappingTransformer, Array> { context -> + context.originalValue?.toStructureArray { bindGroupEntry -> + binding = bindGroupEntry.binding + when (val resource = bindGroupEntry.resource) { + is BindGroupDescriptor.BufferBinding -> { + size = resource.size + offset = resource.offset + buffer = resource.buffer.handler + } + + is BindGroupDescriptor.SamplerBinding -> sampler = resource.sampler.handler + is BindGroupDescriptor.TextureViewBinding -> textureView = resource.view.handler + } + } + } +} + + +private fun BufferDescriptor.convert(): WGPUBufferDescriptor = WGPUBufferDescriptor().also { + it.usage = usage + it.size = size + it.mappedAtCreation = mappedAtCreation?.toInt() +} + +private fun RenderPipelineDescriptor.VertexState.VertexBufferLayout.convert(): WGPUVertexBufferLayout.ByReference = + WGPUVertexBufferLayout.ByReference().also { + it.arrayStride = arrayStride + it.attributeCount = attributes.size.toNativeLong() + it.attributes = WGPUVertexAttribute.ByReference() + .toArray(attributes.size) + .let { it as Array } + .also { + it.forEachIndexed { index, structure -> structure.updateFrom(attributes[index]) } + } + + it.stepMode = stepMode?.value + } + +private fun WGPUVertexAttribute.ByReference.updateFrom(vertexAttribute: RenderPipelineDescriptor.VertexState.VertexBufferLayout.VertexAttribute) { + format = vertexAttribute.format.value + offset = vertexAttribute.offset + shaderLocation = vertexAttribute.shaderLocation +} + +private fun RenderPipelineDescriptor.convert(): WGPURenderPipelineDescriptor = WGPURenderPipelineDescriptor().also { + it.vertex = WGPUVertexState().also { wGPUVertexState -> + wGPUVertexState.module = vertex.module.handler + wGPUVertexState.entryPoint = vertex.entryPoint ?: "main" + wGPUVertexState.bufferCount = (vertex.buffers?.size ?: 0).toNativeLong() + wGPUVertexState.buffers = if (wGPUVertexState.bufferCount.toLong() == 0L) { + arrayOf(WGPUVertexBufferLayout.ByReference()) + } else { + vertex.buffers?.map { it.convert() }?.toTypedArray() + } + } + it.layout = layout?.handler + it.label = label + it.primitive = WGPUPrimitiveState().also { wgpuPrimitiveState -> + wgpuPrimitiveState.topology = primitive?.topology?.value + wgpuPrimitiveState.stripIndexFormat = primitive?.stripIndexFormat?.value + wgpuPrimitiveState.frontFace = primitive?.frontFace?.value + wgpuPrimitiveState.cullMode = primitive?.cullMode?.value + // TODO find how to map this + //wgpuPrimitiveState.unclippedDepth = primitive.unclippedDepth + } + + +// it.depthStencil = this@convert.depthStencil?.convert() + it.fragment = fragment?.convert() + + it.multisample = WGPUMultisampleState().also { wgpuMultisampleState -> + wgpuMultisampleState.count = multisample?.count + wgpuMultisampleState.mask = multisample?.mask + wgpuMultisampleState.alphaToCoverageEnabled = multisample?.alphaToCoverageEnabled?.let { + if (it) 1 else 0 + } + } +} + +private fun RenderPipelineDescriptor.FragmentState.convert(): WGPUFragmentState.ByReference = + WGPUFragmentState.ByReference().also { + it.module = module.handler + it.entryPoint = entryPoint ?: "main" + it.targetCount = targets.filterNotNull().size.toLong().let { NativeLong(it) } + it.targets = targets.filterNotNull().map { it.convert() }.toTypedArray() + } + +private fun RenderPipelineDescriptor.FragmentState.ColorTargetState.convert(): WGPUColorTargetState.ByReference = + WGPUColorTargetState.ByReference().also { + it.format = format.value + it.blend = blend?.convert() + it.writeMask = writeMask?.value + } + +private fun RenderPipelineDescriptor.FragmentState.ColorTargetState.BlendState.convert(): Pointer? { + TODO("Not yet implemented") +} + +private fun PipelineLayoutDescriptor.convert(): WGPUPipelineLayoutDescriptor = WGPUPipelineLayoutDescriptor().also { + it.label = label + // TODO find how to map this + //it.bindGroupLayoutCount = bindGroupLayouts.size.toLong().let { NativeLong(it) } + //it.bindGroupLayouts = bindGroupLayouts.map { it.convert() }.toTypedArray() +} + +private fun CommandEncoderDescriptor.convert(): WGPUCommandEncoderDescriptor = WGPUCommandEncoderDescriptor().also { + it.label = label +} diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Pipeline.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Pipeline.jvm.kt new file mode 100644 index 00000000..64dc2d25 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Pipeline.jvm.kt @@ -0,0 +1,21 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.jvm.* + +actual class PipelineLayout(internal val handler: WGPUPipelineLayout) + +actual class RenderPipeline(internal val handler: WGPURenderPipeline) : AutoCloseable { + + actual fun getBindGroupLayout(index: Int): BindGroupLayout = + wgpuRenderPipelineGetBindGroupLayout(handler, index) + ?.let { BindGroupLayout(it) } ?: error("fail to get bindgroup layout") + + override fun close() { + wgpuRenderPipelineRelease(handler) + } + +} + +private fun WGPUBindGroupLayoutImpl.convert(): PipelineLayoutDescriptor.BindGroupLayout { + TODO("Not yet implemented") +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Queue.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Queue.jvm.kt new file mode 100644 index 00000000..50effc01 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Queue.jvm.kt @@ -0,0 +1,71 @@ +package io.ygdrasil.wgpu + +import com.sun.jna.Memory +import com.sun.jna.NativeLong +import com.sun.jna.Pointer +import io.ygdrasil.wgpu.internal.jvm.* + +actual class Queue(internal val handler: WGPUQueue) { + + actual fun submit(commandsBuffer: Array) { + wgpuQueueSubmit( + handler, + NativeLong(commandsBuffer.size.toLong()), + commandsBuffer.map { it.handler }.toTypedArray() + ) + } + + actual fun writeBuffer( + buffer: Buffer, + bufferOffset: GPUSize64, + data: FloatArray, + dataOffset: GPUSize64, + size: GPUSize64 + ) { + wgpuQueueWriteBuffer( + handler, + buffer.handler, + bufferOffset, + data.toBuffer(dataOffset), + size.toNativeLong() + ) + } + + actual fun copyExternalImageToTexture( + source: ImageCopyExternalImage, + destination: ImageCopyTextureTagged, + copySize: GPUIntegerCoordinates + ) { + wgpuQueueWriteTexture( + handler, + destination.convert(), + null, + NativeLong(0), + null, + null + ) //TODO + } + + + private fun FloatArray.toBuffer(dataOffset: GPUSize64): Pointer? { + //Multiply by 4 because of 4 bytes per float + return Memory(size * 4L).apply { + write(0L, this@toBuffer, dataOffset.toInt(), size) + } + } + +} + +private fun ImageCopyTextureTagged.convert(): WGPUImageCopyTexture = WGPUImageCopyTexture().also { + TODO("Not yet implemented") +} + + +actual class ImageBitmapHolder(val data: Any) : DrawableHolder { + actual val width: Int + get() = TODO("Not yet implemented") + actual val height: Int + get() = TODO("Not yet implemented") +} + +actual sealed interface DrawableHolder \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/RenderPassEncoder.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/RenderPassEncoder.jvm.kt new file mode 100644 index 00000000..f1427c2a --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/RenderPassEncoder.jvm.kt @@ -0,0 +1,47 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.jvm.* + +actual class RenderPassEncoder(private val handler: WGPURenderPassEncoder) : AutoCloseable { + actual fun end() { + wgpuRenderPassEncoderEnd(handler) + } + + actual fun setPipeline(renderPipeline: RenderPipeline) { + wgpuRenderPassEncoderSetPipeline(handler, renderPipeline.handler) + } + + actual fun draw( + vertexCount: GPUSize32, + instanceCount: GPUSize32?, + firstVertex: GPUSize32?, + firstInstance: GPUSize32? + ) { + wgpuRenderPassEncoderDraw(handler, vertexCount, instanceCount ?: 1, firstVertex ?: 0, firstInstance ?: 0) + } + + actual fun setBindGroup(index: Int, bindGroup: BindGroup) { + wgpuRenderPassEncoderSetBindGroup( + handler, + index, + bindGroup.handler, + 0L.toNativeLong(), + null + ) + } + + actual fun setVertexBuffer(slot: Int, buffer: Buffer) { + wgpuRenderPassEncoderSetVertexBuffer( + handler, + slot, + buffer.handler, + 0L, + buffer.size + ) + } + + override fun close() { + wgpuRenderPassEncoderRelease(handler) + } + +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/RenderingContext.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/RenderingContext.jvm.kt new file mode 100644 index 00000000..e56f065d --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/RenderingContext.jvm.kt @@ -0,0 +1,56 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.jvm.* + +actual class RenderingContext( + internal val handler: WGPUSurface, + private val sizeProvider: () -> Pair +) : AutoCloseable { + + private val surfaceCapabilities = WGPUSurfaceCapabilities() + actual val width: Int + get() = sizeProvider().first + actual val height: Int + get() = sizeProvider().second + + actual val textureFormat: TextureFormat by lazy { + surfaceCapabilities.formats?.getInt(0) + ?.let { TextureFormat.of(it) ?: error("texture format not found") } + ?: error("call first computeSurfaceCapabilities") + } + + actual fun getCurrentTexture(): Texture { + val surfaceTexture = WGPUSurfaceTexture() + wgpuSurfaceGetCurrentTexture(handler, surfaceTexture) + return Texture(surfaceTexture.texture) + } + + actual fun present() { + wgpuSurfacePresent(handler) + } + + fun computeSurfaceCapabilities(adapter: Adapter) { + wgpuSurfaceGetCapabilities(handler, adapter.handler, surfaceCapabilities) + } + + actual fun configure(canvasConfiguration: CanvasConfiguration) { + + if (surfaceCapabilities.formats == null) error("call computeSurfaceCapabilities(adapter: Adapter) before configure") + + wgpuSurfaceConfigure(handler, canvasConfiguration.convert()) + } + + override fun close() { + wgpuSurfaceRelease(handler) + } + + private fun CanvasConfiguration.convert(): WGPUSurfaceConfiguration = WGPUSurfaceConfiguration().also { + it.device = device.handler + it.usage = usage ?: WGPUTextureUsage.WGPUTextureUsage_RenderAttachment.value + it.format = format?.value ?: textureFormat.value + it.presentMode = WGPUPresentMode.WGPUPresentMode_Fifo.value + it.alphaMode = alphaMode?.value ?: surfaceCapabilities.alphaModes?.getInt(0) ?: error("") + it.width = width + it.height = height + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Sampler.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Sampler.jvm.kt new file mode 100644 index 00000000..c9313706 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Sampler.jvm.kt @@ -0,0 +1,11 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.jvm.WGPUSampler +import io.ygdrasil.wgpu.internal.jvm.wgpuSamplerRelease + +actual class Sampler(internal val handler: WGPUSampler?) : AutoCloseable { + + override fun close() { + wgpuSamplerRelease(handler) + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/ShaderModule.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/ShaderModule.jvm.kt new file mode 100644 index 00000000..1bccc135 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/ShaderModule.jvm.kt @@ -0,0 +1,29 @@ +package io.ygdrasil.wgpu + +import com.sun.jna.NativeLong +import io.ygdrasil.wgpu.internal.jvm.* + +actual class ShaderModule(internal val handler: WGPUShaderModule) : AutoCloseable { + override fun close() { + wgpuShaderModuleRelease(handler) + } +} + + +internal fun ShaderModuleDescriptor.convert(): WGPUShaderModuleDescriptor = WGPUShaderModuleDescriptor().also { + it.label = label + it.nextInChain = WGPUShaderModuleWGSLDescriptor.ByReference().also { + it.code = code + it.chain.apply { + sType = WGPUSType.WGPUSType_ShaderModuleWGSLDescriptor.value + } + } + it.hintCount = compilationHints?.let { NativeLong(it.size.toLong()) } ?: NativeLong(0) + it.hints = + compilationHints?.map { it.convert() }?.toTypedArray() ?: arrayOf(WGPUShaderModuleCompilationHint.ByReference()) + +} + +private fun ShaderModuleDescriptor.CompilationHint.convert() = WGPUShaderModuleCompilationHint.ByReference().also { + TODO("no yet implemented") +} diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Texture.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Texture.jvm.kt new file mode 100644 index 00000000..d765a214 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/Texture.jvm.kt @@ -0,0 +1,24 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.jvm.WGPUTexture +import io.ygdrasil.wgpu.internal.jvm.WGPUTextureViewDescriptor +import io.ygdrasil.wgpu.internal.jvm.wgpuTextureCreateView +import io.ygdrasil.wgpu.internal.jvm.wgpuTextureRelease + + +actual class Texture(internal val handler: WGPUTexture) : AutoCloseable { + actual fun createView(descriptor: TextureViewDescriptor?): TextureView { + return TextureView( + wgpuTextureCreateView(handler, descriptor?.convert()) + ?: error("fail to create texture view") + ) + } + + override fun close() { + wgpuTextureRelease(handler) + } +} + +private fun TextureViewDescriptor?.convert(): WGPUTextureViewDescriptor? = WGPUTextureViewDescriptor().also { + // TODO +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/TextureView.jvm.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/TextureView.jvm.kt new file mode 100644 index 00000000..481a4a26 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/TextureView.jvm.kt @@ -0,0 +1,10 @@ +package io.ygdrasil.wgpu + +import io.ygdrasil.wgpu.internal.jvm.WGPUTextureView +import io.ygdrasil.wgpu.internal.jvm.wgpuTextureViewRelease + +actual class TextureView(internal val handler: WGPUTextureView) : AutoCloseable { + override fun close() { + wgpuTextureViewRelease(handler) + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/WGPU.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/WGPU.kt new file mode 100644 index 00000000..f661bfeb --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/WGPU.kt @@ -0,0 +1,60 @@ +package io.ygdrasil.wgpu + +import com.sun.jna.Pointer +import io.ygdrasil.libsdl.SDL_Window +import io.ygdrasil.wgpu.internal.jvm.* +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.update + +class WGPU(private val handler: WGPUInstance) : AutoCloseable { + override fun close() { + wgpuInstanceRelease(handler) + } + + suspend fun requestAdapter( + renderingContext: RenderingContext, + powerPreference: WGPUPowerPreference = WGPUPowerPreference.WGPUPowerPreference_Undefined + ): Adapter? { + + val options = WGPURequestAdapterOptions().also { + it.compatibleSurface = renderingContext.handler + it.powerPreference = powerPreference.value + } + + val adapterState = MutableStateFlow(null) + + val handleRequestAdapter = object : WGPURequestAdapterCallback { + override fun invoke(statusAsInt: Int, adapter: WGPUAdapterImpl, message: String?, param4: Pointer?) { + val status = WGPURequestAdapterStatus.of(statusAsInt) + if (status == WGPURequestAdapterStatus.WGPURequestAdapterStatus_Success) { + adapterState.update { adapter } + } else { + println("request_adapter status=%.8X message=%s\n".format(status, message)) + } + } + } + wgpuInstanceRequestAdapter(handler, options, handleRequestAdapter, null) + + return adapterState.value?.let { Adapter(it) } + } + + // TODO remove + fun getSurface(window: SDL_Window): WGPUSurface? { + return SDL_GetWGPUSurface(handler, window) + } + + fun getSurfaceFromMetalLayer(layer: Pointer): WGPUSurface? { + val surfaceDescriptor = WGPUDarwinSurfaceDescriptor() + surfaceDescriptor.nextInChain.let { metalLayerDescriptor -> + metalLayerDescriptor.chain.sType = WGPUSType.WGPUSType_SurfaceDescriptorFromMetalLayer.value + metalLayerDescriptor.layer = layer + } + + return wgpuInstanceCreateSurface(handler, surfaceDescriptor) + } + + companion object { + fun createInstance() = wgpuCreateInstance(null) + ?.let { WGPU(it) } + } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/helpers.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/helpers.kt new file mode 100644 index 00000000..2e07de8c --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/helpers.kt @@ -0,0 +1,52 @@ +package io.ygdrasil.wgpu + +import com.sun.jna.NativeLong +import com.sun.jna.Structure +import dev.krud.shapeshift.ShapeShiftBuilder +import dev.krud.shapeshift.dsl.KotlinDslMappingDefinitionBuilder +import dev.krud.shapeshift.enums.AutoMappingStrategy +import dev.krud.shapeshift.transformer.base.MappingTransformer +import dev.krud.shapeshift.transformer.base.MappingTransformerContext +import io.ygdrasil.wgpu.internal.jvm.WGPUBindGroupLayout +import io.ygdrasil.wgpu.internal.jvm.WGPUExtent3D + +internal fun Long.toNativeLong(): NativeLong = let(::NativeLong) +internal fun Int.toNativeLong(): NativeLong = toLong() + .let(::NativeLong) + +class EnumerationTransformer : MappingTransformer { + override fun transform(context: MappingTransformerContext): Int? { + return context.originalValue?.value + } +} + +class GPUExtent3DDictStrictTransformer : MappingTransformer { + override fun transform(context: MappingTransformerContext): WGPUExtent3D? = + context.originalValue?.let { + WGPUExtent3D().apply { + width = it.width + height = it.height + depthOrArrayLayers = it.depthOrArrayLayers ?: 1 + } + } +} + +class BindGroupLayoutTransformer : MappingTransformer { + override fun transform(context: MappingTransformerContext): WGPUBindGroupLayout? = + context.originalValue?.handler +} + +inline fun mapper(block: KotlinDslMappingDefinitionBuilder.() -> Unit) = + ShapeShiftBuilder().withMapping { + autoMap(AutoMappingStrategy.BY_NAME) + block() + }.build() + + +inline fun Array.toStructureArray(updateFrom: B.(T) -> Unit): Array { + val instance = (B::class.constructors.find { it.parameters.isEmpty() }?.call() + ?: B::class.constructors.find { it.parameters.size == 1 }?.call(null)) + ?: error("fail to find suitable constructor of type ${B::class}") + return (instance.toArray(size) as Array) + .also { forEachIndexed { index, original -> it[index].updateFrom(original) } } +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Constants.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Constants.kt new file mode 100644 index 00000000..7384d001 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Constants.kt @@ -0,0 +1,17 @@ +package io.ygdrasil.wgpu.`internal`.jvm + +public val WGPU_ARRAY_LAYER_COUNT_UNDEFINED: Long = 4294967295L + +public val WGPU_COPY_STRIDE_UNDEFINED: Long = 4294967295L + +public val WGPU_LIMIT_U32_UNDEFINED: Long = 4294967295L + +public val WGPU_LIMIT_U64_UNDEFINED: Long = -1L + +public val WGPU_MIP_LEVEL_COUNT_UNDEFINED: Long = 4294967295L + +public val WGPU_QUERY_SET_INDEX_UNDEFINED: Long = 4294967295L + +public val WGPU_WHOLE_MAP_SIZE: Long = -1L + +public val WGPU_WHOLE_SIZE: Long = -1L diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Enumerations.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Enumerations.kt new file mode 100644 index 00000000..a116c2b8 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Enumerations.kt @@ -0,0 +1,1376 @@ +package io.ygdrasil.wgpu.`internal`.jvm + +public enum class WGPUAdapterType( + public val `value`: Int, +) { + WGPUAdapterType_DiscreteGPU(0), + WGPUAdapterType_IntegratedGPU(1), + WGPUAdapterType_CPU(2), + WGPUAdapterType_Unknown(3), + WGPUAdapterType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUAdapterType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUAdapterType? = entries.find { + it.value == value + } + } +} + +public enum class WGPUAddressMode( + public val `value`: Int, +) { + WGPUAddressMode_Repeat(0), + WGPUAddressMode_MirrorRepeat(1), + WGPUAddressMode_ClampToEdge(2), + WGPUAddressMode_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUAddressMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUAddressMode? = entries.find { + it.value == value + } + } +} + +public enum class WGPUBackendType( + public val `value`: Int, +) { + WGPUBackendType_Undefined(0), + WGPUBackendType_Null(1), + WGPUBackendType_WebGPU(2), + WGPUBackendType_D3D11(3), + WGPUBackendType_D3D12(4), + WGPUBackendType_Metal(5), + WGPUBackendType_Vulkan(6), + WGPUBackendType_OpenGL(7), + WGPUBackendType_OpenGLES(8), + WGPUBackendType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUBackendType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUBackendType? = entries.find { + it.value == value + } + } +} + +public enum class WGPUBlendFactor( + public val `value`: Int, +) { + WGPUBlendFactor_Zero(0), + WGPUBlendFactor_One(1), + WGPUBlendFactor_Src(2), + WGPUBlendFactor_OneMinusSrc(3), + WGPUBlendFactor_SrcAlpha(4), + WGPUBlendFactor_OneMinusSrcAlpha(5), + WGPUBlendFactor_Dst(6), + WGPUBlendFactor_OneMinusDst(7), + WGPUBlendFactor_DstAlpha(8), + WGPUBlendFactor_OneMinusDstAlpha(9), + WGPUBlendFactor_SrcAlphaSaturated(10), + WGPUBlendFactor_Constant(11), + WGPUBlendFactor_OneMinusConstant(12), + WGPUBlendFactor_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUBlendFactor): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUBlendFactor? = entries.find { + it.value == value + } + } +} + +public enum class WGPUBlendOperation( + public val `value`: Int, +) { + WGPUBlendOperation_Add(0), + WGPUBlendOperation_Subtract(1), + WGPUBlendOperation_ReverseSubtract(2), + WGPUBlendOperation_Min(3), + WGPUBlendOperation_Max(4), + WGPUBlendOperation_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUBlendOperation): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUBlendOperation? = entries.find { + it.value == value + } + } +} + +public enum class WGPUBufferBindingType( + public val `value`: Int, +) { + WGPUBufferBindingType_Undefined(0), + WGPUBufferBindingType_Uniform(1), + WGPUBufferBindingType_Storage(2), + WGPUBufferBindingType_ReadOnlyStorage(3), + WGPUBufferBindingType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUBufferBindingType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUBufferBindingType? = entries.find { + it.value == value + } + } +} + +public enum class WGPUBufferMapAsyncStatus( + public val `value`: Int, +) { + WGPUBufferMapAsyncStatus_Success(0), + WGPUBufferMapAsyncStatus_ValidationError(1), + WGPUBufferMapAsyncStatus_Unknown(2), + WGPUBufferMapAsyncStatus_DeviceLost(3), + WGPUBufferMapAsyncStatus_DestroyedBeforeCallback(4), + WGPUBufferMapAsyncStatus_UnmappedBeforeCallback(5), + WGPUBufferMapAsyncStatus_MappingAlreadyPending(6), + WGPUBufferMapAsyncStatus_OffsetOutOfRange(7), + WGPUBufferMapAsyncStatus_SizeOutOfRange(8), + WGPUBufferMapAsyncStatus_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUBufferMapAsyncStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUBufferMapAsyncStatus? = entries.find { + it.value == value + } + } +} + +public enum class WGPUBufferMapState( + public val `value`: Int, +) { + WGPUBufferMapState_Unmapped(0), + WGPUBufferMapState_Pending(1), + WGPUBufferMapState_Mapped(2), + WGPUBufferMapState_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUBufferMapState): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUBufferMapState? = entries.find { + it.value == value + } + } +} + +public enum class WGPUCompareFunction( + public val `value`: Int, +) { + WGPUCompareFunction_Undefined(0), + WGPUCompareFunction_Never(1), + WGPUCompareFunction_Less(2), + WGPUCompareFunction_LessEqual(3), + WGPUCompareFunction_Greater(4), + WGPUCompareFunction_GreaterEqual(5), + WGPUCompareFunction_Equal(6), + WGPUCompareFunction_NotEqual(7), + WGPUCompareFunction_Always(8), + WGPUCompareFunction_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUCompareFunction): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUCompareFunction? = entries.find { + it.value == value + } + } +} + +public enum class WGPUCompilationInfoRequestStatus( + public val `value`: Int, +) { + WGPUCompilationInfoRequestStatus_Success(0), + WGPUCompilationInfoRequestStatus_Error(1), + WGPUCompilationInfoRequestStatus_DeviceLost(2), + WGPUCompilationInfoRequestStatus_Unknown(3), + WGPUCompilationInfoRequestStatus_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUCompilationInfoRequestStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUCompilationInfoRequestStatus? = entries.find { + it.value == value + } + } +} + +public enum class WGPUCompilationMessageType( + public val `value`: Int, +) { + WGPUCompilationMessageType_Error(0), + WGPUCompilationMessageType_Warning(1), + WGPUCompilationMessageType_Info(2), + WGPUCompilationMessageType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUCompilationMessageType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUCompilationMessageType? = entries.find { + it.value == value + } + } +} + +public enum class WGPUCompositeAlphaMode( + public val `value`: Int, +) { + WGPUCompositeAlphaMode_Auto(0), + WGPUCompositeAlphaMode_Opaque(1), + WGPUCompositeAlphaMode_Premultiplied(2), + WGPUCompositeAlphaMode_Unpremultiplied(3), + WGPUCompositeAlphaMode_Inherit(4), + WGPUCompositeAlphaMode_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUCompositeAlphaMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUCompositeAlphaMode? = entries.find { + it.value == value + } + } +} + +public enum class WGPUCreatePipelineAsyncStatus( + public val `value`: Int, +) { + WGPUCreatePipelineAsyncStatus_Success(0), + WGPUCreatePipelineAsyncStatus_ValidationError(1), + WGPUCreatePipelineAsyncStatus_InternalError(2), + WGPUCreatePipelineAsyncStatus_DeviceLost(3), + WGPUCreatePipelineAsyncStatus_DeviceDestroyed(4), + WGPUCreatePipelineAsyncStatus_Unknown(5), + WGPUCreatePipelineAsyncStatus_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUCreatePipelineAsyncStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUCreatePipelineAsyncStatus? = entries.find { + it.value == value + } + } +} + +public enum class WGPUCullMode( + public val `value`: Int, +) { + WGPUCullMode_None(0), + WGPUCullMode_Front(1), + WGPUCullMode_Back(2), + WGPUCullMode_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUCullMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUCullMode? = entries.find { + it.value == value + } + } +} + +public enum class WGPUDeviceLostReason( + public val `value`: Int, +) { + WGPUDeviceLostReason_Undefined(0), + WGPUDeviceLostReason_Destroyed(1), + WGPUDeviceLostReason_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUDeviceLostReason): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUDeviceLostReason? = entries.find { + it.value == value + } + } +} + +public enum class WGPUErrorFilter( + public val `value`: Int, +) { + WGPUErrorFilter_Validation(0), + WGPUErrorFilter_OutOfMemory(1), + WGPUErrorFilter_Internal(2), + WGPUErrorFilter_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUErrorFilter): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUErrorFilter? = entries.find { + it.value == value + } + } +} + +public enum class WGPUErrorType( + public val `value`: Int, +) { + WGPUErrorType_NoError(0), + WGPUErrorType_Validation(1), + WGPUErrorType_OutOfMemory(2), + WGPUErrorType_Internal(3), + WGPUErrorType_Unknown(4), + WGPUErrorType_DeviceLost(5), + WGPUErrorType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUErrorType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUErrorType? = entries.find { + it.value == value + } + } +} + +public enum class WGPUFeatureName( + public val `value`: Int, +) { + WGPUFeatureName_Undefined(0), + WGPUFeatureName_DepthClipControl(1), + WGPUFeatureName_Depth32FloatStencil8(2), + WGPUFeatureName_TimestampQuery(3), + WGPUFeatureName_TextureCompressionBC(4), + WGPUFeatureName_TextureCompressionETC2(5), + WGPUFeatureName_TextureCompressionASTC(6), + WGPUFeatureName_IndirectFirstInstance(7), + WGPUFeatureName_ShaderF16(8), + WGPUFeatureName_RG11B10UfloatRenderable(9), + WGPUFeatureName_BGRA8UnormStorage(10), + WGPUFeatureName_Float32Filterable(11), + WGPUFeatureName_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUFeatureName): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUFeatureName? = entries.find { + it.value == value + } + } +} + +public enum class WGPUFilterMode( + public val `value`: Int, +) { + WGPUFilterMode_Nearest(0), + WGPUFilterMode_Linear(1), + WGPUFilterMode_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUFilterMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUFilterMode? = entries.find { + it.value == value + } + } +} + +public enum class WGPUFrontFace( + public val `value`: Int, +) { + WGPUFrontFace_CCW(0), + WGPUFrontFace_CW(1), + WGPUFrontFace_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUFrontFace): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUFrontFace? = entries.find { + it.value == value + } + } +} + +public enum class WGPUIndexFormat( + public val `value`: Int, +) { + WGPUIndexFormat_Undefined(0), + WGPUIndexFormat_Uint16(1), + WGPUIndexFormat_Uint32(2), + WGPUIndexFormat_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUIndexFormat): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUIndexFormat? = entries.find { + it.value == value + } + } +} + +public enum class WGPULoadOp( + public val `value`: Int, +) { + WGPULoadOp_Undefined(0), + WGPULoadOp_Clear(1), + WGPULoadOp_Load(2), + WGPULoadOp_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPULoadOp): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPULoadOp? = entries.find { + it.value == value + } + } +} + +public enum class WGPUMipmapFilterMode( + public val `value`: Int, +) { + WGPUMipmapFilterMode_Nearest(0), + WGPUMipmapFilterMode_Linear(1), + WGPUMipmapFilterMode_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUMipmapFilterMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUMipmapFilterMode? = entries.find { + it.value == value + } + } +} + +public enum class WGPUPowerPreference( + public val `value`: Int, +) { + WGPUPowerPreference_Undefined(0), + WGPUPowerPreference_LowPower(1), + WGPUPowerPreference_HighPerformance(2), + WGPUPowerPreference_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUPowerPreference): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUPowerPreference? = entries.find { + it.value == value + } + } +} + +public enum class WGPUPresentMode( + public val `value`: Int, +) { + WGPUPresentMode_Fifo(0), + WGPUPresentMode_FifoRelaxed(1), + WGPUPresentMode_Immediate(2), + WGPUPresentMode_Mailbox(3), + WGPUPresentMode_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUPresentMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUPresentMode? = entries.find { + it.value == value + } + } +} + +public enum class WGPUPrimitiveTopology( + public val `value`: Int, +) { + WGPUPrimitiveTopology_PointList(0), + WGPUPrimitiveTopology_LineList(1), + WGPUPrimitiveTopology_LineStrip(2), + WGPUPrimitiveTopology_TriangleList(3), + WGPUPrimitiveTopology_TriangleStrip(4), + WGPUPrimitiveTopology_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUPrimitiveTopology): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUPrimitiveTopology? = entries.find { + it.value == value + } + } +} + +public enum class WGPUQueryType( + public val `value`: Int, +) { + WGPUQueryType_Occlusion(0), + WGPUQueryType_Timestamp(1), + WGPUQueryType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUQueryType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUQueryType? = entries.find { + it.value == value + } + } +} + +public enum class WGPUQueueWorkDoneStatus( + public val `value`: Int, +) { + WGPUQueueWorkDoneStatus_Success(0), + WGPUQueueWorkDoneStatus_Error(1), + WGPUQueueWorkDoneStatus_Unknown(2), + WGPUQueueWorkDoneStatus_DeviceLost(3), + WGPUQueueWorkDoneStatus_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUQueueWorkDoneStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUQueueWorkDoneStatus? = entries.find { + it.value == value + } + } +} + +public enum class WGPURequestAdapterStatus( + public val `value`: Int, +) { + WGPURequestAdapterStatus_Success(0), + WGPURequestAdapterStatus_Unavailable(1), + WGPURequestAdapterStatus_Error(2), + WGPURequestAdapterStatus_Unknown(3), + WGPURequestAdapterStatus_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPURequestAdapterStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPURequestAdapterStatus? = entries.find { + it.value == value + } + } +} + +public enum class WGPURequestDeviceStatus( + public val `value`: Int, +) { + WGPURequestDeviceStatus_Success(0), + WGPURequestDeviceStatus_Error(1), + WGPURequestDeviceStatus_Unknown(2), + WGPURequestDeviceStatus_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPURequestDeviceStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPURequestDeviceStatus? = entries.find { + it.value == value + } + } +} + +public enum class WGPUSType( + public val `value`: Int, +) { + WGPUSType_Invalid(0), + WGPUSType_SurfaceDescriptorFromMetalLayer(1), + WGPUSType_SurfaceDescriptorFromWindowsHWND(2), + WGPUSType_SurfaceDescriptorFromXlibWindow(3), + WGPUSType_SurfaceDescriptorFromCanvasHTMLSelector(4), + WGPUSType_ShaderModuleSPIRVDescriptor(5), + WGPUSType_ShaderModuleWGSLDescriptor(6), + WGPUSType_PrimitiveDepthClipControl(7), + WGPUSType_SurfaceDescriptorFromWaylandSurface(8), + WGPUSType_SurfaceDescriptorFromAndroidNativeWindow(9), + WGPUSType_SurfaceDescriptorFromXcbWindow(10), + WGPUSType_RenderPassDescriptorMaxDrawCount(15), + WGPUSType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUSType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUSType? = entries.find { + it.value == value + } + } +} + +public enum class WGPUSamplerBindingType( + public val `value`: Int, +) { + WGPUSamplerBindingType_Undefined(0), + WGPUSamplerBindingType_Filtering(1), + WGPUSamplerBindingType_NonFiltering(2), + WGPUSamplerBindingType_Comparison(3), + WGPUSamplerBindingType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUSamplerBindingType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUSamplerBindingType? = entries.find { + it.value == value + } + } +} + +public enum class WGPUStencilOperation( + public val `value`: Int, +) { + WGPUStencilOperation_Keep(0), + WGPUStencilOperation_Zero(1), + WGPUStencilOperation_Replace(2), + WGPUStencilOperation_Invert(3), + WGPUStencilOperation_IncrementClamp(4), + WGPUStencilOperation_DecrementClamp(5), + WGPUStencilOperation_IncrementWrap(6), + WGPUStencilOperation_DecrementWrap(7), + WGPUStencilOperation_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUStencilOperation): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUStencilOperation? = entries.find { + it.value == value + } + } +} + +public enum class WGPUStorageTextureAccess( + public val `value`: Int, +) { + WGPUStorageTextureAccess_Undefined(0), + WGPUStorageTextureAccess_WriteOnly(1), + WGPUStorageTextureAccess_ReadOnly(2), + WGPUStorageTextureAccess_ReadWrite(3), + WGPUStorageTextureAccess_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUStorageTextureAccess): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUStorageTextureAccess? = entries.find { + it.value == value + } + } +} + +public enum class WGPUStoreOp( + public val `value`: Int, +) { + WGPUStoreOp_Undefined(0), + WGPUStoreOp_Store(1), + WGPUStoreOp_Discard(2), + WGPUStoreOp_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUStoreOp): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUStoreOp? = entries.find { + it.value == value + } + } +} + +public enum class WGPUSurfaceGetCurrentTextureStatus( + public val `value`: Int, +) { + WGPUSurfaceGetCurrentTextureStatus_Success(0), + WGPUSurfaceGetCurrentTextureStatus_Timeout(1), + WGPUSurfaceGetCurrentTextureStatus_Outdated(2), + WGPUSurfaceGetCurrentTextureStatus_Lost(3), + WGPUSurfaceGetCurrentTextureStatus_OutOfMemory(4), + WGPUSurfaceGetCurrentTextureStatus_DeviceLost(5), + WGPUSurfaceGetCurrentTextureStatus_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUSurfaceGetCurrentTextureStatus): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUSurfaceGetCurrentTextureStatus? = entries.find { + it.value == value + } + } +} + +public enum class WGPUTextureAspect( + public val `value`: Int, +) { + WGPUTextureAspect_All(0), + WGPUTextureAspect_StencilOnly(1), + WGPUTextureAspect_DepthOnly(2), + WGPUTextureAspect_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUTextureAspect): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUTextureAspect? = entries.find { + it.value == value + } + } +} + +public enum class WGPUTextureDimension( + public val `value`: Int, +) { + WGPUTextureDimension_1D(0), + WGPUTextureDimension_2D(1), + WGPUTextureDimension_3D(2), + WGPUTextureDimension_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUTextureDimension): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUTextureDimension? = entries.find { + it.value == value + } + } +} + +public enum class WGPUTextureFormat( + public val `value`: Int, +) { + WGPUTextureFormat_Undefined(0), + WGPUTextureFormat_R8Unorm(1), + WGPUTextureFormat_R8Snorm(2), + WGPUTextureFormat_R8Uint(3), + WGPUTextureFormat_R8Sint(4), + WGPUTextureFormat_R16Uint(5), + WGPUTextureFormat_R16Sint(6), + WGPUTextureFormat_R16Float(7), + WGPUTextureFormat_RG8Unorm(8), + WGPUTextureFormat_RG8Snorm(9), + WGPUTextureFormat_RG8Uint(10), + WGPUTextureFormat_RG8Sint(11), + WGPUTextureFormat_R32Float(12), + WGPUTextureFormat_R32Uint(13), + WGPUTextureFormat_R32Sint(14), + WGPUTextureFormat_RG16Uint(15), + WGPUTextureFormat_RG16Sint(16), + WGPUTextureFormat_RG16Float(17), + WGPUTextureFormat_RGBA8Unorm(18), + WGPUTextureFormat_RGBA8UnormSrgb(19), + WGPUTextureFormat_RGBA8Snorm(20), + WGPUTextureFormat_RGBA8Uint(21), + WGPUTextureFormat_RGBA8Sint(22), + WGPUTextureFormat_BGRA8Unorm(23), + WGPUTextureFormat_BGRA8UnormSrgb(24), + WGPUTextureFormat_RGB10A2Uint(25), + WGPUTextureFormat_RGB10A2Unorm(26), + WGPUTextureFormat_RG11B10Ufloat(27), + WGPUTextureFormat_RGB9E5Ufloat(28), + WGPUTextureFormat_RG32Float(29), + WGPUTextureFormat_RG32Uint(30), + WGPUTextureFormat_RG32Sint(31), + WGPUTextureFormat_RGBA16Uint(32), + WGPUTextureFormat_RGBA16Sint(33), + WGPUTextureFormat_RGBA16Float(34), + WGPUTextureFormat_RGBA32Float(35), + WGPUTextureFormat_RGBA32Uint(36), + WGPUTextureFormat_RGBA32Sint(37), + WGPUTextureFormat_Stencil8(38), + WGPUTextureFormat_Depth16Unorm(39), + WGPUTextureFormat_Depth24Plus(40), + WGPUTextureFormat_Depth24PlusStencil8(41), + WGPUTextureFormat_Depth32Float(42), + WGPUTextureFormat_Depth32FloatStencil8(43), + WGPUTextureFormat_BC1RGBAUnorm(44), + WGPUTextureFormat_BC1RGBAUnormSrgb(45), + WGPUTextureFormat_BC2RGBAUnorm(46), + WGPUTextureFormat_BC2RGBAUnormSrgb(47), + WGPUTextureFormat_BC3RGBAUnorm(48), + WGPUTextureFormat_BC3RGBAUnormSrgb(49), + WGPUTextureFormat_BC4RUnorm(50), + WGPUTextureFormat_BC4RSnorm(51), + WGPUTextureFormat_BC5RGUnorm(52), + WGPUTextureFormat_BC5RGSnorm(53), + WGPUTextureFormat_BC6HRGBUfloat(54), + WGPUTextureFormat_BC6HRGBFloat(55), + WGPUTextureFormat_BC7RGBAUnorm(56), + WGPUTextureFormat_BC7RGBAUnormSrgb(57), + WGPUTextureFormat_ETC2RGB8Unorm(58), + WGPUTextureFormat_ETC2RGB8UnormSrgb(59), + WGPUTextureFormat_ETC2RGB8A1Unorm(60), + WGPUTextureFormat_ETC2RGB8A1UnormSrgb(61), + WGPUTextureFormat_ETC2RGBA8Unorm(62), + WGPUTextureFormat_ETC2RGBA8UnormSrgb(63), + WGPUTextureFormat_EACR11Unorm(64), + WGPUTextureFormat_EACR11Snorm(65), + WGPUTextureFormat_EACRG11Unorm(66), + WGPUTextureFormat_EACRG11Snorm(67), + WGPUTextureFormat_ASTC4x4Unorm(68), + WGPUTextureFormat_ASTC4x4UnormSrgb(69), + WGPUTextureFormat_ASTC5x4Unorm(70), + WGPUTextureFormat_ASTC5x4UnormSrgb(71), + WGPUTextureFormat_ASTC5x5Unorm(72), + WGPUTextureFormat_ASTC5x5UnormSrgb(73), + WGPUTextureFormat_ASTC6x5Unorm(74), + WGPUTextureFormat_ASTC6x5UnormSrgb(75), + WGPUTextureFormat_ASTC6x6Unorm(76), + WGPUTextureFormat_ASTC6x6UnormSrgb(77), + WGPUTextureFormat_ASTC8x5Unorm(78), + WGPUTextureFormat_ASTC8x5UnormSrgb(79), + WGPUTextureFormat_ASTC8x6Unorm(80), + WGPUTextureFormat_ASTC8x6UnormSrgb(81), + WGPUTextureFormat_ASTC8x8Unorm(82), + WGPUTextureFormat_ASTC8x8UnormSrgb(83), + WGPUTextureFormat_ASTC10x5Unorm(84), + WGPUTextureFormat_ASTC10x5UnormSrgb(85), + WGPUTextureFormat_ASTC10x6Unorm(86), + WGPUTextureFormat_ASTC10x6UnormSrgb(87), + WGPUTextureFormat_ASTC10x8Unorm(88), + WGPUTextureFormat_ASTC10x8UnormSrgb(89), + WGPUTextureFormat_ASTC10x10Unorm(90), + WGPUTextureFormat_ASTC10x10UnormSrgb(91), + WGPUTextureFormat_ASTC12x10Unorm(92), + WGPUTextureFormat_ASTC12x10UnormSrgb(93), + WGPUTextureFormat_ASTC12x12Unorm(94), + WGPUTextureFormat_ASTC12x12UnormSrgb(95), + WGPUTextureFormat_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUTextureFormat): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUTextureFormat? = entries.find { + it.value == value + } + } +} + +public enum class WGPUTextureSampleType( + public val `value`: Int, +) { + WGPUTextureSampleType_Undefined(0), + WGPUTextureSampleType_Float(1), + WGPUTextureSampleType_UnfilterableFloat(2), + WGPUTextureSampleType_Depth(3), + WGPUTextureSampleType_Sint(4), + WGPUTextureSampleType_Uint(5), + WGPUTextureSampleType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUTextureSampleType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUTextureSampleType? = entries.find { + it.value == value + } + } +} + +public enum class WGPUTextureViewDimension( + public val `value`: Int, +) { + WGPUTextureViewDimension_Undefined(0), + WGPUTextureViewDimension_1D(1), + WGPUTextureViewDimension_2D(2), + WGPUTextureViewDimension_2DArray(3), + WGPUTextureViewDimension_Cube(4), + WGPUTextureViewDimension_CubeArray(5), + WGPUTextureViewDimension_3D(6), + WGPUTextureViewDimension_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUTextureViewDimension): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUTextureViewDimension? = entries.find { + it.value == value + } + } +} + +public enum class WGPUVertexFormat( + public val `value`: Int, +) { + WGPUVertexFormat_Undefined(0), + WGPUVertexFormat_Uint8x2(1), + WGPUVertexFormat_Uint8x4(2), + WGPUVertexFormat_Sint8x2(3), + WGPUVertexFormat_Sint8x4(4), + WGPUVertexFormat_Unorm8x2(5), + WGPUVertexFormat_Unorm8x4(6), + WGPUVertexFormat_Snorm8x2(7), + WGPUVertexFormat_Snorm8x4(8), + WGPUVertexFormat_Uint16x2(9), + WGPUVertexFormat_Uint16x4(10), + WGPUVertexFormat_Sint16x2(11), + WGPUVertexFormat_Sint16x4(12), + WGPUVertexFormat_Unorm16x2(13), + WGPUVertexFormat_Unorm16x4(14), + WGPUVertexFormat_Snorm16x2(15), + WGPUVertexFormat_Snorm16x4(16), + WGPUVertexFormat_Float16x2(17), + WGPUVertexFormat_Float16x4(18), + WGPUVertexFormat_Float32(19), + WGPUVertexFormat_Float32x2(20), + WGPUVertexFormat_Float32x3(21), + WGPUVertexFormat_Float32x4(22), + WGPUVertexFormat_Uint32(23), + WGPUVertexFormat_Uint32x2(24), + WGPUVertexFormat_Uint32x3(25), + WGPUVertexFormat_Uint32x4(26), + WGPUVertexFormat_Sint32(27), + WGPUVertexFormat_Sint32x2(28), + WGPUVertexFormat_Sint32x3(29), + WGPUVertexFormat_Sint32x4(30), + WGPUVertexFormat_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUVertexFormat): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUVertexFormat? = entries.find { + it.value == value + } + } +} + +public enum class WGPUVertexStepMode( + public val `value`: Int, +) { + WGPUVertexStepMode_Vertex(0), + WGPUVertexStepMode_Instance(1), + WGPUVertexStepMode_VertexBufferNotUsed(2), + WGPUVertexStepMode_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUVertexStepMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUVertexStepMode? = entries.find { + it.value == value + } + } +} + +public enum class WGPUBufferUsage( + public val `value`: Int, +) { + WGPUBufferUsage_None(0), + WGPUBufferUsage_MapRead(1), + WGPUBufferUsage_MapWrite(2), + WGPUBufferUsage_CopySrc(4), + WGPUBufferUsage_CopyDst(8), + WGPUBufferUsage_Index(16), + WGPUBufferUsage_Vertex(32), + WGPUBufferUsage_Uniform(64), + WGPUBufferUsage_Storage(128), + WGPUBufferUsage_Indirect(256), + WGPUBufferUsage_QueryResolve(512), + WGPUBufferUsage_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUBufferUsage): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUBufferUsage? = entries.find { + it.value == value + } + } +} + +public enum class WGPUColorWriteMask( + public val `value`: Int, +) { + WGPUColorWriteMask_None(0), + WGPUColorWriteMask_Red(1), + WGPUColorWriteMask_Green(2), + WGPUColorWriteMask_Blue(4), + WGPUColorWriteMask_Alpha(8), + WGPUColorWriteMask_All(15), + WGPUColorWriteMask_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUColorWriteMask): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUColorWriteMask? = entries.find { + it.value == value + } + } +} + +public enum class WGPUMapMode( + public val `value`: Int, +) { + WGPUMapMode_None(0), + WGPUMapMode_Read(1), + WGPUMapMode_Write(2), + WGPUMapMode_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUMapMode): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUMapMode? = entries.find { + it.value == value + } + } +} + +public enum class WGPUShaderStage( + public val `value`: Int, +) { + WGPUShaderStage_None(0), + WGPUShaderStage_Vertex(1), + WGPUShaderStage_Fragment(2), + WGPUShaderStage_Compute(4), + WGPUShaderStage_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUShaderStage): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUShaderStage? = entries.find { + it.value == value + } + } +} + +public enum class WGPUTextureUsage( + public val `value`: Int, +) { + WGPUTextureUsage_None(0), + WGPUTextureUsage_CopySrc(1), + WGPUTextureUsage_CopyDst(2), + WGPUTextureUsage_TextureBinding(4), + WGPUTextureUsage_StorageBinding(8), + WGPUTextureUsage_RenderAttachment(16), + WGPUTextureUsage_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUTextureUsage): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUTextureUsage? = entries.find { + it.value == value + } + } +} + +public enum class WGPUNativeSType( + public val `value`: Int, +) { + WGPUSType_DeviceExtras(196_609), + WGPUSType_RequiredLimitsExtras(196_610), + WGPUSType_PipelineLayoutExtras(196_611), + WGPUSType_ShaderModuleGLSLDescriptor(196_612), + WGPUSType_SupportedLimitsExtras(196_613), + WGPUSType_InstanceExtras(196_614), + WGPUSType_BindGroupEntryExtras(196_615), + WGPUSType_BindGroupLayoutEntryExtras(196_616), + WGPUSType_QuerySetDescriptorExtras(196_617), + WGPUSType_SurfaceConfigurationExtras(196_618), + WGPUNativeSType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUNativeSType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUNativeSType? = entries.find { + it.value == value + } + } +} + +public enum class WGPUNativeFeature( + public val `value`: Int, +) { + WGPUNativeFeature_PushConstants(196_609), + WGPUNativeFeature_TextureAdapterSpecificFormatFeatures(196_610), + WGPUNativeFeature_MultiDrawIndirect(196_611), + WGPUNativeFeature_MultiDrawIndirectCount(196_612), + WGPUNativeFeature_VertexWritableStorage(196_613), + WGPUNativeFeature_TextureBindingArray(196_614), + WGPUNativeFeature_SampledTextureAndStorageBufferArrayNonUniformIndexing(196_615), + WGPUNativeFeature_PipelineStatisticsQuery(196_616), + WGPUNativeFeature_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUNativeFeature): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUNativeFeature? = entries.find { + it.value == value + } + } +} + +public enum class WGPULogLevel( + public val `value`: Int, +) { + WGPULogLevel_Off(0), + WGPULogLevel_Error(1), + WGPULogLevel_Warn(2), + WGPULogLevel_Info(3), + WGPULogLevel_Debug(4), + WGPULogLevel_Trace(5), + WGPULogLevel_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPULogLevel): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPULogLevel? = entries.find { + it.value == value + } + } +} + +public enum class WGPUInstanceBackend( + public val `value`: Int, +) { + WGPUInstanceBackend_All(0), + WGPUInstanceBackend_Vulkan(1), + WGPUInstanceBackend_GL(2), + WGPUInstanceBackend_Metal(4), + WGPUInstanceBackend_DX12(8), + WGPUInstanceBackend_DX11(16), + WGPUInstanceBackend_BrowserWebGPU(32), + WGPUInstanceBackend_Primary(45), + WGPUInstanceBackend_Secondary(18), + WGPUInstanceBackend_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUInstanceBackend): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUInstanceBackend? = entries.find { + it.value == value + } + } +} + +public enum class WGPUInstanceFlag( + public val `value`: Int, +) { + WGPUInstanceFlag_Default(0), + WGPUInstanceFlag_Debug(1), + WGPUInstanceFlag_Validation(2), + WGPUInstanceFlag_DiscardHalLabels(4), + WGPUInstanceFlag_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUInstanceFlag): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUInstanceFlag? = entries.find { + it.value == value + } + } +} + +public enum class WGPUDx12Compiler( + public val `value`: Int, +) { + WGPUDx12Compiler_Undefined(0), + WGPUDx12Compiler_Fxc(1), + WGPUDx12Compiler_Dxc(2), + WGPUDx12Compiler_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUDx12Compiler): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUDx12Compiler? = entries.find { + it.value == value + } + } +} + +public enum class WGPUGles3MinorVersion( + public val `value`: Int, +) { + WGPUGles3MinorVersion_Automatic(0), + WGPUGles3MinorVersion_Version0(1), + WGPUGles3MinorVersion_Version1(2), + WGPUGles3MinorVersion_Version2(3), + WGPUGles3MinorVersion_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUGles3MinorVersion): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUGles3MinorVersion? = entries.find { + it.value == value + } + } +} + +public enum class WGPUPipelineStatisticName( + public val `value`: Int, +) { + WGPUPipelineStatisticName_VertexShaderInvocations(0), + WGPUPipelineStatisticName_ClipperInvocations(1), + WGPUPipelineStatisticName_ClipperPrimitivesOut(2), + WGPUPipelineStatisticName_FragmentShaderInvocations(3), + WGPUPipelineStatisticName_ComputeShaderInvocations(4), + WGPUPipelineStatisticName_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUPipelineStatisticName): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUPipelineStatisticName? = entries.find { + it.value == value + } + } +} + +public enum class WGPUNativeQueryType( + public val `value`: Int, +) { + WGPUNativeQueryType_PipelineStatistics(196_608), + WGPUNativeQueryType_Force32(2_147_483_647), + ; + + public infix fun or(other: Int): Int = value or other + + public infix fun or(other: WGPUNativeQueryType): Int = value or other.value + + public companion object { + public fun of(`value`: Int): WGPUNativeQueryType? = entries.find { + it.value == value + } + } +} diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Functions.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Functions.kt new file mode 100644 index 00000000..4d81d956 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Functions.kt @@ -0,0 +1,3524 @@ +package io.ygdrasil.wgpu.`internal`.jvm + +import com.sun.jna.Library +import com.sun.jna.NativeLong +import com.sun.jna.Pointer + +public val libWGPULibrary: WGPULibrary by lazy { + klang.internal.NativeLoad("WGPU") +} + +public interface WGPULibrary : Library { + /** + * @param descriptor mapped from (typedef Optional[const WGPUInstanceDescriptor] = + * Declared([a8(nextInChain):[*:b1]](WGPUInstanceDescriptor)))* + */ + public fun wgpuCreateInstance(descriptor: WGPUInstanceDescriptor?): WGPUInstance? + + /** + * @param device mapped from WGPUDevice + * @param procName mapped from (Char(layout = b1))* + */ + public fun wgpuGetProcAddress(device: WGPUDevice?, procName: String?): WGPUProc? + + /** + * @param adapter mapped from WGPUAdapter + * @param features mapped from (typedef Optional[WGPUFeatureName] = Declared(i4))* + */ + public fun wgpuAdapterEnumerateFeatures(adapter: WGPUAdapter?, features: Pointer?): NativeLong + + /** + * @param adapter mapped from WGPUAdapter + * @param limits mapped from (typedef Optional[WGPUSupportedLimits] = + * Declared([a8(nextInChain):[*:b1][i4(maxTextureDimension1D)i4(maxTextureDimension2D)i4(maxTextureDimension3D)i4(maxTextureArrayLayers)i4(maxBindGroups)i4(maxBindGroupsPlusVertexBuffers)i4(maxBindingsPerBindGroup)i4(maxDynamicUniformBuffersPerPipelineLayout)i4(maxDynamicStorageBuffersPerPipelineLayout)i4(maxSampledTexturesPerShaderStage)i4(maxSamplersPerShaderStage)i4(maxStorageBuffersPerShaderStage)i4(maxStorageTexturesPerShaderStage)i4(maxUniformBuffersPerShaderStage)j8(maxUniformBufferBindingSize)j8(maxStorageBufferBindingSize)i4(minUniformBufferOffsetAlignment)i4(minStorageBufferOffsetAlignment)i4(maxVertexBuffers)x4j8(maxBufferSize)i4(maxVertexAttributes)i4(maxVertexBufferArrayStride)i4(maxInterStageShaderComponents)i4(maxInterStageShaderVariables)i4(maxColorAttachments)i4(maxColorAttachmentBytesPerSample)i4(maxComputeWorkgroupStorageSize)i4(maxComputeInvocationsPerWorkgroup)i4(maxComputeWorkgroupSizeX)i4(maxComputeWorkgroupSizeY)i4(maxComputeWorkgroupSizeZ)i4(maxComputeWorkgroupsPerDimension)](limits)](WGPUSupportedLimits)))* + */ + public fun wgpuAdapterGetLimits(adapter: WGPUAdapter?, limits: WGPUSupportedLimits?): WGPUBool + + /** + * @param adapter mapped from WGPUAdapter + * @param properties mapped from (typedef Optional[WGPUAdapterProperties] = + * Declared([a8(nextInChain):[*:b1]i4(vendorID)x4a8(vendorName):[*:b1]a8(architecture):[*:b1]i4(deviceID)x4a8(name):[*:b1]a8(driverDescription):[*:b1]i4(adapterType)i4(backendType)](WGPUAdapterProperties)))* + */ + public fun wgpuAdapterGetProperties(adapter: WGPUAdapter?, properties: WGPUAdapterProperties?) + + /** + * @param adapter mapped from WGPUAdapter + * @param feature mapped from WGPUFeatureName + */ + public fun wgpuAdapterHasFeature(adapter: WGPUAdapter?, feature: Int): WGPUBool + + /** + * @param adapter mapped from WGPUAdapter + * @param descriptor mapped from (typedef Optional[const WGPUDeviceDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(requiredFeatureCount)a8(requiredFeatures):[*:b1]a8(requiredLimits):[*:b1][a8(nextInChain):[*:b1]a8(label):[*:b1]](defaultQueue)a8(deviceLostCallback):[*:b1]a8(deviceLostUserdata):[*:b1]](WGPUDeviceDescriptor)))* + * @param callback mapped from WGPURequestDeviceCallback + * @param userdata mapped from (Void)* + */ + public fun wgpuAdapterRequestDevice( + adapter: WGPUAdapter?, + descriptor: WGPUDeviceDescriptor?, + callback: WGPURequestDeviceCallback?, + userdata: Pointer?, + ) + + /** + * @param adapter mapped from WGPUAdapter + */ + public fun wgpuAdapterReference(adapter: WGPUAdapter?) + + /** + * @param adapter mapped from WGPUAdapter + */ + public fun wgpuAdapterRelease(adapter: WGPUAdapter?) + + /** + * @param bindGroup mapped from WGPUBindGroup + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuBindGroupSetLabel(bindGroup: WGPUBindGroup?, label: String?) + + /** + * @param bindGroup mapped from WGPUBindGroup + */ + public fun wgpuBindGroupReference(bindGroup: WGPUBindGroup?) + + /** + * @param bindGroup mapped from WGPUBindGroup + */ + public fun wgpuBindGroupRelease(bindGroup: WGPUBindGroup?) + + /** + * @param bindGroupLayout mapped from WGPUBindGroupLayout + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuBindGroupLayoutSetLabel(bindGroupLayout: WGPUBindGroupLayout?, label: String?) + + /** + * @param bindGroupLayout mapped from WGPUBindGroupLayout + */ + public fun wgpuBindGroupLayoutReference(bindGroupLayout: WGPUBindGroupLayout?) + + /** + * @param bindGroupLayout mapped from WGPUBindGroupLayout + */ + public fun wgpuBindGroupLayoutRelease(bindGroupLayout: WGPUBindGroupLayout?) + + /** + * @param buffer mapped from WGPUBuffer + */ + public fun wgpuBufferDestroy(buffer: WGPUBuffer?) + + /** + * @param buffer mapped from WGPUBuffer + * @param offset mapped from size_t + * @param size mapped from size_t + */ + public fun wgpuBufferGetConstMappedRange( + buffer: WGPUBuffer?, + offset: NativeLong, + size: NativeLong, + ): Pointer? + + /** + * @param buffer mapped from WGPUBuffer + */ + public fun wgpuBufferGetMapState(buffer: WGPUBuffer?): Int + + /** + * @param buffer mapped from WGPUBuffer + * @param offset mapped from size_t + * @param size mapped from size_t + */ + public fun wgpuBufferGetMappedRange( + buffer: WGPUBuffer?, + offset: NativeLong?, + size: NativeLong?, + ): Pointer? + + /** + * @param buffer mapped from WGPUBuffer + */ + public fun wgpuBufferGetSize(buffer: WGPUBuffer?): Long + + /** + * @param buffer mapped from WGPUBuffer + */ + public fun wgpuBufferGetUsage(buffer: WGPUBuffer?): WGPUBufferUsageFlags + + /** + * @param buffer mapped from WGPUBuffer + * @param mode mapped from WGPUMapModeFlags + * @param offset mapped from size_t + * @param size mapped from size_t + * @param callback mapped from WGPUBufferMapCallback + * @param userdata mapped from (Void)* + */ + public fun wgpuBufferMapAsync( + buffer: WGPUBuffer?, + mode: WGPUMapModeFlags, + offset: NativeLong, + size: NativeLong, + callback: WGPUBufferMapCallback?, + userdata: Pointer?, + ) + + /** + * @param buffer mapped from WGPUBuffer + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuBufferSetLabel(buffer: WGPUBuffer?, label: String?) + + /** + * @param buffer mapped from WGPUBuffer + */ + public fun wgpuBufferUnmap(buffer: WGPUBuffer?) + + /** + * @param buffer mapped from WGPUBuffer + */ + public fun wgpuBufferReference(buffer: WGPUBuffer?) + + /** + * @param buffer mapped from WGPUBuffer + */ + public fun wgpuBufferRelease(buffer: WGPUBuffer?) + + /** + * @param commandBuffer mapped from WGPUCommandBuffer + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuCommandBufferSetLabel(commandBuffer: WGPUCommandBuffer?, label: String?) + + /** + * @param commandBuffer mapped from WGPUCommandBuffer + */ + public fun wgpuCommandBufferReference(commandBuffer: WGPUCommandBuffer?) + + /** + * @param commandBuffer mapped from WGPUCommandBuffer + */ + public fun wgpuCommandBufferRelease(commandBuffer: WGPUCommandBuffer?) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param descriptor mapped from (typedef Optional[const WGPUComputePassDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(timestampWrites):[*:b1]](WGPUComputePassDescriptor)))* + */ + public fun wgpuCommandEncoderBeginComputePass( + commandEncoder: WGPUCommandEncoder?, + descriptor: WGPUComputePassDescriptor? + ): WGPUComputePassEncoder? + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param descriptor mapped from (typedef Optional[const WGPURenderPassDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(colorAttachmentCount)a8(colorAttachments):[*:b1]a8(depthStencilAttachment):[*:b1]a8(occlusionQuerySet):[*:b1]a8(timestampWrites):[*:b1]](WGPURenderPassDescriptor)))* + */ + public fun wgpuCommandEncoderBeginRenderPass( + commandEncoder: WGPUCommandEncoder?, + descriptor: WGPURenderPassDescriptor? + ): WGPURenderPassEncoder? + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param size mapped from uint64_t + */ + public fun wgpuCommandEncoderClearBuffer( + commandEncoder: WGPUCommandEncoder?, + buffer: WGPUBuffer?, + offset: Long, + size: Long, + ) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param source mapped from WGPUBuffer + * @param sourceOffset mapped from uint64_t + * @param destination mapped from WGPUBuffer + * @param destinationOffset mapped from uint64_t + * @param size mapped from uint64_t + */ + public fun wgpuCommandEncoderCopyBufferToBuffer( + commandEncoder: WGPUCommandEncoder?, + source: WGPUBuffer?, + sourceOffset: Long, + destination: WGPUBuffer?, + destinationOffset: Long, + size: Long, + ) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param source mapped from (typedef Optional[const WGPUImageCopyBuffer] = + * Declared([a8(nextInChain):[*:b1][a8(nextInChain):[*:b1]j8(offset)i4(bytesPerRow)i4(rowsPerImage)](layout)a8(buffer):[*:b1]](WGPUImageCopyBuffer)))* + * @param destination mapped from (typedef Optional[const WGPUImageCopyTexture] = + * Declared([a8(nextInChain):[*:b1]a8(texture):[*:b1]i4(mipLevel)[i4(x)i4(y)i4(z)](origin)i4(aspect)x4](WGPUImageCopyTexture)))* + * @param copySize mapped from (typedef Optional[const WGPUExtent3D] = + * Declared([i4(width)i4(height)i4(depthOrArrayLayers)](WGPUExtent3D)))* + */ + public fun wgpuCommandEncoderCopyBufferToTexture( + commandEncoder: WGPUCommandEncoder?, + source: WGPUImageCopyBuffer?, + destination: WGPUImageCopyTexture?, + copySize: WGPUExtent3D?, + ) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param source mapped from (typedef Optional[const WGPUImageCopyTexture] = + * Declared([a8(nextInChain):[*:b1]a8(texture):[*:b1]i4(mipLevel)[i4(x)i4(y)i4(z)](origin)i4(aspect)x4](WGPUImageCopyTexture)))* + * @param destination mapped from (typedef Optional[const WGPUImageCopyBuffer] = + * Declared([a8(nextInChain):[*:b1][a8(nextInChain):[*:b1]j8(offset)i4(bytesPerRow)i4(rowsPerImage)](layout)a8(buffer):[*:b1]](WGPUImageCopyBuffer)))* + * @param copySize mapped from (typedef Optional[const WGPUExtent3D] = + * Declared([i4(width)i4(height)i4(depthOrArrayLayers)](WGPUExtent3D)))* + */ + public fun wgpuCommandEncoderCopyTextureToBuffer( + commandEncoder: WGPUCommandEncoder?, + source: WGPUImageCopyTexture?, + destination: WGPUImageCopyBuffer?, + copySize: WGPUExtent3D?, + ) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param source mapped from (typedef Optional[const WGPUImageCopyTexture] = + * Declared([a8(nextInChain):[*:b1]a8(texture):[*:b1]i4(mipLevel)[i4(x)i4(y)i4(z)](origin)i4(aspect)x4](WGPUImageCopyTexture)))* + * @param destination mapped from (typedef Optional[const WGPUImageCopyTexture] = + * Declared([a8(nextInChain):[*:b1]a8(texture):[*:b1]i4(mipLevel)[i4(x)i4(y)i4(z)](origin)i4(aspect)x4](WGPUImageCopyTexture)))* + * @param copySize mapped from (typedef Optional[const WGPUExtent3D] = + * Declared([i4(width)i4(height)i4(depthOrArrayLayers)](WGPUExtent3D)))* + */ + public fun wgpuCommandEncoderCopyTextureToTexture( + commandEncoder: WGPUCommandEncoder?, + source: WGPUImageCopyTexture?, + destination: WGPUImageCopyTexture?, + copySize: WGPUExtent3D?, + ) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param descriptor mapped from (typedef Optional[const WGPUCommandBufferDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]](WGPUCommandBufferDescriptor)))* + */ + public fun wgpuCommandEncoderFinish( + commandEncoder: WGPUCommandEncoder?, + descriptor: WGPUCommandBufferDescriptor? + ): WGPUCommandBuffer? + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param markerLabel mapped from (Char(layout = b1))* + */ + public fun wgpuCommandEncoderInsertDebugMarker( + commandEncoder: WGPUCommandEncoder?, + markerLabel: String? + ) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + */ + public fun wgpuCommandEncoderPopDebugGroup(commandEncoder: WGPUCommandEncoder?) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param groupLabel mapped from (Char(layout = b1))* + */ + public fun wgpuCommandEncoderPushDebugGroup( + commandEncoder: WGPUCommandEncoder?, + groupLabel: String? + ) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param querySet mapped from WGPUQuerySet + * @param firstQuery mapped from uint32_t + * @param queryCount mapped from uint32_t + * @param destination mapped from WGPUBuffer + * @param destinationOffset mapped from uint64_t + */ + public fun wgpuCommandEncoderResolveQuerySet( + commandEncoder: WGPUCommandEncoder?, + querySet: WGPUQuerySet?, + firstQuery: Int, + queryCount: Int, + destination: WGPUBuffer?, + destinationOffset: Long, + ) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuCommandEncoderSetLabel(commandEncoder: WGPUCommandEncoder?, label: String?) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param querySet mapped from WGPUQuerySet + * @param queryIndex mapped from uint32_t + */ + public fun wgpuCommandEncoderWriteTimestamp( + commandEncoder: WGPUCommandEncoder?, + querySet: WGPUQuerySet?, + queryIndex: Int, + ) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + */ + public fun wgpuCommandEncoderReference(commandEncoder: WGPUCommandEncoder?) + + /** + * @param commandEncoder mapped from WGPUCommandEncoder + */ + public fun wgpuCommandEncoderRelease(commandEncoder: WGPUCommandEncoder?) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param workgroupCountX mapped from uint32_t + * @param workgroupCountY mapped from uint32_t + * @param workgroupCountZ mapped from uint32_t + */ + public fun wgpuComputePassEncoderDispatchWorkgroups( + computePassEncoder: WGPUComputePassEncoder?, + workgroupCountX: Int, + workgroupCountY: Int, + workgroupCountZ: Int, + ) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param indirectBuffer mapped from WGPUBuffer + * @param indirectOffset mapped from uint64_t + */ + public fun wgpuComputePassEncoderDispatchWorkgroupsIndirect( + computePassEncoder: WGPUComputePassEncoder?, + indirectBuffer: WGPUBuffer?, + indirectOffset: Long, + ) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + */ + public fun wgpuComputePassEncoderEnd(computePassEncoder: WGPUComputePassEncoder?) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param markerLabel mapped from (Char(layout = b1))* + */ + public fun wgpuComputePassEncoderInsertDebugMarker( + computePassEncoder: WGPUComputePassEncoder?, + markerLabel: String? + ) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + */ + public fun wgpuComputePassEncoderPopDebugGroup(computePassEncoder: WGPUComputePassEncoder?) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param groupLabel mapped from (Char(layout = b1))* + */ + public fun wgpuComputePassEncoderPushDebugGroup( + computePassEncoder: WGPUComputePassEncoder?, + groupLabel: String? + ) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param groupIndex mapped from uint32_t + * @param group mapped from WGPUBindGroup + * @param dynamicOffsetCount mapped from size_t + * @param dynamicOffsets mapped from (typedef Optional[const uint32_t] = UNSIGNED = Int(layout = + * i4))* + */ + public fun wgpuComputePassEncoderSetBindGroup( + computePassEncoder: WGPUComputePassEncoder?, + groupIndex: Int, + group: WGPUBindGroup?, + dynamicOffsetCount: NativeLong, + dynamicOffsets: Pointer?, + ) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuComputePassEncoderSetLabel( + computePassEncoder: WGPUComputePassEncoder?, + label: String? + ) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param pipeline mapped from WGPUComputePipeline + */ + public fun wgpuComputePassEncoderSetPipeline( + computePassEncoder: WGPUComputePassEncoder?, + pipeline: WGPUComputePipeline? + ) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + */ + public fun wgpuComputePassEncoderReference(computePassEncoder: WGPUComputePassEncoder?) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + */ + public fun wgpuComputePassEncoderRelease(computePassEncoder: WGPUComputePassEncoder?) + + /** + * @param computePipeline mapped from WGPUComputePipeline + * @param groupIndex mapped from uint32_t + */ + public fun wgpuComputePipelineGetBindGroupLayout( + computePipeline: WGPUComputePipeline?, + groupIndex: Int + ): WGPUBindGroupLayout? + + /** + * @param computePipeline mapped from WGPUComputePipeline + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuComputePipelineSetLabel(computePipeline: WGPUComputePipeline?, label: String?) + + /** + * @param computePipeline mapped from WGPUComputePipeline + */ + public fun wgpuComputePipelineReference(computePipeline: WGPUComputePipeline?) + + /** + * @param computePipeline mapped from WGPUComputePipeline + */ + public fun wgpuComputePipelineRelease(computePipeline: WGPUComputePipeline?) + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUBindGroupDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(layout):[*:b1]j8(entryCount)a8(entries):[*:b1]](WGPUBindGroupDescriptor)))* + */ + public fun wgpuDeviceCreateBindGroup(device: WGPUDevice?, descriptor: WGPUBindGroupDescriptor?): + WGPUBindGroup? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUBindGroupLayoutDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(entryCount)a8(entries):[*:b1]](WGPUBindGroupLayoutDescriptor)))* + */ + public fun wgpuDeviceCreateBindGroupLayout( + device: WGPUDevice?, + descriptor: WGPUBindGroupLayoutDescriptor? + ): WGPUBindGroupLayout? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUBufferDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]i4(usage)x4j8(size)i4(mappedAtCreation)x4](WGPUBufferDescriptor)))* + */ + public fun wgpuDeviceCreateBuffer(device: WGPUDevice?, descriptor: WGPUBufferDescriptor?): + WGPUBuffer? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUCommandEncoderDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]](WGPUCommandEncoderDescriptor)))* + */ + public fun wgpuDeviceCreateCommandEncoder( + device: WGPUDevice?, + descriptor: WGPUCommandEncoderDescriptor? + ): WGPUCommandEncoder? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUComputePipelineDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(layout):[*:b1][a8(nextInChain):[*:b1]a8(module):[*:b1]a8(entryPoint):[*:b1]j8(constantCount)a8(constants):[*:b1]](compute)](WGPUComputePipelineDescriptor)))* + */ + public fun wgpuDeviceCreateComputePipeline( + device: WGPUDevice?, + descriptor: WGPUComputePipelineDescriptor? + ): WGPUComputePipeline? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUComputePipelineDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(layout):[*:b1][a8(nextInChain):[*:b1]a8(module):[*:b1]a8(entryPoint):[*:b1]j8(constantCount)a8(constants):[*:b1]](compute)](WGPUComputePipelineDescriptor)))* + * @param callback mapped from WGPUCreateComputePipelineAsyncCallback + * @param userdata mapped from (Void)* + */ + public fun wgpuDeviceCreateComputePipelineAsync( + device: WGPUDevice?, + descriptor: WGPUComputePipelineDescriptor?, + callback: WGPUCreateComputePipelineAsyncCallback?, + userdata: Pointer?, + ) + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUPipelineLayoutDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(bindGroupLayoutCount)a8(bindGroupLayouts):[*:b1]](WGPUPipelineLayoutDescriptor)))* + */ + public fun wgpuDeviceCreatePipelineLayout( + device: WGPUDevice?, + descriptor: WGPUPipelineLayoutDescriptor? + ): WGPUPipelineLayout? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUQuerySetDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]i4(type)i4(count)](WGPUQuerySetDescriptor)))* + */ + public fun wgpuDeviceCreateQuerySet(device: WGPUDevice?, descriptor: WGPUQuerySetDescriptor?): + WGPUQuerySet? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPURenderBundleEncoderDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(colorFormatCount)a8(colorFormats):[*:b1]i4(depthStencilFormat)i4(sampleCount)i4(depthReadOnly)i4(stencilReadOnly)](WGPURenderBundleEncoderDescriptor)))* + */ + public fun wgpuDeviceCreateRenderBundleEncoder( + device: WGPUDevice?, + descriptor: WGPURenderBundleEncoderDescriptor? + ): WGPURenderBundleEncoder? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPURenderPipelineDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(layout):[*:b1][a8(nextInChain):[*:b1]a8(module):[*:b1]a8(entryPoint):[*:b1]j8(constantCount)a8(constants):[*:b1]j8(bufferCount)a8(buffers):[*:b1]](vertex)[a8(nextInChain):[*:b1]i4(topology)i4(stripIndexFormat)i4(frontFace)i4(cullMode)](primitive)a8(depthStencil):[*:b1][a8(nextInChain):[*:b1]i4(count)i4(mask)i4(alphaToCoverageEnabled)x4](multisample)a8(fragment):[*:b1]](WGPURenderPipelineDescriptor)))* + */ + public fun wgpuDeviceCreateRenderPipeline( + device: WGPUDevice?, + descriptor: WGPURenderPipelineDescriptor? + ): WGPURenderPipeline? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPURenderPipelineDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(layout):[*:b1][a8(nextInChain):[*:b1]a8(module):[*:b1]a8(entryPoint):[*:b1]j8(constantCount)a8(constants):[*:b1]j8(bufferCount)a8(buffers):[*:b1]](vertex)[a8(nextInChain):[*:b1]i4(topology)i4(stripIndexFormat)i4(frontFace)i4(cullMode)](primitive)a8(depthStencil):[*:b1][a8(nextInChain):[*:b1]i4(count)i4(mask)i4(alphaToCoverageEnabled)x4](multisample)a8(fragment):[*:b1]](WGPURenderPipelineDescriptor)))* + * @param callback mapped from WGPUCreateRenderPipelineAsyncCallback + * @param userdata mapped from (Void)* + */ + public fun wgpuDeviceCreateRenderPipelineAsync( + device: WGPUDevice?, + descriptor: WGPURenderPipelineDescriptor?, + callback: WGPUCreateRenderPipelineAsyncCallback?, + userdata: Pointer?, + ) + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUSamplerDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]i4(addressModeU)i4(addressModeV)i4(addressModeW)i4(magFilter)i4(minFilter)i4(mipmapFilter)f4(lodMinClamp)f4(lodMaxClamp)i4(compare)s2(maxAnisotropy)x2](WGPUSamplerDescriptor)))* + */ + public fun wgpuDeviceCreateSampler(device: WGPUDevice?, descriptor: WGPUSamplerDescriptor?): + WGPUSampler? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUShaderModuleDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(hintCount)a8(hints):[*:b1]](WGPUShaderModuleDescriptor)))* + */ + public fun wgpuDeviceCreateShaderModule( + device: WGPUDevice?, + descriptor: WGPUShaderModuleDescriptor? + ): WGPUShaderModule? + + /** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUTextureDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]i4(usage)i4(dimension)[i4(width)i4(height)i4(depthOrArrayLayers)](size)i4(format)i4(mipLevelCount)i4(sampleCount)j8(viewFormatCount)a8(viewFormats):[*:b1]](WGPUTextureDescriptor)))* + */ + public fun wgpuDeviceCreateTexture(device: WGPUDevice?, descriptor: WGPUTextureDescriptor?): + WGPUTexture? + + /** + * @param device mapped from WGPUDevice + */ + public fun wgpuDeviceDestroy(device: WGPUDevice?) + + /** + * @param device mapped from WGPUDevice + * @param features mapped from (typedef Optional[WGPUFeatureName] = Declared(i4))* + */ + public fun wgpuDeviceEnumerateFeatures(device: WGPUDevice?, features: Pointer?): NativeLong + + /** + * @param device mapped from WGPUDevice + * @param limits mapped from (typedef Optional[WGPUSupportedLimits] = + * Declared([a8(nextInChain):[*:b1][i4(maxTextureDimension1D)i4(maxTextureDimension2D)i4(maxTextureDimension3D)i4(maxTextureArrayLayers)i4(maxBindGroups)i4(maxBindGroupsPlusVertexBuffers)i4(maxBindingsPerBindGroup)i4(maxDynamicUniformBuffersPerPipelineLayout)i4(maxDynamicStorageBuffersPerPipelineLayout)i4(maxSampledTexturesPerShaderStage)i4(maxSamplersPerShaderStage)i4(maxStorageBuffersPerShaderStage)i4(maxStorageTexturesPerShaderStage)i4(maxUniformBuffersPerShaderStage)j8(maxUniformBufferBindingSize)j8(maxStorageBufferBindingSize)i4(minUniformBufferOffsetAlignment)i4(minStorageBufferOffsetAlignment)i4(maxVertexBuffers)x4j8(maxBufferSize)i4(maxVertexAttributes)i4(maxVertexBufferArrayStride)i4(maxInterStageShaderComponents)i4(maxInterStageShaderVariables)i4(maxColorAttachments)i4(maxColorAttachmentBytesPerSample)i4(maxComputeWorkgroupStorageSize)i4(maxComputeInvocationsPerWorkgroup)i4(maxComputeWorkgroupSizeX)i4(maxComputeWorkgroupSizeY)i4(maxComputeWorkgroupSizeZ)i4(maxComputeWorkgroupsPerDimension)](limits)](WGPUSupportedLimits)))* + */ + public fun wgpuDeviceGetLimits(device: WGPUDevice?, limits: WGPUSupportedLimits?): WGPUBool + + /** + * @param device mapped from WGPUDevice + */ + public fun wgpuDeviceGetQueue(device: WGPUDevice?): WGPUQueue? + + /** + * @param device mapped from WGPUDevice + * @param feature mapped from WGPUFeatureName + */ + public fun wgpuDeviceHasFeature(device: WGPUDevice?, feature: Int): WGPUBool + + /** + * @param device mapped from WGPUDevice + * @param callback mapped from WGPUErrorCallback + * @param userdata mapped from (Void)* + */ + public fun wgpuDevicePopErrorScope( + device: WGPUDevice?, + callback: WGPUErrorCallback?, + userdata: Pointer?, + ) + + /** + * @param device mapped from WGPUDevice + * @param filter mapped from WGPUErrorFilter + */ + public fun wgpuDevicePushErrorScope(device: WGPUDevice?, filter: Int) + + /** + * @param device mapped from WGPUDevice + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuDeviceSetLabel(device: WGPUDevice?, label: String?) + + /** + * @param device mapped from WGPUDevice + * @param callback mapped from WGPUErrorCallback + * @param userdata mapped from (Void)* + */ + public fun wgpuDeviceSetUncapturedErrorCallback( + device: WGPUDevice?, + callback: WGPUErrorCallback?, + userdata: Pointer?, + ) + + /** + * @param device mapped from WGPUDevice + */ + public fun wgpuDeviceReference(device: WGPUDevice?) + + /** + * @param device mapped from WGPUDevice + */ + public fun wgpuDeviceRelease(device: WGPUDevice?) + + /** + * @param instance mapped from WGPUInstance + * @param descriptor mapped from (typedef Optional[const WGPUSurfaceDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]](WGPUSurfaceDescriptor)))* + */ + public fun wgpuInstanceCreateSurface(instance: WGPUInstance?, descriptor: WGPUSurfaceDescriptor?): + WGPUSurface? + public fun wgpuInstanceCreateSurface(instance: WGPUInstance, descriptor: WGPUDarwinSurfaceDescriptor): + WGPUSurface? + + /** + * @param instance mapped from WGPUInstance + */ + public fun wgpuInstanceProcessEvents(instance: WGPUInstance?) + + /** + * @param instance mapped from WGPUInstance + * @param options mapped from (typedef Optional[const WGPURequestAdapterOptions] = + * Declared([a8(nextInChain):[*:b1]a8(compatibleSurface):[*:b1]i4(powerPreference)i4(backendType)i4(forceFallbackAdapter)x4](WGPURequestAdapterOptions)))* + * @param callback mapped from WGPURequestAdapterCallback + * @param userdata mapped from (Void)* + */ + public fun wgpuInstanceRequestAdapter( + instance: WGPUInstance?, + options: WGPURequestAdapterOptions?, + callback: WGPURequestAdapterCallback?, + userdata: Pointer?, + ) + + /** + * @param instance mapped from WGPUInstance + */ + public fun wgpuInstanceReference(instance: WGPUInstance?) + + /** + * @param instance mapped from WGPUInstance + */ + public fun wgpuInstanceRelease(instance: WGPUInstance?) + + /** + * @param pipelineLayout mapped from WGPUPipelineLayout + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuPipelineLayoutSetLabel(pipelineLayout: WGPUPipelineLayout?, label: String?) + + /** + * @param pipelineLayout mapped from WGPUPipelineLayout + */ + public fun wgpuPipelineLayoutReference(pipelineLayout: WGPUPipelineLayout?) + + /** + * @param pipelineLayout mapped from WGPUPipelineLayout + */ + public fun wgpuPipelineLayoutRelease(pipelineLayout: WGPUPipelineLayout?) + + /** + * @param querySet mapped from WGPUQuerySet + */ + public fun wgpuQuerySetDestroy(querySet: WGPUQuerySet?) + + /** + * @param querySet mapped from WGPUQuerySet + */ + public fun wgpuQuerySetGetCount(querySet: WGPUQuerySet?): Int + + /** + * @param querySet mapped from WGPUQuerySet + */ + public fun wgpuQuerySetGetType(querySet: WGPUQuerySet?): Int + + /** + * @param querySet mapped from WGPUQuerySet + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuQuerySetSetLabel(querySet: WGPUQuerySet?, label: String?) + + /** + * @param querySet mapped from WGPUQuerySet + */ + public fun wgpuQuerySetReference(querySet: WGPUQuerySet?) + + /** + * @param querySet mapped from WGPUQuerySet + */ + public fun wgpuQuerySetRelease(querySet: WGPUQuerySet?) + + /** + * @param queue mapped from WGPUQueue + * @param callback mapped from WGPUQueueWorkDoneCallback + * @param userdata mapped from (Void)* + */ + public fun wgpuQueueOnSubmittedWorkDone( + queue: WGPUQueue?, + callback: WGPUQueueWorkDoneCallback?, + userdata: Pointer?, + ) + + /** + * @param queue mapped from WGPUQueue + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuQueueSetLabel(queue: WGPUQueue?, label: String?) + + /** + * @param queue mapped from WGPUQueue + * @param commandCount mapped from size_t + * @param commands mapped from (typedef Optional[const WGPUCommandBuffer] = (Declared())*)* + */ + public fun wgpuQueueSubmit( + queue: WGPUQueue?, + commandCount: NativeLong, + commands: Array?, + ) + + /** + * @param queue mapped from WGPUQueue + * @param buffer mapped from WGPUBuffer + * @param bufferOffset mapped from uint64_t + * @param data mapped from (Void)* + * @param size mapped from size_t + */ + public fun wgpuQueueWriteBuffer( + queue: WGPUQueue?, + buffer: WGPUBuffer?, + bufferOffset: Long, + `data`: Pointer?, + size: NativeLong, + ) + + /** + * @param queue mapped from WGPUQueue + * @param destination mapped from (typedef Optional[const WGPUImageCopyTexture] = + * Declared([a8(nextInChain):[*:b1]a8(texture):[*:b1]i4(mipLevel)[i4(x)i4(y)i4(z)](origin)i4(aspect)x4](WGPUImageCopyTexture)))* + * @param data mapped from (Void)* + * @param dataSize mapped from size_t + * @param dataLayout mapped from (typedef Optional[const WGPUTextureDataLayout] = + * Declared([a8(nextInChain):[*:b1]j8(offset)i4(bytesPerRow)i4(rowsPerImage)](WGPUTextureDataLayout)))* + * @param writeSize mapped from (typedef Optional[const WGPUExtent3D] = + * Declared([i4(width)i4(height)i4(depthOrArrayLayers)](WGPUExtent3D)))* + */ + public fun wgpuQueueWriteTexture( + queue: WGPUQueue?, + destination: WGPUImageCopyTexture?, + `data`: Pointer?, + dataSize: NativeLong, + dataLayout: WGPUTextureDataLayout?, + writeSize: WGPUExtent3D?, + ) + + /** + * @param queue mapped from WGPUQueue + */ + public fun wgpuQueueReference(queue: WGPUQueue?) + + /** + * @param queue mapped from WGPUQueue + */ + public fun wgpuQueueRelease(queue: WGPUQueue?) + + /** + * @param renderBundle mapped from WGPURenderBundle + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuRenderBundleSetLabel(renderBundle: WGPURenderBundle?, label: String?) + + /** + * @param renderBundle mapped from WGPURenderBundle + */ + public fun wgpuRenderBundleReference(renderBundle: WGPURenderBundle?) + + /** + * @param renderBundle mapped from WGPURenderBundle + */ + public fun wgpuRenderBundleRelease(renderBundle: WGPURenderBundle?) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param vertexCount mapped from uint32_t + * @param instanceCount mapped from uint32_t + * @param firstVertex mapped from uint32_t + * @param firstInstance mapped from uint32_t + */ + public fun wgpuRenderBundleEncoderDraw( + renderBundleEncoder: WGPURenderBundleEncoder?, + vertexCount: Int, + instanceCount: Int, + firstVertex: Int, + firstInstance: Int, + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param indexCount mapped from uint32_t + * @param instanceCount mapped from uint32_t + * @param firstIndex mapped from uint32_t + * @param baseVertex mapped from int32_t + * @param firstInstance mapped from uint32_t + */ + public fun wgpuRenderBundleEncoderDrawIndexed( + renderBundleEncoder: WGPURenderBundleEncoder?, + indexCount: Int, + instanceCount: Int, + firstIndex: Int, + baseVertex: Int, + firstInstance: Int, + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param indirectBuffer mapped from WGPUBuffer + * @param indirectOffset mapped from uint64_t + */ + public fun wgpuRenderBundleEncoderDrawIndexedIndirect( + renderBundleEncoder: WGPURenderBundleEncoder?, + indirectBuffer: WGPUBuffer?, + indirectOffset: Long, + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param indirectBuffer mapped from WGPUBuffer + * @param indirectOffset mapped from uint64_t + */ + public fun wgpuRenderBundleEncoderDrawIndirect( + renderBundleEncoder: WGPURenderBundleEncoder?, + indirectBuffer: WGPUBuffer?, + indirectOffset: Long, + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param descriptor mapped from (typedef Optional[const WGPURenderBundleDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]](WGPURenderBundleDescriptor)))* + */ + public fun wgpuRenderBundleEncoderFinish( + renderBundleEncoder: WGPURenderBundleEncoder?, + descriptor: WGPURenderBundleDescriptor? + ): WGPURenderBundle? + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param markerLabel mapped from (Char(layout = b1))* + */ + public fun wgpuRenderBundleEncoderInsertDebugMarker( + renderBundleEncoder: WGPURenderBundleEncoder?, + markerLabel: String? + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + */ + public fun wgpuRenderBundleEncoderPopDebugGroup(renderBundleEncoder: WGPURenderBundleEncoder?) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param groupLabel mapped from (Char(layout = b1))* + */ + public fun wgpuRenderBundleEncoderPushDebugGroup( + renderBundleEncoder: WGPURenderBundleEncoder?, + groupLabel: String? + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param groupIndex mapped from uint32_t + * @param group mapped from WGPUBindGroup + * @param dynamicOffsetCount mapped from size_t + * @param dynamicOffsets mapped from (typedef Optional[const uint32_t] = UNSIGNED = Int(layout = + * i4))* + */ + public fun wgpuRenderBundleEncoderSetBindGroup( + renderBundleEncoder: WGPURenderBundleEncoder?, + groupIndex: Int, + group: WGPUBindGroup?, + dynamicOffsetCount: NativeLong, + dynamicOffsets: Pointer?, + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param buffer mapped from WGPUBuffer + * @param format mapped from WGPUIndexFormat + * @param offset mapped from uint64_t + * @param size mapped from uint64_t + */ + public fun wgpuRenderBundleEncoderSetIndexBuffer( + renderBundleEncoder: WGPURenderBundleEncoder?, + buffer: WGPUBuffer?, + format: Int, + offset: Long, + size: Long, + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuRenderBundleEncoderSetLabel( + renderBundleEncoder: WGPURenderBundleEncoder?, + label: String? + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param pipeline mapped from WGPURenderPipeline + */ + public fun wgpuRenderBundleEncoderSetPipeline( + renderBundleEncoder: WGPURenderBundleEncoder?, + pipeline: WGPURenderPipeline? + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param slot mapped from uint32_t + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param size mapped from uint64_t + */ + public fun wgpuRenderBundleEncoderSetVertexBuffer( + renderBundleEncoder: WGPURenderBundleEncoder?, + slot: Int, + buffer: WGPUBuffer?, + offset: Long, + size: Long, + ) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + */ + public fun wgpuRenderBundleEncoderReference(renderBundleEncoder: WGPURenderBundleEncoder?) + + /** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + */ + public fun wgpuRenderBundleEncoderRelease(renderBundleEncoder: WGPURenderBundleEncoder?) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param queryIndex mapped from uint32_t + */ + public fun wgpuRenderPassEncoderBeginOcclusionQuery( + renderPassEncoder: WGPURenderPassEncoder?, + queryIndex: Int + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param vertexCount mapped from uint32_t + * @param instanceCount mapped from uint32_t + * @param firstVertex mapped from uint32_t + * @param firstInstance mapped from uint32_t + */ + public fun wgpuRenderPassEncoderDraw( + renderPassEncoder: WGPURenderPassEncoder?, + vertexCount: Int, + instanceCount: Int?, + firstVertex: Int?, + firstInstance: Int?, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param indexCount mapped from uint32_t + * @param instanceCount mapped from uint32_t + * @param firstIndex mapped from uint32_t + * @param baseVertex mapped from int32_t + * @param firstInstance mapped from uint32_t + */ + public fun wgpuRenderPassEncoderDrawIndexed( + renderPassEncoder: WGPURenderPassEncoder?, + indexCount: Int, + instanceCount: Int, + firstIndex: Int, + baseVertex: Int, + firstInstance: Int, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param indirectBuffer mapped from WGPUBuffer + * @param indirectOffset mapped from uint64_t + */ + public fun wgpuRenderPassEncoderDrawIndexedIndirect( + renderPassEncoder: WGPURenderPassEncoder?, + indirectBuffer: WGPUBuffer?, + indirectOffset: Long, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param indirectBuffer mapped from WGPUBuffer + * @param indirectOffset mapped from uint64_t + */ + public fun wgpuRenderPassEncoderDrawIndirect( + renderPassEncoder: WGPURenderPassEncoder?, + indirectBuffer: WGPUBuffer?, + indirectOffset: Long, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ + public fun wgpuRenderPassEncoderEnd(renderPassEncoder: WGPURenderPassEncoder?) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ + public fun wgpuRenderPassEncoderEndOcclusionQuery(renderPassEncoder: WGPURenderPassEncoder?) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param bundleCount mapped from size_t + * @param bundles mapped from (typedef Optional[const WGPURenderBundle] = (Declared())*)* + */ + public fun wgpuRenderPassEncoderExecuteBundles( + renderPassEncoder: WGPURenderPassEncoder?, + bundleCount: NativeLong, + bundles: WGPURenderBundle?, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param markerLabel mapped from (Char(layout = b1))* + */ + public fun wgpuRenderPassEncoderInsertDebugMarker( + renderPassEncoder: WGPURenderPassEncoder?, + markerLabel: String? + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ + public fun wgpuRenderPassEncoderPopDebugGroup(renderPassEncoder: WGPURenderPassEncoder?) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param groupLabel mapped from (Char(layout = b1))* + */ + public fun wgpuRenderPassEncoderPushDebugGroup( + renderPassEncoder: WGPURenderPassEncoder?, + groupLabel: String? + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param groupIndex mapped from uint32_t + * @param group mapped from WGPUBindGroup + * @param dynamicOffsetCount mapped from size_t + * @param dynamicOffsets mapped from (typedef Optional[const uint32_t] = UNSIGNED = Int(layout = + * i4))* + */ + public fun wgpuRenderPassEncoderSetBindGroup( + renderPassEncoder: WGPURenderPassEncoder?, + groupIndex: Int, + group: WGPUBindGroup?, + dynamicOffsetCount: NativeLong, + dynamicOffsets: Pointer?, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param color mapped from (typedef Optional[const WGPUColor] = + * Declared([d8(r)d8(g)d8(b)d8(a)](WGPUColor)))* + */ + public fun wgpuRenderPassEncoderSetBlendConstant( + renderPassEncoder: WGPURenderPassEncoder?, + color: WGPUColor? + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param buffer mapped from WGPUBuffer + * @param format mapped from WGPUIndexFormat + * @param offset mapped from uint64_t + * @param size mapped from uint64_t + */ + public fun wgpuRenderPassEncoderSetIndexBuffer( + renderPassEncoder: WGPURenderPassEncoder?, + buffer: WGPUBuffer?, + format: Int, + offset: Long, + size: Long, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuRenderPassEncoderSetLabel( + renderPassEncoder: WGPURenderPassEncoder?, + label: String? + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param pipeline mapped from WGPURenderPipeline + */ + public fun wgpuRenderPassEncoderSetPipeline( + renderPassEncoder: WGPURenderPassEncoder?, + pipeline: WGPURenderPipeline? + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param x mapped from uint32_t + * @param y mapped from uint32_t + * @param width mapped from uint32_t + * @param height mapped from uint32_t + */ + public fun wgpuRenderPassEncoderSetScissorRect( + renderPassEncoder: WGPURenderPassEncoder?, + x: Int, + y: Int, + width: Int, + height: Int, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param reference mapped from uint32_t + */ + public fun wgpuRenderPassEncoderSetStencilReference( + renderPassEncoder: WGPURenderPassEncoder?, + reference: Int + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param slot mapped from uint32_t + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param size mapped from uint64_t + */ + public fun wgpuRenderPassEncoderSetVertexBuffer( + renderPassEncoder: WGPURenderPassEncoder?, + slot: Int, + buffer: WGPUBuffer?, + offset: Long, + size: Long?, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param x mapped from float + * @param y mapped from float + * @param width mapped from float + * @param height mapped from float + * @param minDepth mapped from float + * @param maxDepth mapped from float + */ + public fun wgpuRenderPassEncoderSetViewport( + renderPassEncoder: WGPURenderPassEncoder?, + x: Float, + y: Float, + width: Float, + height: Float, + minDepth: Float, + maxDepth: Float, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ + public fun wgpuRenderPassEncoderReference(renderPassEncoder: WGPURenderPassEncoder?) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ + public fun wgpuRenderPassEncoderRelease(renderPassEncoder: WGPURenderPassEncoder?) + + /** + * @param renderPipeline mapped from WGPURenderPipeline + * @param groupIndex mapped from uint32_t + */ + public fun wgpuRenderPipelineGetBindGroupLayout( + renderPipeline: WGPURenderPipeline?, + groupIndex: Int + ): WGPUBindGroupLayout? + + /** + * @param renderPipeline mapped from WGPURenderPipeline + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuRenderPipelineSetLabel(renderPipeline: WGPURenderPipeline?, label: String?) + + /** + * @param renderPipeline mapped from WGPURenderPipeline + */ + public fun wgpuRenderPipelineReference(renderPipeline: WGPURenderPipeline?) + + /** + * @param renderPipeline mapped from WGPURenderPipeline + */ + public fun wgpuRenderPipelineRelease(renderPipeline: WGPURenderPipeline?) + + /** + * @param sampler mapped from WGPUSampler + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuSamplerSetLabel(sampler: WGPUSampler?, label: String?) + + /** + * @param sampler mapped from WGPUSampler + */ + public fun wgpuSamplerReference(sampler: WGPUSampler?) + + /** + * @param sampler mapped from WGPUSampler + */ + public fun wgpuSamplerRelease(sampler: WGPUSampler?) + + /** + * @param shaderModule mapped from WGPUShaderModule + * @param callback mapped from WGPUCompilationInfoCallback + * @param userdata mapped from (Void)* + */ + public fun wgpuShaderModuleGetCompilationInfo( + shaderModule: WGPUShaderModule?, + callback: WGPUCompilationInfoCallback?, + userdata: Pointer?, + ) + + /** + * @param shaderModule mapped from WGPUShaderModule + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuShaderModuleSetLabel(shaderModule: WGPUShaderModule?, label: String?) + + /** + * @param shaderModule mapped from WGPUShaderModule + */ + public fun wgpuShaderModuleReference(shaderModule: WGPUShaderModule?) + + /** + * @param shaderModule mapped from WGPUShaderModule + */ + public fun wgpuShaderModuleRelease(shaderModule: WGPUShaderModule?) + + /** + * @param surface mapped from WGPUSurface + * @param config mapped from (typedef Optional[const WGPUSurfaceConfiguration] = + * Declared([a8(nextInChain):[*:b1]a8(device):[*:b1]i4(format)i4(usage)j8(viewFormatCount)a8(viewFormats):[*:b1]i4(alphaMode)i4(width)i4(height)i4(presentMode)](WGPUSurfaceConfiguration)))* + */ + public fun wgpuSurfaceConfigure(surface: WGPUSurface?, config: WGPUSurfaceConfiguration?) + + /** + * @param surface mapped from WGPUSurface + * @param adapter mapped from WGPUAdapter + * @param capabilities mapped from (typedef Optional[WGPUSurfaceCapabilities] = + * Declared([a8(nextInChain):[*:b1]j8(formatCount)a8(formats):[*:b1]j8(presentModeCount)a8(presentModes):[*:b1]j8(alphaModeCount)a8(alphaModes):[*:b1]](WGPUSurfaceCapabilities)))* + */ + public fun wgpuSurfaceGetCapabilities( + surface: WGPUSurface?, + adapter: WGPUAdapter?, + capabilities: WGPUSurfaceCapabilities?, + ) + + /** + * @param surface mapped from WGPUSurface + * @param surfaceTexture mapped from (typedef Optional[WGPUSurfaceTexture] = + * Declared([a8(texture):[*:b1]i4(suboptimal)i4(status)](WGPUSurfaceTexture)))* + */ + public fun wgpuSurfaceGetCurrentTexture( + surface: WGPUSurface?, + surfaceTexture: WGPUSurfaceTexture? + ) + + /** + * @param surface mapped from WGPUSurface + * @param adapter mapped from WGPUAdapter + */ + public fun wgpuSurfaceGetPreferredFormat(surface: WGPUSurface?, adapter: WGPUAdapter?): Int + + /** + * @param surface mapped from WGPUSurface + */ + public fun wgpuSurfacePresent(surface: WGPUSurface?) + + /** + * @param surface mapped from WGPUSurface + */ + public fun wgpuSurfaceUnconfigure(surface: WGPUSurface?) + + /** + * @param surface mapped from WGPUSurface + */ + public fun wgpuSurfaceReference(surface: WGPUSurface?) + + /** + * @param surface mapped from WGPUSurface + */ + public fun wgpuSurfaceRelease(surface: WGPUSurface?) + + /** + * @param capabilities mapped from WGPUSurfaceCapabilities + */ + public fun wgpuSurfaceCapabilitiesFreeMembers(capabilities: WGPUSurfaceCapabilities) + + /** + * @param texture mapped from WGPUTexture + * @param descriptor mapped from (typedef Optional[const WGPUTextureViewDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]i4(format)i4(dimension)i4(baseMipLevel)i4(mipLevelCount)i4(baseArrayLayer)i4(arrayLayerCount)i4(aspect)x4](WGPUTextureViewDescriptor)))* + */ + public fun wgpuTextureCreateView(texture: WGPUTexture?, descriptor: WGPUTextureViewDescriptor?): + WGPUTextureView? + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureDestroy(texture: WGPUTexture?) + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureGetDepthOrArrayLayers(texture: WGPUTexture?): Int + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureGetDimension(texture: WGPUTexture?): Int + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureGetFormat(texture: WGPUTexture?): Int + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureGetHeight(texture: WGPUTexture?): Int + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureGetMipLevelCount(texture: WGPUTexture?): Int + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureGetSampleCount(texture: WGPUTexture?): Int + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureGetUsage(texture: WGPUTexture?): WGPUTextureUsageFlags + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureGetWidth(texture: WGPUTexture?): Int + + /** + * @param texture mapped from WGPUTexture + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuTextureSetLabel(texture: WGPUTexture?, label: String?) + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureReference(texture: WGPUTexture?) + + /** + * @param texture mapped from WGPUTexture + */ + public fun wgpuTextureRelease(texture: WGPUTexture?) + + /** + * @param textureView mapped from WGPUTextureView + * @param label mapped from (Char(layout = b1))* + */ + public fun wgpuTextureViewSetLabel(textureView: WGPUTextureView?, label: String?) + + /** + * @param textureView mapped from WGPUTextureView + */ + public fun wgpuTextureViewReference(textureView: WGPUTextureView?) + + /** + * @param textureView mapped from WGPUTextureView + */ + public fun wgpuTextureViewRelease(textureView: WGPUTextureView?) + + /** + * @param instance mapped from WGPUInstance + * @param report mapped from (typedef Optional[WGPUGlobalReport] = + * Declared([[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](surfaces)i4(backendType)x4[[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](adapters)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](devices)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](queues)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](pipelineLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](shaderModules)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroupLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroups)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](commandBuffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderBundles)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderPipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](computePipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](querySets)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](buffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textures)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textureViews)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](samplers)](vulkan)[[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](adapters)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](devices)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](queues)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](pipelineLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](shaderModules)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroupLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroups)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](commandBuffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderBundles)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderPipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](computePipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](querySets)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](buffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textures)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textureViews)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](samplers)](metal)[[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](adapters)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](devices)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](queues)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](pipelineLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](shaderModules)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroupLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroups)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](commandBuffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderBundles)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderPipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](computePipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](querySets)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](buffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textures)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textureViews)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](samplers)](dx12)[[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](adapters)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](devices)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](queues)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](pipelineLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](shaderModules)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroupLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroups)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](commandBuffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderBundles)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderPipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](computePipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](querySets)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](buffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textures)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textureViews)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](samplers)](gl)](WGPUGlobalReport)))* + */ + public fun wgpuGenerateReport(instance: WGPUInstance?, report: WGPUGlobalReport?) + + /** + * @param instance mapped from WGPUInstance + * @param options mapped from (typedef Optional[const WGPUInstanceEnumerateAdapterOptions] = + * Declared([a8(nextInChain):[*:b1]i4(backends)x4](WGPUInstanceEnumerateAdapterOptions)))* + * @param adapters mapped from (typedef Optional[WGPUAdapter] = (Declared())*)* + */ + public fun wgpuInstanceEnumerateAdapters( + instance: WGPUInstance?, + options: WGPUInstanceEnumerateAdapterOptions?, + adapters: WGPUAdapter?, + ): NativeLong + + /** + * @param queue mapped from WGPUQueue + * @param commandCount mapped from size_t + * @param commands mapped from (typedef Optional[const WGPUCommandBuffer] = (Declared())*)* + */ + public fun wgpuQueueSubmitForIndex( + queue: WGPUQueue?, + commandCount: NativeLong, + commands: WGPUCommandBuffer?, + ): WGPUSubmissionIndex + + /** + * @param device mapped from WGPUDevice + * @param wait mapped from WGPUBool + * @param wrappedSubmissionIndex mapped from (typedef Optional[const WGPUWrappedSubmissionIndex] = + * Declared([a8(queue):[*:b1]j8(submissionIndex)](WGPUWrappedSubmissionIndex)))* + */ + public fun wgpuDevicePoll( + device: WGPUDevice?, + wait: WGPUBool, + wrappedSubmissionIndex: WGPUWrappedSubmissionIndex?, + ): WGPUBool + + /** + * @param callback mapped from WGPULogCallback + * @param userdata mapped from (Void)* + */ + public fun wgpuSetLogCallback(callback: WGPULogCallback?, userdata: Pointer?) + + /** + * @param level mapped from WGPULogLevel + */ + public fun wgpuSetLogLevel(level: Int) + + public fun wgpuGetVersion(): Int + + /** + * @param encoder mapped from WGPURenderPassEncoder + * @param stages mapped from WGPUShaderStageFlags + * @param offset mapped from uint32_t + * @param sizeBytes mapped from uint32_t + * @param data mapped from (Void)* + */ + public fun wgpuRenderPassEncoderSetPushConstants( + encoder: WGPURenderPassEncoder?, + stages: WGPUShaderStageFlags, + offset: Int, + sizeBytes: Int, + `data`: Pointer?, + ) + + /** + * @param encoder mapped from WGPURenderPassEncoder + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param count mapped from uint32_t + */ + public fun wgpuRenderPassEncoderMultiDrawIndirect( + encoder: WGPURenderPassEncoder?, + buffer: WGPUBuffer?, + offset: Long, + count: Int, + ) + + /** + * @param encoder mapped from WGPURenderPassEncoder + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param count mapped from uint32_t + */ + public fun wgpuRenderPassEncoderMultiDrawIndexedIndirect( + encoder: WGPURenderPassEncoder?, + buffer: WGPUBuffer?, + offset: Long, + count: Int, + ) + + /** + * @param encoder mapped from WGPURenderPassEncoder + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param count_buffer mapped from WGPUBuffer + * @param count_buffer_offset mapped from uint64_t + * @param max_count mapped from uint32_t + */ + public fun wgpuRenderPassEncoderMultiDrawIndirectCount( + encoder: WGPURenderPassEncoder?, + buffer: WGPUBuffer?, + offset: Long, + count_buffer: WGPUBuffer?, + count_buffer_offset: Long, + max_count: Int, + ) + + /** + * @param encoder mapped from WGPURenderPassEncoder + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param count_buffer mapped from WGPUBuffer + * @param count_buffer_offset mapped from uint64_t + * @param max_count mapped from uint32_t + */ + public fun wgpuRenderPassEncoderMultiDrawIndexedIndirectCount( + encoder: WGPURenderPassEncoder?, + buffer: WGPUBuffer?, + offset: Long, + count_buffer: WGPUBuffer?, + count_buffer_offset: Long, + max_count: Int, + ) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param querySet mapped from WGPUQuerySet + * @param queryIndex mapped from uint32_t + */ + public fun wgpuComputePassEncoderBeginPipelineStatisticsQuery( + computePassEncoder: WGPUComputePassEncoder?, + querySet: WGPUQuerySet?, + queryIndex: Int, + ) + + /** + * @param computePassEncoder mapped from WGPUComputePassEncoder + */ + public + fun wgpuComputePassEncoderEndPipelineStatisticsQuery(computePassEncoder: WGPUComputePassEncoder?) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param querySet mapped from WGPUQuerySet + * @param queryIndex mapped from uint32_t + */ + public fun wgpuRenderPassEncoderBeginPipelineStatisticsQuery( + renderPassEncoder: WGPURenderPassEncoder?, + querySet: WGPUQuerySet?, + queryIndex: Int, + ) + + /** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ + public + fun wgpuRenderPassEncoderEndPipelineStatisticsQuery(renderPassEncoder: WGPURenderPassEncoder?) +} + +/** + * @param descriptor mapped from (typedef Optional[const WGPUInstanceDescriptor] = + * Declared([a8(nextInChain):[*:b1]](WGPUInstanceDescriptor)))* + */ +public fun wgpuCreateInstance(descriptor: WGPUInstanceDescriptor?): WGPUInstance? = + libWGPULibrary.wgpuCreateInstance(descriptor) + +/** + * @param device mapped from WGPUDevice + * @param procName mapped from (Char(layout = b1))* + */ +public fun wgpuGetProcAddress(device: WGPUDevice?, procName: String?): WGPUProc? = + libWGPULibrary.wgpuGetProcAddress(device, procName) + +/** + * @param adapter mapped from WGPUAdapter + * @param features mapped from (typedef Optional[WGPUFeatureName] = Declared(i4))* + */ +public fun wgpuAdapterEnumerateFeatures(adapter: WGPUAdapter?, features: Pointer?): NativeLong = + libWGPULibrary.wgpuAdapterEnumerateFeatures(adapter, features) + +/** + * @param adapter mapped from WGPUAdapter + * @param limits mapped from (typedef Optional[WGPUSupportedLimits] = + * Declared([a8(nextInChain):[*:b1][i4(maxTextureDimension1D)i4(maxTextureDimension2D)i4(maxTextureDimension3D)i4(maxTextureArrayLayers)i4(maxBindGroups)i4(maxBindGroupsPlusVertexBuffers)i4(maxBindingsPerBindGroup)i4(maxDynamicUniformBuffersPerPipelineLayout)i4(maxDynamicStorageBuffersPerPipelineLayout)i4(maxSampledTexturesPerShaderStage)i4(maxSamplersPerShaderStage)i4(maxStorageBuffersPerShaderStage)i4(maxStorageTexturesPerShaderStage)i4(maxUniformBuffersPerShaderStage)j8(maxUniformBufferBindingSize)j8(maxStorageBufferBindingSize)i4(minUniformBufferOffsetAlignment)i4(minStorageBufferOffsetAlignment)i4(maxVertexBuffers)x4j8(maxBufferSize)i4(maxVertexAttributes)i4(maxVertexBufferArrayStride)i4(maxInterStageShaderComponents)i4(maxInterStageShaderVariables)i4(maxColorAttachments)i4(maxColorAttachmentBytesPerSample)i4(maxComputeWorkgroupStorageSize)i4(maxComputeInvocationsPerWorkgroup)i4(maxComputeWorkgroupSizeX)i4(maxComputeWorkgroupSizeY)i4(maxComputeWorkgroupSizeZ)i4(maxComputeWorkgroupsPerDimension)](limits)](WGPUSupportedLimits)))* + */ +public fun wgpuAdapterGetLimits(adapter: WGPUAdapter?, limits: WGPUSupportedLimits?): WGPUBool = + libWGPULibrary.wgpuAdapterGetLimits(adapter, limits) + +/** + * @param adapter mapped from WGPUAdapter + * @param properties mapped from (typedef Optional[WGPUAdapterProperties] = + * Declared([a8(nextInChain):[*:b1]i4(vendorID)x4a8(vendorName):[*:b1]a8(architecture):[*:b1]i4(deviceID)x4a8(name):[*:b1]a8(driverDescription):[*:b1]i4(adapterType)i4(backendType)](WGPUAdapterProperties)))* + */ +public fun wgpuAdapterGetProperties(adapter: WGPUAdapter?, properties: WGPUAdapterProperties?): Unit = + libWGPULibrary.wgpuAdapterGetProperties(adapter, properties) + +/** + * @param adapter mapped from WGPUAdapter + * @param feature mapped from WGPUFeatureName + */ +public fun wgpuAdapterHasFeature(adapter: WGPUAdapter?, feature: Int): WGPUBool = + libWGPULibrary.wgpuAdapterHasFeature(adapter, feature) + +/** + * @param adapter mapped from WGPUAdapter + * @param descriptor mapped from (typedef Optional[const WGPUDeviceDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(requiredFeatureCount)a8(requiredFeatures):[*:b1]a8(requiredLimits):[*:b1][a8(nextInChain):[*:b1]a8(label):[*:b1]](defaultQueue)a8(deviceLostCallback):[*:b1]a8(deviceLostUserdata):[*:b1]](WGPUDeviceDescriptor)))* + * @param callback mapped from WGPURequestDeviceCallback + * @param userdata mapped from (Void)* + */ +public fun wgpuAdapterRequestDevice( + adapter: WGPUAdapter?, + descriptor: WGPUDeviceDescriptor?, + callback: WGPURequestDeviceCallback?, + userdata: Pointer?, +): Unit = libWGPULibrary.wgpuAdapterRequestDevice(adapter, descriptor, callback, userdata) + +/** + * @param adapter mapped from WGPUAdapter + */ +public fun wgpuAdapterReference(adapter: WGPUAdapter?): Unit = + libWGPULibrary.wgpuAdapterReference(adapter) + +/** + * @param adapter mapped from WGPUAdapter + */ +public fun wgpuAdapterRelease(adapter: WGPUAdapter?): Unit = + libWGPULibrary.wgpuAdapterRelease(adapter) + +/** + * @param bindGroup mapped from WGPUBindGroup + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuBindGroupSetLabel(bindGroup: WGPUBindGroup?, label: String?): Unit = + libWGPULibrary.wgpuBindGroupSetLabel(bindGroup, label) + +/** + * @param bindGroup mapped from WGPUBindGroup + */ +public fun wgpuBindGroupReference(bindGroup: WGPUBindGroup?): Unit = + libWGPULibrary.wgpuBindGroupReference(bindGroup) + +/** + * @param bindGroup mapped from WGPUBindGroup + */ +public fun wgpuBindGroupRelease(bindGroup: WGPUBindGroup?): Unit = + libWGPULibrary.wgpuBindGroupRelease(bindGroup) + +/** + * @param bindGroupLayout mapped from WGPUBindGroupLayout + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuBindGroupLayoutSetLabel(bindGroupLayout: WGPUBindGroupLayout?, label: String?): Unit = + libWGPULibrary.wgpuBindGroupLayoutSetLabel(bindGroupLayout, label) + +/** + * @param bindGroupLayout mapped from WGPUBindGroupLayout + */ +public fun wgpuBindGroupLayoutReference(bindGroupLayout: WGPUBindGroupLayout?): Unit = + libWGPULibrary.wgpuBindGroupLayoutReference(bindGroupLayout) + +/** + * @param bindGroupLayout mapped from WGPUBindGroupLayout + */ +public fun wgpuBindGroupLayoutRelease(bindGroupLayout: WGPUBindGroupLayout?): Unit = + libWGPULibrary.wgpuBindGroupLayoutRelease(bindGroupLayout) + +/** + * @param buffer mapped from WGPUBuffer + */ +public fun wgpuBufferDestroy(buffer: WGPUBuffer?): Unit = libWGPULibrary.wgpuBufferDestroy(buffer) + +/** + * @param buffer mapped from WGPUBuffer + * @param offset mapped from size_t + * @param size mapped from size_t + */ +public fun wgpuBufferGetConstMappedRange( + buffer: WGPUBuffer?, + offset: NativeLong, + size: NativeLong, +): Pointer? = libWGPULibrary.wgpuBufferGetConstMappedRange(buffer, offset, size) + +/** + * @param buffer mapped from WGPUBuffer + */ +public fun wgpuBufferGetMapState(buffer: WGPUBuffer?): Int = + libWGPULibrary.wgpuBufferGetMapState(buffer) + +/** + * @param buffer mapped from WGPUBuffer + * @param offset mapped from size_t + * @param size mapped from size_t + */ +public fun wgpuBufferGetMappedRange( + buffer: WGPUBuffer?, + offset: NativeLong?, + size: NativeLong?, +): Pointer? = libWGPULibrary.wgpuBufferGetMappedRange(buffer, offset, size) + +/** + * @param buffer mapped from WGPUBuffer + */ +public fun wgpuBufferGetSize(buffer: WGPUBuffer?): Long = libWGPULibrary.wgpuBufferGetSize(buffer) + +/** + * @param buffer mapped from WGPUBuffer + */ +public fun wgpuBufferGetUsage(buffer: WGPUBuffer?): WGPUBufferUsageFlags = + libWGPULibrary.wgpuBufferGetUsage(buffer) + +/** + * @param buffer mapped from WGPUBuffer + * @param mode mapped from WGPUMapModeFlags + * @param offset mapped from size_t + * @param size mapped from size_t + * @param callback mapped from WGPUBufferMapCallback + * @param userdata mapped from (Void)* + */ +public fun wgpuBufferMapAsync( + buffer: WGPUBuffer?, + mode: WGPUMapModeFlags, + offset: NativeLong, + size: NativeLong, + callback: WGPUBufferMapCallback?, + userdata: Pointer?, +): Unit = libWGPULibrary.wgpuBufferMapAsync(buffer, mode, offset, size, callback, userdata) + +/** + * @param buffer mapped from WGPUBuffer + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuBufferSetLabel(buffer: WGPUBuffer?, label: String?): Unit = + libWGPULibrary.wgpuBufferSetLabel(buffer, label) + +/** + * @param buffer mapped from WGPUBuffer + */ +public fun wgpuBufferUnmap(buffer: WGPUBuffer?): Unit = libWGPULibrary.wgpuBufferUnmap(buffer) + +/** + * @param buffer mapped from WGPUBuffer + */ +public fun wgpuBufferReference(buffer: WGPUBuffer?): Unit = + libWGPULibrary.wgpuBufferReference(buffer) + +/** + * @param buffer mapped from WGPUBuffer + */ +public fun wgpuBufferRelease(buffer: WGPUBuffer?): Unit = libWGPULibrary.wgpuBufferRelease(buffer) + +/** + * @param commandBuffer mapped from WGPUCommandBuffer + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuCommandBufferSetLabel(commandBuffer: WGPUCommandBuffer?, label: String?): Unit = + libWGPULibrary.wgpuCommandBufferSetLabel(commandBuffer, label) + +/** + * @param commandBuffer mapped from WGPUCommandBuffer + */ +public fun wgpuCommandBufferReference(commandBuffer: WGPUCommandBuffer?): Unit = + libWGPULibrary.wgpuCommandBufferReference(commandBuffer) + +/** + * @param commandBuffer mapped from WGPUCommandBuffer + */ +public fun wgpuCommandBufferRelease(commandBuffer: WGPUCommandBuffer?): Unit = + libWGPULibrary.wgpuCommandBufferRelease(commandBuffer) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param descriptor mapped from (typedef Optional[const WGPUComputePassDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(timestampWrites):[*:b1]](WGPUComputePassDescriptor)))* + */ +public fun wgpuCommandEncoderBeginComputePass( + commandEncoder: WGPUCommandEncoder?, + descriptor: WGPUComputePassDescriptor? +): WGPUComputePassEncoder? = + libWGPULibrary.wgpuCommandEncoderBeginComputePass(commandEncoder, descriptor) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param descriptor mapped from (typedef Optional[const WGPURenderPassDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(colorAttachmentCount)a8(colorAttachments):[*:b1]a8(depthStencilAttachment):[*:b1]a8(occlusionQuerySet):[*:b1]a8(timestampWrites):[*:b1]](WGPURenderPassDescriptor)))* + */ +public fun wgpuCommandEncoderBeginRenderPass( + commandEncoder: WGPUCommandEncoder?, + descriptor: WGPURenderPassDescriptor? +): WGPURenderPassEncoder? = + libWGPULibrary.wgpuCommandEncoderBeginRenderPass(commandEncoder, descriptor) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param size mapped from uint64_t + */ +public fun wgpuCommandEncoderClearBuffer( + commandEncoder: WGPUCommandEncoder?, + buffer: WGPUBuffer?, + offset: Long, + size: Long, +): Unit = libWGPULibrary.wgpuCommandEncoderClearBuffer(commandEncoder, buffer, offset, size) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param source mapped from WGPUBuffer + * @param sourceOffset mapped from uint64_t + * @param destination mapped from WGPUBuffer + * @param destinationOffset mapped from uint64_t + * @param size mapped from uint64_t + */ +public fun wgpuCommandEncoderCopyBufferToBuffer( + commandEncoder: WGPUCommandEncoder?, + source: WGPUBuffer?, + sourceOffset: Long, + destination: WGPUBuffer?, + destinationOffset: Long, + size: Long, +): Unit = libWGPULibrary.wgpuCommandEncoderCopyBufferToBuffer( + commandEncoder, source, sourceOffset, + destination, destinationOffset, size +) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param source mapped from (typedef Optional[const WGPUImageCopyBuffer] = + * Declared([a8(nextInChain):[*:b1][a8(nextInChain):[*:b1]j8(offset)i4(bytesPerRow)i4(rowsPerImage)](layout)a8(buffer):[*:b1]](WGPUImageCopyBuffer)))* + * @param destination mapped from (typedef Optional[const WGPUImageCopyTexture] = + * Declared([a8(nextInChain):[*:b1]a8(texture):[*:b1]i4(mipLevel)[i4(x)i4(y)i4(z)](origin)i4(aspect)x4](WGPUImageCopyTexture)))* + * @param copySize mapped from (typedef Optional[const WGPUExtent3D] = + * Declared([i4(width)i4(height)i4(depthOrArrayLayers)](WGPUExtent3D)))* + */ +public fun wgpuCommandEncoderCopyBufferToTexture( + commandEncoder: WGPUCommandEncoder?, + source: WGPUImageCopyBuffer?, + destination: WGPUImageCopyTexture?, + copySize: WGPUExtent3D?, +): Unit = libWGPULibrary.wgpuCommandEncoderCopyBufferToTexture( + commandEncoder, source, destination, + copySize +) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param source mapped from (typedef Optional[const WGPUImageCopyTexture] = + * Declared([a8(nextInChain):[*:b1]a8(texture):[*:b1]i4(mipLevel)[i4(x)i4(y)i4(z)](origin)i4(aspect)x4](WGPUImageCopyTexture)))* + * @param destination mapped from (typedef Optional[const WGPUImageCopyBuffer] = + * Declared([a8(nextInChain):[*:b1][a8(nextInChain):[*:b1]j8(offset)i4(bytesPerRow)i4(rowsPerImage)](layout)a8(buffer):[*:b1]](WGPUImageCopyBuffer)))* + * @param copySize mapped from (typedef Optional[const WGPUExtent3D] = + * Declared([i4(width)i4(height)i4(depthOrArrayLayers)](WGPUExtent3D)))* + */ +public fun wgpuCommandEncoderCopyTextureToBuffer( + commandEncoder: WGPUCommandEncoder?, + source: WGPUImageCopyTexture?, + destination: WGPUImageCopyBuffer?, + copySize: WGPUExtent3D?, +): Unit = libWGPULibrary.wgpuCommandEncoderCopyTextureToBuffer( + commandEncoder, source, destination, + copySize +) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param source mapped from (typedef Optional[const WGPUImageCopyTexture] = + * Declared([a8(nextInChain):[*:b1]a8(texture):[*:b1]i4(mipLevel)[i4(x)i4(y)i4(z)](origin)i4(aspect)x4](WGPUImageCopyTexture)))* + * @param destination mapped from (typedef Optional[const WGPUImageCopyTexture] = + * Declared([a8(nextInChain):[*:b1]a8(texture):[*:b1]i4(mipLevel)[i4(x)i4(y)i4(z)](origin)i4(aspect)x4](WGPUImageCopyTexture)))* + * @param copySize mapped from (typedef Optional[const WGPUExtent3D] = + * Declared([i4(width)i4(height)i4(depthOrArrayLayers)](WGPUExtent3D)))* + */ +public fun wgpuCommandEncoderCopyTextureToTexture( + commandEncoder: WGPUCommandEncoder?, + source: WGPUImageCopyTexture?, + destination: WGPUImageCopyTexture?, + copySize: WGPUExtent3D?, +): Unit = libWGPULibrary.wgpuCommandEncoderCopyTextureToTexture( + commandEncoder, source, destination, + copySize +) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param descriptor mapped from (typedef Optional[const WGPUCommandBufferDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]](WGPUCommandBufferDescriptor)))* + */ +public fun wgpuCommandEncoderFinish( + commandEncoder: WGPUCommandEncoder?, + descriptor: WGPUCommandBufferDescriptor? +): WGPUCommandBuffer? = + libWGPULibrary.wgpuCommandEncoderFinish(commandEncoder, descriptor) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param markerLabel mapped from (Char(layout = b1))* + */ +public fun wgpuCommandEncoderInsertDebugMarker( + commandEncoder: WGPUCommandEncoder?, + markerLabel: String? +): Unit = libWGPULibrary.wgpuCommandEncoderInsertDebugMarker( + commandEncoder, + markerLabel +) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + */ +public fun wgpuCommandEncoderPopDebugGroup(commandEncoder: WGPUCommandEncoder?): Unit = + libWGPULibrary.wgpuCommandEncoderPopDebugGroup(commandEncoder) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param groupLabel mapped from (Char(layout = b1))* + */ +public fun wgpuCommandEncoderPushDebugGroup( + commandEncoder: WGPUCommandEncoder?, + groupLabel: String? +): Unit = libWGPULibrary.wgpuCommandEncoderPushDebugGroup( + commandEncoder, + groupLabel +) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param querySet mapped from WGPUQuerySet + * @param firstQuery mapped from uint32_t + * @param queryCount mapped from uint32_t + * @param destination mapped from WGPUBuffer + * @param destinationOffset mapped from uint64_t + */ +public fun wgpuCommandEncoderResolveQuerySet( + commandEncoder: WGPUCommandEncoder?, + querySet: WGPUQuerySet?, + firstQuery: Int, + queryCount: Int, + destination: WGPUBuffer?, + destinationOffset: Long, +): Unit = libWGPULibrary.wgpuCommandEncoderResolveQuerySet( + commandEncoder, querySet, firstQuery, + queryCount, destination, destinationOffset +) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuCommandEncoderSetLabel(commandEncoder: WGPUCommandEncoder?, label: String?): Unit = + libWGPULibrary.wgpuCommandEncoderSetLabel(commandEncoder, label) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + * @param querySet mapped from WGPUQuerySet + * @param queryIndex mapped from uint32_t + */ +public fun wgpuCommandEncoderWriteTimestamp( + commandEncoder: WGPUCommandEncoder?, + querySet: WGPUQuerySet?, + queryIndex: Int, +): Unit = libWGPULibrary.wgpuCommandEncoderWriteTimestamp(commandEncoder, querySet, queryIndex) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + */ +public fun wgpuCommandEncoderReference(commandEncoder: WGPUCommandEncoder?): Unit = + libWGPULibrary.wgpuCommandEncoderReference(commandEncoder) + +/** + * @param commandEncoder mapped from WGPUCommandEncoder + */ +public fun wgpuCommandEncoderRelease(commandEncoder: WGPUCommandEncoder?): Unit = + libWGPULibrary.wgpuCommandEncoderRelease(commandEncoder) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param workgroupCountX mapped from uint32_t + * @param workgroupCountY mapped from uint32_t + * @param workgroupCountZ mapped from uint32_t + */ +public fun wgpuComputePassEncoderDispatchWorkgroups( + computePassEncoder: WGPUComputePassEncoder?, + workgroupCountX: Int, + workgroupCountY: Int, + workgroupCountZ: Int, +): Unit = libWGPULibrary.wgpuComputePassEncoderDispatchWorkgroups( + computePassEncoder, + workgroupCountX, workgroupCountY, workgroupCountZ +) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param indirectBuffer mapped from WGPUBuffer + * @param indirectOffset mapped from uint64_t + */ +public fun wgpuComputePassEncoderDispatchWorkgroupsIndirect( + computePassEncoder: WGPUComputePassEncoder?, + indirectBuffer: WGPUBuffer?, + indirectOffset: Long, +): Unit = libWGPULibrary.wgpuComputePassEncoderDispatchWorkgroupsIndirect( + computePassEncoder, + indirectBuffer, indirectOffset +) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + */ +public fun wgpuComputePassEncoderEnd(computePassEncoder: WGPUComputePassEncoder?): Unit = + libWGPULibrary.wgpuComputePassEncoderEnd(computePassEncoder) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param markerLabel mapped from (Char(layout = b1))* + */ +public fun wgpuComputePassEncoderInsertDebugMarker( + computePassEncoder: WGPUComputePassEncoder?, + markerLabel: String? +): Unit = + libWGPULibrary.wgpuComputePassEncoderInsertDebugMarker(computePassEncoder, markerLabel) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + */ +public fun wgpuComputePassEncoderPopDebugGroup(computePassEncoder: WGPUComputePassEncoder?): Unit = + libWGPULibrary.wgpuComputePassEncoderPopDebugGroup(computePassEncoder) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param groupLabel mapped from (Char(layout = b1))* + */ +public fun wgpuComputePassEncoderPushDebugGroup( + computePassEncoder: WGPUComputePassEncoder?, + groupLabel: String? +): Unit = + libWGPULibrary.wgpuComputePassEncoderPushDebugGroup(computePassEncoder, groupLabel) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param groupIndex mapped from uint32_t + * @param group mapped from WGPUBindGroup + * @param dynamicOffsetCount mapped from size_t + * @param dynamicOffsets mapped from (typedef Optional[const uint32_t] = UNSIGNED = Int(layout = + * i4))* + */ +public fun wgpuComputePassEncoderSetBindGroup( + computePassEncoder: WGPUComputePassEncoder?, + groupIndex: Int, + group: WGPUBindGroup?, + dynamicOffsetCount: NativeLong, + dynamicOffsets: Pointer?, +): Unit = libWGPULibrary.wgpuComputePassEncoderSetBindGroup( + computePassEncoder, groupIndex, group, + dynamicOffsetCount, dynamicOffsets +) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuComputePassEncoderSetLabel( + computePassEncoder: WGPUComputePassEncoder?, + label: String? +): Unit = libWGPULibrary.wgpuComputePassEncoderSetLabel(computePassEncoder, label) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param pipeline mapped from WGPUComputePipeline + */ +public fun wgpuComputePassEncoderSetPipeline( + computePassEncoder: WGPUComputePassEncoder?, + pipeline: WGPUComputePipeline? +): Unit = + libWGPULibrary.wgpuComputePassEncoderSetPipeline(computePassEncoder, pipeline) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + */ +public fun wgpuComputePassEncoderReference(computePassEncoder: WGPUComputePassEncoder?): Unit = + libWGPULibrary.wgpuComputePassEncoderReference(computePassEncoder) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + */ +public fun wgpuComputePassEncoderRelease(computePassEncoder: WGPUComputePassEncoder?): Unit = + libWGPULibrary.wgpuComputePassEncoderRelease(computePassEncoder) + +/** + * @param computePipeline mapped from WGPUComputePipeline + * @param groupIndex mapped from uint32_t + */ +public fun wgpuComputePipelineGetBindGroupLayout( + computePipeline: WGPUComputePipeline?, + groupIndex: Int +): WGPUBindGroupLayout? = + libWGPULibrary.wgpuComputePipelineGetBindGroupLayout(computePipeline, groupIndex) + +/** + * @param computePipeline mapped from WGPUComputePipeline + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuComputePipelineSetLabel(computePipeline: WGPUComputePipeline?, label: String?): Unit = + libWGPULibrary.wgpuComputePipelineSetLabel(computePipeline, label) + +/** + * @param computePipeline mapped from WGPUComputePipeline + */ +public fun wgpuComputePipelineReference(computePipeline: WGPUComputePipeline?): Unit = + libWGPULibrary.wgpuComputePipelineReference(computePipeline) + +/** + * @param computePipeline mapped from WGPUComputePipeline + */ +public fun wgpuComputePipelineRelease(computePipeline: WGPUComputePipeline?): Unit = + libWGPULibrary.wgpuComputePipelineRelease(computePipeline) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUBindGroupDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(layout):[*:b1]j8(entryCount)a8(entries):[*:b1]](WGPUBindGroupDescriptor)))* + */ +public fun wgpuDeviceCreateBindGroup(device: WGPUDevice?, descriptor: WGPUBindGroupDescriptor?): + WGPUBindGroup? = libWGPULibrary.wgpuDeviceCreateBindGroup(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUBindGroupLayoutDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(entryCount)a8(entries):[*:b1]](WGPUBindGroupLayoutDescriptor)))* + */ +public fun wgpuDeviceCreateBindGroupLayout( + device: WGPUDevice?, + descriptor: WGPUBindGroupLayoutDescriptor? +): WGPUBindGroupLayout? = + libWGPULibrary.wgpuDeviceCreateBindGroupLayout(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUBufferDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]i4(usage)x4j8(size)i4(mappedAtCreation)x4](WGPUBufferDescriptor)))* + */ +public fun wgpuDeviceCreateBuffer(device: WGPUDevice?, descriptor: WGPUBufferDescriptor?): + WGPUBuffer? = libWGPULibrary.wgpuDeviceCreateBuffer(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUCommandEncoderDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]](WGPUCommandEncoderDescriptor)))* + */ +public fun wgpuDeviceCreateCommandEncoder( + device: WGPUDevice?, + descriptor: WGPUCommandEncoderDescriptor? +): WGPUCommandEncoder? = + libWGPULibrary.wgpuDeviceCreateCommandEncoder(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUComputePipelineDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(layout):[*:b1][a8(nextInChain):[*:b1]a8(module):[*:b1]a8(entryPoint):[*:b1]j8(constantCount)a8(constants):[*:b1]](compute)](WGPUComputePipelineDescriptor)))* + */ +public fun wgpuDeviceCreateComputePipeline( + device: WGPUDevice?, + descriptor: WGPUComputePipelineDescriptor? +): WGPUComputePipeline? = + libWGPULibrary.wgpuDeviceCreateComputePipeline(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUComputePipelineDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(layout):[*:b1][a8(nextInChain):[*:b1]a8(module):[*:b1]a8(entryPoint):[*:b1]j8(constantCount)a8(constants):[*:b1]](compute)](WGPUComputePipelineDescriptor)))* + * @param callback mapped from WGPUCreateComputePipelineAsyncCallback + * @param userdata mapped from (Void)* + */ +public fun wgpuDeviceCreateComputePipelineAsync( + device: WGPUDevice?, + descriptor: WGPUComputePipelineDescriptor?, + callback: WGPUCreateComputePipelineAsyncCallback?, + userdata: Pointer?, +): Unit = libWGPULibrary.wgpuDeviceCreateComputePipelineAsync( + device, descriptor, callback, + userdata +) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUPipelineLayoutDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(bindGroupLayoutCount)a8(bindGroupLayouts):[*:b1]](WGPUPipelineLayoutDescriptor)))* + */ +public fun wgpuDeviceCreatePipelineLayout( + device: WGPUDevice?, + descriptor: WGPUPipelineLayoutDescriptor? +): WGPUPipelineLayout? = + libWGPULibrary.wgpuDeviceCreatePipelineLayout(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUQuerySetDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]i4(type)i4(count)](WGPUQuerySetDescriptor)))* + */ +public fun wgpuDeviceCreateQuerySet(device: WGPUDevice?, descriptor: WGPUQuerySetDescriptor?): + WGPUQuerySet? = libWGPULibrary.wgpuDeviceCreateQuerySet(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPURenderBundleEncoderDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(colorFormatCount)a8(colorFormats):[*:b1]i4(depthStencilFormat)i4(sampleCount)i4(depthReadOnly)i4(stencilReadOnly)](WGPURenderBundleEncoderDescriptor)))* + */ +public fun wgpuDeviceCreateRenderBundleEncoder( + device: WGPUDevice?, + descriptor: WGPURenderBundleEncoderDescriptor? +): WGPURenderBundleEncoder? = + libWGPULibrary.wgpuDeviceCreateRenderBundleEncoder(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPURenderPipelineDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(layout):[*:b1][a8(nextInChain):[*:b1]a8(module):[*:b1]a8(entryPoint):[*:b1]j8(constantCount)a8(constants):[*:b1]j8(bufferCount)a8(buffers):[*:b1]](vertex)[a8(nextInChain):[*:b1]i4(topology)i4(stripIndexFormat)i4(frontFace)i4(cullMode)](primitive)a8(depthStencil):[*:b1][a8(nextInChain):[*:b1]i4(count)i4(mask)i4(alphaToCoverageEnabled)x4](multisample)a8(fragment):[*:b1]](WGPURenderPipelineDescriptor)))* + */ +public fun wgpuDeviceCreateRenderPipeline( + device: WGPUDevice?, + descriptor: WGPURenderPipelineDescriptor? +): WGPURenderPipeline? = + libWGPULibrary.wgpuDeviceCreateRenderPipeline(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPURenderPipelineDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]a8(layout):[*:b1][a8(nextInChain):[*:b1]a8(module):[*:b1]a8(entryPoint):[*:b1]j8(constantCount)a8(constants):[*:b1]j8(bufferCount)a8(buffers):[*:b1]](vertex)[a8(nextInChain):[*:b1]i4(topology)i4(stripIndexFormat)i4(frontFace)i4(cullMode)](primitive)a8(depthStencil):[*:b1][a8(nextInChain):[*:b1]i4(count)i4(mask)i4(alphaToCoverageEnabled)x4](multisample)a8(fragment):[*:b1]](WGPURenderPipelineDescriptor)))* + * @param callback mapped from WGPUCreateRenderPipelineAsyncCallback + * @param userdata mapped from (Void)* + */ +public fun wgpuDeviceCreateRenderPipelineAsync( + device: WGPUDevice?, + descriptor: WGPURenderPipelineDescriptor?, + callback: WGPUCreateRenderPipelineAsyncCallback?, + userdata: Pointer?, +): Unit = libWGPULibrary.wgpuDeviceCreateRenderPipelineAsync(device, descriptor, callback, userdata) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUSamplerDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]i4(addressModeU)i4(addressModeV)i4(addressModeW)i4(magFilter)i4(minFilter)i4(mipmapFilter)f4(lodMinClamp)f4(lodMaxClamp)i4(compare)s2(maxAnisotropy)x2](WGPUSamplerDescriptor)))* + */ +public fun wgpuDeviceCreateSampler(device: WGPUDevice?, descriptor: WGPUSamplerDescriptor?): + WGPUSampler? = libWGPULibrary.wgpuDeviceCreateSampler(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUShaderModuleDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]j8(hintCount)a8(hints):[*:b1]](WGPUShaderModuleDescriptor)))* + */ +public fun wgpuDeviceCreateShaderModule( + device: WGPUDevice?, + descriptor: WGPUShaderModuleDescriptor? +): WGPUShaderModule? = + libWGPULibrary.wgpuDeviceCreateShaderModule(device, descriptor) + +/** + * @param device mapped from WGPUDevice + * @param descriptor mapped from (typedef Optional[const WGPUTextureDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]i4(usage)i4(dimension)[i4(width)i4(height)i4(depthOrArrayLayers)](size)i4(format)i4(mipLevelCount)i4(sampleCount)j8(viewFormatCount)a8(viewFormats):[*:b1]](WGPUTextureDescriptor)))* + */ +public fun wgpuDeviceCreateTexture(device: WGPUDevice?, descriptor: WGPUTextureDescriptor?): + WGPUTexture? = libWGPULibrary.wgpuDeviceCreateTexture(device, descriptor) + +/** + * @param device mapped from WGPUDevice + */ +public fun wgpuDeviceDestroy(device: WGPUDevice?): Unit = libWGPULibrary.wgpuDeviceDestroy(device) + +/** + * @param device mapped from WGPUDevice + * @param features mapped from (typedef Optional[WGPUFeatureName] = Declared(i4))* + */ +public fun wgpuDeviceEnumerateFeatures(device: WGPUDevice?, features: Pointer?): NativeLong = + libWGPULibrary.wgpuDeviceEnumerateFeatures(device, features) + +/** + * @param device mapped from WGPUDevice + * @param limits mapped from (typedef Optional[WGPUSupportedLimits] = + * Declared([a8(nextInChain):[*:b1][i4(maxTextureDimension1D)i4(maxTextureDimension2D)i4(maxTextureDimension3D)i4(maxTextureArrayLayers)i4(maxBindGroups)i4(maxBindGroupsPlusVertexBuffers)i4(maxBindingsPerBindGroup)i4(maxDynamicUniformBuffersPerPipelineLayout)i4(maxDynamicStorageBuffersPerPipelineLayout)i4(maxSampledTexturesPerShaderStage)i4(maxSamplersPerShaderStage)i4(maxStorageBuffersPerShaderStage)i4(maxStorageTexturesPerShaderStage)i4(maxUniformBuffersPerShaderStage)j8(maxUniformBufferBindingSize)j8(maxStorageBufferBindingSize)i4(minUniformBufferOffsetAlignment)i4(minStorageBufferOffsetAlignment)i4(maxVertexBuffers)x4j8(maxBufferSize)i4(maxVertexAttributes)i4(maxVertexBufferArrayStride)i4(maxInterStageShaderComponents)i4(maxInterStageShaderVariables)i4(maxColorAttachments)i4(maxColorAttachmentBytesPerSample)i4(maxComputeWorkgroupStorageSize)i4(maxComputeInvocationsPerWorkgroup)i4(maxComputeWorkgroupSizeX)i4(maxComputeWorkgroupSizeY)i4(maxComputeWorkgroupSizeZ)i4(maxComputeWorkgroupsPerDimension)](limits)](WGPUSupportedLimits)))* + */ +public fun wgpuDeviceGetLimits(device: WGPUDevice?, limits: WGPUSupportedLimits?): WGPUBool = + libWGPULibrary.wgpuDeviceGetLimits(device, limits) + +/** + * @param device mapped from WGPUDevice + */ +public fun wgpuDeviceGetQueue(device: WGPUDevice?): WGPUQueue? = + libWGPULibrary.wgpuDeviceGetQueue(device) + +/** + * @param device mapped from WGPUDevice + * @param feature mapped from WGPUFeatureName + */ +public fun wgpuDeviceHasFeature(device: WGPUDevice?, feature: Int): WGPUBool = + libWGPULibrary.wgpuDeviceHasFeature(device, feature) + +/** + * @param device mapped from WGPUDevice + * @param callback mapped from WGPUErrorCallback + * @param userdata mapped from (Void)* + */ +public fun wgpuDevicePopErrorScope( + device: WGPUDevice?, + callback: WGPUErrorCallback?, + userdata: Pointer?, +): Unit = libWGPULibrary.wgpuDevicePopErrorScope(device, callback, userdata) + +/** + * @param device mapped from WGPUDevice + * @param filter mapped from WGPUErrorFilter + */ +public fun wgpuDevicePushErrorScope(device: WGPUDevice?, filter: Int): Unit = + libWGPULibrary.wgpuDevicePushErrorScope(device, filter) + +/** + * @param device mapped from WGPUDevice + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuDeviceSetLabel(device: WGPUDevice?, label: String?): Unit = + libWGPULibrary.wgpuDeviceSetLabel(device, label) + +/** + * @param device mapped from WGPUDevice + * @param callback mapped from WGPUErrorCallback + * @param userdata mapped from (Void)* + */ +public fun wgpuDeviceSetUncapturedErrorCallback( + device: WGPUDevice?, + callback: WGPUErrorCallback?, + userdata: Pointer?, +): Unit = libWGPULibrary.wgpuDeviceSetUncapturedErrorCallback(device, callback, userdata) + +/** + * @param device mapped from WGPUDevice + */ +public fun wgpuDeviceReference(device: WGPUDevice?): Unit = + libWGPULibrary.wgpuDeviceReference(device) + +/** + * @param device mapped from WGPUDevice + */ +public fun wgpuDeviceRelease(device: WGPUDevice?): Unit = libWGPULibrary.wgpuDeviceRelease(device) + +/** + * @param instance mapped from WGPUInstance + * @param descriptor mapped from (typedef Optional[const WGPUSurfaceDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]](WGPUSurfaceDescriptor)))* + */ +public fun wgpuInstanceCreateSurface(instance: WGPUInstance?, descriptor: WGPUSurfaceDescriptor?): + WGPUSurface? = libWGPULibrary.wgpuInstanceCreateSurface(instance, descriptor) + +public fun wgpuInstanceCreateSurface(instance: WGPUInstance, descriptor: WGPUDarwinSurfaceDescriptor): + WGPUSurface? = libWGPULibrary.wgpuInstanceCreateSurface(instance, descriptor) + +/** + * @param instance mapped from WGPUInstance + */ +public fun wgpuInstanceProcessEvents(instance: WGPUInstance?): Unit = + libWGPULibrary.wgpuInstanceProcessEvents(instance) + +/** + * @param instance mapped from WGPUInstance + * @param options mapped from (typedef Optional[const WGPURequestAdapterOptions] = + * Declared([a8(nextInChain):[*:b1]a8(compatibleSurface):[*:b1]i4(powerPreference)i4(backendType)i4(forceFallbackAdapter)x4](WGPURequestAdapterOptions)))* + * @param callback mapped from WGPURequestAdapterCallback + * @param userdata mapped from (Void)* + */ +public fun wgpuInstanceRequestAdapter( + instance: WGPUInstance?, + options: WGPURequestAdapterOptions?, + callback: WGPURequestAdapterCallback?, + userdata: Pointer?, +): Unit = libWGPULibrary.wgpuInstanceRequestAdapter(instance, options, callback, userdata) + +/** + * @param instance mapped from WGPUInstance + */ +public fun wgpuInstanceReference(instance: WGPUInstance?): Unit = + libWGPULibrary.wgpuInstanceReference(instance) + +/** + * @param instance mapped from WGPUInstance + */ +public fun wgpuInstanceRelease(instance: WGPUInstance?): Unit = + libWGPULibrary.wgpuInstanceRelease(instance) + +/** + * @param pipelineLayout mapped from WGPUPipelineLayout + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuPipelineLayoutSetLabel(pipelineLayout: WGPUPipelineLayout?, label: String?): Unit = + libWGPULibrary.wgpuPipelineLayoutSetLabel(pipelineLayout, label) + +/** + * @param pipelineLayout mapped from WGPUPipelineLayout + */ +public fun wgpuPipelineLayoutReference(pipelineLayout: WGPUPipelineLayout?): Unit = + libWGPULibrary.wgpuPipelineLayoutReference(pipelineLayout) + +/** + * @param pipelineLayout mapped from WGPUPipelineLayout + */ +public fun wgpuPipelineLayoutRelease(pipelineLayout: WGPUPipelineLayout?): Unit = + libWGPULibrary.wgpuPipelineLayoutRelease(pipelineLayout) + +/** + * @param querySet mapped from WGPUQuerySet + */ +public fun wgpuQuerySetDestroy(querySet: WGPUQuerySet?): Unit = + libWGPULibrary.wgpuQuerySetDestroy(querySet) + +/** + * @param querySet mapped from WGPUQuerySet + */ +public fun wgpuQuerySetGetCount(querySet: WGPUQuerySet?): Int = + libWGPULibrary.wgpuQuerySetGetCount(querySet) + +/** + * @param querySet mapped from WGPUQuerySet + */ +public fun wgpuQuerySetGetType(querySet: WGPUQuerySet?): Int = + libWGPULibrary.wgpuQuerySetGetType(querySet) + +/** + * @param querySet mapped from WGPUQuerySet + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuQuerySetSetLabel(querySet: WGPUQuerySet?, label: String?): Unit = + libWGPULibrary.wgpuQuerySetSetLabel(querySet, label) + +/** + * @param querySet mapped from WGPUQuerySet + */ +public fun wgpuQuerySetReference(querySet: WGPUQuerySet?): Unit = + libWGPULibrary.wgpuQuerySetReference(querySet) + +/** + * @param querySet mapped from WGPUQuerySet + */ +public fun wgpuQuerySetRelease(querySet: WGPUQuerySet?): Unit = + libWGPULibrary.wgpuQuerySetRelease(querySet) + +/** + * @param queue mapped from WGPUQueue + * @param callback mapped from WGPUQueueWorkDoneCallback + * @param userdata mapped from (Void)* + */ +public fun wgpuQueueOnSubmittedWorkDone( + queue: WGPUQueue?, + callback: WGPUQueueWorkDoneCallback?, + userdata: Pointer?, +): Unit = libWGPULibrary.wgpuQueueOnSubmittedWorkDone(queue, callback, userdata) + +/** + * @param queue mapped from WGPUQueue + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuQueueSetLabel(queue: WGPUQueue?, label: String?): Unit = + libWGPULibrary.wgpuQueueSetLabel(queue, label) + +/** + * @param queue mapped from WGPUQueue + * @param commandCount mapped from size_t + * @param commands mapped from (typedef Optional[const WGPUCommandBuffer] = (Declared())*)* + */ +public fun wgpuQueueSubmit( + queue: WGPUQueue?, + commandCount: NativeLong, + commands: Array?, +): Unit = libWGPULibrary.wgpuQueueSubmit(queue, commandCount, commands) + +/** + * @param queue mapped from WGPUQueue + * @param buffer mapped from WGPUBuffer + * @param bufferOffset mapped from uint64_t + * @param data mapped from (Void)* + * @param size mapped from size_t + */ +public fun wgpuQueueWriteBuffer( + queue: WGPUQueue?, + buffer: WGPUBuffer?, + bufferOffset: Long, + `data`: Pointer?, + size: NativeLong, +): Unit = libWGPULibrary.wgpuQueueWriteBuffer(queue, buffer, bufferOffset, data, size) + +/** + * @param queue mapped from WGPUQueue + * @param destination mapped from (typedef Optional[const WGPUImageCopyTexture] = + * Declared([a8(nextInChain):[*:b1]a8(texture):[*:b1]i4(mipLevel)[i4(x)i4(y)i4(z)](origin)i4(aspect)x4](WGPUImageCopyTexture)))* + * @param data mapped from (Void)* + * @param dataSize mapped from size_t + * @param dataLayout mapped from (typedef Optional[const WGPUTextureDataLayout] = + * Declared([a8(nextInChain):[*:b1]j8(offset)i4(bytesPerRow)i4(rowsPerImage)](WGPUTextureDataLayout)))* + * @param writeSize mapped from (typedef Optional[const WGPUExtent3D] = + * Declared([i4(width)i4(height)i4(depthOrArrayLayers)](WGPUExtent3D)))* + */ +public fun wgpuQueueWriteTexture( + queue: WGPUQueue?, + destination: WGPUImageCopyTexture?, + `data`: Pointer?, + dataSize: NativeLong, + dataLayout: WGPUTextureDataLayout?, + writeSize: WGPUExtent3D?, +): Unit = libWGPULibrary.wgpuQueueWriteTexture( + queue, destination, data, dataSize, dataLayout, + writeSize +) + +/** + * @param queue mapped from WGPUQueue + */ +public fun wgpuQueueReference(queue: WGPUQueue?): Unit = libWGPULibrary.wgpuQueueReference(queue) + +/** + * @param queue mapped from WGPUQueue + */ +public fun wgpuQueueRelease(queue: WGPUQueue?): Unit = libWGPULibrary.wgpuQueueRelease(queue) + +/** + * @param renderBundle mapped from WGPURenderBundle + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuRenderBundleSetLabel(renderBundle: WGPURenderBundle?, label: String?): Unit = + libWGPULibrary.wgpuRenderBundleSetLabel(renderBundle, label) + +/** + * @param renderBundle mapped from WGPURenderBundle + */ +public fun wgpuRenderBundleReference(renderBundle: WGPURenderBundle?): Unit = + libWGPULibrary.wgpuRenderBundleReference(renderBundle) + +/** + * @param renderBundle mapped from WGPURenderBundle + */ +public fun wgpuRenderBundleRelease(renderBundle: WGPURenderBundle?): Unit = + libWGPULibrary.wgpuRenderBundleRelease(renderBundle) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param vertexCount mapped from uint32_t + * @param instanceCount mapped from uint32_t + * @param firstVertex mapped from uint32_t + * @param firstInstance mapped from uint32_t + */ +public fun wgpuRenderBundleEncoderDraw( + renderBundleEncoder: WGPURenderBundleEncoder?, + vertexCount: Int, + instanceCount: Int, + firstVertex: Int, + firstInstance: Int, +): Unit = libWGPULibrary.wgpuRenderBundleEncoderDraw( + renderBundleEncoder, vertexCount, + instanceCount, firstVertex, firstInstance +) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param indexCount mapped from uint32_t + * @param instanceCount mapped from uint32_t + * @param firstIndex mapped from uint32_t + * @param baseVertex mapped from int32_t + * @param firstInstance mapped from uint32_t + */ +public fun wgpuRenderBundleEncoderDrawIndexed( + renderBundleEncoder: WGPURenderBundleEncoder?, + indexCount: Int, + instanceCount: Int, + firstIndex: Int, + baseVertex: Int, + firstInstance: Int, +): Unit = libWGPULibrary.wgpuRenderBundleEncoderDrawIndexed( + renderBundleEncoder, indexCount, + instanceCount, firstIndex, baseVertex, firstInstance +) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param indirectBuffer mapped from WGPUBuffer + * @param indirectOffset mapped from uint64_t + */ +public fun wgpuRenderBundleEncoderDrawIndexedIndirect( + renderBundleEncoder: WGPURenderBundleEncoder?, + indirectBuffer: WGPUBuffer?, + indirectOffset: Long, +): Unit = libWGPULibrary.wgpuRenderBundleEncoderDrawIndexedIndirect( + renderBundleEncoder, + indirectBuffer, indirectOffset +) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param indirectBuffer mapped from WGPUBuffer + * @param indirectOffset mapped from uint64_t + */ +public fun wgpuRenderBundleEncoderDrawIndirect( + renderBundleEncoder: WGPURenderBundleEncoder?, + indirectBuffer: WGPUBuffer?, + indirectOffset: Long, +): Unit = libWGPULibrary.wgpuRenderBundleEncoderDrawIndirect( + renderBundleEncoder, indirectBuffer, + indirectOffset +) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param descriptor mapped from (typedef Optional[const WGPURenderBundleDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]](WGPURenderBundleDescriptor)))* + */ +public fun wgpuRenderBundleEncoderFinish( + renderBundleEncoder: WGPURenderBundleEncoder?, + descriptor: WGPURenderBundleDescriptor? +): WGPURenderBundle? = + libWGPULibrary.wgpuRenderBundleEncoderFinish(renderBundleEncoder, descriptor) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param markerLabel mapped from (Char(layout = b1))* + */ +public fun wgpuRenderBundleEncoderInsertDebugMarker( + renderBundleEncoder: WGPURenderBundleEncoder?, + markerLabel: String? +): Unit = + libWGPULibrary.wgpuRenderBundleEncoderInsertDebugMarker(renderBundleEncoder, markerLabel) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + */ +public fun wgpuRenderBundleEncoderPopDebugGroup(renderBundleEncoder: WGPURenderBundleEncoder?): Unit = + libWGPULibrary.wgpuRenderBundleEncoderPopDebugGroup(renderBundleEncoder) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param groupLabel mapped from (Char(layout = b1))* + */ +public fun wgpuRenderBundleEncoderPushDebugGroup( + renderBundleEncoder: WGPURenderBundleEncoder?, + groupLabel: String? +): Unit = + libWGPULibrary.wgpuRenderBundleEncoderPushDebugGroup(renderBundleEncoder, groupLabel) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param groupIndex mapped from uint32_t + * @param group mapped from WGPUBindGroup + * @param dynamicOffsetCount mapped from size_t + * @param dynamicOffsets mapped from (typedef Optional[const uint32_t] = UNSIGNED = Int(layout = + * i4))* + */ +public fun wgpuRenderBundleEncoderSetBindGroup( + renderBundleEncoder: WGPURenderBundleEncoder?, + groupIndex: Int, + group: WGPUBindGroup?, + dynamicOffsetCount: NativeLong, + dynamicOffsets: Pointer?, +): Unit = libWGPULibrary.wgpuRenderBundleEncoderSetBindGroup( + renderBundleEncoder, groupIndex, group, + dynamicOffsetCount, dynamicOffsets +) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param buffer mapped from WGPUBuffer + * @param format mapped from WGPUIndexFormat + * @param offset mapped from uint64_t + * @param size mapped from uint64_t + */ +public fun wgpuRenderBundleEncoderSetIndexBuffer( + renderBundleEncoder: WGPURenderBundleEncoder?, + buffer: WGPUBuffer?, + format: Int, + offset: Long, + size: Long, +): Unit = libWGPULibrary.wgpuRenderBundleEncoderSetIndexBuffer( + renderBundleEncoder, buffer, format, + offset, size +) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuRenderBundleEncoderSetLabel( + renderBundleEncoder: WGPURenderBundleEncoder?, + label: String? +): Unit = libWGPULibrary.wgpuRenderBundleEncoderSetLabel( + renderBundleEncoder, + label +) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param pipeline mapped from WGPURenderPipeline + */ +public fun wgpuRenderBundleEncoderSetPipeline( + renderBundleEncoder: WGPURenderBundleEncoder?, + pipeline: WGPURenderPipeline? +): Unit = + libWGPULibrary.wgpuRenderBundleEncoderSetPipeline(renderBundleEncoder, pipeline) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + * @param slot mapped from uint32_t + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param size mapped from uint64_t + */ +public fun wgpuRenderBundleEncoderSetVertexBuffer( + renderBundleEncoder: WGPURenderBundleEncoder?, + slot: Int, + buffer: WGPUBuffer?, + offset: Long, + size: Long, +): Unit = libWGPULibrary.wgpuRenderBundleEncoderSetVertexBuffer( + renderBundleEncoder, slot, buffer, + offset, size +) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + */ +public fun wgpuRenderBundleEncoderReference(renderBundleEncoder: WGPURenderBundleEncoder?): Unit = + libWGPULibrary.wgpuRenderBundleEncoderReference(renderBundleEncoder) + +/** + * @param renderBundleEncoder mapped from WGPURenderBundleEncoder + */ +public fun wgpuRenderBundleEncoderRelease(renderBundleEncoder: WGPURenderBundleEncoder?): Unit = + libWGPULibrary.wgpuRenderBundleEncoderRelease(renderBundleEncoder) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param queryIndex mapped from uint32_t + */ +public fun wgpuRenderPassEncoderBeginOcclusionQuery( + renderPassEncoder: WGPURenderPassEncoder?, + queryIndex: Int +): Unit = + libWGPULibrary.wgpuRenderPassEncoderBeginOcclusionQuery(renderPassEncoder, queryIndex) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param vertexCount mapped from uint32_t + * @param instanceCount mapped from uint32_t + * @param firstVertex mapped from uint32_t + * @param firstInstance mapped from uint32_t + */ +public fun wgpuRenderPassEncoderDraw( + renderPassEncoder: WGPURenderPassEncoder?, + vertexCount: Int, + instanceCount: Int?, + firstVertex: Int?, + firstInstance: Int?, +): Unit = libWGPULibrary.wgpuRenderPassEncoderDraw( + renderPassEncoder, vertexCount, instanceCount, + firstVertex, firstInstance +) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param indexCount mapped from uint32_t + * @param instanceCount mapped from uint32_t + * @param firstIndex mapped from uint32_t + * @param baseVertex mapped from int32_t + * @param firstInstance mapped from uint32_t + */ +public fun wgpuRenderPassEncoderDrawIndexed( + renderPassEncoder: WGPURenderPassEncoder?, + indexCount: Int, + instanceCount: Int, + firstIndex: Int, + baseVertex: Int, + firstInstance: Int, +): Unit = libWGPULibrary.wgpuRenderPassEncoderDrawIndexed( + renderPassEncoder, indexCount, + instanceCount, firstIndex, baseVertex, firstInstance +) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param indirectBuffer mapped from WGPUBuffer + * @param indirectOffset mapped from uint64_t + */ +public fun wgpuRenderPassEncoderDrawIndexedIndirect( + renderPassEncoder: WGPURenderPassEncoder?, + indirectBuffer: WGPUBuffer?, + indirectOffset: Long, +): Unit = libWGPULibrary.wgpuRenderPassEncoderDrawIndexedIndirect( + renderPassEncoder, indirectBuffer, + indirectOffset +) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param indirectBuffer mapped from WGPUBuffer + * @param indirectOffset mapped from uint64_t + */ +public fun wgpuRenderPassEncoderDrawIndirect( + renderPassEncoder: WGPURenderPassEncoder?, + indirectBuffer: WGPUBuffer?, + indirectOffset: Long, +): Unit = libWGPULibrary.wgpuRenderPassEncoderDrawIndirect( + renderPassEncoder, indirectBuffer, + indirectOffset +) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ +public fun wgpuRenderPassEncoderEnd(renderPassEncoder: WGPURenderPassEncoder?): Unit = + libWGPULibrary.wgpuRenderPassEncoderEnd(renderPassEncoder) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ +public fun wgpuRenderPassEncoderEndOcclusionQuery(renderPassEncoder: WGPURenderPassEncoder?): Unit = + libWGPULibrary.wgpuRenderPassEncoderEndOcclusionQuery(renderPassEncoder) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param bundleCount mapped from size_t + * @param bundles mapped from (typedef Optional[const WGPURenderBundle] = (Declared())*)* + */ +public fun wgpuRenderPassEncoderExecuteBundles( + renderPassEncoder: WGPURenderPassEncoder?, + bundleCount: NativeLong, + bundles: WGPURenderBundle?, +): Unit = libWGPULibrary.wgpuRenderPassEncoderExecuteBundles( + renderPassEncoder, bundleCount, + bundles +) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param markerLabel mapped from (Char(layout = b1))* + */ +public fun wgpuRenderPassEncoderInsertDebugMarker( + renderPassEncoder: WGPURenderPassEncoder?, + markerLabel: String? +): Unit = + libWGPULibrary.wgpuRenderPassEncoderInsertDebugMarker(renderPassEncoder, markerLabel) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ +public fun wgpuRenderPassEncoderPopDebugGroup(renderPassEncoder: WGPURenderPassEncoder?): Unit = + libWGPULibrary.wgpuRenderPassEncoderPopDebugGroup(renderPassEncoder) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param groupLabel mapped from (Char(layout = b1))* + */ +public fun wgpuRenderPassEncoderPushDebugGroup( + renderPassEncoder: WGPURenderPassEncoder?, + groupLabel: String? +): Unit = + libWGPULibrary.wgpuRenderPassEncoderPushDebugGroup(renderPassEncoder, groupLabel) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param groupIndex mapped from uint32_t + * @param group mapped from WGPUBindGroup + * @param dynamicOffsetCount mapped from size_t + * @param dynamicOffsets mapped from (typedef Optional[const uint32_t] = UNSIGNED = Int(layout = + * i4))* + */ +public fun wgpuRenderPassEncoderSetBindGroup( + renderPassEncoder: WGPURenderPassEncoder?, + groupIndex: Int, + group: WGPUBindGroup?, + dynamicOffsetCount: NativeLong, + dynamicOffsets: Pointer?, +): Unit = libWGPULibrary.wgpuRenderPassEncoderSetBindGroup( + renderPassEncoder, groupIndex, group, + dynamicOffsetCount, dynamicOffsets +) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param color mapped from (typedef Optional[const WGPUColor] = + * Declared([d8(r)d8(g)d8(b)d8(a)](WGPUColor)))* + */ +public fun wgpuRenderPassEncoderSetBlendConstant( + renderPassEncoder: WGPURenderPassEncoder?, + color: WGPUColor? +): Unit = + libWGPULibrary.wgpuRenderPassEncoderSetBlendConstant(renderPassEncoder, color) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param buffer mapped from WGPUBuffer + * @param format mapped from WGPUIndexFormat + * @param offset mapped from uint64_t + * @param size mapped from uint64_t + */ +public fun wgpuRenderPassEncoderSetIndexBuffer( + renderPassEncoder: WGPURenderPassEncoder?, + buffer: WGPUBuffer?, + format: Int, + offset: Long, + size: Long, +): Unit = libWGPULibrary.wgpuRenderPassEncoderSetIndexBuffer( + renderPassEncoder, buffer, format, + offset, size +) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuRenderPassEncoderSetLabel(renderPassEncoder: WGPURenderPassEncoder?, label: String?): + Unit = libWGPULibrary.wgpuRenderPassEncoderSetLabel(renderPassEncoder, label) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param pipeline mapped from WGPURenderPipeline + */ +public fun wgpuRenderPassEncoderSetPipeline( + renderPassEncoder: WGPURenderPassEncoder?, + pipeline: WGPURenderPipeline? +): Unit = + libWGPULibrary.wgpuRenderPassEncoderSetPipeline(renderPassEncoder, pipeline) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param x mapped from uint32_t + * @param y mapped from uint32_t + * @param width mapped from uint32_t + * @param height mapped from uint32_t + */ +public fun wgpuRenderPassEncoderSetScissorRect( + renderPassEncoder: WGPURenderPassEncoder?, + x: Int, + y: Int, + width: Int, + height: Int, +): Unit = libWGPULibrary.wgpuRenderPassEncoderSetScissorRect(renderPassEncoder, x, y, width, height) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param reference mapped from uint32_t + */ +public fun wgpuRenderPassEncoderSetStencilReference( + renderPassEncoder: WGPURenderPassEncoder?, + reference: Int +): Unit = + libWGPULibrary.wgpuRenderPassEncoderSetStencilReference(renderPassEncoder, reference) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param slot mapped from uint32_t + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param size mapped from uint64_t + */ +public fun wgpuRenderPassEncoderSetVertexBuffer( + renderPassEncoder: WGPURenderPassEncoder?, + slot: Int, + buffer: WGPUBuffer?, + offset: Long, + size: Long?, +): Unit = libWGPULibrary.wgpuRenderPassEncoderSetVertexBuffer( + renderPassEncoder, slot, buffer, + offset, size +) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param x mapped from float + * @param y mapped from float + * @param width mapped from float + * @param height mapped from float + * @param minDepth mapped from float + * @param maxDepth mapped from float + */ +public fun wgpuRenderPassEncoderSetViewport( + renderPassEncoder: WGPURenderPassEncoder?, + x: Float, + y: Float, + width: Float, + height: Float, + minDepth: Float, + maxDepth: Float, +): Unit = libWGPULibrary.wgpuRenderPassEncoderSetViewport( + renderPassEncoder, x, y, width, height, + minDepth, maxDepth +) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ +public fun wgpuRenderPassEncoderReference(renderPassEncoder: WGPURenderPassEncoder?): Unit = + libWGPULibrary.wgpuRenderPassEncoderReference(renderPassEncoder) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ +public fun wgpuRenderPassEncoderRelease(renderPassEncoder: WGPURenderPassEncoder?): Unit = + libWGPULibrary.wgpuRenderPassEncoderRelease(renderPassEncoder) + +/** + * @param renderPipeline mapped from WGPURenderPipeline + * @param groupIndex mapped from uint32_t + */ +public fun wgpuRenderPipelineGetBindGroupLayout( + renderPipeline: WGPURenderPipeline?, + groupIndex: Int +): WGPUBindGroupLayout? = + libWGPULibrary.wgpuRenderPipelineGetBindGroupLayout(renderPipeline, groupIndex) + +/** + * @param renderPipeline mapped from WGPURenderPipeline + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuRenderPipelineSetLabel(renderPipeline: WGPURenderPipeline?, label: String?): Unit = + libWGPULibrary.wgpuRenderPipelineSetLabel(renderPipeline, label) + +/** + * @param renderPipeline mapped from WGPURenderPipeline + */ +public fun wgpuRenderPipelineReference(renderPipeline: WGPURenderPipeline?): Unit = + libWGPULibrary.wgpuRenderPipelineReference(renderPipeline) + +/** + * @param renderPipeline mapped from WGPURenderPipeline + */ +public fun wgpuRenderPipelineRelease(renderPipeline: WGPURenderPipeline?): Unit = + libWGPULibrary.wgpuRenderPipelineRelease(renderPipeline) + +/** + * @param sampler mapped from WGPUSampler + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuSamplerSetLabel(sampler: WGPUSampler?, label: String?): Unit = + libWGPULibrary.wgpuSamplerSetLabel(sampler, label) + +/** + * @param sampler mapped from WGPUSampler + */ +public fun wgpuSamplerReference(sampler: WGPUSampler?): Unit = + libWGPULibrary.wgpuSamplerReference(sampler) + +/** + * @param sampler mapped from WGPUSampler + */ +public fun wgpuSamplerRelease(sampler: WGPUSampler?): Unit = + libWGPULibrary.wgpuSamplerRelease(sampler) + +/** + * @param shaderModule mapped from WGPUShaderModule + * @param callback mapped from WGPUCompilationInfoCallback + * @param userdata mapped from (Void)* + */ +public fun wgpuShaderModuleGetCompilationInfo( + shaderModule: WGPUShaderModule?, + callback: WGPUCompilationInfoCallback?, + userdata: Pointer?, +): Unit = libWGPULibrary.wgpuShaderModuleGetCompilationInfo(shaderModule, callback, userdata) + +/** + * @param shaderModule mapped from WGPUShaderModule + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuShaderModuleSetLabel(shaderModule: WGPUShaderModule?, label: String?): Unit = + libWGPULibrary.wgpuShaderModuleSetLabel(shaderModule, label) + +/** + * @param shaderModule mapped from WGPUShaderModule + */ +public fun wgpuShaderModuleReference(shaderModule: WGPUShaderModule?): Unit = + libWGPULibrary.wgpuShaderModuleReference(shaderModule) + +/** + * @param shaderModule mapped from WGPUShaderModule + */ +public fun wgpuShaderModuleRelease(shaderModule: WGPUShaderModule?): Unit = + libWGPULibrary.wgpuShaderModuleRelease(shaderModule) + +/** + * @param surface mapped from WGPUSurface + * @param config mapped from (typedef Optional[const WGPUSurfaceConfiguration] = + * Declared([a8(nextInChain):[*:b1]a8(device):[*:b1]i4(format)i4(usage)j8(viewFormatCount)a8(viewFormats):[*:b1]i4(alphaMode)i4(width)i4(height)i4(presentMode)](WGPUSurfaceConfiguration)))* + */ +public fun wgpuSurfaceConfigure(surface: WGPUSurface?, config: WGPUSurfaceConfiguration?): Unit = + libWGPULibrary.wgpuSurfaceConfigure(surface, config) + +/** + * @param surface mapped from WGPUSurface + * @param adapter mapped from WGPUAdapter + * @param capabilities mapped from (typedef Optional[WGPUSurfaceCapabilities] = + * Declared([a8(nextInChain):[*:b1]j8(formatCount)a8(formats):[*:b1]j8(presentModeCount)a8(presentModes):[*:b1]j8(alphaModeCount)a8(alphaModes):[*:b1]](WGPUSurfaceCapabilities)))* + */ +public fun wgpuSurfaceGetCapabilities( + surface: WGPUSurface?, + adapter: WGPUAdapter?, + capabilities: WGPUSurfaceCapabilities?, +): Unit = libWGPULibrary.wgpuSurfaceGetCapabilities(surface, adapter, capabilities) + +/** + * @param surface mapped from WGPUSurface + * @param surfaceTexture mapped from (typedef Optional[WGPUSurfaceTexture] = + * Declared([a8(texture):[*:b1]i4(suboptimal)i4(status)](WGPUSurfaceTexture)))* + */ +public fun wgpuSurfaceGetCurrentTexture(surface: WGPUSurface?, surfaceTexture: WGPUSurfaceTexture?): + Unit = libWGPULibrary.wgpuSurfaceGetCurrentTexture(surface, surfaceTexture) + +/** + * @param surface mapped from WGPUSurface + * @param adapter mapped from WGPUAdapter + */ +public fun wgpuSurfaceGetPreferredFormat(surface: WGPUSurface?, adapter: WGPUAdapter?): Int = + libWGPULibrary.wgpuSurfaceGetPreferredFormat(surface, adapter) + +/** + * @param surface mapped from WGPUSurface + */ +public fun wgpuSurfacePresent(surface: WGPUSurface?): Unit = + libWGPULibrary.wgpuSurfacePresent(surface) + +/** + * @param surface mapped from WGPUSurface + */ +public fun wgpuSurfaceUnconfigure(surface: WGPUSurface?): Unit = + libWGPULibrary.wgpuSurfaceUnconfigure(surface) + +/** + * @param surface mapped from WGPUSurface + */ +public fun wgpuSurfaceReference(surface: WGPUSurface?): Unit = + libWGPULibrary.wgpuSurfaceReference(surface) + +/** + * @param surface mapped from WGPUSurface + */ +public fun wgpuSurfaceRelease(surface: WGPUSurface?): Unit = + libWGPULibrary.wgpuSurfaceRelease(surface) + +/** + * @param capabilities mapped from WGPUSurfaceCapabilities + */ +public fun wgpuSurfaceCapabilitiesFreeMembers(capabilities: WGPUSurfaceCapabilities): Unit = + libWGPULibrary.wgpuSurfaceCapabilitiesFreeMembers(capabilities) + +/** + * @param texture mapped from WGPUTexture + * @param descriptor mapped from (typedef Optional[const WGPUTextureViewDescriptor] = + * Declared([a8(nextInChain):[*:b1]a8(label):[*:b1]i4(format)i4(dimension)i4(baseMipLevel)i4(mipLevelCount)i4(baseArrayLayer)i4(arrayLayerCount)i4(aspect)x4](WGPUTextureViewDescriptor)))* + */ +public fun wgpuTextureCreateView(texture: WGPUTexture?, descriptor: WGPUTextureViewDescriptor?): + WGPUTextureView? = libWGPULibrary.wgpuTextureCreateView(texture, descriptor) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureDestroy(texture: WGPUTexture?): Unit = + libWGPULibrary.wgpuTextureDestroy(texture) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureGetDepthOrArrayLayers(texture: WGPUTexture?): Int = + libWGPULibrary.wgpuTextureGetDepthOrArrayLayers(texture) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureGetDimension(texture: WGPUTexture?): Int = + libWGPULibrary.wgpuTextureGetDimension(texture) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureGetFormat(texture: WGPUTexture?): Int = + libWGPULibrary.wgpuTextureGetFormat(texture) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureGetHeight(texture: WGPUTexture?): Int = + libWGPULibrary.wgpuTextureGetHeight(texture) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureGetMipLevelCount(texture: WGPUTexture?): Int = + libWGPULibrary.wgpuTextureGetMipLevelCount(texture) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureGetSampleCount(texture: WGPUTexture?): Int = + libWGPULibrary.wgpuTextureGetSampleCount(texture) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureGetUsage(texture: WGPUTexture?): WGPUTextureUsageFlags = + libWGPULibrary.wgpuTextureGetUsage(texture) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureGetWidth(texture: WGPUTexture?): Int = + libWGPULibrary.wgpuTextureGetWidth(texture) + +/** + * @param texture mapped from WGPUTexture + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuTextureSetLabel(texture: WGPUTexture?, label: String?): Unit = + libWGPULibrary.wgpuTextureSetLabel(texture, label) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureReference(texture: WGPUTexture?): Unit = + libWGPULibrary.wgpuTextureReference(texture) + +/** + * @param texture mapped from WGPUTexture + */ +public fun wgpuTextureRelease(texture: WGPUTexture?): Unit = + libWGPULibrary.wgpuTextureRelease(texture) + +/** + * @param textureView mapped from WGPUTextureView + * @param label mapped from (Char(layout = b1))* + */ +public fun wgpuTextureViewSetLabel(textureView: WGPUTextureView?, label: String?): Unit = + libWGPULibrary.wgpuTextureViewSetLabel(textureView, label) + +/** + * @param textureView mapped from WGPUTextureView + */ +public fun wgpuTextureViewReference(textureView: WGPUTextureView?): Unit = + libWGPULibrary.wgpuTextureViewReference(textureView) + +/** + * @param textureView mapped from WGPUTextureView + */ +public fun wgpuTextureViewRelease(textureView: WGPUTextureView?): Unit = + libWGPULibrary.wgpuTextureViewRelease(textureView) + +/** + * @param instance mapped from WGPUInstance + * @param report mapped from (typedef Optional[WGPUGlobalReport] = + * Declared([[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](surfaces)i4(backendType)x4[[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](adapters)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](devices)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](queues)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](pipelineLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](shaderModules)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroupLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroups)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](commandBuffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderBundles)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderPipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](computePipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](querySets)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](buffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textures)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textureViews)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](samplers)](vulkan)[[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](adapters)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](devices)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](queues)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](pipelineLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](shaderModules)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroupLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroups)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](commandBuffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderBundles)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderPipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](computePipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](querySets)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](buffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textures)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textureViews)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](samplers)](metal)[[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](adapters)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](devices)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](queues)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](pipelineLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](shaderModules)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroupLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroups)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](commandBuffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderBundles)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderPipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](computePipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](querySets)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](buffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textures)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textureViews)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](samplers)](dx12)[[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](adapters)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](devices)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](queues)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](pipelineLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](shaderModules)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroupLayouts)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](bindGroups)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](commandBuffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderBundles)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](renderPipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](computePipelines)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](querySets)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](buffers)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textures)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](textureViews)[j8(numAllocated)j8(numKeptFromUser)j8(numReleasedFromUser)j8(numError)j8(elementSize)](samplers)](gl)](WGPUGlobalReport)))* + */ +public fun wgpuGenerateReport(instance: WGPUInstance?, report: WGPUGlobalReport?): Unit = + libWGPULibrary.wgpuGenerateReport(instance, report) + +/** + * @param instance mapped from WGPUInstance + * @param options mapped from (typedef Optional[const WGPUInstanceEnumerateAdapterOptions] = + * Declared([a8(nextInChain):[*:b1]i4(backends)x4](WGPUInstanceEnumerateAdapterOptions)))* + * @param adapters mapped from (typedef Optional[WGPUAdapter] = (Declared())*)* + */ +public fun wgpuInstanceEnumerateAdapters( + instance: WGPUInstance?, + options: WGPUInstanceEnumerateAdapterOptions?, + adapters: WGPUAdapter?, +): NativeLong = libWGPULibrary.wgpuInstanceEnumerateAdapters(instance, options, adapters) + +/** + * @param queue mapped from WGPUQueue + * @param commandCount mapped from size_t + * @param commands mapped from (typedef Optional[const WGPUCommandBuffer] = (Declared())*)* + */ +public fun wgpuQueueSubmitForIndex( + queue: WGPUQueue?, + commandCount: NativeLong, + commands: WGPUCommandBuffer?, +): WGPUSubmissionIndex = libWGPULibrary.wgpuQueueSubmitForIndex(queue, commandCount, commands) + +/** + * @param device mapped from WGPUDevice + * @param wait mapped from WGPUBool + * @param wrappedSubmissionIndex mapped from (typedef Optional[const WGPUWrappedSubmissionIndex] = + * Declared([a8(queue):[*:b1]j8(submissionIndex)](WGPUWrappedSubmissionIndex)))* + */ +public fun wgpuDevicePoll( + device: WGPUDevice?, + wait: WGPUBool, + wrappedSubmissionIndex: WGPUWrappedSubmissionIndex?, +): WGPUBool = libWGPULibrary.wgpuDevicePoll(device, wait, wrappedSubmissionIndex) + +/** + * @param callback mapped from WGPULogCallback + * @param userdata mapped from (Void)* + */ +public fun wgpuSetLogCallback(callback: WGPULogCallback?, userdata: Pointer?): Unit = + libWGPULibrary.wgpuSetLogCallback(callback, userdata) + +/** + * @param level mapped from WGPULogLevel + */ +public fun wgpuSetLogLevel(level: Int): Unit = libWGPULibrary.wgpuSetLogLevel(level) + +public fun wgpuGetVersion(): Int = libWGPULibrary.wgpuGetVersion() + +/** + * @param encoder mapped from WGPURenderPassEncoder + * @param stages mapped from WGPUShaderStageFlags + * @param offset mapped from uint32_t + * @param sizeBytes mapped from uint32_t + * @param data mapped from (Void)* + */ +public fun wgpuRenderPassEncoderSetPushConstants( + encoder: WGPURenderPassEncoder?, + stages: WGPUShaderStageFlags, + offset: Int, + sizeBytes: Int, + `data`: Pointer?, +): Unit = libWGPULibrary.wgpuRenderPassEncoderSetPushConstants( + encoder, stages, offset, sizeBytes, + data +) + +/** + * @param encoder mapped from WGPURenderPassEncoder + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param count mapped from uint32_t + */ +public fun wgpuRenderPassEncoderMultiDrawIndirect( + encoder: WGPURenderPassEncoder?, + buffer: WGPUBuffer?, + offset: Long, + count: Int, +): Unit = libWGPULibrary.wgpuRenderPassEncoderMultiDrawIndirect(encoder, buffer, offset, count) + +/** + * @param encoder mapped from WGPURenderPassEncoder + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param count mapped from uint32_t + */ +public fun wgpuRenderPassEncoderMultiDrawIndexedIndirect( + encoder: WGPURenderPassEncoder?, + buffer: WGPUBuffer?, + offset: Long, + count: Int, +): Unit = libWGPULibrary.wgpuRenderPassEncoderMultiDrawIndexedIndirect( + encoder, buffer, offset, + count +) + +/** + * @param encoder mapped from WGPURenderPassEncoder + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param count_buffer mapped from WGPUBuffer + * @param count_buffer_offset mapped from uint64_t + * @param max_count mapped from uint32_t + */ +public fun wgpuRenderPassEncoderMultiDrawIndirectCount( + encoder: WGPURenderPassEncoder?, + buffer: WGPUBuffer?, + offset: Long, + count_buffer: WGPUBuffer?, + count_buffer_offset: Long, + max_count: Int, +): Unit = libWGPULibrary.wgpuRenderPassEncoderMultiDrawIndirectCount( + encoder, buffer, offset, + count_buffer, count_buffer_offset, max_count +) + +/** + * @param encoder mapped from WGPURenderPassEncoder + * @param buffer mapped from WGPUBuffer + * @param offset mapped from uint64_t + * @param count_buffer mapped from WGPUBuffer + * @param count_buffer_offset mapped from uint64_t + * @param max_count mapped from uint32_t + */ +public fun wgpuRenderPassEncoderMultiDrawIndexedIndirectCount( + encoder: WGPURenderPassEncoder?, + buffer: WGPUBuffer?, + offset: Long, + count_buffer: WGPUBuffer?, + count_buffer_offset: Long, + max_count: Int, +): Unit = libWGPULibrary.wgpuRenderPassEncoderMultiDrawIndexedIndirectCount( + encoder, buffer, offset, + count_buffer, count_buffer_offset, max_count +) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + * @param querySet mapped from WGPUQuerySet + * @param queryIndex mapped from uint32_t + */ +public fun wgpuComputePassEncoderBeginPipelineStatisticsQuery( + computePassEncoder: WGPUComputePassEncoder?, + querySet: WGPUQuerySet?, + queryIndex: Int, +): Unit = libWGPULibrary.wgpuComputePassEncoderBeginPipelineStatisticsQuery( + computePassEncoder, + querySet, queryIndex +) + +/** + * @param computePassEncoder mapped from WGPUComputePassEncoder + */ +public +fun wgpuComputePassEncoderEndPipelineStatisticsQuery(computePassEncoder: WGPUComputePassEncoder?): + Unit = libWGPULibrary.wgpuComputePassEncoderEndPipelineStatisticsQuery(computePassEncoder) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + * @param querySet mapped from WGPUQuerySet + * @param queryIndex mapped from uint32_t + */ +public fun wgpuRenderPassEncoderBeginPipelineStatisticsQuery( + renderPassEncoder: WGPURenderPassEncoder?, + querySet: WGPUQuerySet?, + queryIndex: Int, +): Unit = libWGPULibrary.wgpuRenderPassEncoderBeginPipelineStatisticsQuery( + renderPassEncoder, + querySet, queryIndex +) + +/** + * @param renderPassEncoder mapped from WGPURenderPassEncoder + */ +public +fun wgpuRenderPassEncoderEndPipelineStatisticsQuery(renderPassEncoder: WGPURenderPassEncoder?): + Unit = libWGPULibrary.wgpuRenderPassEncoderEndPipelineStatisticsQuery(renderPassEncoder) diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Structures.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Structures.kt new file mode 100644 index 00000000..022434fa --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/Structures.kt @@ -0,0 +1,4415 @@ +package io.ygdrasil.wgpu.`internal`.jvm + +import com.sun.jna.NativeLong +import com.sun.jna.Pointer +import com.sun.jna.PointerType +import com.sun.jna.Structure +import com.sun.jna.ptr.PointerByReference + +public class WGPUAdapterImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUBindGroupImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUBindGroupLayoutImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUBufferImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUCommandBufferImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUCommandEncoderImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUComputePassEncoderImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUComputePipelineImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUDeviceImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUInstanceImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUPipelineLayoutImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUQuerySetImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUQueueImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPURenderBundleImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPURenderBundleEncoderImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPURenderPassEncoderImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPURenderPipelineImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUSamplerImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUShaderModuleImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUSurfaceImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUTextureImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +public class WGPUTextureViewImpl : PointerType { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + + public class ByReference : PointerByReference { + public constructor() : super() + + public constructor(pointer: Pointer?) : super(pointer) + } +} + +@Structure.FieldOrder("next", "sType") +public open class WGPUChainedStruct : Structure { + /** + * mapped from (Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var next: Pointer? = null + + /** + * mapped from WGPUSType + */ + @JvmField + public var sType: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUChainedStruct(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUChainedStruct(pointer), Structure.ByValue +} + +@Structure.FieldOrder("next", "sType") +public open class WGPUChainedStructOut : Structure { + /** + * mapped from (Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStructOut)))* + */ + @JvmField + public var next: Pointer? = null + + /** + * mapped from WGPUSType + */ + @JvmField + public var sType: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUChainedStructOut(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUChainedStructOut(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "vendorID", "vendorName", "architecture", "deviceID", "name", + "driverDescription", "adapterType", "backendType" +) +public open class WGPUAdapterProperties : Structure { + /** + * mapped from (typedef Optional[WGPUChainedStructOut] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStructOut)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var vendorID: Int = 0 + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var vendorName: String? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var architecture: String? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var deviceID: Int = 0 + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var name: String? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var driverDescription: String? = null + + /** + * mapped from WGPUAdapterType + */ + @JvmField + public var adapterType: Int = 0 + + /** + * mapped from WGPUBackendType + */ + @JvmField + public var backendType: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUAdapterProperties(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUAdapterProperties(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "binding", "buffer", "offset", "size", "sampler", + "textureView" +) +public open class WGPUBindGroupEntry : Structure { + + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var binding: Int? = null + + /** + * mapped from WGPUBuffer + */ + @JvmField + public var buffer: WGPUBuffer? = null + + /** + * mapped from uint64_t + */ + @JvmField + public var offset: Long? = null + + /** + * mapped from uint64_t + */ + @JvmField + public var size: Long? = null + + /** + * mapped from WGPUSampler + */ + @JvmField + public var sampler: WGPUSampler? = null + + /** + * mapped from WGPUTextureView + */ + @JvmField + public var textureView: WGPUTextureView? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUBindGroupEntry(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUBindGroupEntry(pointer), Structure.ByValue +} + +@Structure.FieldOrder("operation", "srcFactor", "dstFactor") +public open class WGPUBlendComponent : Structure { + /** + * mapped from WGPUBlendOperation + */ + @JvmField + public var operation: Int = 0 + + /** + * mapped from WGPUBlendFactor + */ + @JvmField + public var srcFactor: Int = 0 + + /** + * mapped from WGPUBlendFactor + */ + @JvmField + public var dstFactor: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUBlendComponent(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUBlendComponent(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "type", "hasDynamicOffset", "minBindingSize") +public open class WGPUBufferBindingLayout : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUBufferBindingType + */ + @JvmField + public var type: Int = 0 + + /** + * mapped from WGPUBool + */ + @JvmField + public var hasDynamicOffset: WGPUBool = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var minBindingSize: Long = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUBufferBindingLayout(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUBufferBindingLayout(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label", "usage", "size", "mappedAtCreation") +public open class WGPUBufferDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from WGPUBufferUsageFlags + */ + @JvmField + public var usage: WGPUBufferUsageFlags = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var size: Long = 0 + + /** + * mapped from WGPUBool + */ + @JvmField + public var mappedAtCreation: WGPUBool? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUBufferDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUBufferDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("r", "g", "b", "a") +public open class WGPUColor : Structure { + /** + * mapped from double + */ + @JvmField + public var r: Double = 0.0 + + /** + * mapped from double + */ + @JvmField + public var g: Double = 0.0 + + /** + * mapped from double + */ + @JvmField + public var b: Double = 0.0 + + /** + * mapped from double + */ + @JvmField + public var a: Double = 0.0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUColor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUColor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label") +public open class WGPUCommandBufferDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUCommandBufferDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUCommandBufferDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label") +public open class WGPUCommandEncoderDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUCommandEncoderDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUCommandEncoderDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "message", "type", "lineNum", "linePos", "offset", "length", + "utf16LinePos", "utf16Offset", "utf16Length" +) +public open class WGPUCompilationMessage : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var message: String? = null + + /** + * mapped from WGPUCompilationMessageType + */ + @JvmField + public var type: Int = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var lineNum: Long = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var linePos: Long = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var offset: Long = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var length: Long = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var utf16LinePos: Long = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var utf16Offset: Long = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var utf16Length: Long = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUCompilationMessage(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUCompilationMessage(pointer), Structure.ByValue +} + +@Structure.FieldOrder("querySet", "beginningOfPassWriteIndex", "endOfPassWriteIndex") +public open class WGPUComputePassTimestampWrites : Structure { + /** + * mapped from WGPUQuerySet + */ + @JvmField + public var querySet: WGPUQuerySet = WGPUQuerySetImpl() + + /** + * mapped from uint32_t + */ + @JvmField + public var beginningOfPassWriteIndex: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var endOfPassWriteIndex: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUComputePassTimestampWrites(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUComputePassTimestampWrites(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "key", "value") +public open class WGPUConstantEntry : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var key: String? = null + + /** + * mapped from double + */ + @JvmField + public var `value`: Double = 0.0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUConstantEntry(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUConstantEntry(pointer), Structure.ByValue +} + +@Structure.FieldOrder("width", "height", "depthOrArrayLayers") +public open class WGPUExtent3D : Structure { + /** + * mapped from uint32_t + */ + @JvmField + public var width: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var height: Int? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var depthOrArrayLayers: Int? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUExtent3D(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUExtent3D(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain") +public open class WGPUInstanceDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUInstanceDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUInstanceDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "maxTextureDimension1D", "maxTextureDimension2D", "maxTextureDimension3D", + "maxTextureArrayLayers", "maxBindGroups", "maxBindGroupsPlusVertexBuffers", + "maxBindingsPerBindGroup", "maxDynamicUniformBuffersPerPipelineLayout", + "maxDynamicStorageBuffersPerPipelineLayout", "maxSampledTexturesPerShaderStage", + "maxSamplersPerShaderStage", "maxStorageBuffersPerShaderStage", + "maxStorageTexturesPerShaderStage", "maxUniformBuffersPerShaderStage", + "maxUniformBufferBindingSize", "maxStorageBufferBindingSize", "minUniformBufferOffsetAlignment", + "minStorageBufferOffsetAlignment", "maxVertexBuffers", "maxBufferSize", "maxVertexAttributes", + "maxVertexBufferArrayStride", "maxInterStageShaderComponents", "maxInterStageShaderVariables", + "maxColorAttachments", "maxColorAttachmentBytesPerSample", "maxComputeWorkgroupStorageSize", + "maxComputeInvocationsPerWorkgroup", "maxComputeWorkgroupSizeX", "maxComputeWorkgroupSizeY", + "maxComputeWorkgroupSizeZ", "maxComputeWorkgroupsPerDimension" +) +public open class WGPULimits : Structure { + /** + * mapped from uint32_t + */ + @JvmField + public var maxTextureDimension1D: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxTextureDimension2D: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxTextureDimension3D: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxTextureArrayLayers: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxBindGroups: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxBindGroupsPlusVertexBuffers: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxBindingsPerBindGroup: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxDynamicUniformBuffersPerPipelineLayout: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxDynamicStorageBuffersPerPipelineLayout: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxSampledTexturesPerShaderStage: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxSamplersPerShaderStage: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxStorageBuffersPerShaderStage: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxStorageTexturesPerShaderStage: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxUniformBuffersPerShaderStage: Int = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var maxUniformBufferBindingSize: Long = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var maxStorageBufferBindingSize: Long = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var minUniformBufferOffsetAlignment: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var minStorageBufferOffsetAlignment: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxVertexBuffers: Int = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var maxBufferSize: Long = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxVertexAttributes: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxVertexBufferArrayStride: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxInterStageShaderComponents: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxInterStageShaderVariables: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxColorAttachments: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxColorAttachmentBytesPerSample: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxComputeWorkgroupStorageSize: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxComputeInvocationsPerWorkgroup: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxComputeWorkgroupSizeX: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxComputeWorkgroupSizeY: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxComputeWorkgroupSizeZ: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxComputeWorkgroupsPerDimension: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPULimits(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPULimits(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "count", "mask", "alphaToCoverageEnabled") +public open class WGPUMultisampleState : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var count: Int? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var mask: Int? = null + + /** + * mapped from WGPUBool + */ + @JvmField + public var alphaToCoverageEnabled: WGPUBool? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUMultisampleState(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUMultisampleState(pointer), Structure.ByValue +} + +@Structure.FieldOrder("x", "y", "z") +public open class WGPUOrigin3D : Structure { + /** + * mapped from uint32_t + */ + @JvmField + public var x: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var y: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var z: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUOrigin3D(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUOrigin3D(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label", "bindGroupLayoutCount", "bindGroupLayouts") +public open class WGPUPipelineLayoutDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from size_t + */ + @JvmField + public var bindGroupLayoutCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUBindGroupLayout] = (Declared())*)* + */ + @JvmField + public var bindGroupLayouts: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUPipelineLayoutDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUPipelineLayoutDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "unclippedDepth") +public open class WGPUPrimitiveDepthClipControl : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from WGPUBool + */ + @JvmField + public var unclippedDepth: WGPUBool = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUPrimitiveDepthClipControl(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUPrimitiveDepthClipControl(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "topology", "stripIndexFormat", "frontFace", "cullMode") +public open class WGPUPrimitiveState : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUPrimitiveTopology + */ + @JvmField + public var topology: Int? = null + + /** + * mapped from WGPUIndexFormat + */ + @JvmField + public var stripIndexFormat: Int? = null + + /** + * mapped from WGPUFrontFace + */ + @JvmField + public var frontFace: Int? = null + + /** + * mapped from WGPUCullMode + */ + @JvmField + public var cullMode: Int? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUPrimitiveState(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUPrimitiveState(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label", "type", "count") +public open class WGPUQuerySetDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from WGPUQueryType + */ + @JvmField + public var type: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var count: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUQuerySetDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUQuerySetDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label") +public open class WGPUQueueDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUQueueDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUQueueDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label") +public open class WGPURenderBundleDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURenderBundleDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURenderBundleDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "label", "colorFormatCount", "colorFormats", + "depthStencilFormat", "sampleCount", "depthReadOnly", "stencilReadOnly" +) +public open class WGPURenderBundleEncoderDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from size_t + */ + @JvmField + public var colorFormatCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUTextureFormat] = Declared(i4))* + */ + @JvmField + public var colorFormats: Pointer? = null + + /** + * mapped from WGPUTextureFormat + */ + @JvmField + public var depthStencilFormat: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var sampleCount: Int = 0 + + /** + * mapped from WGPUBool + */ + @JvmField + public var depthReadOnly: WGPUBool = 0 + + /** + * mapped from WGPUBool + */ + @JvmField + public var stencilReadOnly: WGPUBool = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURenderBundleEncoderDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURenderBundleEncoderDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "view", "depthLoadOp", "depthStoreOp", "depthClearValue", "depthReadOnly", + "stencilLoadOp", "stencilStoreOp", "stencilClearValue", "stencilReadOnly" +) +public open class WGPURenderPassDepthStencilAttachment : Structure { + /** + * mapped from WGPUTextureView + */ + @JvmField + public var view: WGPUTextureView = WGPUTextureViewImpl() + + /** + * mapped from WGPULoadOp + */ + @JvmField + public var depthLoadOp: Int = 0 + + /** + * mapped from WGPUStoreOp + */ + @JvmField + public var depthStoreOp: Int = 0 + + /** + * mapped from float + */ + @JvmField + public var depthClearValue: Float = 0.0f + + /** + * mapped from WGPUBool + */ + @JvmField + public var depthReadOnly: WGPUBool = 0 + + /** + * mapped from WGPULoadOp + */ + @JvmField + public var stencilLoadOp: Int = 0 + + /** + * mapped from WGPUStoreOp + */ + @JvmField + public var stencilStoreOp: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var stencilClearValue: Int = 0 + + /** + * mapped from WGPUBool + */ + @JvmField + public var stencilReadOnly: WGPUBool = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURenderPassDepthStencilAttachment(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURenderPassDepthStencilAttachment(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "maxDrawCount") +public open class WGPURenderPassDescriptorMaxDrawCount : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from uint64_t + */ + @JvmField + public var maxDrawCount: Long = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURenderPassDescriptorMaxDrawCount(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURenderPassDescriptorMaxDrawCount(pointer), Structure.ByValue +} + +@Structure.FieldOrder("querySet", "beginningOfPassWriteIndex", "endOfPassWriteIndex") +public open class WGPURenderPassTimestampWrites : Structure { + /** + * mapped from WGPUQuerySet + */ + @JvmField + public var querySet: WGPUQuerySet = WGPUQuerySetImpl() + + /** + * mapped from uint32_t + */ + @JvmField + public var beginningOfPassWriteIndex: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var endOfPassWriteIndex: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURenderPassTimestampWrites(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURenderPassTimestampWrites(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "compatibleSurface", "powerPreference", "backendType", + "forceFallbackAdapter" +) +public open class WGPURequestAdapterOptions : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUSurface + */ + @JvmField + public var compatibleSurface: WGPUSurface = WGPUSurfaceImpl() + + /** + * mapped from WGPUPowerPreference + */ + @JvmField + public var powerPreference: Int = 0 + + /** + * mapped from WGPUBackendType + */ + @JvmField + public var backendType: Int? = null + + /** + * mapped from WGPUBool + */ + @JvmField + public var forceFallbackAdapter: WGPUBool = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURequestAdapterOptions(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURequestAdapterOptions(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "type") +public open class WGPUSamplerBindingLayout : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUSamplerBindingType + */ + @JvmField + public var type: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSamplerBindingLayout(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSamplerBindingLayout(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "label", "addressModeU", "addressModeV", "addressModeW", + "magFilter", "minFilter", "mipmapFilter", "lodMinClamp", "lodMaxClamp", "compare", + "maxAnisotropy" +) +public open class WGPUSamplerDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from WGPUAddressMode + */ + @JvmField + public var addressModeU: Int = 0 + + /** + * mapped from WGPUAddressMode + */ + @JvmField + public var addressModeV: Int = 0 + + /** + * mapped from WGPUAddressMode + */ + @JvmField + public var addressModeW: Int = 0 + + /** + * mapped from WGPUFilterMode + */ + @JvmField + public var magFilter: Int = 0 + + /** + * mapped from WGPUFilterMode + */ + @JvmField + public var minFilter: Int = 0 + + /** + * mapped from WGPUMipmapFilterMode + */ + @JvmField + public var mipmapFilter: Int = 0 + + /** + * mapped from float + */ + @JvmField + public var lodMinClamp: Float = 0.0f + + /** + * mapped from float + */ + @JvmField + public var lodMaxClamp: Float = 0.0f + + /** + * mapped from WGPUCompareFunction + */ + @JvmField + public var compare: Int = 0 + + /** + * mapped from uint16_t + */ + @JvmField + public var maxAnisotropy: Byte = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSamplerDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSamplerDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "entryPoint", "layout") +public open class WGPUShaderModuleCompilationHint : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var entryPoint: String? = null + + /** + * mapped from WGPUPipelineLayout + */ + @JvmField + public var layout: WGPUPipelineLayout = WGPUPipelineLayoutImpl() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUShaderModuleCompilationHint(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUShaderModuleCompilationHint(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "codeSize", "code") +public open class WGPUShaderModuleSPIRVDescriptor : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from uint32_t + */ + @JvmField + public var codeSize: Int = 0 + + /** + * mapped from (typedef Optional[const uint32_t] = UNSIGNED = Int(layout = i4))* + */ + @JvmField + public var code: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUShaderModuleSPIRVDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUShaderModuleSPIRVDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "code") +public open class WGPUShaderModuleWGSLDescriptor : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var code: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUShaderModuleWGSLDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUShaderModuleWGSLDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("compare", "failOp", "depthFailOp", "passOp") +public open class WGPUStencilFaceState : Structure { + /** + * mapped from WGPUCompareFunction + */ + @JvmField + public var compare: Int = 0 + + /** + * mapped from WGPUStencilOperation + */ + @JvmField + public var failOp: Int = 0 + + /** + * mapped from WGPUStencilOperation + */ + @JvmField + public var depthFailOp: Int = 0 + + /** + * mapped from WGPUStencilOperation + */ + @JvmField + public var passOp: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUStencilFaceState(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUStencilFaceState(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "access", "format", "viewDimension") +public open class WGPUStorageTextureBindingLayout : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUStorageTextureAccess + */ + @JvmField + public var access: Int = 0 + + /** + * mapped from WGPUTextureFormat + */ + @JvmField + public var format: Int = 0 + + /** + * mapped from WGPUTextureViewDimension + */ + @JvmField + public var viewDimension: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUStorageTextureBindingLayout(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUStorageTextureBindingLayout(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "formatCount", "formats", "presentModeCount", "presentModes", + "alphaModeCount", "alphaModes" +) +public open class WGPUSurfaceCapabilities : Structure { + /** + * mapped from (typedef Optional[WGPUChainedStructOut] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStructOut)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from size_t + */ + @JvmField + public var formatCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[WGPUTextureFormat] = Declared(i4))* + */ + @JvmField + public var formats: Pointer? = null + + /** + * mapped from size_t + */ + @JvmField + public var presentModeCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[WGPUPresentMode] = Declared(i4))* + */ + @JvmField + public var presentModes: Pointer? = null + + /** + * mapped from size_t + */ + @JvmField + public var alphaModeCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[WGPUCompositeAlphaMode] = Declared(i4))* + */ + @JvmField + public var alphaModes: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceCapabilities(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceCapabilities(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "device", "format", "usage", "viewFormatCount", "viewFormats", + "alphaMode", "width", "height", "presentMode" +) +public open class WGPUSurfaceConfiguration : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUDevice + */ + @JvmField + public var device: WGPUDevice = WGPUDeviceImpl() + + /** + * mapped from WGPUTextureFormat + */ + @JvmField + public var format: Int = 0 + + /** + * mapped from WGPUTextureUsageFlags + */ + @JvmField + public var usage: WGPUTextureUsageFlags = 0 + + /** + * mapped from size_t + */ + @JvmField + public var viewFormatCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUTextureFormat] = Declared(i4))* + */ + @JvmField + public var viewFormats: Pointer? = null + + /** + * mapped from WGPUCompositeAlphaMode + */ + @JvmField + public var alphaMode: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var width: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var height: Int = 0 + + /** + * mapped from WGPUPresentMode + */ + @JvmField + public var presentMode: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceConfiguration(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceConfiguration(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label") +public open class WGPUDarwinSurfaceDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: WGPUSurfaceDescriptorFromMetalLayer.ByReference = + WGPUSurfaceDescriptorFromMetalLayer.ByReference() + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label") +public open class WGPUSurfaceDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "window") +public open class WGPUSurfaceDescriptorFromAndroidNativeWindow : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (Void)* + */ + @JvmField + public var window: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromAndroidNativeWindow(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromAndroidNativeWindow(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "selector") +public open class WGPUSurfaceDescriptorFromCanvasHTMLSelector : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var selector: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromCanvasHTMLSelector(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromCanvasHTMLSelector(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "layer") +public open class WGPUSurfaceDescriptorFromMetalLayer : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (Void)* + */ + @JvmField + public var layer: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromMetalLayer(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromMetalLayer(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "display", "surface") +public open class WGPUSurfaceDescriptorFromWaylandSurface : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (Void)* + */ + @JvmField + public var display: Pointer? = null + + /** + * mapped from (Void)* + */ + @JvmField + public var surface: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromWaylandSurface(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromWaylandSurface(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "hinstance", "hwnd") +public open class WGPUSurfaceDescriptorFromWindowsHWND : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (Void)* + */ + @JvmField + public var hinstance: Pointer? = null + + /** + * mapped from (Void)* + */ + @JvmField + public var hwnd: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromWindowsHWND(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromWindowsHWND(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "connection", "window") +public open class WGPUSurfaceDescriptorFromXcbWindow : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (Void)* + */ + @JvmField + public var connection: Pointer? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var window: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromXcbWindow(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromXcbWindow(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "display", "window") +public open class WGPUSurfaceDescriptorFromXlibWindow : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (Void)* + */ + @JvmField + public var display: Pointer? = null + + /** + * mapped from uint64_t + */ + @JvmField + public var window: Long = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromXlibWindow(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceDescriptorFromXlibWindow(pointer), Structure.ByValue +} + +@Structure.FieldOrder("texture", "suboptimal", "status") +public open class WGPUSurfaceTexture : Structure { + /** + * mapped from WGPUTexture + */ + @JvmField + public var texture: WGPUTexture = WGPUTextureImpl() + + /** + * mapped from WGPUBool + */ + @JvmField + public var suboptimal: WGPUBool = 0 + + /** + * mapped from WGPUSurfaceGetCurrentTextureStatus + */ + @JvmField + public var status: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceTexture(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceTexture(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "sampleType", "viewDimension", "multisampled") +public open class WGPUTextureBindingLayout : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUTextureSampleType + */ + @JvmField + public var sampleType: Int = 0 + + /** + * mapped from WGPUTextureViewDimension + */ + @JvmField + public var viewDimension: Int = 0 + + /** + * mapped from WGPUBool + */ + @JvmField + public var multisampled: WGPUBool = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUTextureBindingLayout(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUTextureBindingLayout(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "offset", "bytesPerRow", "rowsPerImage") +public open class WGPUTextureDataLayout : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from uint64_t + */ + @JvmField + public var offset: Long = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var bytesPerRow: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var rowsPerImage: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUTextureDataLayout(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUTextureDataLayout(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "label", "format", "dimension", "baseMipLevel", + "mipLevelCount", "baseArrayLayer", "arrayLayerCount", "aspect" +) +public open class WGPUTextureViewDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from WGPUTextureFormat + */ + @JvmField + public var format: Int = 0 + + /** + * mapped from WGPUTextureViewDimension + */ + @JvmField + public var dimension: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var baseMipLevel: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var mipLevelCount: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var baseArrayLayer: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var arrayLayerCount: Int = 0 + + /** + * mapped from WGPUTextureAspect + */ + @JvmField + public var aspect: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUTextureViewDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUTextureViewDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("format", "offset", "shaderLocation") +public open class WGPUVertexAttribute : Structure { + /** + * mapped from WGPUVertexFormat + */ + @JvmField + public var format: Int = 0 + + /** + * mapped from uint64_t + */ + @JvmField + public var offset: Long = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var shaderLocation: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUVertexAttribute(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUVertexAttribute(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label", "layout", "entryCount", "entriesPtr") +public open class WGPUBindGroupDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from WGPUBindGroupLayout + */ + @JvmField + public var layout: WGPUBindGroupLayout? = null + + /** + * mapped from size_t + */ + @JvmField + public var entryCount: NativeLong? = null + + /** + * mapped from (typedef Optional[const WGPUBindGroupEntry] = + * Declared([a8(nextInChain):[*:b1]i4(binding)x4a8(buffer):[*:b1]j8(offset)j8(size)a8(sampler):[*:b1]a8(textureView):[*:b1]](WGPUBindGroupEntry)))* + */ + @JvmField + public var entriesPtr: Pointer? = null + + public var entries: Array? = null + + override fun write() { + entries?.forEach { it.write() } + entryCount = NativeLong(entries?.size?.toLong() ?: 0L) + entriesPtr = entries?.getOrNull(0)?.pointer + super.write() + } + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUBindGroupDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUBindGroupDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "binding", "visibility", "buffer", "sampler", "texture", + "storageTexture" +) +public open class WGPUBindGroupLayoutEntry : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var binding: Int = 0 + + /** + * mapped from WGPUShaderStageFlags + */ + @JvmField + public var visibility: WGPUShaderStageFlags = 0 + + /** + * mapped from WGPUBufferBindingLayout + */ + @JvmField + public var buffer: WGPUBufferBindingLayout = WGPUBufferBindingLayout() + + /** + * mapped from WGPUSamplerBindingLayout + */ + @JvmField + public var sampler: WGPUSamplerBindingLayout = WGPUSamplerBindingLayout() + + /** + * mapped from WGPUTextureBindingLayout + */ + @JvmField + public var texture: WGPUTextureBindingLayout = WGPUTextureBindingLayout() + + /** + * mapped from WGPUStorageTextureBindingLayout + */ + @JvmField + public var storageTexture: WGPUStorageTextureBindingLayout = WGPUStorageTextureBindingLayout() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUBindGroupLayoutEntry(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUBindGroupLayoutEntry(pointer), Structure.ByValue +} + +@Structure.FieldOrder("color", "alpha") +public open class WGPUBlendState : Structure { + /** + * mapped from WGPUBlendComponent + */ + @JvmField + public var color: WGPUBlendComponent = WGPUBlendComponent() + + /** + * mapped from WGPUBlendComponent + */ + @JvmField + public var alpha: WGPUBlendComponent = WGPUBlendComponent() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUBlendState(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUBlendState(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "messageCount", "messages") +public open class WGPUCompilationInfo : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from size_t + */ + @JvmField + public var messageCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUCompilationMessage] = + * Declared([a8(nextInChain):[*:b1]a8(message):[*:b1]i4(type)x4j8(lineNum)j8(linePos)j8(offset)j8(length)j8(utf16LinePos)j8(utf16Offset)j8(utf16Length)](WGPUCompilationMessage)))* + */ + @JvmField + public var messages: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUCompilationInfo(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUCompilationInfo(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label", "timestampWrites") +public open class WGPUComputePassDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from (typedef Optional[const WGPUComputePassTimestampWrites] = + * Declared([a8(querySet):[*:b1]i4(beginningOfPassWriteIndex)i4(endOfPassWriteIndex)](WGPUComputePassTimestampWrites)))* + */ + @JvmField + public var timestampWrites: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUComputePassDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUComputePassDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "format", "depthWriteEnabled", "depthCompare", "stencilFront", + "stencilBack", "stencilReadMask", "stencilWriteMask", "depthBias", "depthBiasSlopeScale", + "depthBiasClamp" +) +public open class WGPUDepthStencilState : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUTextureFormat + */ + @JvmField + public var format: Int = 0 + + /** + * mapped from WGPUBool + */ + @JvmField + public var depthWriteEnabled: WGPUBool = 0 + + /** + * mapped from WGPUCompareFunction + */ + @JvmField + public var depthCompare: Int = 0 + + /** + * mapped from WGPUStencilFaceState + */ + @JvmField + public var stencilFront: WGPUStencilFaceState = WGPUStencilFaceState() + + /** + * mapped from WGPUStencilFaceState + */ + @JvmField + public var stencilBack: WGPUStencilFaceState = WGPUStencilFaceState() + + /** + * mapped from uint32_t + */ + @JvmField + public var stencilReadMask: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var stencilWriteMask: Int = 0 + + /** + * mapped from int32_t + */ + @JvmField + public var depthBias: Int = 0 + + /** + * mapped from float + */ + @JvmField + public var depthBiasSlopeScale: Float = 0.0f + + /** + * mapped from float + */ + @JvmField + public var depthBiasClamp: Float = 0.0f + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUDepthStencilState(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUDepthStencilState(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "layout", "buffer") +public open class WGPUImageCopyBuffer : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUTextureDataLayout + */ + @JvmField + public var layout: WGPUTextureDataLayout = WGPUTextureDataLayout() + + /** + * mapped from WGPUBuffer + */ + @JvmField + public var buffer: WGPUBuffer = WGPUBufferImpl() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUImageCopyBuffer(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUImageCopyBuffer(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "texture", "mipLevel", "origin", "aspect") +public open class WGPUImageCopyTexture : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUTexture + */ + @JvmField + public var texture: WGPUTexture = WGPUTextureImpl() + + /** + * mapped from uint32_t + */ + @JvmField + public var mipLevel: Int? = null + + /** + * mapped from WGPUOrigin3D + */ + @JvmField + public var origin: WGPUOrigin3D? = null + + /** + * mapped from WGPUTextureAspect + */ + @JvmField + public var aspect: Int? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUImageCopyTexture(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUImageCopyTexture(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "module", "entryPoint", "constantCount", "constants") +public open class WGPUProgrammableStageDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUShaderModule + */ + @JvmField + public var module: WGPUShaderModule = WGPUShaderModuleImpl() + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var entryPoint: String? = null + + /** + * mapped from size_t + */ + @JvmField + public var constantCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUConstantEntry] = + * Declared([a8(nextInChain):[*:b1]a8(key):[*:b1]d8(value)](WGPUConstantEntry)))* + */ + @JvmField + public var constants: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUProgrammableStageDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUProgrammableStageDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "view", "resolveTarget", "loadOp", "storeOp", "clearValue") +public open class WGPURenderPassColorAttachment : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUTextureView + */ + @JvmField + public var view: WGPUTextureView = WGPUTextureViewImpl() + + /** + * mapped from WGPUTextureView + */ + @JvmField + public var resolveTarget: WGPUTextureView? = null + + /** + * mapped from WGPULoadOp + */ + @JvmField + public var loadOp: Int = 0 + + /** + * mapped from WGPUStoreOp + */ + @JvmField + public var storeOp: Int = 0 + + /** + * mapped from WGPUColor + */ + @JvmField + public var clearValue: WGPUColor? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURenderPassColorAttachment(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURenderPassColorAttachment(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "limits") +public open class WGPURequiredLimits : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPULimits + */ + @JvmField + public var limits: WGPULimits = WGPULimits() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURequiredLimits(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURequiredLimits(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label", "hintCount", "hints") +public open class WGPUShaderModuleDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: WGPUShaderModuleWGSLDescriptor.ByReference? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from size_t + */ + @JvmField + public var hintCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUShaderModuleCompilationHint] = + * Declared([a8(nextInChain):[*:b1]a8(entryPoint):[*:b1]a8(layout):[*:b1]](WGPUShaderModuleCompilationHint)))* + */ + @JvmField + public var hints: Array? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUShaderModuleDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUShaderModuleDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "limits") +public open class WGPUSupportedLimits : Structure { + /** + * mapped from (typedef Optional[WGPUChainedStructOut] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStructOut)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPULimits + */ + @JvmField + public var limits: WGPULimits = WGPULimits() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSupportedLimits(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSupportedLimits(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "label", "usage", "dimension", "size", "format", + "mipLevelCount", "sampleCount", "viewFormatCount", "viewFormats" +) +public open class WGPUTextureDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from WGPUTextureUsageFlags + */ + @JvmField + public var usage: WGPUTextureUsageFlags? = null + + /** + * mapped from WGPUTextureDimension + */ + @JvmField + public var dimension: Int? = null + + /** + * mapped from WGPUExtent3D + */ + @JvmField + public var size: WGPUExtent3D? = null + + /** + * mapped from WGPUTextureFormat + */ + @JvmField + public var format: Int? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var mipLevelCount: Int? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var sampleCount: Int? = null + + /** + * mapped from size_t + */ + @JvmField + public var viewFormatCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUTextureFormat] = Declared(i4))* + */ + @JvmField + public var viewFormats: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUTextureDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUTextureDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("arrayStride", "stepMode", "attributeCount", "attributes") +public open class WGPUVertexBufferLayout : Structure { + /** + * mapped from uint64_t + */ + @JvmField + public var arrayStride: Long = 0 + + /** + * mapped from WGPUVertexStepMode + */ + @JvmField + public var stepMode: Int? = null + + /** + * mapped from size_t + */ + @JvmField + public var attributeCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUVertexAttribute] = + * Declared([i4(format)x4j8(offset)i4(shaderLocation)x4](WGPUVertexAttribute)))* + */ + @JvmField + public var attributes: Array? = arrayOf(WGPUVertexAttribute.ByReference()) + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUVertexBufferLayout(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUVertexBufferLayout(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label", "entryCount", "entries") +public open class WGPUBindGroupLayoutDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from size_t + */ + @JvmField + public var entryCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUBindGroupLayoutEntry] = + * Declared([a8(nextInChain):[*:b1]i4(binding)i4(visibility)[a8(nextInChain):[*:b1]i4(type)i4(hasDynamicOffset)j8(minBindingSize)](buffer)[a8(nextInChain):[*:b1]i4(type)x4](sampler)[a8(nextInChain):[*:b1]i4(sampleType)i4(viewDimension)i4(multisampled)x4](texture)[a8(nextInChain):[*:b1]i4(access)i4(format)i4(viewDimension)x4](storageTexture)](WGPUBindGroupLayoutEntry)))* + */ + @JvmField + public var entries: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUBindGroupLayoutDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUBindGroupLayoutDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "format", "blend", "writeMask") +public open class WGPUColorTargetState : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUTextureFormat + */ + @JvmField + public var format: Int = 0 + + /** + * mapped from (typedef Optional[const WGPUBlendState] = + * Declared([[i4(operation)i4(srcFactor)i4(dstFactor)](color)[i4(operation)i4(srcFactor)i4(dstFactor)](alpha)](WGPUBlendState)))* + */ + @JvmField + public var blend: Pointer? = null + + /** + * mapped from WGPUColorWriteMaskFlags + */ + @JvmField + public var writeMask: WGPUColorWriteMaskFlags? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUColorTargetState(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUColorTargetState(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "label", "layout", "compute") +public open class WGPUComputePipelineDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from WGPUPipelineLayout + */ + @JvmField + public var layout: WGPUPipelineLayout = WGPUPipelineLayoutImpl() + + /** + * mapped from WGPUProgrammableStageDescriptor + */ + @JvmField + public var compute: WGPUProgrammableStageDescriptor = WGPUProgrammableStageDescriptor() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUComputePipelineDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUComputePipelineDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "label", "requiredFeatureCount", "requiredFeatures", + "requiredLimits", "defaultQueue", "deviceLostCallback", "deviceLostUserdata" +) +public open class WGPUDeviceDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from size_t + */ + @JvmField + public var requiredFeatureCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUFeatureName] = Declared(i4))* + */ + @JvmField + public var requiredFeatures: Pointer? = null + + /** + * mapped from (typedef Optional[const WGPURequiredLimits] = + * Declared([a8(nextInChain):[*:b1][i4(maxTextureDimension1D)i4(maxTextureDimension2D)i4(maxTextureDimension3D)i4(maxTextureArrayLayers)i4(maxBindGroups)i4(maxBindGroupsPlusVertexBuffers)i4(maxBindingsPerBindGroup)i4(maxDynamicUniformBuffersPerPipelineLayout)i4(maxDynamicStorageBuffersPerPipelineLayout)i4(maxSampledTexturesPerShaderStage)i4(maxSamplersPerShaderStage)i4(maxStorageBuffersPerShaderStage)i4(maxStorageTexturesPerShaderStage)i4(maxUniformBuffersPerShaderStage)j8(maxUniformBufferBindingSize)j8(maxStorageBufferBindingSize)i4(minUniformBufferOffsetAlignment)i4(minStorageBufferOffsetAlignment)i4(maxVertexBuffers)x4j8(maxBufferSize)i4(maxVertexAttributes)i4(maxVertexBufferArrayStride)i4(maxInterStageShaderComponents)i4(maxInterStageShaderVariables)i4(maxColorAttachments)i4(maxColorAttachmentBytesPerSample)i4(maxComputeWorkgroupStorageSize)i4(maxComputeInvocationsPerWorkgroup)i4(maxComputeWorkgroupSizeX)i4(maxComputeWorkgroupSizeY)i4(maxComputeWorkgroupSizeZ)i4(maxComputeWorkgroupsPerDimension)](limits)](WGPURequiredLimits)))* + */ + @JvmField + public var requiredLimits: Pointer? = null + + /** + * mapped from WGPUQueueDescriptor + */ + @JvmField + public var defaultQueue: WGPUQueueDescriptor = WGPUQueueDescriptor() + + /** + * mapped from WGPUDeviceLostCallback + */ + @JvmField + public var deviceLostCallback: WGPUDeviceLostCallback? = null + + /** + * mapped from (Void)* + */ + @JvmField + public var deviceLostUserdata: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUDeviceDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUDeviceDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "label", "colorAttachmentCount", "colorAttachments", + "depthStencilAttachment", "occlusionQuerySet", "timestampWrites" +) +public open class WGPURenderPassDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from size_t + */ + @JvmField + public var colorAttachmentCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPURenderPassColorAttachment] = + * Declared([a8(nextInChain):[*:b1]a8(view):[*:b1]a8(resolveTarget):[*:b1]i4(loadOp)i4(storeOp)[d8(r)d8(g)d8(b)d8(a)](clearValue)](WGPURenderPassColorAttachment)))* + */ + @JvmField + public var colorAttachments: Array? = null + + /** + * mapped from (typedef Optional[const WGPURenderPassDepthStencilAttachment] = + * Declared([a8(view):[*:b1]i4(depthLoadOp)i4(depthStoreOp)f4(depthClearValue)i4(depthReadOnly)i4(stencilLoadOp)i4(stencilStoreOp)i4(stencilClearValue)i4(stencilReadOnly)](WGPURenderPassDepthStencilAttachment)))* + */ + @JvmField + public var depthStencilAttachment: Pointer? = null + + /** + * mapped from WGPUQuerySet + */ + @JvmField + public var occlusionQuerySet: WGPUQuerySet = WGPUQuerySetImpl() + + /** + * mapped from (typedef Optional[const WGPURenderPassTimestampWrites] = + * Declared([a8(querySet):[*:b1]i4(beginningOfPassWriteIndex)i4(endOfPassWriteIndex)](WGPURenderPassTimestampWrites)))* + */ + @JvmField + public var timestampWrites: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURenderPassDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURenderPassDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "module", "entryPoint", "constantCount", "constants", + "bufferCount", "buffers" +) +public open class WGPUVertexState : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUShaderModule + */ + @JvmField + public var module: WGPUShaderModule = WGPUShaderModuleImpl() + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var entryPoint: String? = null + + /** + * mapped from size_t + */ + @JvmField + public var constantCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUConstantEntry] = + * Declared([a8(nextInChain):[*:b1]a8(key):[*:b1]d8(value)](WGPUConstantEntry)))* + */ + @JvmField + public var constants: Array? = arrayOf(WGPUConstantEntry.ByReference()) + + /** + * mapped from size_t + */ + @JvmField + public var bufferCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUVertexBufferLayout] = + * Declared([j8(arrayStride)i4(stepMode)x4j8(attributeCount)a8(attributes):[*:b1]](WGPUVertexBufferLayout)))* + */ + @JvmField + public var buffers: Array? = arrayOf(WGPUVertexBufferLayout.ByReference()) + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUVertexState(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUVertexState(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "module", "entryPoint", "constantCount", "constants", + "targetCount", "targets" +) +public open class WGPUFragmentState : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUShaderModule + */ + @JvmField + public var module: WGPUShaderModule = WGPUShaderModuleImpl() + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var entryPoint: String? = null + + /** + * mapped from size_t + */ + @JvmField + public var constantCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUConstantEntry] = + * Declared([a8(nextInChain):[*:b1]a8(key):[*:b1]d8(value)](WGPUConstantEntry)))* + */ + @JvmField + public var constants: Pointer? = null + + /** + * mapped from size_t + */ + @JvmField + public var targetCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUColorTargetState] = + * Declared([a8(nextInChain):[*:b1]i4(format)x4a8(blend):[*:b1]i4(writeMask)x4](WGPUColorTargetState)))* + */ + @JvmField + public var targets: Array? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUFragmentState(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUFragmentState(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "nextInChain", "label", "layout", "vertex", "primitive", "depthStencil", + "multisample", "fragment" +) +public open class WGPURenderPipelineDescriptor : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var label: String? = null + + /** + * mapped from WGPUPipelineLayout + */ + @JvmField + public var layout: WGPUPipelineLayout? = null + + /** + * mapped from WGPUVertexState + */ + @JvmField + public var vertex: WGPUVertexState? = null + + /** + * mapped from WGPUPrimitiveState + */ + @JvmField + public var primitive: WGPUPrimitiveState? = null + + /** + * mapped from (typedef Optional[const WGPUDepthStencilState] = + * Declared([a8(nextInChain):[*:b1]i4(format)i4(depthWriteEnabled)i4(depthCompare)[i4(compare)i4(failOp)i4(depthFailOp)i4(passOp)](stencilFront)[i4(compare)i4(failOp)i4(depthFailOp)i4(passOp)](stencilBack)i4(stencilReadMask)i4(stencilWriteMask)i4(depthBias)f4(depthBiasSlopeScale)f4(depthBiasClamp)](WGPUDepthStencilState)))* + */ + @JvmField + public var depthStencil: Pointer? = null + + /** + * mapped from WGPUMultisampleState + */ + @JvmField + public var multisample: WGPUMultisampleState? = null + + /** + * mapped from (typedef Optional[const WGPUFragmentState] = + * Declared([a8(nextInChain):[*:b1]a8(module):[*:b1]a8(entryPoint):[*:b1]j8(constantCount)a8(constants):[*:b1]j8(targetCount)a8(targets):[*:b1]](WGPUFragmentState)))* + */ + @JvmField + public var fragment: WGPUFragmentState.ByReference? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURenderPipelineDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURenderPipelineDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "chain", "backends", "flags", "dx12ShaderCompiler", "gles3MinorVersion", + "dxilPath", "dxcPath" +) +public open class WGPUInstanceExtras : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from WGPUInstanceBackendFlags + */ + @JvmField + public var backends: WGPUInstanceBackendFlags = 0 + + /** + * mapped from WGPUInstanceFlags + */ + @JvmField + public var flags: WGPUInstanceFlags = 0 + + /** + * mapped from WGPUDx12Compiler + */ + @JvmField + public var dx12ShaderCompiler: Int = 0 + + /** + * mapped from WGPUGles3MinorVersion + */ + @JvmField + public var gles3MinorVersion: Int = 0 + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var dxilPath: String? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var dxcPath: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUInstanceExtras(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUInstanceExtras(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "tracePath") +public open class WGPUDeviceExtras : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var tracePath: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUDeviceExtras(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUDeviceExtras(pointer), Structure.ByValue +} + +@Structure.FieldOrder("maxPushConstantSize", "maxNonSamplerBindings") +public open class WGPUNativeLimits : Structure { + /** + * mapped from uint32_t + */ + @JvmField + public var maxPushConstantSize: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var maxNonSamplerBindings: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUNativeLimits(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUNativeLimits(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "limits") +public open class WGPURequiredLimitsExtras : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from WGPUNativeLimits + */ + @JvmField + public var limits: WGPUNativeLimits = WGPUNativeLimits() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURequiredLimitsExtras(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURequiredLimitsExtras(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "limits") +public open class WGPUSupportedLimitsExtras : Structure { + /** + * mapped from WGPUChainedStructOut + */ + @JvmField + public var chain: WGPUChainedStructOut = WGPUChainedStructOut() + + /** + * mapped from WGPUNativeLimits + */ + @JvmField + public var limits: WGPUNativeLimits = WGPUNativeLimits() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSupportedLimitsExtras(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSupportedLimitsExtras(pointer), Structure.ByValue +} + +@Structure.FieldOrder("stages", "start", "end") +public open class WGPUPushConstantRange : Structure { + /** + * mapped from WGPUShaderStageFlags + */ + @JvmField + public var stages: WGPUShaderStageFlags = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var start: Int = 0 + + /** + * mapped from uint32_t + */ + @JvmField + public var end: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUPushConstantRange(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUPushConstantRange(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "pushConstantRangeCount", "pushConstantRanges") +public open class WGPUPipelineLayoutExtras : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from size_t + */ + @JvmField + public var pushConstantRangeCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUPushConstantRange] = + * Declared([i4(stages)i4(start)i4(end)](WGPUPushConstantRange)))* + */ + @JvmField + public var pushConstantRanges: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUPipelineLayoutExtras(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUPipelineLayoutExtras(pointer), Structure.ByValue +} + +@Structure.FieldOrder("queue", "submissionIndex") +public open class WGPUWrappedSubmissionIndex : Structure { + /** + * mapped from WGPUQueue + */ + @JvmField + public var queue: WGPUQueue = WGPUQueueImpl() + + /** + * mapped from WGPUSubmissionIndex + */ + @JvmField + public var submissionIndex: WGPUSubmissionIndex = com.sun.jna.NativeLong(0) + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUWrappedSubmissionIndex(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUWrappedSubmissionIndex(pointer), Structure.ByValue +} + +@Structure.FieldOrder("name", "value") +public open class WGPUShaderDefine : Structure { + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var name: String? = null + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var `value`: String? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUShaderDefine(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUShaderDefine(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "stage", "code", "defineCount", "defines") +public open class WGPUShaderModuleGLSLDescriptor : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from WGPUShaderStage + */ + @JvmField + public var stage: Int = 0 + + /** + * mapped from (Char(layout = b1))* + */ + @JvmField + public var code: String? = null + + /** + * mapped from uint32_t + */ + @JvmField + public var defineCount: Int = 0 + + /** + * mapped from (typedef Optional[WGPUShaderDefine] = + * Declared([a8(name):[*:b1]a8(value):[*:b1]](WGPUShaderDefine)))* + */ + @JvmField + public var defines: Pointer? = null + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUShaderModuleGLSLDescriptor(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUShaderModuleGLSLDescriptor(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "numAllocated", "numKeptFromUser", "numReleasedFromUser", "numError", + "elementSize" +) +public open class WGPURegistryReport : Structure { + /** + * mapped from size_t + */ + @JvmField + public var numAllocated: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from size_t + */ + @JvmField + public var numKeptFromUser: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from size_t + */ + @JvmField + public var numReleasedFromUser: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from size_t + */ + @JvmField + public var numError: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from size_t + */ + @JvmField + public var elementSize: NativeLong = com.sun.jna.NativeLong(0) + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPURegistryReport(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPURegistryReport(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "adapters", "devices", "queues", "pipelineLayouts", "shaderModules", + "bindGroupLayouts", "bindGroups", "commandBuffers", "renderBundles", "renderPipelines", + "computePipelines", "querySets", "buffers", "textures", "textureViews", "samplers" +) +public open class WGPUHubReport : Structure { + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var adapters: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var devices: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var queues: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var pipelineLayouts: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var shaderModules: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var bindGroupLayouts: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var bindGroups: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var commandBuffers: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var renderBundles: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var renderPipelines: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var computePipelines: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var querySets: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var buffers: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var textures: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var textureViews: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var samplers: WGPURegistryReport = WGPURegistryReport() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUHubReport(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUHubReport(pointer), Structure.ByValue +} + +@Structure.FieldOrder("surfaces", "backendType", "vulkan", "metal", "dx12", "gl") +public open class WGPUGlobalReport : Structure { + /** + * mapped from WGPURegistryReport + */ + @JvmField + public var surfaces: WGPURegistryReport = WGPURegistryReport() + + /** + * mapped from WGPUBackendType + */ + @JvmField + public var backendType: Int = 0 + + /** + * mapped from WGPUHubReport + */ + @JvmField + public var vulkan: WGPUHubReport = WGPUHubReport() + + /** + * mapped from WGPUHubReport + */ + @JvmField + public var metal: WGPUHubReport = WGPUHubReport() + + /** + * mapped from WGPUHubReport + */ + @JvmField + public var dx12: WGPUHubReport = WGPUHubReport() + + /** + * mapped from WGPUHubReport + */ + @JvmField + public var gl: WGPUHubReport = WGPUHubReport() + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUGlobalReport(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUGlobalReport(pointer), Structure.ByValue +} + +@Structure.FieldOrder("nextInChain", "backends") +public open class WGPUInstanceEnumerateAdapterOptions : Structure { + /** + * mapped from (typedef Optional[const WGPUChainedStruct] = + * Declared([a8(next):[*:b1]i4(sType)x4](WGPUChainedStruct)))* + */ + @JvmField + public var nextInChain: Pointer? = null + + /** + * mapped from WGPUInstanceBackendFlags + */ + @JvmField + public var backends: WGPUInstanceBackendFlags = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUInstanceEnumerateAdapterOptions(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUInstanceEnumerateAdapterOptions(pointer), Structure.ByValue +} + +@Structure.FieldOrder( + "chain", "buffers", "bufferCount", "samplers", "samplerCount", "textureViews", + "textureViewCount" +) +public open class WGPUBindGroupEntryExtras : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (typedef Optional[const WGPUBuffer] = (Declared())*)* + */ + @JvmField + public var buffers: Pointer? = null + + /** + * mapped from size_t + */ + @JvmField + public var bufferCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUSampler] = (Declared())*)* + */ + @JvmField + public var samplers: Pointer? = null + + /** + * mapped from size_t + */ + @JvmField + public var samplerCount: NativeLong = com.sun.jna.NativeLong(0) + + /** + * mapped from (typedef Optional[const WGPUTextureView] = (Declared())*)* + */ + @JvmField + public var textureViews: Pointer? = null + + /** + * mapped from size_t + */ + @JvmField + public var textureViewCount: NativeLong = com.sun.jna.NativeLong(0) + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUBindGroupEntryExtras(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUBindGroupEntryExtras(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "count") +public open class WGPUBindGroupLayoutEntryExtras : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from uint32_t + */ + @JvmField + public var count: Int = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUBindGroupLayoutEntryExtras(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUBindGroupLayoutEntryExtras(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "pipelineStatistics", "pipelineStatisticCount") +public open class WGPUQuerySetDescriptorExtras : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from (typedef Optional[const WGPUPipelineStatisticName] = Declared(i4))* + */ + @JvmField + public var pipelineStatistics: Pointer? = null + + /** + * mapped from size_t + */ + @JvmField + public var pipelineStatisticCount: NativeLong = com.sun.jna.NativeLong(0) + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUQuerySetDescriptorExtras(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUQuerySetDescriptorExtras(pointer), Structure.ByValue +} + +@Structure.FieldOrder("chain", "desiredMaximumFrameLatency") +public open class WGPUSurfaceConfigurationExtras : Structure { + /** + * mapped from WGPUChainedStruct + */ + @JvmField + public var chain: WGPUChainedStruct = WGPUChainedStruct() + + /** + * mapped from WGPUBool + */ + @JvmField + public var desiredMaximumFrameLatency: WGPUBool = 0 + + public constructor(pointer: Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: Pointer? = null, + ) : WGPUSurfaceConfigurationExtras(pointer), Structure.ByReference + + public class ByValue( + pointer: Pointer? = null, + ) : WGPUSurfaceConfigurationExtras(pointer), Structure.ByValue +} diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/TypeAlias.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/TypeAlias.kt new file mode 100644 index 00000000..248cc851 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/TypeAlias.kt @@ -0,0 +1,1159 @@ +package io.ygdrasil.wgpu.`internal`.jvm + +import com.sun.jna.Callback +import com.sun.jna.NativeLong +import com.sun.jna.Pointer + +public typealias WGPUFlags = Int + +public typealias `WGPUFlags$Array` = IntArray + +public typealias WGPUBool = Int + +public typealias `WGPUBool$Array` = IntArray + +public typealias WGPUAdapter = WGPUAdapterImpl + +public typealias WGPUBindGroup = WGPUBindGroupImpl + +public typealias WGPUBindGroupLayout = WGPUBindGroupLayoutImpl + +public typealias WGPUBuffer = WGPUBufferImpl + +public typealias WGPUCommandBuffer = WGPUCommandBufferImpl + +public typealias WGPUCommandEncoder = WGPUCommandEncoderImpl + +public typealias WGPUComputePassEncoder = WGPUComputePassEncoderImpl + +public typealias WGPUComputePipeline = WGPUComputePipelineImpl + +public typealias WGPUDevice = WGPUDeviceImpl + +public typealias WGPUInstance = WGPUInstanceImpl + +public typealias WGPUPipelineLayout = WGPUPipelineLayoutImpl + +public typealias WGPUQuerySet = WGPUQuerySetImpl + +public typealias WGPUQueue = WGPUQueueImpl + +public typealias WGPURenderBundle = WGPURenderBundleImpl + +public typealias WGPURenderBundleEncoder = WGPURenderBundleEncoderImpl + +public typealias WGPURenderPassEncoder = WGPURenderPassEncoderImpl + +public typealias WGPURenderPipeline = WGPURenderPipelineImpl + +public typealias WGPUSampler = WGPUSamplerImpl + +public typealias WGPUShaderModule = WGPUShaderModuleImpl + +public typealias WGPUSurface = WGPUSurfaceImpl + +public typealias WGPUTexture = WGPUTextureImpl + +public typealias WGPUTextureView = WGPUTextureViewImpl + +public typealias WGPUBufferUsageFlags = Int + +public typealias `WGPUBufferUsageFlags$Array` = IntArray + +public typealias WGPUColorWriteMaskFlags = Int + +public typealias `WGPUColorWriteMaskFlags$Array` = IntArray + +public typealias WGPUMapModeFlags = Int + +public typealias `WGPUMapModeFlags$Array` = IntArray + +public typealias WGPUShaderStageFlags = Int + +public typealias `WGPUShaderStageFlags$Array` = IntArray + +public typealias WGPUTextureUsageFlags = Int + +public typealias `WGPUTextureUsageFlags$Array` = IntArray + +public interface WGPUBufferMapCallback : Callback { + public operator fun invoke(param1: Unit, param2: Unit) +} + +public interface WGPUCompilationInfoCallback : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUCompilationInfo, + param3: Unit, + ) +} + +public interface WGPUCreateComputePipelineAsyncCallback : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUComputePipelineImpl, + param3: Byte, + param4: Unit, + ) +} + +public interface WGPUCreateRenderPipelineAsyncCallback : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPURenderPipelineImpl, + param3: Byte, + param4: Unit, + ) +} + +public interface WGPUDeviceLostCallback : Callback { + public operator fun invoke( + param1: Unit, + param2: Byte, + param3: Unit, + ) +} + +public interface WGPUErrorCallback : Callback { + public operator fun invoke( + param1: Unit, + param2: Byte, + param3: Unit, + ) +} + +public interface WGPUProc : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUQueueWorkDoneCallback : Callback { + public operator fun invoke(param1: Unit, param2: Unit) +} + +public interface WGPURequestAdapterCallback : Callback { + public operator fun invoke( + param1: Int, + param2: WGPUAdapterImpl, + param3: String?, + param4: Pointer?, + ) +} + +public interface WGPURequestDeviceCallback : Callback { + public operator fun invoke( + param1: Int, + param2: WGPUDeviceImpl, + param3: String?, + param4: Pointer?, + ) +} + +public interface WGPUProcCreateInstance : Callback { + public operator fun invoke(param1: WGPUInstanceImpl): WGPUInstanceImpl +} + +public interface WGPUProcGetProcAddress : Callback { + public operator fun invoke(param1: Pointer?, param2: Byte) +} + +public interface WGPUProcAdapterEnumerateFeatures : Callback { + public operator fun invoke(param1: NativeLong, param2: Int): NativeLong +} + +public interface WGPUProcAdapterGetLimits : Callback { + public operator fun invoke(param1: Int, param2: WGPUSupportedLimits): Int +} + +public interface WGPUProcAdapterGetProperties : Callback { + public operator fun invoke(param1: Unit, param2: WGPUAdapterProperties) +} + +public interface WGPUProcAdapterHasFeature : Callback { + public operator fun invoke(param1: Int, param2: Int): Int +} + +public interface WGPUProcAdapterRequestDevice : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUDeviceDescriptor, + param3: Unit, + param4: WGPUDeviceImpl, + param5: Byte, + param6: Unit, + param7: Unit, + ) +} + +public interface WGPUProcAdapterReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcAdapterRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcBindGroupSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcBindGroupReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcBindGroupRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcBindGroupLayoutSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcBindGroupLayoutReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcBindGroupLayoutRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcBufferDestroy : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcBufferGetConstMappedRange : Callback { + public operator fun invoke( + param1: Pointer?, + param2: NativeLong, + param3: NativeLong, + ): Pointer +} + +public interface WGPUProcBufferGetMapState : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcBufferGetMappedRange : Callback { + public operator fun invoke( + param1: Pointer?, + param2: NativeLong, + param3: NativeLong, + ): Pointer +} + +public interface WGPUProcBufferGetSize : Callback { + public operator fun invoke(param1: NativeLong): NativeLong +} + +public interface WGPUProcBufferGetUsage : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcBufferMapAsync : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: NativeLong, + param4: NativeLong, + param5: Unit, + param6: Unit, + param7: Unit, + ) +} + +public interface WGPUProcBufferSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcBufferUnmap : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcBufferReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcBufferRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcCommandBufferSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcCommandBufferReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcCommandBufferRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcCommandEncoderBeginComputePass : Callback { + public operator fun invoke(param1: WGPUComputePassEncoderImpl, param2: WGPUComputePassDescriptor): + WGPUComputePassEncoderImpl +} + +public interface WGPUProcCommandEncoderBeginRenderPass : Callback { + public operator fun invoke(param1: WGPURenderPassEncoderImpl, param2: WGPURenderPassDescriptor): + WGPURenderPassEncoderImpl +} + +public interface WGPUProcCommandEncoderClearBuffer : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUBufferImpl, + param3: NativeLong, + param4: NativeLong, + ) +} + +public interface WGPUProcCommandEncoderCopyBufferToBuffer : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUBufferImpl, + param3: NativeLong, + param4: WGPUBufferImpl, + param5: NativeLong, + param6: NativeLong, + ) +} + +public interface WGPUProcCommandEncoderCopyBufferToTexture : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUImageCopyBuffer, + param3: WGPUImageCopyTexture, + param4: WGPUExtent3D, + ) +} + +public interface WGPUProcCommandEncoderCopyTextureToBuffer : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUImageCopyTexture, + param3: WGPUImageCopyBuffer, + param4: WGPUExtent3D, + ) +} + +public interface WGPUProcCommandEncoderCopyTextureToTexture : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUImageCopyTexture, + param3: WGPUImageCopyTexture, + param4: WGPUExtent3D, + ) +} + +public interface WGPUProcCommandEncoderFinish : Callback { + public operator fun invoke(param1: WGPUCommandBufferImpl, param2: WGPUCommandBufferDescriptor): + WGPUCommandBufferImpl +} + +public interface WGPUProcCommandEncoderInsertDebugMarker : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcCommandEncoderPopDebugGroup : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcCommandEncoderPushDebugGroup : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcCommandEncoderResolveQuerySet : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUQuerySetImpl, + param3: Int, + param4: Int, + param5: WGPUBufferImpl, + param6: NativeLong, + ) +} + +public interface WGPUProcCommandEncoderSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcCommandEncoderWriteTimestamp : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUQuerySetImpl, + param3: Int, + ) +} + +public interface WGPUProcCommandEncoderReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcCommandEncoderRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcComputePassEncoderDispatchWorkgroups : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: Int, + param4: Int, + ) +} + +public interface WGPUProcComputePassEncoderDispatchWorkgroupsIndirect : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUBufferImpl, + param3: NativeLong, + ) +} + +public interface WGPUProcComputePassEncoderEnd : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcComputePassEncoderInsertDebugMarker : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcComputePassEncoderPopDebugGroup : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcComputePassEncoderPushDebugGroup : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcComputePassEncoderSetBindGroup : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: WGPUBindGroupImpl, + param4: NativeLong, + param5: Int, + ) +} + +public interface WGPUProcComputePassEncoderSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcComputePassEncoderSetPipeline : Callback { + public operator fun invoke(param1: Unit, param2: WGPUComputePipelineImpl) +} + +public interface WGPUProcComputePassEncoderReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcComputePassEncoderRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcComputePipelineGetBindGroupLayout : Callback { + public operator fun invoke(param1: WGPUBindGroupLayoutImpl, param2: Int): WGPUBindGroupLayoutImpl +} + +public interface WGPUProcComputePipelineSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcComputePipelineReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcComputePipelineRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcDeviceCreateBindGroup : Callback { + public operator fun invoke(param1: WGPUBindGroupImpl, param2: WGPUBindGroupDescriptor): + WGPUBindGroupImpl +} + +public interface WGPUProcDeviceCreateBindGroupLayout : Callback { + public operator fun invoke( + param1: WGPUBindGroupLayoutImpl, + param2: WGPUBindGroupLayoutDescriptor + ): WGPUBindGroupLayoutImpl +} + +public interface WGPUProcDeviceCreateBuffer : Callback { + public operator fun invoke(param1: WGPUBufferImpl, param2: WGPUBufferDescriptor): WGPUBufferImpl +} + +public interface WGPUProcDeviceCreateCommandEncoder : Callback { + public operator fun invoke(param1: WGPUCommandEncoderImpl, param2: WGPUCommandEncoderDescriptor): + WGPUCommandEncoderImpl +} + +public interface WGPUProcDeviceCreateComputePipeline : Callback { + public operator fun invoke( + param1: WGPUComputePipelineImpl, + param2: WGPUComputePipelineDescriptor + ): WGPUComputePipelineImpl +} + +public interface WGPUProcDeviceCreateComputePipelineAsync : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUComputePipelineDescriptor, + param3: Unit, + param4: WGPUComputePipelineImpl, + param5: Byte, + param6: Unit, + param7: Unit, + ) +} + +public interface WGPUProcDeviceCreatePipelineLayout : Callback { + public operator fun invoke(param1: WGPUPipelineLayoutImpl, param2: WGPUPipelineLayoutDescriptor): + WGPUPipelineLayoutImpl +} + +public interface WGPUProcDeviceCreateQuerySet : Callback { + public operator fun invoke(param1: WGPUQuerySetImpl, param2: WGPUQuerySetDescriptor): + WGPUQuerySetImpl +} + +public interface WGPUProcDeviceCreateRenderBundleEncoder : Callback { + public operator fun invoke( + param1: WGPURenderBundleEncoderImpl, + param2: WGPURenderBundleEncoderDescriptor + ): WGPURenderBundleEncoderImpl +} + +public interface WGPUProcDeviceCreateRenderPipeline : Callback { + public operator fun invoke(param1: WGPURenderPipelineImpl, param2: WGPURenderPipelineDescriptor): + WGPURenderPipelineImpl +} + +public interface WGPUProcDeviceCreateRenderPipelineAsync : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPURenderPipelineDescriptor, + param3: Unit, + param4: WGPURenderPipelineImpl, + param5: Byte, + param6: Unit, + param7: Unit, + ) +} + +public interface WGPUProcDeviceCreateSampler : Callback { + public operator fun invoke(param1: WGPUSamplerImpl, param2: WGPUSamplerDescriptor): + WGPUSamplerImpl +} + +public interface WGPUProcDeviceCreateShaderModule : Callback { + public operator fun invoke(param1: WGPUShaderModuleImpl, param2: WGPUShaderModuleDescriptor): + WGPUShaderModuleImpl +} + +public interface WGPUProcDeviceCreateTexture : Callback { + public operator fun invoke(param1: WGPUTextureImpl, param2: WGPUTextureDescriptor): + WGPUTextureImpl +} + +public interface WGPUProcDeviceDestroy : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcDeviceEnumerateFeatures : Callback { + public operator fun invoke(param1: NativeLong, param2: Int): NativeLong +} + +public interface WGPUProcDeviceGetLimits : Callback { + public operator fun invoke(param1: Int, param2: WGPUSupportedLimits): Int +} + +public interface WGPUProcDeviceGetQueue : Callback { + public operator fun invoke(param1: WGPUQueueImpl): WGPUQueueImpl +} + +public interface WGPUProcDeviceHasFeature : Callback { + public operator fun invoke(param1: Int, param2: Int): Int +} + +public interface WGPUProcDevicePopErrorScope : Callback { + public operator fun invoke( + param1: Unit, + param2: Unit, + param3: Byte, + param4: Unit, + param5: Unit, + ) +} + +public interface WGPUProcDevicePushErrorScope : Callback { + public operator fun invoke(param1: Unit, param2: Int) +} + +public interface WGPUProcDeviceSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcDeviceSetUncapturedErrorCallback : Callback { + public operator fun invoke( + param1: Unit, + param2: Unit, + param3: Byte, + param4: Unit, + param5: Unit, + ) +} + +public interface WGPUProcDeviceReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcDeviceRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcInstanceCreateSurface : Callback { + public operator fun invoke(param1: WGPUSurfaceImpl, param2: WGPUSurfaceDescriptor): + WGPUSurfaceImpl +} + +public interface WGPUProcInstanceProcessEvents : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcInstanceRequestAdapter : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPURequestAdapterOptions, + param3: Unit, + param4: WGPUAdapterImpl, + param5: Byte, + param6: Unit, + param7: Unit, + ) +} + +public interface WGPUProcInstanceReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcInstanceRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcPipelineLayoutSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcPipelineLayoutReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcPipelineLayoutRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcQuerySetDestroy : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcQuerySetGetCount : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcQuerySetGetType : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcQuerySetSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcQuerySetReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcQuerySetRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcQueueOnSubmittedWorkDone : Callback { + public operator fun invoke( + param1: Unit, + param2: Unit, + param3: Unit, + param4: Unit, + ) +} + +public interface WGPUProcQueueSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcQueueSubmit : Callback { + public operator fun invoke( + param1: Unit, + param2: NativeLong, + param3: WGPUCommandBufferImpl, + ) +} + +public interface WGPUProcQueueWriteBuffer : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUBufferImpl, + param3: NativeLong, + param4: Unit, + param5: NativeLong, + ) +} + +public interface WGPUProcQueueWriteTexture : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUImageCopyTexture, + param3: Unit, + param4: NativeLong, + param5: WGPUTextureDataLayout, + param6: WGPUExtent3D, + ) +} + +public interface WGPUProcQueueReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcQueueRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderBundleSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcRenderBundleReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderBundleRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderBundleEncoderDraw : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: Int, + param4: Int, + param5: Int, + ) +} + +public interface WGPUProcRenderBundleEncoderDrawIndexed : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: Int, + param4: Int, + param5: Int, + param6: Int, + ) +} + +public interface WGPUProcRenderBundleEncoderDrawIndexedIndirect : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUBufferImpl, + param3: NativeLong, + ) +} + +public interface WGPUProcRenderBundleEncoderDrawIndirect : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUBufferImpl, + param3: NativeLong, + ) +} + +public interface WGPUProcRenderBundleEncoderFinish : Callback { + public operator fun invoke(param1: WGPURenderBundleImpl, param2: WGPURenderBundleDescriptor): + WGPURenderBundleImpl +} + +public interface WGPUProcRenderBundleEncoderInsertDebugMarker : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcRenderBundleEncoderPopDebugGroup : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderBundleEncoderPushDebugGroup : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcRenderBundleEncoderSetBindGroup : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: WGPUBindGroupImpl, + param4: NativeLong, + param5: Int, + ) +} + +public interface WGPUProcRenderBundleEncoderSetIndexBuffer : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUBufferImpl, + param3: Int, + param4: NativeLong, + param5: NativeLong, + ) +} + +public interface WGPUProcRenderBundleEncoderSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcRenderBundleEncoderSetPipeline : Callback { + public operator fun invoke(param1: Unit, param2: WGPURenderPipelineImpl) +} + +public interface WGPUProcRenderBundleEncoderSetVertexBuffer : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: WGPUBufferImpl, + param4: NativeLong, + param5: NativeLong, + ) +} + +public interface WGPUProcRenderBundleEncoderReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderBundleEncoderRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderPassEncoderBeginOcclusionQuery : Callback { + public operator fun invoke(param1: Unit, param2: Int) +} + +public interface WGPUProcRenderPassEncoderDraw : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: Int, + param4: Int, + param5: Int, + ) +} + +public interface WGPUProcRenderPassEncoderDrawIndexed : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: Int, + param4: Int, + param5: Int, + param6: Int, + ) +} + +public interface WGPUProcRenderPassEncoderDrawIndexedIndirect : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUBufferImpl, + param3: NativeLong, + ) +} + +public interface WGPUProcRenderPassEncoderDrawIndirect : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUBufferImpl, + param3: NativeLong, + ) +} + +public interface WGPUProcRenderPassEncoderEnd : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderPassEncoderEndOcclusionQuery : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderPassEncoderExecuteBundles : Callback { + public operator fun invoke( + param1: Unit, + param2: NativeLong, + param3: WGPURenderBundleImpl, + ) +} + +public interface WGPUProcRenderPassEncoderInsertDebugMarker : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcRenderPassEncoderPopDebugGroup : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderPassEncoderPushDebugGroup : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcRenderPassEncoderSetBindGroup : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: WGPUBindGroupImpl, + param4: NativeLong, + param5: Int, + ) +} + +public interface WGPUProcRenderPassEncoderSetBlendConstant : Callback { + public operator fun invoke(param1: Unit, param2: WGPUColor) +} + +public interface WGPUProcRenderPassEncoderSetIndexBuffer : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUBufferImpl, + param3: Int, + param4: NativeLong, + param5: NativeLong, + ) +} + +public interface WGPUProcRenderPassEncoderSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcRenderPassEncoderSetPipeline : Callback { + public operator fun invoke(param1: Unit, param2: WGPURenderPipelineImpl) +} + +public interface WGPUProcRenderPassEncoderSetScissorRect : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: Int, + param4: Int, + param5: Int, + ) +} + +public interface WGPUProcRenderPassEncoderSetStencilReference : Callback { + public operator fun invoke(param1: Unit, param2: Int) +} + +public interface WGPUProcRenderPassEncoderSetVertexBuffer : Callback { + public operator fun invoke( + param1: Unit, + param2: Int, + param3: WGPUBufferImpl, + param4: NativeLong, + param5: NativeLong, + ) +} + +public interface WGPUProcRenderPassEncoderSetViewport : Callback { + public operator fun invoke( + param1: Unit, + param2: Float, + param3: Float, + param4: Float, + param5: Float, + param6: Float, + param7: Float, + ) +} + +public interface WGPUProcRenderPassEncoderReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderPassEncoderRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderPipelineGetBindGroupLayout : Callback { + public operator fun invoke(param1: WGPUBindGroupLayoutImpl, param2: Int): WGPUBindGroupLayoutImpl +} + +public interface WGPUProcRenderPipelineSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcRenderPipelineReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcRenderPipelineRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcSamplerSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcSamplerReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcSamplerRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcShaderModuleGetCompilationInfo : Callback { + public operator fun invoke( + param1: Unit, + param2: Unit, + param3: WGPUCompilationInfo, + param4: Unit, + param5: Unit, + ) +} + +public interface WGPUProcShaderModuleSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcShaderModuleReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcShaderModuleRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcSurfaceConfigure : Callback { + public operator fun invoke(param1: Unit, param2: WGPUSurfaceConfiguration) +} + +public interface WGPUProcSurfaceGetCapabilities : Callback { + public operator fun invoke( + param1: Unit, + param2: WGPUAdapterImpl, + param3: WGPUSurfaceCapabilities, + ) +} + +public interface WGPUProcSurfaceGetCurrentTexture : Callback { + public operator fun invoke(param1: Unit, param2: WGPUSurfaceTexture) +} + +public interface WGPUProcSurfaceGetPreferredFormat : Callback { + public operator fun invoke(param1: Int, param2: WGPUAdapterImpl): Int +} + +public interface WGPUProcSurfacePresent : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcSurfaceUnconfigure : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcSurfaceReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcSurfaceRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcSurfaceCapabilitiesFreeMembers : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcTextureCreateView : Callback { + public operator fun invoke(param1: WGPUTextureViewImpl, param2: WGPUTextureViewDescriptor): + WGPUTextureViewImpl +} + +public interface WGPUProcTextureDestroy : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcTextureGetDepthOrArrayLayers : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcTextureGetDimension : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcTextureGetFormat : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcTextureGetHeight : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcTextureGetMipLevelCount : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcTextureGetSampleCount : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcTextureGetUsage : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcTextureGetWidth : Callback { + public operator fun invoke(param1: Int): Int +} + +public interface WGPUProcTextureSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcTextureReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcTextureRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcTextureViewSetLabel : Callback { + public operator fun invoke(param1: Unit, param2: Byte) +} + +public interface WGPUProcTextureViewReference : Callback { + public operator fun invoke(param1: Unit) +} + +public interface WGPUProcTextureViewRelease : Callback { + public operator fun invoke(param1: Unit) +} + +public typealias WGPUInstanceBackendFlags = Int + +public typealias `WGPUInstanceBackendFlags$Array` = IntArray + +public typealias WGPUInstanceFlags = Int + +public typealias `WGPUInstanceFlags$Array` = IntArray + +public typealias WGPUSubmissionIndex = NativeLong + +public interface WGPULogCallback : Callback { + public operator fun invoke( + level: Int, + message: String, + param3: Pointer?, + ) +} diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/helpers.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/helpers.kt new file mode 100644 index 00000000..78a03105 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/helpers.kt @@ -0,0 +1,6 @@ +package io.ygdrasil.wgpu.internal.jvm + +internal fun Boolean.toInt(): WGPUBool = when (this) { + true -> 1 + else -> 0 +} \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/sdl2wgpu.kt b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/sdl2wgpu.kt new file mode 100644 index 00000000..f63a007f --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmMain/kotlin/io.ygdrasil.wgpu/internal/jvm/sdl2wgpu.kt @@ -0,0 +1,15 @@ +package io.ygdrasil.wgpu.internal.jvm + +import com.sun.jna.Library +import io.ygdrasil.libsdl.SDL_Window + +public val libsdl2wgpu: Libsdl2wgpu by lazy { + klang.internal.NativeLoad("sdl2wgpu") +} + +interface Libsdl2wgpu : Library { + fun SDL_GetWGPUSurface(instance: WGPUInstance, window: SDL_Window): WGPUSurface? +} + +fun SDL_GetWGPUSurface(instance: WGPUInstance, window: SDL_Window): WGPUSurface? = + libsdl2wgpu.SDL_GetWGPUSurface(instance, window) \ No newline at end of file diff --git a/bindings/wgpu/wgpu4k/src/jvmTest/kotlin/io.ygdrasil.wgpu/DeviceDescriptoMapping.kt b/bindings/wgpu/wgpu4k/src/jvmTest/kotlin/io.ygdrasil.wgpu/DeviceDescriptoMapping.kt new file mode 100644 index 00000000..3c9866b8 --- /dev/null +++ b/bindings/wgpu/wgpu4k/src/jvmTest/kotlin/io.ygdrasil.wgpu/DeviceDescriptoMapping.kt @@ -0,0 +1,36 @@ +package io.ygdrasil.wgpu + +import io.kotest.core.spec.style.FreeSpec +import io.kotest.matchers.shouldBe +import io.ygdrasil.wgpu.internal.jvm.WGPUTextureDescriptor + + +class DeviceDescriptoMapping : FreeSpec({ + + + "test texture descriptor mapping" { + + // Given + val descriptor = TextureDescriptor( + size = GPUExtent3DDictStrict(100, 150, 5), + format = TextureFormat.depth24plus, + usage = TextureUsage.renderattachment.value, + ) + + + // When + val result: WGPUTextureDescriptor = textureDescriptorMapper.map(descriptor) + + result.apply { + size.width shouldBe 100 + size.height shouldBe 150 + size.depthOrArrayLayers shouldBe 5 + format shouldBe TextureFormat.depth24plus.value + usage shouldBe TextureUsage.renderattachment.value + + //TODO add more test + } + + } + +}) diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..e88ff8d2 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,8 @@ +FROM ubuntu:24.04 + +RUN apt-get update -yq \ + && apt-get install openjdk-21-jdk -yq \ + && apt-get install clang-tools-15 -yq \ + && apt-get install gradle -yq \ + && apt-get clean -yq \ + && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/docker/build.sh b/docker/build.sh index db56f736..0b2fab22 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -1 +1,3 @@ -docker build -t ubuntu-clang-16 -f ./ubuntu-clang-16 . \ No newline at end of file + +docker buildx build --platform linux/amd64 -t ubuntu-all-tools:jdk21-adm64 . +docker buildx build --platform linux/arm64 -t ubuntu-all-tools:jdk21-arm64 . \ No newline at end of file diff --git a/docker/ubuntu-clang-16 b/docker/ubuntu-clang-16 deleted file mode 100644 index 0fdc94a0..00000000 --- a/docker/ubuntu-clang-16 +++ /dev/null @@ -1,5 +0,0 @@ -FROM ubuntu:23.10 - -RUN apt-get update -yq \ - && apt-get install clang-tools-16 -yq \ - && apt-get clean -yq \ No newline at end of file diff --git a/klang/build.gradle.kts b/klang/build.gradle.kts index 921951eb..94edeb8b 100644 --- a/klang/build.gradle.kts +++ b/klang/build.gradle.kts @@ -1,10 +1,14 @@ +import klang.publish.SonatypeCentralUploadTask + plugins { - kotlin("jvm") version "1.9.20" - kotlin("plugin.serialization") version "1.9.20" + kotlin("jvm") version libs.versions.kotlin + kotlin("plugin.serialization") version libs.versions.kotlin id("org.jetbrains.kotlinx.kover") version "0.7.3" id("com.gradle.plugin-publish") version "1.0.0" } +val rootProject = project + val projectVersion = System.getenv("VERSION") ?.takeIf { it.isNotBlank() } ?: "0.0.0" @@ -13,7 +17,6 @@ allprojects { apply(plugin = "maven-publish") apply(plugin = "org.jetbrains.kotlin.jvm") apply(plugin = "org.jetbrains.kotlin.plugin.serialization") - apply(plugin = "org.jetbrains.kotlinx.kover") repositories { mavenCentral() @@ -22,6 +25,11 @@ allprojects { group = "io.ygdrasil" version = projectVersion + java { + withJavadocJar() + withSourcesJar() + } + kotlin { jvmToolchain(21) @@ -41,22 +49,59 @@ allprojects { publications { create("maven") { from(components["java"]) - } - } - repositories { - maven { - name = "GitLab" - url = uri(System.getenv("URL") ?: "") - credentials(HttpHeaderCredentials::class) { - name = "Deploy-Token" - value = System.getenv("TOKEN") - } - authentication { - create("header") + pom { + name = "Klang-${project.name}" + description = "Module of Klang project" + url = "https://ygdrasil.io/" + licenses { + license { + name = "MIT" + url = "https://opensource.org/license/mit/" + } + } + developers { + developer { + id = "alexandremo" + name = "Alexandre Mommers" + email = "alexandre dot mommers at gmail do com" + } + } + scm { + connection = "scm:git:git://github.com/ygdrasil-io/klang.git" + developerConnection = "scm:git:ssh//git@github.com:ygdrasil-io/klang.git" + url = "https://github.com/ygdrasil-io/klang" + } } } } } + + val buildDir = project.layout.buildDirectory.locationOnly.get().asFile + val artifact = buildDir.resolve("libs").resolve("$name-$version.jar") + val sources = buildDir.resolve("libs").resolve("$name-$version-sources.jar") + val javadoc = buildDir.resolve("libs").resolve("$name-$version-javadoc.jar") + + val sonatypeCentralUploadTask = tasks.register("sonatypeCentralUpload-$name") { + + username = System.getenv("SONATYPE_LOGIN") + password = System.getenv("SONATYPE_PASSWORD") + signingKey = System.getenv("PGP_PRIVATE") + signingKeyPassphrase = System.getenv("PGP_PASSPHRASE") + publicKey = System.getenv("PGP_PUBLIC") + + archives = files(artifact, sources, javadoc) + pom = file(buildDir.resolve("publications").resolve("maven").resolve("pom-default.xml")) + + }.get() + + val publishAllTask = tasks.register("publishAll") {}.get() + + if (project != rootProject) { + tasks.filterIsInstance().forEach { task -> sonatypeCentralUploadTask.dependsOn(task) } + sonatypeCentralUploadTask.dependsOn(tasks.getByName("assemble")) + publishAllTask.dependsOn(sonatypeCentralUploadTask) + } } + diff --git a/klang/buildSrc/build.gradle.kts b/klang/buildSrc/build.gradle.kts new file mode 100644 index 00000000..6967591a --- /dev/null +++ b/klang/buildSrc/build.gradle.kts @@ -0,0 +1,28 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +val libs = versionCatalogs.named("libs") + +plugins { + `java-gradle-plugin` + kotlin("jvm") version libs.versions.kotlin +} + +repositories { + mavenCentral() +} + +dependencies { + implementation("org.pgpainless:pgpainless-sop:1.6.5") + implementation("net.lingala.zip4j:zip4j:2.11.5") + implementation("com.google.code.gson:gson:2.10.1") + +} + +configure { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + + sourceSets { + getByName("main").java.srcDirs("src/main/kotlin") + } +} \ No newline at end of file diff --git a/klang/buildSrc/settings.gradle.kts b/klang/buildSrc/settings.gradle.kts new file mode 100644 index 00000000..7c693129 --- /dev/null +++ b/klang/buildSrc/settings.gradle.kts @@ -0,0 +1,7 @@ +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} \ No newline at end of file diff --git a/klang/buildSrc/src/main/kotlin/SonatypeCentralUploadPlugin.kt b/klang/buildSrc/src/main/kotlin/SonatypeCentralUploadPlugin.kt new file mode 100644 index 00000000..4fa175b8 --- /dev/null +++ b/klang/buildSrc/src/main/kotlin/SonatypeCentralUploadPlugin.kt @@ -0,0 +1,10 @@ +package klang.publish + +import org.gradle.api.Plugin +import org.gradle.api.Project + +class SonatypeCentralUploadPlugin: Plugin { + override fun apply(project: Project) { + project.tasks.register("sonatypeCentralUpload", SonatypeCentralUploadTask::class.java) + } +} \ No newline at end of file diff --git a/klang/buildSrc/src/main/kotlin/SonatypeCentralUploadTask.kt b/klang/buildSrc/src/main/kotlin/SonatypeCentralUploadTask.kt new file mode 100644 index 00000000..5cd8f07b --- /dev/null +++ b/klang/buildSrc/src/main/kotlin/SonatypeCentralUploadTask.kt @@ -0,0 +1,127 @@ +package klang.publish + +import klang.publish.utils.* +import org.gradle.api.DefaultTask +import org.gradle.api.file.FileCollection +import org.gradle.api.provider.Property +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Optional +import org.gradle.api.tasks.TaskAction +import java.io.File +import java.nio.file.Files +import kotlin.io.path.deleteExisting +import kotlin.io.path.exists + + +abstract class SonatypeCentralUploadTask: DefaultTask() { + + @get:Input + abstract val username: Property + + @get:Input + abstract val password: Property + + @get:Input + @get:Optional + abstract val signingKey: Property + + @get:Input + @get:Optional + abstract val signingKeyPassphrase: Property + + @get:Input + @get:Optional + abstract val publicKey: Property + + @get:Input + abstract val archives: Property + + @get:Input + abstract val pom: Property + + @TaskAction + fun run() { + val groupFolder = "${project.group}".replace('.', '/').lowercase() + val sonatypeCentralUploadDir = project.file(project.layout.buildDirectory.dir("sonatype-central-upload")) + val uploadDir = project.file(project.layout.buildDirectory.dir("${sonatypeCentralUploadDir.path}/$groupFolder/${project.name.lowercase()}/${project.version}")) + if (username.orNull?.isBlank() == true) { + throw IllegalStateException("'username' is empty. A username is required.") + } + + if (password.orNull?.isBlank() == true) { + throw IllegalStateException("'password' is empty. A password is required.") + } + + if (signingKey.orNull?.isBlank() == true) { + throw IllegalStateException("'signingKey' is empty. A signing key is required.") + } + + if (!archives.isPresent || archives.orNull?.isEmpty == true) { + throw IllegalStateException("'archives' is empty. Archives to upload are required.") + } + + if (!pom.isPresent || pom.orNull == null) { + throw IllegalStateException("'pom' is empty. A pom file is required.") + } + + + if(uploadDir.exists()) { + uploadDir.deleteRecursively() + } + + // Create upload dir + uploadDir.mkdirs() + + // Get all artifacts + val artifacts = archives.orNull ?: emptyList() + + // Copy artifacts to upload dir + for(artifact in artifacts) { + if(!artifact.nameWithoutExtension.startsWith("${project.name.lowercase()}-${project.version}")) { + throw IllegalStateException("Artifact name '${artifact.name}' does not match or does not start with project name '${project.name.lowercase()}-${project.version}'.") + } + val artifactFile = artifact.toPath() + val uploadFile = uploadDir.toPath().resolve(artifactFile.fileName) + Files.copy(artifactFile, uploadFile) + } + + val pomFile = pom.orNull ?: throw NullPointerException("Pom file is null.") + Files.copy(pomFile.toPath(), uploadDir.toPath().resolve("${project.name.lowercase()}-${project.version}.pom")) + + if (publicKey.orNull?.isNotBlank() == true) { + val publicKey = publicKey.orNull ?: "" + val pkToDistribute = if(publicKey.startsWith("-----BEGIN PGP") && publicKey.contains("KEY BLOCK-----")) { + publicKey.replace("\\n", "\n") + } else if (File(publicKey).exists()) { + File(uploadDir, "public.key").readText().replace("\\n", "\n") + } else { + throw IllegalStateException("'publicKey' is not a file or a key block.") + } + + sendKeyToServer(pkToDistribute) + } + + // Generate signatures for all files + for(file in uploadDir.listFiles() ?: emptyArray()) { + signFile( + file = file, + signingKey = signingKey.orNull ?: "", + signingPassword = signingKeyPassphrase.orNull ?: "" + ) + } + + // Generate checksums for all files (filter out .asc files) + for (file in (uploadDir.listFiles() ?: emptyArray()).filter { it.extension != "asc" }) { + generateChecksums(file) + } + + // Now we need to zip all the contents of 'sonatype-central-upload' + val zipFile = File(sonatypeCentralUploadDir, "${project.name.lowercase()}-${project.version}.zip") + zipFolder(File(sonatypeCentralUploadDir, groupFolder.split('/').first()), zipFile) + + initPublishingProcess(zipFile, username.orNull ?: "", password.orNull ?: "") + } + + + +} \ No newline at end of file diff --git a/klang/buildSrc/src/main/kotlin/utils/CheckSum.kt b/klang/buildSrc/src/main/kotlin/utils/CheckSum.kt new file mode 100644 index 00000000..83541fcf --- /dev/null +++ b/klang/buildSrc/src/main/kotlin/utils/CheckSum.kt @@ -0,0 +1,22 @@ +package klang.publish.utils + +import java.io.File +import java.security.MessageDigest + +/** + * Generates the checksums for the given file. + * @param file The file to generate the checksums for. + * + * @return A list of files containing the checksums. + */ +fun generateChecksums(file: File): List = mutableListOf().apply { + listOf("MD5", "SHA-1", "SHA-256", "SHA-512").forEach { algorithm -> + MessageDigest.getInstance(algorithm).let { digest -> + digest.reset() + digest.update(file.readBytes()) + add(File(file.parentFile, "${file.name}.${algorithm.lowercase().replace("-", "")}").apply { + writeText(digest.digest().joinToString("") { byte -> "%02x".format(byte) }) + }) + } + } +} \ No newline at end of file diff --git a/klang/buildSrc/src/main/kotlin/utils/Signing.kt b/klang/buildSrc/src/main/kotlin/utils/Signing.kt new file mode 100644 index 00000000..b20025cc --- /dev/null +++ b/klang/buildSrc/src/main/kotlin/utils/Signing.kt @@ -0,0 +1,79 @@ +package klang.publish.utils + + +import org.pgpainless.sop.SOPImpl +import java.io.File +import java.net.URL +import java.net.URLEncoder +import javax.net.ssl.HttpsURLConnection + +/** + * Sign the given file and return the signed file. + * @param file The file to sign. + * @param signingKey The signing key. + * @param signingPassword The signing password. + * + * @return The signed file, or null if an error occurred. + */ +fun signFile(file: File, signingKey: String, signingPassword: String): File? = try { + val signedFile = File(file.parentFile, "${file.name}.asc") + val keyBytes = if(signingKey.startsWith("-----BEGIN PGP") && signingKey.contains("KEY BLOCK-----")) { + signingKey.replace("\\n", "\n") + .toByteArray() + } else if (File(signingKey).exists()) { + File(signingKey).readText() + .replace("\\n", "\n") + .toByteArray() + } else { + throw IllegalStateException("Signing key is not a file or a key block.") + } + + SOPImpl() + .detachedSign() + .key(keyBytes) + .let { sign -> + if(signingPassword.isNotBlank()) { + sign.withKeyPassword(signingPassword) + } + sign + } + .data(file.readBytes()) + .writeTo(signedFile.outputStream()) + + signedFile +} catch (e: Exception) { + e.printStackTrace() + null +} + +/** + * Sends the given public key to the key server. + * @param key The public key to send. + */ +fun sendKeyToServer(key: String) = try { + val url = URL("https://keyserver.ubuntu.com/pks/add") + val connection = url.openConnection() as HttpsURLConnection + connection.requestMethod = "POST" + connection.addRequestProperty("Content-Type", "application/x-www-form-urlencoded") + connection.doOutput = true + connection.outputStream.write("keytext=${URLEncoder.encode(key, Charsets.UTF_8.name())}".toByteArray(Charsets.UTF_8)) + + connection.connect() + val responseCode = connection.responseCode + if(responseCode != HttpsURLConnection.HTTP_OK) { + System.err.println("Failed to send key to server. Response code: ${connection.responseCode}") + } + + if(System.getenv("SONATYPECENTRALUPLOAD_DEBUG") != null) { + println("Response code: $responseCode") + println("Response message: ${connection.responseMessage}") + println("Response body: ${connection.inputStream.bufferedReader().readText()}") + } + + connection.disconnect() +} catch (e: Exception) { + if(System.getenv("SONATYPECENTRALUPLOAD_DEBUG") != null) { + e.printStackTrace() + } + System.err.println("Failed to send key to server.") +} \ No newline at end of file diff --git a/klang/buildSrc/src/main/kotlin/utils/Upload.kt b/klang/buildSrc/src/main/kotlin/utils/Upload.kt new file mode 100644 index 00000000..e9c799f9 --- /dev/null +++ b/klang/buildSrc/src/main/kotlin/utils/Upload.kt @@ -0,0 +1,131 @@ +package klang.publish.utils + +import com.google.gson.JsonParser +import java.io.File +import java.net.URI +import java.net.URL +import java.util.* +import javax.net.ssl.HttpsURLConnection + +/** + * Initializes the publishing process in Sonatype Central. + * @param file The file to upload. + * @param username The username to use. + * @param password The password to use. + */ +fun initPublishingProcess(file: File, username: String, password: String, automatic: Boolean = false) { + val authorizationHeader = "UserToken ${Base64.getEncoder().encodeToString("$username:$password".toByteArray())}" + + val deploymentId = uploadToCentral(file, authorizationHeader, automatic) + + var loops = 0 + var status: String + do { + status = deploymentStatus(deploymentId, authorizationHeader) + when (status) { + "FAILED" -> { + throw IllegalStateException("Failed to upload to Sonatype Central. Deployment ID: $deploymentId") + } + "VALIDATED" -> { + if (!automatic) { + println("[Sonatype Central Upload] Deployment verified!") + break + } + println("[Sonatype Central Upload] Deployment verified! Now we wait for publishing...") + Thread.sleep(5000) + } + "PUBLISHED" -> { + println("[Sonatype Central Upload] Deployment published!") + } + else -> { + if(loops >= 3) { + // Assume everything is ok + println("[Sonatype Central Upload] Deployment status: $status. Assuming everything is ok. For further information please check your Sonatype Central account (usually it takes 5-7 minutes to publish).") + break + } + + println("[Sonatype Central Upload] Deployment status: $status. Waiting 5 seconds before checking status again...") + loops++ + Thread.sleep(5000) + } + } + } while (status != "PUBLISHED") +} + +/** + * Uploads the given zipFile into Sonatype Central + * @param file The zipFile to upload. + * @param authorizationHeader The authorization header to use. + * @return The deployment id. + */ +private fun uploadToCentral(file: File, authorizationHeader: String, automatic: Boolean): String { + println("[Sonatype Central Upload] Uploading to Sonatype Central...") + val publishingType = when(automatic) { + true -> "AUTOMATIC" + else -> "USER_MANAGED" + } + val url = URI("https://central.sonatype.com/api/v1/publisher/upload?publishingType=$publishingType").toURL() + val connection = url.openConnection() as HttpsURLConnection + connection.requestMethod = "POST" + connection.doOutput = true + connection.setRequestProperty("Authorization", authorizationHeader) + connection.setRequestProperty("Content-Type", "multipart/form-data") + connection.setRequestProperty("Accept", "text/plain") + connection.setRequestProperty("User-Agent", "Gradle Sonatype Central Upload Plugin") + + // Updated content type and modified payload to include "bundle" parameter + val boundary = "*****" + System.currentTimeMillis() + "*****" + connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=$boundary") + + val outputStream = connection.outputStream + val writer = outputStream.bufferedWriter() + + writer.write("--$boundary\r\n") + writer.write("Content-Disposition: form-data; name=\"bundle\"; filename=\"${file.name}\"\r\n") + writer.write("Content-Type: application/octet-stream\r\n\r\n") + writer.flush() + + file.inputStream().copyTo(outputStream) + + writer.write("\r\n--$boundary--\r\n") + writer.flush() + + writer.close() + outputStream.close() + + connection.connect() + + if (connection.responseCode != 201) { + throw IllegalStateException("Failed to upload to Sonatype Central. Response code: ${connection.responseCode}. Response message: ${connection.responseMessage}.") + } + + val deploymentId = String(connection.inputStream.readAllBytes(), Charsets.UTF_8) + println("[Sonatype Central Upload] Successfully uploaded to Sonatype Central. Deployment ID: $deploymentId") + return deploymentId +} + +/** + * Gets the status of the given deployment + * @param deploymentId The deployment id to check. + * @param authorizationHeader The authorization header to use. + * @return The status of the deployment. + */ +private fun deploymentStatus(deploymentId: String, authorizationHeader: String): String { + println("[Sonatype Central Upload] Checking status of deployment...") + val statusUrl = URL("https://central.sonatype.com/api/v1/publisher/status?id=$deploymentId") + val statusConnection = statusUrl.openConnection() as HttpsURLConnection + statusConnection.requestMethod = "POST" + statusConnection.setRequestProperty("Authorization", authorizationHeader) + statusConnection.setRequestProperty("Content-Type", "application/json") + statusConnection.setRequestProperty("Accept", "application/json") + statusConnection.setRequestProperty("User-Agent", "Gradle Sonatype Central Upload Plugin") + statusConnection.connect() + + if(statusConnection.responseCode != 200) { + throw IllegalStateException("Failed to get status of deployment. Response code: ${statusConnection.responseCode}. Response message: ${statusConnection.responseMessage}.") + } + + val response = String(statusConnection.inputStream.readAllBytes(), Charsets.UTF_8) + val json = JsonParser.parseString(response).asJsonObject + return json["deploymentState"].asString +} \ No newline at end of file diff --git a/klang/buildSrc/src/main/kotlin/utils/Zip.kt b/klang/buildSrc/src/main/kotlin/utils/Zip.kt new file mode 100644 index 00000000..3f27616b --- /dev/null +++ b/klang/buildSrc/src/main/kotlin/utils/Zip.kt @@ -0,0 +1,17 @@ +package klang.publish.utils + +import net.lingala.zip4j.ZipFile +import java.io.File +import java.nio.file.Files + +/** + * Creates a zip of the given folder + * @param folder The folder to zip. + * @param output The zip file to create. + */ +fun zipFolder(folder: File, output: File) { + Files.deleteIfExists(output.toPath()) + val zip = ZipFile(output.absolutePath) + zip.addFolder(folder) + zip.close() +} \ No newline at end of file diff --git a/klang/gradle-plugin/src/main/kotlin/io/ygdrasil/KlangPlugin.kt b/klang/gradle-plugin/src/main/kotlin/io/ygdrasil/KlangPlugin.kt index 078e8ca3..fcc272b8 100644 --- a/klang/gradle-plugin/src/main/kotlin/io/ygdrasil/KlangPlugin.kt +++ b/klang/gradle-plugin/src/main/kotlin/io/ygdrasil/KlangPlugin.kt @@ -2,54 +2,71 @@ package io.ygdrasil import klang.DeclarationRepository import klang.InMemoryDeclarationRepository -import klang.domain.NativeEnumeration -import klang.domain.NativeFunction -import klang.domain.NativeStructure -import klang.domain.NativeTypeAlias -import klang.generator.generateKotlinFile +import klang.generator.JnaBindingGenerator.generateKotlinFiles +import klang.helper.HeaderManager +import klang.helper.doesNotExists +import klang.helper.isDirectoryEmpty +import klang.helper.unzip import klang.parser.json.parseAstJson +import klang.parser.libclang.parseFile import klang.tools.generateAstFromDocker import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.Task import org.slf4j.LoggerFactory import java.io.File -import java.io.FileInputStream import java.net.URL import java.nio.file.Files +import java.nio.file.Path import java.nio.file.StandardCopyOption import java.security.MessageDigest -import java.util.zip.ZipInputStream -private val logger = LoggerFactory.getLogger("some-logger") +private val logger = LoggerFactory.getLogger("klang-logger") private val hasher by lazy { MessageDigest.getInstance("MD5") } private const val taskGroup = "klang" +val noMacros = mapOf() + +enum class ParsingMethod { + Docker, + Libclang +} + internal sealed class KlangPluginTask { // TODO use a value object instead of a string class DownloadFile(val sourceUrl: URL, val targetFile: String) : KlangPluginTask() + // TODO use a value object instead of a string class Unpack(val sourceFile: String, val targetPath: String) : KlangPluginTask() + // TODO use a value object instead of a string - class Parse(val sourceFile: String, val sourcePath: String, val onSuccess: DeclarationRepository.() -> Unit) : KlangPluginTask() + class Parse(val sourceFile: String, val sourcePath: String, val macros: Map, val onSuccess: DeclarationRepository.() -> Unit) : + KlangPluginTask() + // TODO use a value object instead of a string class GenerateBinding(val basePackage: String, val libraryName: String) : KlangPluginTask() } open class KlangPluginExtension { internal val tasks = mutableListOf() - internal var declarations: DeclarationRepository = InMemoryDeclarationRepository() + internal val declarations: DeclarationRepository = InMemoryDeclarationRepository() + var parsingMethod = ParsingMethod.Docker @Suppress("unused") fun unpack(urlToUnpack: String) = urlToUnpack .hash .also { hash -> tasks.add(KlangPluginTask.Unpack(urlToUnpack, hash)) } + @Suppress("unused") + fun parse(fileToParse: String, at: String, macros: Map, onSuccess: DeclarationRepository.() -> Unit = {}) { + tasks.add(KlangPluginTask.Parse(fileToParse, at, macros, onSuccess)) + } + @Suppress("unused") fun parse(fileToParse: String, at: String, onSuccess: DeclarationRepository.() -> Unit = {}) { - tasks.add(KlangPluginTask.Parse(fileToParse, at, onSuccess)) + parse(fileToParse, at, noMacros, onSuccess) } @Suppress("unused") @@ -70,14 +87,31 @@ class KlangPlugin : Plugin { private val Project.workingDirectory: File get() = buildDir.resolve("klang").also { it.mkdirs() } + private val Project.cHeadersDirectory: File + get() = workingDirectory.resolve("c-headers") + + private val Project.platformSpecificHeadersDirectory: File + get() = workingDirectory.resolve("platform-headers") + override fun apply(project: Project) { val extension = project.extensions.create("klang", KlangPluginExtension::class.java) + val unpackCHeader = project.unpackCHeaderTask() val downloadFile = project.downloadTask(extension) val unpackFile = project.unpackTask(downloadFile, extension) - val generateAst = project.generateAstTask(unpackFile, extension) - val generateBinding = project.task("generateBinding") { task -> - task.dependsOn(generateAst) + val generateAst = project.generateAstTask(unpackFile, extension).apply { + dependsOn(unpackCHeader) + } + val generateBinding = generateBindingTask(project, extension).apply { + dependsOn(generateAst) + } + + listOf(downloadFile, unpackFile, generateAst, generateBinding, unpackCHeader) + .forEach { it.group = taskGroup } + } + + private fun generateBindingTask(project: Project, extension: KlangPluginExtension): Task = + project.task("generateBinding") { task -> task.doFirst { extension.tasks .asSequence() @@ -96,10 +130,6 @@ class KlangPlugin : Plugin { } } - listOf(downloadFile, unpackFile, generateAst, generateBinding) - .forEach { it.group = taskGroup } - } - private fun Project.generateAstTask( unpackFile: Task, extension: KlangPluginExtension, @@ -109,23 +139,37 @@ class KlangPlugin : Plugin { extension.tasks .asSequence() .filterIsInstance() - .map { Triple(it.sourceFile, workingDirectory.resolve(it.sourcePath), it.onSuccess) } - .forEach { (fileToParse, sourcePath, onSuccess) -> - val localFileToParse = File(fileToParse) - assert(localFileToParse.exists()) { "File to parse does not exist" } - assert(localFileToParse.isFile()) { "${localFileToParse.absolutePath} is not a file" } - assert(localFileToParse.canRead()) { "${localFileToParse.absolutePath} is not readable" } - assert(localFileToParse.length() > 0) { "${localFileToParse.absolutePath} is empty" } - - val jsonFile = workingDirectory.resolve("${fileToParse.hash}.json") - generateAstFromDocker( - sourcePath = sourcePath.absolutePath, - sourceFile = fileToParse, - clangJsonAstOutput = jsonFile - ) - - extension.declarations = parseAstJson(jsonFile.absolutePath) - .also { it.resolveTypes() } + //.map { Triple(it.sourceFile, workingDirectory.resolve(it.sourcePath), it.onSuccess) } + .forEach { //(fileToParse, sourcePath, onSuccess) -> + val fileToParse = it.sourceFile + val sourcePath = workingDirectory.resolve(it.sourcePath) + val onSuccess = it.onSuccess + val localFileToParse = Path.of(sourcePath.absolutePath).resolve(fileToParse).toFile() + check(localFileToParse.exists()) { "${localFileToParse.absolutePath} to parse does not exist" } + check(localFileToParse.isFile()) { "${localFileToParse.absolutePath} is not a file" } + check(localFileToParse.canRead()) { "${localFileToParse.absolutePath} is not readable" } + check(localFileToParse.length() > 0) { "${localFileToParse.absolutePath} is empty" } + + when (extension.parsingMethod) { + ParsingMethod.Docker -> { + val jsonFile = workingDirectory.resolve("${fileToParse.hash}.json") + generateAstFromDocker( + sourcePath = sourcePath.absolutePath, + sourceFile = fileToParse, + clangJsonAstOutput = jsonFile + ) + parseAstJson(jsonFile.absolutePath) + } + + ParsingMethod.Libclang -> { + extension.declarations.parseFile( + fileToParse, + sourcePath.absolutePath, + HeaderManager.listPlatformHeadersFromPath(cHeadersDirectory.toPath()), + it.macros + ) + } + }.also { it.resolveTypes() } with(extension.declarations) { onSuccess() @@ -165,67 +209,17 @@ class KlangPlugin : Plugin { } } - private fun unzip(sourceFile: File, targetPath: File) { - ZipInputStream(FileInputStream(sourceFile)).use { - var entry = it.nextEntry - while (entry != null) { - val file = File(targetPath, entry.name) - if (entry.isDirectory) { - file.mkdirs() - } else { - file.parentFile.mkdirs() - file.outputStream().use { output -> - it.copyTo(output) - } - } - entry = it.nextEntry - } + private fun Project.unpackCHeaderTask(): Task = task("unpackCHeader") { task -> + task.onlyIf { cHeadersDirectory.doesNotExists() || cHeadersDirectory.isDirectoryEmpty() } + task.doFirst { + cHeadersDirectory.deleteRecursively() + cHeadersDirectory.mkdirs() + HeaderManager.putPlatformHeaderAt(cHeadersDirectory.toPath()) } } -} -private fun DeclarationRepository.generateKotlinFiles(outputDirectory: File, basePackage: String, libraryName: String) { - - outputDirectory.deleteRecursively() - outputDirectory.mkdirs() - - declarations - .filterIsInstance() - .generateKotlinFile(outputDirectory, basePackage) - - declarations.asSequence() - .filterIsInstance() - .removeCNativeFunctions() - .toList() - .generateKotlinFile(outputDirectory, basePackage, libraryName) - - declarations.asSequence() - .filterIsInstance() - .filter { it.name.startsWith("__").not() } - .filter { it.typeRef.typeName.startsWith("__").not() } - .filter { findStructureByName(it.typeRef.typeName) == null } - .filter { findEnumerationByName(it.typeRef.typeName) == null } - .toList() - .generateKotlinFile(outputDirectory, basePackage) - - declarations.asSequence() - .filterIsInstance() - .filter { it.name.startsWith("__").not() } - .filter { it.fields.none { (name, field) -> name.startsWith("__") || field.typeName.startsWith("__") } } - .toList() - .generateKotlinFile(outputDirectory, basePackage) } -// TODO find a better way to do that -// Skip specific C functions -private fun Sequence.removeCNativeFunctions(): Sequence = - filter { function -> - function.name.startsWith("__").not() && function.name.startsWith("_") - .not() && function.arguments - .mapNotNull { it.name } - .none { name -> name.startsWith("__") && name.startsWith("_") } - } - private val String.hash get() = toByteArray() .let(hasher::digest) @@ -249,5 +243,4 @@ fun downloadFile(fileUrl: URL, targetFile: File): File? = try { } catch (e: Exception) { logger.error("An error occurred: ${e.message}") null -} - +} \ No newline at end of file diff --git a/klang/gradle.properties b/klang/gradle.properties new file mode 100644 index 00000000..de166998 --- /dev/null +++ b/klang/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Xmx2g \ No newline at end of file diff --git a/klang/gradle/libs.versions.toml b/klang/gradle/libs.versions.toml index ebc9d4b3..3678e8bf 100644 --- a/klang/gradle/libs.versions.toml +++ b/klang/gradle/libs.versions.toml @@ -2,6 +2,7 @@ arrow = "1.2.0" kotest = "5.6.1" kotlinpoet = "1.14.2" +kotlin = "1.9.22" [libraries] arrow-core = { module = "io.arrow-kt:arrow-core", version.ref = "arrow" } diff --git a/klang/gradle/wrapper/gradle-wrapper.jar b/klang/gradle/wrapper/gradle-wrapper.jar index 7f93135c..d64cd491 100644 Binary files a/klang/gradle/wrapper/gradle-wrapper.jar and b/klang/gradle/wrapper/gradle-wrapper.jar differ diff --git a/klang/gradle/wrapper/gradle-wrapper.properties b/klang/gradle/wrapper/gradle-wrapper.properties index 1af9e093..a80b22ce 100644 --- a/klang/gradle/wrapper/gradle-wrapper.properties +++ b/klang/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/klang/jextract/build.gradle.kts b/klang/jextract/build.gradle.kts new file mode 100644 index 00000000..1838c436 --- /dev/null +++ b/klang/jextract/build.gradle.kts @@ -0,0 +1,57 @@ +import org.jetbrains.kotlin.de.undercouch.gradle.tasks.download.Download + +plugins { + id("de.undercouch.download") version "4.1.2" +} + +dependencies { + implementation("io.github.microutils:kotlin-logging:1.7.4") + implementation("org.slf4j:slf4j-simple:1.7.26") + testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation(libs.kotest) +} + +tasks.test { + useJUnitPlatform() +} + +tasks.withType().configureEach { + options.compilerArgs.add("--enable-preview") +} + +tasks.withType().configureEach { + val javadocOptions = options as CoreJavadocOptions + javadocOptions.addBooleanOption("-enable-preview", true) + javadocOptions.addStringOption("source", "21") +} + +task("runTest", JavaExec::class) { + jvmArgs( + "--enable-preview", + "--enable-native-access=ALL-UNNAMED" + ) + systemProperties("java.library.path" to "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib") + classpath = sourceSets["main"].runtimeClasspath + mainClass = "klang.TestKt" +} + +val baseUrl = "https://github.com/klang-toolkit/libclang-binary/releases/download/15/" +val fileToDownload = listOf( + "libclang-arm64.dylib", + "libclang-x86_64.dylib", + "libclang-x86_64.so", + "libclang-arm64.so", +).forEach { fileName -> + val url = "$baseUrl$fileName" + val taskName = "downloadFile-$fileName" + tasks.register(taskName) { + val directory = project.file("src/main/resources") + onlyIf { !directory.resolve(fileName).exists() } + src(url) + dest(directory) + } + + tasks.named("processResources") { + dependsOn(taskName) + } +} \ No newline at end of file diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/Declaration.java b/klang/jextract/src/main/java/org/openjdk/jextract/Declaration.java new file mode 100644 index 00000000..3d149d1c --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/Declaration.java @@ -0,0 +1,586 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract; + +import java.lang.constant.Constable; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.impl.DeclarationImpl; + +/** + * Instances of this class are used to model declaration elements in the foreign language. + * All declarations have a position (see {@link Position}) and a name. Instances of this class + * support the visitor pattern (see {@link Declaration#accept(Visitor, Object)} and + * {@link Visitor}). + */ +public interface Declaration { + + /** + * The position associated with this declaration. + * @return The position associated with this declaration. + */ + Position pos(); + + /** + * The name associated with this declaration. + * @return The name associated with this declaration. + */ + String name(); + + /** + * Get a declaration with specified attribute. + * Set the values to the specified attribute while other attributes remains unchanged. If the specified attribute + * already exist, the new values are replacing the old ones. By not specifying any value, the attribute will become + * empty as {@link #getAttribute(String) getAttribute(name).isEmpty()} will return true. + * @param name The attribute name + * @param values More attribute values + * @return the Declaration with attributes + */ + Declaration withAttribute(String name, Constable... values); + + /** + * Get a declaration without current attributes + * @return the Declatation without any attributes + */ + Declaration stripAttributes(); + + /** + * The values of the specified attribute. + * @param name The attribute to retrieve + * @return The list of values associate with this attribute + */ + Optional> getAttribute(String name); + + /** + * The attributes associated with this declaration + * @return The attributes associated with this declaration + */ + Set attributeNames(); + + /** + * Entry point for visiting declaration instances. + * @param visitor the declaration visitor. + * @param data optional data to be passed to the visitor. + * @param the visitor's return type. + * @param the visitor's argument type. + * @return the result of visiting this declaration through the specified declaration visitor. + */ + R accept(Visitor visitor, D data); + + /** + * Compares the specified object with this Declaration for equality. Returns + * {@code true} if and only if the specified object is also a Declaration and both + * the declarations are equal. + * + * @param o the object to be compared for equality with this Declaration + * @return {@code true} if the specified object is equal to this Declaration + */ + boolean equals(Object o); + + /** + * Returns the hash code value for this Declaration. + * + * @return the hash code value for this Declaration. + */ + int hashCode(); + + /** + * A function declaration. + */ + interface Function extends Declaration { + /** + * The parameters associated with this function declaration. + * @return The parameters associated with this function declaration. + */ + List parameters(); + + /** + * The foreign type associated with this function declaration. + * @return The foreign type associated with this function declaration. + */ + Type.Function type(); + } + + /** + * A scoped declaration is a container for one or more nested declarations. This declaration can be used to model + * several constructs in the foreign languages, such as (but not limited to) structs, unions and structs (see also + * {@link Scoped.Kind}). + */ + interface Scoped extends Declaration { + + /** + * The scoped declaration kind. + */ + enum Kind { + /** + * Namespace declaration. + */ + NAMESPACE, + /** + * Class declaration. + */ + CLASS, + /** + * Enum declaration. + */ + ENUM, + /** + * Struct declaration. + */ + STRUCT, + /** + * Union declaration. + */ + UNION, + /** + * Bitfields declaration. + */ + BITFIELDS, + /** + * Toplevel declaration. + */ + TOPLEVEL; + } + + /** + * The member declarations associated with this scoped declaration. + * @return The member declarations associated with this scoped declaration. + */ + List members(); + + /** + * The (optional) layout associated with this scoped declaration. + * @return The (optional) layout associated with this scoped declaration. + * + * implSpec a layout is present if the scoped declaration kind is one of {@link Kind#STRUCT}, {@link Kind#UNION}, + * {@link Kind#ENUM}, {@link Kind#BITFIELDS}, {@link Kind#CLASS} and if this declaration models an entity in the foreign + * language that is associated with a definition. + */ + Optional layout(); + + /** + * The scoped declaration kind. + * @return The scoped declaration kind. + */ + Kind kind(); + } + + /** + * A typedef declaration + */ + interface Typedef extends Declaration { + /** + * The canonical type associated with this typedef declaration. + * @return The canonical type associated with this typedef declaration. + */ + Type type(); + } + + /** + * A variable declaration. + */ + interface Variable extends Declaration { + /** + * The variable declaration kind. + */ + enum Kind { + /** + * Global variable declaration. + */ + GLOBAL, + /** + * Field declaration. + */ + FIELD, + /** + * Bitfield declaration. + */ + BITFIELD, + /** + * Function parameter declaration. + */ + PARAMETER; + } + + /** + * The type associated with this variable declaration. + * @return The type associated with this variable declaration. + */ + Type type(); + + /** + * The kind associated with this variable declaration. + * @return The kind associated with this variable declaration. + */ + Kind kind(); + } + + /** + * A bitfield declaration. Same as a variable declaration, but doesn't have a layout. Instead, it has + * an offset (relative to the enclosing container) and a width. + */ + interface Bitfield extends Variable { + /** + * {@return The bitfield offset (relative to the enclosing container)} + */ + long offset(); + + /** + * {@return The bitfield width (in bits)} + */ + long width(); + } + + /** + * A constant value declaration. + */ + interface Constant extends Declaration { + /** + * The value associated with this constant declaration. + * @return The value associated with this constant declaration. + */ + Object value(); + + /** + * The type associated with this constant declaration. + * @return The type associated with this constant declaration. + */ + Type type(); + } + + /** + * Declaration visitor interface. + * @param the visitor's return type. + * @param

the visitor's parameter type. + */ + interface Visitor { + /** + * Visit a scoped declaration. + * @param d the scoped declaration. + * @param p the visitor parameter. + * @return the result of visiting the given scoped declaration through this visitor object. + */ + default R visitScoped(Scoped d, P p) { return visitDeclaration(d, p); } + + /** + * Visit a function declaration. + * @param d the function declaration. + * @param p the visitor parameter. + * @return the result of visiting the given function declaration through this visitor object. + */ + default R visitFunction(Function d, P p) { return visitDeclaration(d, p); } + + /** + * Visit a variable declaration. + * @param d the variable declaration. + * @param p the visitor parameter. + * @return the result of visiting the given variable declaration through this visitor object. + */ + default R visitVariable(Variable d, P p) { return visitDeclaration(d, p); } + + /** + * Visit a constant declaration. + * @param d the constant declaration. + * @param p the visitor parameter. + * @return the result of visiting the given constant declaration through this visitor object. + */ + default R visitConstant(Constant d, P p) { return visitDeclaration(d, p); } + + /** + * Visit a typedef declaration. + * @param d the typedef declaration. + * @param p the visitor parameter. + * @return the result of visiting the given typedef declaration through this visitor object. + */ + default R visitTypedef(Typedef d, P p) { return visitDeclaration(d, p); } + + /** + * Visit a declaration. + * @param d the declaration. + * @param p the visitor parameter. + * @return the result of visiting the given declaration through this visitor object. + */ + default R visitDeclaration(Declaration d, P p) { throw new UnsupportedOperationException(); } + } + + /** + * Creates a new constant declaration with given name and type. + * @param pos the constant declaration position. + * @param name the constant declaration name. + * @param value the constant declaration value. + * @param type the constant declaration type. + * @return a new constant declaration with given name and type. + */ + static Declaration.Constant constant(Position pos, String name, Object value, Type type) { + return new DeclarationImpl.ConstantImpl(type, value, name, pos); + } + + /** + * Creates a new global variable declaration with given name and type. + * @param pos the global variable declaration position. + * @param name the global variable declaration name. + * @param type the global variable declaration type. + * @return a new global variable declaration with given name and type. + */ + static Declaration.Variable globalVariable(Position pos, String name, Type type) { + return new DeclarationImpl.VariableImpl(type, Declaration.Variable.Kind.GLOBAL, name, pos); + } + + /** + * Creates a new field declaration with given name and type. + * @param pos the field declaration position. + * @param name the field declaration name. + * @param type the field declaration type. + * @return a new field declaration with given name and type. + */ + static Declaration.Variable field(Position pos, String name, Type type) { + return new DeclarationImpl.VariableImpl(type, Declaration.Variable.Kind.FIELD, name, pos); + } + + /** + * Creates a new bitfield declaration with given name, type, offset and width. + * @param pos the bitfield declaration position. + * @param name the bitfield declaration name. + * @param type the bitfield declaration type. + * @param offset the offset of the bitfield (relative to the enclosing container). + * @param width the bitfield width. + * @return a new bitfield declaration with given name, type and layout. + */ + static Declaration.Variable bitfield(Position pos, String name, Type type, long offset, long width) { + return new DeclarationImpl.BitfieldImpl(type, offset, width, name, pos); + } + + /** + * Creates a new parameter declaration with given name and type. + * @param pos the parameter declaration position. + * @param name the parameter declaration name. + * @param type the parameter declaration type. + * @return a new parameter declaration with given name and type. + */ + static Declaration.Variable parameter(Position pos, String name, Type type) { + return new DeclarationImpl.VariableImpl(type, Declaration.Variable.Kind.PARAMETER, name, pos); + } + + /** + * Creates a new variable declaration with given kind, name and type. + * @param kind the variable declaration kind. + * @param pos the variable declaration position. + * @param name the variable declaration name. + * @param type the variable declaration type. + * @return a new variable declaration with given kind, name and type. + */ + static Declaration.Variable var(Variable.Kind kind, Position pos, String name, Type type) { + return new DeclarationImpl.VariableImpl(type, kind, name, pos); + } + + /** + * Creates a new toplevel declaration with given member declarations. + * @param pos the toplevel declaration position. + * @param decls the toplevel declaration member declarations. + * @return a new toplevel declaration with given member declarations. + */ + static Declaration.Scoped toplevel(Position pos, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(Declaration.Scoped.Kind.TOPLEVEL, declList, "", pos); + } + + /** + * Creates a new namespace declaration with given name and member declarations. + * @param pos the namespace declaration position. + * @param name the namespace declaration name. + * @param decls the namespace declaration member declarations. + * @return a new namespace declaration with given name and member declarations. + */ + static Declaration.Scoped namespace(Position pos, String name, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(Declaration.Scoped.Kind.NAMESPACE, declList, name, pos); + } + + /** + * Creates a new bitfields group declaration with given name and layout. + * @param pos the bitfields group declaration position. + * @param bitfields the bitfields group member declarations. + * @return a new bitfields group declaration with given name and layout. + */ + static Declaration.Scoped bitfields(Position pos, Declaration.Variable... bitfields) { + List declList = List.of(bitfields); + return new DeclarationImpl.ScopedImpl(Declaration.Scoped.Kind.BITFIELDS, declList, "", pos); + } + + /** + * Creates a new struct declaration with given name and member declarations. + * @param pos the struct declaration position. + * @param name the struct declaration name. + * @param decls the struct declaration member declarations. + * @return a new struct declaration with given name, layout and member declarations. + */ + static Declaration.Scoped struct(Position pos, String name, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(Declaration.Scoped.Kind.STRUCT, declList, name, pos); + } + + /** + * Creates a new struct declaration with given name, layout and member declarations. + * @param pos the struct declaration position. + * @param name the struct declaration name. + * @param layout the struct declaration layout. + * @param decls the struct declaration member declarations. + * @return a new struct declaration with given name, layout and member declarations. + */ + static Declaration.Scoped struct(Position pos, String name, MemoryLayout layout, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(Declaration.Scoped.Kind.STRUCT, layout, declList, name, pos); + } + + /** + * Creates a new union declaration with given name and member declarations. + * @param pos the union declaration position. + * @param name the union declaration name. + * @param decls the union declaration member declarations. + * @return a new union declaration with given name and member declarations. + */ + static Declaration.Scoped union(Position pos, String name, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(Scoped.Kind.UNION, declList, name, pos); + } + + /** + * Creates a new union declaration with given name, layout and member declarations. + * @param pos the union declaration position. + * @param name the union declaration name. + * @param layout the union declaration layout. + * @param decls the union declaration member declarations. + * @return a new union declaration with given name, layout and member declarations. + */ + static Declaration.Scoped union(Position pos, String name, MemoryLayout layout, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(Declaration.Scoped.Kind.UNION, layout, declList, name, pos); + } + + /** + * Creates a new class declaration with given name and member declarations. + * @param pos the class declaration position. + * @param name the class declaration name. + * @param decls the class declaration member declarations. + * @return a new class declaration with given name and member declarations. + */ + static Declaration.Scoped class_(Position pos, String name, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(Declaration.Scoped.Kind.CLASS, declList, name, pos); + } + + /** + * Creates a new class declaration with given name, layout and member declarations. + * @param pos the class declaration position. + * @param name the class declaration name. + * @param layout the class declaration layout. + * @param decls the class declaration member declarations. + * @return a new class declaration with given name, layout and member declarations. + */ + static Declaration.Scoped class_(Position pos, String name, MemoryLayout layout, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(Declaration.Scoped.Kind.CLASS, layout, declList, name, pos); + } + + /** + * Creates a new enum declaration with given name and member declarations. + * @param pos the enum declaration position. + * @param name the enum declaration name. + * @param decls the enum declaration member declarations. + * @return a new enum declaration with given name, layout and member declarations. + */ + static Declaration.Scoped enum_(Position pos, String name, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(Declaration.Scoped.Kind.ENUM, declList, name, pos); + } + + /** + * Creates a new enum declaration with given name, layout and member declarations. + * @param pos the enum declaration position. + * @param name the enum declaration name. + * @param layout the enum declaration layout. + * @param decls the enum declaration member declarations. + * @return a new enum declaration with given name, layout and member declarations. + */ + static Declaration.Scoped enum_(Position pos, String name, MemoryLayout layout, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(Declaration.Scoped.Kind.ENUM, layout, declList, name, pos); + } + + /** + * Creates a new scoped declaration with given kind, name and member declarations. + * @param kind the kind of the scoped declaration. + * @param pos the scoped declaration position. + * @param name the scoped declaration name. + * @param decls the scoped declaration member declarations. + * @return a new scoped declaration with given kind, name, layout and member declarations. + */ + static Declaration.Scoped scoped(Scoped.Kind kind, Position pos, String name, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(kind, declList, name, pos); + } + + /** + * Creates a new scoped declaration with given kind, name, layout and member declarations. + * @param kind the kind of the scoped declaration. + * @param pos the scoped declaration position. + * @param name the scoped declaration name. + * @param layout the scoped declaration layout. + * @param decls the scoped declaration member declarations. + * @return a new scoped declaration with given kind, name, layout and member declarations. + */ + static Declaration.Scoped scoped(Scoped.Kind kind, Position pos, String name, MemoryLayout layout, Declaration... decls) { + List declList = List.of(decls); + return new DeclarationImpl.ScopedImpl(kind, layout, declList, name, pos); + } + + /** + * Creates a new function declaration with given name, type and parameter declarations. + * @param pos the function declaration position. + * @param name the function declaration name. + * @param type the function declaration type. + * @param params the function declaration parameter declarations. + * @return a new function declaration with given name, type and parameter declarations. + */ + static Declaration.Function function(Position pos, String name, Type.Function type, Declaration.Variable... params) { + List paramList = List.of(params); + return new DeclarationImpl.FunctionImpl(type, paramList, name, pos); + } + + /** + * Creates a new typedef declaration with given name and declared type. + * @param pos the typedef declaration position. + * @param name the typedef declaration name. + * @param type the typedef type + * @return a new type declaration with given name and declared type. + */ + static Declaration.Typedef typedef(Position pos, String name, Type type) { + return new DeclarationImpl.TypedefImpl(type, name, pos, null); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/JextractTool.java b/klang/jextract/src/main/java/org/openjdk/jextract/JextractTool.java new file mode 100644 index 00000000..b59cd756 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/JextractTool.java @@ -0,0 +1,556 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.jextract; + +import org.openjdk.jextract.clang.LibClang; +import org.openjdk.jextract.impl.ClangException; +import org.openjdk.jextract.impl.CommandLine; +import org.openjdk.jextract.impl.IncludeHelper; +import org.openjdk.jextract.impl.CodeGenerator; +import org.openjdk.jextract.impl.Parser; +import org.openjdk.jextract.impl.Options; +import org.openjdk.jextract.impl.Writer; + +import javax.tools.JavaFileObject; +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.List; +import java.util.Locale; +import java.util.Optional; +import java.util.ResourceBundle; +import java.util.spi.ToolProvider; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * Simple extraction tool which generates a minimal Java API. Such an API consists mainly of static methods, + * where for each native function a static method is added which calls the underlying native method handles. + * Similarly, for struct fields and global variables, static accessors (getter and setter) are generated + * on top of the underlying memory access var handles. For each struct, a static layout field is generated. + */ +public final class JextractTool { + private static final String MESSAGES_RESOURCE = "org.openjdk.jextract.impl.resources.Messages"; + + private static final ResourceBundle MESSAGES_BUNDLE; + static { + MESSAGES_BUNDLE = ResourceBundle.getBundle(MESSAGES_RESOURCE, Locale.getDefault()); + } + + public static final boolean DEBUG = Boolean.getBoolean("jextract.debug"); + public static final Optional PLATFORM_INCLUDE_PATH = inferPlatformIncludePath(); + + // error codes + private static final int SUCCESS = 0; + private static final int OPTION_ERROR = 1; + private static final int INPUT_ERROR = 2; + private static final int CLANG_ERROR = 3; + private static final int RUNTIME_ERROR = 4; + private static final int OUTPUT_ERROR = 5; + + private final PrintWriter out; + private final PrintWriter err; + + private static String format(String msgId, Object... args) { + return new MessageFormat(MESSAGES_BUNDLE.getString(msgId)).format(args); + } + + public JextractTool(PrintWriter out, PrintWriter err) { + this.out = out; + this.err = err; + } + + private static Path generateTmpSource(List headers) { + assert headers.size() > 1; + try { + Path tmpFile = Files.createTempFile("jextract", ".h"); + tmpFile.toFile().deleteOnExit(); + Files.write(tmpFile, headers.stream(). + map(src -> "#include \"" + src + "\""). + collect(Collectors.toList())); + return tmpFile; + } catch (IOException ioExp) { + throw new UncheckedIOException(ioExp); + } + } + + /** + * Parse input files into a toplevel declaration with given options. + * @param parserOptions options to be passed to the parser. + * @return a toplevel declaration. + */ + public static Declaration.Scoped parse(List headers, String... parserOptions) { + Path source = headers.size() > 1? generateTmpSource(headers) : headers.iterator().next(); + return new Parser().parse(source, Stream.of(parserOptions).collect(Collectors.toList())); + } + + public static List generate(Declaration.Scoped decl, String headerName, + String targetPkg, List libNames) { + return List.of(CodeGenerator.generate(decl, headerName, targetPkg, new IncludeHelper(), libNames)); + } + + private static List generateInternal(Declaration.Scoped decl, String headerName, + String targetPkg, IncludeHelper includeHelper, List libNames) { + return List.of(CodeGenerator.generate(decl, headerName, targetPkg, includeHelper, libNames)); + } + + /** + * Write resulting {@link JavaFileObject} instances into specified destination path. + * @param dest the destination path. + * @param compileSources whether to compile .java sources or not + * @param files the {@link JavaFileObject} instances to be written. + */ + public static void write(Path dest, boolean compileSources, List files) throws UncheckedIOException { + try { + new Writer(dest, files).writeAll(compileSources); + } catch (IOException ex) { + throw new UncheckedIOException(ex); + } + } + + private int printHelp(int exitCode) { + err.println(format("jextract.usage")); + return exitCode; + } + + + private void printOptionError(Throwable throwable) { + printOptionError(throwable.getMessage()); + if (DEBUG) { + throwable.printStackTrace(err); + } + } + + private void printOptionError(String message) { + err.println("OPTION ERROR: " + message); + err.println("Usage: jextract

"); + err.println("Use --help for a list of possible options"); + } + + /** + * Main entry point to run the JextractTool + * + * @param args command line options passed + */ + public static void main(String[] args) { + if (args.length == 0) { + System.err.println("Expected a header file"); + return; + } + + JextractTool m = new JextractTool(new PrintWriter(System.out, true), new PrintWriter(System.err, true)); + System.exit(m.run(args)); + } + + + // Option handling code + + // specification for an option + record OptionSpec(String name, List aliases, String help, boolean argRequired) { + } + + private static class OptionException extends RuntimeException { + private static final long serialVersionUID = -1L; + OptionException(String msg) { + super(msg); + } + } + + // output of OptionParser.parse + private static class OptionSet { + private final Map> options; + // non-option arguments + private final List nonOptionArgs; + + OptionSet(Map> options, + List nonOptionArgs) { + this.options = options; + this.nonOptionArgs = nonOptionArgs; + } + + boolean has(String name) { + return options.containsKey(name); + } + + List valuesOf(String name) { + return options.get(name); + } + + String valueOf(String name) { + var values = valuesOf(name); + return values == null? null : values.get(values.size() - 1); + } + + List nonOptionArguments() { + return nonOptionArgs; + } + } + + private static final class OptionParser { + // option name to corresponding OptionSpec mapping + private Map optionSpecs = new HashMap<>(); + + void accepts(String name, String help, boolean argRequired) { + accepts(name, List.of(), help, argRequired); + } + + void accepts(String name, List aliases, String help, boolean argRequired) { + var spec = new OptionSpec(name, aliases, help, argRequired); + optionSpecs.put(name, spec); + for (String alias : aliases) { + optionSpecs.put(alias, spec); + } + } + + // does the string str start like an option? + private boolean isOption(String str) { + return str.length() > 1 && str.charAt(0) == '-'; + } + + // does the string str start like single char option? + private boolean isSingleCharOptionWithArg(String str) { + assert isOption(str); + return str.length() > 2 && str.charAt(1) != '-'; + } + + // option part of single char option + // -lclang => -l, -DFOO -> -D + private String singleCharOption(String str) { + assert isSingleCharOptionWithArg(str); + return str.substring(0, 2); + } + + // argument part of single char option + // -lclang => clang, -DFOO -> FOO + private String singleCharOptionArg(String str) { + assert isSingleCharOptionWithArg(str); + return str.substring(2); + } + + OptionSet parse(String[] args) { + Map> options = new HashMap<>(); + List nonOptionArgs = new ArrayList<>(); + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + // does this look like an option? + if (isOption(arg)) { + OptionSpec spec = optionSpecs.get(arg); + String argValue = null; + // does not match known options directly. + // check for single char option followed + // by option value without whitespace in between. + // Examples: -lclang, -DFOO + if (spec == null ) { + spec = isSingleCharOptionWithArg(arg) ? optionSpecs.get(singleCharOption(arg)) : null; + // we have a matching single char option and that requires argument + if (spec != null && spec.argRequired()) { + argValue = singleCharOptionArg(arg); + } else { + // single char option special handling also failed. give up. + throw new OptionException("invalid option: " + arg); + } + } + // handle argument associated with the current option, if any + List values; + if (spec.argRequired()) { + if (argValue == null) { + if (i == args.length - 1) { + throw new OptionException(spec.help()); + } + argValue = args[i + 1]; + i++; // consume value from next command line arg + } // else -DFOO like case. argValue already set + + // do not allow argument value to start with '-' + // this will catch issues like "-l-lclang", "-l -t" + if (argValue.charAt(0) == '-') { + throw new OptionException(spec.help()); + } + values = options.getOrDefault(spec.name(), new ArrayList()); + values.add(argValue); + } else { + // no argument value associated with this option. + // using empty list to flag that. + values = List.of(); + } + + // set value for the option as well as all its aliases + // so that option lookup, value lookup will work regardless + // which alias was used to check. + options.put(spec.name(), values); + for (String alias : spec.aliases()) { + options.put(spec.name(), values); + } + } else { // !isOption(arg) + nonOptionArgs.add(arg); + } + } + return new OptionSet(options, nonOptionArgs); + } + } + + public int run(String[] args) { + try { + args = CommandLine.parse(Arrays.asList(args)).toArray(new String[0]); + } catch (IOException ioexp) { + err.println(format("argfile.read.error", ioexp)); + if (JextractTool.DEBUG) { + ioexp.printStackTrace(err); + } + return OPTION_ERROR; + } + + OptionParser parser = new OptionParser(); + parser.accepts("-D", List.of("--define-macro"), format("help.D"), true); + parser.accepts("--dump-includes", format("help.dump-includes"), true); + for (IncludeHelper.IncludeKind includeKind : IncludeHelper.IncludeKind.values()) { + parser.accepts("--" + includeKind.optionName(), format("help." + includeKind.optionName()), true); + } + parser.accepts("-h", List.of("-?", "--help"), format("help.h"), false); + parser.accepts("--header-class-name", format("help.header-class-name"), true); + parser.accepts("-I", List.of("--include-dir"), format("help.I"), true); + parser.accepts("-l", List.of("--library"), format("help.l"), true); + parser.accepts("--output", format("help.output"), true); + parser.accepts("--source", format("help.source"), false); + parser.accepts("-t", List.of("--target-package"), format("help.t"), true); + parser.accepts("--version", format("help.version"), false); + + OptionSet optionSet; + try { + optionSet = parser.parse(args); + } catch (OptionException oe) { + printOptionError(oe); + return OPTION_ERROR; + } + + if (optionSet.has("--version")) { + var version = JextractTool.class.getModule().getDescriptor().version(); + err.printf("%s %s\n", "jextract", version.get()); + err.printf("%s %s\n", "JDK version", System.getProperty("java.runtime.version")); + err.printf("%s\n", LibClang.version()); + return SUCCESS; + } + + if (optionSet.has("-h")) { + return printHelp(SUCCESS); + } + + if (optionSet.nonOptionArguments().size() != 1) { + printOptionError("Expected 1 header file, not " + optionSet.nonOptionArguments().size()); + return OPTION_ERROR; + } + + Options.Builder builder = Options.builder(); + // before processing command line options, check & process compile_flags.txt. + Path compileFlagsTxt = Paths.get(".", "compile_flags.txt"); + if (Files.exists(compileFlagsTxt)) { + try { + Files.lines(compileFlagsTxt).forEach(opt -> builder.addClangArg(opt)); + } catch (IOException ioExp) { + err.println("compile_flags.txt reading failed " + ioExp); + if (JextractTool.DEBUG) { + ioExp.printStackTrace(err); + } + return OPTION_ERROR; + } + } + + if (optionSet.has("-D")) { + optionSet.valuesOf("-D").forEach(p -> builder.addClangArg("-D" + p)); + } + + if (optionSet.has("-I")) { + optionSet.valuesOf("-I").forEach(p -> builder.addClangArg("-I" + p)); + } + + Path builtinInc = Paths.get(System.getProperty("java.home"), "conf", "jextract"); + if (Files.isDirectory(builtinInc)) { + builder.addClangArg("-I" + builtinInc); + } + + PLATFORM_INCLUDE_PATH.ifPresent(platformPath -> { + builder.addClangArg("-I" + platformPath); + }); + + String jextractHeaderPath = System.getProperty("jextract.header.path"); + if (jextractHeaderPath != null) { + builtinInc = Paths.get(jextractHeaderPath); + if (Files.isDirectory(builtinInc)) { + builder.addClangArg("-I" + builtinInc); + } + } + + for (IncludeHelper.IncludeKind includeKind : IncludeHelper.IncludeKind.values()) { + if (optionSet.has("--" + includeKind.optionName())) { + optionSet.valuesOf("--" + includeKind.optionName()).forEach(p -> builder.addIncludeSymbol(includeKind, p)); + } + } + + if (optionSet.has("--dump-includes")) { + builder.setDumpIncludeFile(optionSet.valueOf("--dump-includes")); + } + + if (optionSet.has("--output")) { + builder.setOutputDir(optionSet.valueOf("--output")); + } + + if (optionSet.has("--source")) { + builder.setGenerateSource(); + } + boolean librariesSpecified = optionSet.has("-l"); + if (librariesSpecified) { + for (String lib : optionSet.valuesOf("-l")) { + if (lib.indexOf(File.separatorChar) == -1) { + builder.addLibraryName(lib); + } else { + Path libPath = Paths.get(lib); + if (libPath.isAbsolute() && Files.isRegularFile(libPath)) { + builder.addLibraryName(lib); + } else { + err.println(format("l.option.value.invalid", lib)); + return OPTION_ERROR; + } + } + } + } + + String targetPackage = optionSet.has("-t") ? optionSet.valueOf("-t") : ""; + builder.setTargetPackage(targetPackage); + + Options options = builder.build(); + + Path header = Paths.get(optionSet.nonOptionArguments().get(0)); + if (!Files.isReadable(header)) { + err.println(format("cannot.read.header.file", header)); + return INPUT_ERROR; + } + if (!(Files.isRegularFile(header))) { + err.println(format("not.a.file", header)); + return INPUT_ERROR; + } + + List files = null; + try { + Declaration.Scoped toplevel = parse(List.of(header), options.clangArgs.toArray(new String[0])); + + if (JextractTool.DEBUG) { + System.out.println(toplevel); + } + + String headerName = optionSet.has("--header-class-name") ? + optionSet.valueOf("--header-class-name") : + header.getFileName().toString(); + + files = generateInternal( + toplevel, headerName, + options.targetPackage, options.includeHelper, options.libraryNames); + } catch (ClangException ce) { + err.println(ce.getMessage()); + if (JextractTool.DEBUG) { + ce.printStackTrace(err); + } + return CLANG_ERROR; + } catch (RuntimeException re) { + err.println(re.getMessage()); + if (JextractTool.DEBUG) { + re.printStackTrace(err); + } + return RUNTIME_ERROR; + } + + try { + if (options.includeHelper.dumpIncludesFile != null) { + options.includeHelper.dumpIncludes(); + } else { + Path output = Path.of(options.outputDir); + write(output, !options.source, files); + } + } catch (UncheckedIOException uioe) { + err.println(uioe.getMessage()); + if (JextractTool.DEBUG) { + uioe.printStackTrace(err); + } + return OUTPUT_ERROR; + } catch (RuntimeException re) { + err.println(re.getMessage()); + if (JextractTool.DEBUG) { + re.printStackTrace(err); + } + return RUNTIME_ERROR; + } + + return SUCCESS; + } + + /** + * ToolProvider implementation for jextract tool. + */ + public static class JextractToolProvider implements ToolProvider { + public JextractToolProvider() {} + + @Override + public String name() { + return "jextract"; + } + + @Override + public int run(PrintWriter out, PrintWriter err, String... args) { + JextractTool instance = new JextractTool(out, err); + return instance.run(args); + } + } + + private static Optional inferPlatformIncludePath() { + String os = System.getProperty("os.name"); + if (os.equals("Mac OS X")) { + try { + ProcessBuilder pb = new ProcessBuilder(). + command("/usr/bin/xcrun", "--show-sdk-path"); + Process proc = pb.start(); + String str = new String(proc.getInputStream().readAllBytes()); + Path dir = Paths.get(str.trim(), "usr", "include"); + if (Files.isDirectory(dir)) { + return Optional.of(dir); + } + } catch (IOException ioExp) { + if (JextractTool.DEBUG) { + ioExp.printStackTrace(System.err); + } + } + } + + return Optional.empty(); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/Position.java b/klang/jextract/src/main/java/org/openjdk/jextract/Position.java new file mode 100644 index 00000000..a27ab8d6 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/Position.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract; + +import java.nio.file.Path; +import java.util.Objects; + +/** + * Instances of this class model are used to model source code positions. + */ +public interface Position { + + /** + * The input file to which this position refers to. + * @return The input file to which this position refers to. + */ + Path path(); + + /** + * The line number associated with this position. + * @return The line number associated with this position. + */ + int line(); + + /** + * The column number associated with this position. + * @return The column number associated with this position. + */ + int col(); + + /** + * An empty position instance; this can be used to model synthetic program elements which are not + * defined in any input file. + */ + Position NO_POSITION = new Position() { + @Override + public Path path() { + return null; + } + + @Override + public int line() { + return 0; + } + + @Override + public int col() { + return 0; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj instanceof Position pos) { + return Objects.equals(path(), pos.path()) && + Objects.equals(line(), pos.line()) && + Objects.equals(col(), pos.col()); + } + return false; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public String toString() { + return "NO_POSITION"; + } + }; +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/Type.java b/klang/jextract/src/main/java/org/openjdk/jextract/Type.java new file mode 100644 index 00000000..afa3123f --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/Type.java @@ -0,0 +1,531 @@ +/* + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.ValueLayout; +import org.openjdk.jextract.impl.TypeImpl; +import org.openjdk.jextract.impl.UnsupportedLayouts; + +import java.util.List; +import java.util.Optional; +import java.util.OptionalLong; +import java.util.function.Supplier; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * Instances of this class are used to model types in the foreign language. + * Instances of this class support the visitor pattern (see {@link Type#accept(Type.Visitor, Object)} and + * {@link Type.Visitor}). + */ +public interface Type { + + /** + * Is this type the erroneous type? + * @return true, if this type is the erroneous type. + */ + boolean isErroneous(); + + /** + * Entry point for visiting type instances. + * @param visitor the type visitor. + * @param data optional data to be passed to the visitor. + * @param the visitor's return type. + * @param the visitor's argument type. + * @return the result of visiting this type through the specified type visitor. + */ + R accept(Visitor visitor, D data); + + /** + * Compares the specified object with this Type for equality. Returns + * {@code true} if and only if the specified object is also a Type and both + * the Types are equal. + * + * @param o the object to be compared for equality with this Type + * @return {@code true} if the specified object is equal to this Type + */ + boolean equals(Object o); + + /** + * Returns the hash code value for this Type. + * + * @return the hash code value for this Type. + */ + int hashCode(); + + /** + * A primitive type. + */ + interface Primitive extends Type { + + /** + * The primitive type kind. + */ + enum Kind { + /** + * {@code void} type. + */ + Void("void", null), + /** + * {@code Bool} type. + */ + Bool("_Bool", ValueLayout.JAVA_BOOLEAN), + /** + * {@code char} type. + */ + Char("char", ValueLayout.JAVA_BYTE), + /** + * {@code char16} type. + */ + Char16("char16", UnsupportedLayouts.CHAR16), + /** + * {@code short} type. + */ + Short("short", ValueLayout.JAVA_SHORT), + /** + * {@code int} type. + */ + Int("int", ValueLayout.JAVA_INT), + /** + * {@code long} type. + */ + Long("long", TypeImpl.IS_WINDOWS ? + ValueLayout.JAVA_INT : + ValueLayout.JAVA_LONG), + /** + * {@code long long} type. + */ + LongLong("long long", ValueLayout.JAVA_LONG), + /** + * {@code int128} type. + */ + Int128("__int128", UnsupportedLayouts.__INT128), + /** + * {@code float} type. + */ + Float("float", ValueLayout.JAVA_FLOAT), + /** + * {@code double} type. + */ + Double("double", ValueLayout.JAVA_DOUBLE), + /** + * {@code long double} type. + */ + LongDouble("long double", TypeImpl.IS_WINDOWS ? + ValueLayout.JAVA_DOUBLE : + UnsupportedLayouts.LONG_DOUBLE), + /** + * {@code float128} type. + */ + Float128("float128", UnsupportedLayouts._FLOAT128), + /** + * {@code float16} type. + */ + HalfFloat("__fp16", UnsupportedLayouts.__FP16), + /** + * {@code wchar} type. + */ + WChar("wchar_t", UnsupportedLayouts.WCHAR_T); + + private final String typeName; + private final MemoryLayout layout; + + Kind(String typeName, MemoryLayout layout) { + this.typeName = typeName; + this.layout = layout; + } + + public String typeName() { + return typeName; + } + + /** + * The primitive type (optional) layout. + * @return The primitive type (optional) layout. + */ + public Optional layout() { + return Optional.ofNullable(layout); + } + } + + /** + * The primitive type kind. + * @return The primitive type kind. + */ + Kind kind(); + } + + /** + * Instances of this class are used to model types which are associated to a declaration in the foreign language + * (see {@link Declaration}). + */ + interface Declared extends Type { + /** + * The declaration to this type refers to. + * @return The declaration to this type refers to. + */ + Declaration.Scoped tree(); + } + + /** + * A function type. + */ + interface Function extends Type { + /** + * Is this function type a variable-arity? + * @return true, if this function type is a variable-arity. + */ + boolean varargs(); + + /** + * The function formal parameter types. + * @return The function formal parameter types. + */ + List argumentTypes(); + + /** + * The function return type. + * @return The function return type. + */ + Type returnType(); + + /** + * Names of function parameters (from typedef), if any + * @return The optional list of function parameter names. + */ + Optional> parameterNames(); + + /** + * Returns a Function type that has the given parameter names. + * + * @param paramNames parameter names for this function type. + * @return new Function type with the given parameter names. + */ + Function withParameterNames(List paramNames); + } + + /** + * An array type. Array types feature an element type and an optional size. As such they can also be used to + * model array types. + */ + interface Array extends Type { + + /** + * The array type kind. + */ + enum Kind { + /** + * Vector kind. + */ + VECTOR, + /** + * Array kind. + */ + ARRAY, + /** + * Incomplete array kind. + */ + INCOMPLETE_ARRAY; + } + + /** + * The array type kind. + * @return The array type kind. + */ + Kind kind(); + + /** + * The (optional) array element count. + * @return The (optional) array element count. + * + * implSpec an element count is present if the array type kind is one of {@link Kind#VECTOR}, {@link Kind#ARRAY}. + */ + OptionalLong elementCount(); + + /** + * The array type element type. + * @return The array type element type. + */ + Type elementType(); + } + + /** + * A delegated type is used to model a type which contains an indirection to some other underlying type. For instance, + * a delegated type can be used to model foreign pointers, where the indirection is used to model the pointee type. + */ + interface Delegated extends Type { + + /** + * The delegated type kind. + */ + enum Kind { + /** + * Type-defined type. + */ + TYPEDEF, + /** + * Pointer type. + */ + POINTER, + /** + * Signed type. + */ + SIGNED, + /** + * Unsigned type. + */ + UNSIGNED, + /** + * Atomic type. + */ + ATOMIC, + /** + * Volatile type. + */ + VOLATILE, + /** + * Complex type. + */ + COMPLEX; + } + + /** + * The delegated type kind. + * @return The delegated type kind. + */ + Kind kind(); + + /** + * The delegated type (optional) name. + * @return The delegated type (optional) name. + * + * implSpec an element count is present if the array type kind is one of {@link Kind#TYPEDEF}. + */ + Optional name(); + + /** + * The delegated type underlying type. + * @return The delegated type underlying type. + */ + Type type(); + } + + /** + * Type visitor interface. + * @param the visitor's return type. + * @param

the visitor's parameter type. + */ + interface Visitor { + /** + * Visit a primitive type. + * @param t the primitive type. + * @param p the visitor parameter. + * @return the result of visiting the given primitive type through this visitor object. + */ + default R visitPrimitive(Primitive t, P p) { return visitType(t, p); } + + /** + * Visit a function type. + * @param t the function type. + * @param p the visitor parameter. + * @return the result of visiting the given function type through this visitor object. + */ + default R visitFunction(Function t, P p) { return visitType(t, p); } + + /** + * Visit a declared type. + * @param t the declared type. + * @param p the visitor parameter. + * @return the result of visiting the given declared type through this visitor object. + */ + default R visitDeclared(Declared t, P p) { return visitType(t, p); } + + /** + * Visit a delegated type. + * @param t the delegated type. + * @param p the visitor parameter. + * @return the result of visiting the given delegated type through this visitor object. + */ + default R visitDelegated(Delegated t, P p) { return visitType(t, p); } + + /** + * Visit an array type. + * @param t the array type. + * @param p the visitor parameter. + * @return the result of visiting the given array type through this visitor object. + */ + default R visitArray(Array t, P p) { return visitType(t, p); } + + /** + * Visit a type. + * @param t the type. + * @param p the visitor parameter. + * @return the result of visiting the given type through this visitor object. + */ + default R visitType(Type t, P p) { throw new UnsupportedOperationException(); } + } + + /** + * Compute the layout for a given type. + * @param t the type. + * @return the layout for given type. + */ + static Optional layoutFor(Type t) { + return TypeImpl.getLayout(t); + } + + /** + * Compute the function descriptor for a given function type. + * @param function the function type. + * @return the function descriptor for given function type. + */ + static Optional descriptorFor(Function function) { + return TypeImpl.getDescriptor(function); + } + + /** + * Create the {@code void} type. + * @return the {@code void} type. + */ + static Type.Primitive void_() { + return new TypeImpl.PrimitiveImpl(Type.Primitive.Kind.Void); + } + + /** + * Creates a new primitive type given kind. + * @param kind the primitive type kind. + * @return a new primitive type with given kind. + */ + static Type.Primitive primitive(Type.Primitive.Kind kind) { + return new TypeImpl.PrimitiveImpl(kind); + } + + /** + * Creates a new qualified type given kind and underlying type. + * @param kind the qualified type kind. + * @param type the qualified type underlying type. + * @return a new qualified type with given name and underlying type. + */ + static Type.Delegated qualified(Type.Delegated.Kind kind, Type type) { + return new TypeImpl.QualifiedImpl(kind, type); + } + + /** + * Creates a new typedef type given name and underlying type. + * @param name the typedef type name. + * @param aliased the typeef type underlying type. + * @return a new typedef type with given name and underlying type. + */ + static Type.Delegated typedef(String name, Type aliased) { + return new TypeImpl.QualifiedImpl(Delegated.Kind.TYPEDEF, name, aliased); + } + + /** + * Creates a new pointer type with no associated pointee information. + * @return a new pointer type with no associated pointee information. + */ + static Type.Delegated pointer() { + return new TypeImpl.PointerImpl(() -> new TypeImpl.PrimitiveImpl(Type.Primitive.Kind.Void)); + } + + /** + * Creates a new pointer type with given pointee type. + * @param pointee the pointee type. + * @return a new pointer type with given pointee type. + */ + static Type.Delegated pointer(Type pointee) { + return new TypeImpl.PointerImpl(() -> pointee); + } + + /** + * Creates a new pointer type with given pointee type. + * @param pointee factory to (lazily) build the pointee type. + * @return a new pointer type with given pointee type (lazily built from factory). + */ + static Type.Delegated pointer(Supplier pointee) { + return new TypeImpl.PointerImpl(pointee); + } + + /** + * Creates a new function type with given parameter types and return type. + * @param varargs is this function type variable-arity? + * @param returnType the function type return type. + * @param arguments the function type formal parameter types. + * @return a new function type with given parameter types and return type. + */ + static Type.Function function(boolean varargs, Type returnType, Type... arguments) { + return new TypeImpl.FunctionImpl(varargs, Stream.of(arguments).collect(Collectors.toList()), returnType, null); + } + + /** + * Creates a new declared type with given foreign declaration. + * @param tree the foreign declaration the type refers to. + * @return a new declared type with given foreign declaration. + */ + static Type.Declared declared(Declaration.Scoped tree) { + return new TypeImpl.DeclaredImpl(tree); + } + + /** + * Creates a new vector type with given element count and element type. + * @param elementCount the vector type element count. + * @param elementType the vector type element type. + * @return a new vector type with given element count and element type. + */ + static Type.Array vector(long elementCount, Type elementType) { + return new TypeImpl.ArrayImpl(Array.Kind.VECTOR, elementCount, elementType); + } + + /** + * Creates a new array type with given element count and element type. + * @param elementCount the array type element count. + * @param elementType the array type element type. + * @return a new array type with given element count and element type. + */ + static Type.Array array(long elementCount, Type elementType) { + return new TypeImpl.ArrayImpl(Array.Kind.ARRAY, elementCount, elementType); + } + + /** + * Creates a new array type with given element type. + * @param elementType the array type element type. + * @return a new array type with given element type. + */ + static Type.Array array(Type elementType) { + return new TypeImpl.ArrayImpl(Array.Kind.INCOMPLETE_ARRAY, elementType); + } + + /** + * Creates an erroneous type. + * @return an erroneous type. + */ + static Type error() { + return TypeImpl.ERROR; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/CallingConvention.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/CallingConvention.java new file mode 100644 index 00000000..624910ae --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/CallingConvention.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.util.HashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import static org.openjdk.jextract.clang.libclang.Index_h.*; + +public enum CallingConvention { + + Default(CXCallingConv_Default()), + C(CXCallingConv_C()), + X86StdCall(CXCallingConv_X86StdCall()), + X86FastCall(CXCallingConv_X86FastCall()), + X86ThisCall(CXCallingConv_X86ThisCall()), + X86Pascal(CXCallingConv_X86Pascal()), + AAPCS(CXCallingConv_AAPCS()), + AAPCS_VFP(CXCallingConv_AAPCS_VFP()), + PnaclCall(CXCallingConv_X86RegCall()), + IntelOclBicc(CXCallingConv_IntelOclBicc()), + X86_64Win64(CXCallingConv_X86_64Win64()), + X86_64SysV(CXCallingConv_X86_64SysV()), + Invalid(CXCallingConv_Invalid()), + Unexposed(CXCallingConv_Unexposed()); + + private final int value; + + CallingConvention(int value) { + this.value = value; + } + + public int value() { + return value; + } + + private final static Map lookup; + + static { + lookup = new HashMap<>(); + for (CallingConvention e: CallingConvention.values()) { + lookup.put(e.value(), e); + } + } + + public final static CallingConvention valueOf(int value) { + CallingConvention x = lookup.get(value); + if (null == x) { + throw new NoSuchElementException(); + } + return x; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/ClangDisposable.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/ClangDisposable.java new file mode 100644 index 00000000..6992edbf --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/ClangDisposable.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.clang; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.util.function.Consumer; + +/** + * This class models a libclang entity that has an explicit lifecycle (e.g. TranslationUnit, Index). + * This class starts a new confined session and an arena allocator; this arena allocator is used by all + * the abstractions "owned" by this disposable. For instance, as a CXCursor's lifetime is the same as that of + * the CXTranslationUnit's lifetime, cursors are allocated inside the translation unit's lifetime. + */ +public abstract class ClangDisposable implements SegmentAllocator, AutoCloseable { + protected final MemorySegment ptr; + protected final Arena arena; + + public ClangDisposable(MemorySegment ptr, long size, Consumer cleanup) { + this.arena = Arena.ofConfined(); + this.ptr = ptr.reinterpret(size, arena, cleanup).asReadOnly(); + } + + public ClangDisposable(MemorySegment ptr, Consumer cleanup) { + this(ptr, 0, cleanup); + } + + @Override + public void close() { + arena.close(); + } + + @Override + public MemorySegment allocate(long bytesSize, long bytesAlignment) { + return arena.allocate(bytesSize, bytesAlignment); + } + + /** + * A libclang entity owned by some libclang disposable entity. Entities modelled by this class + * do not have their own session; instead, they piggyback on the session of their owner. + */ + static class Owned { + final MemorySegment segment; + final ClangDisposable owner; + + protected Owned(MemorySegment segment, ClangDisposable owner) { + this.segment = segment; + this.owner = owner; + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/Cursor.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/Cursor.java new file mode 100644 index 00000000..738cb398 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/Cursor.java @@ -0,0 +1,292 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.clang; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import org.openjdk.jextract.clang.libclang.CXCursorVisitor; +import org.openjdk.jextract.clang.libclang.Index_h; + +import java.util.function.Consumer; + +public final class Cursor extends ClangDisposable.Owned { + + private final int kind; + + Cursor(MemorySegment segment, ClangDisposable owner) { + super(segment, owner); + kind = Index_h.clang_getCursorKind(segment); + } + + public boolean isDeclaration() { + return Index_h.clang_isDeclaration(kind) != 0; + } + + public boolean isPreprocessing() { + return Index_h.clang_isPreprocessing(kind) != 0; + } + + public boolean isInvalid() { + return Index_h.clang_isInvalid(kind) != 0; + } + + public boolean isDefinition() { + return Index_h.clang_isCursorDefinition(segment) != 0; + } + + public boolean isAttribute() { return Index_h.clang_isAttribute(kind) != 0; } + + public boolean isAnonymousStruct() { + return Index_h.clang_Cursor_isAnonymousRecordDecl(segment) != 0; + } + + public boolean isAnonymous() { + return Index_h.clang_Cursor_isAnonymous(segment) != 0; + } + + public boolean isMacroFunctionLike() { + return Index_h.clang_Cursor_isMacroFunctionLike(segment) != 0; + } + + public String spelling() { + var spelling = Index_h.clang_getCursorSpelling(LibClang.STRING_ALLOCATOR, segment); + return LibClang.CXStrToString(spelling); + } + + public String USR() { + var USR = Index_h.clang_getCursorUSR(LibClang.STRING_ALLOCATOR, segment); + return LibClang.CXStrToString(USR); + } + + public String prettyPrinted(PrintingPolicy policy) { + var prettyOutput = Index_h.clang_getCursorPrettyPrinted(LibClang.STRING_ALLOCATOR, segment, policy.ptr()); + return LibClang.CXStrToString(prettyOutput); + } + + public String prettyPrinted() { + try (PrintingPolicy policy = getPrintingPolicy()) { + return prettyPrinted(policy); + } + } + + public String displayName() { + var displayName = Index_h.clang_getCursorDisplayName(LibClang.STRING_ALLOCATOR, segment); + return LibClang.CXStrToString(displayName); + } + + public boolean equalCursor(Cursor other) { + return Index_h.clang_equalCursors(segment, other.segment) != 0; + } + + public Type type() { + var cursorType = Index_h.clang_getCursorType(owner, segment); + return new Type(cursorType, owner); + } + + public Type getEnumDeclIntegerType() { + var enumType = Index_h.clang_getEnumDeclIntegerType(owner, segment); + return new Type(enumType, owner); + } + + public Cursor getDefinition() { + var cursorDef = Index_h.clang_getCursorDefinition(owner, segment); + return new Cursor(cursorDef, owner); + } + + public boolean isFunctionInlined() { + return Index_h.clang_Cursor_isFunctionInlined(segment) != 0; + } + + public SourceLocation getSourceLocation() { + MemorySegment loc = Index_h.clang_getCursorLocation(owner, segment); + try (Arena arena = Arena.ofConfined()) { + if (Index_h.clang_equalLocations(loc, Index_h.clang_getNullLocation(arena)) != 0) { + return null; + } + } + return new SourceLocation(loc, owner); + } + + public SourceRange getExtent() { + MemorySegment range = Index_h.clang_getCursorExtent(owner, segment); + if (Index_h.clang_Range_isNull(range) != 0) { + return null; + } + return new SourceRange(range, owner); + } + + public int numberOfArgs() { + return Index_h.clang_Cursor_getNumArguments(segment); + } + + public Cursor getArgument(int idx) { + var cursorArg = Index_h.clang_Cursor_getArgument(owner, segment, idx); + return new Cursor(cursorArg, owner); + } + + // C long long, 64-bit + public long getEnumConstantValue() { + return Index_h.clang_getEnumConstantDeclValue(segment); + } + + // C unsigned long long, 64-bit + public long getEnumConstantUnsignedValue() { + return Index_h.clang_getEnumConstantDeclUnsignedValue(segment); + } + + public boolean isBitField() { + return Index_h.clang_Cursor_isBitField(segment) != 0; + } + + public int getBitFieldWidth() { + return Index_h.clang_getFieldDeclBitWidth(segment); + } + + public CursorKind kind() { + return CursorKind.valueOf(kind); + } + + public CursorLanguage language() { + return CursorLanguage.valueOf(Index_h.clang_getCursorLanguage(segment)); + } + + public LinkageKind linkage() { + return LinkageKind.valueOf(Index_h.clang_getCursorLinkage(segment)); + } + + public int kind0() { + return kind; + } + + /** + * For a segment that is a reference, retrieve a segment representing the entity that it references. + */ + public Cursor getCursorReferenced() { + var referenced = Index_h.clang_getCursorReferenced(owner, segment); + return new Cursor(referenced, owner); + } + + public void forEach(Consumer action) { + CursorChildren.forEach(this, action); + } + + /** + * We run the visitor action inside the upcall, so that we do not have to worry about + * having to copy cursors into separate off-heap storage. To do this, we have to setup + * some context for the upcall, so that the upcall code can call the "correct" user-defined visitor action. + * Note: exceptions must be delayed until after the upcall has returned; this is necessary as upcalls + * cannot throw (if they do, they cause a JVM crash). + */ + private static class CursorChildren { + + static class Context { + private final Consumer action; + private final ClangDisposable owner; + private RuntimeException exception; + + Context(Consumer action, ClangDisposable owner) { + this.action = action; + this.owner = owner; + } + + boolean visit(MemorySegment segment) { + // Note: the session of this cursor is smaller than that of the translation unit + // this is because the cursor will be destroyed when the upcall ends. This means + // that the cursor passed by the visitor must NOT be leaked into a field and accessed + // at a later time (or the liveness check will fail with IllegalStateException). + try { + // run the visitor action + action.accept(new Cursor(segment, owner)); + return true; + } catch (RuntimeException ex) { + // if we fail, record the exception, and return false to stop the visit + exception = ex; + return false; + } + } + + void handleExceptions() { + if (exception != null) { + throw exception; + } + } + } + + static Context pendingContext = null; + + private static final MemorySegment callback = CXCursorVisitor.allocate((c, p, d) -> { + if (pendingContext.visit(c)) { + return Index_h.CXChildVisit_Continue(); + } else { + return Index_h.CXChildVisit_Break(); + } + }, Arena.global()); + + synchronized static void forEach(Cursor c, Consumer op) { + // everything is confined, no need to synchronize + Context prevContext = pendingContext; + try { + pendingContext = new Context(op, c.owner); + Index_h.clang_visitChildren(c.segment, callback, MemorySegment.NULL); + pendingContext.handleExceptions(); + } finally { + pendingContext = prevContext; + } + } + } + + public TranslationUnit getTranslationUnit() { + return new TranslationUnit(Index_h.clang_Cursor_getTranslationUnit(segment)); + } + + private MemorySegment eval0() { + return Index_h.clang_Cursor_Evaluate(segment); + } + + public EvalResult eval() { + MemorySegment ptr = eval0(); + return ptr == MemorySegment.NULL ? EvalResult.erroneous : new EvalResult(ptr); + } + + public PrintingPolicy getPrintingPolicy() { + return new PrintingPolicy(Index_h.clang_getCursorPrintingPolicy(segment)); + } + + @Override + public boolean equals(Object other) { + if (this == other) { + return true; + } + return other instanceof Cursor otherCursor && + (Index_h.clang_equalCursors(segment, otherCursor.segment) != 0); + } + + @Override + public int hashCode() { + return spelling().hashCode(); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/CursorKind.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/CursorKind.java new file mode 100644 index 00000000..9a7e604f --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/CursorKind.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.util.HashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import static org.openjdk.jextract.clang.libclang.Index_h.*; + +public enum CursorKind { + + UnexposedDecl(CXCursor_UnexposedDecl()), + StructDecl(CXCursor_StructDecl()), + UnionDecl(CXCursor_UnionDecl()), + ClassDecl(CXCursor_ClassDecl()), + EnumDecl(CXCursor_EnumDecl()), + FieldDecl(CXCursor_FieldDecl()), + EnumConstantDecl(CXCursor_EnumConstantDecl()), + FunctionDecl(CXCursor_FunctionDecl()), + VarDecl(CXCursor_VarDecl()), + ParmDecl(CXCursor_ParmDecl()), + TypedefDecl(CXCursor_TypedefDecl()), + Namespace(CXCursor_Namespace()), + TypeRef(CXCursor_TypeRef()), + IntegerLiteral(CXCursor_IntegerLiteral()), + FloatingLiteral(CXCursor_FloatingLiteral()), + ImaginaryLiteral(CXCursor_ImaginaryLiteral()), + StringLiteral(CXCursor_StringLiteral()), + CharacterLiteral(CXCursor_CharacterLiteral()), + UnexposedAttr(CXCursor_UnexposedAttr()), + IBActionAttr(CXCursor_IBActionAttr()), + IBOutletAttr(CXCursor_IBOutletAttr()), + IBOutletCollectionAttr(CXCursor_IBOutletCollectionAttr()), + CXXFinalAttr(CXCursor_CXXFinalAttr()), + CXXOverrideAttr(CXCursor_CXXOverrideAttr()), + AnnotateAttr(CXCursor_AnnotateAttr()), + AsmLabelAttr(CXCursor_AsmLabelAttr()), + PackedAttr(CXCursor_PackedAttr()), + PureAttr(CXCursor_PureAttr()), + ConstAttr(CXCursor_ConstAttr()), + NoDuplicateAttr(CXCursor_NoDuplicateAttr()), + CUDAConstantAttr(CXCursor_CUDAConstantAttr()), + CUDADeviceAttr(CXCursor_CUDADeviceAttr()), + CUDAGlobalAttr(CXCursor_CUDAGlobalAttr()), + CUDAHostAttr(CXCursor_CUDAHostAttr()), + CUDASharedAttr(CXCursor_CUDASharedAttr()), + VisibilityAttr(CXCursor_VisibilityAttr()), + DLLExport(CXCursor_DLLExport()), + DLLImport(CXCursor_DLLImport()), + NSReturnsRetained(CXCursor_NSReturnsRetained()), + NSReturnsNotRetained(CXCursor_NSReturnsNotRetained()), + NSReturnsAutoreleased(CXCursor_NSReturnsAutoreleased()), + NSConsumesSelf(CXCursor_NSConsumesSelf()), + NSConsumed(CXCursor_NSConsumed()), + ObjCException(CXCursor_ObjCException()), + ObjCNSObject(CXCursor_ObjCNSObject()), + ObjCIndependentClass(CXCursor_ObjCIndependentClass()), + ObjCPreciseLifetime(CXCursor_ObjCPreciseLifetime()), + ObjCReturnsInnerPointer(CXCursor_ObjCReturnsInnerPointer()), + ObjCRequiresSuper(CXCursor_ObjCRequiresSuper()), + ObjCRootClass(CXCursor_ObjCRootClass()), + ObjCSubclassingRestricted(CXCursor_ObjCSubclassingRestricted()), + ObjCExplicitProtocolImpl(CXCursor_ObjCExplicitProtocolImpl()), + ObjCDesignatedInitializer(CXCursor_ObjCDesignatedInitializer()), + ObjCRuntimeVisible(CXCursor_ObjCRuntimeVisible()), + ObjCBoxable(CXCursor_ObjCBoxable()), + FlagEnum(CXCursor_FlagEnum()), + ConvergentAttr(CXCursor_ConvergentAttr()), + WarnUnusedAttr(CXCursor_WarnUnusedAttr()), + WarnUnusedResultAttr(CXCursor_WarnUnusedResultAttr()), + AlignedAttr(CXCursor_AlignedAttr()), + MacroDefinition(CXCursor_MacroDefinition()), + MacroExpansion(CXCursor_MacroExpansion()), + MacroInstantiation(CXCursor_MacroInstantiation()), + InclusionDirective(CXCursor_InclusionDirective()), + /* + * Per libclang API docs, clang returns this CursorKind + * for both C11 _Static_assert and C++11 static_assert + */ + StaticAssert(CXCursor_StaticAssert()); + + + private final int value; + + CursorKind(int value) { + this.value = value; + } + + public int value() { + return value; + } + + private final static Map lookup; + + static { + lookup = new HashMap<>(); + for (CursorKind e: CursorKind.values()) { + lookup.put(e.value(), e); + } + } + + public final static CursorKind valueOf(int value) { + CursorKind x = lookup.get(value); + if (null == x) { + throw new NoSuchElementException("Invalid Cursor kind value: " + value); + } + return x; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/CursorLanguage.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/CursorLanguage.java new file mode 100644 index 00000000..ed76b865 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/CursorLanguage.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.util.Arrays; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.function.Function; + +import static java.util.stream.Collectors.toMap; +import static org.openjdk.jextract.clang.libclang.Index_h.*; + +public enum CursorLanguage { + Invalid(CXLanguage_Invalid(), "Invalid"), + C(CXLanguage_C(), "C"), + ObjC(CXLanguage_ObjC(), "Objective C"), + CPlusPlus(CXLanguage_CPlusPlus(), "C++"); + + private final int code; + private final String name; + + CursorLanguage(int code, String name) { + this.code = code; + this.name = name; + } + + public int code() { + return code; + } + + @Override + public String toString() { + return name; + } + + private static final Map lookup = Arrays.stream(values()) + .collect(toMap(CursorLanguage::code, Function.identity())); + + public static CursorLanguage valueOf(int code) { + return lookup.computeIfAbsent(code, k -> { throw new NoSuchElementException("No CursorLanguage with code: " + k); }); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/Diagnostic.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/Diagnostic.java new file mode 100644 index 00000000..7fb168ac --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/Diagnostic.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.lang.foreign.MemorySegment; +import org.openjdk.jextract.clang.libclang.Index_h; + +import static org.openjdk.jextract.clang.LibClang.STRING_ALLOCATOR; + +public class Diagnostic extends ClangDisposable { + + // Various Diagnostic severity levels - from Clang enum CXDiagnosticSeverity + + /** + * A diagnostic that has been suppressed, e.g., by a command-line + * option. + */ + public static final int CXDiagnostic_Ignored = Index_h.CXDiagnostic_Ignored(); + + /** + * This diagnostic is a note that should be attached to the + * previous (non-note) diagnostic. + */ + public static final int CXDiagnostic_Note = Index_h.CXDiagnostic_Note(); + + /** + * This diagnostic indicates suspicious code that may not be + * wrong. + */ + public static final int CXDiagnostic_Warning = Index_h.CXDiagnostic_Warning(); + + /** + * This diagnostic indicates that the code is ill-formed. + */ + public static final int CXDiagnostic_Error = Index_h.CXDiagnostic_Error(); + + /** + * This diagnostic indicates that the code is ill-formed such + * that future parser recovery is unlikely to produce useful + * results. + */ + public static final int CXDiagnostic_Fatal = Index_h.CXDiagnostic_Fatal(); + + Diagnostic(MemorySegment ptr) { + super(ptr, Index_h::clang_disposeDiagnostic); + } + + public int severity() { + return Index_h.clang_getDiagnosticSeverity(ptr); + } + + public SourceLocation location() { + var loc = Index_h.clang_getDiagnosticLocation(arena, ptr); + return new SourceLocation(loc, this); + } + + public String spelling() { + var spelling = Index_h.clang_getDiagnosticSpelling(STRING_ALLOCATOR, ptr); + return LibClang.CXStrToString(spelling); + } + + @Override + public String toString() { + var diagString = Index_h.clang_formatDiagnostic(arena, ptr, + Index_h.clang_defaultDiagnosticDisplayOptions()); + return LibClang.CXStrToString(diagString); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/ErrorCode.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/ErrorCode.java new file mode 100644 index 00000000..bfa2b9ea --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/ErrorCode.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.util.Arrays; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.function.Function; + +import static java.util.stream.Collectors.toMap; +import static org.openjdk.jextract.clang.libclang.Index_h.*; + +public enum ErrorCode { + Success(CXError_Success()), + Failure(CXError_Failure()), + Crashed(CXError_Crashed()), + InvalidArguments(CXError_InvalidArguments()), + ASTReadError(CXError_ASTReadError()); + + private final int code; + + ErrorCode(int code) { + this.code = code; + } + + public int code() { + return code; + } + + private static final Map lookup = Arrays.stream(values()) + .collect(toMap(ErrorCode::code, Function.identity())); + + public static ErrorCode valueOf(int code) { + return lookup.computeIfAbsent(code, k -> { throw new NoSuchElementException("No ErrorCode with code: " + k); }); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/EvalResult.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/EvalResult.java new file mode 100644 index 00000000..eff73126 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/EvalResult.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.clang; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.MemorySegment; +import org.openjdk.jextract.clang.libclang.Index_h; + +public class EvalResult implements AutoCloseable { + private MemorySegment ptr; + + public EvalResult(MemorySegment ptr) { + this.ptr = ptr; + } + + public enum Kind { + Integral, + FloatingPoint, + StrLiteral, + Erroneous, + Unknown + } + + private int getKind0() { + return Index_h.clang_EvalResult_getKind(ptr); + } + + public Kind getKind() { + int code = getKind0(); + switch (code) { + case 1: return Kind.Integral; + case 2: return Kind.FloatingPoint; + case 3: case 4: case 5: + return Kind.StrLiteral; + default: + return Kind.Unknown; + } + } + + private long getAsInt0() { + return Index_h.clang_EvalResult_getAsLongLong(ptr); + } + + public long getAsInt() { + Kind kind = getKind(); + switch (kind) { + case Integral: + return getAsInt0(); + default: + throw new IllegalStateException("Unexpected kind: " + kind); + } + } + + private double getAsFloat0() { + return Index_h.clang_EvalResult_getAsDouble(ptr); + } + + public double getAsFloat() { + Kind kind = getKind(); + switch (kind) { + case FloatingPoint: + return getAsFloat0(); + default: + throw new IllegalStateException("Unexpected kind: " + kind); + } + } + + private String getAsString0() { + MemorySegment value = Index_h.clang_EvalResult_getAsStr(ptr); + return value.getUtf8String(0); + } + + public String getAsString() { + Kind kind = getKind(); + switch (kind) { + case StrLiteral: + return getAsString0(); + default: + throw new IllegalStateException("Unexpected kind: " + kind); + } + } + + @Override + public void close() { + if (ptr != MemorySegment.NULL) { + Index_h.clang_EvalResult_dispose(ptr); + ptr = MemorySegment.NULL; + } + } + + final static EvalResult erroneous = new EvalResult(MemorySegment.NULL) { + @Override + public Kind getKind() { + return Kind.Erroneous; + } + + @Override + public void close() { + //do nothing + } + }; +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/Index.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/Index.java new file mode 100644 index 00000000..ef9ce4cc --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/Index.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.clang; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import org.openjdk.jextract.clang.libclang.Index_h; + +import java.nio.file.Path; +import java.util.function.Consumer; + +import static org.openjdk.jextract.clang.libclang.Index_h.C_POINTER; + +public class Index extends ClangDisposable { + + Index(MemorySegment addr) { + super(addr, Index_h::clang_disposeIndex); + } + + public static class UnsavedFile { + final String file; + final String contents; + + private UnsavedFile(Path path, String contents) { + this.file = path.toAbsolutePath().toString(); + this.contents = contents; + } + + public static UnsavedFile of(Path path, String contents) { + return new UnsavedFile(path, contents); + } + } + + public static class ParsingFailedException extends RuntimeException { + private static final long serialVersionUID = -1L; + private final String srcFile; + private final ErrorCode code; + + public ParsingFailedException(Path srcFile, ErrorCode code) { + super("Failed to parse " + srcFile.toAbsolutePath().toString() + ": " + code); + this.srcFile = srcFile.toAbsolutePath().toString(); + this.code = code; + } + } + + public TranslationUnit parseTU(String file, Consumer dh, int options, String... args) + throws ParsingFailedException { + try (Arena arena = Arena.ofConfined()) { + MemorySegment src = arena.allocateUtf8String(file); + MemorySegment cargs = args.length == 0 ? null : arena.allocateArray(C_POINTER, args.length); + for (int i = 0 ; i < args.length ; i++) { + cargs.set(C_POINTER, i * C_POINTER.byteSize(), arena.allocateUtf8String(args[i])); + } + MemorySegment outAddress = arena.allocate(C_POINTER); + ErrorCode code = ErrorCode.valueOf(Index_h.clang_parseTranslationUnit2( + ptr, + src, + cargs == null ? MemorySegment.NULL : cargs, + args.length, MemorySegment.NULL, + 0, + options, + outAddress)); + + MemorySegment tu = outAddress.get(C_POINTER, 0); + TranslationUnit rv = new TranslationUnit(tu); + // even if we failed to parse, we might still have diagnostics + rv.processDiagnostics(dh); + + if (code != ErrorCode.Success) { + throw new ParsingFailedException(Path.of(file).toAbsolutePath(), code); + } + + return rv; + } + } + + private int defaultOptions(boolean detailedPreprocessorRecord) { + int rv = Index_h.CXTranslationUnit_ForSerialization(); + rv |= Index_h.CXTranslationUnit_SkipFunctionBodies(); + if (detailedPreprocessorRecord) { + rv |= Index_h.CXTranslationUnit_DetailedPreprocessingRecord(); + } + return rv; + } + + public TranslationUnit parse(String file, Consumer dh, boolean detailedPreprocessorRecord, String... args) + throws ParsingFailedException { + return parseTU(file, dh, defaultOptions(detailedPreprocessorRecord), args); + } + + public TranslationUnit parse(String file, boolean detailedPreprocessorRecord, String... args) + throws ParsingFailedException { + return parse(file, dh -> {}, detailedPreprocessorRecord, args); + } + +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/LibClang.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/LibClang.java new file mode 100644 index 00000000..69f76bf0 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/LibClang.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.SegmentAllocator; +import org.openjdk.jextract.clang.libclang.CXString; +import org.openjdk.jextract.clang.libclang.Index_h; + +import java.lang.invoke.MethodHandle; + +import static org.openjdk.jextract.clang.libclang.Index_h.C_INT; +import static org.openjdk.jextract.clang.libclang.Index_h.C_POINTER; + +public class LibClang { + private static final boolean DEBUG = Boolean.getBoolean("libclang.debug"); + private static final boolean IS_WINDOWS = System.getProperty("os.name").startsWith("Windows"); + // crash recovery is not an issue on Windows, so enable it there by default to work around a libclang issue with reparseTranslationUnit + private static final boolean CRASH_RECOVERY = IS_WINDOWS || Boolean.getBoolean("libclang.crash_recovery"); + + private static final SegmentAllocator IMPLICIT_ALLOCATOR = (size, align) -> Arena.ofAuto().allocate(size, align); + + private final static MemorySegment disableCrashRecovery = + IMPLICIT_ALLOCATOR.allocateUtf8String("LIBCLANG_DISABLE_CRASH_RECOVERY=" + CRASH_RECOVERY); + + static { + if (!CRASH_RECOVERY) { + //this is an hack - needed because clang_toggleCrashRecovery only takes effect _after_ the + //first call to createIndex. + try { + Linker linker = Linker.nativeLinker(); + String putenv = IS_WINDOWS ? "_putenv" : "putenv"; + MethodHandle PUT_ENV = linker.downcallHandle(linker.defaultLookup().find(putenv).get(), + FunctionDescriptor.of(C_INT, C_POINTER)); + int res = (int) PUT_ENV.invokeExact((MemorySegment)disableCrashRecovery); + } catch (Throwable ex) { + throw new ExceptionInInitializerError(ex); + } + } + } + + public static Index createIndex(boolean local) { + Index index = new Index(Index_h.clang_createIndex(local ? 1 : 0, 0)); + if (DEBUG) { + System.err.println("LibClang crash recovery " + (CRASH_RECOVERY ? "enabled" : "disabled")); + } + return index; + } + + public static String CXStrToString(MemorySegment cxstr) { + MemorySegment buf = Index_h.clang_getCString(cxstr); + String str = buf.getUtf8String(0); + Index_h.clang_disposeString(cxstr); + return str; + } + + /** + * This is an allocator for temporary CXString structs. CXStrToString needs to save the CXString somewhere, + * so that we can extract a Java string out of it. Once that's done, we can dispose the CXString, and the + * associated segment. Since jextract is single-threaded, we can use a prefix allocator, to speed up string + * conversion. The size of the prefix segment is set to 256, which should be enough to hold a CXString. + */ + public final static SegmentAllocator STRING_ALLOCATOR = SegmentAllocator.prefixAllocator( + Arena.ofAuto().allocate(CXString.sizeof(), 8)); + + public static String version() { + var clangVersion = Index_h.clang_getClangVersion(STRING_ALLOCATOR); + return CXStrToString(clangVersion); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/LinkageKind.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/LinkageKind.java new file mode 100644 index 00000000..26a94f43 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/LinkageKind.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.util.HashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import static org.openjdk.jextract.clang.libclang.Index_h.*; + +public enum LinkageKind { + Invalid(CXLinkage_Invalid()), + NoLinkage(CXLinkage_NoLinkage()), + Internal(CXLinkage_Internal()), + UniqueExternal(CXLinkage_UniqueExternal()), + External(CXLinkage_External()); + + private final int value; + + LinkageKind(int value) { + this.value = value; + } + + public int value() { + return value; + } + + private final static Map lookup; + + static { + lookup = new HashMap<>(); + for (LinkageKind e: LinkageKind.values()) { + lookup.put(e.value(), e); + } + } + + public final static LinkageKind valueOf(int value) { + LinkageKind x = lookup.get(value); + if (null == x) { + throw new NoSuchElementException("Invalid Cursor kind value: " + value); + } + return x; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/PrintingPolicy.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/PrintingPolicy.java new file mode 100644 index 00000000..e7ebdefd --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/PrintingPolicy.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.clang; + +import java.lang.foreign.MemorySegment; +import org.openjdk.jextract.clang.libclang.Index_h; + +public final class PrintingPolicy implements AutoCloseable { + private MemorySegment policy; + + PrintingPolicy(MemorySegment policy) { + this.policy = policy; + } + + MemorySegment ptr() { + return policy; + } + + @Override + public void close() { + dispose(); + } + + public void dispose() { + if (policy != MemorySegment.NULL) { + Index_h.clang_PrintingPolicy_dispose(policy); + policy = MemorySegment.NULL; + } + } + + public boolean getProperty(PrintingPolicyProperty prop) { + return Index_h.clang_PrintingPolicy_getProperty(policy, prop.value()) != 0; + } + + public void setProperty(PrintingPolicyProperty prop, boolean value) { + Index_h.clang_PrintingPolicy_setProperty(policy, prop.value(), value? 1 : 0); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/PrintingPolicyProperty.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/PrintingPolicyProperty.java new file mode 100644 index 00000000..9424ab9a --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/PrintingPolicyProperty.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.clang; + +import java.util.HashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import static org.openjdk.jextract.clang.libclang.Index_h.*; + +public enum PrintingPolicyProperty { + Indentation(CXPrintingPolicy_Indentation()), + SuppressSpecifiers(CXPrintingPolicy_SuppressSpecifiers()), + SuppressTagKeyword(CXPrintingPolicy_SuppressTagKeyword()), + IncludeTagDefinition(CXPrintingPolicy_IncludeTagDefinition()), + SuppressScope(CXPrintingPolicy_SuppressScope()), + SuppressUnwrittenScope(CXPrintingPolicy_SuppressUnwrittenScope()), + SuppressInitializers(CXPrintingPolicy_SuppressInitializers()), + ConstantArraySizeAsWritten(CXPrintingPolicy_ConstantArraySizeAsWritten()), + AnonymousTagLocations(CXPrintingPolicy_AnonymousTagLocations()), + SuppressStrongLifetime(CXPrintingPolicy_SuppressStrongLifetime()), + SuppressLifetimeQualifiers(CXPrintingPolicy_SuppressLifetimeQualifiers()), + SuppressTemplateArgsInCXXConstructors(CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors()), + Bool(CXPrintingPolicy_Bool()), + Restrict(CXPrintingPolicy_Restrict()), + Alignof(CXPrintingPolicy_Alignof()), + UnderscoreAlignof(CXPrintingPolicy_UnderscoreAlignof()), + UseVoidForZeroParams(CXPrintingPolicy_UseVoidForZeroParams()), + TerseOutput(CXPrintingPolicy_TerseOutput()), + PolishForDeclaration(CXPrintingPolicy_PolishForDeclaration()), + Half(CXPrintingPolicy_Half()), + MSWChar(CXPrintingPolicy_MSWChar()), + IncludeNewlines(CXPrintingPolicy_IncludeNewlines()), + MSVCFormatting(CXPrintingPolicy_MSVCFormatting()), + ConstantsAsWritten(CXPrintingPolicy_ConstantsAsWritten()), + SuppressImplicitBase(CXPrintingPolicy_SuppressImplicitBase()), + FullyQualifiedName(CXPrintingPolicy_FullyQualifiedName()), + LastProperty(CXPrintingPolicy_LastProperty()); + + private final int value; + + PrintingPolicyProperty(int value) { + this.value = value; + } + + public int value() { + return value; + } + + private final static Map lookup; + + static { + lookup = new HashMap<>(); + for (PrintingPolicyProperty e: PrintingPolicyProperty.values()) { + lookup.put(e.value(), e); + } + } + + public final static PrintingPolicyProperty valueOf(int value) { + PrintingPolicyProperty x = lookup.get(value); + if (null == x) { + throw new NoSuchElementException("Invalid PrintingPolicyProperty value: " + value); + } + return x; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/SaveError.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/SaveError.java new file mode 100644 index 00000000..e06524bb --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/SaveError.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.util.Arrays; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.function.Function; + +import static java.util.stream.Collectors.toMap; +import static org.openjdk.jextract.clang.libclang.Index_h.*; + +public enum SaveError { + None(CXSaveError_None()), + Unknown(CXSaveError_Unknown()), + TranslationErrors(CXSaveError_TranslationErrors()), + InvalidTU(CXSaveError_InvalidTU()); + + private final int code; + + SaveError(int code) { + this.code = code; + } + + public int code() { + return code; + } + + private static final Map lookup = Arrays.stream(values()) + .collect(toMap(SaveError::code, Function.identity())); + + public static SaveError valueOf(int code) { + return lookup.computeIfAbsent(code, k -> { throw new NoSuchElementException("No SaveError with code: " + k); }); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/SourceLocation.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/SourceLocation.java new file mode 100644 index 00000000..26409ddc --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/SourceLocation.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import org.openjdk.jextract.clang.libclang.Index_h; + +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Objects; + +import static org.openjdk.jextract.clang.LibClang.STRING_ALLOCATOR; +import static org.openjdk.jextract.clang.libclang.Index_h.C_INT; +import static org.openjdk.jextract.clang.libclang.Index_h.C_POINTER; + +public class SourceLocation extends ClangDisposable.Owned { + + private final MemorySegment loc; + + SourceLocation(MemorySegment loc, ClangDisposable owner) { + super(loc, owner); + this.loc = loc; + } + + @FunctionalInterface + private interface LocationFactory { + void get(MemorySegment loc, MemorySegment file, + MemorySegment line, MemorySegment column, MemorySegment offset); + } + + @SuppressWarnings("unchecked") + private Location getLocation(LocationFactory fn) { + try (var arena = Arena.ofConfined()) { + MemorySegment file = arena.allocate(C_POINTER); + MemorySegment line = arena.allocate(C_INT); + MemorySegment col = arena.allocate(C_INT); + MemorySegment offset = arena.allocate(C_INT); + + fn.get(loc, file, line, col, offset); + MemorySegment fname = file.get(C_POINTER, 0); + String str = fname.equals(MemorySegment.NULL) ? null : getFileName(fname); + + return new Location(str, line.get(C_INT, 0), + col.get(C_INT, 0), offset.get(C_INT, 0)); + } + } + + private static String getFileName(MemorySegment fname) { + var filename = Index_h.clang_getFileName(STRING_ALLOCATOR, fname); + return LibClang.CXStrToString(filename); + } + + public Location getFileLocation() { return getLocation(Index_h::clang_getFileLocation); } + public Location getExpansionLocation() { return getLocation(Index_h::clang_getExpansionLocation); } + public Location getSpellingLocation() { return getLocation(Index_h::clang_getSpellingLocation); } + public boolean isInSystemHeader() { + return Index_h.clang_Location_isInSystemHeader(loc) != 0; + } + + public boolean isFromMainFile() { + return Index_h.clang_Location_isFromMainFile(loc) != 0; + } + + @Override + public boolean equals(Object other) { + if (this == other) { + return true; + } + return other instanceof SourceLocation sloc && + Objects.equals(getFileLocation(), sloc.getFileLocation()); + } + + @Override + public int hashCode() { + return getFileLocation().hashCode(); + } + + public final static class Location { + private final Path path; + private final int line; + private final int column; + private final int offset; + + private Location(String filename, int line, int column, int offset) { + if (filename == null || filename.isEmpty()) { + this.path = null; + } else { + this.path = Paths.get(filename); + } + + this.line = line; + this.column = column; + this.offset = offset; + } + + public Path path() { + return path; + } + + public int line() { + return line; + } + + public int column() { + return column; + } + + public int offset() { + return offset; + } + + @Override + public boolean equals(Object other) { + if (this == other) { + return true; + } + return other instanceof Location loc && + Objects.equals(path, loc.path) && + line == loc.line && column == loc.column && + offset == loc.offset; + } + + @Override + public int hashCode() { + return Objects.hashCode(path) ^ line ^ column ^ offset; + } + + @Override + public String toString() { + return Objects.toString(path) + ":" + line + ":" + column + ":" + offset; + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/SourceRange.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/SourceRange.java new file mode 100644 index 00000000..3cba6298 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/SourceRange.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.lang.foreign.MemorySegment; +import org.openjdk.jextract.clang.libclang.Index_h; + +public class SourceRange extends ClangDisposable.Owned { + + SourceRange(MemorySegment range, ClangDisposable owner) { + super(range, owner); + } + + public SourceLocation getBegin() { + var rangeStart = Index_h.clang_getRangeStart(owner, segment); + return new SourceLocation(rangeStart, owner); + } + + public SourceLocation getEnd() { + var rangeEnd = Index_h.clang_getRangeEnd(owner, segment); + return new SourceLocation(rangeEnd, owner); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/TranslationUnit.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/TranslationUnit.java new file mode 100644 index 00000000..6d3d3b1f --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/TranslationUnit.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.clang; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.SegmentAllocator; +import org.openjdk.jextract.clang.libclang.CXToken; +import org.openjdk.jextract.clang.libclang.Index_h; +import org.openjdk.jextract.clang.libclang.CXUnsavedFile; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.Objects; +import java.util.function.Consumer; + +import static org.openjdk.jextract.clang.LibClang.STRING_ALLOCATOR; +import static org.openjdk.jextract.clang.libclang.Index_h.C_INT; +import static org.openjdk.jextract.clang.libclang.Index_h.C_POINTER; + +public class TranslationUnit extends ClangDisposable { + private static final int MAX_RETRIES = 10; + + TranslationUnit(MemorySegment addr) { + super(addr, Index_h::clang_disposeTranslationUnit); + } + + public Cursor getCursor() { + var cursor = Index_h.clang_getTranslationUnitCursor(arena, ptr); + return new Cursor(cursor, this); + } + + public final void save(Path path) throws TranslationUnitSaveException { + try (Arena arena = Arena.ofConfined()) { + MemorySegment pathStr = arena.allocateUtf8String(path.toAbsolutePath().toString()); + SaveError res = SaveError.valueOf(Index_h.clang_saveTranslationUnit(ptr, pathStr, 0)); + if (res != SaveError.None) { + throw new TranslationUnitSaveException(path, res); + } + } + } + + void processDiagnostics(Consumer dh) { + Objects.requireNonNull(dh); + int cntDiags = Index_h.clang_getNumDiagnostics(ptr); + for (int i = 0; i < cntDiags; i++) { + MemorySegment diag = Index_h.clang_getDiagnostic(ptr, i); + dh.accept(new Diagnostic(diag)); + } + } + + static long FILENAME_OFFSET = CXUnsavedFile.$LAYOUT().byteOffset(MemoryLayout.PathElement.groupElement("Filename")); + static long CONTENTS_OFFSET = CXUnsavedFile.$LAYOUT().byteOffset(MemoryLayout.PathElement.groupElement("Contents")); + static long LENGTH_OFFSET = CXUnsavedFile.$LAYOUT().byteOffset(MemoryLayout.PathElement.groupElement("Length")); + + public void reparse(Index.UnsavedFile... inMemoryFiles) { + try (Arena arena = Arena.ofConfined()) { + MemorySegment files = inMemoryFiles.length == 0 ? + null : + arena.allocateArray(CXUnsavedFile.$LAYOUT(), inMemoryFiles.length); + for (int i = 0; i < inMemoryFiles.length; i++) { + MemorySegment start = files.asSlice(i * CXUnsavedFile.$LAYOUT().byteSize()); + start.set(C_POINTER, FILENAME_OFFSET, arena.allocateUtf8String(inMemoryFiles[i].file)); + start.set(C_POINTER, CONTENTS_OFFSET, arena.allocateUtf8String(inMemoryFiles[i].contents)); + start.set(C_INT, LENGTH_OFFSET, inMemoryFiles[i].contents.length()); + } + ErrorCode code; + int tries = 0; + do { + code = ErrorCode.valueOf(Index_h.clang_reparseTranslationUnit( + ptr, + inMemoryFiles.length, + files == null ? MemorySegment.NULL : files, + Index_h.clang_defaultReparseOptions(ptr))); + } while(code == ErrorCode.Crashed && (++tries) < MAX_RETRIES); // this call can crash on Windows. Retry in that case. + + if (code != ErrorCode.Success) { + throw new IllegalStateException("Re-parsing failed: " + code); + } + } + } + + public void reparse(Consumer dh, Index.UnsavedFile... inMemoryFiles) { + reparse(inMemoryFiles); + processDiagnostics(dh); + } + + public String[] tokens(SourceRange range) { + try (Tokens tokens = tokenize(range)) { + String rv[] = new String[tokens.size()]; + for (int i = 0; i < rv.length; i++) { + rv[i] = tokens.getToken(i).spelling(); + } + return rv; + } + } + + public Tokens tokenize(SourceRange range) { + try (Arena arena = Arena.ofConfined()) { + MemorySegment p = arena.allocate(C_POINTER); + MemorySegment pCnt = arena.allocate(C_INT); + Index_h.clang_tokenize(ptr, range.segment, p, pCnt); + Tokens rv = new Tokens(p.get(C_POINTER, 0), pCnt.get(C_INT, 0)); + return rv; + } + } + + public class Tokens extends ClangDisposable { + private final int size; + + Tokens(MemorySegment addr, int size) { + super(addr, size * CXToken.$LAYOUT().byteSize(), + (addrCleanup) -> Index_h.clang_disposeTokens(TranslationUnit.this.ptr, addrCleanup, size)); + this.size = size; + } + + public int size() { + return size; + } + + public MemorySegment getTokenSegment(int idx) { + return ptr.asSlice(idx * CXToken.$LAYOUT().byteSize()); + } + + public Token getToken(int index) { + return new Token(getTokenSegment(index), this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < size; i++) { + sb.append("Token["); + sb.append(i); + sb.append("]="); + sb.append(getToken(i).spelling()); + sb.append("\n"); + } + return sb.toString(); + } + + public class Token extends ClangDisposable.Owned { + Token(MemorySegment token, ClangDisposable owner) { + super(token, owner); + } + + public int kind() { + return Index_h.clang_getTokenKind(segment); + } + + public String spelling() { + var spelling = Index_h.clang_getTokenSpelling(STRING_ALLOCATOR, TranslationUnit.this.ptr, segment); + return LibClang.CXStrToString(spelling); + } + + public SourceLocation getLocation() { + var tokenLoc = Index_h.clang_getTokenLocation(owner, TranslationUnit.this.ptr, segment); + return new SourceLocation(tokenLoc, owner); + } + + public SourceRange getExtent() { + var tokenExt = Index_h.clang_getTokenExtent(owner, TranslationUnit.this.ptr, segment); + return new SourceRange(tokenExt, owner); + } + } + } + + public static class TranslationUnitSaveException extends IOException { + + static final long serialVersionUID = 1L; + + private final SaveError error; + + TranslationUnitSaveException(Path path, SaveError error) { + super("Cannot save translation unit to: " + path.toAbsolutePath() + ". Error: " + error); + this.error = error; + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/Type.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/Type.java new file mode 100644 index 00000000..ccae46c8 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/Type.java @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.clang; + +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; + +import org.openjdk.jextract.clang.libclang.CXType; +import org.openjdk.jextract.clang.libclang.Index_h; + +import static org.openjdk.jextract.clang.LibClang.STRING_ALLOCATOR; + +public final class Type extends ClangDisposable.Owned { + + Type(MemorySegment segment, ClangDisposable owner) { + super(segment, owner); + } + + public boolean isInvalid() { + return kind() == TypeKind.Invalid; + } + + // Function Types + public boolean isVariadic() { + return Index_h.clang_isFunctionTypeVariadic(segment) != 0; + } + public Type resultType() { + var resultType = Index_h.clang_getResultType(owner, segment); + return new Type(resultType, owner); + } + public int numberOfArgs() { + return Index_h.clang_getNumArgTypes(segment); + } + public Type argType(int idx) { + var argType = Index_h.clang_getArgType(owner, segment, idx); + return new Type(argType, owner); + } + private int getCallingConvention0() { + return Index_h.clang_getFunctionTypeCallingConv(segment); + } + + public CallingConvention getCallingConvention() { + int v = getCallingConvention0(); + return CallingConvention.valueOf(v); + } + + public boolean isPointer() { + var kind = kind(); + return kind == TypeKind.Pointer || + kind == TypeKind.BlockPointer || kind == TypeKind.MemberPointer; + } + + public boolean isReference() { + var kind = kind(); + return kind == TypeKind.LValueReference || kind == TypeKind.RValueReference; + } + + public boolean isArray() { + var kind = kind(); + return kind == TypeKind.ConstantArray || + kind == TypeKind.IncompleteArray || + kind == TypeKind.VariableArray || + kind == TypeKind.DependentSizedArray; + } + + // Pointer segment + public Type getPointeeType() { + var pointee = Index_h.clang_getPointeeType(owner, segment); + return new Type(pointee, owner); + } + + // array/vector segment + public Type getElementType() { + var elementType = Index_h.clang_getElementType(owner, segment); + return new Type(elementType, owner); + } + public Type getValueType() { + var valueType = Index_h.clang_getValueType(owner, segment); + return new Type(valueType, owner); + } + + public long getNumberOfElements() { + return Index_h.clang_getNumElements(segment); + } + + // Struct/RecordType + private long getOffsetOf0(String fieldName) { + try (Arena arena = Arena.ofConfined()) { + MemorySegment cfname = arena.allocateUtf8String(fieldName); + return Index_h.clang_Type_getOffsetOf(segment, cfname); + } + } + + public long getOffsetOf(String fieldName) { + long res = getOffsetOf0(fieldName); + if(TypeLayoutError.isError(res)) { + throw new TypeLayoutError(res, String.format("segment: %s, fieldName: %s", this, fieldName)); + } + return res; + } + + // Typedef + /** + * Return the canonical segment for a Type. + * + * Clang's segment system explicitly models typedefs and all the ways + * a specific segment can be represented. The canonical segment is the underlying + * segment with all the "sugar" removed. For example, if 'T' is a typedef + * for 'int', the canonical segment for 'T' would be 'int'. + */ + public Type canonicalType() { + var canonicalType = Index_h.clang_getCanonicalType(owner, segment); + return new Type(canonicalType, owner); + } + + /** + * Determine whether a Type has the "const" qualifier set, + * without looking through typedefs that may have added "const" at a + * different level. + */ + public boolean isConstQualifierdType() { + return Index_h.clang_isConstQualifiedType(segment) != 0; + } + + /** + * Determine whether a Type has the "volatile" qualifier set, + * without looking through typedefs that may have added "volatile" at + * a different level. + */ + public boolean isVolatileQualified() { + return Index_h.clang_isVolatileQualifiedType(segment) != 0; + } + + public String spelling() { + var spelling = Index_h.clang_getTypeSpelling(STRING_ALLOCATOR, segment); + return LibClang.CXStrToString(spelling); + } + + public int kind0() { + return CXType.kind$get(segment); + } + + private long size0() { + return Index_h.clang_Type_getSizeOf(segment); + } + + private long align0() { + return Index_h.clang_Type_getAlignOf(segment); + } + + public long size() { + long res = size0(); + if(TypeLayoutError.isError(res)) { + throw new TypeLayoutError(res, String.format("segment: %s", this)); + } + return res; + } + + public long align() { + long res = align0(); + if(TypeLayoutError.isError(res)) { + throw new TypeLayoutError(res, String.format("segment: %s", this)); + } + return res; + } + + public TypeKind kind() { + int v = kind0(); + TypeKind rv = TypeKind.valueOf(v); + // TODO: Atomic segment doesn't work + return rv; + } + + public Cursor getDeclarationCursor() { + var cursorDecl = Index_h.clang_getTypeDeclaration(owner, segment); + return new Cursor(cursorDecl, owner); + } + + public boolean equalType(Type other) { + return Index_h.clang_equalTypes(segment, other.segment) != 0; + } + + @Override + public boolean equals(Object other) { + if (this == other) { + return true; + } + return other instanceof Type segment && equalType(segment); + } + + @Override + public int hashCode() { + return spelling().hashCode(); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/TypeKind.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/TypeKind.java new file mode 100644 index 00000000..e55bf006 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/TypeKind.java @@ -0,0 +1,179 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.clang; + +import java.util.HashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import static org.openjdk.jextract.clang.libclang.Index_h.*; + +public enum TypeKind { + + Invalid(CXType_Invalid()), + Unexposed(CXType_Unexposed()), + Void(CXType_Void()), + Bool(CXType_Bool()), + Char_U(CXType_Char_U()), + UChar(CXType_UChar()), + Char16(CXType_Char16()), + Char32(CXType_Char32()), + UShort(CXType_UShort()), + UInt(CXType_UInt()), + ULong(CXType_ULong()), + ULongLong(CXType_ULongLong()), + UInt128(CXType_UInt128()), + Char_S(CXType_Char_S()), + SChar(CXType_SChar()), + WChar(CXType_WChar()), + Short(CXType_Short()), + Int(CXType_Int()), + Long(CXType_Long()), + LongLong(CXType_LongLong()), + Int128(CXType_Int128()), + Float(CXType_Float()), + Double(CXType_Double()), + LongDouble(CXType_LongDouble()), + NullPtr(CXType_NullPtr()), + Overload(CXType_Overload()), + Dependent(CXType_Dependent()), + ObjCId(CXType_ObjCId()), + ObjCClass(CXType_ObjCClass()), + ObjCSel(CXType_ObjCSel()), + Float128(CXType_Float128()), + Half(CXType_Half()), + Float16(CXType_Float16()), + ShortAccum(CXType_ShortAccum()), + Accum(CXType_Accum()), + LongAccum(CXType_LongAccum()), + UShortAccum(CXType_UShortAccum()), + UAccum(CXType_UAccum()), + ULongAccum(CXType_ULongAccum()), + Complex(CXType_Complex()), + Pointer(CXType_Pointer()), + BlockPointer(CXType_BlockPointer()), + LValueReference(CXType_LValueReference()), + RValueReference(CXType_RValueReference()), + Record(CXType_Record()), + Enum(CXType_Enum()), + Typedef(CXType_Typedef()), + ObjCInterface(CXType_ObjCInterface()), + ObjCObjectPointer(CXType_ObjCObjectPointer()), + FunctionNoProto(CXType_FunctionNoProto()), + FunctionProto(CXType_FunctionProto()), + ConstantArray(CXType_ConstantArray()), + Vector(CXType_Vector()), + IncompleteArray(CXType_IncompleteArray()), + VariableArray(CXType_VariableArray()), + DependentSizedArray(CXType_DependentSizedArray()), + MemberPointer(CXType_MemberPointer()), + Auto(CXType_Auto()), + Elaborated(CXType_Elaborated()), + Pipe(CXType_Pipe()), + OCLImage1dRO(CXType_OCLImage1dRO()), + OCLImage1dArrayRO(CXType_OCLImage1dArrayRO()), + OCLImage1dBufferRO(CXType_OCLImage1dBufferRO()), + OCLImage2dRO(CXType_OCLImage2dRO()), + OCLImage2dArrayRO(CXType_OCLImage2dArrayRO()), + OCLImage2dDepthRO(CXType_OCLImage2dDepthRO()), + OCLImage2dArrayDepthRO(CXType_OCLImage2dArrayDepthRO()), + OCLImage2dMSAARO(CXType_OCLImage2dMSAARO()), + OCLImage2dArrayMSAARO(CXType_OCLImage2dArrayMSAARO()), + OCLImage2dMSAADepthRO(CXType_OCLImage2dMSAADepthRO()), + OCLImage2dArrayMSAADepthRO(CXType_OCLImage2dArrayMSAADepthRO()), + OCLImage3dRO(CXType_OCLImage3dRO()), + OCLImage1dWO(CXType_OCLImage1dWO()), + OCLImage1dArrayWO(CXType_OCLImage1dArrayWO()), + OCLImage1dBufferWO(CXType_OCLImage1dBufferWO()), + OCLImage2dWO(CXType_OCLImage2dWO()), + OCLImage2dArrayWO(CXType_OCLImage2dArrayWO()), + OCLImage2dDepthWO(CXType_OCLImage2dDepthWO()), + OCLImage2dArrayDepthWO(CXType_OCLImage2dArrayDepthWO()), + OCLImage2dMSAAWO(CXType_OCLImage2dMSAAWO()), + OCLImage2dArrayMSAAWO(CXType_OCLImage2dArrayMSAAWO()), + OCLImage2dMSAADepthWO(CXType_OCLImage2dMSAADepthWO()), + OCLImage2dArrayMSAADepthWO(CXType_OCLImage2dArrayMSAADepthWO()), + OCLImage3dWO(CXType_OCLImage3dWO()), + OCLImage1dRW(CXType_OCLImage1dRW()), + OCLImage1dArrayRW(CXType_OCLImage1dArrayRW()), + OCLImage1dBufferRW(CXType_OCLImage1dBufferRW()), + OCLImage2dRW(CXType_OCLImage2dRW()), + OCLImage2dArrayRW(CXType_OCLImage2dArrayRW()), + OCLImage2dDepthRW(CXType_OCLImage2dDepthRW()), + OCLImage2dArrayDepthRW(CXType_OCLImage2dArrayDepthRW()), + OCLImage2dMSAARW(CXType_OCLImage2dMSAARW()), + OCLImage2dArrayMSAARW(CXType_OCLImage2dArrayMSAARW()), + OCLImage2dMSAADepthRW(CXType_OCLImage2dMSAADepthRW()), + OCLImage2dArrayMSAADepthRW(CXType_OCLImage2dArrayMSAADepthRW()), + OCLImage3dRW(CXType_OCLImage3dRW()), + OCLSampler(CXType_OCLSampler()), + OCLEvent(CXType_OCLEvent()), + OCLQueue(CXType_OCLQueue()), + OCLReserveID(CXType_OCLReserveID()), + ObjCObject(CXType_ObjCObject()), + ObjCTypeParam(CXType_ObjCTypeParam()), + Attributed(CXType_Attributed()), + OCLIntelSubgroupAVCMcePayload(CXType_OCLIntelSubgroupAVCMcePayload()), + OCLIntelSubgroupAVCImePayload(CXType_OCLIntelSubgroupAVCImePayload()), + OCLIntelSubgroupAVCRefPayload(CXType_OCLIntelSubgroupAVCRefPayload()), + OCLIntelSubgroupAVCSicPayload(CXType_OCLIntelSubgroupAVCSicPayload()), + OCLIntelSubgroupAVCMceResult(CXType_OCLIntelSubgroupAVCMceResult()), + OCLIntelSubgroupAVCImeResult(CXType_OCLIntelSubgroupAVCImeResult()), + OCLIntelSubgroupAVCRefResult(CXType_OCLIntelSubgroupAVCRefResult()), + OCLIntelSubgroupAVCSicResult(CXType_OCLIntelSubgroupAVCSicResult()), + OCLIntelSubgroupAVCImeResultSingleRefStreamout(CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout()), + OCLIntelSubgroupAVCImeResultDualRefStreamout(CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout()), + OCLIntelSubgroupAVCImeSingleRefStreamin(CXType_OCLIntelSubgroupAVCImeSingleRefStreamin()), + OCLIntelSubgroupAVCImeDualRefStreamin(CXType_OCLIntelSubgroupAVCImeDualRefStreamin()), + ExtVector(CXType_ExtVector()), + Atomic(177); // This is missing in auto-generated code + + private final int value; + + TypeKind(int value) { + this.value = value; + } + + public int value() { + return value; + } + + private final static Map lookup; + + static { + lookup = new HashMap<>(); + for (TypeKind e: TypeKind.values()) { + lookup.put(e.value(), e); + } + } + + public final static TypeKind valueOf(int value) { + TypeKind x = lookup.get(value); + if (null == x) { + throw new NoSuchElementException("kind = " + value); + } + return x; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/TypeLayoutError.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/TypeLayoutError.java new file mode 100644 index 00000000..ade6a62c --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/TypeLayoutError.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.clang; + +import java.util.HashMap; +import java.util.Map; +import java.util.NoSuchElementException; + +public class TypeLayoutError extends IllegalStateException { + + private static final long serialVersionUID = 0L; + + private final Kind kind; + + public TypeLayoutError(long value, String message) { + super(Kind.valueOf(value) + ". " + message); + this.kind = Kind.valueOf(value); + } + + public Kind kind() { + return kind; + } + + public static boolean isError(long value) { + return Kind.isError(value); + } + + public enum Kind { + Invalid(-1), + Incomplete(-2), + Dependent(-3), + NotConstantSize(-4), + InvalidFieldName(-5); + + private final long value; + + Kind(long value) { + this.value = value; + } + + private final static Map lookup; + + static { + lookup = new HashMap<>(); + for (Kind e: Kind.values()) { + lookup.put(e.value, e); + } + } + + public final static Kind valueOf(long value) { + Kind x = lookup.get(value); + if (null == x) { + throw new NoSuchElementException("TypeLayoutError = " + value); + } + return x; + } + + public static boolean isError(long value) { + return lookup.containsKey(value); + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXCursorVisitor.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXCursorVisitor.java new file mode 100644 index 00000000..b0db7c9d --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXCursorVisitor.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * enum CXChildVisitResult (*CXCursorVisitor)(struct cursor,struct parent,void* client_data); + * } + */ +public interface CXCursorVisitor { + + int apply(java.lang.foreign.MemorySegment cursor, java.lang.foreign.MemorySegment parent, java.lang.foreign.MemorySegment client_data); + static MemorySegment allocate(CXCursorVisitor fi, Arena scope) { + return RuntimeHelper.upcallStub(CXCursorVisitor.class, fi, constants$13.CXCursorVisitor$FUNC, scope); + } + static CXCursorVisitor ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment _cursor, java.lang.foreign.MemorySegment _parent, java.lang.foreign.MemorySegment _client_data) -> { + try { + return (int)constants$13.CXCursorVisitor$MH.invokeExact(symbol, _cursor, _parent, _client_data); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXString.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXString.java new file mode 100644 index 00000000..cc42891f --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXString.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct { + * void* data; + * unsigned int private_flags; + * }; + * } + */ +public class CXString { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ); + public static MemoryLayout $LAYOUT() { + return CXString.$struct$LAYOUT; + } + static final VarHandle data$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("data")); + public static VarHandle data$VH() { + return CXString.data$VH; + } + /** + * Getter for field: + * {@snippet : + * void* data; + * } + */ + public static MemorySegment data$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)CXString.data$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * void* data; + * } + */ + public static void data$set(MemorySegment seg, MemorySegment x) { + CXString.data$VH.set(seg, x); + } + public static MemorySegment data$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)CXString.data$VH.get(seg.asSlice(index*sizeof())); + } + public static void data$set(MemorySegment seg, long index, MemorySegment x) { + CXString.data$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle private_flags$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("private_flags")); + public static VarHandle private_flags$VH() { + return CXString.private_flags$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned int private_flags; + * } + */ + public static int private_flags$get(MemorySegment seg) { + return (int)CXString.private_flags$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int private_flags; + * } + */ + public static void private_flags$set(MemorySegment seg, int x) { + CXString.private_flags$VH.set(seg, x); + } + public static int private_flags$get(MemorySegment seg, long index) { + return (int)CXString.private_flags$VH.get(seg.asSlice(index*sizeof())); + } + public static void private_flags$set(MemorySegment seg, long index, int x) { + CXString.private_flags$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXToken.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXToken.java new file mode 100644 index 00000000..3434bcbb --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXToken.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct { + * unsigned int int_data[4]; + * void* ptr_data; + * }; + * } + */ +public class CXToken { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(4, Constants$root.C_INT$LAYOUT).withName("int_data"), + Constants$root.C_POINTER$LAYOUT.withName("ptr_data") + ); + public static MemoryLayout $LAYOUT() { + return CXToken.$struct$LAYOUT; + } + public static MemorySegment int_data$slice(MemorySegment seg) { + return seg.asSlice(0, 16); + } + static final VarHandle ptr_data$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ptr_data")); + public static VarHandle ptr_data$VH() { + return CXToken.ptr_data$VH; + } + /** + * Getter for field: + * {@snippet : + * void* ptr_data; + * } + */ + public static MemorySegment ptr_data$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)CXToken.ptr_data$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * void* ptr_data; + * } + */ + public static void ptr_data$set(MemorySegment seg, MemorySegment x) { + CXToken.ptr_data$VH.set(seg, x); + } + public static MemorySegment ptr_data$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)CXToken.ptr_data$VH.get(seg.asSlice(index*sizeof())); + } + public static void ptr_data$set(MemorySegment seg, long index, MemorySegment x) { + CXToken.ptr_data$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXType.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXType.java new file mode 100644 index 00000000..24a2565f --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXType.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct { + * enum CXTypeKind kind; + * void* data[2]; + * }; + * } + */ +public class CXType { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ); + public static MemoryLayout $LAYOUT() { + return CXType.$struct$LAYOUT; + } + static final VarHandle kind$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("kind")); + public static VarHandle kind$VH() { + return CXType.kind$VH; + } + /** + * Getter for field: + * {@snippet : + * enum CXTypeKind kind; + * } + */ + public static int kind$get(MemorySegment seg) { + return (int)CXType.kind$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * enum CXTypeKind kind; + * } + */ + public static void kind$set(MemorySegment seg, int x) { + CXType.kind$VH.set(seg, x); + } + public static int kind$get(MemorySegment seg, long index) { + return (int)CXType.kind$VH.get(seg.asSlice(index*sizeof())); + } + public static void kind$set(MemorySegment seg, long index, int x) { + CXType.kind$VH.set(seg.asSlice(index*sizeof()), x); + } + public static MemorySegment data$slice(MemorySegment seg) { + return seg.asSlice(8, 16); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXUnsavedFile.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXUnsavedFile.java new file mode 100644 index 00000000..649d1722 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/CXUnsavedFile.java @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct CXUnsavedFile { + * char* Filename; + * char* Contents; + * unsigned long Length; + * }; + * } + */ +public class CXUnsavedFile { + + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("Filename"), + Constants$root.C_POINTER$LAYOUT.withName("Contents"), + Constants$root.C_LONG_LONG$LAYOUT.withName("Length") + ).withName("CXUnsavedFile"); + public static MemoryLayout $LAYOUT() { + return CXUnsavedFile.$struct$LAYOUT; + } + static final VarHandle Filename$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("Filename")); + public static VarHandle Filename$VH() { + return CXUnsavedFile.Filename$VH; + } + /** + * Getter for field: + * {@snippet : + * char* Filename; + * } + */ + public static MemorySegment Filename$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)CXUnsavedFile.Filename$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * char* Filename; + * } + */ + public static void Filename$set(MemorySegment seg, MemorySegment x) { + CXUnsavedFile.Filename$VH.set(seg, x); + } + public static MemorySegment Filename$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)CXUnsavedFile.Filename$VH.get(seg.asSlice(index*sizeof())); + } + public static void Filename$set(MemorySegment seg, long index, MemorySegment x) { + CXUnsavedFile.Filename$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle Contents$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("Contents")); + public static VarHandle Contents$VH() { + return CXUnsavedFile.Contents$VH; + } + /** + * Getter for field: + * {@snippet : + * char* Contents; + * } + */ + public static MemorySegment Contents$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)CXUnsavedFile.Contents$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * char* Contents; + * } + */ + public static void Contents$set(MemorySegment seg, MemorySegment x) { + CXUnsavedFile.Contents$VH.set(seg, x); + } + public static MemorySegment Contents$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)CXUnsavedFile.Contents$VH.get(seg.asSlice(index*sizeof())); + } + public static void Contents$set(MemorySegment seg, long index, MemorySegment x) { + CXUnsavedFile.Contents$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle Length$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("Length")); + public static VarHandle Length$VH() { + return CXUnsavedFile.Length$VH; + } + /** + * Getter for field: + * {@snippet : + * unsigned long Length; + * } + */ + public static long Length$get(MemorySegment seg) { + return (long)CXUnsavedFile.Length$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned long Length; + * } + */ + public static void Length$set(MemorySegment seg, long x) { + CXUnsavedFile.Length$VH.set(seg, x); + } + public static long Length$get(MemorySegment seg, long index) { + return (long)CXUnsavedFile.Length$VH.get(seg.asSlice(index*sizeof())); + } + public static void Length$set(MemorySegment seg, long index, long x) { + CXUnsavedFile.Length$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/Constants$root.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/Constants$root.java new file mode 100644 index 00000000..856e922d --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/Constants$root.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class Constants$root { + + // Suppresses default constructor, ensuring non-instantiability. + private Constants$root() {} + static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN; + static final OfByte C_CHAR$LAYOUT = JAVA_BYTE; + static final OfShort C_SHORT$LAYOUT = JAVA_SHORT; + static final OfInt C_INT$LAYOUT = JAVA_INT; + static final OfLong C_LONG$LAYOUT = JAVA_LONG; + static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG; + static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT; + static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE; + static final AddressLayout C_POINTER$LAYOUT = ADDRESS + .withTargetLayout(MemoryLayout.sequenceLayout(C_CHAR$LAYOUT)); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java new file mode 100644 index 00000000..5dda0010 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/Index_h.java @@ -0,0 +1,5910 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +public class Index_h { + + public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; + public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; + public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; + public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; + public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; + public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; + public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; + public static final AddressLayout C_POINTER = Constants$root.C_POINTER$LAYOUT; + /** + * {@snippet : + * enum CXErrorCode.CXError_Success = 0; + * } + */ + public static int CXError_Success() { + return (int)0L; + } + /** + * {@snippet : + * enum CXErrorCode.CXError_Failure = 1; + * } + */ + public static int CXError_Failure() { + return (int)1L; + } + /** + * {@snippet : + * enum CXErrorCode.CXError_Crashed = 2; + * } + */ + public static int CXError_Crashed() { + return (int)2L; + } + /** + * {@snippet : + * enum CXErrorCode.CXError_InvalidArguments = 3; + * } + */ + public static int CXError_InvalidArguments() { + return (int)3L; + } + /** + * {@snippet : + * enum CXErrorCode.CXError_ASTReadError = 4; + * } + */ + public static int CXError_ASTReadError() { + return (int)4L; + } + public static MethodHandle clang_getCString$MH() { + return RuntimeHelper.requireNonNull(constants$0.clang_getCString$MH,"clang_getCString"); + } + /** + * {@snippet : + * char* clang_getCString(CXString string); + * } + */ + public static MemorySegment clang_getCString(MemorySegment string) { + var mh$ = clang_getCString$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(string); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_disposeString$MH() { + return RuntimeHelper.requireNonNull(constants$0.clang_disposeString$MH,"clang_disposeString"); + } + /** + * {@snippet : + * void clang_disposeString(CXString string); + * } + */ + public static void clang_disposeString(MemorySegment string) { + var mh$ = clang_disposeString$MH(); + try { + mh$.invokeExact(string); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * typedef void* CXIndex; + * } + */ + public static final AddressLayout CXIndex = Constants$root.C_POINTER$LAYOUT; + /** + * {@snippet : + * typedef struct CXTranslationUnitImpl* CXTranslationUnit; + * } + */ + public static final AddressLayout CXTranslationUnit = Constants$root.C_POINTER$LAYOUT; + /** + * {@snippet : + * enum CXCursor_ExceptionSpecificationKind.CXCursor_ExceptionSpecificationKind_None = 0; + * } + */ + public static int CXCursor_ExceptionSpecificationKind_None() { + return (int)0L; + } + /** + * {@snippet : + * enum CXCursor_ExceptionSpecificationKind.CXCursor_ExceptionSpecificationKind_DynamicNone = 1; + * } + */ + public static int CXCursor_ExceptionSpecificationKind_DynamicNone() { + return (int)1L; + } + /** + * {@snippet : + * enum CXCursor_ExceptionSpecificationKind.CXCursor_ExceptionSpecificationKind_Dynamic = 2; + * } + */ + public static int CXCursor_ExceptionSpecificationKind_Dynamic() { + return (int)2L; + } + /** + * {@snippet : + * enum CXCursor_ExceptionSpecificationKind.CXCursor_ExceptionSpecificationKind_MSAny = 3; + * } + */ + public static int CXCursor_ExceptionSpecificationKind_MSAny() { + return (int)3L; + } + /** + * {@snippet : + * enum CXCursor_ExceptionSpecificationKind.CXCursor_ExceptionSpecificationKind_BasicNoexcept = 4; + * } + */ + public static int CXCursor_ExceptionSpecificationKind_BasicNoexcept() { + return (int)4L; + } + /** + * {@snippet : + * enum CXCursor_ExceptionSpecificationKind.CXCursor_ExceptionSpecificationKind_ComputedNoexcept = 5; + * } + */ + public static int CXCursor_ExceptionSpecificationKind_ComputedNoexcept() { + return (int)5L; + } + /** + * {@snippet : + * enum CXCursor_ExceptionSpecificationKind.CXCursor_ExceptionSpecificationKind_Unevaluated = 6; + * } + */ + public static int CXCursor_ExceptionSpecificationKind_Unevaluated() { + return (int)6L; + } + /** + * {@snippet : + * enum CXCursor_ExceptionSpecificationKind.CXCursor_ExceptionSpecificationKind_Uninstantiated = 7; + * } + */ + public static int CXCursor_ExceptionSpecificationKind_Uninstantiated() { + return (int)7L; + } + /** + * {@snippet : + * enum CXCursor_ExceptionSpecificationKind.CXCursor_ExceptionSpecificationKind_Unparsed = 8; + * } + */ + public static int CXCursor_ExceptionSpecificationKind_Unparsed() { + return (int)8L; + } + /** + * {@snippet : + * enum CXCursor_ExceptionSpecificationKind.CXCursor_ExceptionSpecificationKind_NoThrow = 9; + * } + */ + public static int CXCursor_ExceptionSpecificationKind_NoThrow() { + return (int)9L; + } + public static MethodHandle clang_createIndex$MH() { + return RuntimeHelper.requireNonNull(constants$0.clang_createIndex$MH,"clang_createIndex"); + } + /** + * {@snippet : + * CXIndex clang_createIndex(int excludeDeclarationsFromPCH, int displayDiagnostics); + * } + */ + public static MemorySegment clang_createIndex(int excludeDeclarationsFromPCH, int displayDiagnostics) { + var mh$ = clang_createIndex$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(excludeDeclarationsFromPCH, displayDiagnostics); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_disposeIndex$MH() { + return RuntimeHelper.requireNonNull(constants$0.clang_disposeIndex$MH,"clang_disposeIndex"); + } + /** + * {@snippet : + * void clang_disposeIndex(CXIndex index); + * } + */ + public static void clang_disposeIndex(MemorySegment index) { + var mh$ = clang_disposeIndex$MH(); + try { + mh$.invokeExact(index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getFileName$MH() { + return RuntimeHelper.requireNonNull(constants$0.clang_getFileName$MH,"clang_getFileName"); + } + /** + * {@snippet : + * CXString clang_getFileName(CXFile SFile); + * } + */ + public static MemorySegment clang_getFileName(SegmentAllocator allocator, MemorySegment SFile) { + var mh$ = clang_getFileName$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, SFile); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getNullLocation$MH() { + return RuntimeHelper.requireNonNull(constants$0.clang_getNullLocation$MH,"clang_getNullLocation"); + } + /** + * {@snippet : + * CXSourceLocation clang_getNullLocation(); + * } + */ + public static MemorySegment clang_getNullLocation(SegmentAllocator allocator) { + var mh$ = clang_getNullLocation$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_equalLocations$MH() { + return RuntimeHelper.requireNonNull(constants$1.clang_equalLocations$MH,"clang_equalLocations"); + } + /** + * {@snippet : + * unsigned int clang_equalLocations(CXSourceLocation loc1, CXSourceLocation loc2); + * } + */ + public static int clang_equalLocations(MemorySegment loc1, MemorySegment loc2) { + var mh$ = clang_equalLocations$MH(); + try { + return (int)mh$.invokeExact(loc1, loc2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getLocation$MH() { + return RuntimeHelper.requireNonNull(constants$1.clang_getLocation$MH,"clang_getLocation"); + } + /** + * {@snippet : + * CXSourceLocation clang_getLocation(CXTranslationUnit tu, CXFile file, unsigned int line, unsigned int column); + * } + */ + public static MemorySegment clang_getLocation(SegmentAllocator allocator, MemorySegment tu, MemorySegment file, int line, int column) { + var mh$ = clang_getLocation$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, tu, file, line, column); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getLocationForOffset$MH() { + return RuntimeHelper.requireNonNull(constants$1.clang_getLocationForOffset$MH,"clang_getLocationForOffset"); + } + /** + * {@snippet : + * CXSourceLocation clang_getLocationForOffset(CXTranslationUnit tu, CXFile file, unsigned int offset); + * } + */ + public static MemorySegment clang_getLocationForOffset(SegmentAllocator allocator, MemorySegment tu, MemorySegment file, int offset) { + var mh$ = clang_getLocationForOffset$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, tu, file, offset); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Location_isInSystemHeader$MH() { + return RuntimeHelper.requireNonNull(constants$1.clang_Location_isInSystemHeader$MH,"clang_Location_isInSystemHeader"); + } + /** + * {@snippet : + * int clang_Location_isInSystemHeader(CXSourceLocation location); + * } + */ + public static int clang_Location_isInSystemHeader(MemorySegment location) { + var mh$ = clang_Location_isInSystemHeader$MH(); + try { + return (int)mh$.invokeExact(location); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Location_isFromMainFile$MH() { + return RuntimeHelper.requireNonNull(constants$1.clang_Location_isFromMainFile$MH,"clang_Location_isFromMainFile"); + } + /** + * {@snippet : + * int clang_Location_isFromMainFile(CXSourceLocation location); + * } + */ + public static int clang_Location_isFromMainFile(MemorySegment location) { + var mh$ = clang_Location_isFromMainFile$MH(); + try { + return (int)mh$.invokeExact(location); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Range_isNull$MH() { + return RuntimeHelper.requireNonNull(constants$1.clang_Range_isNull$MH,"clang_Range_isNull"); + } + /** + * {@snippet : + * int clang_Range_isNull(CXSourceRange range); + * } + */ + public static int clang_Range_isNull(MemorySegment range) { + var mh$ = clang_Range_isNull$MH(); + try { + return (int)mh$.invokeExact(range); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getExpansionLocation$MH() { + return RuntimeHelper.requireNonNull(constants$2.clang_getExpansionLocation$MH,"clang_getExpansionLocation"); + } + /** + * {@snippet : + * void clang_getExpansionLocation(CXSourceLocation location, CXFile* file, unsigned int* line, unsigned int* column, unsigned int* offset); + * } + */ + public static void clang_getExpansionLocation(MemorySegment location, MemorySegment file, MemorySegment line, MemorySegment column, MemorySegment offset) { + var mh$ = clang_getExpansionLocation$MH(); + try { + mh$.invokeExact(location, file, line, column, offset); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getSpellingLocation$MH() { + return RuntimeHelper.requireNonNull(constants$2.clang_getSpellingLocation$MH,"clang_getSpellingLocation"); + } + /** + * {@snippet : + * void clang_getSpellingLocation(CXSourceLocation location, CXFile* file, unsigned int* line, unsigned int* column, unsigned int* offset); + * } + */ + public static void clang_getSpellingLocation(MemorySegment location, MemorySegment file, MemorySegment line, MemorySegment column, MemorySegment offset) { + var mh$ = clang_getSpellingLocation$MH(); + try { + mh$.invokeExact(location, file, line, column, offset); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getFileLocation$MH() { + return RuntimeHelper.requireNonNull(constants$2.clang_getFileLocation$MH,"clang_getFileLocation"); + } + /** + * {@snippet : + * void clang_getFileLocation(CXSourceLocation location, CXFile* file, unsigned int* line, unsigned int* column, unsigned int* offset); + * } + */ + public static void clang_getFileLocation(MemorySegment location, MemorySegment file, MemorySegment line, MemorySegment column, MemorySegment offset) { + var mh$ = clang_getFileLocation$MH(); + try { + mh$.invokeExact(location, file, line, column, offset); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getRangeStart$MH() { + return RuntimeHelper.requireNonNull(constants$2.clang_getRangeStart$MH,"clang_getRangeStart"); + } + /** + * {@snippet : + * CXSourceLocation clang_getRangeStart(CXSourceRange range); + * } + */ + public static MemorySegment clang_getRangeStart(SegmentAllocator allocator, MemorySegment range) { + var mh$ = clang_getRangeStart$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, range); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getRangeEnd$MH() { + return RuntimeHelper.requireNonNull(constants$2.clang_getRangeEnd$MH,"clang_getRangeEnd"); + } + /** + * {@snippet : + * CXSourceLocation clang_getRangeEnd(CXSourceRange range); + * } + */ + public static MemorySegment clang_getRangeEnd(SegmentAllocator allocator, MemorySegment range) { + var mh$ = clang_getRangeEnd$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, range); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXDiagnosticSeverity.CXDiagnostic_Ignored = 0; + * } + */ + public static int CXDiagnostic_Ignored() { + return (int)0L; + } + /** + * {@snippet : + * enum CXDiagnosticSeverity.CXDiagnostic_Note = 1; + * } + */ + public static int CXDiagnostic_Note() { + return (int)1L; + } + /** + * {@snippet : + * enum CXDiagnosticSeverity.CXDiagnostic_Warning = 2; + * } + */ + public static int CXDiagnostic_Warning() { + return (int)2L; + } + /** + * {@snippet : + * enum CXDiagnosticSeverity.CXDiagnostic_Error = 3; + * } + */ + public static int CXDiagnostic_Error() { + return (int)3L; + } + /** + * {@snippet : + * enum CXDiagnosticSeverity.CXDiagnostic_Fatal = 4; + * } + */ + public static int CXDiagnostic_Fatal() { + return (int)4L; + } + public static MethodHandle clang_getChildDiagnostics$MH() { + return RuntimeHelper.requireNonNull(constants$2.clang_getChildDiagnostics$MH,"clang_getChildDiagnostics"); + } + /** + * {@snippet : + * CXDiagnosticSet clang_getChildDiagnostics(CXDiagnostic D); + * } + */ + public static MemorySegment clang_getChildDiagnostics(MemorySegment D) { + var mh$ = clang_getChildDiagnostics$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(D); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getNumDiagnostics$MH() { + return RuntimeHelper.requireNonNull(constants$3.clang_getNumDiagnostics$MH,"clang_getNumDiagnostics"); + } + /** + * {@snippet : + * unsigned int clang_getNumDiagnostics(CXTranslationUnit Unit); + * } + */ + public static int clang_getNumDiagnostics(MemorySegment Unit) { + var mh$ = clang_getNumDiagnostics$MH(); + try { + return (int)mh$.invokeExact(Unit); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getDiagnostic$MH() { + return RuntimeHelper.requireNonNull(constants$3.clang_getDiagnostic$MH,"clang_getDiagnostic"); + } + /** + * {@snippet : + * CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, unsigned int Index); + * } + */ + public static MemorySegment clang_getDiagnostic(MemorySegment Unit, int Index) { + var mh$ = clang_getDiagnostic$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(Unit, Index); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_disposeDiagnostic$MH() { + return RuntimeHelper.requireNonNull(constants$3.clang_disposeDiagnostic$MH,"clang_disposeDiagnostic"); + } + /** + * {@snippet : + * void clang_disposeDiagnostic(CXDiagnostic Diagnostic); + * } + */ + public static void clang_disposeDiagnostic(MemorySegment Diagnostic) { + var mh$ = clang_disposeDiagnostic$MH(); + try { + mh$.invokeExact(Diagnostic); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXDiagnosticDisplayOptions.CXDiagnostic_DisplaySourceLocation = 1; + * } + */ + public static int CXDiagnostic_DisplaySourceLocation() { + return (int)1L; + } + /** + * {@snippet : + * enum CXDiagnosticDisplayOptions.CXDiagnostic_DisplayColumn = 2; + * } + */ + public static int CXDiagnostic_DisplayColumn() { + return (int)2L; + } + /** + * {@snippet : + * enum CXDiagnosticDisplayOptions.CXDiagnostic_DisplaySourceRanges = 4; + * } + */ + public static int CXDiagnostic_DisplaySourceRanges() { + return (int)4L; + } + /** + * {@snippet : + * enum CXDiagnosticDisplayOptions.CXDiagnostic_DisplayOption = 8; + * } + */ + public static int CXDiagnostic_DisplayOption() { + return (int)8L; + } + /** + * {@snippet : + * enum CXDiagnosticDisplayOptions.CXDiagnostic_DisplayCategoryId = 16; + * } + */ + public static int CXDiagnostic_DisplayCategoryId() { + return (int)16L; + } + /** + * {@snippet : + * enum CXDiagnosticDisplayOptions.CXDiagnostic_DisplayCategoryName = 32; + * } + */ + public static int CXDiagnostic_DisplayCategoryName() { + return (int)32L; + } + public static MethodHandle clang_formatDiagnostic$MH() { + return RuntimeHelper.requireNonNull(constants$3.clang_formatDiagnostic$MH,"clang_formatDiagnostic"); + } + /** + * {@snippet : + * CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, unsigned int Options); + * } + */ + public static MemorySegment clang_formatDiagnostic(SegmentAllocator allocator, MemorySegment Diagnostic, int Options) { + var mh$ = clang_formatDiagnostic$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, Diagnostic, Options); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_defaultDiagnosticDisplayOptions$MH() { + return RuntimeHelper.requireNonNull(constants$3.clang_defaultDiagnosticDisplayOptions$MH,"clang_defaultDiagnosticDisplayOptions"); + } + /** + * {@snippet : + * unsigned int clang_defaultDiagnosticDisplayOptions(); + * } + */ + public static int clang_defaultDiagnosticDisplayOptions() { + var mh$ = clang_defaultDiagnosticDisplayOptions$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getDiagnosticSeverity$MH() { + return RuntimeHelper.requireNonNull(constants$3.clang_getDiagnosticSeverity$MH,"clang_getDiagnosticSeverity"); + } + /** + * {@snippet : + * enum CXDiagnosticSeverity clang_getDiagnosticSeverity(CXDiagnostic); + * } + */ + public static int clang_getDiagnosticSeverity(MemorySegment x0) { + var mh$ = clang_getDiagnosticSeverity$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getDiagnosticLocation$MH() { + return RuntimeHelper.requireNonNull(constants$4.clang_getDiagnosticLocation$MH,"clang_getDiagnosticLocation"); + } + /** + * {@snippet : + * CXSourceLocation clang_getDiagnosticLocation(CXDiagnostic); + * } + */ + public static MemorySegment clang_getDiagnosticLocation(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_getDiagnosticLocation$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getDiagnosticSpelling$MH() { + return RuntimeHelper.requireNonNull(constants$4.clang_getDiagnosticSpelling$MH,"clang_getDiagnosticSpelling"); + } + /** + * {@snippet : + * CXString clang_getDiagnosticSpelling(CXDiagnostic); + * } + */ + public static MemorySegment clang_getDiagnosticSpelling(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_getDiagnosticSpelling$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_None = 0; + * } + */ + public static int CXTranslationUnit_None() { + return (int)0L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_DetailedPreprocessingRecord = 1; + * } + */ + public static int CXTranslationUnit_DetailedPreprocessingRecord() { + return (int)1L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_Incomplete = 2; + * } + */ + public static int CXTranslationUnit_Incomplete() { + return (int)2L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_PrecompiledPreamble = 4; + * } + */ + public static int CXTranslationUnit_PrecompiledPreamble() { + return (int)4L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_CacheCompletionResults = 8; + * } + */ + public static int CXTranslationUnit_CacheCompletionResults() { + return (int)8L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_ForSerialization = 16; + * } + */ + public static int CXTranslationUnit_ForSerialization() { + return (int)16L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_CXXChainedPCH = 32; + * } + */ + public static int CXTranslationUnit_CXXChainedPCH() { + return (int)32L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_SkipFunctionBodies = 64; + * } + */ + public static int CXTranslationUnit_SkipFunctionBodies() { + return (int)64L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_IncludeBriefCommentsInCodeCompletion = 128; + * } + */ + public static int CXTranslationUnit_IncludeBriefCommentsInCodeCompletion() { + return (int)128L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_CreatePreambleOnFirstParse = 256; + * } + */ + public static int CXTranslationUnit_CreatePreambleOnFirstParse() { + return (int)256L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_KeepGoing = 512; + * } + */ + public static int CXTranslationUnit_KeepGoing() { + return (int)512L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_SingleFileParse = 1024; + * } + */ + public static int CXTranslationUnit_SingleFileParse() { + return (int)1024L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_LimitSkipFunctionBodiesToPreamble = 2048; + * } + */ + public static int CXTranslationUnit_LimitSkipFunctionBodiesToPreamble() { + return (int)2048L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_IncludeAttributedTypes = 4096; + * } + */ + public static int CXTranslationUnit_IncludeAttributedTypes() { + return (int)4096L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_VisitImplicitAttributes = 8192; + * } + */ + public static int CXTranslationUnit_VisitImplicitAttributes() { + return (int)8192L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles = 16384; + * } + */ + public static int CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles() { + return (int)16384L; + } + /** + * {@snippet : + * enum CXTranslationUnit_Flags.CXTranslationUnit_RetainExcludedConditionalBlocks = 32768; + * } + */ + public static int CXTranslationUnit_RetainExcludedConditionalBlocks() { + return (int)32768L; + } + public static MethodHandle clang_parseTranslationUnit$MH() { + return RuntimeHelper.requireNonNull(constants$4.clang_parseTranslationUnit$MH,"clang_parseTranslationUnit"); + } + /** + * {@snippet : + * CXTranslationUnit clang_parseTranslationUnit(CXIndex CIdx, char* source_filename, char** command_line_args, int num_command_line_args, struct CXUnsavedFile* unsaved_files, unsigned int num_unsaved_files, unsigned int options); + * } + */ + public static MemorySegment clang_parseTranslationUnit(MemorySegment CIdx, MemorySegment source_filename, MemorySegment command_line_args, int num_command_line_args, MemorySegment unsaved_files, int num_unsaved_files, int options) { + var mh$ = clang_parseTranslationUnit$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(CIdx, source_filename, command_line_args, num_command_line_args, unsaved_files, num_unsaved_files, options); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_parseTranslationUnit2$MH() { + return RuntimeHelper.requireNonNull(constants$4.clang_parseTranslationUnit2$MH,"clang_parseTranslationUnit2"); + } + /** + * {@snippet : + * enum CXErrorCode clang_parseTranslationUnit2(CXIndex CIdx, char* source_filename, char** command_line_args, int num_command_line_args, struct CXUnsavedFile* unsaved_files, unsigned int num_unsaved_files, unsigned int options, CXTranslationUnit* out_TU); + * } + */ + public static int clang_parseTranslationUnit2(MemorySegment CIdx, MemorySegment source_filename, MemorySegment command_line_args, int num_command_line_args, MemorySegment unsaved_files, int num_unsaved_files, int options, MemorySegment out_TU) { + var mh$ = clang_parseTranslationUnit2$MH(); + try { + return (int)mh$.invokeExact(CIdx, source_filename, command_line_args, num_command_line_args, unsaved_files, num_unsaved_files, options, out_TU); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXSaveTranslationUnit_Flags.CXSaveTranslationUnit_None = 0; + * } + */ + public static int CXSaveTranslationUnit_None() { + return (int)0L; + } + /** + * {@snippet : + * enum CXSaveError.CXSaveError_None = 0; + * } + */ + public static int CXSaveError_None() { + return (int)0L; + } + /** + * {@snippet : + * enum CXSaveError.CXSaveError_Unknown = 1; + * } + */ + public static int CXSaveError_Unknown() { + return (int)1L; + } + /** + * {@snippet : + * enum CXSaveError.CXSaveError_TranslationErrors = 2; + * } + */ + public static int CXSaveError_TranslationErrors() { + return (int)2L; + } + /** + * {@snippet : + * enum CXSaveError.CXSaveError_InvalidTU = 3; + * } + */ + public static int CXSaveError_InvalidTU() { + return (int)3L; + } + public static MethodHandle clang_saveTranslationUnit$MH() { + return RuntimeHelper.requireNonNull(constants$4.clang_saveTranslationUnit$MH,"clang_saveTranslationUnit"); + } + /** + * {@snippet : + * int clang_saveTranslationUnit(CXTranslationUnit TU, char* FileName, unsigned int options); + * } + */ + public static int clang_saveTranslationUnit(MemorySegment TU, MemorySegment FileName, int options) { + var mh$ = clang_saveTranslationUnit$MH(); + try { + return (int)mh$.invokeExact(TU, FileName, options); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_disposeTranslationUnit$MH() { + return RuntimeHelper.requireNonNull(constants$4.clang_disposeTranslationUnit$MH,"clang_disposeTranslationUnit"); + } + /** + * {@snippet : + * void clang_disposeTranslationUnit(CXTranslationUnit); + * } + */ + public static void clang_disposeTranslationUnit(MemorySegment x0) { + var mh$ = clang_disposeTranslationUnit$MH(); + try { + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXReparse_Flags.CXReparse_None = 0; + * } + */ + public static int CXReparse_None() { + return (int)0L; + } + public static MethodHandle clang_defaultReparseOptions$MH() { + return RuntimeHelper.requireNonNull(constants$5.clang_defaultReparseOptions$MH,"clang_defaultReparseOptions"); + } + /** + * {@snippet : + * unsigned int clang_defaultReparseOptions(CXTranslationUnit TU); + * } + */ + public static int clang_defaultReparseOptions(MemorySegment TU) { + var mh$ = clang_defaultReparseOptions$MH(); + try { + return (int)mh$.invokeExact(TU); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_reparseTranslationUnit$MH() { + return RuntimeHelper.requireNonNull(constants$5.clang_reparseTranslationUnit$MH,"clang_reparseTranslationUnit"); + } + /** + * {@snippet : + * int clang_reparseTranslationUnit(CXTranslationUnit TU, unsigned int num_unsaved_files, struct CXUnsavedFile* unsaved_files, unsigned int options); + * } + */ + public static int clang_reparseTranslationUnit(MemorySegment TU, int num_unsaved_files, MemorySegment unsaved_files, int options) { + var mh$ = clang_reparseTranslationUnit$MH(); + try { + return (int)mh$.invokeExact(TU, num_unsaved_files, unsaved_files, options); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_UnexposedDecl = 1; + * } + */ + public static int CXCursor_UnexposedDecl() { + return (int)1L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_StructDecl = 2; + * } + */ + public static int CXCursor_StructDecl() { + return (int)2L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_UnionDecl = 3; + * } + */ + public static int CXCursor_UnionDecl() { + return (int)3L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ClassDecl = 4; + * } + */ + public static int CXCursor_ClassDecl() { + return (int)4L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_EnumDecl = 5; + * } + */ + public static int CXCursor_EnumDecl() { + return (int)5L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FieldDecl = 6; + * } + */ + public static int CXCursor_FieldDecl() { + return (int)6L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_EnumConstantDecl = 7; + * } + */ + public static int CXCursor_EnumConstantDecl() { + return (int)7L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FunctionDecl = 8; + * } + */ + public static int CXCursor_FunctionDecl() { + return (int)8L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_VarDecl = 9; + * } + */ + public static int CXCursor_VarDecl() { + return (int)9L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ParmDecl = 10; + * } + */ + public static int CXCursor_ParmDecl() { + return (int)10L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCInterfaceDecl = 11; + * } + */ + public static int CXCursor_ObjCInterfaceDecl() { + return (int)11L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCCategoryDecl = 12; + * } + */ + public static int CXCursor_ObjCCategoryDecl() { + return (int)12L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCProtocolDecl = 13; + * } + */ + public static int CXCursor_ObjCProtocolDecl() { + return (int)13L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCPropertyDecl = 14; + * } + */ + public static int CXCursor_ObjCPropertyDecl() { + return (int)14L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCIvarDecl = 15; + * } + */ + public static int CXCursor_ObjCIvarDecl() { + return (int)15L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCInstanceMethodDecl = 16; + * } + */ + public static int CXCursor_ObjCInstanceMethodDecl() { + return (int)16L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCClassMethodDecl = 17; + * } + */ + public static int CXCursor_ObjCClassMethodDecl() { + return (int)17L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCImplementationDecl = 18; + * } + */ + public static int CXCursor_ObjCImplementationDecl() { + return (int)18L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCCategoryImplDecl = 19; + * } + */ + public static int CXCursor_ObjCCategoryImplDecl() { + return (int)19L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_TypedefDecl = 20; + * } + */ + public static int CXCursor_TypedefDecl() { + return (int)20L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXMethod = 21; + * } + */ + public static int CXCursor_CXXMethod() { + return (int)21L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_Namespace = 22; + * } + */ + public static int CXCursor_Namespace() { + return (int)22L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LinkageSpec = 23; + * } + */ + public static int CXCursor_LinkageSpec() { + return (int)23L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_Constructor = 24; + * } + */ + public static int CXCursor_Constructor() { + return (int)24L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_Destructor = 25; + * } + */ + public static int CXCursor_Destructor() { + return (int)25L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ConversionFunction = 26; + * } + */ + public static int CXCursor_ConversionFunction() { + return (int)26L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_TemplateTypeParameter = 27; + * } + */ + public static int CXCursor_TemplateTypeParameter() { + return (int)27L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NonTypeTemplateParameter = 28; + * } + */ + public static int CXCursor_NonTypeTemplateParameter() { + return (int)28L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_TemplateTemplateParameter = 29; + * } + */ + public static int CXCursor_TemplateTemplateParameter() { + return (int)29L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FunctionTemplate = 30; + * } + */ + public static int CXCursor_FunctionTemplate() { + return (int)30L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ClassTemplate = 31; + * } + */ + public static int CXCursor_ClassTemplate() { + return (int)31L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ClassTemplatePartialSpecialization = 32; + * } + */ + public static int CXCursor_ClassTemplatePartialSpecialization() { + return (int)32L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NamespaceAlias = 33; + * } + */ + public static int CXCursor_NamespaceAlias() { + return (int)33L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_UsingDirective = 34; + * } + */ + public static int CXCursor_UsingDirective() { + return (int)34L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_UsingDeclaration = 35; + * } + */ + public static int CXCursor_UsingDeclaration() { + return (int)35L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_TypeAliasDecl = 36; + * } + */ + public static int CXCursor_TypeAliasDecl() { + return (int)36L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCSynthesizeDecl = 37; + * } + */ + public static int CXCursor_ObjCSynthesizeDecl() { + return (int)37L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCDynamicDecl = 38; + * } + */ + public static int CXCursor_ObjCDynamicDecl() { + return (int)38L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXAccessSpecifier = 39; + * } + */ + public static int CXCursor_CXXAccessSpecifier() { + return (int)39L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FirstDecl = 1; + * } + */ + public static int CXCursor_FirstDecl() { + return (int)1L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LastDecl = 39; + * } + */ + public static int CXCursor_LastDecl() { + return (int)39L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FirstRef = 40; + * } + */ + public static int CXCursor_FirstRef() { + return (int)40L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCSuperClassRef = 40; + * } + */ + public static int CXCursor_ObjCSuperClassRef() { + return (int)40L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCProtocolRef = 41; + * } + */ + public static int CXCursor_ObjCProtocolRef() { + return (int)41L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCClassRef = 42; + * } + */ + public static int CXCursor_ObjCClassRef() { + return (int)42L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_TypeRef = 43; + * } + */ + public static int CXCursor_TypeRef() { + return (int)43L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXBaseSpecifier = 44; + * } + */ + public static int CXCursor_CXXBaseSpecifier() { + return (int)44L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_TemplateRef = 45; + * } + */ + public static int CXCursor_TemplateRef() { + return (int)45L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NamespaceRef = 46; + * } + */ + public static int CXCursor_NamespaceRef() { + return (int)46L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_MemberRef = 47; + * } + */ + public static int CXCursor_MemberRef() { + return (int)47L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LabelRef = 48; + * } + */ + public static int CXCursor_LabelRef() { + return (int)48L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OverloadedDeclRef = 49; + * } + */ + public static int CXCursor_OverloadedDeclRef() { + return (int)49L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_VariableRef = 50; + * } + */ + public static int CXCursor_VariableRef() { + return (int)50L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LastRef = 50; + * } + */ + public static int CXCursor_LastRef() { + return (int)50L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FirstInvalid = 70; + * } + */ + public static int CXCursor_FirstInvalid() { + return (int)70L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_InvalidFile = 70; + * } + */ + public static int CXCursor_InvalidFile() { + return (int)70L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NoDeclFound = 71; + * } + */ + public static int CXCursor_NoDeclFound() { + return (int)71L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NotImplemented = 72; + * } + */ + public static int CXCursor_NotImplemented() { + return (int)72L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_InvalidCode = 73; + * } + */ + public static int CXCursor_InvalidCode() { + return (int)73L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LastInvalid = 73; + * } + */ + public static int CXCursor_LastInvalid() { + return (int)73L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FirstExpr = 100; + * } + */ + public static int CXCursor_FirstExpr() { + return (int)100L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_UnexposedExpr = 100; + * } + */ + public static int CXCursor_UnexposedExpr() { + return (int)100L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_DeclRefExpr = 101; + * } + */ + public static int CXCursor_DeclRefExpr() { + return (int)101L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_MemberRefExpr = 102; + * } + */ + public static int CXCursor_MemberRefExpr() { + return (int)102L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CallExpr = 103; + * } + */ + public static int CXCursor_CallExpr() { + return (int)103L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCMessageExpr = 104; + * } + */ + public static int CXCursor_ObjCMessageExpr() { + return (int)104L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_BlockExpr = 105; + * } + */ + public static int CXCursor_BlockExpr() { + return (int)105L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_IntegerLiteral = 106; + * } + */ + public static int CXCursor_IntegerLiteral() { + return (int)106L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FloatingLiteral = 107; + * } + */ + public static int CXCursor_FloatingLiteral() { + return (int)107L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ImaginaryLiteral = 108; + * } + */ + public static int CXCursor_ImaginaryLiteral() { + return (int)108L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_StringLiteral = 109; + * } + */ + public static int CXCursor_StringLiteral() { + return (int)109L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CharacterLiteral = 110; + * } + */ + public static int CXCursor_CharacterLiteral() { + return (int)110L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ParenExpr = 111; + * } + */ + public static int CXCursor_ParenExpr() { + return (int)111L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_UnaryOperator = 112; + * } + */ + public static int CXCursor_UnaryOperator() { + return (int)112L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ArraySubscriptExpr = 113; + * } + */ + public static int CXCursor_ArraySubscriptExpr() { + return (int)113L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_BinaryOperator = 114; + * } + */ + public static int CXCursor_BinaryOperator() { + return (int)114L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CompoundAssignOperator = 115; + * } + */ + public static int CXCursor_CompoundAssignOperator() { + return (int)115L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ConditionalOperator = 116; + * } + */ + public static int CXCursor_ConditionalOperator() { + return (int)116L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CStyleCastExpr = 117; + * } + */ + public static int CXCursor_CStyleCastExpr() { + return (int)117L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CompoundLiteralExpr = 118; + * } + */ + public static int CXCursor_CompoundLiteralExpr() { + return (int)118L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_InitListExpr = 119; + * } + */ + public static int CXCursor_InitListExpr() { + return (int)119L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_AddrLabelExpr = 120; + * } + */ + public static int CXCursor_AddrLabelExpr() { + return (int)120L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_StmtExpr = 121; + * } + */ + public static int CXCursor_StmtExpr() { + return (int)121L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_GenericSelectionExpr = 122; + * } + */ + public static int CXCursor_GenericSelectionExpr() { + return (int)122L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_GNUNullExpr = 123; + * } + */ + public static int CXCursor_GNUNullExpr() { + return (int)123L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXStaticCastExpr = 124; + * } + */ + public static int CXCursor_CXXStaticCastExpr() { + return (int)124L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXDynamicCastExpr = 125; + * } + */ + public static int CXCursor_CXXDynamicCastExpr() { + return (int)125L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXReinterpretCastExpr = 126; + * } + */ + public static int CXCursor_CXXReinterpretCastExpr() { + return (int)126L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXConstCastExpr = 127; + * } + */ + public static int CXCursor_CXXConstCastExpr() { + return (int)127L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXFunctionalCastExpr = 128; + * } + */ + public static int CXCursor_CXXFunctionalCastExpr() { + return (int)128L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXTypeidExpr = 129; + * } + */ + public static int CXCursor_CXXTypeidExpr() { + return (int)129L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXBoolLiteralExpr = 130; + * } + */ + public static int CXCursor_CXXBoolLiteralExpr() { + return (int)130L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXNullPtrLiteralExpr = 131; + * } + */ + public static int CXCursor_CXXNullPtrLiteralExpr() { + return (int)131L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXThisExpr = 132; + * } + */ + public static int CXCursor_CXXThisExpr() { + return (int)132L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXThrowExpr = 133; + * } + */ + public static int CXCursor_CXXThrowExpr() { + return (int)133L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXNewExpr = 134; + * } + */ + public static int CXCursor_CXXNewExpr() { + return (int)134L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXDeleteExpr = 135; + * } + */ + public static int CXCursor_CXXDeleteExpr() { + return (int)135L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_UnaryExpr = 136; + * } + */ + public static int CXCursor_UnaryExpr() { + return (int)136L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCStringLiteral = 137; + * } + */ + public static int CXCursor_ObjCStringLiteral() { + return (int)137L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCEncodeExpr = 138; + * } + */ + public static int CXCursor_ObjCEncodeExpr() { + return (int)138L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCSelectorExpr = 139; + * } + */ + public static int CXCursor_ObjCSelectorExpr() { + return (int)139L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCProtocolExpr = 140; + * } + */ + public static int CXCursor_ObjCProtocolExpr() { + return (int)140L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCBridgedCastExpr = 141; + * } + */ + public static int CXCursor_ObjCBridgedCastExpr() { + return (int)141L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_PackExpansionExpr = 142; + * } + */ + public static int CXCursor_PackExpansionExpr() { + return (int)142L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_SizeOfPackExpr = 143; + * } + */ + public static int CXCursor_SizeOfPackExpr() { + return (int)143L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LambdaExpr = 144; + * } + */ + public static int CXCursor_LambdaExpr() { + return (int)144L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCBoolLiteralExpr = 145; + * } + */ + public static int CXCursor_ObjCBoolLiteralExpr() { + return (int)145L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCSelfExpr = 146; + * } + */ + public static int CXCursor_ObjCSelfExpr() { + return (int)146L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPArraySectionExpr = 147; + * } + */ + public static int CXCursor_OMPArraySectionExpr() { + return (int)147L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCAvailabilityCheckExpr = 148; + * } + */ + public static int CXCursor_ObjCAvailabilityCheckExpr() { + return (int)148L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FixedPointLiteral = 149; + * } + */ + public static int CXCursor_FixedPointLiteral() { + return (int)149L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LastExpr = 152; + * } + */ + public static int CXCursor_LastExpr() { + return (int)152L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FirstStmt = 200; + * } + */ + public static int CXCursor_FirstStmt() { + return (int)200L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_UnexposedStmt = 200; + * } + */ + public static int CXCursor_UnexposedStmt() { + return (int)200L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LabelStmt = 201; + * } + */ + public static int CXCursor_LabelStmt() { + return (int)201L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CompoundStmt = 202; + * } + */ + public static int CXCursor_CompoundStmt() { + return (int)202L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CaseStmt = 203; + * } + */ + public static int CXCursor_CaseStmt() { + return (int)203L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_DefaultStmt = 204; + * } + */ + public static int CXCursor_DefaultStmt() { + return (int)204L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_IfStmt = 205; + * } + */ + public static int CXCursor_IfStmt() { + return (int)205L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_SwitchStmt = 206; + * } + */ + public static int CXCursor_SwitchStmt() { + return (int)206L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_WhileStmt = 207; + * } + */ + public static int CXCursor_WhileStmt() { + return (int)207L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_DoStmt = 208; + * } + */ + public static int CXCursor_DoStmt() { + return (int)208L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ForStmt = 209; + * } + */ + public static int CXCursor_ForStmt() { + return (int)209L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_GotoStmt = 210; + * } + */ + public static int CXCursor_GotoStmt() { + return (int)210L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_IndirectGotoStmt = 211; + * } + */ + public static int CXCursor_IndirectGotoStmt() { + return (int)211L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ContinueStmt = 212; + * } + */ + public static int CXCursor_ContinueStmt() { + return (int)212L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_BreakStmt = 213; + * } + */ + public static int CXCursor_BreakStmt() { + return (int)213L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ReturnStmt = 214; + * } + */ + public static int CXCursor_ReturnStmt() { + return (int)214L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_GCCAsmStmt = 215; + * } + */ + public static int CXCursor_GCCAsmStmt() { + return (int)215L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_AsmStmt = 215; + * } + */ + public static int CXCursor_AsmStmt() { + return (int)215L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCAtTryStmt = 216; + * } + */ + public static int CXCursor_ObjCAtTryStmt() { + return (int)216L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCAtCatchStmt = 217; + * } + */ + public static int CXCursor_ObjCAtCatchStmt() { + return (int)217L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCAtFinallyStmt = 218; + * } + */ + public static int CXCursor_ObjCAtFinallyStmt() { + return (int)218L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCAtThrowStmt = 219; + * } + */ + public static int CXCursor_ObjCAtThrowStmt() { + return (int)219L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCAtSynchronizedStmt = 220; + * } + */ + public static int CXCursor_ObjCAtSynchronizedStmt() { + return (int)220L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCAutoreleasePoolStmt = 221; + * } + */ + public static int CXCursor_ObjCAutoreleasePoolStmt() { + return (int)221L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCForCollectionStmt = 222; + * } + */ + public static int CXCursor_ObjCForCollectionStmt() { + return (int)222L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXCatchStmt = 223; + * } + */ + public static int CXCursor_CXXCatchStmt() { + return (int)223L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXTryStmt = 224; + * } + */ + public static int CXCursor_CXXTryStmt() { + return (int)224L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXForRangeStmt = 225; + * } + */ + public static int CXCursor_CXXForRangeStmt() { + return (int)225L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_SEHTryStmt = 226; + * } + */ + public static int CXCursor_SEHTryStmt() { + return (int)226L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_SEHExceptStmt = 227; + * } + */ + public static int CXCursor_SEHExceptStmt() { + return (int)227L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_SEHFinallyStmt = 228; + * } + */ + public static int CXCursor_SEHFinallyStmt() { + return (int)228L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_MSAsmStmt = 229; + * } + */ + public static int CXCursor_MSAsmStmt() { + return (int)229L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NullStmt = 230; + * } + */ + public static int CXCursor_NullStmt() { + return (int)230L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_DeclStmt = 231; + * } + */ + public static int CXCursor_DeclStmt() { + return (int)231L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPParallelDirective = 232; + * } + */ + public static int CXCursor_OMPParallelDirective() { + return (int)232L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPSimdDirective = 233; + * } + */ + public static int CXCursor_OMPSimdDirective() { + return (int)233L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPForDirective = 234; + * } + */ + public static int CXCursor_OMPForDirective() { + return (int)234L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPSectionsDirective = 235; + * } + */ + public static int CXCursor_OMPSectionsDirective() { + return (int)235L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPSectionDirective = 236; + * } + */ + public static int CXCursor_OMPSectionDirective() { + return (int)236L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPSingleDirective = 237; + * } + */ + public static int CXCursor_OMPSingleDirective() { + return (int)237L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPParallelForDirective = 238; + * } + */ + public static int CXCursor_OMPParallelForDirective() { + return (int)238L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPParallelSectionsDirective = 239; + * } + */ + public static int CXCursor_OMPParallelSectionsDirective() { + return (int)239L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTaskDirective = 240; + * } + */ + public static int CXCursor_OMPTaskDirective() { + return (int)240L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPMasterDirective = 241; + * } + */ + public static int CXCursor_OMPMasterDirective() { + return (int)241L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPCriticalDirective = 242; + * } + */ + public static int CXCursor_OMPCriticalDirective() { + return (int)242L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTaskyieldDirective = 243; + * } + */ + public static int CXCursor_OMPTaskyieldDirective() { + return (int)243L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPBarrierDirective = 244; + * } + */ + public static int CXCursor_OMPBarrierDirective() { + return (int)244L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTaskwaitDirective = 245; + * } + */ + public static int CXCursor_OMPTaskwaitDirective() { + return (int)245L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPFlushDirective = 246; + * } + */ + public static int CXCursor_OMPFlushDirective() { + return (int)246L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_SEHLeaveStmt = 247; + * } + */ + public static int CXCursor_SEHLeaveStmt() { + return (int)247L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPOrderedDirective = 248; + * } + */ + public static int CXCursor_OMPOrderedDirective() { + return (int)248L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPAtomicDirective = 249; + * } + */ + public static int CXCursor_OMPAtomicDirective() { + return (int)249L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPForSimdDirective = 250; + * } + */ + public static int CXCursor_OMPForSimdDirective() { + return (int)250L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPParallelForSimdDirective = 251; + * } + */ + public static int CXCursor_OMPParallelForSimdDirective() { + return (int)251L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetDirective = 252; + * } + */ + public static int CXCursor_OMPTargetDirective() { + return (int)252L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTeamsDirective = 253; + * } + */ + public static int CXCursor_OMPTeamsDirective() { + return (int)253L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTaskgroupDirective = 254; + * } + */ + public static int CXCursor_OMPTaskgroupDirective() { + return (int)254L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPCancellationPointDirective = 255; + * } + */ + public static int CXCursor_OMPCancellationPointDirective() { + return (int)255L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPCancelDirective = 256; + * } + */ + public static int CXCursor_OMPCancelDirective() { + return (int)256L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetDataDirective = 257; + * } + */ + public static int CXCursor_OMPTargetDataDirective() { + return (int)257L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTaskLoopDirective = 258; + * } + */ + public static int CXCursor_OMPTaskLoopDirective() { + return (int)258L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTaskLoopSimdDirective = 259; + * } + */ + public static int CXCursor_OMPTaskLoopSimdDirective() { + return (int)259L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPDistributeDirective = 260; + * } + */ + public static int CXCursor_OMPDistributeDirective() { + return (int)260L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetEnterDataDirective = 261; + * } + */ + public static int CXCursor_OMPTargetEnterDataDirective() { + return (int)261L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetExitDataDirective = 262; + * } + */ + public static int CXCursor_OMPTargetExitDataDirective() { + return (int)262L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetParallelDirective = 263; + * } + */ + public static int CXCursor_OMPTargetParallelDirective() { + return (int)263L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetParallelForDirective = 264; + * } + */ + public static int CXCursor_OMPTargetParallelForDirective() { + return (int)264L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetUpdateDirective = 265; + * } + */ + public static int CXCursor_OMPTargetUpdateDirective() { + return (int)265L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPDistributeParallelForDirective = 266; + * } + */ + public static int CXCursor_OMPDistributeParallelForDirective() { + return (int)266L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPDistributeParallelForSimdDirective = 267; + * } + */ + public static int CXCursor_OMPDistributeParallelForSimdDirective() { + return (int)267L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPDistributeSimdDirective = 268; + * } + */ + public static int CXCursor_OMPDistributeSimdDirective() { + return (int)268L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetParallelForSimdDirective = 269; + * } + */ + public static int CXCursor_OMPTargetParallelForSimdDirective() { + return (int)269L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetSimdDirective = 270; + * } + */ + public static int CXCursor_OMPTargetSimdDirective() { + return (int)270L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTeamsDistributeDirective = 271; + * } + */ + public static int CXCursor_OMPTeamsDistributeDirective() { + return (int)271L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTeamsDistributeSimdDirective = 272; + * } + */ + public static int CXCursor_OMPTeamsDistributeSimdDirective() { + return (int)272L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTeamsDistributeParallelForSimdDirective = 273; + * } + */ + public static int CXCursor_OMPTeamsDistributeParallelForSimdDirective() { + return (int)273L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTeamsDistributeParallelForDirective = 274; + * } + */ + public static int CXCursor_OMPTeamsDistributeParallelForDirective() { + return (int)274L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetTeamsDirective = 275; + * } + */ + public static int CXCursor_OMPTargetTeamsDirective() { + return (int)275L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetTeamsDistributeDirective = 276; + * } + */ + public static int CXCursor_OMPTargetTeamsDistributeDirective() { + return (int)276L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetTeamsDistributeParallelForDirective = 277; + * } + */ + public static int CXCursor_OMPTargetTeamsDistributeParallelForDirective() { + return (int)277L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = 278; + * } + */ + public static int CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective() { + return (int)278L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPTargetTeamsDistributeSimdDirective = 279; + * } + */ + public static int CXCursor_OMPTargetTeamsDistributeSimdDirective() { + return (int)279L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_BuiltinBitCastExpr = 280; + * } + */ + public static int CXCursor_BuiltinBitCastExpr() { + return (int)280L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPMasterTaskLoopDirective = 281; + * } + */ + public static int CXCursor_OMPMasterTaskLoopDirective() { + return (int)281L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPParallelMasterTaskLoopDirective = 282; + * } + */ + public static int CXCursor_OMPParallelMasterTaskLoopDirective() { + return (int)282L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPMasterTaskLoopSimdDirective = 283; + * } + */ + public static int CXCursor_OMPMasterTaskLoopSimdDirective() { + return (int)283L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284; + * } + */ + public static int CXCursor_OMPParallelMasterTaskLoopSimdDirective() { + return (int)284L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LastStmt = 293; + * } + */ + public static int CXCursor_LastStmt() { + return (int)293L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_TranslationUnit = 300; + * } + */ + public static int CXCursor_TranslationUnit() { + return (int)300L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FirstAttr = 400; + * } + */ + public static int CXCursor_FirstAttr() { + return (int)400L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_UnexposedAttr = 400; + * } + */ + public static int CXCursor_UnexposedAttr() { + return (int)400L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_IBActionAttr = 401; + * } + */ + public static int CXCursor_IBActionAttr() { + return (int)401L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_IBOutletAttr = 402; + * } + */ + public static int CXCursor_IBOutletAttr() { + return (int)402L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_IBOutletCollectionAttr = 403; + * } + */ + public static int CXCursor_IBOutletCollectionAttr() { + return (int)403L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXFinalAttr = 404; + * } + */ + public static int CXCursor_CXXFinalAttr() { + return (int)404L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CXXOverrideAttr = 405; + * } + */ + public static int CXCursor_CXXOverrideAttr() { + return (int)405L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_AnnotateAttr = 406; + * } + */ + public static int CXCursor_AnnotateAttr() { + return (int)406L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_AsmLabelAttr = 407; + * } + */ + public static int CXCursor_AsmLabelAttr() { + return (int)407L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_PackedAttr = 408; + * } + */ + public static int CXCursor_PackedAttr() { + return (int)408L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_PureAttr = 409; + * } + */ + public static int CXCursor_PureAttr() { + return (int)409L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ConstAttr = 410; + * } + */ + public static int CXCursor_ConstAttr() { + return (int)410L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NoDuplicateAttr = 411; + * } + */ + public static int CXCursor_NoDuplicateAttr() { + return (int)411L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CUDAConstantAttr = 412; + * } + */ + public static int CXCursor_CUDAConstantAttr() { + return (int)412L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CUDADeviceAttr = 413; + * } + */ + public static int CXCursor_CUDADeviceAttr() { + return (int)413L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CUDAGlobalAttr = 414; + * } + */ + public static int CXCursor_CUDAGlobalAttr() { + return (int)414L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CUDAHostAttr = 415; + * } + */ + public static int CXCursor_CUDAHostAttr() { + return (int)415L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_CUDASharedAttr = 416; + * } + */ + public static int CXCursor_CUDASharedAttr() { + return (int)416L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_VisibilityAttr = 417; + * } + */ + public static int CXCursor_VisibilityAttr() { + return (int)417L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_DLLExport = 418; + * } + */ + public static int CXCursor_DLLExport() { + return (int)418L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_DLLImport = 419; + * } + */ + public static int CXCursor_DLLImport() { + return (int)419L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NSReturnsRetained = 420; + * } + */ + public static int CXCursor_NSReturnsRetained() { + return (int)420L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NSReturnsNotRetained = 421; + * } + */ + public static int CXCursor_NSReturnsNotRetained() { + return (int)421L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NSReturnsAutoreleased = 422; + * } + */ + public static int CXCursor_NSReturnsAutoreleased() { + return (int)422L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NSConsumesSelf = 423; + * } + */ + public static int CXCursor_NSConsumesSelf() { + return (int)423L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_NSConsumed = 424; + * } + */ + public static int CXCursor_NSConsumed() { + return (int)424L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCException = 425; + * } + */ + public static int CXCursor_ObjCException() { + return (int)425L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCNSObject = 426; + * } + */ + public static int CXCursor_ObjCNSObject() { + return (int)426L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCIndependentClass = 427; + * } + */ + public static int CXCursor_ObjCIndependentClass() { + return (int)427L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCPreciseLifetime = 428; + * } + */ + public static int CXCursor_ObjCPreciseLifetime() { + return (int)428L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCReturnsInnerPointer = 429; + * } + */ + public static int CXCursor_ObjCReturnsInnerPointer() { + return (int)429L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCRequiresSuper = 430; + * } + */ + public static int CXCursor_ObjCRequiresSuper() { + return (int)430L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCRootClass = 431; + * } + */ + public static int CXCursor_ObjCRootClass() { + return (int)431L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCSubclassingRestricted = 432; + * } + */ + public static int CXCursor_ObjCSubclassingRestricted() { + return (int)432L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCExplicitProtocolImpl = 433; + * } + */ + public static int CXCursor_ObjCExplicitProtocolImpl() { + return (int)433L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCDesignatedInitializer = 434; + * } + */ + public static int CXCursor_ObjCDesignatedInitializer() { + return (int)434L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCRuntimeVisible = 435; + * } + */ + public static int CXCursor_ObjCRuntimeVisible() { + return (int)435L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ObjCBoxable = 436; + * } + */ + public static int CXCursor_ObjCBoxable() { + return (int)436L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FlagEnum = 437; + * } + */ + public static int CXCursor_FlagEnum() { + return (int)437L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ConvergentAttr = 438; + * } + */ + public static int CXCursor_ConvergentAttr() { + return (int)438L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_WarnUnusedAttr = 439; + * } + */ + public static int CXCursor_WarnUnusedAttr() { + return (int)439L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_WarnUnusedResultAttr = 440; + * } + */ + public static int CXCursor_WarnUnusedResultAttr() { + return (int)440L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_AlignedAttr = 441; + * } + */ + public static int CXCursor_AlignedAttr() { + return (int)441L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LastAttr = 441; + * } + */ + public static int CXCursor_LastAttr() { + return (int)441L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_PreprocessingDirective = 500; + * } + */ + public static int CXCursor_PreprocessingDirective() { + return (int)500L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_MacroDefinition = 501; + * } + */ + public static int CXCursor_MacroDefinition() { + return (int)501L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_MacroExpansion = 502; + * } + */ + public static int CXCursor_MacroExpansion() { + return (int)502L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_MacroInstantiation = 502; + * } + */ + public static int CXCursor_MacroInstantiation() { + return (int)502L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_InclusionDirective = 503; + * } + */ + public static int CXCursor_InclusionDirective() { + return (int)503L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FirstPreprocessing = 500; + * } + */ + public static int CXCursor_FirstPreprocessing() { + return (int)500L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LastPreprocessing = 503; + * } + */ + public static int CXCursor_LastPreprocessing() { + return (int)503L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_ModuleImportDecl = 600; + * } + */ + public static int CXCursor_ModuleImportDecl() { + return (int)600L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_TypeAliasTemplateDecl = 601; + * } + */ + public static int CXCursor_TypeAliasTemplateDecl() { + return (int)601L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_StaticAssert = 602; + * } + */ + public static int CXCursor_StaticAssert() { + return (int)602L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FriendDecl = 603; + * } + */ + public static int CXCursor_FriendDecl() { + return (int)603L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_FirstExtraDecl = 600; + * } + */ + public static int CXCursor_FirstExtraDecl() { + return (int)600L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_LastExtraDecl = 603; + * } + */ + public static int CXCursor_LastExtraDecl() { + return (int)603L; + } + /** + * {@snippet : + * enum CXCursorKind.CXCursor_OverloadCandidate = 700; + * } + */ + public static int CXCursor_OverloadCandidate() { + return (int)700L; + } + public static MethodHandle clang_getNullCursor$MH() { + return RuntimeHelper.requireNonNull(constants$5.clang_getNullCursor$MH,"clang_getNullCursor"); + } + /** + * {@snippet : + * CXCursor clang_getNullCursor(); + * } + */ + public static MemorySegment clang_getNullCursor(SegmentAllocator allocator) { + var mh$ = clang_getNullCursor$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getTranslationUnitCursor$MH() { + return RuntimeHelper.requireNonNull(constants$5.clang_getTranslationUnitCursor$MH,"clang_getTranslationUnitCursor"); + } + /** + * {@snippet : + * CXCursor clang_getTranslationUnitCursor(CXTranslationUnit); + * } + */ + public static MemorySegment clang_getTranslationUnitCursor(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_getTranslationUnitCursor$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_equalCursors$MH() { + return RuntimeHelper.requireNonNull(constants$5.clang_equalCursors$MH,"clang_equalCursors"); + } + /** + * {@snippet : + * unsigned int clang_equalCursors(CXCursor, CXCursor); + * } + */ + public static int clang_equalCursors(MemorySegment x0, MemorySegment x1) { + var mh$ = clang_equalCursors$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_isNull$MH() { + return RuntimeHelper.requireNonNull(constants$5.clang_Cursor_isNull$MH,"clang_Cursor_isNull"); + } + /** + * {@snippet : + * int clang_Cursor_isNull(CXCursor cursor); + * } + */ + public static int clang_Cursor_isNull(MemorySegment cursor) { + var mh$ = clang_Cursor_isNull$MH(); + try { + return (int)mh$.invokeExact(cursor); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorKind$MH() { + return RuntimeHelper.requireNonNull(constants$6.clang_getCursorKind$MH,"clang_getCursorKind"); + } + /** + * {@snippet : + * enum CXCursorKind clang_getCursorKind(CXCursor); + * } + */ + public static int clang_getCursorKind(MemorySegment x0) { + var mh$ = clang_getCursorKind$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_isDeclaration$MH() { + return RuntimeHelper.requireNonNull(constants$6.clang_isDeclaration$MH,"clang_isDeclaration"); + } + /** + * {@snippet : + * unsigned int clang_isDeclaration(enum CXCursorKind); + * } + */ + public static int clang_isDeclaration(int x0) { + var mh$ = clang_isDeclaration$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_isAttribute$MH() { + return RuntimeHelper.requireNonNull(constants$6.clang_isAttribute$MH,"clang_isAttribute"); + } + /** + * {@snippet : + * unsigned int clang_isAttribute(enum CXCursorKind); + * } + */ + public static int clang_isAttribute(int x0) { + var mh$ = clang_isAttribute$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_isInvalid$MH() { + return RuntimeHelper.requireNonNull(constants$6.clang_isInvalid$MH,"clang_isInvalid"); + } + /** + * {@snippet : + * unsigned int clang_isInvalid(enum CXCursorKind); + * } + */ + public static int clang_isInvalid(int x0) { + var mh$ = clang_isInvalid$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_isPreprocessing$MH() { + return RuntimeHelper.requireNonNull(constants$6.clang_isPreprocessing$MH,"clang_isPreprocessing"); + } + /** + * {@snippet : + * unsigned int clang_isPreprocessing(enum CXCursorKind); + * } + */ + public static int clang_isPreprocessing(int x0) { + var mh$ = clang_isPreprocessing$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXLinkageKind.CXLinkage_Invalid = 0; + * } + */ + public static int CXLinkage_Invalid() { + return (int)0L; + } + /** + * {@snippet : + * enum CXLinkageKind.CXLinkage_NoLinkage = 1; + * } + */ + public static int CXLinkage_NoLinkage() { + return (int)1L; + } + /** + * {@snippet : + * enum CXLinkageKind.CXLinkage_Internal = 2; + * } + */ + public static int CXLinkage_Internal() { + return (int)2L; + } + /** + * {@snippet : + * enum CXLinkageKind.CXLinkage_UniqueExternal = 3; + * } + */ + public static int CXLinkage_UniqueExternal() { + return (int)3L; + } + /** + * {@snippet : + * enum CXLinkageKind.CXLinkage_External = 4; + * } + */ + public static int CXLinkage_External() { + return (int)4L; + } + public static MethodHandle clang_getCursorLinkage$MH() { + return RuntimeHelper.requireNonNull(constants$6.clang_getCursorLinkage$MH,"clang_getCursorLinkage"); + } + /** + * {@snippet : + * enum CXLinkageKind clang_getCursorLinkage(CXCursor cursor); + * } + */ + public static int clang_getCursorLinkage(MemorySegment cursor) { + var mh$ = clang_getCursorLinkage$MH(); + try { + return (int)mh$.invokeExact(cursor); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXLanguageKind.CXLanguage_Invalid = 0; + * } + */ + public static int CXLanguage_Invalid() { + return (int)0L; + } + /** + * {@snippet : + * enum CXLanguageKind.CXLanguage_C = 1; + * } + */ + public static int CXLanguage_C() { + return (int)1L; + } + /** + * {@snippet : + * enum CXLanguageKind.CXLanguage_ObjC = 2; + * } + */ + public static int CXLanguage_ObjC() { + return (int)2L; + } + /** + * {@snippet : + * enum CXLanguageKind.CXLanguage_CPlusPlus = 3; + * } + */ + public static int CXLanguage_CPlusPlus() { + return (int)3L; + } + public static MethodHandle clang_getCursorLanguage$MH() { + return RuntimeHelper.requireNonNull(constants$7.clang_getCursorLanguage$MH,"clang_getCursorLanguage"); + } + /** + * {@snippet : + * enum CXLanguageKind clang_getCursorLanguage(CXCursor cursor); + * } + */ + public static int clang_getCursorLanguage(MemorySegment cursor) { + var mh$ = clang_getCursorLanguage$MH(); + try { + return (int)mh$.invokeExact(cursor); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_getTranslationUnit$MH() { + return RuntimeHelper.requireNonNull(constants$7.clang_Cursor_getTranslationUnit$MH,"clang_Cursor_getTranslationUnit"); + } + /** + * {@snippet : + * CXTranslationUnit clang_Cursor_getTranslationUnit(CXCursor); + * } + */ + public static MemorySegment clang_Cursor_getTranslationUnit(MemorySegment x0) { + var mh$ = clang_Cursor_getTranslationUnit$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorLocation$MH() { + return RuntimeHelper.requireNonNull(constants$7.clang_getCursorLocation$MH,"clang_getCursorLocation"); + } + /** + * {@snippet : + * CXSourceLocation clang_getCursorLocation(CXCursor); + * } + */ + public static MemorySegment clang_getCursorLocation(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_getCursorLocation$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorExtent$MH() { + return RuntimeHelper.requireNonNull(constants$7.clang_getCursorExtent$MH,"clang_getCursorExtent"); + } + /** + * {@snippet : + * CXSourceRange clang_getCursorExtent(CXCursor); + * } + */ + public static MemorySegment clang_getCursorExtent(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_getCursorExtent$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Invalid = 0; + * } + */ + public static int CXType_Invalid() { + return (int)0L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Unexposed = 1; + * } + */ + public static int CXType_Unexposed() { + return (int)1L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Void = 2; + * } + */ + public static int CXType_Void() { + return (int)2L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Bool = 3; + * } + */ + public static int CXType_Bool() { + return (int)3L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Char_U = 4; + * } + */ + public static int CXType_Char_U() { + return (int)4L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_UChar = 5; + * } + */ + public static int CXType_UChar() { + return (int)5L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Char16 = 6; + * } + */ + public static int CXType_Char16() { + return (int)6L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Char32 = 7; + * } + */ + public static int CXType_Char32() { + return (int)7L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_UShort = 8; + * } + */ + public static int CXType_UShort() { + return (int)8L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_UInt = 9; + * } + */ + public static int CXType_UInt() { + return (int)9L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ULong = 10; + * } + */ + public static int CXType_ULong() { + return (int)10L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ULongLong = 11; + * } + */ + public static int CXType_ULongLong() { + return (int)11L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_UInt128 = 12; + * } + */ + public static int CXType_UInt128() { + return (int)12L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Char_S = 13; + * } + */ + public static int CXType_Char_S() { + return (int)13L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_SChar = 14; + * } + */ + public static int CXType_SChar() { + return (int)14L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_WChar = 15; + * } + */ + public static int CXType_WChar() { + return (int)15L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Short = 16; + * } + */ + public static int CXType_Short() { + return (int)16L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Int = 17; + * } + */ + public static int CXType_Int() { + return (int)17L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Long = 18; + * } + */ + public static int CXType_Long() { + return (int)18L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_LongLong = 19; + * } + */ + public static int CXType_LongLong() { + return (int)19L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Int128 = 20; + * } + */ + public static int CXType_Int128() { + return (int)20L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Float = 21; + * } + */ + public static int CXType_Float() { + return (int)21L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Double = 22; + * } + */ + public static int CXType_Double() { + return (int)22L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_LongDouble = 23; + * } + */ + public static int CXType_LongDouble() { + return (int)23L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_NullPtr = 24; + * } + */ + public static int CXType_NullPtr() { + return (int)24L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Overload = 25; + * } + */ + public static int CXType_Overload() { + return (int)25L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Dependent = 26; + * } + */ + public static int CXType_Dependent() { + return (int)26L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ObjCId = 27; + * } + */ + public static int CXType_ObjCId() { + return (int)27L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ObjCClass = 28; + * } + */ + public static int CXType_ObjCClass() { + return (int)28L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ObjCSel = 29; + * } + */ + public static int CXType_ObjCSel() { + return (int)29L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Float128 = 30; + * } + */ + public static int CXType_Float128() { + return (int)30L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Half = 31; + * } + */ + public static int CXType_Half() { + return (int)31L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Float16 = 32; + * } + */ + public static int CXType_Float16() { + return (int)32L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ShortAccum = 33; + * } + */ + public static int CXType_ShortAccum() { + return (int)33L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Accum = 34; + * } + */ + public static int CXType_Accum() { + return (int)34L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_LongAccum = 35; + * } + */ + public static int CXType_LongAccum() { + return (int)35L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_UShortAccum = 36; + * } + */ + public static int CXType_UShortAccum() { + return (int)36L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_UAccum = 37; + * } + */ + public static int CXType_UAccum() { + return (int)37L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ULongAccum = 38; + * } + */ + public static int CXType_ULongAccum() { + return (int)38L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_FirstBuiltin = 2; + * } + */ + public static int CXType_FirstBuiltin() { + return (int)2L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_LastBuiltin = 39; + * } + */ + public static int CXType_LastBuiltin() { + return (int)39L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Complex = 100; + * } + */ + public static int CXType_Complex() { + return (int)100L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Pointer = 101; + * } + */ + public static int CXType_Pointer() { + return (int)101L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_BlockPointer = 102; + * } + */ + public static int CXType_BlockPointer() { + return (int)102L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_LValueReference = 103; + * } + */ + public static int CXType_LValueReference() { + return (int)103L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_RValueReference = 104; + * } + */ + public static int CXType_RValueReference() { + return (int)104L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Record = 105; + * } + */ + public static int CXType_Record() { + return (int)105L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Enum = 106; + * } + */ + public static int CXType_Enum() { + return (int)106L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Typedef = 107; + * } + */ + public static int CXType_Typedef() { + return (int)107L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ObjCInterface = 108; + * } + */ + public static int CXType_ObjCInterface() { + return (int)108L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ObjCObjectPointer = 109; + * } + */ + public static int CXType_ObjCObjectPointer() { + return (int)109L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_FunctionNoProto = 110; + * } + */ + public static int CXType_FunctionNoProto() { + return (int)110L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_FunctionProto = 111; + * } + */ + public static int CXType_FunctionProto() { + return (int)111L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ConstantArray = 112; + * } + */ + public static int CXType_ConstantArray() { + return (int)112L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Vector = 113; + * } + */ + public static int CXType_Vector() { + return (int)113L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_IncompleteArray = 114; + * } + */ + public static int CXType_IncompleteArray() { + return (int)114L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_VariableArray = 115; + * } + */ + public static int CXType_VariableArray() { + return (int)115L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_DependentSizedArray = 116; + * } + */ + public static int CXType_DependentSizedArray() { + return (int)116L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_MemberPointer = 117; + * } + */ + public static int CXType_MemberPointer() { + return (int)117L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Auto = 118; + * } + */ + public static int CXType_Auto() { + return (int)118L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Elaborated = 119; + * } + */ + public static int CXType_Elaborated() { + return (int)119L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Pipe = 120; + * } + */ + public static int CXType_Pipe() { + return (int)120L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage1dRO = 121; + * } + */ + public static int CXType_OCLImage1dRO() { + return (int)121L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage1dArrayRO = 122; + * } + */ + public static int CXType_OCLImage1dArrayRO() { + return (int)122L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage1dBufferRO = 123; + * } + */ + public static int CXType_OCLImage1dBufferRO() { + return (int)123L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dRO = 124; + * } + */ + public static int CXType_OCLImage2dRO() { + return (int)124L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayRO = 125; + * } + */ + public static int CXType_OCLImage2dArrayRO() { + return (int)125L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dDepthRO = 126; + * } + */ + public static int CXType_OCLImage2dDepthRO() { + return (int)126L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayDepthRO = 127; + * } + */ + public static int CXType_OCLImage2dArrayDepthRO() { + return (int)127L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dMSAARO = 128; + * } + */ + public static int CXType_OCLImage2dMSAARO() { + return (int)128L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayMSAARO = 129; + * } + */ + public static int CXType_OCLImage2dArrayMSAARO() { + return (int)129L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dMSAADepthRO = 130; + * } + */ + public static int CXType_OCLImage2dMSAADepthRO() { + return (int)130L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayMSAADepthRO = 131; + * } + */ + public static int CXType_OCLImage2dArrayMSAADepthRO() { + return (int)131L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage3dRO = 132; + * } + */ + public static int CXType_OCLImage3dRO() { + return (int)132L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage1dWO = 133; + * } + */ + public static int CXType_OCLImage1dWO() { + return (int)133L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage1dArrayWO = 134; + * } + */ + public static int CXType_OCLImage1dArrayWO() { + return (int)134L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage1dBufferWO = 135; + * } + */ + public static int CXType_OCLImage1dBufferWO() { + return (int)135L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dWO = 136; + * } + */ + public static int CXType_OCLImage2dWO() { + return (int)136L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayWO = 137; + * } + */ + public static int CXType_OCLImage2dArrayWO() { + return (int)137L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dDepthWO = 138; + * } + */ + public static int CXType_OCLImage2dDepthWO() { + return (int)138L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayDepthWO = 139; + * } + */ + public static int CXType_OCLImage2dArrayDepthWO() { + return (int)139L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dMSAAWO = 140; + * } + */ + public static int CXType_OCLImage2dMSAAWO() { + return (int)140L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayMSAAWO = 141; + * } + */ + public static int CXType_OCLImage2dArrayMSAAWO() { + return (int)141L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dMSAADepthWO = 142; + * } + */ + public static int CXType_OCLImage2dMSAADepthWO() { + return (int)142L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayMSAADepthWO = 143; + * } + */ + public static int CXType_OCLImage2dArrayMSAADepthWO() { + return (int)143L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage3dWO = 144; + * } + */ + public static int CXType_OCLImage3dWO() { + return (int)144L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage1dRW = 145; + * } + */ + public static int CXType_OCLImage1dRW() { + return (int)145L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage1dArrayRW = 146; + * } + */ + public static int CXType_OCLImage1dArrayRW() { + return (int)146L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage1dBufferRW = 147; + * } + */ + public static int CXType_OCLImage1dBufferRW() { + return (int)147L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dRW = 148; + * } + */ + public static int CXType_OCLImage2dRW() { + return (int)148L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayRW = 149; + * } + */ + public static int CXType_OCLImage2dArrayRW() { + return (int)149L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dDepthRW = 150; + * } + */ + public static int CXType_OCLImage2dDepthRW() { + return (int)150L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayDepthRW = 151; + * } + */ + public static int CXType_OCLImage2dArrayDepthRW() { + return (int)151L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dMSAARW = 152; + * } + */ + public static int CXType_OCLImage2dMSAARW() { + return (int)152L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayMSAARW = 153; + * } + */ + public static int CXType_OCLImage2dArrayMSAARW() { + return (int)153L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dMSAADepthRW = 154; + * } + */ + public static int CXType_OCLImage2dMSAADepthRW() { + return (int)154L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage2dArrayMSAADepthRW = 155; + * } + */ + public static int CXType_OCLImage2dArrayMSAADepthRW() { + return (int)155L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLImage3dRW = 156; + * } + */ + public static int CXType_OCLImage3dRW() { + return (int)156L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLSampler = 157; + * } + */ + public static int CXType_OCLSampler() { + return (int)157L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLEvent = 158; + * } + */ + public static int CXType_OCLEvent() { + return (int)158L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLQueue = 159; + * } + */ + public static int CXType_OCLQueue() { + return (int)159L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLReserveID = 160; + * } + */ + public static int CXType_OCLReserveID() { + return (int)160L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ObjCObject = 161; + * } + */ + public static int CXType_ObjCObject() { + return (int)161L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ObjCTypeParam = 162; + * } + */ + public static int CXType_ObjCTypeParam() { + return (int)162L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_Attributed = 163; + * } + */ + public static int CXType_Attributed() { + return (int)163L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCMcePayload = 164; + * } + */ + public static int CXType_OCLIntelSubgroupAVCMcePayload() { + return (int)164L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCImePayload = 165; + * } + */ + public static int CXType_OCLIntelSubgroupAVCImePayload() { + return (int)165L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCRefPayload = 166; + * } + */ + public static int CXType_OCLIntelSubgroupAVCRefPayload() { + return (int)166L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCSicPayload = 167; + * } + */ + public static int CXType_OCLIntelSubgroupAVCSicPayload() { + return (int)167L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCMceResult = 168; + * } + */ + public static int CXType_OCLIntelSubgroupAVCMceResult() { + return (int)168L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCImeResult = 169; + * } + */ + public static int CXType_OCLIntelSubgroupAVCImeResult() { + return (int)169L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCRefResult = 170; + * } + */ + public static int CXType_OCLIntelSubgroupAVCRefResult() { + return (int)170L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCSicResult = 171; + * } + */ + public static int CXType_OCLIntelSubgroupAVCSicResult() { + return (int)171L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout = 172; + * } + */ + public static int CXType_OCLIntelSubgroupAVCImeResultSingleRefStreamout() { + return (int)172L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173; + * } + */ + public static int CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout() { + return (int)173L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174; + * } + */ + public static int CXType_OCLIntelSubgroupAVCImeSingleRefStreamin() { + return (int)174L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175; + * } + */ + public static int CXType_OCLIntelSubgroupAVCImeDualRefStreamin() { + return (int)175L; + } + /** + * {@snippet : + * enum CXTypeKind.CXType_ExtVector = 176; + * } + */ + public static int CXType_ExtVector() { + return (int)176L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_Default = 0; + * } + */ + public static int CXCallingConv_Default() { + return (int)0L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_C = 1; + * } + */ + public static int CXCallingConv_C() { + return (int)1L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_X86StdCall = 2; + * } + */ + public static int CXCallingConv_X86StdCall() { + return (int)2L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_X86FastCall = 3; + * } + */ + public static int CXCallingConv_X86FastCall() { + return (int)3L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_X86ThisCall = 4; + * } + */ + public static int CXCallingConv_X86ThisCall() { + return (int)4L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_X86Pascal = 5; + * } + */ + public static int CXCallingConv_X86Pascal() { + return (int)5L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_AAPCS = 6; + * } + */ + public static int CXCallingConv_AAPCS() { + return (int)6L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_AAPCS_VFP = 7; + * } + */ + public static int CXCallingConv_AAPCS_VFP() { + return (int)7L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_X86RegCall = 8; + * } + */ + public static int CXCallingConv_X86RegCall() { + return (int)8L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_IntelOclBicc = 9; + * } + */ + public static int CXCallingConv_IntelOclBicc() { + return (int)9L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_Win64 = 10; + * } + */ + public static int CXCallingConv_Win64() { + return (int)10L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_X86_64Win64 = 10; + * } + */ + public static int CXCallingConv_X86_64Win64() { + return (int)10L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_X86_64SysV = 11; + * } + */ + public static int CXCallingConv_X86_64SysV() { + return (int)11L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_X86VectorCall = 12; + * } + */ + public static int CXCallingConv_X86VectorCall() { + return (int)12L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_Swift = 13; + * } + */ + public static int CXCallingConv_Swift() { + return (int)13L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_PreserveMost = 14; + * } + */ + public static int CXCallingConv_PreserveMost() { + return (int)14L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_PreserveAll = 15; + * } + */ + public static int CXCallingConv_PreserveAll() { + return (int)15L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_AArch64VectorCall = 16; + * } + */ + public static int CXCallingConv_AArch64VectorCall() { + return (int)16L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_Invalid = 100; + * } + */ + public static int CXCallingConv_Invalid() { + return (int)100L; + } + /** + * {@snippet : + * enum CXCallingConv.CXCallingConv_Unexposed = 200; + * } + */ + public static int CXCallingConv_Unexposed() { + return (int)200L; + } + public static MethodHandle clang_getCursorType$MH() { + return RuntimeHelper.requireNonNull(constants$7.clang_getCursorType$MH,"clang_getCursorType"); + } + /** + * {@snippet : + * CXType clang_getCursorType(CXCursor C); + * } + */ + public static MemorySegment clang_getCursorType(SegmentAllocator allocator, MemorySegment C) { + var mh$ = clang_getCursorType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getTypeSpelling$MH() { + return RuntimeHelper.requireNonNull(constants$7.clang_getTypeSpelling$MH,"clang_getTypeSpelling"); + } + /** + * {@snippet : + * CXString clang_getTypeSpelling(CXType CT); + * } + */ + public static MemorySegment clang_getTypeSpelling(SegmentAllocator allocator, MemorySegment CT) { + var mh$ = clang_getTypeSpelling$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, CT); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getTypedefDeclUnderlyingType$MH() { + return RuntimeHelper.requireNonNull(constants$8.clang_getTypedefDeclUnderlyingType$MH,"clang_getTypedefDeclUnderlyingType"); + } + /** + * {@snippet : + * CXType clang_getTypedefDeclUnderlyingType(CXCursor C); + * } + */ + public static MemorySegment clang_getTypedefDeclUnderlyingType(SegmentAllocator allocator, MemorySegment C) { + var mh$ = clang_getTypedefDeclUnderlyingType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getEnumDeclIntegerType$MH() { + return RuntimeHelper.requireNonNull(constants$8.clang_getEnumDeclIntegerType$MH,"clang_getEnumDeclIntegerType"); + } + /** + * {@snippet : + * CXType clang_getEnumDeclIntegerType(CXCursor C); + * } + */ + public static MemorySegment clang_getEnumDeclIntegerType(SegmentAllocator allocator, MemorySegment C) { + var mh$ = clang_getEnumDeclIntegerType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getEnumConstantDeclValue$MH() { + return RuntimeHelper.requireNonNull(constants$8.clang_getEnumConstantDeclValue$MH,"clang_getEnumConstantDeclValue"); + } + /** + * {@snippet : + * long long clang_getEnumConstantDeclValue(CXCursor C); + * } + */ + public static long clang_getEnumConstantDeclValue(MemorySegment C) { + var mh$ = clang_getEnumConstantDeclValue$MH(); + try { + return (long)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getEnumConstantDeclUnsignedValue$MH() { + return RuntimeHelper.requireNonNull(constants$8.clang_getEnumConstantDeclUnsignedValue$MH,"clang_getEnumConstantDeclUnsignedValue"); + } + /** + * {@snippet : + * unsigned long long clang_getEnumConstantDeclUnsignedValue(CXCursor C); + * } + */ + public static long clang_getEnumConstantDeclUnsignedValue(MemorySegment C) { + var mh$ = clang_getEnumConstantDeclUnsignedValue$MH(); + try { + return (long)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getFieldDeclBitWidth$MH() { + return RuntimeHelper.requireNonNull(constants$8.clang_getFieldDeclBitWidth$MH,"clang_getFieldDeclBitWidth"); + } + /** + * {@snippet : + * int clang_getFieldDeclBitWidth(CXCursor C); + * } + */ + public static int clang_getFieldDeclBitWidth(MemorySegment C) { + var mh$ = clang_getFieldDeclBitWidth$MH(); + try { + return (int)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_getNumArguments$MH() { + return RuntimeHelper.requireNonNull(constants$8.clang_Cursor_getNumArguments$MH,"clang_Cursor_getNumArguments"); + } + /** + * {@snippet : + * int clang_Cursor_getNumArguments(CXCursor C); + * } + */ + public static int clang_Cursor_getNumArguments(MemorySegment C) { + var mh$ = clang_Cursor_getNumArguments$MH(); + try { + return (int)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_getArgument$MH() { + return RuntimeHelper.requireNonNull(constants$9.clang_Cursor_getArgument$MH,"clang_Cursor_getArgument"); + } + /** + * {@snippet : + * CXCursor clang_Cursor_getArgument(CXCursor C, unsigned int i); + * } + */ + public static MemorySegment clang_Cursor_getArgument(SegmentAllocator allocator, MemorySegment C, int i) { + var mh$ = clang_Cursor_getArgument$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, C, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_equalTypes$MH() { + return RuntimeHelper.requireNonNull(constants$9.clang_equalTypes$MH,"clang_equalTypes"); + } + /** + * {@snippet : + * unsigned int clang_equalTypes(CXType A, CXType B); + * } + */ + public static int clang_equalTypes(MemorySegment A, MemorySegment B) { + var mh$ = clang_equalTypes$MH(); + try { + return (int)mh$.invokeExact(A, B); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCanonicalType$MH() { + return RuntimeHelper.requireNonNull(constants$9.clang_getCanonicalType$MH,"clang_getCanonicalType"); + } + /** + * {@snippet : + * CXType clang_getCanonicalType(CXType T); + * } + */ + public static MemorySegment clang_getCanonicalType(SegmentAllocator allocator, MemorySegment T) { + var mh$ = clang_getCanonicalType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_isConstQualifiedType$MH() { + return RuntimeHelper.requireNonNull(constants$9.clang_isConstQualifiedType$MH,"clang_isConstQualifiedType"); + } + /** + * {@snippet : + * unsigned int clang_isConstQualifiedType(CXType T); + * } + */ + public static int clang_isConstQualifiedType(MemorySegment T) { + var mh$ = clang_isConstQualifiedType$MH(); + try { + return (int)mh$.invokeExact(T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_isMacroFunctionLike$MH() { + return RuntimeHelper.requireNonNull(constants$9.clang_Cursor_isMacroFunctionLike$MH,"clang_Cursor_isMacroFunctionLike"); + } + /** + * {@snippet : + * unsigned int clang_Cursor_isMacroFunctionLike(CXCursor C); + * } + */ + public static int clang_Cursor_isMacroFunctionLike(MemorySegment C) { + var mh$ = clang_Cursor_isMacroFunctionLike$MH(); + try { + return (int)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_isFunctionInlined$MH() { + return RuntimeHelper.requireNonNull(constants$9.clang_Cursor_isFunctionInlined$MH,"clang_Cursor_isFunctionInlined"); + } + /** + * {@snippet : + * unsigned int clang_Cursor_isFunctionInlined(CXCursor C); + * } + */ + public static int clang_Cursor_isFunctionInlined(MemorySegment C) { + var mh$ = clang_Cursor_isFunctionInlined$MH(); + try { + return (int)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_isVolatileQualifiedType$MH() { + return RuntimeHelper.requireNonNull(constants$10.clang_isVolatileQualifiedType$MH,"clang_isVolatileQualifiedType"); + } + /** + * {@snippet : + * unsigned int clang_isVolatileQualifiedType(CXType T); + * } + */ + public static int clang_isVolatileQualifiedType(MemorySegment T) { + var mh$ = clang_isVolatileQualifiedType$MH(); + try { + return (int)mh$.invokeExact(T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getTypedefName$MH() { + return RuntimeHelper.requireNonNull(constants$10.clang_getTypedefName$MH,"clang_getTypedefName"); + } + /** + * {@snippet : + * CXString clang_getTypedefName(CXType CT); + * } + */ + public static MemorySegment clang_getTypedefName(SegmentAllocator allocator, MemorySegment CT) { + var mh$ = clang_getTypedefName$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, CT); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getPointeeType$MH() { + return RuntimeHelper.requireNonNull(constants$10.clang_getPointeeType$MH,"clang_getPointeeType"); + } + /** + * {@snippet : + * CXType clang_getPointeeType(CXType T); + * } + */ + public static MemorySegment clang_getPointeeType(SegmentAllocator allocator, MemorySegment T) { + var mh$ = clang_getPointeeType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getTypeDeclaration$MH() { + return RuntimeHelper.requireNonNull(constants$10.clang_getTypeDeclaration$MH,"clang_getTypeDeclaration"); + } + /** + * {@snippet : + * CXCursor clang_getTypeDeclaration(CXType T); + * } + */ + public static MemorySegment clang_getTypeDeclaration(SegmentAllocator allocator, MemorySegment T) { + var mh$ = clang_getTypeDeclaration$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getTypeKindSpelling$MH() { + return RuntimeHelper.requireNonNull(constants$10.clang_getTypeKindSpelling$MH,"clang_getTypeKindSpelling"); + } + /** + * {@snippet : + * CXString clang_getTypeKindSpelling(enum CXTypeKind K); + * } + */ + public static MemorySegment clang_getTypeKindSpelling(SegmentAllocator allocator, int K) { + var mh$ = clang_getTypeKindSpelling$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, K); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getFunctionTypeCallingConv$MH() { + return RuntimeHelper.requireNonNull(constants$10.clang_getFunctionTypeCallingConv$MH,"clang_getFunctionTypeCallingConv"); + } + /** + * {@snippet : + * enum CXCallingConv clang_getFunctionTypeCallingConv(CXType T); + * } + */ + public static int clang_getFunctionTypeCallingConv(MemorySegment T) { + var mh$ = clang_getFunctionTypeCallingConv$MH(); + try { + return (int)mh$.invokeExact(T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getResultType$MH() { + return RuntimeHelper.requireNonNull(constants$11.clang_getResultType$MH,"clang_getResultType"); + } + /** + * {@snippet : + * CXType clang_getResultType(CXType T); + * } + */ + public static MemorySegment clang_getResultType(SegmentAllocator allocator, MemorySegment T) { + var mh$ = clang_getResultType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getNumArgTypes$MH() { + return RuntimeHelper.requireNonNull(constants$11.clang_getNumArgTypes$MH,"clang_getNumArgTypes"); + } + /** + * {@snippet : + * int clang_getNumArgTypes(CXType T); + * } + */ + public static int clang_getNumArgTypes(MemorySegment T) { + var mh$ = clang_getNumArgTypes$MH(); + try { + return (int)mh$.invokeExact(T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getArgType$MH() { + return RuntimeHelper.requireNonNull(constants$11.clang_getArgType$MH,"clang_getArgType"); + } + /** + * {@snippet : + * CXType clang_getArgType(CXType T, unsigned int i); + * } + */ + public static MemorySegment clang_getArgType(SegmentAllocator allocator, MemorySegment T, int i) { + var mh$ = clang_getArgType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, T, i); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_isFunctionTypeVariadic$MH() { + return RuntimeHelper.requireNonNull(constants$11.clang_isFunctionTypeVariadic$MH,"clang_isFunctionTypeVariadic"); + } + /** + * {@snippet : + * unsigned int clang_isFunctionTypeVariadic(CXType T); + * } + */ + public static int clang_isFunctionTypeVariadic(MemorySegment T) { + var mh$ = clang_isFunctionTypeVariadic$MH(); + try { + return (int)mh$.invokeExact(T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorResultType$MH() { + return RuntimeHelper.requireNonNull(constants$11.clang_getCursorResultType$MH,"clang_getCursorResultType"); + } + /** + * {@snippet : + * CXType clang_getCursorResultType(CXCursor C); + * } + */ + public static MemorySegment clang_getCursorResultType(SegmentAllocator allocator, MemorySegment C) { + var mh$ = clang_getCursorResultType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getElementType$MH() { + return RuntimeHelper.requireNonNull(constants$11.clang_getElementType$MH,"clang_getElementType"); + } + + /** + * {@snippet : + * CXType clang_getElementType(CXType T); + * } + */ + public static MemorySegment clang_getElementType(SegmentAllocator allocator, MemorySegment T) { + var mh$ = clang_getElementType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + + public static MethodHandle clang_getValueType$MH() { + return RuntimeHelper.requireNonNull(constants$11.clang_getValueType$MH,"clang_Type_getValueType"); + } + + /** + * {@snippet : + * CXType clang_getValueType(CXType T); + * } + */ + public static MemorySegment clang_getValueType(SegmentAllocator allocator, MemorySegment T) { + var mh$ = clang_getValueType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getNumElements$MH() { + return RuntimeHelper.requireNonNull(constants$12.clang_getNumElements$MH,"clang_getNumElements"); + } + /** + * {@snippet : + * long long clang_getNumElements(CXType T); + * } + */ + public static long clang_getNumElements(MemorySegment T) { + var mh$ = clang_getNumElements$MH(); + try { + return (long)mh$.invokeExact(T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getArrayElementType$MH() { + return RuntimeHelper.requireNonNull(constants$12.clang_getArrayElementType$MH,"clang_getArrayElementType"); + } + /** + * {@snippet : + * CXType clang_getArrayElementType(CXType T); + * } + */ + public static MemorySegment clang_getArrayElementType(SegmentAllocator allocator, MemorySegment T) { + var mh$ = clang_getArrayElementType$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getArraySize$MH() { + return RuntimeHelper.requireNonNull(constants$12.clang_getArraySize$MH,"clang_getArraySize"); + } + /** + * {@snippet : + * long long clang_getArraySize(CXType T); + * } + */ + public static long clang_getArraySize(MemorySegment T) { + var mh$ = clang_getArraySize$MH(); + try { + return (long)mh$.invokeExact(T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXTypeNullabilityKind.CXTypeNullability_NonNull = 0; + * } + */ + public static int CXTypeNullability_NonNull() { + return (int)0L; + } + /** + * {@snippet : + * enum CXTypeNullabilityKind.CXTypeNullability_Nullable = 1; + * } + */ + public static int CXTypeNullability_Nullable() { + return (int)1L; + } + /** + * {@snippet : + * enum CXTypeNullabilityKind.CXTypeNullability_Unspecified = 2; + * } + */ + public static int CXTypeNullability_Unspecified() { + return (int)2L; + } + /** + * {@snippet : + * enum CXTypeNullabilityKind.CXTypeNullability_Invalid = 3; + * } + */ + public static int CXTypeNullability_Invalid() { + return (int)3L; + } + /** + * {@snippet : + * enum CXTypeLayoutError.CXTypeLayoutError_Invalid = -1; + * } + */ + public static int CXTypeLayoutError_Invalid() { + return (int)-1L; + } + /** + * {@snippet : + * enum CXTypeLayoutError.CXTypeLayoutError_Incomplete = -2; + * } + */ + public static int CXTypeLayoutError_Incomplete() { + return (int)-2L; + } + /** + * {@snippet : + * enum CXTypeLayoutError.CXTypeLayoutError_Dependent = -3; + * } + */ + public static int CXTypeLayoutError_Dependent() { + return (int)-3L; + } + /** + * {@snippet : + * enum CXTypeLayoutError.CXTypeLayoutError_NotConstantSize = -4; + * } + */ + public static int CXTypeLayoutError_NotConstantSize() { + return (int)-4L; + } + /** + * {@snippet : + * enum CXTypeLayoutError.CXTypeLayoutError_InvalidFieldName = -5; + * } + */ + public static int CXTypeLayoutError_InvalidFieldName() { + return (int)-5L; + } + /** + * {@snippet : + * enum CXTypeLayoutError.CXTypeLayoutError_Undeduced = -6; + * } + */ + public static int CXTypeLayoutError_Undeduced() { + return (int)-6L; + } + public static MethodHandle clang_Type_getSizeOf$MH() { + return RuntimeHelper.requireNonNull(constants$12.clang_Type_getSizeOf$MH,"clang_Type_getSizeOf"); + } + /** + * {@snippet : + * long long clang_Type_getSizeOf(CXType T); + * } + */ + public static long clang_Type_getSizeOf(MemorySegment T) { + var mh$ = clang_Type_getSizeOf$MH(); + try { + return (long)mh$.invokeExact(T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Type_getAlignOf$MH() { + return RuntimeHelper.requireNonNull(constants$12.clang_Type_getAlignOf$MH,"clang_Type_getAlignOf"); + } + /** + * {@snippet : + * long long clang_Type_getAlignOf(CXType T); + * } + */ + public static long clang_Type_getAlignOf(MemorySegment T) { + var mh$ = clang_Type_getAlignOf$MH(); + try { + return (long)mh$.invokeExact(T); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Type_getOffsetOf$MH() { + return RuntimeHelper.requireNonNull(constants$12.clang_Type_getOffsetOf$MH,"clang_Type_getOffsetOf"); + } + /** + * {@snippet : + * long long clang_Type_getOffsetOf(CXType T, char* S); + * } + */ + public static long clang_Type_getOffsetOf(MemorySegment T, MemorySegment S) { + var mh$ = clang_Type_getOffsetOf$MH(); + try { + return (long)mh$.invokeExact(T, S); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_isAnonymous$MH() { + return RuntimeHelper.requireNonNull(constants$12.clang_Cursor_isAnonymous$MH,"clang_Cursor_isAnonymous"); + } + /** + * {@snippet : + * unsigned int clang_Cursor_isAnonymous(CXCursor C); + * } + */ + public static int clang_Cursor_isAnonymous(MemorySegment C) { + var mh$ = clang_Cursor_isAnonymous$MH(); + try { + return (int)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_isAnonymousRecordDecl$MH() { + return RuntimeHelper.requireNonNull(constants$13.clang_Cursor_isAnonymousRecordDecl$MH,"clang_Cursor_isAnonymousRecordDecl"); + } + /** + * {@snippet : + * unsigned int clang_Cursor_isAnonymousRecordDecl(CXCursor C); + * } + */ + public static int clang_Cursor_isAnonymousRecordDecl(MemorySegment C) { + var mh$ = clang_Cursor_isAnonymousRecordDecl$MH(); + try { + return (int)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_isBitField$MH() { + return RuntimeHelper.requireNonNull(constants$13.clang_Cursor_isBitField$MH,"clang_Cursor_isBitField"); + } + /** + * {@snippet : + * unsigned int clang_Cursor_isBitField(CXCursor C); + * } + */ + public static int clang_Cursor_isBitField(MemorySegment C) { + var mh$ = clang_Cursor_isBitField$MH(); + try { + return (int)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXChildVisitResult.CXChildVisit_Break = 0; + * } + */ + public static int CXChildVisit_Break() { + return (int)0L; + } + /** + * {@snippet : + * enum CXChildVisitResult.CXChildVisit_Continue = 1; + * } + */ + public static int CXChildVisit_Continue() { + return (int)1L; + } + /** + * {@snippet : + * enum CXChildVisitResult.CXChildVisit_Recurse = 2; + * } + */ + public static int CXChildVisit_Recurse() { + return (int)2L; + } + public static MethodHandle clang_visitChildren$MH() { + return RuntimeHelper.requireNonNull(constants$13.clang_visitChildren$MH,"clang_visitChildren"); + } + /** + * {@snippet : + * unsigned int clang_visitChildren(CXCursor parent, CXCursorVisitor visitor, CXClientData client_data); + * } + */ + public static int clang_visitChildren(MemorySegment parent, MemorySegment visitor, MemorySegment client_data) { + var mh$ = clang_visitChildren$MH(); + try { + return (int)mh$.invokeExact(parent, visitor, client_data); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorUSR$MH() { + return RuntimeHelper.requireNonNull(constants$13.clang_getCursorUSR$MH,"clang_getCursorUSR"); + } + /** + * {@snippet : + * CXString clang_getCursorUSR(CXCursor); + * } + */ + public static MemorySegment clang_getCursorUSR(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_getCursorUSR$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorSpelling$MH() { + return RuntimeHelper.requireNonNull(constants$14.clang_getCursorSpelling$MH,"clang_getCursorSpelling"); + } + /** + * {@snippet : + * CXString clang_getCursorSpelling(CXCursor); + * } + */ + public static MemorySegment clang_getCursorSpelling(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_getCursorSpelling$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_Indentation = 0; + * } + */ + public static int CXPrintingPolicy_Indentation() { + return (int)0L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_SuppressSpecifiers = 1; + * } + */ + public static int CXPrintingPolicy_SuppressSpecifiers() { + return (int)1L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_SuppressTagKeyword = 2; + * } + */ + public static int CXPrintingPolicy_SuppressTagKeyword() { + return (int)2L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_IncludeTagDefinition = 3; + * } + */ + public static int CXPrintingPolicy_IncludeTagDefinition() { + return (int)3L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_SuppressScope = 4; + * } + */ + public static int CXPrintingPolicy_SuppressScope() { + return (int)4L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_SuppressUnwrittenScope = 5; + * } + */ + public static int CXPrintingPolicy_SuppressUnwrittenScope() { + return (int)5L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_SuppressInitializers = 6; + * } + */ + public static int CXPrintingPolicy_SuppressInitializers() { + return (int)6L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_ConstantArraySizeAsWritten = 7; + * } + */ + public static int CXPrintingPolicy_ConstantArraySizeAsWritten() { + return (int)7L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_AnonymousTagLocations = 8; + * } + */ + public static int CXPrintingPolicy_AnonymousTagLocations() { + return (int)8L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_SuppressStrongLifetime = 9; + * } + */ + public static int CXPrintingPolicy_SuppressStrongLifetime() { + return (int)9L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_SuppressLifetimeQualifiers = 10; + * } + */ + public static int CXPrintingPolicy_SuppressLifetimeQualifiers() { + return (int)10L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors = 11; + * } + */ + public static int CXPrintingPolicy_SuppressTemplateArgsInCXXConstructors() { + return (int)11L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_Bool = 12; + * } + */ + public static int CXPrintingPolicy_Bool() { + return (int)12L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_Restrict = 13; + * } + */ + public static int CXPrintingPolicy_Restrict() { + return (int)13L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_Alignof = 14; + * } + */ + public static int CXPrintingPolicy_Alignof() { + return (int)14L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_UnderscoreAlignof = 15; + * } + */ + public static int CXPrintingPolicy_UnderscoreAlignof() { + return (int)15L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_UseVoidForZeroParams = 16; + * } + */ + public static int CXPrintingPolicy_UseVoidForZeroParams() { + return (int)16L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_TerseOutput = 17; + * } + */ + public static int CXPrintingPolicy_TerseOutput() { + return (int)17L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_PolishForDeclaration = 18; + * } + */ + public static int CXPrintingPolicy_PolishForDeclaration() { + return (int)18L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_Half = 19; + * } + */ + public static int CXPrintingPolicy_Half() { + return (int)19L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_MSWChar = 20; + * } + */ + public static int CXPrintingPolicy_MSWChar() { + return (int)20L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_IncludeNewlines = 21; + * } + */ + public static int CXPrintingPolicy_IncludeNewlines() { + return (int)21L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_MSVCFormatting = 22; + * } + */ + public static int CXPrintingPolicy_MSVCFormatting() { + return (int)22L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_ConstantsAsWritten = 23; + * } + */ + public static int CXPrintingPolicy_ConstantsAsWritten() { + return (int)23L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_SuppressImplicitBase = 24; + * } + */ + public static int CXPrintingPolicy_SuppressImplicitBase() { + return (int)24L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_FullyQualifiedName = 25; + * } + */ + public static int CXPrintingPolicy_FullyQualifiedName() { + return (int)25L; + } + /** + * {@snippet : + * enum CXPrintingPolicyProperty.CXPrintingPolicy_LastProperty = 25; + * } + */ + public static int CXPrintingPolicy_LastProperty() { + return (int)25L; + } + public static MethodHandle clang_PrintingPolicy_getProperty$MH() { + return RuntimeHelper.requireNonNull(constants$14.clang_PrintingPolicy_getProperty$MH,"clang_PrintingPolicy_getProperty"); + } + /** + * {@snippet : + * unsigned int clang_PrintingPolicy_getProperty(CXPrintingPolicy Policy, enum CXPrintingPolicyProperty Property); + * } + */ + public static int clang_PrintingPolicy_getProperty(MemorySegment Policy, int Property) { + var mh$ = clang_PrintingPolicy_getProperty$MH(); + try { + return (int)mh$.invokeExact(Policy, Property); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_PrintingPolicy_setProperty$MH() { + return RuntimeHelper.requireNonNull(constants$14.clang_PrintingPolicy_setProperty$MH,"clang_PrintingPolicy_setProperty"); + } + /** + * {@snippet : + * void clang_PrintingPolicy_setProperty(CXPrintingPolicy Policy, enum CXPrintingPolicyProperty Property, unsigned int Value); + * } + */ + public static void clang_PrintingPolicy_setProperty(MemorySegment Policy, int Property, int Value) { + var mh$ = clang_PrintingPolicy_setProperty$MH(); + try { + mh$.invokeExact(Policy, Property, Value); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorPrintingPolicy$MH() { + return RuntimeHelper.requireNonNull(constants$14.clang_getCursorPrintingPolicy$MH,"clang_getCursorPrintingPolicy"); + } + /** + * {@snippet : + * CXPrintingPolicy clang_getCursorPrintingPolicy(CXCursor); + * } + */ + public static MemorySegment clang_getCursorPrintingPolicy(MemorySegment x0) { + var mh$ = clang_getCursorPrintingPolicy$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_PrintingPolicy_dispose$MH() { + return RuntimeHelper.requireNonNull(constants$14.clang_PrintingPolicy_dispose$MH,"clang_PrintingPolicy_dispose"); + } + /** + * {@snippet : + * void clang_PrintingPolicy_dispose(CXPrintingPolicy Policy); + * } + */ + public static void clang_PrintingPolicy_dispose(MemorySegment Policy) { + var mh$ = clang_PrintingPolicy_dispose$MH(); + try { + mh$.invokeExact(Policy); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorPrettyPrinted$MH() { + return RuntimeHelper.requireNonNull(constants$14.clang_getCursorPrettyPrinted$MH,"clang_getCursorPrettyPrinted"); + } + /** + * {@snippet : + * CXString clang_getCursorPrettyPrinted(CXCursor Cursor, CXPrintingPolicy Policy); + * } + */ + public static MemorySegment clang_getCursorPrettyPrinted(SegmentAllocator allocator, MemorySegment Cursor, MemorySegment Policy) { + var mh$ = clang_getCursorPrettyPrinted$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, Cursor, Policy); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorDisplayName$MH() { + return RuntimeHelper.requireNonNull(constants$15.clang_getCursorDisplayName$MH,"clang_getCursorDisplayName"); + } + /** + * {@snippet : + * CXString clang_getCursorDisplayName(CXCursor); + * } + */ + public static MemorySegment clang_getCursorDisplayName(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_getCursorDisplayName$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorReferenced$MH() { + return RuntimeHelper.requireNonNull(constants$15.clang_getCursorReferenced$MH,"clang_getCursorReferenced"); + } + /** + * {@snippet : + * CXCursor clang_getCursorReferenced(CXCursor); + * } + */ + public static MemorySegment clang_getCursorReferenced(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_getCursorReferenced$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorDefinition$MH() { + return RuntimeHelper.requireNonNull(constants$15.clang_getCursorDefinition$MH,"clang_getCursorDefinition"); + } + /** + * {@snippet : + * CXCursor clang_getCursorDefinition(CXCursor); + * } + */ + public static MemorySegment clang_getCursorDefinition(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_getCursorDefinition$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_isCursorDefinition$MH() { + return RuntimeHelper.requireNonNull(constants$15.clang_isCursorDefinition$MH,"clang_isCursorDefinition"); + } + /** + * {@snippet : + * unsigned int clang_isCursorDefinition(CXCursor); + * } + */ + public static int clang_isCursorDefinition(MemorySegment x0) { + var mh$ = clang_isCursorDefinition$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_isVariadic$MH() { + return RuntimeHelper.requireNonNull(constants$15.clang_Cursor_isVariadic$MH,"clang_Cursor_isVariadic"); + } + /** + * {@snippet : + * unsigned int clang_Cursor_isVariadic(CXCursor C); + * } + */ + public static int clang_Cursor_isVariadic(MemorySegment C) { + var mh$ = clang_Cursor_isVariadic$MH(); + try { + return (int)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_getMangling$MH() { + return RuntimeHelper.requireNonNull(constants$15.clang_Cursor_getMangling$MH,"clang_Cursor_getMangling"); + } + /** + * {@snippet : + * CXString clang_Cursor_getMangling(CXCursor); + * } + */ + public static MemorySegment clang_Cursor_getMangling(SegmentAllocator allocator, MemorySegment x1) { + var mh$ = clang_Cursor_getMangling$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum CXTokenKind.CXToken_Punctuation = 0; + * } + */ + public static int CXToken_Punctuation() { + return (int)0L; + } + /** + * {@snippet : + * enum CXTokenKind.CXToken_Keyword = 1; + * } + */ + public static int CXToken_Keyword() { + return (int)1L; + } + /** + * {@snippet : + * enum CXTokenKind.CXToken_Identifier = 2; + * } + */ + public static int CXToken_Identifier() { + return (int)2L; + } + /** + * {@snippet : + * enum CXTokenKind.CXToken_Literal = 3; + * } + */ + public static int CXToken_Literal() { + return (int)3L; + } + /** + * {@snippet : + * enum CXTokenKind.CXToken_Comment = 4; + * } + */ + public static int CXToken_Comment() { + return (int)4L; + } + public static MethodHandle clang_getTokenKind$MH() { + return RuntimeHelper.requireNonNull(constants$16.clang_getTokenKind$MH,"clang_getTokenKind"); + } + /** + * {@snippet : + * CXTokenKind clang_getTokenKind(CXToken); + * } + */ + public static int clang_getTokenKind(MemorySegment x0) { + var mh$ = clang_getTokenKind$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getTokenSpelling$MH() { + return RuntimeHelper.requireNonNull(constants$16.clang_getTokenSpelling$MH,"clang_getTokenSpelling"); + } + /** + * {@snippet : + * CXString clang_getTokenSpelling(CXTranslationUnit, CXToken); + * } + */ + public static MemorySegment clang_getTokenSpelling(SegmentAllocator allocator, MemorySegment x1, MemorySegment x2) { + var mh$ = clang_getTokenSpelling$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getTokenLocation$MH() { + return RuntimeHelper.requireNonNull(constants$16.clang_getTokenLocation$MH,"clang_getTokenLocation"); + } + /** + * {@snippet : + * CXSourceLocation clang_getTokenLocation(CXTranslationUnit, CXToken); + * } + */ + public static MemorySegment clang_getTokenLocation(SegmentAllocator allocator, MemorySegment x1, MemorySegment x2) { + var mh$ = clang_getTokenLocation$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getTokenExtent$MH() { + return RuntimeHelper.requireNonNull(constants$16.clang_getTokenExtent$MH,"clang_getTokenExtent"); + } + /** + * {@snippet : + * CXSourceRange clang_getTokenExtent(CXTranslationUnit, CXToken); + * } + */ + public static MemorySegment clang_getTokenExtent(SegmentAllocator allocator, MemorySegment x1, MemorySegment x2) { + var mh$ = clang_getTokenExtent$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_tokenize$MH() { + return RuntimeHelper.requireNonNull(constants$16.clang_tokenize$MH,"clang_tokenize"); + } + /** + * {@snippet : + * void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range, CXToken** Tokens, unsigned int* NumTokens); + * } + */ + public static void clang_tokenize(MemorySegment TU, MemorySegment Range, MemorySegment Tokens, MemorySegment NumTokens) { + var mh$ = clang_tokenize$MH(); + try { + mh$.invokeExact(TU, Range, Tokens, NumTokens); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_disposeTokens$MH() { + return RuntimeHelper.requireNonNull(constants$16.clang_disposeTokens$MH,"clang_disposeTokens"); + } + /** + * {@snippet : + * void clang_disposeTokens(CXTranslationUnit TU, CXToken* Tokens, unsigned int NumTokens); + * } + */ + public static void clang_disposeTokens(MemorySegment TU, MemorySegment Tokens, int NumTokens) { + var mh$ = clang_disposeTokens$MH(); + try { + mh$.invokeExact(TU, Tokens, NumTokens); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getCursorKindSpelling$MH() { + return RuntimeHelper.requireNonNull(constants$17.clang_getCursorKindSpelling$MH,"clang_getCursorKindSpelling"); + } + /** + * {@snippet : + * CXString clang_getCursorKindSpelling(enum CXCursorKind Kind); + * } + */ + public static MemorySegment clang_getCursorKindSpelling(SegmentAllocator allocator, int Kind) { + var mh$ = clang_getCursorKindSpelling$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator, Kind); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_getClangVersion$MH() { + return RuntimeHelper.requireNonNull(constants$17.clang_getClangVersion$MH,"clang_getClangVersion"); + } + /** + * {@snippet : + * CXString clang_getClangVersion(); + * } + */ + public static MemorySegment clang_getClangVersion(SegmentAllocator allocator) { + var mh$ = clang_getClangVersion$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(allocator); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_toggleCrashRecovery$MH() { + return RuntimeHelper.requireNonNull(constants$17.clang_toggleCrashRecovery$MH,"clang_toggleCrashRecovery"); + } + /** + * {@snippet : + * void clang_toggleCrashRecovery(unsigned int isEnabled); + * } + */ + public static void clang_toggleCrashRecovery(int isEnabled) { + var mh$ = clang_toggleCrashRecovery$MH(); + try { + mh$.invokeExact(isEnabled); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_Cursor_Evaluate$MH() { + return RuntimeHelper.requireNonNull(constants$17.clang_Cursor_Evaluate$MH,"clang_Cursor_Evaluate"); + } + /** + * {@snippet : + * CXEvalResult clang_Cursor_Evaluate(CXCursor C); + * } + */ + public static MemorySegment clang_Cursor_Evaluate(MemorySegment C) { + var mh$ = clang_Cursor_Evaluate$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(C); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_EvalResult_getKind$MH() { + return RuntimeHelper.requireNonNull(constants$17.clang_EvalResult_getKind$MH,"clang_EvalResult_getKind"); + } + /** + * {@snippet : + * CXEvalResultKind clang_EvalResult_getKind(CXEvalResult E); + * } + */ + public static int clang_EvalResult_getKind(MemorySegment E) { + var mh$ = clang_EvalResult_getKind$MH(); + try { + return (int)mh$.invokeExact(E); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_EvalResult_getAsInt$MH() { + return RuntimeHelper.requireNonNull(constants$17.clang_EvalResult_getAsInt$MH,"clang_EvalResult_getAsInt"); + } + /** + * {@snippet : + * int clang_EvalResult_getAsInt(CXEvalResult E); + * } + */ + public static int clang_EvalResult_getAsInt(MemorySegment E) { + var mh$ = clang_EvalResult_getAsInt$MH(); + try { + return (int)mh$.invokeExact(E); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_EvalResult_getAsLongLong$MH() { + return RuntimeHelper.requireNonNull(constants$18.clang_EvalResult_getAsLongLong$MH,"clang_EvalResult_getAsLongLong"); + } + /** + * {@snippet : + * long long clang_EvalResult_getAsLongLong(CXEvalResult E); + * } + */ + public static long clang_EvalResult_getAsLongLong(MemorySegment E) { + var mh$ = clang_EvalResult_getAsLongLong$MH(); + try { + return (long)mh$.invokeExact(E); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_EvalResult_isUnsignedInt$MH() { + return RuntimeHelper.requireNonNull(constants$18.clang_EvalResult_isUnsignedInt$MH,"clang_EvalResult_isUnsignedInt"); + } + /** + * {@snippet : + * unsigned int clang_EvalResult_isUnsignedInt(CXEvalResult E); + * } + */ + public static int clang_EvalResult_isUnsignedInt(MemorySegment E) { + var mh$ = clang_EvalResult_isUnsignedInt$MH(); + try { + return (int)mh$.invokeExact(E); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_EvalResult_getAsUnsigned$MH() { + return RuntimeHelper.requireNonNull(constants$18.clang_EvalResult_getAsUnsigned$MH,"clang_EvalResult_getAsUnsigned"); + } + /** + * {@snippet : + * unsigned long long clang_EvalResult_getAsUnsigned(CXEvalResult E); + * } + */ + public static long clang_EvalResult_getAsUnsigned(MemorySegment E) { + var mh$ = clang_EvalResult_getAsUnsigned$MH(); + try { + return (long)mh$.invokeExact(E); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_EvalResult_getAsDouble$MH() { + return RuntimeHelper.requireNonNull(constants$18.clang_EvalResult_getAsDouble$MH,"clang_EvalResult_getAsDouble"); + } + /** + * {@snippet : + * double clang_EvalResult_getAsDouble(CXEvalResult E); + * } + */ + public static double clang_EvalResult_getAsDouble(MemorySegment E) { + var mh$ = clang_EvalResult_getAsDouble$MH(); + try { + return (double)mh$.invokeExact(E); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_EvalResult_getAsStr$MH() { + return RuntimeHelper.requireNonNull(constants$18.clang_EvalResult_getAsStr$MH,"clang_EvalResult_getAsStr"); + } + /** + * {@snippet : + * char* clang_EvalResult_getAsStr(CXEvalResult E); + * } + */ + public static MemorySegment clang_EvalResult_getAsStr(MemorySegment E) { + var mh$ = clang_EvalResult_getAsStr$MH(); + try { + return (java.lang.foreign.MemorySegment)mh$.invokeExact(E); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clang_EvalResult_dispose$MH() { + return RuntimeHelper.requireNonNull(constants$18.clang_EvalResult_dispose$MH,"clang_EvalResult_dispose"); + } + /** + * {@snippet : + * void clang_EvalResult_dispose(CXEvalResult E); + * } + */ + public static void clang_EvalResult_dispose(MemorySegment E) { + var mh$ = clang_EvalResult_dispose$MH(); + try { + mh$.invokeExact(E); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + /** + * {@snippet : + * enum .CXResult_Success = 0; + * } + */ + public static int CXResult_Success() { + return (int)0L; + } + /** + * {@snippet : + * enum .CXResult_Invalid = 1; + * } + */ + public static int CXResult_Invalid() { + return (int)1L; + } + /** + * {@snippet : + * enum .CXResult_VisitBreak = 2; + * } + */ + public static int CXResult_VisitBreak() { + return (int)2L; + } +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/RuntimeHelper.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/RuntimeHelper.java new file mode 100644 index 00000000..aa5f1076 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/RuntimeHelper.java @@ -0,0 +1,333 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.jextract.clang.libclang; +// Generated by jextract + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.foreign.*; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; + +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { + throw new AssertionError("should not reach here"); + }; + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + if (System.getenv("LIBCLANG_PATH") != null) { + System.load(System.getenv("LIBCLANG_PATH")); + } else { + var libraryFile = new File(getTemporaryDirectory() + inferLibraryFileName()); + if (!libraryFile.exists()) { + var embeddedLibraryFile = findFileInClasspath(inferEmbeddedLibraryFileName()); + try { + copyInputStreamToFile(embeddedLibraryFile, libraryFile.getAbsolutePath()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + libraryFile.deleteOnExit(); + System.load(libraryFile.getAbsolutePath()); + } + + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() { + } + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); + handle = handle.bindTo(z); + return LINKER.upcallStub(handle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert (args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o : unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } + + private static String inferEmbeddedLibraryFileName() { + return STR."libclang-\{inferArchitecture()}.\{inferLibraryExtension()}"; + } + + private static String inferLibraryFileName() { + return STR."libclang.\{inferLibraryExtension()}"; + } + + private static String inferLibraryExtension() { + var osName = System.getProperty("os.name").toLowerCase(); + + if (osName.startsWith("windows")) { + return "dll"; + } else if (osName.contains("nix") || osName.contains("nux")) { + return "so"; + } else if (osName.contains("mac")) { + return "dylib"; + } + + throw new UnsupportedOperationException(STR."Unsupported operating system: \{osName}"); + } + + private static String inferArchitecture() { + var architecture = System.getProperty("os.arch").toLowerCase(); + + if (architecture.contains("amd64") + || architecture.contains("x86_64") + || architecture.contains("x86") + || architecture.contains("i386")) { + return "x86_64"; + } else if (architecture.contains("arm") + || architecture.contains("aarch")) { + return "arm64"; + } + + throw new UnsupportedOperationException(STR."Unsupported architecture: \{architecture}"); + } + private static InputStream findFileInClasspath(String fileName) { + // Get current classloader + ClassLoader classLoader = RuntimeHelper.class.getClassLoader(); + + // Find the resource + InputStream resourceStream = classLoader.getResourceAsStream(fileName); + + if (resourceStream == null) { + throw new IllegalArgumentException(STR."File not found in classpath: \{fileName}"); + } + + return resourceStream; + } + + private static void copyInputStreamToFile(InputStream source, String targetFilePath) throws IOException { + Files.copy(source, Path.of(targetFilePath), StandardCopyOption.REPLACE_EXISTING); + } + + private static String getTemporaryDirectory() { + String tempDir = System.getProperty("java.io.tmpdir"); + if (!tempDir.endsWith(File.separator)) { + // append file separator if it does not exist + tempDir += File.separator; + } + return tempDir; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$0.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$0.java new file mode 100644 index 00000000..6e210c7a --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$0.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} + static final FunctionDescriptor clang_getCString$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ) + ); + static final MethodHandle clang_getCString$MH = RuntimeHelper.downcallHandle( + "clang_getCString", + constants$0.clang_getCString$FUNC + ); + static final FunctionDescriptor clang_disposeString$FUNC = FunctionDescriptor.ofVoid( + MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ) + ); + static final MethodHandle clang_disposeString$MH = RuntimeHelper.downcallHandle( + "clang_disposeString", + constants$0.clang_disposeString$FUNC + ); + static final FunctionDescriptor clang_createIndex$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_createIndex$MH = RuntimeHelper.downcallHandle( + "clang_createIndex", + constants$0.clang_createIndex$FUNC + ); + static final FunctionDescriptor clang_disposeIndex$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_disposeIndex$MH = RuntimeHelper.downcallHandle( + "clang_disposeIndex", + constants$0.clang_disposeIndex$FUNC + ); + static final FunctionDescriptor clang_getFileName$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getFileName$MH = RuntimeHelper.downcallHandle( + "clang_getFileName", + constants$0.clang_getFileName$FUNC + ); + static final FunctionDescriptor clang_getNullLocation$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + )); + static final MethodHandle clang_getNullLocation$MH = RuntimeHelper.downcallHandle( + "clang_getNullLocation", + constants$0.clang_getNullLocation$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$1.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$1.java new file mode 100644 index 00000000..0c9f1002 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$1.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$1 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$1() {} + static final FunctionDescriptor clang_equalLocations$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ) + ); + static final MethodHandle clang_equalLocations$MH = RuntimeHelper.downcallHandle( + "clang_equalLocations", + constants$1.clang_equalLocations$FUNC + ); + static final FunctionDescriptor clang_getLocation$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_getLocation$MH = RuntimeHelper.downcallHandle( + "clang_getLocation", + constants$1.clang_getLocation$FUNC + ); + static final FunctionDescriptor clang_getLocationForOffset$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_getLocationForOffset$MH = RuntimeHelper.downcallHandle( + "clang_getLocationForOffset", + constants$1.clang_getLocationForOffset$FUNC + ); + static final FunctionDescriptor clang_Location_isInSystemHeader$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ) + ); + static final MethodHandle clang_Location_isInSystemHeader$MH = RuntimeHelper.downcallHandle( + "clang_Location_isInSystemHeader", + constants$1.clang_Location_isInSystemHeader$FUNC + ); + static final FunctionDescriptor clang_Location_isFromMainFile$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ) + ); + static final MethodHandle clang_Location_isFromMainFile$MH = RuntimeHelper.downcallHandle( + "clang_Location_isFromMainFile", + constants$1.clang_Location_isFromMainFile$FUNC + ); + static final FunctionDescriptor clang_Range_isNull$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("begin_int_data"), + Constants$root.C_INT$LAYOUT.withName("end_int_data") + ) + ); + static final MethodHandle clang_Range_isNull$MH = RuntimeHelper.downcallHandle( + "clang_Range_isNull", + constants$1.clang_Range_isNull$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$10.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$10.java new file mode 100644 index 00000000..bdb4289f --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$10.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$10 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$10() {} + static final FunctionDescriptor clang_isVolatileQualifiedType$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_isVolatileQualifiedType$MH = RuntimeHelper.downcallHandle( + "clang_isVolatileQualifiedType", + constants$10.clang_isVolatileQualifiedType$FUNC + ); + static final FunctionDescriptor clang_getTypedefName$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getTypedefName$MH = RuntimeHelper.downcallHandle( + "clang_getTypedefName", + constants$10.clang_getTypedefName$FUNC + ); + static final FunctionDescriptor clang_getPointeeType$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getPointeeType$MH = RuntimeHelper.downcallHandle( + "clang_getPointeeType", + constants$10.clang_getPointeeType$FUNC + ); + static final FunctionDescriptor clang_getTypeDeclaration$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getTypeDeclaration$MH = RuntimeHelper.downcallHandle( + "clang_getTypeDeclaration", + constants$10.clang_getTypeDeclaration$FUNC + ); + static final FunctionDescriptor clang_getTypeKindSpelling$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_getTypeKindSpelling$MH = RuntimeHelper.downcallHandle( + "clang_getTypeKindSpelling", + constants$10.clang_getTypeKindSpelling$FUNC + ); + static final FunctionDescriptor clang_getFunctionTypeCallingConv$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getFunctionTypeCallingConv$MH = RuntimeHelper.downcallHandle( + "clang_getFunctionTypeCallingConv", + constants$10.clang_getFunctionTypeCallingConv$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$11.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$11.java new file mode 100644 index 00000000..4f614630 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$11.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$11 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$11() {} + static final FunctionDescriptor clang_getResultType$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getResultType$MH = RuntimeHelper.downcallHandle( + "clang_getResultType", + constants$11.clang_getResultType$FUNC + ); + static final FunctionDescriptor clang_getNumArgTypes$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getNumArgTypes$MH = RuntimeHelper.downcallHandle( + "clang_getNumArgTypes", + constants$11.clang_getNumArgTypes$FUNC + ); + static final FunctionDescriptor clang_getArgType$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_getArgType$MH = RuntimeHelper.downcallHandle( + "clang_getArgType", + constants$11.clang_getArgType$FUNC + ); + static final FunctionDescriptor clang_isFunctionTypeVariadic$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_isFunctionTypeVariadic$MH = RuntimeHelper.downcallHandle( + "clang_isFunctionTypeVariadic", + constants$11.clang_isFunctionTypeVariadic$FUNC + ); + static final FunctionDescriptor clang_getCursorResultType$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorResultType$MH = RuntimeHelper.downcallHandle( + "clang_getCursorResultType", + constants$11.clang_getCursorResultType$FUNC + ); + static final FunctionDescriptor clang_getElementType$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getElementType$MH = RuntimeHelper.downcallHandle( + "clang_getElementType", + constants$11.clang_getElementType$FUNC + ); + + static final MethodHandle clang_getValueType$MH = RuntimeHelper.downcallHandle( + "clang_Type_getValueType", + constants$11.clang_getElementType$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$12.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$12.java new file mode 100644 index 00000000..6d75dcae --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$12.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$12 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$12() {} + static final FunctionDescriptor clang_getNumElements$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getNumElements$MH = RuntimeHelper.downcallHandle( + "clang_getNumElements", + constants$12.clang_getNumElements$FUNC + ); + static final FunctionDescriptor clang_getArrayElementType$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getArrayElementType$MH = RuntimeHelper.downcallHandle( + "clang_getArrayElementType", + constants$12.clang_getArrayElementType$FUNC + ); + static final FunctionDescriptor clang_getArraySize$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getArraySize$MH = RuntimeHelper.downcallHandle( + "clang_getArraySize", + constants$12.clang_getArraySize$FUNC + ); + static final FunctionDescriptor clang_Type_getSizeOf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Type_getSizeOf$MH = RuntimeHelper.downcallHandle( + "clang_Type_getSizeOf", + constants$12.clang_Type_getSizeOf$FUNC + ); + static final FunctionDescriptor clang_Type_getAlignOf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Type_getAlignOf$MH = RuntimeHelper.downcallHandle( + "clang_Type_getAlignOf", + constants$12.clang_Type_getAlignOf$FUNC + ); + static final FunctionDescriptor clang_Type_getOffsetOf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_Type_getOffsetOf$MH = RuntimeHelper.downcallHandle( + "clang_Type_getOffsetOf", + constants$12.clang_Type_getOffsetOf$FUNC + ); + static final FunctionDescriptor clang_Cursor_isAnonymous$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_isAnonymous$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_isAnonymous", + constants$12.clang_Cursor_isAnonymous$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$13.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$13.java new file mode 100644 index 00000000..a4843443 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$13.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$13 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$13() {} + static final FunctionDescriptor clang_Cursor_isAnonymousRecordDecl$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_isAnonymousRecordDecl$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_isAnonymousRecordDecl", + constants$13.clang_Cursor_isAnonymousRecordDecl$FUNC + ); + static final FunctionDescriptor clang_Cursor_isBitField$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_isBitField$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_isBitField", + constants$13.clang_Cursor_isBitField$FUNC + ); + static final FunctionDescriptor CXCursorVisitor$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle CXCursorVisitor$MH = RuntimeHelper.downcallHandle( + constants$13.CXCursorVisitor$FUNC + ); + static final FunctionDescriptor clang_visitChildren$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_visitChildren$MH = RuntimeHelper.downcallHandle( + "clang_visitChildren", + constants$13.clang_visitChildren$FUNC + ); + static final FunctionDescriptor clang_getCursorUSR$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorUSR$MH = RuntimeHelper.downcallHandle( + "clang_getCursorUSR", + constants$13.clang_getCursorUSR$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$14.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$14.java new file mode 100644 index 00000000..a0d49450 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$14.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$14 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$14() {} + static final FunctionDescriptor clang_getCursorSpelling$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorSpelling$MH = RuntimeHelper.downcallHandle( + "clang_getCursorSpelling", + constants$14.clang_getCursorSpelling$FUNC + ); + static final FunctionDescriptor clang_PrintingPolicy_getProperty$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_PrintingPolicy_getProperty$MH = RuntimeHelper.downcallHandle( + "clang_PrintingPolicy_getProperty", + constants$14.clang_PrintingPolicy_getProperty$FUNC + ); + static final FunctionDescriptor clang_PrintingPolicy_setProperty$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_PrintingPolicy_setProperty$MH = RuntimeHelper.downcallHandle( + "clang_PrintingPolicy_setProperty", + constants$14.clang_PrintingPolicy_setProperty$FUNC + ); + static final FunctionDescriptor clang_getCursorPrintingPolicy$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorPrintingPolicy$MH = RuntimeHelper.downcallHandle( + "clang_getCursorPrintingPolicy", + constants$14.clang_getCursorPrintingPolicy$FUNC + ); + static final FunctionDescriptor clang_PrintingPolicy_dispose$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_PrintingPolicy_dispose$MH = RuntimeHelper.downcallHandle( + "clang_PrintingPolicy_dispose", + constants$14.clang_PrintingPolicy_dispose$FUNC + ); + static final FunctionDescriptor clang_getCursorPrettyPrinted$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getCursorPrettyPrinted$MH = RuntimeHelper.downcallHandle( + "clang_getCursorPrettyPrinted", + constants$14.clang_getCursorPrettyPrinted$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$15.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$15.java new file mode 100644 index 00000000..fb57c50f --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$15.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$15 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$15() {} + static final FunctionDescriptor clang_getCursorDisplayName$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorDisplayName$MH = RuntimeHelper.downcallHandle( + "clang_getCursorDisplayName", + constants$15.clang_getCursorDisplayName$FUNC + ); + static final FunctionDescriptor clang_getCursorReferenced$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorReferenced$MH = RuntimeHelper.downcallHandle( + "clang_getCursorReferenced", + constants$15.clang_getCursorReferenced$FUNC + ); + static final FunctionDescriptor clang_getCursorDefinition$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorDefinition$MH = RuntimeHelper.downcallHandle( + "clang_getCursorDefinition", + constants$15.clang_getCursorDefinition$FUNC + ); + static final FunctionDescriptor clang_isCursorDefinition$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_isCursorDefinition$MH = RuntimeHelper.downcallHandle( + "clang_isCursorDefinition", + constants$15.clang_isCursorDefinition$FUNC + ); + static final FunctionDescriptor clang_Cursor_isVariadic$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_isVariadic$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_isVariadic", + constants$15.clang_Cursor_isVariadic$FUNC + ); + static final FunctionDescriptor clang_Cursor_getMangling$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_getMangling$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_getMangling", + constants$15.clang_Cursor_getMangling$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$16.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$16.java new file mode 100644 index 00000000..b70a7926 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$16.java @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$16 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$16() {} + static final FunctionDescriptor clang_getTokenKind$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(4, Constants$root.C_INT$LAYOUT).withName("int_data"), + Constants$root.C_POINTER$LAYOUT.withName("ptr_data") + ) + ); + static final MethodHandle clang_getTokenKind$MH = RuntimeHelper.downcallHandle( + "clang_getTokenKind", + constants$16.clang_getTokenKind$FUNC + ); + static final FunctionDescriptor clang_getTokenSpelling$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT, + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(4, Constants$root.C_INT$LAYOUT).withName("int_data"), + Constants$root.C_POINTER$LAYOUT.withName("ptr_data") + ) + ); + static final MethodHandle clang_getTokenSpelling$MH = RuntimeHelper.downcallHandle( + "clang_getTokenSpelling", + constants$16.clang_getTokenSpelling$FUNC + ); + static final FunctionDescriptor clang_getTokenLocation$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT, + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(4, Constants$root.C_INT$LAYOUT).withName("int_data"), + Constants$root.C_POINTER$LAYOUT.withName("ptr_data") + ) + ); + static final MethodHandle clang_getTokenLocation$MH = RuntimeHelper.downcallHandle( + "clang_getTokenLocation", + constants$16.clang_getTokenLocation$FUNC + ); + static final FunctionDescriptor clang_getTokenExtent$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("begin_int_data"), + Constants$root.C_INT$LAYOUT.withName("end_int_data") + ), + Constants$root.C_POINTER$LAYOUT, + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(4, Constants$root.C_INT$LAYOUT).withName("int_data"), + Constants$root.C_POINTER$LAYOUT.withName("ptr_data") + ) + ); + static final MethodHandle clang_getTokenExtent$MH = RuntimeHelper.downcallHandle( + "clang_getTokenExtent", + constants$16.clang_getTokenExtent$FUNC + ); + static final FunctionDescriptor clang_tokenize$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT, + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("begin_int_data"), + Constants$root.C_INT$LAYOUT.withName("end_int_data") + ), + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_tokenize$MH = RuntimeHelper.downcallHandle( + "clang_tokenize", + constants$16.clang_tokenize$FUNC + ); + static final FunctionDescriptor clang_disposeTokens$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_disposeTokens$MH = RuntimeHelper.downcallHandle( + "clang_disposeTokens", + constants$16.clang_disposeTokens$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$17.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$17.java new file mode 100644 index 00000000..1270db7c --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$17.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$17 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$17() {} + static final FunctionDescriptor clang_getCursorKindSpelling$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_getCursorKindSpelling$MH = RuntimeHelper.downcallHandle( + "clang_getCursorKindSpelling", + constants$17.clang_getCursorKindSpelling$FUNC + ); + static final FunctionDescriptor clang_getClangVersion$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + )); + static final MethodHandle clang_getClangVersion$MH = RuntimeHelper.downcallHandle( + "clang_getClangVersion", + constants$17.clang_getClangVersion$FUNC + ); + static final FunctionDescriptor clang_toggleCrashRecovery$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_toggleCrashRecovery$MH = RuntimeHelper.downcallHandle( + "clang_toggleCrashRecovery", + constants$17.clang_toggleCrashRecovery$FUNC + ); + static final FunctionDescriptor clang_Cursor_Evaluate$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_Evaluate$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_Evaluate", + constants$17.clang_Cursor_Evaluate$FUNC + ); + static final FunctionDescriptor clang_EvalResult_getKind$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_EvalResult_getKind$MH = RuntimeHelper.downcallHandle( + "clang_EvalResult_getKind", + constants$17.clang_EvalResult_getKind$FUNC + ); + static final FunctionDescriptor clang_EvalResult_getAsInt$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_EvalResult_getAsInt$MH = RuntimeHelper.downcallHandle( + "clang_EvalResult_getAsInt", + constants$17.clang_EvalResult_getAsInt$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$18.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$18.java new file mode 100644 index 00000000..6d1e1019 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$18.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$18 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$18() {} + static final FunctionDescriptor clang_EvalResult_getAsLongLong$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_EvalResult_getAsLongLong$MH = RuntimeHelper.downcallHandle( + "clang_EvalResult_getAsLongLong", + constants$18.clang_EvalResult_getAsLongLong$FUNC + ); + static final FunctionDescriptor clang_EvalResult_isUnsignedInt$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_EvalResult_isUnsignedInt$MH = RuntimeHelper.downcallHandle( + "clang_EvalResult_isUnsignedInt", + constants$18.clang_EvalResult_isUnsignedInt$FUNC + ); + static final FunctionDescriptor clang_EvalResult_getAsUnsigned$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_EvalResult_getAsUnsigned$MH = RuntimeHelper.downcallHandle( + "clang_EvalResult_getAsUnsigned", + constants$18.clang_EvalResult_getAsUnsigned$FUNC + ); + static final FunctionDescriptor clang_EvalResult_getAsDouble$FUNC = FunctionDescriptor.of(Constants$root.C_DOUBLE$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_EvalResult_getAsDouble$MH = RuntimeHelper.downcallHandle( + "clang_EvalResult_getAsDouble", + constants$18.clang_EvalResult_getAsDouble$FUNC + ); + static final FunctionDescriptor clang_EvalResult_getAsStr$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_EvalResult_getAsStr$MH = RuntimeHelper.downcallHandle( + "clang_EvalResult_getAsStr", + constants$18.clang_EvalResult_getAsStr$FUNC + ); + static final FunctionDescriptor clang_EvalResult_dispose$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_EvalResult_dispose$MH = RuntimeHelper.downcallHandle( + "clang_EvalResult_dispose", + constants$18.clang_EvalResult_dispose$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$2.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$2.java new file mode 100644 index 00000000..c58a27a7 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$2.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$2 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$2() {} + static final FunctionDescriptor clang_getExpansionLocation$FUNC = FunctionDescriptor.ofVoid( + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getExpansionLocation$MH = RuntimeHelper.downcallHandle( + "clang_getExpansionLocation", + constants$2.clang_getExpansionLocation$FUNC + ); + static final FunctionDescriptor clang_getSpellingLocation$FUNC = FunctionDescriptor.ofVoid( + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getSpellingLocation$MH = RuntimeHelper.downcallHandle( + "clang_getSpellingLocation", + constants$2.clang_getSpellingLocation$FUNC + ); + static final FunctionDescriptor clang_getFileLocation$FUNC = FunctionDescriptor.ofVoid( + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getFileLocation$MH = RuntimeHelper.downcallHandle( + "clang_getFileLocation", + constants$2.clang_getFileLocation$FUNC + ); + static final FunctionDescriptor clang_getRangeStart$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("begin_int_data"), + Constants$root.C_INT$LAYOUT.withName("end_int_data") + ) + ); + static final MethodHandle clang_getRangeStart$MH = RuntimeHelper.downcallHandle( + "clang_getRangeStart", + constants$2.clang_getRangeStart$FUNC + ); + static final FunctionDescriptor clang_getRangeEnd$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("begin_int_data"), + Constants$root.C_INT$LAYOUT.withName("end_int_data") + ) + ); + static final MethodHandle clang_getRangeEnd$MH = RuntimeHelper.downcallHandle( + "clang_getRangeEnd", + constants$2.clang_getRangeEnd$FUNC + ); + static final FunctionDescriptor clang_getChildDiagnostics$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getChildDiagnostics$MH = RuntimeHelper.downcallHandle( + "clang_getChildDiagnostics", + constants$2.clang_getChildDiagnostics$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$3.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$3.java new file mode 100644 index 00000000..aafbfae5 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$3.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$3 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$3() {} + static final FunctionDescriptor clang_getNumDiagnostics$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getNumDiagnostics$MH = RuntimeHelper.downcallHandle( + "clang_getNumDiagnostics", + constants$3.clang_getNumDiagnostics$FUNC + ); + static final FunctionDescriptor clang_getDiagnostic$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_getDiagnostic$MH = RuntimeHelper.downcallHandle( + "clang_getDiagnostic", + constants$3.clang_getDiagnostic$FUNC + ); + static final FunctionDescriptor clang_disposeDiagnostic$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_disposeDiagnostic$MH = RuntimeHelper.downcallHandle( + "clang_disposeDiagnostic", + constants$3.clang_disposeDiagnostic$FUNC + ); + static final FunctionDescriptor clang_formatDiagnostic$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_formatDiagnostic$MH = RuntimeHelper.downcallHandle( + "clang_formatDiagnostic", + constants$3.clang_formatDiagnostic$FUNC + ); + static final FunctionDescriptor clang_defaultDiagnosticDisplayOptions$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); + static final MethodHandle clang_defaultDiagnosticDisplayOptions$MH = RuntimeHelper.downcallHandle( + "clang_defaultDiagnosticDisplayOptions", + constants$3.clang_defaultDiagnosticDisplayOptions$FUNC + ); + static final FunctionDescriptor clang_getDiagnosticSeverity$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getDiagnosticSeverity$MH = RuntimeHelper.downcallHandle( + "clang_getDiagnosticSeverity", + constants$3.clang_getDiagnosticSeverity$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$4.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$4.java new file mode 100644 index 00000000..eb7072f4 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$4.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$4 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$4() {} + static final FunctionDescriptor clang_getDiagnosticLocation$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getDiagnosticLocation$MH = RuntimeHelper.downcallHandle( + "clang_getDiagnosticLocation", + constants$4.clang_getDiagnosticLocation$FUNC + ); + static final FunctionDescriptor clang_getDiagnosticSpelling$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getDiagnosticSpelling$MH = RuntimeHelper.downcallHandle( + "clang_getDiagnosticSpelling", + constants$4.clang_getDiagnosticSpelling$FUNC + ); + static final FunctionDescriptor clang_parseTranslationUnit$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_parseTranslationUnit$MH = RuntimeHelper.downcallHandle( + "clang_parseTranslationUnit", + constants$4.clang_parseTranslationUnit$FUNC + ); + static final FunctionDescriptor clang_parseTranslationUnit2$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_parseTranslationUnit2$MH = RuntimeHelper.downcallHandle( + "clang_parseTranslationUnit2", + constants$4.clang_parseTranslationUnit2$FUNC + ); + static final FunctionDescriptor clang_saveTranslationUnit$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_saveTranslationUnit$MH = RuntimeHelper.downcallHandle( + "clang_saveTranslationUnit", + constants$4.clang_saveTranslationUnit$FUNC + ); + static final FunctionDescriptor clang_disposeTranslationUnit$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_disposeTranslationUnit$MH = RuntimeHelper.downcallHandle( + "clang_disposeTranslationUnit", + constants$4.clang_disposeTranslationUnit$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$5.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$5.java new file mode 100644 index 00000000..ec9bdefa --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$5.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$5 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$5() {} + static final FunctionDescriptor clang_defaultReparseOptions$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_defaultReparseOptions$MH = RuntimeHelper.downcallHandle( + "clang_defaultReparseOptions", + constants$5.clang_defaultReparseOptions$FUNC + ); + static final FunctionDescriptor clang_reparseTranslationUnit$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_reparseTranslationUnit$MH = RuntimeHelper.downcallHandle( + "clang_reparseTranslationUnit", + constants$5.clang_reparseTranslationUnit$FUNC + ); + static final FunctionDescriptor clang_getNullCursor$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + )); + static final MethodHandle clang_getNullCursor$MH = RuntimeHelper.downcallHandle( + "clang_getNullCursor", + constants$5.clang_getNullCursor$FUNC + ); + static final FunctionDescriptor clang_getTranslationUnitCursor$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clang_getTranslationUnitCursor$MH = RuntimeHelper.downcallHandle( + "clang_getTranslationUnitCursor", + constants$5.clang_getTranslationUnitCursor$FUNC + ); + static final FunctionDescriptor clang_equalCursors$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_equalCursors$MH = RuntimeHelper.downcallHandle( + "clang_equalCursors", + constants$5.clang_equalCursors$FUNC + ); + static final FunctionDescriptor clang_Cursor_isNull$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_isNull$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_isNull", + constants$5.clang_Cursor_isNull$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$6.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$6.java new file mode 100644 index 00000000..e9ea2575 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$6.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$6 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$6() {} + static final FunctionDescriptor clang_getCursorKind$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorKind$MH = RuntimeHelper.downcallHandle( + "clang_getCursorKind", + constants$6.clang_getCursorKind$FUNC + ); + static final FunctionDescriptor clang_isDeclaration$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_isDeclaration$MH = RuntimeHelper.downcallHandle( + "clang_isDeclaration", + constants$6.clang_isDeclaration$FUNC + ); + static final FunctionDescriptor clang_isAttribute$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_isAttribute$MH = RuntimeHelper.downcallHandle( + "clang_isAttribute", + constants$6.clang_isAttribute$FUNC + ); + static final FunctionDescriptor clang_isInvalid$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_isInvalid$MH = RuntimeHelper.downcallHandle( + "clang_isInvalid", + constants$6.clang_isInvalid$FUNC + ); + static final FunctionDescriptor clang_isPreprocessing$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_isPreprocessing$MH = RuntimeHelper.downcallHandle( + "clang_isPreprocessing", + constants$6.clang_isPreprocessing$FUNC + ); + static final FunctionDescriptor clang_getCursorLinkage$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorLinkage$MH = RuntimeHelper.downcallHandle( + "clang_getCursorLinkage", + constants$6.clang_getCursorLinkage$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$7.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$7.java new file mode 100644 index 00000000..e909f1ae --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$7.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$7 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$7() {} + static final FunctionDescriptor clang_getCursorLanguage$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorLanguage$MH = RuntimeHelper.downcallHandle( + "clang_getCursorLanguage", + constants$7.clang_getCursorLanguage$FUNC + ); + static final FunctionDescriptor clang_Cursor_getTranslationUnit$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_getTranslationUnit$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_getTranslationUnit", + constants$7.clang_Cursor_getTranslationUnit$FUNC + ); + static final FunctionDescriptor clang_getCursorLocation$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("int_data"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorLocation$MH = RuntimeHelper.downcallHandle( + "clang_getCursorLocation", + constants$7.clang_getCursorLocation$FUNC + ); + static final FunctionDescriptor clang_getCursorExtent$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("ptr_data"), + Constants$root.C_INT$LAYOUT.withName("begin_int_data"), + Constants$root.C_INT$LAYOUT.withName("end_int_data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorExtent$MH = RuntimeHelper.downcallHandle( + "clang_getCursorExtent", + constants$7.clang_getCursorExtent$FUNC + ); + static final FunctionDescriptor clang_getCursorType$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCursorType$MH = RuntimeHelper.downcallHandle( + "clang_getCursorType", + constants$7.clang_getCursorType$FUNC + ); + static final FunctionDescriptor clang_getTypeSpelling$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("data"), + Constants$root.C_INT$LAYOUT.withName("private_flags"), + MemoryLayout.paddingLayout(4) + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getTypeSpelling$MH = RuntimeHelper.downcallHandle( + "clang_getTypeSpelling", + constants$7.clang_getTypeSpelling$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$8.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$8.java new file mode 100644 index 00000000..4661c8ca --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$8.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$8 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$8() {} + static final FunctionDescriptor clang_getTypedefDeclUnderlyingType$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getTypedefDeclUnderlyingType$MH = RuntimeHelper.downcallHandle( + "clang_getTypedefDeclUnderlyingType", + constants$8.clang_getTypedefDeclUnderlyingType$FUNC + ); + static final FunctionDescriptor clang_getEnumDeclIntegerType$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getEnumDeclIntegerType$MH = RuntimeHelper.downcallHandle( + "clang_getEnumDeclIntegerType", + constants$8.clang_getEnumDeclIntegerType$FUNC + ); + static final FunctionDescriptor clang_getEnumConstantDeclValue$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getEnumConstantDeclValue$MH = RuntimeHelper.downcallHandle( + "clang_getEnumConstantDeclValue", + constants$8.clang_getEnumConstantDeclValue$FUNC + ); + static final FunctionDescriptor clang_getEnumConstantDeclUnsignedValue$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getEnumConstantDeclUnsignedValue$MH = RuntimeHelper.downcallHandle( + "clang_getEnumConstantDeclUnsignedValue", + constants$8.clang_getEnumConstantDeclUnsignedValue$FUNC + ); + static final FunctionDescriptor clang_getFieldDeclBitWidth$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getFieldDeclBitWidth$MH = RuntimeHelper.downcallHandle( + "clang_getFieldDeclBitWidth", + constants$8.clang_getFieldDeclBitWidth$FUNC + ); + static final FunctionDescriptor clang_Cursor_getNumArguments$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_getNumArguments$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_getNumArguments", + constants$8.clang_Cursor_getNumArguments$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$9.java b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$9.java new file mode 100644 index 00000000..135dc196 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/clang/libclang/constants$9.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Generated by jextract + +package org.openjdk.jextract.clang.libclang; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$9 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$9() {} + static final FunctionDescriptor clang_Cursor_getArgument$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + Constants$root.C_INT$LAYOUT + ); + static final MethodHandle clang_Cursor_getArgument$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_getArgument", + constants$9.clang_Cursor_getArgument$FUNC + ); + static final FunctionDescriptor clang_equalTypes$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_equalTypes$MH = RuntimeHelper.downcallHandle( + "clang_equalTypes", + constants$9.clang_equalTypes$FUNC + ); + static final FunctionDescriptor clang_getCanonicalType$FUNC = FunctionDescriptor.of(MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ), + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_getCanonicalType$MH = RuntimeHelper.downcallHandle( + "clang_getCanonicalType", + constants$9.clang_getCanonicalType$FUNC + ); + static final FunctionDescriptor clang_isConstQualifiedType$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + MemoryLayout.paddingLayout(4), + MemoryLayout.sequenceLayout(2, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_isConstQualifiedType$MH = RuntimeHelper.downcallHandle( + "clang_isConstQualifiedType", + constants$9.clang_isConstQualifiedType$FUNC + ); + static final FunctionDescriptor clang_Cursor_isMacroFunctionLike$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_isMacroFunctionLike$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_isMacroFunctionLike", + constants$9.clang_Cursor_isMacroFunctionLike$FUNC + ); + static final FunctionDescriptor clang_Cursor_isFunctionInlined$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, + MemoryLayout.structLayout( + Constants$root.C_INT$LAYOUT.withName("kind"), + Constants$root.C_INT$LAYOUT.withName("xdata"), + MemoryLayout.sequenceLayout(3, Constants$root.C_POINTER$LAYOUT).withName("data") + ) + ); + static final MethodHandle clang_Cursor_isFunctionInlined$MH = RuntimeHelper.downcallHandle( + "clang_Cursor_isFunctionInlined", + constants$9.clang_Cursor_isFunctionInlined$FUNC + ); +} + + diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/CDeclarationPrinter.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/CDeclarationPrinter.java new file mode 100644 index 00000000..f7503a37 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/CDeclarationPrinter.java @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; + +final class CDeclarationPrinter implements Declaration.Visitor { + private static String SPACES = " ".repeat(92); + private int align = 0; + private String prefix; + + private void incr() { + align += 4; + } + + private void decr() { + align -= 4; + } + + private CDeclarationPrinter(String prefix) { + this.prefix = prefix; + } + + private void indent() { + builder.append(prefix); + builder.append(SPACES.substring(0, align)); + } + + private final StringBuilder builder = new StringBuilder(); + + private String print(Declaration decl) { + decl.accept(this, null); + return builder.toString(); + } + + // Return C source style signature for the given declaration. + // The prefix is emitted for every line. This can be used + // to prefix per line comment character "*" in generated javadoc. + static String declaration(Declaration decl, String prefix) { + Objects.requireNonNull(decl); + Objects.requireNonNull(prefix); + return new CDeclarationPrinter(prefix).print(decl); + } + + static String declaration(Type.Function funcType, String name) { + return nameAndType(funcType, "*" + name); + } + + @Override + public Void visitScoped(Declaration.Scoped d, Void ignored) { + indent(); + var tag = typeTag(d); + if (!tag.isEmpty()) { + builder.append(tag); + if (!d.name().isEmpty()) { + builder.append(" " + d.name()); + } + builder.append(" {"); + builder.append("\n"); + incr(); + } + d.members().forEach(m -> m.accept(this, null)); + if (!tag.isEmpty()) { + decr(); + indent(); + builder.append("};\n"); + } + return null; + } + + @Override + public Void visitFunction(Declaration.Function d, Void ignored) { + indent(); + + // name and args part of the function + StringBuilder buf = new StringBuilder(); + buf.append(d.name()); + buf.append('('); + buf.append( + d.parameters(). + stream(). + map(p -> nameAndType(p.type(), p.name())). + collect(Collectors.joining(", ")) + ); + if (d.type().varargs()) { + buf.append(",..."); + } + buf.append(')'); + + // The return type is handled later to take care of + // pointer to function return type like signal from signal.h + // void (*signal(int sig, void (*func)(int)))(int) + + String funcNameAndArgs = buf.toString(); + Type returnType = d.type().returnType(); + builder.append(nameAndType(returnType, funcNameAndArgs)); + builder.append(";\n"); + return null; + } + + @Override + public Void visitVariable(Declaration.Variable d, Void ignored) { + indent(); + builder.append(nameAndType(d.type(), d.name())); + builder.append(";\n"); + return null; + } + + @Override + public Void visitConstant(Declaration.Constant d, Void ignored) { + indent(); + Optional enumName = EnumConstantLifter.enumName(d); + if (enumName.isPresent()) { + builder.append("enum " + enumName.get() + "." + d.name()); + builder.append(" = "); + builder.append(d.value()); + builder.append(";\n"); + } else { + builder.append("#define "); + builder.append(d.name()); + Object value = d.value(); + builder.append(" "); + if (value instanceof String str) { + builder.append("\"" + Utils.quote(str) + "\""); + } else { + builder.append(value); + } + builder.append("\n"); + } + return null; + } + + @Override + public Void visitTypedef(Declaration.Typedef d, Void ignored) { + indent(); + builder.append("typedef "); + builder.append(nameAndType(d.type(), d.name())); + builder.append(";\n"); + return null; + } + + // In few cases, C type signature 'embeds' name. + // Examples: + // int a[3]; // 'a' in between int and [] + // int (*func)(int); // 'func' is inside paren after '*' + // TypeVisitor accepts name and includes it in the appropriate + // place as needed. If not included, boolean flag is set to false + // in the result. + + private static String nameAndType(Type type, String name) { + var result = type.accept(typeVisitor, name); + var typeStr = result.typeStr(); + return result.nameIncluded() || name.isEmpty() ? + typeStr : (typeStr + " " + name); + } + + // result type for Type.Visitor + private record TypeVisitorResult(boolean nameIncluded, String typeStr) {} + + private static Type.Visitor typeVisitor = new Type.Visitor<>() { + // context argument in this visitor usually starts with a name. But it may pick up + // "*" prefixes for pointer type. [] suffix for array types. For pointer to function + // return type, the context is name of the function + argument types as in declaration. + + @Override + public TypeVisitorResult visitPrimitive(Type.Primitive t, String context) { + return new TypeVisitorResult(false, t.kind().typeName()); + } + + private TypeVisitorResult prefixedType(String prefix, Type.Delegated delegated) { + return new TypeVisitorResult(false, + prefix + " " + delegated.type().accept(this, "").typeStr()); + } + + @Override + public TypeVisitorResult visitDelegated(Type.Delegated t, String context) { + switch (t.kind()) { + case POINTER: { + var result = t.type().accept(this, "*" + context); + if (result.nameIncluded()) { + return new TypeVisitorResult(true, result.typeStr()); + } else { + return new TypeVisitorResult(false, result.typeStr() + "*"); + } + } + case UNSIGNED: + return prefixedType("unsigned", t); + case SIGNED: + return prefixedType("signed", t); + case VOLATILE: + return prefixedType("volatile", t); + case COMPLEX: + return prefixedType("complex", t); + } + // defensive. If no name is present, we don't want to crash + return new TypeVisitorResult(false, t.name().orElse(defaultName(t))); + } + + @Override + public TypeVisitorResult visitFunction(Type.Function t, String context) { + String argsStr; + // Function type may optionally have parameter names. + // Include parameter names if available. + var optParameterNames = t.parameterNames(); + if (optParameterNames.isPresent()) { + List argTypes = t.argumentTypes(); + List argNames = optParameterNames.get(); + int numArgs = argTypes.size(); + List args = new ArrayList<>(numArgs); + for (int i = 0; i < numArgs; i++) { + args.add(nameAndType(argTypes.get(i), argNames.get(i))); + } + argsStr = args.stream() + .collect(Collectors.joining(",", "(", ")")); + } else { + argsStr = t.argumentTypes().stream() + .map(a -> a.accept(this, "").typeStr()) + .collect(Collectors.joining(",", "(", ")")); + } + String res = t.returnType().accept(this, "").typeStr(); + return new TypeVisitorResult(true, res + " (" + context + ")" + argsStr); + } + + @Override + public TypeVisitorResult visitDeclared(Type.Declared t, String context) { + Declaration.Scoped scoped = t.tree(); + return new TypeVisitorResult(false, typeTag(scoped) + " " + scoped.name()); + } + + @Override + public TypeVisitorResult visitArray(Type.Array t, String context) { + String brackets = String.format(" %s[%s]", context, + t.elementCount().isPresent() ? t.elementCount().getAsLong() : ""); + var result = t.elementType().accept(this, brackets); + if (result.nameIncluded()) { + return new TypeVisitorResult(true, result.typeStr()); + } else { + return new TypeVisitorResult(true, result.typeStr() + brackets); + } + } + + @Override + public TypeVisitorResult visitType(Type t, String context) { + return new TypeVisitorResult(false, defaultName(t)); + } + + private String defaultName(Type t) { + return t.toString(); + } + }; + + private static String typeTag(Declaration.Scoped scoped) { + return switch (scoped.kind()) { + case STRUCT -> "struct"; + case UNION -> "union"; + case ENUM -> "enum"; + default -> ""; + }; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/ClangException.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/ClangException.java new file mode 100644 index 00000000..ba0820ea --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/ClangException.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.impl; + +public class ClangException extends RuntimeException { + private static final long serialVersionUID = 0L; + + public ClangException(String message) { + super(message); + } + + public ClangException(String message, Throwable cause) { + super(message, cause); + } + + public ClangException(Throwable cause) { + super(cause); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java new file mode 100644 index 00000000..3e415ef9 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/ClassSourceBuilder.java @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import javax.tools.JavaFileObject; +import java.lang.constant.ClassDesc; +import java.util.List; + +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; +import org.openjdk.jextract.impl.Constants.Constant; + +/** + * Superclass for .java source generator classes. + */ +abstract class ClassSourceBuilder extends JavaSourceBuilder { + + private static final boolean SHOW_GENERATING_CLASS = Boolean.getBoolean("jextract.showGeneratingClass"); + + enum Kind { + CLASS("class"), + INTERFACE("interface"); + + final String kindName; + + Kind(String kindName) { + this.kindName = kindName; + } + } + + final Kind kind; + final ClassDesc desc; + protected final JavaSourceBuilder enclosing; + + // code buffer + private StringBuilder sb = new StringBuilder(); + // current line alignment (number of 4-spaces) + private int align; + + ClassSourceBuilder(JavaSourceBuilder enclosing, Kind kind, String name) { + this.enclosing = enclosing; + this.align = (enclosing instanceof ClassSourceBuilder classSourceBuilder) + ? classSourceBuilder.align : 0; + this.kind = kind; + this.desc = ClassDesc.of(enclosing.packageName(), name); + } + + boolean isNested() { + return enclosing instanceof ClassSourceBuilder; + } + + String className() { + return desc.displayName(); + } + + String fullName() { + return isNested() ? + ((ClassSourceBuilder)enclosing).className() + "." + className() : + className(); + } + + @Override + public final String packageName() { + return desc.packageName(); + } + + String superClass() { + return null; + } + + String mods() { + if (kind == Kind.INTERFACE) { + return "public "; + } + return (isNested() ? "public static " : "public ") + + (isClassFinal() ? "final " : ""); + } + + boolean isClassFinal() { + return true; + } + + void classBegin() { + if (isNested()) { + incrAlign(); + } + emitPackagePrefix(); + emitImportSection(); + + classDeclBegin(); + indent(); + append(mods()); + append(kind.kindName + " " + className()); + if (superClass() != null) { + append(" extends "); + append(superClass()); + } + append(" {\n\n"); + if (kind != Kind.INTERFACE) { + emitConstructor(); + } + } + + void classDeclBegin() {} + + void emitConstructor() { + incrAlign(); + indent(); + append("// Suppresses default constructor, ensuring non-instantiability.\n"); + indent(); + append("private "); + append(className()); + append("() {}"); + append('\n'); + decrAlign(); + } + + JavaSourceBuilder classEnd() { + indent(); + append("}\n\n"); + if (isNested()) { + decrAlign(); + ((ClassSourceBuilder)enclosing).append(build()); + sb = null; + } + return enclosing; + } + + @Override + public List toFiles() { + if (isNested()) { + throw new UnsupportedOperationException("Nested builder!"); + } + String res = build(); + sb = null; + return List.of(Utils.fileFromString(packageName(), className(), res)); + } + + // Internal generation helpers (used by other builders) + + void append(Object o) { + sb.append(o); + } + + void append(String s) { + sb.append(s); + } + + void append(char c) { + sb.append(c); + } + + void append(boolean b) { + sb.append(b); + } + + void append(long l) { + sb.append(l); + } + + void indent() { + for (int i = 0; i < align; i++) { + append(" "); + } + } + + void incrAlign() { + align++; + } + + void decrAlign() { + align--; + } + + String build() { + String s = sb.toString(); + return s; + } + + void emitDocComment(Declaration decl) { + emitDocComment(decl, ""); + } + + void emitDocComment(Declaration decl, String header) { + indent(); + append("/**\n"); + if (!header.isEmpty()) { + indent(); + append(" * "); + append(header); + append("\n"); + } + indent(); + append(" * {@snippet lang=c :\n"); + append(CDeclarationPrinter.declaration(decl, " ".repeat(align*4) + " * ")); + indent(); + append(" * }\n"); + indent(); + append(" */\n"); + } + + void emitDocComment(Type.Function funcType, String name) { + indent(); + append("/**\n"); + indent(); + append(" * {@snippet lang=c :\n"); + append(" * "); + append(CDeclarationPrinter.declaration(funcType, name)); + append(";\n"); + indent(); + append(" * }\n"); + indent(); + append(" */\n"); + } + + // is the name enclosed enclosed by a class of the same name? + boolean isEnclosedBySameName(String name) { + return className().equals(name) || + (isNested() && enclosing.isEnclosedBySameName(name)); + } + + protected void emitPackagePrefix() { + if (!isNested()) { + assert packageName().indexOf('/') == -1 : "package name invalid: " + packageName(); + append("// Generated by jextract"); + if (SHOW_GENERATING_CLASS) { + append(" (via "); + append(getClass().getName()); + append(")"); + } + append("\n\n"); + if (!packageName().isEmpty()) { + append("package "); + append(packageName()); + append(";\n\n"); + } + } + } + + protected void emitImportSection() { + if (!isNested()) { + append("import java.lang.invoke.MethodHandle;\n"); + append("import java.lang.invoke.VarHandle;\n"); + append("import java.nio.ByteOrder;\n"); + append("import java.lang.foreign.*;\n"); + append("import static java.lang.foreign.ValueLayout.*;\n"); + } + } + + void emitConstantGetter(String mods, String getterName, boolean nullCheck, String symbolName, Constant constant) { + incrAlign(); + indent(); + append(mods + " " + constant.type().getSimpleName() + " " + getterName + "() {\n"); + incrAlign(); + indent(); + append("return "); + if (nullCheck) { + append("RuntimeHelper.requireNonNull("); + } + append(constant.accessExpression()); + if (nullCheck) { + append(",\""); + append(symbolName); + append("\")"); + } + append(";\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + @Override + protected Constants constants() { + return enclosing.constants(); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/CodeGenerator.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/CodeGenerator.java new file mode 100644 index 00000000..85cb2584 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/CodeGenerator.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; +import java.util.List; +import java.util.stream.Stream; +import javax.tools.JavaFileObject; + +public final class CodeGenerator { + private CodeGenerator() {} + + public static JavaFileObject[] generate(Declaration.Scoped decl, String headerName, + String targetPkg, IncludeHelper includeHelper, + List libNames) { + var nameMangler = new NameMangler(headerName); + var transformedDecl = Stream.of(decl). + map(new IncludeFilter(includeHelper)::transform). + map(new EnumConstantLifter()::transform). + map(new DuplicateFilter()::transform). + map(nameMangler::scan). + findFirst().get(); + return OutputFactory.generateWrapped(transformedDecl, targetPkg, libNames, nameMangler); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/CommandLine.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/CommandLine.java new file mode 100644 index 00000000..64b27223 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/CommandLine.java @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.jextract.impl; + +// This is verbatim copy of com.sun.tools.javac.main.CommandLine except for package name + +import java.io.IOException; +import java.io.Reader; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Various utility methods for processing Java tool command line arguments. + * + *

This is NOT part of any supported API. + * If you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice. + */ +public class CommandLine { + /** + * Process Win32-style command files for the specified command line + * arguments and return the resulting arguments. A command file argument + * is of the form '@file' where 'file' is the name of the file whose + * contents are to be parsed for additional arguments. The contents of + * the command file are parsed using StreamTokenizer and the original + * '@file' argument replaced with the resulting tokens. Recursive command + * files are not supported. The '@' character itself can be quoted with + * the sequence '@@'. + * @param args the arguments that may contain @files + * @return the arguments, with @files expanded + * @throws IOException if there is a problem reading any of the @files + */ + public static List parse(List args) throws IOException { + List newArgs = new ArrayList<>(); + appendParsedCommandArgs(newArgs, args); + return newArgs; + } + + private static void appendParsedCommandArgs(List newArgs, List args) throws IOException { + for (String arg : args) { + if (arg.length() > 1 && arg.charAt(0) == '@') { + arg = arg.substring(1); + if (arg.charAt(0) == '@') { + newArgs.add(arg); + } else { + loadCmdFile(arg, newArgs); + } + } else { + newArgs.add(arg); + } + } + } + + /** + * Process the given environment variable and appends any Win32-style + * command files for the specified command line arguments and return + * the resulting arguments. A command file argument + * is of the form '@file' where 'file' is the name of the file whose + * contents are to be parsed for additional arguments. The contents of + * the command file are parsed using StreamTokenizer and the original + * '@file' argument replaced with the resulting tokens. Recursive command + * files are not supported. The '@' character itself can be quoted with + * the sequence '@@'. + * @param envVariable the env variable to process + * @param args the arguments that may contain @files + * @return the arguments, with environment variable's content and expansion of @files + * @throws IOException if there is a problem reading any of the @files + * @throws org.openjdk.jextract.impl.CommandLine.UnmatchedQuote + */ + public static List parse(String envVariable, List args) + throws IOException, UnmatchedQuote { + + List inArgs = new ArrayList<>(); + appendParsedEnvVariables(inArgs, envVariable); + inArgs.addAll(args); + List newArgs = new ArrayList<>(); + appendParsedCommandArgs(newArgs, inArgs); + return newArgs; + } + + private static void loadCmdFile(String name, List args) throws IOException { + try (Reader r = Files.newBufferedReader(Paths.get(name), Charset.defaultCharset())) { + Tokenizer t = new Tokenizer(r); + String s; + while ((s = t.nextToken()) != null) { + args.add(s); + } + } + } + + public static class Tokenizer { + private final Reader in; + private int ch; + + public Tokenizer(Reader in) throws IOException { + this.in = in; + ch = in.read(); + } + + public String nextToken() throws IOException { + skipWhite(); + if (ch == -1) { + return null; + } + + StringBuilder sb = new StringBuilder(); + char quoteChar = 0; + + while (ch != -1) { + switch (ch) { + case ' ': + case '\t': + case '\f': + if (quoteChar == 0) { + return sb.toString(); + } + sb.append((char) ch); + break; + + case '\n': + case '\r': + return sb.toString(); + + case '\'': + case '"': + if (quoteChar == 0) { + quoteChar = (char) ch; + } else if (quoteChar == ch) { + quoteChar = 0; + } else { + sb.append((char) ch); + } + break; + + case '\\': + if (quoteChar != 0) { + ch = in.read(); + switch (ch) { + case '\n': + case '\r': + while (ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t' || ch == '\f') { + ch = in.read(); + } + continue; + + case 'n': + ch = '\n'; + break; + case 'r': + ch = '\r'; + break; + case 't': + ch = '\t'; + break; + case 'f': + ch = '\f'; + break; + } + } + sb.append((char) ch); + break; + + default: + sb.append((char) ch); + } + + ch = in.read(); + } + + return sb.toString(); + } + + void skipWhite() throws IOException { + while (ch != -1) { + switch (ch) { + case ' ': + case '\t': + case '\n': + case '\r': + case '\f': + break; + + case '#': + ch = in.read(); + while (ch != '\n' && ch != '\r' && ch != -1) { + ch = in.read(); + } + break; + + default: + return; + } + + ch = in.read(); + } + } + } + + @SuppressWarnings("fallthrough") + private static void appendParsedEnvVariables(List newArgs, String envVariable) + throws UnmatchedQuote { + + if (envVariable == null) { + return; + } + String in = System.getenv(envVariable); + if (in == null || in.trim().isEmpty()) { + return; + } + + final char NUL = (char)0; + final int len = in.length(); + + int pos = 0; + StringBuilder sb = new StringBuilder(); + char quote = NUL; + char ch; + + loop: + while (pos < len) { + ch = in.charAt(pos); + switch (ch) { + case '\"': case '\'': + if (quote == NUL) { + quote = ch; + } else if (quote == ch) { + quote = NUL; + } else { + sb.append(ch); + } + pos++; + break; + case '\f': case '\n': case '\r': case '\t': case ' ': + if (quote == NUL) { + newArgs.add(sb.toString()); + sb.setLength(0); + while (ch == '\f' || ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') { + pos++; + if (pos >= len) { + break loop; + } + ch = in.charAt(pos); + } + break; + } + // fall through + default: + sb.append(ch); + pos++; + } + } + if (sb.length() != 0) { + newArgs.add(sb.toString()); + } + if (quote != NUL) { + throw new UnmatchedQuote(envVariable); + } + } + + public static class UnmatchedQuote extends Exception { + private static final long serialVersionUID = 0; + + public final String variableName; + + UnmatchedQuote(String variable) { + this.variableName = variable; + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/CompilationFailedException.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/CompilationFailedException.java new file mode 100644 index 00000000..6c23bfbb --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/CompilationFailedException.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.impl; + +public class CompilationFailedException extends RuntimeException { + private static final long serialVersionUID = 1L; + + public CompilationFailedException(String msg) { + super(msg); + } + + public CompilationFailedException(String msg, Throwable cause) { + super(msg, cause); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/Constants.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/Constants.java new file mode 100644 index 00000000..4405986e --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/Constants.java @@ -0,0 +1,547 @@ +/* + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Type; + +import javax.tools.JavaFileObject; +import java.lang.foreign.AddressLayout; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SequenceLayout; +import java.lang.foreign.StructLayout; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; + +public class Constants { + + private final Map cache = new HashMap<>(); + + List constantBuilders = new ArrayList<>(); + Builder currentBuilder; + + public Constants(JavaSourceBuilder enclosing) { + currentBuilder = new Builder(enclosing, 0); + constantBuilders.add(currentBuilder); + currentBuilder.classBegin(); + // prime the cache with basic primitive/pointer (immediate) layouts + for (Type.Primitive.Kind kind : Type.Primitive.Kind.values()) { + kind.layout().ifPresent(layout -> { + if (layout instanceof ValueLayout valueLayout) { + cache.put(valueLayout, ImmediateConstant.ofPrimitiveLayout(valueLayout)); + } + }); + } + AddressLayout pointerLayout = ValueLayout.ADDRESS.withTargetLayout( + MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE)); + cache.put(pointerLayout, ImmediateConstant.ofPrimitiveLayout(pointerLayout)); + } + + static final int CONSTANTS_PER_CLASS = Integer.getInteger("jextract.constants.per.class", 5); + + private Builder builder() { + if (currentBuilder.constantIndex > CONSTANTS_PER_CLASS || currentBuilder == null) { + if (currentBuilder != null) { + currentBuilder.classEnd(); + } + currentBuilder = new Builder(currentBuilder.enclosing, constantBuilders.size()); + constantBuilders.add(currentBuilder); + currentBuilder.classBegin(); + } + return currentBuilder; + } + + static sealed abstract class Constant permits Builder.NamedConstant, ImmediateConstant { + + final Class type; + + public Constant(Class type) { + this.type = type; + } + + Class type() { + return type; + } + + String getterName(String javaName) { + return javaName + nameSuffix(); + } + + Constant emitGetter(ClassSourceBuilder builder, String mods, String javaName) { + return emitGetter(builder, mods, c -> c.getterName(javaName)); + } + + Constant emitGetter(ClassSourceBuilder builder, String mods, String javaName, String symbolName) { + return emitGetter(builder, mods, symbolName, c -> c.getterName(javaName)); + } + + Constant emitGetter(ClassSourceBuilder builder, String mods, Function getterNameFunc) { + builder.emitConstantGetter(mods, getterNameFunc.apply(this), false, null, this); + return this; + } + + Constant emitGetter(ClassSourceBuilder builder, String mods, String symbolName, Function getterNameFunc) { + builder.emitConstantGetter(mods, getterNameFunc.apply(this), true, symbolName, this); + return this; + } + + String nameSuffix() { + if (type.equals(MemorySegment.class)) { + return "$SEGMENT"; + } else if (type.equals(MemoryLayout.class)) { + return "$LAYOUT"; + } else if (type.equals(MethodHandle.class)) { + return "$MH"; + } else if (type.equals(VarHandle.class)) { + return "$VH"; + } else if (type.equals(FunctionDescriptor.class)) { + return "$DESC"; + } else { + return ""; + } + } + + abstract String accessExpression(); + } + + final static class ImmediateConstant extends Constant { + final String value; + + ImmediateConstant(Class type, String value) { + super(type); + this.value = value; + } + + @Override + String accessExpression() { + return value; + } + + static ImmediateConstant ofPrimitiveLayout(ValueLayout vl) { + final String layoutStr; + if (vl.carrier() == boolean.class) { + layoutStr = "JAVA_BOOLEAN"; + } else if (vl.carrier() == char.class) { + layoutStr = "JAVA_CHAR"; + } else if (vl.carrier() == byte.class) { + layoutStr = "JAVA_BYTE"; + } else if (vl.carrier() == short.class) { + layoutStr = "JAVA_SHORT"; + } else if (vl.carrier() == int.class) { + layoutStr = "JAVA_INT"; + } else if (vl.carrier() == float.class) { + layoutStr = "JAVA_FLOAT"; + } else if (vl.carrier() == long.class) { + layoutStr = "JAVA_LONG"; + } else if (vl.carrier() == double.class) { + layoutStr = "JAVA_DOUBLE"; + } else if (vl.carrier() == MemorySegment.class) { + layoutStr = "RuntimeHelper.POINTER"; + } else { + throw new UnsupportedOperationException("Unsupported layout: " + vl); + } + return new ImmediateConstant(MemoryLayout.class, layoutStr); + } + + static Constant ofLiteral(Class type, Object value) { + StringBuilder buf = new StringBuilder(); + if (type == float.class) { + float f = ((Number)value).floatValue(); + if (Float.isFinite(f)) { + buf.append(value); + buf.append("f"); + } else { + buf.append("Float.valueOf(\""); + buf.append(value); + buf.append("\")"); + } + } else if (type == long.class) { + buf.append(value.toString()); + buf.append("L"); + } else if (type == double.class) { + double d = ((Number)value).doubleValue(); + if (Double.isFinite(d)) { + buf.append(value); + buf.append("d"); + } else { + buf.append("Double.valueOf(\""); + buf.append(value); + buf.append("\")"); + } + } else if (type == boolean.class) { + boolean booleanValue = ((Number)value).byteValue() != 0; + buf.append(booleanValue); + } else { + buf.append("(" + type.getName() + ")"); + buf.append(value + "L"); + } + return new ImmediateConstant(type, buf.toString()); + } + } + + public List toFiles() { + currentBuilder.classEnd(); + List files = new ArrayList<>(); + files.addAll(constantBuilders.stream() + .flatMap(b -> b.toFiles().stream()).toList()); + return files; + } + + class Builder extends ClassSourceBuilder { + + Builder(JavaSourceBuilder encl, int id) { + super(encl, Kind.CLASS, "constants$" + id); + } + + String memberMods() { + return kind == ClassSourceBuilder.Kind.CLASS ? + "static final " : ""; + } + + @Override + String mods() { + return "final "; // constants package-private! + } + + int constantIndex = 0; + + final class NamedConstant extends Constant { + final String constantName; + + NamedConstant(Class type) { + super(type); + this.constantName = newConstantName(); + } + + String constantName() { + return constantName; + } + + @Override + String accessExpression() { + return className() + "." + constantName; + } + } + + private Constant emitDowncallMethodHandleField(String nativeName, FunctionDescriptor descriptor, boolean isVarargs, boolean virtual) { + Constant functionDesc = addFunctionDesc(descriptor); + incrAlign(); + NamedConstant mhConst = new NamedConstant(MethodHandle.class); + indent(); + append(memberMods() + "MethodHandle "); + append(mhConst.constantName + " = RuntimeHelper."); + if (isVarargs) { + append("downcallHandleVariadic"); + } else { + append("downcallHandle"); + } + append("(\n"); + incrAlign(); + indent(); + if (!virtual) { + append("\"" + nativeName + "\""); + append(",\n"); + indent(); + } + append(functionDesc.accessExpression()); + append("\n"); + decrAlign(); + indent(); + append(");\n"); + decrAlign(); + return mhConst; + } + + private Constant emitUpcallMethodHandleField(String className, String methodName, FunctionDescriptor descriptor) { + Constant functionDesc = addFunctionDesc(descriptor); + incrAlign(); + NamedConstant mhConst = new NamedConstant(MethodHandle.class); + indent(); + append(memberMods() + "MethodHandle "); + append(mhConst.constantName + " = RuntimeHelper.upcallHandle("); + append(className + ".class, "); + append("\"" + methodName + "\", "); + append(functionDesc.accessExpression()); + append(");\n"); + decrAlign(); + return mhConst; + } + + private Constant emitVarHandle(ValueLayout valueLayout) { + Constant layoutConstant = addLayout(valueLayout); + incrAlign(); + indent(); + NamedConstant vhConst = new NamedConstant(VarHandle.class); + append(memberMods() + "VarHandle " + vhConst.constantName + " = "); + append(layoutConstant.accessExpression()); + append(".varHandle();\n"); + decrAlign(); + return vhConst; + } + + private Constant emitFieldVarHandle(String nativeName, GroupLayout parentLayout, List prefixElementNames) { + Constant layoutConstant = addLayout(parentLayout); + incrAlign(); + indent(); + NamedConstant vhConst = new NamedConstant(VarHandle.class); + append(memberMods() + "VarHandle " + vhConst.constantName + " = "); + append(layoutConstant.accessExpression()); + append(".varHandle("); + String prefix = ""; + for (String prefixElementName : prefixElementNames) { + append(prefix + "MemoryLayout.PathElement.groupElement(\"" + prefixElementName + "\")"); + prefix = ", "; + } + append(prefix + "MemoryLayout.PathElement.groupElement(\"" + nativeName + "\")"); + append(")"); + append(";\n"); + decrAlign(); + return vhConst; + } + + private Constant emitLayoutField(MemoryLayout layout) { + NamedConstant layoutConst = new NamedConstant(MemoryLayout.class); + incrAlign(); + indent(); + String layoutClassName = Utils.layoutDeclarationType(layout).getSimpleName(); + append(memberMods() + layoutClassName + " " + layoutConst.constantName + " = "); + emitLayoutString(layout); + append(";\n"); + decrAlign(); + return layoutConst; + } + + private void emitLayoutString(MemoryLayout l) { + if (l instanceof ValueLayout val) { + append(ImmediateConstant.ofPrimitiveLayout(val).accessExpression()); + if (l.byteAlignment() != l.byteSize()) { + append(".withByteAlignment("); + append(l.byteAlignment()); + append(")"); + } + } else if (l instanceof SequenceLayout seq) { + append("MemoryLayout.sequenceLayout("); + append(seq.elementCount() + ", "); + emitLayoutString(seq.elementLayout()); + append(")"); + } else if (l instanceof GroupLayout group) { + if (group instanceof StructLayout) { + append("MemoryLayout.structLayout(\n"); + } else { + append("MemoryLayout.unionLayout(\n"); + } + incrAlign(); + String delim = ""; + for (MemoryLayout e : group.memberLayouts()) { + append(delim); + indent(); + emitLayoutString(e); + delim = ",\n"; + } + append("\n"); + decrAlign(); + indent(); + append(")"); + } else { + // padding (or unsupported) + append("MemoryLayout.paddingLayout(" + l.byteSize() + ")"); + } + if (l.name().isPresent()) { + append(".withName(\"" + l.name().get() + "\")"); + } + } + + private Constant emitFunctionDescField(FunctionDescriptor desc) { + incrAlign(); + indent(); + final boolean noArgs = desc.argumentLayouts().isEmpty(); + append(memberMods()); + append("FunctionDescriptor "); + NamedConstant descConstant = new NamedConstant(FunctionDescriptor.class); + append(descConstant.constantName); + append(" = "); + if (desc.returnLayout().isPresent()) { + append("FunctionDescriptor.of("); + emitLayoutString(desc.returnLayout().get()); + if (!noArgs) { + append(","); + } + } else { + append("FunctionDescriptor.ofVoid("); + } + if (!noArgs) { + append("\n"); + incrAlign(); + String delim = ""; + for (MemoryLayout e : desc.argumentLayouts()) { + append(delim); + indent(); + emitLayoutString(e); + delim = ",\n"; + } + append("\n"); + decrAlign(); + indent(); + } + append(");\n"); + decrAlign(); + return descConstant; + } + + private Constant emitConstantString(Object value) { + incrAlign(); + indent(); + append(memberMods()); + append("MemorySegment "); + NamedConstant segConstant = new NamedConstant(MemorySegment.class); + append(segConstant.constantName); + append(" = RuntimeHelper.CONSTANT_ALLOCATOR.allocateUtf8String(\""); + append(Utils.quote(Objects.toString(value))); + append("\");\n"); + decrAlign(); + return segConstant; + } + + private Constant emitConstantAddress(Object value) { + incrAlign(); + indent(); + append(memberMods()); + append("MemorySegment "); + NamedConstant segConstant = new NamedConstant(MemorySegment.class); + append(segConstant.constantName); + append(" = MemorySegment.ofAddress("); + append(((Number)value).longValue()); + append("L);\n"); + decrAlign(); + return segConstant; + } + + private Constant emitSegmentField(String nativeName, MemoryLayout layout) { + Constant layoutConstant = addLayout(layout); + incrAlign(); + indent(); + append(memberMods()); + append("MemorySegment "); + NamedConstant segConstant = new NamedConstant(MemorySegment.class); + append(segConstant.constantName); + append(" = "); + append("RuntimeHelper.lookupGlobalVariable("); + append("\"" + nativeName + "\", "); + append(layoutConstant.accessExpression()); + append(");\n"); + decrAlign(); + return segConstant; + } + + String newConstantName() { + return "const$" + constantIndex++; + } + } + + // public API + + public Constant addLayout(MemoryLayout layout) { + Constant constant = cache.get(layout); + if (constant == null) { + constant = builder().emitLayoutField(layout); + cache.put(layout, constant); + } + return constant; + } + + public Constant addFieldVarHandle(String nativeName, GroupLayout parentLayout, List prefixElementNames) { + return builder().emitFieldVarHandle(nativeName, parentLayout, prefixElementNames); + } + + public Constant addGlobalVarHandle(ValueLayout valueLayout) { + record VarHandleKey(ValueLayout valueLayout) { } + VarHandleKey key = new VarHandleKey(valueLayout.withoutName()); + Constant constant = cache.get(key); + if (constant == null) { + constant = builder().emitVarHandle(valueLayout); + cache.put(key, constant); + } + return constant; + } + + public Constant addDowncallMethodHandle(String nativeName, FunctionDescriptor descriptor, boolean isVarargs) { + return builder().emitDowncallMethodHandleField(nativeName, descriptor, isVarargs, false); + } + + public Constant addVirtualDowncallMethodHandle(FunctionDescriptor descriptor) { + record DowncallKey(FunctionDescriptor desc) { } + DowncallKey downcallKey = new DowncallKey(descriptor); + Constant constant = cache.get(downcallKey); + if (constant == null) { + constant = builder().emitDowncallMethodHandleField(null, descriptor, false, true); + cache.put(downcallKey, constant); + } + return constant; + } + + public Constant addUpcallMethodHandle(String className, String name, FunctionDescriptor descriptor) { + return builder().emitUpcallMethodHandleField(className, name, descriptor); + } + + public Constant addSegment(String nativeName, MemoryLayout layout) { + return builder().emitSegmentField(nativeName, layout); + } + + public Constant addFunctionDesc(FunctionDescriptor desc) { + Constant constant = cache.get(desc); + if (constant == null) { + constant = builder().emitFunctionDescField(desc); + cache.put(desc, constant); + } + return constant; + } + + public Constant addConstantDesc(Class type, Object value) { + record ConstantKey(Class type, Object value) { } + var key = new ConstantKey(type, value); + Constant constant = cache.get(key); + if (constant == null) { + if (value instanceof String) { + constant = builder().emitConstantString(value); + } else if (type == MemorySegment.class) { + constant = builder().emitConstantAddress(value); + } else { + constant = ImmediateConstant.ofLiteral(type, value); + } + cache.put(key, constant); + } + return constant; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/DeclarationImpl.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/DeclarationImpl.java new file mode 100644 index 00000000..1143ab77 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/DeclarationImpl.java @@ -0,0 +1,430 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import java.lang.constant.Constable; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Position; +import org.openjdk.jextract.Type; + +public abstract class DeclarationImpl implements Declaration { + + private final String name; + private final Position pos; + private final Optional>> attributes; + + public DeclarationImpl(String name, Position pos, Map> attrs) { + this.name = name; + this.pos = pos; + this.attributes = Optional.ofNullable(attrs); + } + + public String toString() { + return new PrettyPrinter().print(this); + } + + public String name() { + return name; + } + + @Override + public Position pos() { + return pos; + } + + @Override + public Optional> getAttribute(String name) { + return attributes.map(attrs -> attrs.get(name)); + } + + @Override + public Set attributeNames() { return Collections.unmodifiableSet( + attributes.map(Map::keySet).orElse(Collections.emptySet())); + } + + @Override + public Declaration withAttribute(String name, Constable... values) { + if (values == null || values.length == 0) { + return withAttributes(null); + } + var attrs = attributes.map(HashMap::new).orElseGet(HashMap::new); + attrs.put(name, List.of(values)); + return withAttributes(attrs); + } + + abstract protected Declaration withAttributes(Map> attrs); + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + return o instanceof Declaration decl && name().equals(decl.name()); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + public static final class TypedefImpl extends DeclarationImpl implements Declaration.Typedef { + final Type type; + + public TypedefImpl(Type type, String name, Position pos, Map> attrs) { + super(name, pos, attrs); + this.type = Objects.requireNonNull(type); + } + + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitTypedef(this, data); + } + + @Override + public Type type() { + return type; + } + + @Override + public Typedef withAttributes(Map> attrs) { + return new TypedefImpl(type, name(), pos(), attrs); + } + + @Override + public Typedef stripAttributes() { + return new TypedefImpl(type, name(), pos(), null); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + return o instanceof Declaration.Typedef other && + name().equals(other.name()) && + type.equals(other.type()); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), type); + } + } + + public static class VariableImpl extends DeclarationImpl implements Declaration.Variable { + + final Variable.Kind kind; + final Type type; + final Optional layout; + + private VariableImpl(Type type, Optional layout, Variable.Kind kind, String name, Position pos, Map> attrs) { + super(name, pos, attrs); + this.kind = Objects.requireNonNull(kind); + this.type = Objects.requireNonNull(type); + this.layout = Objects.requireNonNull(layout); + } + + public VariableImpl(Type type, Variable.Kind kind, String name, Position pos) { + this(type, TypeImpl.getLayout(type), kind, name, pos, null); + } + + public VariableImpl(Type type, MemoryLayout layout, Variable.Kind kind, String name, Position pos) { + this(type, Optional.of(layout), kind, name, pos, null); + } + + @Override + public Kind kind() { + return kind; + } + + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitVariable(this, data); + } + + @Override + public Type type() { + return type; + } + + @Override + public Variable withAttributes(Map> attrs) { + return new VariableImpl(type, layout, kind, name(), pos(), attrs); + } + + @Override + public Variable stripAttributes() { + return new VariableImpl(type, layout, kind, name(), pos(), null); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Declaration.Variable variable)) return false; + if (!super.equals(o)) return false; + return kind == variable.kind() && + type.equals(variable.type()); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), kind, type); + } + } + + public static final class BitfieldImpl extends VariableImpl implements Declaration.Bitfield { + + final long offset; + final long width; + + private BitfieldImpl(Type type, long offset, long width, String name, Position pos, Map> attrs) { + super(type, Optional.empty(), Kind.BITFIELD, name, pos, attrs); + this.offset = offset; + this.width = width; + } + + public BitfieldImpl(Type type, long offset, long width, String name, Position pos) { + this(type, offset, width, name, pos, null); + } + + @Override + public long offset() { + return offset; + } + + @Override + public long width() { + return width; + } + + @Override + public Variable withAttributes(Map> attrs) { + return new BitfieldImpl(type, offset, width, name(), pos(), attrs); + } + + @Override + public Variable stripAttributes() { + return new BitfieldImpl(type, offset, width, name(), pos(), null); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof BitfieldImpl bitfield)) return false; + if (!super.equals(o)) return false; + return offset == bitfield.offset && + width == bitfield.width; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), offset, width); + } + } + + public static final class FunctionImpl extends DeclarationImpl implements Declaration.Function { + + final List params; + final Type.Function type; + + public FunctionImpl(Type.Function type, List params, String name, Position pos) { + this(type, params, name, pos, null); + } + + public FunctionImpl(Type.Function type, List params, String name, Position pos, Map> attrs) { + super(name, pos, attrs); + this.params = Objects.requireNonNull(params); + this.type = Objects.requireNonNull(type); + } + + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitFunction(this, data); + } + + @Override + public List parameters() { + return params; + } + + @Override + public Type.Function type() { + return type; + } + + @Override + public Function withAttributes(Map> attrs) { + return new FunctionImpl(type, params, name(), pos(), attrs); + } + + @Override + public Function stripAttributes() { + return new FunctionImpl(type, params, name(), pos(), null); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Declaration.Function function)) return false; + if (!super.equals(o)) return false; + return type.equals(function.type()); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), type); + } + } + + public static class ScopedImpl extends DeclarationImpl implements Declaration.Scoped { + + private final Scoped.Kind kind; + private final List declarations; + private final Optional optLayout; + + public ScopedImpl(Kind kind, MemoryLayout layout, List declarations, String name, Position pos) { + this(kind, Optional.of(layout), declarations, name, pos, null); + } + + public ScopedImpl(Kind kind, List declarations, String name, Position pos) { + this(kind, Optional.empty(), declarations, name, pos, null); + } + + ScopedImpl(Kind kind, Optional optLayout, List declarations, + String name, Position pos, Map> attrs) { + super(name, pos, attrs); + this.kind = Objects.requireNonNull(kind); + this.declarations = Objects.requireNonNull(declarations); + this.optLayout = Objects.requireNonNull(optLayout); + } + + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitScoped(this, data); + } + + @Override + public List members() { + return declarations; + } + + @Override + public Optional layout() { + return optLayout; + } + + @Override + public Kind kind() { + return kind; + } + + @Override + public Scoped withAttributes(Map> attrs) { + return new ScopedImpl(kind, optLayout, declarations, name(), pos(), attrs); + } + + @Override + public Scoped stripAttributes() { + return new ScopedImpl(kind, optLayout, declarations, name(), pos(), null); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Declaration.Scoped scoped)) return false; + if (!super.equals(o)) return false; + return kind == scoped.kind() && + declarations.equals(scoped.members()); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), kind, declarations); + } + } + + public static final class ConstantImpl extends DeclarationImpl implements Declaration.Constant { + + final Object value; + final Type type; + + public ConstantImpl(Type type, Object value, String name, Position pos) { + this(type, value, name, pos, null); + } + + public ConstantImpl(Type type, Object value, String name, Position pos, Map> attrs) { + super(name, pos, attrs); + this.value = Objects.requireNonNull(value); + this.type = Objects.requireNonNull(type); + } + + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitConstant(this, data); + } + + @Override + public Object value() { + return value; + } + + @Override + public Type type() { + return type; + } + + @Override + public Constant withAttributes(Map> attrs) { + return new ConstantImpl(type, value, name(), pos(), attrs); + } + + @Override + public Constant stripAttributes() { + return new ConstantImpl(type, value, name(), pos(), null); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Declaration.Constant constant)) return false; + if (!super.equals(o)) return false; + return value.equals(constant.value()) && + type.equals(constant.type()); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), value, type); + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/DuplicateFilter.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/DuplicateFilter.java new file mode 100644 index 00000000..2247578e --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/DuplicateFilter.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/* + * This visitor filters duplicate top-level variables, constants and functions. + */ +final class DuplicateFilter implements TreeTransformer, Declaration.Visitor { + // To detect duplicate Variable and Function declarations. + private final Set constants = new HashSet<>(); + private final Set variables = new HashSet<>(); + private final Set typedefs = new HashSet<>(); + private final Set functions = new HashSet<>(); + private final List decls = new ArrayList<>(); + + // have we seen this Constant earlier? + private boolean constantSeen(Declaration.Constant tree) { + return !constants.add(tree.name()); + } + + // have we seen this Variable earlier? + private boolean variableSeen(Declaration.Variable tree) { + return !variables.add(tree.name()); + } + + // have we seen this Function earlier? + private boolean functionSeen(Declaration.Function tree) { + return !functions.add(tree); + } + + // have we seen this Function earlier? + private boolean typedefSeen(Declaration.Typedef tree) { + return !typedefs.add(tree); + } + + DuplicateFilter() { + } + + @Override + public Declaration.Scoped transform(Declaration.Scoped header) { + // Process all header declarations are collect potential + // declarations that will go into transformed HeaderTree + // into the this.decls field. + header.members().forEach(fieldTree -> fieldTree.accept(this, null)); + return createHeader(header, decls); + } + + @Override + public Void visitConstant(Declaration.Constant constant, Void ignored) { + if (constantSeen(constant)) { + //skip + return null; + } + + decls.add(constant); + return null; + } + + @Override + public Void visitFunction(Declaration.Function funcTree, Void ignored) { + if (functionSeen(funcTree)) { + //skip + return null; + } + + decls.add(funcTree); + return null; + } + + @Override + public Void visitTypedef(Declaration.Typedef tree, Void ignored) { + if (typedefSeen(tree)) { + //skip + return null; + } + + decls.add(tree); + return null; + } + + @Override + public Void visitVariable(Declaration.Variable tree, Void ignored) { + if (variableSeen(tree)) { + //skip + return null; + } + + decls.add(tree); + return null; + } + + @Override + public Void visitDeclaration(Declaration decl, Void ignored) { + decls.add(decl); + return null; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/EnumConstantLifter.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/EnumConstantLifter.java new file mode 100644 index 00000000..2cf77207 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/EnumConstantLifter.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +/* + * This visitor lifts enum constants to the top level and removes enum Trees. + */ +final class EnumConstantLifter implements TreeTransformer, Declaration.Visitor { + private static final String ENUM_NAME = "enum-name"; + + private final List decls = new ArrayList<>(); + EnumConstantLifter() { + } + + static Optional enumName(Declaration.Constant constant) { + return constant.getAttribute(ENUM_NAME).map(attrs -> attrs.get(0).toString()); + } + + @Override + public Declaration.Scoped transform(Declaration.Scoped header) { + // Process all header declarations are collect potential + // declarations that will go into transformed HeaderTree + // into the this.decls field. + header.members().forEach(fieldTree -> fieldTree.accept(this, null)); + return createHeader(header, decls); + } + + @Override + public Void visitScoped(Declaration.Scoped scoped, Void ignored) { + if (liftEnumConstants(scoped)) { + return null; + } + decls.add(scoped); + return null; + } + + @Override + public Void visitTypedef(Declaration.Typedef tree, Void ignored) { + Type type = tree.type(); + if (type instanceof Type.Declared declared) { + if (liftEnumConstants(declared.tree())) { + return null; + } + } + decls.add(tree); + return null; + } + + @Override + public Void visitDeclaration(Declaration decl, Void ignored) { + decls.add(decl); + return null; + } + + private boolean liftEnumConstants(Declaration.Scoped scoped) { + boolean isEnum = scoped.kind() == Declaration.Scoped.Kind.ENUM; + if (isEnum) { + // add the name of the enum as an attribute. + scoped.members().forEach(fieldTree -> fieldTree + .withAttribute(ENUM_NAME, scoped.name()) + .accept(this, null)); + } + return isEnum; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/FunctionalInterfaceBuilder.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/FunctionalInterfaceBuilder.java new file mode 100644 index 00000000..459ac689 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/FunctionalInterfaceBuilder.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.jextract.impl; + +import java.lang.foreign.*; + +import org.openjdk.jextract.impl.Constants.Constant; +import org.openjdk.jextract.Type; + +import java.lang.invoke.MethodType; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +public class FunctionalInterfaceBuilder extends ClassSourceBuilder { + + private static final String MEMBER_MODS = "static"; + + private final Type.Function funcType; + private final MethodType fiType; + private final MethodType downcallType; + private final FunctionDescriptor fiDesc; + private final Optional> parameterNames; + + FunctionalInterfaceBuilder(JavaSourceBuilder enclosing, Type.Function funcType, String className, + FunctionDescriptor descriptor, Optional> parameterNames) { + super(enclosing, Kind.INTERFACE, className); + this.funcType = funcType; + this.fiType = descriptor.toMethodType(); + this.downcallType = descriptor.toMethodType(); + this.fiDesc = descriptor; + this.parameterNames = parameterNames; + } + + @Override + void classDeclBegin() { + emitDocComment(funcType, className()); + } + + @Override + JavaSourceBuilder classEnd() { + emitFunctionalInterfaceMethod(); + emitFunctionalFactories(); + emitFunctionalFactoryForPointer(); + return super.classEnd(); + } + + // private generation + private String parameterName(int i) { + String name = ""; + if (parameterNames.isPresent()) { + name = parameterNames.get().get(i); + } + return name.isEmpty()? "_x" + i : name; + } + + private void emitFunctionalInterfaceMethod() { + incrAlign(); + indent(); + append(fiType.returnType().getName() + " apply("); + String delim = ""; + for (int i = 0 ; i < fiType.parameterCount(); i++) { + append(delim + fiType.parameterType(i).getName()); + append(" "); + append(parameterName(i)); + delim = ", "; + } + append(");\n"); + decrAlign(); + } + + private void emitFunctionalFactories() { + Constant functionDesc = constants().addFunctionDesc(fiDesc); + Constant upcallHandle = constants().addUpcallMethodHandle(fullName(), "apply", fiDesc); + incrAlign(); + indent(); + append(MEMBER_MODS + " MemorySegment allocate(" + className() + " fi, Arena scope) {\n"); + incrAlign(); + indent(); + append("return RuntimeHelper.upcallStub(" + + upcallHandle.accessExpression() + ", fi, " + functionDesc.accessExpression() + ", scope);\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + private void emitFunctionalFactoryForPointer() { + Constant mhConstant = constants().addVirtualDowncallMethodHandle(fiDesc); + incrAlign(); + indent(); + append(MEMBER_MODS + " " + className() + " ofAddress(MemorySegment addr, Arena arena) {\n"); + incrAlign(); + indent(); + append("MemorySegment symbol = addr.reinterpret("); + append("arena, null);\n"); + indent(); + append("return ("); + String delim = ""; + for (int i = 0 ; i < fiType.parameterCount(); i++) { + append(delim + fiType.parameterType(i).getName()); + append(" "); + append("_" + parameterName(i)); + delim = ", "; + } + append(") -> {\n"); + incrAlign(); + indent(); + append("try {\n"); + incrAlign(); + indent(); + if (!fiType.returnType().equals(void.class)) { + append("return (" + fiType.returnType().getName() + ")"); + if (fiType.returnType() != downcallType.returnType()) { + // add cast for invokeExact + append("(" + downcallType.returnType().getName() + ")"); + } + } + append(mhConstant.accessExpression() + ".invokeExact(symbol"); + if (fiType.parameterCount() > 0) { + String params = IntStream.range(0, fiType.parameterCount()) + .mapToObj(i -> { + String paramExpr = "_" + parameterName(i); + if (fiType.parameterType(i) != downcallType.parameterType(i)) { + // add cast for invokeExact + return "(" + downcallType.parameterType(i).getName() + ")" + paramExpr; + } else { + return paramExpr; + } + }) + .collect(Collectors.joining(", ")); + append(", " + params); + } + append(");\n"); + decrAlign(); + indent(); + append("} catch (Throwable ex$) {\n"); + incrAlign(); + indent(); + append("throw new AssertionError(\"should not reach here\", ex$);\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + indent(); + append("};\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/FunctionalInterfaceScanner.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/FunctionalInterfaceScanner.java new file mode 100644 index 00000000..0441167c --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/FunctionalInterfaceScanner.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; +import java.lang.foreign.FunctionDescriptor; + +import java.util.Optional; +import java.util.Set; + +class FunctionalInterfaceScanner implements Declaration.Visitor> { + + private final Set descriptors; + + FunctionalInterfaceScanner(Set descriptors) { + this.descriptors = descriptors; + } + + Declaration.Scoped scan(Declaration.Scoped decl) { + decl.accept(this, descriptors); + return decl; + } + + void scanType(Type t, Set functionDescriptors) { + t.accept(new TypeScanner(), functionDescriptors); + } + + @Override + public Void visitScoped(Declaration.Scoped d, Set functionDescriptors) { + d.members().forEach(m -> m.accept(this, functionDescriptors)); + return null; + } + + @Override + public Void visitFunction(Declaration.Function d, Set functionDescriptors) { + scanType(d.type().returnType(), functionDescriptors); + d.parameters().forEach(p -> p.accept(this, functionDescriptors)); + return null; + } + + @Override + public Void visitVariable(Declaration.Variable d, Set functionDescriptors) { + scanType(d.type(), functionDescriptors); + return null; + } + + @Override + public Void visitConstant(Declaration.Constant d, Set functionDescriptors) { + scanType(d.type(), functionDescriptors); + return null; + } + + static class TypeScanner implements Type.Visitor> { + + @Override + public Void visitPrimitive(Type.Primitive t, Set functionDescriptors) { + return null; + } + + @Override + public Void visitDelegated(Type.Delegated t, Set functionDescriptors) { + return t.type().accept(this, functionDescriptors); + } + + @Override + public Void visitFunction(Type.Function t, Set functionDescriptors) { + t.returnType().accept(this, functionDescriptors); + t.argumentTypes().forEach(a -> a.accept(this, functionDescriptors)); + Optional descriptor = Type.descriptorFor(t); + if (descriptor.isPresent()) { + functionDescriptors.add(descriptor.get()); + } + return null; + } + + @Override + public Void visitDeclared(Type.Declared t, Set functionDescriptors) { + return null; + } + + @Override + public Void visitArray(Type.Array t, Set functionDescriptors) { + return t.elementType().accept(this, functionDescriptors); + } + + @Override + public Void visitType(Type t, Set functionDescriptors) { + throw new UnsupportedOperationException(); + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/HeaderFileBuilder.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/HeaderFileBuilder.java new file mode 100644 index 00000000..d1cc34d0 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/HeaderFileBuilder.java @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SequenceLayout; +import java.lang.foreign.ValueLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; + +import org.openjdk.jextract.impl.Constants.Constant; + +import java.lang.invoke.MethodType; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +/** + * A helper class to generate header interface class in source form. + * After aggregating various constituents of a .java source, build + * method is called to get overall generated source string. + */ +abstract class HeaderFileBuilder extends ClassSourceBuilder { + + static final String MEMBER_MODS = "public static"; + + private final String superclass; + + HeaderFileBuilder(ToplevelBuilder enclosing, String name, String superclass) { + super(enclosing, Kind.CLASS, name); + this.superclass = superclass; + } + + @Override + String superClass() { + return superclass; + } + + @Override + void emitDocComment(Declaration decl, String header) { + incrAlign(); + super.emitDocComment(decl, header); + decrAlign(); + } + + @Override + public void addVar(Declaration.Variable varTree, String javaName, + MemoryLayout layout, Optional fiName) { + String nativeName = varTree.name(); + if (layout instanceof SequenceLayout || layout instanceof GroupLayout) { + if (layout.byteSize() > 0) { + emitDocComment(varTree); + constants().addSegment(nativeName, layout) + .emitGetter(this, MEMBER_MODS, javaName, nativeName); + }; + } else if (layout instanceof ValueLayout valueLayout) { + constants().addLayout(valueLayout) + .emitGetter(this, MEMBER_MODS, javaName); + Constant vhConstant = constants().addGlobalVarHandle(valueLayout) + .emitGetter(this, MEMBER_MODS, javaName); + Constant segmentConstant = constants().addSegment(nativeName, valueLayout) + .emitGetter(this, MEMBER_MODS, javaName, nativeName); + emitDocComment(varTree, "Getter for variable:"); + emitGlobalGetter(segmentConstant, vhConstant, javaName, nativeName, valueLayout.carrier()); + emitDocComment(varTree, "Setter for variable:"); + emitGlobalSetter(segmentConstant, vhConstant, javaName, nativeName, valueLayout.carrier()); + + if (fiName.isPresent()) { + emitFunctionalInterfaceGetter(fiName.get(), javaName); + } + } + } + + @Override + public void addFunction(Declaration.Function funcTree, FunctionDescriptor descriptor, + String javaName, List parameterNames) { + String nativeName = funcTree.name(); + boolean isVarargs = funcTree.type().varargs(); + + Constant mhConstant = constants().addDowncallMethodHandle(nativeName, descriptor, isVarargs) + .emitGetter(this, MEMBER_MODS, javaName, nativeName); + MethodType downcallType = descriptor.toMethodType(); + boolean needsAllocator = descriptor.returnLayout().isPresent() && + descriptor.returnLayout().get() instanceof GroupLayout; + emitDocComment(funcTree); + emitFunctionWrapper(mhConstant, javaName, nativeName, downcallType, needsAllocator, isVarargs, parameterNames); + } + + @Override + public void addConstant(Declaration.Constant constantTree, String javaName, Class javaType) { + Object value = constantTree.value(); + emitDocComment(constantTree); + constants().addConstantDesc(javaType, value) + .emitGetter(this, MEMBER_MODS, c -> javaName); + } + + // private generation + + private void emitFunctionWrapper(Constant mhConstant, String javaName, String nativeName, MethodType declType, + boolean needsAllocator, boolean isVarargs, List parameterNames) { + incrAlign(); + indent(); + append(MEMBER_MODS + " "); + if (needsAllocator) { + // needs allocator parameter + declType = declType.insertParameterTypes(0, SegmentAllocator.class); + parameterNames = new ArrayList<>(parameterNames); + parameterNames.add(0, "allocator"); + } + List pExprs = emitFunctionWrapperDecl(javaName, declType, isVarargs, parameterNames); + append(" {\n"); + incrAlign(); + indent(); + append("var mh$ = "); + append(mhConstant.getterName(javaName)); + append("();\n"); + indent(); + append("try {\n"); + incrAlign(); + indent(); + if (!declType.returnType().equals(void.class)) { + append("return (" + declType.returnType().getName() + ")"); + } + append("mh$.invokeExact(" + String.join(", ", pExprs) + ");\n"); + decrAlign(); + indent(); + append("} catch (Throwable ex$) {\n"); + incrAlign(); + indent(); + append("throw new AssertionError(\"should not reach here\", ex$);\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + private List emitFunctionWrapperDecl(String javaName, MethodType methodType, boolean isVarargs, List paramNames) { + append(methodType.returnType().getSimpleName() + " " + javaName + "("); + String delim = ""; + List pExprs = new ArrayList<>(); + final int numParams = paramNames.size(); + for (int i = 0 ; i < numParams; i++) { + String pName = paramNames.get(i); + if (pName.isEmpty()) { + pName = "x" + i; + } + pExprs.add(pName); + Class pType = methodType.parameterType(i); + append(delim + pType.getSimpleName() + " " + pName); + delim = ", "; + } + if (isVarargs) { + String lastArg = "x" + numParams; + append(delim + "Object... " + lastArg); + pExprs.add(lastArg); + } + append(")"); + return pExprs; + } + + private void emitFunctionalInterfaceGetter(String fiName, String javaName) { + incrAlign(); + indent(); + append(MEMBER_MODS + " "); + append(fiName + " " + javaName + " () {\n"); + incrAlign(); + indent(); + append("return " + fiName + ".ofAddress(" + javaName + "$get(), Arena.global());\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + void emitPrimitiveTypedef(Type.Primitive primType, String name) { + emitPrimitiveTypedef(null, primType, name); + } + + void emitPrimitiveTypedef(Declaration.Typedef typedefTree, Type.Primitive primType, String name) { + Type.Primitive.Kind kind = primType.kind(); + if (primitiveKindSupported(kind) && kind.layout().isPresent()) { + if (typedefTree != null) { + emitDocComment(typedefTree); + } + incrAlign(); + indent(); + append(MEMBER_MODS); + append(" final"); + append(" " + Utils.layoutDeclarationType(primType.kind().layout().orElseThrow()).getSimpleName()); + append(" " + name); + append(" = "); + append(constants().addLayout(kind.layout().get()).accessExpression()); + append(";\n"); + decrAlign(); + } + } + + void emitPointerTypedef(String name) { + emitPointerTypedef(null, name); + } + + void emitPointerTypedef(Declaration.Typedef typedefTree, String name) { + if (typedefTree != null) { + emitDocComment(typedefTree); + } + incrAlign(); + indent(); + append(MEMBER_MODS); + append(" final"); + append(" AddressLayout "); + append(name); + append(" = "); + append(constants().addLayout(TypeImpl.PointerImpl.POINTER_LAYOUT).accessExpression()); + append(";\n"); + decrAlign(); + } + + private boolean primitiveKindSupported(Type.Primitive.Kind kind) { + return switch(kind) { + case Short, Int, Long, LongLong, Float, Double, Char -> true; + default -> false; + }; + } + + private void emitGlobalGetter(Constant segmentConstant, Constant vhConstant, String javaName, String nativeName, Class type) { + incrAlign(); + indent(); + append(MEMBER_MODS + " " + type.getSimpleName() + " " + javaName + "$get() {\n"); + incrAlign(); + indent(); + append("return (" + type.getName() + ") "); + append(vhConstant.accessExpression()); + append(".get(RuntimeHelper.requireNonNull("); + append(segmentConstant.accessExpression()); + append(", \""); + append(nativeName); + append("\"));\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + private void emitGlobalSetter(Constant segmentConstant, Constant vhConstant, String javaName, String nativeName, Class type) { + incrAlign(); + indent(); + append(MEMBER_MODS + " void " + javaName + "$set(" + type.getSimpleName() + " x) {\n"); + incrAlign(); + indent(); + append(vhConstant.accessExpression()); + append(".set(RuntimeHelper.requireNonNull("); + append(segmentConstant.accessExpression()); + append(", \""); + append(nativeName); + append("\"), x);\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/InMemoryJavaCompiler.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/InMemoryJavaCompiler.java new file mode 100644 index 00000000..391d5571 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/InMemoryJavaCompiler.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.impl; + +import javax.tools.FileObject; +import javax.tools.ForwardingJavaFileManager; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileManager; +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import javax.tools.ToolProvider; +import java.io.*; +import java.io.Writer; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +final class InMemoryJavaCompiler { + private InMemoryJavaCompiler() {} + + static List compile(List files, + String... options) { + JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); + FileManager fileManager = new FileManager(compiler.getStandardFileManager(null, null, null)); + + Writer writer = new StringWriter(); + Boolean exitCode = compiler.getTask(writer, fileManager, null, Arrays.asList(options), null, files).call(); + if (!exitCode) { + throw new CompilationFailedException("In memory compilation failed: " + writer.toString()); + } + return fileManager.getCompiledFiles(); + } + + static JavaFileObject jfoFromByteArray(URI uri, byte[] bytes) { + return new SimpleJavaFileObject(uri, JavaFileObject.Kind.CLASS) { + @Override + public InputStream openInputStream() { + return new ByteArrayInputStream(bytes); + } + }; + } + + static JavaFileObject jfoFromString(URI uri, String contents) { + return new SimpleJavaFileObject(uri, JavaFileObject.Kind.SOURCE) { + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { + return contents; + } + }; + } + + // Wraper for class byte array + private static class ClassFile extends SimpleJavaFileObject { + private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + protected ClassFile(String name) { + super(URI.create(name.replace('.', '/') + Kind.CLASS.extension), Kind.CLASS); + } + + @Override + public ByteArrayOutputStream openOutputStream() { + return this.baos; + } + + @Override + public InputStream openInputStream() { + return new ByteArrayInputStream(baos.toByteArray()); + } + } + + // File manager which spawns ClassFile instances on demand + private static class FileManager extends ForwardingJavaFileManager { + private final List compiled = new ArrayList<>(); + + protected FileManager(JavaFileManager fileManager) { + super(fileManager); + } + + @Override + public JavaFileObject getJavaFileForOutput(Location location, String name, JavaFileObject.Kind kind, FileObject source) throws IOException { + JavaFileObject out = new ClassFile(name); + compiled.add(out); + return out; + } + + public List getCompiledFiles() { + return compiled; + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/IncludeFilter.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/IncludeFilter.java new file mode 100644 index 00000000..b2b7297c --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/IncludeFilter.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +/* + * This visitor filters tree elements based on --include options specified. + */ +final class IncludeFilter implements TreeTransformer, Declaration.Visitor { + private List decls = new ArrayList<>(); + private final IncludeHelper includeHelper; + + IncludeFilter(IncludeHelper includeHelper) { + this.includeHelper = includeHelper; + } + + @Override + public Declaration.Scoped transform(Declaration.Scoped header) { + // Process all header declarations are collect potential + // declarations that will go into transformed HeaderTree + // into the this.decls field. + header.members().forEach(fieldTree -> fieldTree.accept(this, null)); + return createHeader(header, decls); + } + + @Override + public Void visitConstant(Declaration.Constant constant, Declaration parent) { + if (!includeHelper.isIncluded(constant)) { + //skip + return null; + } + decls.add(constant); + return null; + } + + @Override + public Void visitFunction(Declaration.Function funcTree, Declaration parent) { + if (!includeHelper.isIncluded(funcTree)) { + return null; + } + + decls.add(funcTree); + return null; + } + + @Override + public Void visitScoped(Declaration.Scoped d, Declaration parent) { + boolean isStructKind = Utils.isStructOrUnion(d); + if (isStructKind) { + String name = d.name(); + if (!name.isEmpty() && !includeHelper.isIncluded(d)) { + return null; + } + } + + List oldDecls = decls; + this.decls = new ArrayList<>(); + try { + d.members().forEach(fieldTree -> fieldTree.accept(this, d)); + } finally { + var scoped = createScoped(d, decls); + this.decls = oldDecls; + decls.add(scoped); + } + return null; + } + + @Override + public Void visitTypedef(Declaration.Typedef tree, Declaration parent) { + if (!includeHelper.isIncluded(tree)) { + return null; + } + decls.add(tree); + return null; + } + + @Override + public Void visitVariable(Declaration.Variable tree, Declaration parent) { + if (parent == null && !includeHelper.isIncluded(tree)) { + return null; + } + decls.add(tree); + return null; + } + + @Override + public Void visitDeclaration(Declaration decl, Declaration parent) { + decls.add(decl); + return null; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/IncludeHelper.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/IncludeHelper.java new file mode 100644 index 00000000..2ea0a20e --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/IncludeHelper.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.Comparator; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.stream.Collectors; + +public class IncludeHelper { + + public enum IncludeKind { + CONSTANT, + VAR, + FUNCTION, + TYPEDEF, + STRUCT, + UNION; + + public String optionName() { + return "include-" + name().toLowerCase(); + } + + static IncludeKind fromDeclaration(Declaration d) { + if (d instanceof Declaration.Constant) { + return CONSTANT; + } else if (d instanceof Declaration.Variable) { + return VAR; + } else if (d instanceof Declaration.Function) { + return FUNCTION; + } else if (d instanceof Declaration.Typedef) { + return TYPEDEF; + } else if (d instanceof Declaration.Scoped scoped) { + return fromScoped(scoped); + } else { + throw new IllegalStateException("Cannot get here!"); + } + } + + static IncludeKind fromScoped(Declaration.Scoped scoped) { + return switch (scoped.kind()) { + case STRUCT -> IncludeKind.STRUCT; + case UNION -> IncludeKind.UNION; + default -> throw new IllegalStateException("Cannot get here!"); + }; + } + } + + private final EnumMap> includesSymbolNamesByKind = new EnumMap<>(IncludeKind.class); + private final Set usedDeclarations = new HashSet<>(); + public String dumpIncludesFile; + + public void addSymbol(IncludeKind kind, String symbolName) { + Set names = includesSymbolNamesByKind.computeIfAbsent(kind, (_unused) -> new HashSet<>()); + names.add(symbolName); + } + + public boolean isIncluded(Declaration.Variable variable) { + return checkIncludedAndAddIfNeeded(IncludeKind.VAR, variable); + } + + public boolean isIncluded(Declaration.Function function) { + return checkIncludedAndAddIfNeeded(IncludeKind.FUNCTION, function); + } + + public boolean isIncluded(Declaration.Constant constant) { + return checkIncludedAndAddIfNeeded(IncludeKind.CONSTANT, constant); + } + + public boolean isIncluded(Declaration.Typedef typedef) { + return checkIncludedAndAddIfNeeded(IncludeKind.TYPEDEF, typedef); + } + + public boolean isIncluded(Declaration.Scoped scoped) { + return checkIncludedAndAddIfNeeded(IncludeKind.fromScoped(scoped), scoped); + } + + private boolean checkIncludedAndAddIfNeeded(IncludeKind kind, Declaration declaration) { + boolean included = isIncludedInternal(kind, declaration); + if (included && dumpIncludesFile != null) { + usedDeclarations.add(declaration); + } + return included; + } + + private boolean isIncludedInternal(IncludeKind kind, Declaration declaration) { + if (!isEnabled()) { + return true; + } else { + Set names = includesSymbolNamesByKind.computeIfAbsent(kind, (_unused) -> new HashSet<>()); + return names.contains(declaration.name()); + } + } + + public boolean isEnabled() { + return includesSymbolNamesByKind.size() > 0; + } + + public void dumpIncludes() { + try (var writer = Files.newBufferedWriter(Path.of(dumpIncludesFile), StandardOpenOption.CREATE)) { + Map> declsByPath = usedDeclarations.stream() + .collect(Collectors.groupingBy(d -> d.pos().path(), + () -> new TreeMap<>(Path::compareTo), + Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Declaration::name))))); + String lineSep = ""; + for (Map.Entry> pathEntries : declsByPath.entrySet()) { + writer.append(lineSep); + writer.append("#### Extracted from: " + pathEntries.getKey().toString() + "\n\n"); + Map> declsByKind = pathEntries.getValue().stream() + .collect(Collectors.groupingBy(IncludeKind::fromDeclaration)); + int maxLengthOptionCol = pathEntries.getValue().stream().mapToInt(d -> d.name().length()).max().getAsInt(); + maxLengthOptionCol += 2; // -- + maxLengthOptionCol += IncludeKind.FUNCTION.optionName().length(); // max option name + maxLengthOptionCol += 1; // space + for (Map.Entry> kindEntries : declsByKind.entrySet()) { + for (Declaration d : kindEntries.getValue()) { + writer.append(String.format("%-" + maxLengthOptionCol + "s %s", + "--" + kindEntries.getKey().optionName() + " " + d.name(), + "# header: " + pathEntries.getKey() + "\n")); + } + } + lineSep = "\n"; + } + } catch (IOException exception) { + throw new UncheckedIOException(exception); + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/JavaSourceBuilder.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/JavaSourceBuilder.java new file mode 100644 index 00000000..d205a2db --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/JavaSourceBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.jextract.impl; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; + +import javax.tools.JavaFileObject; +import java.util.List; +import java.util.Optional; + +public abstract class JavaSourceBuilder { + + public void addVar(Declaration.Variable varTree, String javaName, + MemoryLayout layout, Optional fiName) { + throw new UnsupportedOperationException(); + } + + public void addFunction(Declaration.Function funcTree, FunctionDescriptor descriptor, + String javaName, List parameterNames) { + throw new UnsupportedOperationException(); + } + + public void addConstant(Declaration.Constant constantTree, String javaName, Class javaType) { + throw new UnsupportedOperationException(); + } + + public void addTypedef(Declaration.Typedef typedefTree, String javaName, String superClass) { + addTypedef(typedefTree, javaName, superClass, typedefTree.type()); + } + + public void addTypedef(Declaration.Typedef typedefTree, String javaName, + String superClass, Type type) { + throw new UnsupportedOperationException(); + } + + public StructBuilder addStruct(Declaration.Scoped structTree, boolean isNestedAnonStruct, + String javaName, GroupLayout layout) { + throw new UnsupportedOperationException(); + } + + public void addFunctionalInterface(Type.Function funcType, String javaName, + FunctionDescriptor descriptor, Optional> parameterNames) { + throw new UnsupportedOperationException(); + } + + abstract public List toFiles(); + + public abstract String packageName(); + + abstract boolean isEnclosedBySameName(String name); + + abstract protected Constants constants(); +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/MacroParserImpl.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/MacroParserImpl.java new file mode 100644 index 00000000..f7d5238d --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/MacroParserImpl.java @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Position; +import org.openjdk.jextract.Type; +import org.openjdk.jextract.JextractTool; +import org.openjdk.jextract.clang.Cursor; +import org.openjdk.jextract.clang.CursorKind; +import org.openjdk.jextract.clang.Diagnostic; +import org.openjdk.jextract.clang.EvalResult; +import org.openjdk.jextract.clang.Index; +import org.openjdk.jextract.clang.LibClang; +import org.openjdk.jextract.clang.TranslationUnit; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +class MacroParserImpl implements AutoCloseable { + + private final ClangReparser reparser; + private final TreeMaker treeMaker; + final MacroTable macroTable; + + private MacroParserImpl(ClangReparser reparser, TreeMaker treeMaker) { + this.reparser = reparser; + this.treeMaker = treeMaker; + this.macroTable = new MacroTable(); + } + + static MacroParserImpl make(TreeMaker treeMaker, TranslationUnit tu, Collection args) { + ClangReparser reparser; + try { + reparser = new ClangReparser(tu, args); + } catch (IOException | Index.ParsingFailedException ex) { + throw new RuntimeException(ex); + } + + return new MacroParserImpl(reparser, treeMaker); + } + + /** + * This method attempts to evaluate the macro. Evaluation occurs in two steps: first, an attempt is made + * to see if the macro corresponds to a simple numeric constant. If so, the constant is parsed in Java directly. + * If that is not possible (e.g. because the macro refers to other macro, or has a more complex grammar), fall + * back to use clang evaluation support. + */ + Optional parseConstant(Cursor cursor, String name, String[] tokens) { + if (cursor.isMacroFunctionLike()) { + return Optional.empty(); + } else if (tokens.length == 2) { + //check for fast path + Integer num = toNumber(tokens[1]); + if (num != null) { + return Optional.of(treeMaker.createMacro(TreeMaker.CursorPosition.of(cursor), name, Type.primitive(Type.Primitive.Kind.Int), (long)num)); + } + } + macroTable.enterMacro(name, tokens, TreeMaker.CursorPosition.of(cursor)); + return Optional.empty(); + } + + private Integer toNumber(String str) { + try { + // Integer.decode supports '#' hex literals which is not valid in C. + return str.length() > 0 && str.charAt(0) != '#'? Integer.decode(str) : null; + } catch (NumberFormatException nfe) { + return null; + } + } + + /** + * This class allows client to reparse a snippet of code against a given set of include files. + * For performance reasons, the set of includes (which comes from the jextract parser) is compiled + * into a precompiled header, so as to speed to incremental recompilation of the generated snippets. + */ + static class ClangReparser { + final Path macro; + final Index macroIndex = LibClang.createIndex(true); + final TranslationUnit macroUnit; + + public ClangReparser(TranslationUnit tu, Collection args) throws IOException, Index.ParsingFailedException { + Path precompiled = Files.createTempFile("jextract$", ".pch"); + precompiled.toFile().deleteOnExit(); + tu.save(precompiled); + this.macro = Files.createTempFile("jextract$", ".h"); + this.macro.toFile().deleteOnExit(); + String[] patchedArgs = Stream.concat( + Stream.of( + // Avoid system search path, use bundled instead + "-nostdinc", + "-ferror-limit=0", + // precompiled header + "-include-pch", precompiled.toAbsolutePath().toString()), + args.stream()).toArray(String[]::new); + this.macroUnit = macroIndex.parse(macro.toAbsolutePath().toString(), + this::processDiagnostics, + false, //add serialization support (needed for macros) + patchedArgs); + } + + void processDiagnostics(Diagnostic diag) { + if (JextractTool.DEBUG) { + System.err.println("Error while processing macro: " + diag.spelling()); + } + } + + public Cursor reparse(String snippet) { + macroUnit.reparse(this::processDiagnostics, + Index.UnsavedFile.of(macro, snippet)); + return macroUnit.getCursor(); + } + } + + /** + * This abstraction is used to collect all macros which could not be interpreted during {@link #parseConstant(Position, String, String[])}. + * All unparsed macros in the table can have three different states: UNPARSED (which means the macro has not been parsed yet), + * SUCCESS (which means the macro has been parsed and has a type and a value) and FAILURE, which means the macro has been + * parsed with some errors, but for which we were at least able to infer a type. + * + * The reparsing process goes as follows: + * 1. all unparsed macros are added to the table in the UNPARSED state. + * 2. a snippet for all macros in the UNPARSED state is compiled and the table state is updated + * 3. a recovery snippet for all macros in the FAILURE state is compiled and the table state is updated again + * 4. we repeat from (2) until no further progress is made. + * 5. we return a list of macro which are in the SUCCESS state. + * + * State transitions in the table are as follows: + * - an UNPARSED macro can go to either SUCCESS, to FAILURE or be removed (if not even a type can be inferred) + * - a FAILURE macro can go to either SUCCESS (if recovery step succeds) or be removed + * - a SUCCESS macro cannot go in any other state + */ + class MacroTable { + + final Map macrosByMangledName = new LinkedHashMap<>(); + + abstract class Entry { + final String name; + final String[] tokens; + final Position position; + + Entry(String name, String[] tokens, Position position) { + this.name = name; + this.tokens = tokens; + this.position = position; + } + + String mangledName() { + return "jextract$macro$" + name; + } + + Entry success(Type type, Object value) { + throw new IllegalStateException(); + } + + Entry failure(Type type) { + throw new IllegalStateException(); + } + + boolean isSuccess() { + return false; + } + boolean isRecoverableFailure() { + return false; + } + boolean isUnparsed() { + return false; + } + + void update() { + macrosByMangledName.put(mangledName(), this); + } + } + + class Unparsed extends Entry { + Unparsed(String name, String[] tokens, Position position) { + super(name, tokens, position); + } + + @Override + Entry success(Type type, Object value) { + return new Success(name, tokens, position, type, value); + } + + @Override + Entry failure(Type type) { + return type != null ? + new RecoverableFailure(name, tokens, type, position) : + new UnparseableMacro(name, tokens, position); + } + + @Override + boolean isUnparsed() { + return true; + } + + @Override + void update() { + throw new IllegalStateException(); + } + } + + class RecoverableFailure extends Entry { + + final Type type; + + public RecoverableFailure(String name, String[] tokens, Type type, Position position) { + super(name, tokens, position); + this.type = type; + } + + @Override + Entry success(Type type, Object value) { + return new Success(name, tokens, position, this.type, value); + } + + @Override + Entry failure(Type type) { + return new UnparseableMacro(name, tokens, position); + } + + @Override + boolean isRecoverableFailure() { + return true; + } + } + + class Success extends Entry { + final Declaration.Constant constant; + + public Success(String name, String[] tokens, Position position, Type type, Object value) { + super(name, tokens, position); + constant = treeMaker.createMacro(position, name, type, value); + } + + @Override + boolean isSuccess() { + return true; + } + + Declaration.Constant constant() { + return constant; + } + } + + class UnparseableMacro extends Entry { + + UnparseableMacro(String name, String[] tokens, Position position) { + super(name, tokens, position); + } + + @Override + void update() { + macrosByMangledName.remove(mangledName()); + } + }; + + void enterMacro(String name, String[] tokens, Position position) { + Unparsed unparsed = new Unparsed(name, tokens, position); + macrosByMangledName.put(unparsed.mangledName(), unparsed); + } + + public List reparseConstants() { + int last = -1; + while (macrosByMangledName.size() > 0 && last != macrosByMangledName.size()) { + last = macrosByMangledName.size(); + // step 1 - try parsing macros as var declarations + reparseMacros(false); + // step 2 - retry failed parsed macros as pointers + reparseMacros(true); + } + treeMaker.typeMaker.resolveTypeReferences(); + return macrosByMangledName.values().stream() + .filter(Entry::isSuccess) + .map(e -> ((Success) e).constant()) + .collect(Collectors.toList()); + } + + void updateTable(TypeMaker typeMaker, Cursor decl) { + String mangledName = decl.spelling(); + Entry entry = macrosByMangledName.get(mangledName); + try (EvalResult result = decl.eval()) { + Entry newEntry = switch (result.getKind()) { + case Integral -> { + long value = result.getAsInt(); + yield entry.success(typeMaker.makeType(decl.type()), value); + } + case FloatingPoint -> { + double value = result.getAsFloat(); + yield entry.success(typeMaker.makeType(decl.type()), value); + } + case StrLiteral -> { + String value = result.getAsString(); + yield entry.success(typeMaker.makeType(decl.type()), value); + } + default -> { + Type type = decl.type().equals(decl.type().canonicalType()) ? + null : typeMaker.makeType(decl.type()); + yield entry.failure(type); + } + }; + newEntry.update(); + } + } + + void reparseMacros(boolean recovery) { + String snippet = macroDecl(recovery); + TreeMaker treeMaker = new TreeMaker(); + try { + reparser.reparse(snippet).forEach(c -> { + if (c.kind() == CursorKind.VarDecl && + c.spelling().contains("jextract$")) { + updateTable(treeMaker.typeMaker, c); + } + }); + } finally { + treeMaker.typeMaker.resolveTypeReferences(); + } + } + + String macroDecl(boolean recovery) { + StringBuilder buf = new StringBuilder(); + if (recovery) { + buf.append("#include \n"); + } + macrosByMangledName.values().stream() + .filter(e -> !e.isSuccess()) // skip macros that already have passed + .filter(recovery ? Entry::isRecoverableFailure : Entry::isUnparsed) + .forEach(e -> { + buf.append("__auto_type ") + .append(e.mangledName()) + .append(" = "); + if (recovery) { + buf.append("(uintptr_t)"); + } + buf.append(e.name) + .append(";\n"); + }); + return buf.toString(); + } + } + + @Override + public void close() { + reparser.macroUnit.close(); + reparser.macroIndex.close(); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/NameMangler.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/NameMangler.java new file mode 100644 index 00000000..5dce4548 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/NameMangler.java @@ -0,0 +1,376 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import javax.lang.model.SourceVersion; + +/* + * This visitor handles java safe names for identifiers, type names. This visitor + * stores java safe names in maps. Subsequent code generation steps can check for + * java safe names via lookup methods. + * + * NOTE: Unlike other transforming tree visitors, this visitor collects name + * mappings as it visits tree nodes. Subsequent code generation steps can check + * the collected names using getters. + */ +final class NameMangler implements Declaration.Visitor { + private final String headerName; + + private static class Scope { + private Scope parent; + private String className; + private Set nestedClassNames = new HashSet<>(); + private int nestedClassNameCount = 0; + private boolean isStruct; + + // is the name enclosed enclosed by a class of the same name? + private boolean isEnclosedBySameName(String name) { + return className().equals(name) || + (isNested() && parent.isEnclosedBySameName(name)); + } + + private boolean isNested() { + return parent != null && parent.isStruct; + } + + private Scope(Scope parent, String name, boolean isStruct) { + this.parent = parent; + this.className = parent != null ? + parent.uniqueNestedClassName(name) : + javaSafeIdentifier(name); + this.isStruct = isStruct; + } + + static Scope newStruct(Scope parent, String name) { + return new Scope(parent, name, true); + } + + static Scope newHeader(String name) { + return new Scope(null, name, false); + } + + String uniqueNestedClassName(String name) { + name = javaSafeIdentifier(name); + var notSeen = nestedClassNames.add(name.toLowerCase()); + var notEnclosed = !isEnclosedBySameName(name); + return notSeen && notEnclosed? name : (name + "$" + nestedClassNameCount++); + } + + String className() { + return className; + } + } + + private Scope curScope; + + private static record NameAndDecl(String name, Declaration decl) {} + // key is either Declaration or NameAndDecl + private final Map declJavaNames = new HashMap<>(); + + private static record DeclPair(Declaration parent, Declaration decl) {} + // key is either Declaration or NameAndDecl or DeclPair + private final Map declFiNames = new HashMap<>(); + private final Map> parameterNames = new HashMap<>(); + + NameMangler(String headerName) { + this.headerName = headerName; + } + + // package private name lookup API + String getJavaName(Declaration parent, Declaration decl) { + Objects.requireNonNull(decl); + if (declJavaNames.containsKey(decl)) { + return Objects.requireNonNull(declJavaNames.get(decl)); + } else { + var name = decl.name().isEmpty()? parent.name() : decl.name(); + var nameAndDecl = new NameAndDecl(name, decl); + return Objects.requireNonNull(declJavaNames.get(nameAndDecl)); + } + } + + Optional> getParameterNames(Type.Function func) { + return Optional.ofNullable(parameterNames.get(func)); + } + + String getFiName(Declaration.Function func, int paramNum, Declaration.Variable param) { + Objects.requireNonNull(func); + Objects.requireNonNull(param); + var nameAndDecl = new NameAndDecl(funcParamID(func, paramNum), param); + return Objects.requireNonNull(declFiNames.get(nameAndDecl)); + } + + String getReturnFiName(Declaration.Function func) { + Objects.requireNonNull(func); + return funcReturnID(func); + } + + String getFiName(Declaration parent, Declaration decl) { + Objects.requireNonNull(decl); + if (declFiNames.containsKey(decl)) { + return Objects.requireNonNull(declFiNames.get(decl)); + } else { + Objects.requireNonNull(parent); + var declPair = new DeclPair(parent, decl); + return Objects.requireNonNull(declFiNames.get(declPair)); + } + } + + // Internals below this point + + private static String funcReturnID(Declaration.Function func) { + return func.name() + "$return"; + } + + private static String funcParamID(Declaration.Function func, int paramNum) { + return func.name() + "$" + paramNum; + } + + private void putJavaName(Declaration decl, String javaName) { + assert decl != null; + assert javaName != null; + declJavaNames.put(decl, javaName); + } + + private void putJavaName(String name, Declaration decl, String javaName) { + assert name != null; + assert decl != null; + assert javaName != null; + declJavaNames.put(new NameAndDecl(name, decl), javaName); + } + + private void putFiName(Declaration decl, String javaName) { + assert decl != null; + assert javaName != null; + declFiNames.put(decl, javaName); + } + + private void putFiName(Declaration parent, Declaration.Variable variable, String javaName) { + assert parent != null; + assert variable != null; + assert javaName != null; + declFiNames.put(new DeclPair(parent, variable), javaName); + } + + private void putFiName(String name, Declaration decl, String javaName) { + assert name != null; + assert decl != null; + assert javaName != null; + declFiNames.put(new NameAndDecl(name, decl), javaName); + } + + // entry point for this visitor + Declaration.Scoped scan(Declaration.Scoped header) { + String javaName = javaSafeIdentifier(headerName.replace(".h", "_h"), true); + curScope = Scope.newHeader(javaName); + putJavaName(header, javaName); + // Process all header declarations are collect java name mappings + header.members().forEach(fieldTree -> fieldTree.accept(this, null)); + return header; + } + + @Override + public Void visitConstant(Declaration.Constant constant, Declaration parent) { + putJavaName(constant, makeJavaName(constant)); + return null; + } + + @Override + public Void visitFunction(Declaration.Function func, Declaration parent) { + putJavaName(func, makeJavaName(func)); + int i = 0; + for (Declaration.Variable param : func.parameters()) { + Type.Function f = Utils.getAsFunctionPointer(param.type()); + if (f != null) { + String declFiName = func.name() + "$" + (param.name().isEmpty() ? "x" + i : param.name()); + putFiName(funcParamID(func, i), param, declFiName); + i++; + } + putJavaName(param, makeJavaName(param)); + } + + return null; + } + + @Override + public Void visitScoped(Declaration.Scoped scoped, Declaration parent) { + String name = scoped.name().isEmpty()? parent.name() : scoped.name(); + if (declJavaNames.containsKey(new NameAndDecl(name, scoped))) { + //skip struct that's seen already + return null; + } + + boolean isStruct = Utils.isStructOrUnion(scoped); + if (!isStruct) { + return null; + } + + Scope oldScope = curScope; + boolean isNestedAnonStruct = scoped.name().isEmpty() && + (parent instanceof Declaration.Scoped); + if (!isNestedAnonStruct) { + this.curScope = Scope.newStruct(oldScope, name); + putJavaName(name, scoped, curScope.className()); + } + try { + scoped.members().forEach(fieldTree -> fieldTree.accept(this, scoped)); + } finally { + this.curScope = oldScope; + } + + return null; + } + + @Override + public Void visitTypedef(Declaration.Typedef typedef, Declaration parent) { + if (declJavaNames.containsKey(typedef)) { + //skip typedef that's seen already + return null; + } + + // handle if this typedef is of a struct/union/enum etc. + if (typedef.type() instanceof Type.Declared declared) { + declared.tree().accept(this, typedef); + } + + // We may potentially generate a class for a typedef. Make sure + // class name is unique in the current nesting context. + String javaName = curScope.uniqueNestedClassName(typedef.name()); + putJavaName(typedef, javaName); + Type.Function func = Utils.getAsFunctionPointer(typedef.type()); + if (func != null) { + var paramNamesOpt = func.parameterNames(); + if (paramNamesOpt.isPresent()) { + parameterNames.put(func, + paramNamesOpt. + get(). + stream(). + map(NameMangler::javaSafeIdentifier). + toList() + ); + } + putFiName(typedef, javaName); + } + return null; + } + + @Override + public Void visitVariable(Declaration.Variable variable, Declaration parent) { + putJavaName(variable, makeJavaName(variable)); + var type = variable.type(); + if (type instanceof Type.Declared declared) { + // declared type - visit declaration recursively + declared.tree().accept(this, variable); + } + Type.Function func = Utils.getAsFunctionPointer(type); + if (func != null) { + String fiName = curScope.uniqueNestedClassName(variable.name()); + if (parent != null) { + putFiName(parent, variable, fiName); + } else { + putFiName(variable, fiName); + } + } + return null; + } + + @Override + public Void visitDeclaration(Declaration decl, Declaration parent) { + return null; + } + + private List javaSafeNameList(List names) { + return names.stream(). + map(n -> n.isEmpty()? n : javaSafeIdentifier(n)). + toList(); + } + + private String makeJavaName(Declaration decl) { + return decl.name().isEmpty()? decl.name() : javaSafeIdentifier(decl.name()); + } + + // Java identifier handling helpers + private static String javaSafeIdentifier(String name) { + return javaSafeIdentifier(name, false); + } + + private static String javaSafeIdentifier(String name, boolean checkAllChars) { + if (checkAllChars) { + StringBuilder buf = new StringBuilder(); + char[] chars = name.toCharArray(); + if (Character.isJavaIdentifierStart(chars[0])) { + buf.append(chars[0]); + } else { + buf.append('_'); + } + if (chars.length > 1) { + for (int i = 1; i < chars.length; i++) { + char ch = chars[i]; + if (Character.isJavaIdentifierPart(ch)) { + buf.append(ch); + } else { + buf.append('_'); + } + } + } + return buf.toString(); + } else { + // We never get the problem of Java non-identifiers (like 123, ab-xy) as + // C identifiers. But we may have a java keyword used as a C identifier. + assert SourceVersion.isIdentifier(name); + + return SourceVersion.isKeyword(name) || isRestrictedTypeName(name) || isJavaTypeName(name)? (name + "_") : name; + } + } + + private static boolean isRestrictedTypeName(String name) { + return switch (name) { + case "var", "yield", "record", + "sealed", "permits" -> true; + default -> false; + }; + } + + private static boolean isJavaTypeName(String name) { + // Java types that are used unqualified in the generated code + return switch (name) { + case "String", "Struct", "MethodHandle", + "VarHandle", "ByteOrder", + "FunctionDescriptor", "LibraryLookup", + "MemoryLayout", + "Arena", "NativeArena", "MemorySegment", "ValueLayout", + "RuntimeHelper" -> true; + default -> false; + }; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/Options.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/Options.java new file mode 100644 index 00000000..f2900f77 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/Options.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public final class Options { + + // The args for parsing C + public final List clangArgs; + // The list of library names + public final List libraryNames; + public final List filters; + // target package + public final String targetPackage; + // output directory + public final String outputDir; + public final boolean source; + public final IncludeHelper includeHelper; + + private Options(List clangArgs, List libraryNames, + List filters, String targetPackage, + String outputDir, boolean source, IncludeHelper includeHelper) { + this.clangArgs = clangArgs; + this.libraryNames = libraryNames; + this.filters = filters; + this.targetPackage = targetPackage; + this.outputDir = outputDir; + this.source = source; + this.includeHelper = includeHelper; + } + + public static Builder builder() { + return new Builder(); + } + + public static Options createDefault() { + return builder().build(); + } + + public static class Builder { + private final List clangArgs; + private final List libraryNames; + private final List filters; + private String targetPackage; + private String outputDir; + private boolean source; + private IncludeHelper includeHelper = new IncludeHelper(); + + public Builder() { + this.clangArgs = new ArrayList<>(); + this.libraryNames = new ArrayList<>(); + this.filters = new ArrayList<>(); + this.targetPackage = ""; + this.outputDir = "."; + this.source = false; + } + + public Options build() { + return new Options( + Collections.unmodifiableList(clangArgs), + Collections.unmodifiableList(libraryNames), + Collections.unmodifiableList(filters), + targetPackage, outputDir, source, includeHelper + ); + } + + public void addClangArg(String arg) { + clangArgs.add(arg); + } + + public void addLibraryName(String name) { + libraryNames.add(name); + } + + public void setOutputDir(String outputDir) { + this.outputDir = outputDir; + } + + public void setTargetPackage(String pkg) { + this.targetPackage = pkg; + } + + public void addFilter(String filter) { + filters.add(filter); + } + + public void setGenerateSource() { + source = true; + } + + public void setDumpIncludeFile(String dumpIncludesFile) { + includeHelper.dumpIncludesFile = dumpIncludesFile; + } + + public void addIncludeSymbol(IncludeHelper.IncludeKind kind, String symbolName) { + includeHelper.addSymbol(kind, symbolName); + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/OutputFactory.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/OutputFactory.java new file mode 100644 index 00000000..ea4fc116 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/OutputFactory.java @@ -0,0 +1,435 @@ +/* + * Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import java.lang.foreign.*; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; + +import javax.tools.JavaFileObject; +import java.io.File; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.net.URI; +import java.net.URL; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +/* + * Scan a header file and generate Java source items for entities defined in that header + * file. Tree visitor visit methods return true/false depending on whether a + * particular Tree is processed or skipped. + */ +public class OutputFactory implements Declaration.Visitor { + protected final ToplevelBuilder toplevelBuilder; + protected JavaSourceBuilder currentBuilder; + private final String pkgName; + private final Map structClassNames = new HashMap<>(); + private final Set unresolvedStructTypedefs = new HashSet<>(); + private final Map functionTypeDefNames = new HashMap<>(); + private final NameMangler nameMangler; + + private void addStructDefinition(Declaration.Scoped decl, String name) { + structClassNames.put(decl, name); + } + + private boolean structDefinitionSeen(Declaration.Scoped decl) { + return structClassNames.containsKey(decl); + } + + private String structDefinitionName(Declaration.Scoped decl) { + return structClassNames.get(decl); + } + + private void addFunctionTypedef(Type.Delegated typedef, String name) { + functionTypeDefNames.put(typedef, name); + } + + private boolean functionTypedefSeen(Type.Delegated typedef) { + return functionTypeDefNames.containsKey(typedef); + } + + private String functionTypedefName(Type.Delegated decl) { + return functionTypeDefNames.get(decl); + } + + static JavaFileObject[] generateWrapped(Declaration.Scoped decl, + String pkgName, List libraryNames, NameMangler nameMangler) { + String clsName = nameMangler.getJavaName(null, decl); + ToplevelBuilder toplevelBuilder = new ToplevelBuilder(pkgName, clsName); + return new OutputFactory(pkgName, toplevelBuilder, nameMangler). + generate(decl, libraryNames.toArray(new String[0])); + } + + private OutputFactory(String pkgName, ToplevelBuilder toplevelBuilder, NameMangler nameMangler) { + this.pkgName = pkgName; + this.toplevelBuilder = toplevelBuilder; + this.currentBuilder = toplevelBuilder; + this.nameMangler = nameMangler; + } + + JavaFileObject[] generate(Declaration.Scoped decl, String[] libs) { + //generate all decls + decl.members().forEach(this::generateDecl); + // check if unresolved typedefs can be resolved now! + for (Declaration.Typedef td : unresolvedStructTypedefs) { + Declaration.Scoped structDef = ((Type.Declared) td.type()).tree(); + toplevelBuilder.addTypedef(td, nameMangler.getJavaName(null, td), structDefinitionName(structDef)); + } + try { + List files = new ArrayList<>(toplevelBuilder.toFiles()); + files.add(jfoFromString(pkgName,"RuntimeHelper", getRuntimeHelperSource(libs))); + return files.toArray(new JavaFileObject[0]); + } catch (IOException ex) { + throw new UncheckedIOException(ex); + } catch (URISyntaxException ex2) { + throw new RuntimeException(ex2); + } + } + + private String getRuntimeHelperSource(String[] libraries) throws URISyntaxException, IOException { + URL runtimeHelper = OutputFactory.class.getResource("resources/RuntimeHelper.java.template"); + String template = (pkgName.isEmpty()? "" : "package " + pkgName + ";\n") + + String.join("\n", Files.readAllLines(Paths.get(runtimeHelper.toURI()))); + List loadLibrariesStr = new ArrayList<>(); + for (String lib : libraries) { + String quotedLibName = quoteLibraryName(lib); + if (quotedLibName.indexOf(File.separatorChar) != -1) { + loadLibrariesStr.add("System.load(\"" + quotedLibName + "\");"); + } else { + loadLibrariesStr.add("System.loadLibrary(\"" + quotedLibName + "\");"); + } + } + return template.replace("#LOAD_LIBRARIES#", loadLibrariesStr.stream().collect(Collectors.joining(" "))); + } + + private String quoteLibraryName(String lib) { + return lib.replace("\\", "\\\\"); // double up slashes + } + + private void generateDecl(Declaration tree) { + try { + tree.accept(this, null); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + private JavaFileObject jfoFromString(String pkgName, String clsName, String contents) { + String pkgPrefix = pkgName.isEmpty() ? "" : pkgName.replaceAll("\\.", "/") + "/"; + return InMemoryJavaCompiler.jfoFromString(URI.create(pkgPrefix + clsName + ".java"), contents); + } + + @Override + public Void visitConstant(Declaration.Constant constant, Declaration parent) { + /* + * This method is called from visitVariable when it recursively visits type + * When type is enum, enum constants are visited again! Checking parent to be + * null to avoid duplicate generation of enum constant getter methods. + */ + if (parent != null) { + return null; + } + + Class clazz = getJavaType(constant.type()); + if (clazz == null) { + warn("skipping " + constant.name() + " because of unsupported type usage"); + return null; + } + toplevelBuilder.addConstant(constant, nameMangler.getJavaName(parent, constant), clazz); + return null; + } + + @Override + public Void visitScoped(Declaration.Scoped d, Declaration parent) { + if (d.layout().isEmpty() || structDefinitionSeen(d)) { + //skip decl + return null; + } + + boolean isStructKind = Utils.isStructOrUnion(d); + StructBuilder structBuilder = null; + if (isStructKind) { + GroupLayout layout = (GroupLayout) layoutFor(d); + boolean isNestedAnonStruct = d.name().isEmpty() && + (parent instanceof Declaration.Scoped); + currentBuilder = structBuilder = currentBuilder.addStruct( + d, + isNestedAnonStruct, + isNestedAnonStruct? null : nameMangler.getJavaName(parent, d), + layout); + structBuilder.classBegin(); + if (!d.name().isEmpty()) { + addStructDefinition(d, structBuilder.fullName()); + } + if (parent instanceof Declaration.Typedef) { + addStructDefinition(d, structBuilder.fullName()); + } + } + try { + d.members().forEach(fieldTree -> fieldTree.accept(this, d)); + } finally { + if (isStructKind) { + currentBuilder = structBuilder.classEnd(); + } + } + return null; + } + + private boolean generateFunctionalInterface(Type.Function func, String javaName) { + String unsupportedType = UnsupportedLayouts.firstUnsupportedType(func); + if (unsupportedType != null) { + warn("skipping " + javaName + " because of unsupported type usage: " + + unsupportedType); + return false; + } + + FunctionDescriptor descriptor = Type.descriptorFor(func).orElse(null); + if (descriptor == null) { + return false; + } + + //generate functional interface + if (func.varargs() && !func.argumentTypes().isEmpty()) { + warn("varargs in callbacks is not supported: " + CDeclarationPrinter.declaration(func, javaName)); + return false; + } + + currentBuilder.addFunctionalInterface(func, javaName, descriptor, + nameMangler.getParameterNames(func)); + return true; + } + + @Override + public Void visitFunction(Declaration.Function funcTree, Declaration parent) { + //generate static wrapper for function + String unsupportedType = UnsupportedLayouts.firstUnsupportedType(funcTree.type()); + if (unsupportedType != null) { + warn("skipping " + funcTree.name() + " because of unsupported type usage: " + + unsupportedType); + return null; + } + + FunctionDescriptor descriptor = Type.descriptorFor(funcTree.type()).orElse(null); + if (descriptor == null) { + return null; + } + + // check for function pointer type arguments + int i = 0; + for (Declaration.Variable param : funcTree.parameters()) { + Type.Function f = Utils.getAsFunctionPointer(param.type()); + if (f != null) { + String fiName = nameMangler.getFiName(funcTree, i, param); + if (! generateFunctionalInterface(f, fiName)) { + return null; + } + i++; + } + } + + // return type could be a function pointer type + Type.Function returnFunc = Utils.getAsFunctionPointer(funcTree.type().returnType()); + if (returnFunc != null) { + if (! generateFunctionalInterface(returnFunc, nameMangler.getReturnFiName(funcTree))) { + return null; + } + } + + toplevelBuilder.addFunction(funcTree, descriptor, nameMangler.getJavaName(parent, funcTree), + funcTree.parameters(). + stream(). + map(param -> nameMangler.getJavaName(null, param)). + toList()); + + return null; + } + + Optional getAsFunctionPointerTypedef(Type type) { + if (type instanceof Type.Delegated delegated && + delegated.kind() == Type.Delegated.Kind.TYPEDEF && + functionTypedefSeen(delegated)) { + return Optional.of(functionTypedefName(delegated)); + } else { + return Optional.empty(); + } + } + + @Override + public Void visitTypedef(Declaration.Typedef tree, Declaration parent) { + Type type = tree.type(); + if (type instanceof Type.Declared declared) { + Declaration.Scoped s = declared.tree(); + if (!s.name().equals(tree.name())) { + switch (s.kind()) { + case STRUCT, UNION -> { + if (s.name().isEmpty()) { + visitScoped(s, tree); + } else { + /* + * If typedef is seen after the struct/union definition, we can generate subclass + * right away. If not, we've to save it and revisit after all the declarations are + * seen. This is to support forward declaration of typedefs. + * + * typedef struct Foo Bar; + * + * struct Foo { + * int x, y; + * }; + */ + if (structDefinitionSeen(s)) { + String javaName = nameMangler.getJavaName(parent, tree); + toplevelBuilder.addTypedef(tree, javaName, structDefinitionName(s)); + } else { + /* + * Definition of typedef'ed struct/union not seen yet. May be the definition comes later. + * Save it to visit at the end of all declarations. + */ + unresolvedStructTypedefs.add(tree); + } + } + } + default -> visitScoped(s, tree); + } + } + } else if (type instanceof Type.Primitive) { + toplevelBuilder.addTypedef(tree, nameMangler.getJavaName(parent, tree), null); + } else { + Type.Function func = Utils.getAsFunctionPointer(type); + if (func != null) { + String fiName = nameMangler.getFiName(parent, tree); + boolean funcIntfGen = generateFunctionalInterface(func, fiName); + if (funcIntfGen) { + addFunctionTypedef(Type.typedef(tree.name(), tree.type()), fiName); + } + } else if (((TypeImpl)type).isPointer()) { + toplevelBuilder.addTypedef(tree, nameMangler.getJavaName(parent, tree), null); + } else { + Type.Primitive primitive = Utils.getAsSignedOrUnsigned(type); + if (primitive != null) { + toplevelBuilder.addTypedef(tree, nameMangler.getJavaName(parent, tree), null, primitive); + } + } + } + return null; + } + + @Override + public Void visitVariable(Declaration.Variable tree, Declaration parent) { + Type type = tree.type(); + + if (type instanceof Type.Declared declared) { + // declared type - visit declaration recursively + declared.tree().accept(this, tree); + } + + MemoryLayout layout = Type.layoutFor(type).orElse(null); + if (layout == null) { + //no layout - abort + return null; + } + + if (tree.kind() == Declaration.Variable.Kind.BITFIELD || + (layout instanceof ValueLayout && layout.byteSize() > 8)) { + //skip + return null; + } + + final String fieldName = tree.name(); + assert !fieldName.isEmpty(); + + String unsupportedType = UnsupportedLayouts.firstUnsupportedType(type); + if (unsupportedType != null) { + String name = parent != null? parent.name() + "." : ""; + name += fieldName; + warn("skipping " + name + " because of unsupported type usage: " + + unsupportedType); + return null; + } + + Class clazz = getJavaType(type); + if (clazz == null) { + String name = parent != null? parent.name() + "." : ""; + name += fieldName; + warn("skipping " + name + " because of unsupported type usage"); + return null; + } + + + Type.Function func = Utils.getAsFunctionPointer(type); + String fiName = null; + if (func != null) { + fiName = nameMangler.getFiName(parent, tree); + if (! generateFunctionalInterface(func, fiName)) { + fiName = null; + } + } else { + Optional funcTypedef = getAsFunctionPointerTypedef(type); + if (funcTypedef.isPresent()) { + fiName = funcTypedef.get(); + } + } + + currentBuilder.addVar(tree, nameMangler.getJavaName(parent, tree), layout, Optional.ofNullable(fiName)); + + return null; + } + + protected static MemoryLayout layoutFor(Declaration decl) { + if (decl instanceof Declaration.Typedef alias) { + return Type.layoutFor(alias.type()).orElseThrow(); + } else if (decl instanceof Declaration.Scoped scoped) { + return scoped.layout().orElseThrow(); + } else { + throw new IllegalArgumentException("Unexpected parent declaration"); + } + // case like `typedef struct { ... } Foo` + } + + static void warn(String msg) { + System.err.println("WARNING: " + msg); + } + + private Class getJavaType(Type type) { + Optional layout = Type.layoutFor(type); + if (!layout.isPresent()) return null; + if (layout.get() instanceof SequenceLayout || layout.get() instanceof GroupLayout) { + return MemorySegment.class; + } else if (layout.get() instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else { + return null; + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/Parser.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/Parser.java new file mode 100644 index 00000000..8f81fb5f --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/Parser.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.clang.Cursor; +import org.openjdk.jextract.clang.CursorKind; +import org.openjdk.jextract.clang.Diagnostic; +import org.openjdk.jextract.clang.Index; +import org.openjdk.jextract.clang.LibClang; +import org.openjdk.jextract.clang.SourceLocation; +import org.openjdk.jextract.clang.SourceRange; +import org.openjdk.jextract.clang.TranslationUnit; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Optional; + +public class Parser { + private final TreeMaker treeMaker; + + public Parser() { + this.treeMaker = new TreeMaker(); + } + + public Declaration.Scoped parse(Path path, Collection args) { + try (Index index = LibClang.createIndex(false) ; + TranslationUnit tu = index.parse(path.toString(), + d -> { + if (d.severity() > Diagnostic.CXDiagnostic_Warning) { + //TODO do something on error + //throw new ClangException(d.toString()); + } + }, + true, args.toArray(new String[0])) ; + MacroParserImpl macroParser = MacroParserImpl.make(treeMaker, tu, args)) { + + List decls = new ArrayList<>(); + Cursor tuCursor = tu.getCursor(); + tuCursor.forEach(c -> { + SourceLocation loc = c.getSourceLocation(); + if (loc == null) { + return; + } + + SourceLocation.Location src = loc.getFileLocation(); + if (src == null) { + return; + } + + + if (c.isDeclaration()) { + if (c.kind() == CursorKind.UnexposedDecl || + c.kind() == CursorKind.Namespace) { + c.forEach(t -> { + Declaration declaration = treeMaker.createTree(t); + if (declaration != null) { + decls.add(declaration); + } + }); + } else { + Declaration decl = treeMaker.createTree(c); + if (decl != null) { + decls.add(decl); + } + } + } else if (isMacro(c) && src.path() != null) { + SourceRange range = c.getExtent(); + String[] tokens = c.getTranslationUnit().tokens(range); + Optional constant = macroParser.parseConstant(c, c.spelling(), tokens); + if (constant.isPresent()) { + decls.add(constant.get()); + } + } + }); + + decls.addAll(macroParser.macroTable.reparseConstants()); + Declaration.Scoped rv = treeMaker.createHeader(tuCursor, decls); + treeMaker.freeze(); + return rv; + } + } + + private boolean isMacro(Cursor c) { + return c.isPreprocessing() && c.kind() == CursorKind.MacroDefinition; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/PrettyPrinter.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/PrettyPrinter.java new file mode 100644 index 00000000..e7de2a04 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/PrettyPrinter.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import java.lang.constant.Constable; +import java.util.Set; +import java.util.stream.Collectors; +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Declaration.Bitfield; +import org.openjdk.jextract.Declaration.Variable.Kind; +import org.openjdk.jextract.Position; +import org.openjdk.jextract.Type; + +public class PrettyPrinter implements Declaration.Visitor { + + private static String SPACES = " ".repeat(92); + int align = 0; + + void incr() { + align += 4; + } + + void decr() { + align -= 4; + } + + void indent() { + builder.append(SPACES.substring(0, align)); + } + + StringBuilder builder = new StringBuilder(); + + private void getAttributes(Declaration decl) { + Set attrs = decl.attributeNames(); + if (attrs.isEmpty()) { + return; + } + incr(); + indent(); + for (String k: attrs) { + builder.append("Attr: "); + builder.append(k); + builder.append(" -> ["); + builder.append(decl.getAttribute(k).get().stream() + .map(Constable::toString) + .collect(Collectors.joining(", "))); + builder.append("]\n"); + } + decr(); + } + + public String print(Declaration decl) { + decl.accept(this, null); + return builder.toString(); + } + + @Override + public Void visitScoped(Declaration.Scoped d, Void aVoid) { + indent(); + builder.append("Scoped: " + d.kind() + " " + d.name() + d.layout().map(l -> " layout = " + l).orElse("")); + builder.append("\n"); + getAttributes(d); + incr(); + d.members().forEach(m -> m.accept(this, null)); + decr(); + return null; + } + + @Override + public Void visitFunction(Declaration.Function d, Void aVoid) { + indent(); + builder.append("Function: " + d.name() + " type = " + d.type().accept(typeVisitor, null)); + builder.append("\n"); + getAttributes(d); + incr(); + d.parameters().forEach(m -> m.accept(this, null)); + decr(); + return null; + } + + @Override + public Void visitVariable(Declaration.Variable d, Void aVoid) { + indent(); + if (d instanceof Bitfield bitfield) { + builder.append("Bitfield: " + " type = " + d.type().accept(typeVisitor, null) + ", name = " + bitfield.name() + + ", offset = " + bitfield.offset() + ", width = " + bitfield.width()); + } else { + builder.append("Variable: " + d.kind() + " " + d.name() + " type = " + d.type().accept(typeVisitor, null)); + } + builder.append("\n"); + getAttributes(d); + return null; + } + + @Override + public Void visitConstant(Declaration.Constant d, Void aVoid) { + indent(); + builder.append("Constant: " + d.name() + " " + d.value() + " type = " + d.type().accept(typeVisitor, null)); + builder.append("\n"); + getAttributes(d); + return null; + } + + @Override + public Void visitTypedef(Declaration.Typedef d, Void aVoid) { + indent(); + builder.append("Typedef: ").append(d.name()).append(" = ") + .append(d.type().accept(typeVisitor, null)).append("\n"); + getAttributes(d); + return null; + } + + private static Type.Visitor typeVisitor = new Type.Visitor<>() { + @Override + public String visitPrimitive(Type.Primitive t, Void aVoid) { + return t.kind().toString() + t.kind().layout().map(l -> "(layout = " + l + ")").orElse(""); + } + + @Override + public String visitDelegated(Type.Delegated t, Void aVoid) { + switch (t.kind()) { + case TYPEDEF: + return "typedef " + t.name() + " = " + t.type().accept(this, null); + case POINTER: + return "(" + t.type().accept(this, null) + ")*"; + default: + return t.kind() + " = " + t.type().accept(this, null); + } + } + + @Override + public String visitFunction(Type.Function t, Void aVoid) { + String res = t.returnType().accept(this, null); + String args = t.argumentTypes().stream() + .map(a -> a.accept(this, null)) + .collect(Collectors.joining(",", "(", ")")); + return res + args; + } + + @Override + public String visitDeclared(Type.Declared t, Void aVoid) { + return "Declared(" + t.tree().layout().map(MemoryLayout::toString).orElse("") + ")"; + } + + @Override + public String visitArray(Type.Array t, Void aVoid) { + String brackets = String.format("%s[%s]", t.kind() == Type.Array.Kind.VECTOR ? "v" : "", + t.elementCount().isPresent() ? t.elementCount().getAsLong() : ""); + return t.elementType().accept(this, null) + brackets; + } + + @Override + public String visitType(Type t, Void aVoid) { + return "Unknown type: " + t.getClass().getName(); + } + }; + + public static String type(Type type) { + return type.accept(typeVisitor, null); + } + + public static String position(Position pos) { + return String.format("%s:%d:%d", + pos.path() == null ? "N/A" : pos.path().toString(), + pos.line(), pos.col()); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/RecordLayoutComputer.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/RecordLayoutComputer.java new file mode 100644 index 00000000..8b2b0981 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/RecordLayoutComputer.java @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.clang.Cursor; +import org.openjdk.jextract.clang.CursorKind; +import org.openjdk.jextract.clang.Type; +import org.openjdk.jextract.clang.TypeKind; + +import java.lang.foreign.SequenceLayout; +import java.lang.foreign.StructLayout; +import java.lang.foreign.ValueLayout; +import java.util.ArrayList; +import java.util.List; + +/** + * Base class for C struct, union MemoryLayout computer helper classes. + */ +abstract class RecordLayoutComputer { + // enclosing struct type (or this struct type for top level structs) + final Type parent; + // this struct type + final Type type; + // cursor of this struct + final Cursor cursor; + final List fieldDecls; + final List fieldLayouts; + + final TypeMaker typeMaker; + + private int anonCount = 0; + + RecordLayoutComputer(TypeMaker typeMaker, Type parent, Type type) { + this.parent = parent; + this.type = type; + this.cursor = type.getDeclarationCursor().getDefinition(); + this.fieldDecls = new ArrayList<>(); + this.fieldLayouts = new ArrayList<>(); + this.typeMaker = typeMaker; + } + + static org.openjdk.jextract.Type compute(TypeMaker typeMaker, long offsetInParent, Type parent, Type type) { + return computeInternal(typeMaker, offsetInParent, parent, type, null); + } + + private static org.openjdk.jextract.Type computeAnonymous(TypeMaker typeMaker, long offsetInParent, Type parent, Type type, String name) { + return computeInternal(typeMaker, offsetInParent, parent, type, name); + } + + static final org.openjdk.jextract.Type.Declared ERRONEOUS = org.openjdk.jextract.Type.declared( + Declaration.struct(TreeMaker.CursorPosition.NO_POSITION, "", MemoryLayout.paddingLayout(8))); + + private static org.openjdk.jextract.Type computeInternal(TypeMaker typeMaker, long offsetInParent, Type parent, Type type, String name) { + Cursor cursor = type.getDeclarationCursor().getDefinition(); + if (cursor.isInvalid()) { + return ERRONEOUS; + } + + final boolean isUnion = cursor.kind() == CursorKind.UnionDecl; + return isUnion? new UnionLayoutComputer(typeMaker, offsetInParent, parent, type).compute(name) : + new StructLayoutComputer(typeMaker, offsetInParent, parent, type).compute(name); + } + + final org.openjdk.jextract.Type.Declared compute(String anonName) { + cursor.forEach(fc -> { + if (Utils.isFlattenable(fc)) { + /* + * Ignore bitfields of zero width. + * + * struct Foo { + * int i:0; + * } + * + * And bitfields without a name. + * (padding is computed automatically) + */ + if (fc.isBitField() && (fc.getBitFieldWidth() == 0 || fc.spelling().isEmpty())) { + startBitfield(); + } else { + processField(fc); + } + } + }); + + String declName = recordName(); + Declaration.Scoped declaration = finishRecord(anonName != null ? anonName : declName, declName); + if (cursor.isAnonymousStruct()) { + // record this with a declaration attribute, so we don't have to rely on the cursor again later + declaration = (Declaration.Scoped)declaration.withAttribute("ANONYMOUS", true); + } + return org.openjdk.jextract.Type.declared(declaration); + } + + abstract void startBitfield(); + abstract void processField(Cursor c); + abstract Declaration.Scoped finishRecord(String layoutName, String declName); + + void addField(long offset, Declaration declaration) { + fieldDecls.add(declaration); + MemoryLayout layout = null; + if (declaration instanceof Declaration.Scoped scoped) { + layout = scoped.layout().orElse(null); + } else if (declaration instanceof Declaration.Variable var) { + layout = org.openjdk.jextract.Type.layoutFor(var.type()).orElse(null); + } + if (layout != null) { + fieldLayouts.add(declaration.name().isEmpty() ? layout : layout.withName(declaration.name())); + } + } + + void addPadding(long bits) { + fieldLayouts.add(MemoryLayout.paddingLayout(bits / 8)); + } + + void addField(long offset, Type parent, Cursor c) { + if (c.isAnonymousStruct()) { + addField(offset, ((org.openjdk.jextract.Type.Declared)computeAnonymous(typeMaker, offset, parent, c.type(), nextAnonymousName())).tree()); + } else { + addField(offset, field(offset, c)); + } + } + + private String nextAnonymousName() { + return "$anon$" + anonCount++; + } + + Declaration field(long offset, Cursor c) { + org.openjdk.jextract.Type type = typeMaker.makeType(c.type()); + String name = c.spelling(); + if (c.isBitField()) { + return Declaration.bitfield(TreeMaker.CursorPosition.of(c), name, type, offset, c.getBitFieldWidth()); + } else if (c.isAnonymousStruct() && type instanceof org.openjdk.jextract.Type.Declared decl) { + return decl.tree(); + } else { + return Declaration.field(TreeMaker.CursorPosition.of(c), name, type); + } + } + + long fieldSize(Cursor c) { + if (c.type().kind() == TypeKind.IncompleteArray) { + return 0; + } + return c.isBitField() ? c.getBitFieldWidth() : c.type().size() * 8; + } + + Declaration.Scoped bitfield(Declaration.Variable... declarations) { + return Declaration.bitfields(declarations[0].pos(), declarations); + } + + long offsetOf(Type parent, Cursor c) { + if (c.kind() == CursorKind.FieldDecl) { + return parent.getOffsetOf(c.spelling()); + } else { + List offsets = new ArrayList<>(); + c.forEach(child -> { + if (Utils.isFlattenable(child)) { + offsets.add(offsetOf(parent, child)); + } + }); + return offsets.stream().findFirst() + .orElseThrow(() -> new IllegalStateException( + "Can not find offset of: " + c + ", in: " + parent)); + } + } + + void checkSize(GroupLayout layout) { + // sanity check + if (cursor.type().size() != layout.byteSize()) { + throw new AssertionError( + String.format("Unexpected size for layout %s. Found %d ; expected %d", + layout, layout.byteSize(), cursor.type().size())); + } + } + + private String recordName() { + if (cursor.isAnonymous()) { + return ""; + } else { + return cursor.spelling(); + } + } + + MemoryLayout[] alignFields() { + long align = cursor.type().align(); + return fieldLayouts.stream() + .map(l -> forceAlign(l, align)) + .toArray(MemoryLayout[]::new); + } + + private static MemoryLayout forceAlign(MemoryLayout layout, long align) { + if (align >= layout.byteAlignment()) { + return layout; // fast-path + } + MemoryLayout res = switch (layout) { + case GroupLayout groupLayout -> { + MemoryLayout[] newMembers = groupLayout.memberLayouts() + .stream().map(l -> forceAlign(l, align)).toArray(MemoryLayout[]::new); + yield groupLayout instanceof StructLayout ? + MemoryLayout.structLayout(newMembers) : + MemoryLayout.unionLayout(newMembers); + } + case SequenceLayout sequenceLayout -> + MemoryLayout.sequenceLayout(sequenceLayout.elementCount(), + forceAlign(sequenceLayout.elementLayout(), align)); + default -> layout.withByteAlignment(align); + }; + // copy name and target layout, if present + if (layout.name().isPresent()) { + res = res.withName(layout.name().get()); + } + if (layout instanceof AddressLayout addressLayout && addressLayout.targetLayout().isPresent()) { + ((AddressLayout)res).withTargetLayout(addressLayout.targetLayout().get()); + } + return res; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/StructBuilder.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/StructBuilder.java new file mode 100644 index 00000000..77a6148f --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/StructBuilder.java @@ -0,0 +1,334 @@ +/* + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SequenceLayout; +import java.lang.foreign.ValueLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; +import org.openjdk.jextract.impl.Constants.Constant; + +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Deque; +import java.util.List; +import java.util.Optional; + +/** + * This class generates static utilities class for C structs, unions. + */ +class StructBuilder extends ClassSourceBuilder { + + private static final String MEMBER_MODS = "public static"; + + private final Declaration.Scoped structTree; + private final GroupLayout structLayout; + private final Type structType; + private final Deque prefixElementNames; + private Constant layoutConstant; + + StructBuilder(JavaSourceBuilder enclosing, Declaration.Scoped structTree, + String name, GroupLayout structLayout) { + super(enclosing, Kind.CLASS, name); + this.structTree = structTree; + this.structLayout = structLayout; + this.structType = Type.declared(structTree); + prefixElementNames = new ArrayDeque<>(); + } + + private String safeParameterName(String paramName) { + return isEnclosedBySameName(paramName)? paramName + "$" : paramName; + } + + void pushPrefixElement(String prefixElementName) { + prefixElementNames.push(prefixElementName); + } + + void popPrefixElement() { + prefixElementNames.pop(); + } + + private List prefixNamesList() { + List prefixes = new ArrayList<>(prefixElementNames); + Collections.reverse(prefixes); + return Collections.unmodifiableList(prefixes); + } + + @Override + void classBegin() { + if (!inAnonymousNested()) { + super.classBegin(); + layoutConstant = constants().addLayout(((Type.Declared) structType).tree().layout().orElseThrow()); + layoutConstant.emitGetter(this, MEMBER_MODS, Constant::nameSuffix); + } + } + + @Override + void classDeclBegin() { + if (!inAnonymousNested()) { + emitDocComment(structTree); + } + } + + @Override + JavaSourceBuilder classEnd() { + if (!inAnonymousNested()) { + emitSizeof(); + emitAllocatorAllocate(); + emitAllocatorAllocateArray(); + emitOfAddressScoped(); + return super.classEnd(); + } else { + // we're in an anonymous struct which got merged into this one, return this very builder and keep it open + popPrefixElement(); + return this; + } + } + + boolean inAnonymousNested() { + return !prefixElementNames.isEmpty(); + } + + @Override + public StructBuilder addStruct(Declaration.Scoped tree, boolean isNestedAnonStruct, + String name, GroupLayout layout) { + if (isNestedAnonStruct) { + //nested anon struct - merge into this builder! + String anonName = layout.name().orElseThrow(); + pushPrefixElement(anonName); + return this; + } else { + return new StructBuilder(this, tree, name, layout); + } + } + + @Override + public void addFunctionalInterface(Type.Function funcType, String javaName, + FunctionDescriptor descriptor, Optional> parameterNames) { + FunctionalInterfaceBuilder builder = new FunctionalInterfaceBuilder(this, funcType, javaName, descriptor, parameterNames); + builder.classBegin(); + builder.classEnd(); + } + + @Override + public void addVar(Declaration.Variable varTree, String javaName, + MemoryLayout layout, Optional fiName) { + String nativeName = varTree.name(); + try { + structLayout.byteOffset(elementPaths(nativeName)); + } catch (UnsupportedOperationException uoe) { + // bad layout - do nothing + OutputFactory.warn("skipping '" + className() + "." + nativeName + "' : " + uoe.toString()); + return; + } + if (layout instanceof SequenceLayout || layout instanceof GroupLayout) { + if (layout.byteSize() > 0) { + emitSegmentGetter(javaName, nativeName, layout); + } + } else if (layout instanceof ValueLayout valueLayout) { + Constant vhConstant = constants().addFieldVarHandle(nativeName, structLayout, prefixNamesList()) + .emitGetter(this, MEMBER_MODS, javaName); + emitFieldDocComment(varTree, "Getter for field:"); + emitFieldGetter(vhConstant, javaName, valueLayout.carrier()); + emitFieldDocComment(varTree, "Setter for field:"); + emitFieldSetter(vhConstant, javaName, valueLayout.carrier()); + emitIndexedFieldGetter(vhConstant, javaName, valueLayout.carrier()); + emitIndexedFieldSetter(vhConstant, javaName, valueLayout.carrier()); + if (fiName.isPresent()) { + emitFunctionalInterfaceGetter(fiName.get(), javaName); + } + } + } + + private void emitFieldDocComment(Declaration.Variable varTree, String header) { + incrAlign(); + emitDocComment(varTree, header); + decrAlign(); + } + + private void emitFunctionalInterfaceGetter(String fiName, String javaName) { + incrAlign(); + indent(); + append(MEMBER_MODS + " "); + append(fiName + " " + javaName + "(MemorySegment segment, Arena scope) {\n"); + incrAlign(); + indent(); + append("return " + fiName + ".ofAddress(" + javaName + "$get(segment), scope);\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + private void emitFieldGetter(Constant vhConstant, String javaName, Class type) { + incrAlign(); + indent(); + String seg = safeParameterName("seg"); + append(MEMBER_MODS + " " + type.getSimpleName() + " " + javaName + "$get(MemorySegment " + seg + ") {\n"); + incrAlign(); + indent(); + append("return (" + type.getName() + ")" + + vhConstant.accessExpression() + ".get(" + seg + ");\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + private void emitFieldSetter(Constant vhConstant, String javaName, Class type) { + incrAlign(); + indent(); + String seg = safeParameterName("seg"); + String x = safeParameterName("x"); + String param = MemorySegment.class.getSimpleName() + " " + seg; + append(MEMBER_MODS + " void " + javaName + "$set(" + param + ", " + type.getSimpleName() + " " + x + ") {\n"); + incrAlign(); + indent(); + append(vhConstant.accessExpression() + ".set(" + seg + ", " + x + ");\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + private MemoryLayout.PathElement[] elementPaths(String nativeFieldName) { + List prefixElements = prefixNamesList(); + MemoryLayout.PathElement[] elems = new MemoryLayout.PathElement[prefixElements.size() + 1]; + int i = 0; + for (; i < prefixElements.size(); i++) { + elems[i] = MemoryLayout.PathElement.groupElement(prefixElements.get(i)); + } + elems[i] = MemoryLayout.PathElement.groupElement(nativeFieldName); + return elems; + } + + private void emitSegmentGetter(String javaName, String nativeName, MemoryLayout layout) { + incrAlign(); + indent(); + String seg = safeParameterName("seg"); + append(MEMBER_MODS + " MemorySegment " + javaName + "$slice(MemorySegment " + seg + ") {\n"); + incrAlign(); + indent(); + append("return " + seg + ".asSlice("); + append(structLayout.byteOffset(elementPaths(nativeName))); + append(", "); + append(layout.byteSize()); + append(");\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + private void emitSizeof() { + incrAlign(); + indent(); + append(MEMBER_MODS); + append(" long sizeof() { return $LAYOUT().byteSize(); }\n"); + decrAlign(); + } + + private void emitAllocatorAllocate() { + incrAlign(); + indent(); + append(MEMBER_MODS); + append(" MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }\n"); + decrAlign(); + } + + private void emitAllocatorAllocateArray() { + incrAlign(); + indent(); + append(MEMBER_MODS); + append(" MemorySegment allocateArray(long len, SegmentAllocator allocator) {\n"); + incrAlign(); + indent(); + append("return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + private void emitOfAddressScoped() { + incrAlign(); + indent(); + append(MEMBER_MODS); + append(" MemorySegment ofAddress(MemorySegment addr, Arena arena) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, arena); }\n"); + decrAlign(); + } + + private void emitIndexedFieldGetter(Constant vhConstant, String javaName, Class type) { + incrAlign(); + indent(); + String index = safeParameterName("index"); + String seg = safeParameterName("seg"); + String params = MemorySegment.class.getSimpleName() + " " + seg + ", long " + index; + append(MEMBER_MODS + " " + type.getSimpleName() + " " + javaName + "$get(" + params + ") {\n"); + incrAlign(); + indent(); + append("return (" + type.getName() + ")"); + append(vhConstant.accessExpression()); + append(".get("); + append(seg); + append(".asSlice("); + append(index); + append("*sizeof()));\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } + + private void emitIndexedFieldSetter(Constant vhConstant, String javaName, Class type) { + incrAlign(); + indent(); + String index = safeParameterName("index"); + String seg = safeParameterName("seg"); + String x = safeParameterName("x"); + String params = MemorySegment.class.getSimpleName() + " " + seg + + ", long " + index + ", " + type.getSimpleName() + " " + x; + append(MEMBER_MODS + " void " + javaName + "$set(" + params + ") {\n"); + incrAlign(); + indent(); + append(vhConstant.accessExpression()); + append(".set("); + append(seg); + append(".asSlice("); + append(index); + append("*sizeof()), "); + append(x); + append(");\n"); + decrAlign(); + indent(); + append("}\n"); + decrAlign(); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/StructLayoutComputer.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/StructLayoutComputer.java new file mode 100644 index 00000000..3c4f244a --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/StructLayoutComputer.java @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.clang.Cursor; +import org.openjdk.jextract.clang.Type; + +import java.util.ArrayList; +import java.util.List; + +/** + * MemoryLayout computer for C structs. + */ +final class StructLayoutComputer extends RecordLayoutComputer { + private long offset; + private long actualSize = 0L; + // List to collect bitfield fields to process later, may be null + private List bitfieldDecls; + private long bitfieldSize; + + StructLayoutComputer(TypeMaker typeMaker, long offsetInParent, Type parent, Type type) { + super(typeMaker, parent, type); + this.offset = offsetInParent; + } + + @Override + void addField(long offset, Declaration declaration) { + if (bitfieldDecls != null) { + bitfieldDecls.add(declaration); + bitfieldSize += ((Declaration.Bitfield)declaration).width(); + } else { + super.addField(offset, declaration); + } + } + + @Override + void addPadding(long bits) { + if (bitfieldDecls == null) { + super.addPadding(bits); + } else { + bitfieldSize += bits; + } + } + + @Override + void startBitfield() { + /* + * In a struct, a bitfield field is seen after a non-bitfield. + * Initialize bitfieldLayouts list to collect this and subsequent + * bitfield layouts. + */ + if (bitfieldDecls == null) { + bitfieldDecls = new ArrayList<>(); + bitfieldSize = 0; + } + } + + @Override + void processField(Cursor c) { + boolean isBitfield = c.isBitField(); + long expectedOffset = offsetOf(parent, c); + if (offset > expectedOffset) { + // out-of-order field, skip + System.err.println("WARNING: ignoring field: " + c.spelling() + " in struct " + type.spelling()); + return; + } + if (expectedOffset > offset) { + addPadding(expectedOffset - offset); + actualSize += (expectedOffset - offset); + offset = expectedOffset; + } + + if (isBitfield) { + startBitfield(); + } else { // !isBitfield + /* + * We may be crossing from bit fields to non-bitfield field. + * + * struct Foo { + * int i:12; + * int j:20; + * int k; // <-- processing this + * int m; + * } + */ + handleBitfields(); + } + + addField(offset, parent, c); + long size = fieldSize(c); + offset += size; + actualSize += size; + } + + @Override + Declaration.Scoped finishRecord(String layoutName, String declName) { + // pad at the end, if any + long expectedSize = type.size() * 8; + if (actualSize < expectedSize) { + addPadding(expectedSize - actualSize); + } + + /* + * Handle bitfields at the end, if any. + * + * struct Foo { + * int i,j, k; + * int f:10; + * int pad:12; + * } + */ + handleBitfields(); + + GroupLayout g = MemoryLayout.structLayout(alignFields()); + checkSize(g); + g = g.withName(layoutName); + Declaration.Scoped declaration = Declaration.struct(TreeMaker.CursorPosition.of(cursor), declName, + g, fieldDecls.stream().toArray(Declaration[]::new)); + return declaration; + } + + // process bitfields if any and clear bitfield layouts + private void handleBitfields() { + if (bitfieldDecls != null) { + List prevBitfieldDecls = bitfieldDecls; + long prevBitfieldSize = bitfieldSize; + bitfieldDecls = null; + bitfieldSize = 0; + if (!prevBitfieldDecls.isEmpty()) { + addField(offset, bitfield(prevBitfieldDecls.toArray(new Declaration.Variable[0]))); + } + if (prevBitfieldSize > 0) { + if (prevBitfieldSize % 8 != 0) { + throw new IllegalStateException("Cannot get here: " + prevBitfieldSize); + } + fieldLayouts.add(MemoryLayout.paddingLayout(prevBitfieldSize / 8)); + } + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/ToplevelBuilder.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/ToplevelBuilder.java new file mode 100644 index 00000000..34086223 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/ToplevelBuilder.java @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; + +import javax.tools.JavaFileObject; +import java.lang.constant.ClassDesc; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +/** + * A helper class to generate header interface class in source form. + * After aggregating various constituents of a .java source, build + * method is called to get overall generated source string. + */ +class ToplevelBuilder extends JavaSourceBuilder { + + private int declCount; + private final List builders = new ArrayList<>(); + private SplitHeader lastHeader; + private int headersCount; + private final ClassDesc headerDesc; + + Constants constants; + + static final int DECLS_PER_HEADER_CLASS = Integer.getInteger("jextract.decls.per.header", 1000); + + ToplevelBuilder(String packageName, String headerClassName) { + this.headerDesc = ClassDesc.of(packageName, headerClassName); + SplitHeader first = lastHeader = new FirstHeader(headerClassName); + builders.add(first); + constants = new Constants(this); + first.classBegin(); + } + + public List toFiles() { + lastHeader.classEnd(); + List files = new ArrayList<>(); + files.addAll(builders.stream() + .flatMap(b -> b.toFiles().stream()).toList()); + files.addAll(constants.toFiles()); + return files; + } + + public String headerClassName() { + return headerDesc.displayName(); + } + + @Override + boolean isEnclosedBySameName(String name) { + return false; + } + + @Override + public String packageName() { + return headerDesc.packageName(); + } + + @Override + protected Constants constants() { + return constants; + } + + @Override + public void addVar(Declaration.Variable varTree, String javaName, + MemoryLayout layout, Optional fiName) { + nextHeader().addVar(varTree, javaName, layout, fiName); + } + + @Override + public void addFunction(Declaration.Function funcTree, FunctionDescriptor descriptor, + String javaName, List parameterNames) { + nextHeader().addFunction(funcTree, descriptor, javaName, parameterNames); + } + + @Override + public void addConstant(Declaration.Constant constantTree, String javaName, Class javaType) { + nextHeader().addConstant(constantTree, javaName, javaType); + } + + @Override + public void addTypedef(Declaration.Typedef typedefTree, String javaName, + String superClass, Type type) { + if (type instanceof Type.Primitive primitive) { + // primitive + nextHeader().emitPrimitiveTypedef(typedefTree, primitive, javaName); + } else if (((TypeImpl)type).isPointer()) { + // pointer typedef + nextHeader().emitPointerTypedef(typedefTree, javaName); + } else { + TypedefBuilder builder = new TypedefBuilder(this, typedefTree, javaName, superClass); + builders.add(builder); + builder.classBegin(); + builder.classEnd(); + } + } + + @Override + public StructBuilder addStruct(Declaration.Scoped tree, boolean isNestedAnonStruct, + String javaName, GroupLayout layout) { + StructBuilder structBuilder = new StructBuilder(this, tree, javaName, layout) { + @Override + boolean isClassFinal() { + return false; + } + + @Override + void emitConstructor() { + // None... + } + }; + builders.add(structBuilder); + return structBuilder; + } + + @Override + public void addFunctionalInterface(Type.Function funcType, String javaName, + FunctionDescriptor descriptor, Optional> parameterNames) { + FunctionalInterfaceBuilder builder = new FunctionalInterfaceBuilder(this, funcType, javaName, descriptor, parameterNames); + builders.add(builder); + builder.classBegin(); + builder.classEnd(); + } + + private SplitHeader nextHeader() { + if (declCount == DECLS_PER_HEADER_CLASS) { + boolean hasSuper = !(lastHeader instanceof FirstHeader); + SplitHeader headerFileBuilder = new SplitHeader(headerDesc.displayName() + "_" + ++headersCount, + hasSuper ? lastHeader.className() : null); + lastHeader.classEnd(); + headerFileBuilder.classBegin(); + builders.add(headerFileBuilder); + lastHeader = headerFileBuilder; + declCount = 1; + return headerFileBuilder; + } else { + declCount++; + return lastHeader; + } + } + + class SplitHeader extends HeaderFileBuilder { + SplitHeader(String name, String superclass) { + super(ToplevelBuilder.this, name, superclass); + } + + @Override + boolean isClassFinal() { + return false; + } + + @Override + void emitConstructor() { + // None... + } + } + + class FirstHeader extends SplitHeader { + + FirstHeader(String name) { + super(name, "#{SUPER}"); + } + + @Override + void classBegin() { + super.classBegin(); + // emit basic primitive types + emitPrimitiveTypedef(Type.primitive(Type.Primitive.Kind.Bool), "C_BOOL"); + emitPrimitiveTypedef(Type.primitive(Type.Primitive.Kind.Char), "C_CHAR"); + emitPrimitiveTypedef(Type.primitive(Type.Primitive.Kind.Short), "C_SHORT"); + emitPrimitiveTypedef(Type.primitive(Type.Primitive.Kind.Int), "C_INT"); + emitPrimitiveTypedef(Type.primitive(Type.Primitive.Kind.Long), "C_LONG"); + emitPrimitiveTypedef(Type.primitive(Type.Primitive.Kind.LongLong), "C_LONG_LONG"); + emitPrimitiveTypedef(Type.primitive(Type.Primitive.Kind.Float), "C_FLOAT"); + emitPrimitiveTypedef(Type.primitive(Type.Primitive.Kind.Double), "C_DOUBLE"); + emitPointerTypedef("C_POINTER"); + } + + @Override + String build() { + HeaderFileBuilder last = lastHeader; + return super.build().replace("extends #{SUPER}", + last != this ? "extends " + last.className() : ""); + } + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/TreeMaker.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/TreeMaker.java new file mode 100644 index 00000000..5f20a7fa --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/TreeMaker.java @@ -0,0 +1,344 @@ +/* + * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package org.openjdk.jextract.impl; + +import java.lang.constant.Constable; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Position; +import org.openjdk.jextract.Type; +import org.openjdk.jextract.clang.Cursor; +import org.openjdk.jextract.clang.CursorKind; +import org.openjdk.jextract.clang.CursorLanguage; +import org.openjdk.jextract.clang.LinkageKind; +import org.openjdk.jextract.clang.SourceLocation; + +class TreeMaker { + public TreeMaker() {} + + TypeMaker typeMaker = new TypeMaker(this); + + public void freeze() { + typeMaker.resolveTypeReferences(); + } + + Map> collectAttributes(Cursor c) { + Map> attributeMap = new HashMap<>(); + c.forEach(child -> { + if (child.isAttribute()) { + List attrs = attributeMap.computeIfAbsent(child.kind().name(), _unused -> new ArrayList<>()); + attrs.add(child.spelling()); + } + }); + return attributeMap; + } + + public Declaration createTree(Cursor c) { + Objects.requireNonNull(c); + CursorLanguage lang = c.language(); + LinkageKind linkage = c.linkage(); + + /* + * We detect non-C constructs to early exit with error for + * unsupported features. But libclang maps both C11's _Static_assert + * and C++11's static_assert to same CursorKind. But the language is + * set a C++ always. Because we want to allow C11's _Static_Assert, + * we allow that exception here. + */ + if (lang != CursorLanguage.C && lang != CursorLanguage.Invalid && + c.kind() != CursorKind.StaticAssert) { + throw new RuntimeException("Unsupported language: " + c.language()); + } + + // If we can clearly determine internal linkage, then filter it. + if (linkage == LinkageKind.Internal) { + return null; + } + + // filter inline functions + if (c.isFunctionInlined()) { + return null; + } + var rv = (DeclarationImpl) createTreeInternal(c); + return (rv == null) ? null : rv.withAttributes(collectAttributes(c)); + } + + private Declaration createTreeInternal(Cursor c) { + return switch (c.kind()) { + case EnumDecl -> createEnum(c); + case EnumConstantDecl -> createEnumConstant(c); + case FieldDecl -> createVar(c, Declaration.Variable.Kind.FIELD); + case ParmDecl -> createVar(c, Declaration.Variable.Kind.PARAMETER); + case FunctionDecl -> createFunction(c); + case StructDecl -> createRecord(c, Declaration.Scoped.Kind.STRUCT); + case UnionDecl -> createRecord(c, Declaration.Scoped.Kind.UNION); + case TypedefDecl -> createTypedef(c); + case VarDecl -> createVar(c, Declaration.Variable.Kind.GLOBAL); + default -> null; // skip + }; + } + + static class CursorPosition implements Position { + private final Cursor cursor; + private final Path path; + private final int line; + private final int column; + + private CursorPosition(Cursor cursor) { + this.cursor = cursor; + SourceLocation.Location loc = cursor.getSourceLocation().getFileLocation(); + this.path = loc.path(); + this.line = loc.line(); + this.column = loc.column(); + } + + static Position of(Cursor cursor) { + SourceLocation loc = cursor.getSourceLocation(); + if (loc == null) { + return NO_POSITION; + } + SourceLocation.Location sloc = loc.getFileLocation(); + if (sloc == null) { + return NO_POSITION; + } + return new CursorPosition(cursor); + } + + + @Override + public Path path() { + return path; + } + + @Override + public int line() { + return line; + } + + @Override + public int col() { + return column; + } + + public Cursor cursor() { + return cursor; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj instanceof Position pos) { + return Objects.equals(path, pos.path()) && + Objects.equals(line, pos.line()) && + Objects.equals(column, pos.col()); + } + return false; + } + + @Override + public int hashCode() { + return Objects.hash(path, line, column); + } + + @Override + public String toString() { + return PrettyPrinter.position(this); + } + } + + public Declaration.Function createFunction(Cursor c) { + checkCursor(c, CursorKind.FunctionDecl); + List params = new ArrayList<>(); + for (int i = 0 ; i < c.numberOfArgs() ; i++) { + params.add((Declaration.Variable)createTree(c.getArgument(i))); + } + Type type = toType(c); + Type funcType = canonicalType(type); + return Declaration.function(CursorPosition.of(c), c.spelling(), (Type.Function)funcType, + params.toArray(new Declaration.Variable[0])); + } + + public Declaration.Constant createMacro(Position pos, String name, Type type, Object value) { + return Declaration.constant(pos, name, value, type); + } + + public Declaration.Constant createEnumConstant(Cursor c) { + return Declaration.constant(CursorPosition.of(c), c.spelling(), c.getEnumConstantValue(), typeMaker.makeType(c.type())); + } + + public Declaration.Scoped createHeader(Cursor c, List decls) { + return Declaration.toplevel(CursorPosition.of(c), filterNestedDeclarations(decls).toArray(new Declaration[0])); + } + + public Declaration.Scoped createRecord(Cursor c, Declaration.Scoped.Kind scopeKind) { + Type.Declared t = (Type.Declared)RecordLayoutComputer.compute(typeMaker, 0, c.type(), c.type()); + if (c.isDefinition()) { + Declaration.Scoped scoped = t.tree(); + List decls = filterNestedDeclarations(scoped.members()); + //just a declaration AND definition, we have a layout + return Declaration.scoped(scoped.kind(), scoped.pos(), scoped.name(), + scoped.layout().get(), decls.toArray(new Declaration[0])); + } else { + //if there's a real definition somewhere else, skip this redundant declaration + if (!c.getDefinition().isInvalid()) { + return null; + } + return Declaration.scoped(scopeKind, CursorPosition.of(c), c.spelling()); + } + } + + public Declaration.Scoped createEnum(Cursor c) { + List allDecls = new ArrayList<>(); + c.forEach(child -> { + if (!child.isBitField() || (child.getBitFieldWidth() != 0 && !child.spelling().isEmpty())) { + allDecls.add(createTree(child)); + } + }); + List decls = filterNestedDeclarations(allDecls); + if (c.isDefinition()) { + //just a declaration AND definition, we have a layout + MemoryLayout layout = TypeMaker.valueLayoutForSize(c.type().size() * 8).layout().orElseThrow(); + return Declaration.enum_(CursorPosition.of(c), c.spelling(), layout, decls.toArray(new Declaration[0])); + } else { + return null; + } + } + + private static boolean isEnum(Declaration d) { + return d instanceof Declaration.Scoped scoped && + scoped.kind() == Declaration.Scoped.Kind.ENUM; + } + + private static boolean isBitfield(Declaration d) { + return d instanceof Declaration.Scoped scoped && + scoped.kind() == Declaration.Scoped.Kind.BITFIELDS; + } + + private static boolean isAnonymousStruct(Declaration declaration) { + return declaration.getAttribute("ANONYMOUS").isPresent(); + } + + private List filterNestedDeclarations(List declarations) { + return declarations.stream() + .filter(Objects::nonNull) + .filter(d -> isEnum(d) || !d.name().isEmpty() || isAnonymousStruct(d) || isBitfield(d)) + .collect(Collectors.toList()); + } + + private Declaration.Typedef createTypedef(Cursor c) { + Type cursorType = toType(c); + Type canonicalType = canonicalType(cursorType); + if (canonicalType instanceof Type.Declared declaredCanonicalType) { + Declaration.Scoped s = declaredCanonicalType.tree(); + if (s.name().equals(c.spelling())) { + // typedef record with the same name, no need to present twice + return null; + } + } + Type.Function funcType = null; + boolean isFuncPtrType = false; + if (canonicalType instanceof Type.Function canonicalFunctionType) { + funcType = canonicalFunctionType; + } else if (Utils.isPointerType(canonicalType)) { + Type pointeeType = null; + try { + pointeeType = ((Type.Delegated)canonicalType).type(); + } catch (NullPointerException npe) { + // exception thrown for unresolved pointee type. Ignore if we hit that case. + } + if (pointeeType instanceof Type.Function pointeeFunctionType) { + funcType = pointeeFunctionType; + isFuncPtrType = true; + } + } + if (funcType != null) { + List params = new ArrayList<>(); + c.forEach(child -> { + if (child.kind() == CursorKind.ParmDecl) { + params.add(createTree(child).name()); + } + }); + if (!params.isEmpty()) { + canonicalType = funcType.withParameterNames(params); + if (isFuncPtrType) { + canonicalType = new TypeImpl.PointerImpl(canonicalType); + } + } + } + return Declaration.typedef(CursorPosition.of(c), c.spelling(), canonicalType); + } + + private Type canonicalType(Type t) { + if (t instanceof Type.Delegated delegated && + delegated.kind() == Type.Delegated.Kind.TYPEDEF) { + return delegated.type(); + } else { + return t; + } + } + + private Declaration.Variable createVar(Cursor c, Declaration.Variable.Kind kind) { + if (c.isBitField()) throw new AssertionError("Cannot get here!"); + checkCursorAny(c, CursorKind.VarDecl, CursorKind.FieldDecl, CursorKind.ParmDecl); + Type type; + try { + type = toType(c); + } catch (TypeMaker.TypeException ex) { + System.err.println(ex); + System.err.println("WARNING: ignoring variable: " + c.spelling()); + return null; + } + return Declaration.var(kind, CursorPosition.of(c), c.spelling(), type); + } + + private Type toType(Cursor c) { + return typeMaker.makeType(c.type()); + } + + private void checkCursor(Cursor c, CursorKind k) { + if (c.kind() != k) { + throw new IllegalArgumentException("Invalid cursor kind"); + } + } + + private void checkCursorAny(Cursor c, CursorKind... kinds) { + CursorKind expected = Objects.requireNonNull(c.kind()); + for (CursorKind k : kinds) { + if (k == expected) { + return; + } + } + throw new IllegalArgumentException("Invalid cursor kind"); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/TreeTransformer.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/TreeTransformer.java new file mode 100644 index 00000000..745d3be0 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/TreeTransformer.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserveold. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import java.util.List; +import org.openjdk.jextract.Declaration; + +interface TreeTransformer { + Declaration.Scoped transform(Declaration.Scoped header); + + default Declaration.Scoped createHeader(Declaration.Scoped old, List members) { + return Declaration.toplevel(old.pos(), members.toArray(new Declaration[0])); + } + + default Declaration.Scoped createScoped(Declaration.Scoped old, List members) { + var declsArray = members.toArray(new Declaration[0]); + return old.layout().isEmpty() ? + Declaration.scoped(old.kind(), old.pos(), old.name(), declsArray) : + Declaration.scoped(old.kind(), old.pos(), old.name(), old.layout().get(), declsArray); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/TypeImpl.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/TypeImpl.java new file mode 100644 index 00000000..2dd584ca --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/TypeImpl.java @@ -0,0 +1,456 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.OptionalLong; +import java.util.function.Supplier; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.ValueLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; + +import static java.lang.foreign.ValueLayout.ADDRESS; + +public abstract class TypeImpl implements Type { + + public static final boolean IS_WINDOWS = System.getProperty("os.name").startsWith("Windows"); + + @Override + public boolean isErroneous() { + return false; + } + + static boolean equals(Type t1, Type.Delegated t2) { + assert t1 != null; + assert t2 != null; + + return (t2.kind() == Delegated.Kind.TYPEDEF) && t1.equals(t2.type()); + } + + public static final TypeImpl ERROR = new TypeImpl() { + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitType(this, data); + } + + @Override + public boolean isErroneous() { + return true; + } + }; + + public static final class PrimitiveImpl extends TypeImpl implements Type.Primitive { + + private final Primitive.Kind kind; + + public PrimitiveImpl(Kind kind) { + this.kind = Objects.requireNonNull(kind); + } + + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitPrimitive(this, data); + } + + @Override + public Kind kind() { + return kind; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Type.Primitive primitive)) { + return (o instanceof Delegated delegated) && equals(this, delegated); + } + return kind == primitive.kind(); + } + + @Override + public int hashCode() { + return Objects.hash(kind); + } + } + + static abstract class DelegatedBase extends TypeImpl implements Type.Delegated { + Delegated.Kind kind; + Optional name; + + DelegatedBase(Kind kind, Optional name) { + this.kind = Objects.requireNonNull(kind); + this.name = Objects.requireNonNull(name); + } + + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitDelegated(this, data); + } + + @Override + public final Delegated.Kind kind() { + return kind; + } + + @Override + public final Optional name() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Type.Delegated delegated)) { + return (o instanceof Type type) && equals(type, this); + } + return kind == delegated.kind() && + name.equals(delegated.name()); + } + + @Override + public int hashCode() { + return Objects.hash(kind, name); + } + } + + public static final class QualifiedImpl extends DelegatedBase { + private final Type type; + + public QualifiedImpl(Kind kind, Type type) { + this(kind, Optional.empty(), type); + } + + public QualifiedImpl(Kind kind, String name, Type type) { + this(kind, Optional.of(name), type); + } + + private QualifiedImpl(Kind kind, Optional name, Type type) { + super(kind, name); + this.type = type; + } + + @Override + public Type type() { + return type; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Type.Delegated qualified)) return false; + if (!super.equals(o)) { + return (o instanceof Delegated delegated) && equals(this, delegated); + } + return Objects.equals(type, qualified.type()); + } + + @Override + public int hashCode() { + return (kind() == Kind.TYPEDEF)? type().hashCode() : Objects.hash(super.hashCode(), type); + } + } + + public static final class PointerImpl extends DelegatedBase { + public static final AddressLayout POINTER_LAYOUT = ADDRESS + .withTargetLayout(MemoryLayout.sequenceLayout(ValueLayout.JAVA_BYTE)); + + private final Supplier pointeeFactory; + + public PointerImpl(Supplier pointeeFactory) { + super(Kind.POINTER, Optional.empty()); + this.pointeeFactory = Objects.requireNonNull(pointeeFactory); + } + + public PointerImpl(Type pointee) { + this(() -> pointee); + } + + @Override + public Type type() { + return pointeeFactory.get(); + } + } + + public static final class DeclaredImpl extends TypeImpl implements Type.Declared { + + private final Declaration.Scoped declaration; + + public DeclaredImpl(Declaration.Scoped declaration) { + super(); + this.declaration = Objects.requireNonNull(declaration); + } + + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitDeclared(this, data); + } + + @Override + public Declaration.Scoped tree() { + return declaration; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Type.Declared declared)) { + return (o instanceof Delegated delegated) && equals(this, delegated); + } + return declaration.equals(declared.tree()); + } + + @Override + public int hashCode() { + return Objects.hash(declaration); + } + } + + public static final class FunctionImpl extends TypeImpl implements Type.Function { + + private final boolean varargs; + private final List argtypes; + private final Type restype; + private final Optional> paramNames; + + public FunctionImpl(boolean varargs, List argtypes, Type restype, List paramNames) { + super(); + this.varargs = varargs; + this.argtypes = Objects.requireNonNull(argtypes); + this.restype = Objects.requireNonNull(restype); + this.paramNames = Optional.ofNullable(paramNames); + } + + public FunctionImpl(boolean varargs, List argtypes, Type restype) { + this(varargs, argtypes, restype, null); + } + + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitFunction(this, data); + } + + @Override + public boolean varargs() { + return varargs; + } + + @Override + public List argumentTypes() { + return argtypes; + } + + @Override + public Type returnType() { + return restype; + } + + @Override + public Type.Function withParameterNames(List paramNames) { + Objects.requireNonNull(paramNames); + return new FunctionImpl(varargs, argtypes, restype, paramNames); + } + + @Override + public Optional> parameterNames() { + return paramNames; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Type.Function function)) { + return (o instanceof Delegated delegated) && equals(this, delegated); + } + return varargs == function.varargs() && + argtypes.equals(function.argumentTypes()) && + restype.equals(function.returnType()); + } + + @Override + public int hashCode() { + return Objects.hash(varargs, argtypes, restype); + } + } + + public static final class ArrayImpl extends TypeImpl implements Type.Array { + + private final Kind kind; + private final OptionalLong elemCount; + private final Type elemType; + + public ArrayImpl(Kind kind, long count, Type elemType) { + this(kind, elemType, OptionalLong.of(count)); + } + + public ArrayImpl(Kind kind, Type elemType) { + this(kind, elemType, OptionalLong.empty()); + } + + private ArrayImpl(Kind kind, Type elemType, OptionalLong elemCount) { + super(); + this.kind = Objects.requireNonNull(kind); + this.elemCount = Objects.requireNonNull(elemCount); + this.elemType = Objects.requireNonNull(elemType); + } + + @Override + public R accept(Visitor visitor, D data) { + return visitor.visitArray(this, data); + } + + @Override + public OptionalLong elementCount() { + return elemCount; + } + + @Override + public Type elementType() { + return elemType; + } + + @Override + public Kind kind() { + return kind; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof Type.Array array)) { + return (o instanceof Delegated delegated) && equals(this, delegated); + } + return kind == array.kind() && + elemType.equals(array.elementType()); + } + + @Override + public int hashCode() { + return Objects.hash(kind, elemType); + } + } + + public boolean isPointer() { + return this instanceof Type.Delegated delegated && + delegated.kind() == Type.Delegated.Kind.POINTER; + } + + @Override + public String toString() { + return PrettyPrinter.type(this); + } + + // Utilities to fetch layouts/descriptor from types + + public static Optional getLayout(org.openjdk.jextract.Type t) { + try { + return Optional.of(getLayoutInternal(t)); + } catch (UnsupportedOperationException ex) { + return Optional.empty(); + } + } + + public static Optional getDescriptor(Function t) { + try { + MemoryLayout[] args = t.argumentTypes().stream() + .map(TypeImpl::getLayoutInternal) + .toArray(MemoryLayout[]::new); + Type retType = t.returnType(); + if (isVoidType(retType)) { + return Optional.of(FunctionDescriptor.ofVoid(args)); + } else { + return Optional.of(FunctionDescriptor.of(getLayoutInternal(retType), args)); + } + } catch (UnsupportedOperationException ex) { + return Optional.empty(); + } + } + + private static boolean isVoidType(org.openjdk.jextract.Type type) { + if (type instanceof org.openjdk.jextract.Type.Primitive pt) { + return pt.kind() == org.openjdk.jextract.Type.Primitive.Kind.Void; + } else if (type instanceof org.openjdk.jextract.Type.Delegated dt) { + return dt.kind() == org.openjdk.jextract.Type.Delegated.Kind.TYPEDEF? isVoidType(dt.type()) : false; + } + return false; + } + + public static MemoryLayout getLayoutInternal(org.openjdk.jextract.Type t) { + return t.accept(layoutMaker, null); + } + + private static org.openjdk.jextract.Type.Visitor layoutMaker = new org.openjdk.jextract.Type.Visitor<>() { + @Override + public MemoryLayout visitPrimitive(org.openjdk.jextract.Type.Primitive t, Void _ignored) { + return t.kind().layout().orElseThrow(UnsupportedOperationException::new); + } + + @Override + public MemoryLayout visitDelegated(org.openjdk.jextract.Type.Delegated t, Void _ignored) { + if (t.kind() == org.openjdk.jextract.Type.Delegated.Kind.POINTER) { + return PointerImpl.POINTER_LAYOUT; + } else { + return t.type().accept(this, null); + } + } + + @Override + public MemoryLayout visitFunction(org.openjdk.jextract.Type.Function t, Void _ignored) { + /* + * // pointer to function declared as function like this + * + * typedef void CB(int); + * void func(CB cb); + */ + return PointerImpl.POINTER_LAYOUT; + } + + @Override + public MemoryLayout visitDeclared(org.openjdk.jextract.Type.Declared t, Void _ignored) { + return t.tree().layout().orElseThrow(UnsupportedOperationException::new); + } + + @Override + public MemoryLayout visitArray(org.openjdk.jextract.Type.Array t, Void _ignored) { + MemoryLayout elem = t.elementType().accept(this, null); + if (t.elementCount().isPresent()) { + return MemoryLayout.sequenceLayout(t.elementCount().getAsLong(), elem); + } else { + return MemoryLayout.sequenceLayout(0, elem); + } + } + + @Override + public MemoryLayout visitType(org.openjdk.jextract.Type t, Void _ignored) { + throw new UnsupportedOperationException(); + } + }; +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/TypeMaker.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/TypeMaker.java new file mode 100644 index 00000000..f0b34153 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/TypeMaker.java @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import java.nio.ByteOrder; +import java.util.ArrayList; +import java.util.ConcurrentModificationException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Supplier; + +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; +import org.openjdk.jextract.Type.Delegated; +import org.openjdk.jextract.Type.Primitive; +import org.openjdk.jextract.clang.Cursor; +import org.openjdk.jextract.clang.TypeKind; + +class TypeMaker { + + TreeMaker treeMaker; + private final Map typeCache = new HashMap<>(); + private List unresolved = new ArrayList<>(); + + private class ClangTypeReference implements Supplier { + org.openjdk.jextract.clang.Type origin; + Type derived; + + private ClangTypeReference(org.openjdk.jextract.clang.Type origin) { + this.origin = origin; + derived = typeCache.get(origin); + } + + public boolean isUnresolved() { + return null == derived; + } + + public void resolve() { + derived = makeType(origin); + Objects.requireNonNull(derived, "Clang type cannot be resolved: " + origin.spelling()); + } + + public Type get() { + Objects.requireNonNull(derived, "Type is not yet resolved."); + return derived; + } + } + + private ClangTypeReference reference(org.openjdk.jextract.clang.Type type) { + ClangTypeReference ref = new ClangTypeReference(type); + if (ref.isUnresolved()) { + unresolved.add(ref); + } + return ref; + } + + public TypeMaker(TreeMaker treeMaker) { + this.treeMaker = treeMaker; + } + + /** + * Resolve all type references. This method should be called before discard clang cursors/types + */ + void resolveTypeReferences() { + List resolving = unresolved; + unresolved = new ArrayList<>(); + while (! resolving.isEmpty()) { + resolving.forEach(ClangTypeReference::resolve); + resolving = unresolved; + unresolved = new ArrayList<>(); + } + } + + Type makeType(org.openjdk.jextract.clang.Type t) { + Type rv = typeCache.get(t); + if (rv != null) { + return rv; + } + rv = makeTypeInternal(t); + if (null != rv && typeCache.put(t, rv) != null) { + throw new ConcurrentModificationException(); + } + return rv; + } + + static class TypeException extends RuntimeException { + static final long serialVersionUID = 1L; + + TypeException(String msg) { + super(msg); + } + } + + Type makeTypeInternal(org.openjdk.jextract.clang.Type t) { + switch(t.kind()) { + case Auto: + return makeType(t.canonicalType()); + case Void: + return Type.void_(); + case Char_S: + case Char_U: + return Type.primitive(Primitive.Kind.Char); + case Short: + return Type.primitive(Primitive.Kind.Short); + case Int: + return Type.primitive(Primitive.Kind.Int); + case Long: + return Type.primitive(Primitive.Kind.Long); + case LongLong: + return Type.primitive(Primitive.Kind.LongLong); + case SChar: { + Type chType = Type.primitive(Primitive.Kind.Char); + return Type.qualified(Delegated.Kind.SIGNED, chType); + } + case UShort: { + Type chType = Type.primitive(Primitive.Kind.Short); + return Type.qualified(Delegated.Kind.UNSIGNED, chType); + } + case UInt: { + Type chType = Type.primitive(Primitive.Kind.Int); + return Type.qualified(Delegated.Kind.UNSIGNED, chType); + } + case ULong: { + Type chType = Type.primitive(Primitive.Kind.Long); + return Type.qualified(Delegated.Kind.UNSIGNED, chType); + } + case ULongLong: { + Type chType = Type.primitive(Primitive.Kind.LongLong); + return Type.qualified(Delegated.Kind.UNSIGNED, chType); + } + case UChar: { + Type chType = Type.primitive(Primitive.Kind.Char); + return Type.qualified(Delegated.Kind.UNSIGNED, chType); + } + + case Bool: + return Type.primitive(Primitive.Kind.Bool); + case Double: + return Type.primitive(Primitive.Kind.Double); + case Float: + return Type.primitive(Primitive.Kind.Float); + case Unexposed: + case Elaborated: + org.openjdk.jextract.clang.Type canonical = t.canonicalType(); + if (canonical.equalType(t)) { + throw new TypeException("Unknown type with same canonical type: " + t.spelling()); + } + return makeType(canonical); + case ConstantArray: { + Type elem = makeType(t.getElementType()); + return Type.array(t.getNumberOfElements(), elem); + } + case IncompleteArray: { + Type elem = makeType(t.getElementType()); + return Type.array(elem); + } + case FunctionProto: + case FunctionNoProto: { + List args = new ArrayList<>(); + for (int i = 0; i < t.numberOfArgs(); i++) { + // argument could be function pointer declared locally + args.add(lowerFunctionType(t.argType(i))); + } + return Type.function(t.isVariadic(), lowerFunctionType(t.resultType()), args.toArray(new Type[0])); + } + case Enum: + case Record: { + return Type.declared((Declaration.Scoped) treeMaker.createTree(t.getDeclarationCursor())); + } + case BlockPointer: + case Pointer: { + // TODO: We can always erase type for macro evaluation, should we? + if (t.getPointeeType().kind() == TypeKind.FunctionProto) { + return new TypeImpl.PointerImpl(makeType(t.getPointeeType())); + } else { + return new TypeImpl.PointerImpl(reference(t.getPointeeType())); + } + } + case Typedef: { + Type __type = makeType(t.canonicalType()); + return Type.typedef(t.spelling(), __type); + } + case Complex: { + Type __type = makeType(t.getElementType()); + return Type.qualified(Delegated.Kind.COMPLEX, __type); + } + case Vector: { + Type __type = makeType(t.getElementType()); + return Type.vector(t.getNumberOfElements(), __type); + } + case WChar: //unsupported + return Type.primitive(Primitive.Kind.WChar); + case Char16: //unsupported + return Type.primitive(Primitive.Kind.Char16); + case Half: //unsupported + return Type.primitive(Primitive.Kind.HalfFloat); + case Int128: //unsupported + return Type.primitive(Primitive.Kind.Int128); + case LongDouble: //unsupported + return Type.primitive(Primitive.Kind.LongDouble); + case UInt128: { //unsupported + Type iType = Type.primitive(Primitive.Kind.Int128); + return Type.qualified(Delegated.Kind.UNSIGNED, iType); + } + case Atomic: { + Type aType = makeType(t.getValueType()); + return Type.qualified(Delegated.Kind.ATOMIC, aType); + } + default: + return TypeImpl.ERROR; + } + } + + private Type lowerFunctionType(org.openjdk.jextract.clang.Type t) { + Type t2 = makeType(t); + return t2.accept(lowerFunctionType, null); + } + + private Type.Visitor lowerFunctionType = new Type.Visitor<>() { + @Override + public Type visitArray(Type.Array t, Void aVoid) { + return Type.pointer(t.elementType()); + } + + @Override + public Type visitDelegated(Type.Delegated t, Void aVoid) { + if (t.kind() == Delegated.Kind.TYPEDEF && t.type() instanceof Type.Array array) { + return visitArray(array, aVoid); + } + return visitType(t, aVoid); + } + + @Override + public Type visitType(Type t, Void aVoid) { + return t; + } + }; + + public static Primitive.Kind valueLayoutForSize(long size) { + return switch ((int) size) { + case 8 -> Primitive.Kind.Char; + case 16 -> Primitive.Kind.Short; + case 32 -> Primitive.Kind.Int; + case 64 -> Primitive.Kind.LongLong; + default -> throw new IllegalStateException("Cannot infer container layout"); + }; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/TypedefBuilder.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/TypedefBuilder.java new file mode 100644 index 00000000..eae83b00 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/TypedefBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; + +public class TypedefBuilder extends ClassSourceBuilder { + private final Declaration.Typedef typedefTree; + private final String superClass; + + public TypedefBuilder(JavaSourceBuilder enclosing, + Declaration.Typedef typedefTree, String name, String superClass) { + super(enclosing, Kind.CLASS, name); + this.typedefTree = typedefTree; + this.superClass = superClass; + } + + @Override + String superClass() { + return superClass; + } + + @Override + void classDeclBegin() { + emitDocComment(typedefTree); + } + + @Override + JavaSourceBuilder classEnd() { + return super.classEnd(); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/UnionLayoutComputer.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/UnionLayoutComputer.java new file mode 100644 index 00000000..2d01f8fb --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/UnionLayoutComputer.java @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.clang.Cursor; +import org.openjdk.jextract.clang.Type; +import org.openjdk.jextract.clang.TypeKind; + +import java.util.List; + +/** + * MemoryLayout computer for C unions. + */ +final class UnionLayoutComputer extends RecordLayoutComputer { + private final long offset; + private long actualSize = 0L; + + UnionLayoutComputer(TypeMaker typeMaker, long offsetInParent, Type parent, Type type) { + super(typeMaker, parent, type); + this.offset = offsetInParent; + } + + @Override + void processField(Cursor c) { + long expectedOffset = offsetOf(parent, c); + if (expectedOffset > offset) { + throw new IllegalStateException("No padding in union elements!"); + } + + addField(offset, parent, c); + actualSize = Math.max(actualSize, fieldSize(c)); + } + + @Override + void startBitfield() { + // do nothing + } + + @Override + Declaration field(long offset, Cursor c) { + if (c.isBitField()) { + Declaration.Variable var = (Declaration.Variable)super.field(offset, c); + return bitfield(var); + } else { + return super.field(offset, c); + } + } + + @Override + long fieldSize(Cursor c) { + if (c.type().kind() == TypeKind.IncompleteArray) { + return 0; + } else if (c.isBitField()) { + return c.getBitFieldWidth(); + } else { + return c.type().size() * 8; + } + } + + @Override + Declaration.Scoped finishRecord(String layoutName, String declName) { + // size mismatch indicates use of bitfields in union + long expectedSize = type.size() * 8; + if (actualSize < expectedSize) { + // emit an extra padding of expected size to make sure union layout size is computed correctly + addPadding(expectedSize); + } + + GroupLayout g = MemoryLayout.unionLayout(alignFields()); + checkSize(g); + g = g.withName(layoutName); + return Declaration.union(TreeMaker.CursorPosition.of(cursor), declName, g, fieldDecls.stream().toArray(Declaration[]::new)); + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/UnsupportedLayouts.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/UnsupportedLayouts.java new file mode 100644 index 00000000..aed7f50e --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/UnsupportedLayouts.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package org.openjdk.jextract.impl; + +import java.lang.foreign.MemoryLayout; +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; + +import java.nio.ByteOrder; + +/* + * Layouts for the primitive types not supported by ABI implementations. + */ +public final class UnsupportedLayouts { + private UnsupportedLayouts() {} + + public static final MemoryLayout __INT128 = makeUnsupportedLayout(16, "__int128"); + + public static final MemoryLayout LONG_DOUBLE = makeUnsupportedLayout(16, "long double"); + + public static final MemoryLayout _FLOAT128 = makeUnsupportedLayout(16, "_float128"); + + public static final MemoryLayout __FP16 = makeUnsupportedLayout(2, "__fp16"); + + public static final MemoryLayout CHAR16 = makeUnsupportedLayout(2, "char16"); + + public static final MemoryLayout WCHAR_T = makeUnsupportedLayout(2, "wchar_t"); + + static String firstUnsupportedType(Type type) { + return type.accept(unsupportedVisitor, null); + } + + private static MemoryLayout makeUnsupportedLayout(long size, String name) { + return MemoryLayout.paddingLayout(size).withByteAlignment(size).withName(name); + } + + static Type.Visitor unsupportedVisitor = new Type.Visitor<>() { + @Override + public String visitPrimitive(Type.Primitive t, Void unused) { + MemoryLayout layout = t.kind().layout().orElse(MemoryLayout.paddingLayout(8)); + if (layout.equals(__INT128) || layout.equals(LONG_DOUBLE) || layout.equals(_FLOAT128) || layout.equals(__FP16)) { + return layout.name().get(); + } else { + return null; + } + } + + @Override + public String visitFunction(Type.Function t, Void unused) { + for (Type arg : t.argumentTypes()) { + String unsupported = firstUnsupportedType(arg); + if (unsupported != null) { + return unsupported; + } + } + String unsupported = firstUnsupportedType(t.returnType()); + if (unsupported != null) { + return unsupported; + } + return null; + } + + @Override + public String visitDeclared(Type.Declared t, Void unused) { + for (Declaration d : t.tree().members()) { + if (d instanceof Declaration.Variable variable) { + String unsupported = firstUnsupportedType(variable.type()); + if (unsupported != null) { + return unsupported; + } + } + } + return null; + } + + @Override + public String visitDelegated(Type.Delegated t, Void unused) { + return t.kind() != Type.Delegated.Kind.POINTER ? + firstUnsupportedType(t.type()) : + null; + //in principle we should always do this: + // return firstUnsupportedType(t.type()); + // but if we do that, we might end up with infinite recursion (because of pointer types). + // Unsupported pointer types (e.g. *long double) are not detected, but they are not problematic layout-wise + // (e.g. they are always 32- or 64-bits, depending on the platform). + } + + @Override + public String visitArray(Type.Array t, Void unused) { + return firstUnsupportedType(t.elementType()); + } + + @Override + public String visitType(Type t, Void unused) { + return null; + } + }; +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/Utils.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/Utils.java new file mode 100644 index 00000000..cb2a9b5d --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/Utils.java @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import org.openjdk.jextract.Declaration; +import org.openjdk.jextract.Type; +import org.openjdk.jextract.Type.Delegated; +import org.openjdk.jextract.Type.Function; +import org.openjdk.jextract.clang.Cursor; +import org.openjdk.jextract.clang.CursorKind; + +import javax.tools.JavaFileObject; +import javax.tools.SimpleJavaFileObject; +import java.lang.foreign.MemoryLayout; +import java.io.IOException; +import java.net.URI; + +/** + * General utility functions + */ +class Utils { + private static URI fileName(String pkgName, String clsName, String extension) { + String pkgPrefix = pkgName.isEmpty() ? "" : pkgName.replaceAll("\\.", "/") + "/"; + return URI.create(pkgPrefix + clsName + extension); + } + + static JavaFileObject fileFromString(String pkgName, String clsName, String contents) { + return new SimpleJavaFileObject(fileName(pkgName, clsName, ".java"), JavaFileObject.Kind.SOURCE) { + @Override + public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException { + return contents; + } + }; + } + + static boolean isFlattenable(Cursor c) { + return c.isAnonymousStruct() || c.kind() == CursorKind.FieldDecl; + } + + /* + * FIXME: when we add jdk.compiler dependency from jdk.jextract module, revisit + * the following. The following methods 'quote', 'quote' and 'isPrintableAscii' + * are from javac source. See also com.sun.tools.javac.util.Convert.java. + */ + + /** + * Escapes each character in a string that has an escape sequence or + * is non-printable ASCII. Leaves non-ASCII characters alone. + */ + static String quote(String s) { + StringBuilder buf = new StringBuilder(); + for (int i = 0; i < s.length(); i++) { + buf.append(quote(s.charAt(i))); + } + return buf.toString(); + } + + /** + * Escapes a character if it has an escape sequence or is + * non-printable ASCII. Leaves non-ASCII characters alone. + */ + static String quote(char ch) { + switch (ch) { + case '\b': return "\\b"; + case '\f': return "\\f"; + case '\n': return "\\n"; + case '\r': return "\\r"; + case '\t': return "\\t"; + case '\'': return "\\'"; + case '\"': return "\\\""; + case '\\': return "\\\\"; + default: + return (isPrintableAscii(ch)) + ? String.valueOf(ch) + : String.format("\\u%04x", (int) ch); + } + } + + /** + * Returns the type that should be used in declarations of various + * memory layout implementations. + *

+ * For example, the concrete layout implementation class {@code OfLongImpl} should be + * declared as {@code OfLong} and not {@code OfLongImpl}. + * + * @param layout to generate a declaring type string for. + * @return the unqualified type + */ + static Class layoutDeclarationType(MemoryLayout layout) { + if (!layout.getClass().isInterface()) { + Class ifs[] = layout.getClass().getInterfaces(); + if (ifs.length != 1) { + throw new IllegalStateException("The class" + layout.getClass() + " does not implement exactly one interface"); + } + return ifs[0]; + } + return layout.getClass(); + } + + static boolean isStructOrUnion(Declaration.Scoped scoped) { + return switch (scoped.kind()) { + case STRUCT, UNION -> true; + default -> false; + }; + } + + static boolean isPointerType(Type type) { + if (type instanceof Delegated delegated) { + return delegated.kind() == Delegated.Kind.POINTER; + } else { + return false; + } + } + + static Function getAsFunctionPointer(Type type) { + if (type instanceof Function function) { + /* + * // pointer to function declared as function like this + * + * typedef void CB(int); + * void func(CB cb); + */ + return function; + } else if (isPointerType(type)) { + return getAsFunctionPointer(((Delegated)type).type()); + } else { + return null; + } + } + + static Type.Primitive getAsSignedOrUnsigned(Type type) { + if (type instanceof Type.Delegated delegated && + delegated.type() instanceof Type.Primitive primitive) { + var kind = delegated.kind(); + if (kind == Type.Delegated.Kind.SIGNED || + kind == Type.Delegated.Kind.UNSIGNED) { + return primitive; + } + } + return null; + } + + /** + * Is a character printable ASCII? + */ + private static boolean isPrintableAscii(char ch) { + return ch >= ' ' && ch <= '~'; + } +} diff --git a/klang/jextract/src/main/java/org/openjdk/jextract/impl/Writer.java b/klang/jextract/src/main/java/org/openjdk/jextract/impl/Writer.java new file mode 100644 index 00000000..63945149 --- /dev/null +++ b/klang/jextract/src/main/java/org/openjdk/jextract/impl/Writer.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package org.openjdk.jextract.impl; + +import javax.tools.JavaFileObject; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.stream.Collectors; + +public final class Writer { + private final List files; + private final Path dest; + + public Writer(Path dest, List files) { + this.files = files; + this.dest = dest; + } + + private List ensureSourcesCompiled() { + List sources = sources(); + if (sources.isEmpty()) { + return List.of(); + } else { + return InMemoryJavaCompiler.compile(sources, + "--enable-preview", + "--source", "21", + "-d", dest.toAbsolutePath().toString(), + "-cp", dest.toAbsolutePath().toString()); + } + } + + public void writeAll(boolean compileSources) throws IOException { + writeClassFiles(resources()); + writeClassFiles(classes()); + if (compileSources) { + writeClassFiles(ensureSourcesCompiled()); + } else { + writeSourceFiles(); + } + } + + void writeClassFiles(List files) throws IOException { + Path destDir = createOutputDir(); + for (var entry : files) { + String path = entry.getName(); + Path fullPath = destDir.resolve(path).normalize(); + Files.createDirectories(fullPath.getParent()); + try (InputStream is = entry.openInputStream()) { + Files.write(fullPath, is.readAllBytes()); + } + } + } + + void writeSourceFiles() throws IOException { + Path destDir = createOutputDir(); + for (var entry : sources()) { + String srcPath = entry.getName(); + Path fullPath = destDir.resolve(srcPath).normalize(); + Path dir = fullPath.getParent(); + // In case the folder exist and is a link to a folder, this should be OK + // Case in point, /tmp on MacOS link to /private/tmp + if (Files.exists(dir)) { + if (!Files.isDirectory(dir)) { + throw new FileAlreadyExistsException(dir.toAbsolutePath().toString()); + } + } else { + Files.createDirectories(fullPath.getParent()); + } + Files.write(fullPath, List.of(entry.getCharContent(false))); + } + } + + private List sources() { + return files.stream() + .filter(jfo -> jfo.getKind() == JavaFileObject.Kind.SOURCE) + .collect(Collectors.toList()); + } + + private List classes() { + return files.stream() + .filter(jfo -> jfo.getKind() == JavaFileObject.Kind.CLASS) + .collect(Collectors.toList()); + } + + private List resources() { + return files.stream() + .filter(jfo -> (jfo.getKind() == JavaFileObject.Kind.HTML || jfo.getKind() == JavaFileObject.Kind.OTHER)) + .collect(Collectors.toList()); + } + + private Path createOutputDir() throws IOException { + Path absDest = dest.toAbsolutePath(); + if (!Files.exists(absDest)) { + Files.createDirectories(absDest); + } + if (!Files.isDirectory(absDest)) { + throw new IOException("Not a directory: " + dest); + } + return absDest; + } +} diff --git a/klang/jextract/src/main/kotlin/klang/test.kt b/klang/jextract/src/main/kotlin/klang/test.kt new file mode 100644 index 00000000..120cc9d9 --- /dev/null +++ b/klang/jextract/src/main/kotlin/klang/test.kt @@ -0,0 +1,31 @@ +package klang + +import org.openjdk.jextract.Declaration +import org.openjdk.jextract.impl.Parser +import java.io.IOException +import java.io.UncheckedIOException +import java.nio.file.Files +import java.nio.file.Path +import java.util.stream.Collectors +import java.util.stream.Stream + +fun parse(headers: List, vararg parserOptions: String?): Declaration.Scoped { + val source = if (headers.size > 1) generateTmpSource(headers) else headers.iterator().next()!! + return Parser().parse(source, Stream.of(*parserOptions).collect(Collectors.toList())) +} + +private fun generateTmpSource(headers: List): Path { + check(headers.size > 1) + try { + val tmpFile = Files.createTempFile("jextract", ".h") + tmpFile.toFile().deleteOnExit() + Files.write( + tmpFile, headers.stream().map + { src: Path -> "#include \"$src\"" }.collect + (Collectors.toList()) + ) + return tmpFile + } catch (ioExp: IOException) { + throw UncheckedIOException(ioExp) + } +} diff --git a/klang/jextract/src/main/resources/org/openjdk/jextract/impl/resources/C-X.java.template b/klang/jextract/src/main/resources/org/openjdk/jextract/impl/resources/C-X.java.template new file mode 100644 index 00000000..618631a2 --- /dev/null +++ b/klang/jextract/src/main/resources/org/openjdk/jextract/impl/resources/C-X.java.template @@ -0,0 +1,59 @@ +// Generated by jextract + +import java.lang.invoke.VarHandle; +import java.lang.foreign.MemoryAccess; +import java.lang.foreign.MemoryAddress; +import java.lang.foreign.MemoryCopy; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import static java.lang.foreign.CLinker.*; + +public class C-X { + C-X() {} + + public static MemorySegment allocate(SegmentAllocator allocator) { + return allocator.allocate(LAYOUT); + } + + public static MemorySegment allocate(${CARRIER} val, SegmentAllocator allocator) { + MemorySegment segment = allocator.allocate(LAYOUT); + MemoryAccess.set${CAPITALIZED_CARRIER}AtOffset(segment, 0, val); + return segment; + } + + public static MemorySegment allocateArray(long size, SegmentAllocator allocator) { + return allocator.allocateArray(LAYOUT, size); + } + + public static MemorySegment allocateArray(${CARRIER}[] values, SegmentAllocator allocator) { + MemorySegment segment = allocator.allocateArray(LAYOUT, values.length); + MemoryCopy.copyFromArray(values, 0, values.length, segment, 0); + return segment; + } + + public static ${CARRIER} get(MemorySegment segment, long offset) { + return MemoryAccess.get${CAPITALIZED_CARRIER}AtOffset(segment, offset); + } + + public static void set(MemorySegment segment, long offset, ${CARRIER} value) { + MemoryAccess.set${CAPITALIZED_CARRIER}AtOffset(segment, offset, value); + } + + public static long sizeof() { + return LAYOUT.byteSize(); + } + + public static ${CARRIER}[] toJavaArray(MemorySegment seg) { + var segSize = seg.byteSize(); + var elemSize = sizeof(); + if (segSize % elemSize != 0) { + throw new UnsupportedOperationException("segment cannot contain integral number of elements"); + } + ${CARRIER}[] array = new ${CARRIER}[(int) (segSize / elemSize)]; + MemoryCopy.copyToArray(seg, 0, array, 0, array.length); + return array; + } + + public static final MemoryLayout LAYOUT = ${LAYOUT}; +} diff --git a/klang/jextract/src/main/resources/org/openjdk/jextract/impl/resources/Messages.properties b/klang/jextract/src/main/resources/org/openjdk/jextract/impl/resources/Messages.properties new file mode 100644 index 00000000..4200f600 --- /dev/null +++ b/klang/jextract/src/main/resources/org/openjdk/jextract/impl/resources/Messages.properties @@ -0,0 +1,74 @@ +# +# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +# error message +argfile.read.error=reading @argfile failed: {0} +cannot.read.header.file=cannot read header file: {0} +not.a.file=not a file: {0} +l.option.value.invalid=option value for -l option should be a name or an absolute path: {0} + +# help messages for options +help.I=specify include files path +help.include-constant=name of macro or enum constant to include +help.include-var=name of global variable to include +help.include-function=name of function to include +help.include-typedef=name of type definition to include +help.include-struct=name of struct definition to include +help.include-union=name of union definition to include +help.D=define a C preprocessor macro +help.dump-includes=dump included symbols into specified file +help.h=print help +help.header-class-name=name of the header class +help.l=specify a library +help.output=specify the directory to place generated files +help.source=generate java sources +help.t=target package for specified header files +help.version=print version information and exit +help.non.option=header file +jextract.usage=\ +Usage: jextract

\n\ + \n\ +Option Description \n\ +------ ----------- \n\ +-?, -h, --help print help \n\ +-D --define-macro = define to (or 1 if omitted) \n\ +-I, --include-dir add directory to the end of the list of include search paths \n\ +--dump-includes dump included symbols into specified file \n\ +--header-class-name name of the generated header class. If this option is not \n\ +\ specified, then header class name is derived from the header\n\ +\ file name. For example, class "foo_h" for header "foo.h". \n\ +--include-function name of function to include \n\ +--include-constant name of macro or enum constant to include \n\ +--include-struct name of struct definition to include \n\ +--include-typedef name of type definition to include \n\ +--include-union name of union definition to include \n\ +--include-var name of global variable to include \n\ +-l, --library specify a library by platform-independent name (e.g. "GL") \n\ +\ or by absolute path ("/usr/lib/libGL.so") that will be \n\ +\ loaded by the generated class. \n\ +--output specify the directory to place generated files. If this \n\ +\ option is not specified, then current directory is used. \n\ +--source generate java sources \n\ +-t, --target-package target package name for the generated classes. If this option\n\ +\ is not specified, then unnamed package is used. \n\ +--version print version information and exit \n diff --git a/klang/jextract/src/main/resources/org/openjdk/jextract/impl/resources/RuntimeHelper.java.template b/klang/jextract/src/main/resources/org/openjdk/jextract/impl/resources/RuntimeHelper.java.template new file mode 100644 index 00000000..46ebed91 --- /dev/null +++ b/klang/jextract/src/main/resources/org/openjdk/jextract/impl/resources/RuntimeHelper.java.template @@ -0,0 +1,244 @@ +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + #LOAD_LIBRARIES# + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (MemorySegment.class.isAssignableFrom(c)) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/klang/klang/.gitignore b/klang/klang/.gitignore index c5ba95e5..584c5af5 100644 --- a/klang/klang/.gitignore +++ b/klang/klang/.gitignore @@ -41,3 +41,8 @@ bin/ ### Mac OS ### .DS_Store /*.log + + +## use to integration ## +/src/test/c/SDL2/ +/src/test/c/c/ diff --git a/klang/klang/build.gradle.kts b/klang/klang/build.gradle.kts index 66dc772c..ccaa959e 100644 --- a/klang/klang/build.gradle.kts +++ b/klang/klang/build.gradle.kts @@ -1,8 +1,9 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestLogEvent +import java.util.* tasks.test { - useJUnitPlatform() + useJUnitPlatform() maxHeapSize = "4g" minHeapSize = "512m" @@ -13,8 +14,6 @@ tasks.test { showStackTraces = true showStandardStreams = true } - - exclude("klang/parser/libclang/**") } dependencies { @@ -23,9 +22,20 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0") implementation("io.github.microutils:kotlin-logging:1.7.4") implementation("org.slf4j:slf4j-simple:1.7.26") - api(project(":libclang")) + api(project(":jextract")) implementation(libs.arrow.core) implementation(libs.arrow.fx.coroutines) api(libs.kotlinpoet) testImplementation(libs.kotest) } + +tasks.withType().configureEach { + options.compilerArgs.add("--enable-preview") +} + +tasks.withType().configureEach { + jvmArgs( + "--enable-preview", + "--enable-native-access=ALL-UNNAMED" + ) +} diff --git a/klang/klang/src/main/kotlin/klang/CDefaultDeclaration.kt b/klang/klang/src/main/kotlin/klang/CDefaultDeclaration.kt index b65a86d4..0fc0de9c 100644 --- a/klang/klang/src/main/kotlin/klang/CDefaultDeclaration.kt +++ b/klang/klang/src/main/kotlin/klang/CDefaultDeclaration.kt @@ -1,11 +1,13 @@ package klang import klang.domain.FixeSizeType +import klang.domain.NotBlankString import klang.domain.PlatformDependantSizeType import klang.domain.VoidType fun DeclarationRepository.insertCDefaultDeclaration() { save(VoidType) + save(PlatformDependantSizeType(32..64, NotBlankString("size_t"))) byteType.forEach { save(FixeSizeType(8, it)) } shortType.forEach { save(FixeSizeType(16, it)) } intType.forEach { save(FixeSizeType(32, it)) } @@ -16,27 +18,34 @@ fun DeclarationRepository.insertCDefaultDeclaration() { charType.forEach { save(PlatformDependantSizeType(16..32, it)) } } - // 8 bits private val byteType = listOf("char", "unsigned char", "uint16_t", "int16_t") + .map { NotBlankString(it) } // 16 bits private val shortType = listOf("short", "unsigned short", "uint8_t", "int8_t") + .map { NotBlankString(it) } // 32 bits private val intType = listOf("int", "unsigned int", "uint32_t", "int32_t") + .map { NotBlankString(it) } // 32 to 64 bits private val longType = listOf("long", "unsigned long") + .map { NotBlankString(it) } // 32 to 64 bits private val charType = listOf("wchar_t") + .map { NotBlankString(it) } // 64 bits private val int64Type = listOf("uint64_t", "int64_t") + .map { NotBlankString(it) } // 32 bits private val floatType = listOf("float") + .map { NotBlankString(it) } // 64 bits -private val doubleType = listOf("double") \ No newline at end of file +private val doubleType = listOf("double") + .map { NotBlankString(it) } \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/DeclarationRepository.kt b/klang/klang/src/main/kotlin/klang/DeclarationRepository.kt index 2fad793d..dd161250 100644 --- a/klang/klang/src/main/kotlin/klang/DeclarationRepository.kt +++ b/klang/klang/src/main/kotlin/klang/DeclarationRepository.kt @@ -2,32 +2,75 @@ package klang import klang.domain.* +val libraryDeclarationsFilter: (ResolvableDeclaration) -> Boolean = { resolvableDeclaration -> + when (resolvableDeclaration) { + is SourceableDeclaration -> (resolvableDeclaration.source is DeclarationOrigin.LibraryHeader) + else -> false + } +} + +val allDeclarationsFilter: (ResolvableDeclaration) -> Boolean = { _ -> true } + +/** + * The DeclarationRepository interface represents a repository for native declarations From C headers so far. + */ interface DeclarationRepository { + /** + * Set of native C/C++ or Objective-C declarations. + */ val declarations: Set + /** + * Saves the given [declaration] in the DeclarationRepository. + * Some native declaration support merging, if the definition exist, they will be merged + * + * @param declaration The nameable declaration to be saved. + */ fun save(declaration: NameableDeclaration) + + /** + * Remove all declaration of the DeclarationRepository. + */ fun clear() fun update(nativeEnumeration: NativeDeclaration, provider: () -> NativeDeclaration): NativeDeclaration - fun resolveTypes() + fun resolveTypes(filter: (ResolvableDeclaration) -> Boolean = libraryDeclarationsFilter) + fun resolveAllTypes() = resolveTypes(allDeclarationsFilter) - fun findEnumerationByName(name: String) = findDeclarationByName(name) + fun findConstantByName(name: String) = findConstantByName(NotBlankString(name)) + fun findConstantByName(name: NotBlankString) = findDeclarationByName>(name) - fun findStructureByName(name: String) = findDeclarationByName(name) + fun findEnumerationByName(name: String) = findEnumerationByName(NotBlankString(name)) + fun findEnumerationByName(name: NotBlankString) = findDeclarationByName(name) - fun findFunctionByName(name: String) = findDeclarationByName(name) + fun findStructureByName(name: String) = findStructureByName(NotBlankString(name)) + fun findStructureByName(name: NotBlankString) = findDeclarationByName(name) - fun findTypeAliasByName(name: String) = findDeclarationByName(name) + fun findFunctionByName(name: String) = findFunctionByName(NotBlankString(name)) + fun findFunctionByName(name: NotBlankString) = findDeclarationByName(name) - fun findObjectiveCClassByName(name: String) = findDeclarationByName(name) + fun findTypeAliasByName(name: String) = findTypeAliasByName(NotBlankString(name)) + fun findTypeAliasByName(name: NotBlankString) = findDeclarationByName(name) - fun findObjectiveCProtocolByName(name: String) = findDeclarationByName(name) + fun findObjectiveCClassByName(name: String) = findObjectiveCClassByName(NotBlankString(name)) + fun findObjectiveCClassByName(name: NotBlankString) = findDeclarationByName(name) - fun findObjectiveCCategoryByName(name: String) = findDeclarationByName(name) + fun findObjectiveCProtocolByName(name: String) = findObjectiveCProtocolByName(NotBlankString(name)) + fun findObjectiveCProtocolByName(name: NotBlankString) = findDeclarationByName(name) + fun findObjectiveCCategoryByName(name: String) = findObjectiveCCategoryByName(NotBlankString(name)) + fun findObjectiveCCategoryByName(name: NotBlankString) = findDeclarationByName(name) + + fun findLibraryDeclaration() = declarations.asSequence() + .filterIsInstance() + .filter { it.source is DeclarationOrigin.LibraryHeader } + .toList() } -inline fun DeclarationRepository.findDeclarationByName(declarationName: String) = declarations + +inline fun DeclarationRepository.findDeclarationByName(declarationName: String) = findDeclarationByName(NotBlankString(declarationName)) + +inline fun DeclarationRepository.findDeclarationByName(declarationName: NotBlankString) = declarations .asSequence() .filterIsInstance() .firstOrNull { it.name == declarationName } \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/InMemoryDeclarationRepository.kt b/klang/klang/src/main/kotlin/klang/InMemoryDeclarationRepository.kt index 8573f420..0d146394 100644 --- a/klang/klang/src/main/kotlin/klang/InMemoryDeclarationRepository.kt +++ b/klang/klang/src/main/kotlin/klang/InMemoryDeclarationRepository.kt @@ -49,10 +49,11 @@ class InMemoryDeclarationRepository : DeclarationRepository { } - override fun resolveTypes() { + override fun resolveTypes(filter: (ResolvableDeclaration) -> Boolean) { nativeDeclarations .asSequence() .filterIsInstance() + .filter(filter) .forEach { with(it) { resolve() } } } } \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/ObjectiveCDefaultDeclarations.kt b/klang/klang/src/main/kotlin/klang/ObjectiveCDefaultDeclarations.kt index 24019236..660e4664 100644 --- a/klang/klang/src/main/kotlin/klang/ObjectiveCDefaultDeclarations.kt +++ b/klang/klang/src/main/kotlin/klang/ObjectiveCDefaultDeclarations.kt @@ -1,32 +1,33 @@ package klang +import klang.domain.DeclarationOrigin import klang.domain.NameableDeclaration -import klang.domain.NativeDeclaration +import klang.domain.NotBlankString import klang.domain.ObjectiveCProtocol object ObjectiveCRootClass: NameableDeclaration { - override val name: String = "NSObject" - + override val name: NotBlankString = NotBlankString("NSObject") + override val source: DeclarationOrigin = DeclarationOrigin.Platform } fun DeclarationRepository.insertObjectiveCDefaultDeclaration() { save(ObjectiveCRootClass) // TODO: insert default declarations with correct method - save(ObjectiveCProtocol("NSSecureCoding", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSXPCProxyCreating", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSLocking", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSProgressReporting", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSStream", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSProxy", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSXMLNode", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSClassDescription", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSUserScriptTask", setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSSecureCoding"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSXPCProxyCreating"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSLocking"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSProgressReporting"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSStream"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSProxy"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSXMLNode"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSClassDescription"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSUserScriptTask"), setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSScanner", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSOrderedSet", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSMutableOrderedSet", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSProcessInfo", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSXMLParser", setOf(), listOf(), listOf())) - save(ObjectiveCProtocol("NSProtocolChecker", setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSScanner"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSOrderedSet"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSMutableOrderedSet"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSProcessInfo"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSXMLParser"), setOf(), listOf(), listOf())) + save(ObjectiveCProtocol(NotBlankString("NSProtocolChecker"), setOf(), listOf(), listOf())) } \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/domain/NativeConstant.kt b/klang/klang/src/main/kotlin/klang/domain/NativeConstant.kt new file mode 100644 index 00000000..ba122a14 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/domain/NativeConstant.kt @@ -0,0 +1,16 @@ +package klang.domain + +import kotlin.reflect.KClass + +val acceptableConstantType = listOf>(String::class, Double::class, Long::class) + +data class NativeConstant( + override val name: NotBlankString, + val value: T, + override val source: DeclarationOrigin = DeclarationOrigin.Unknown +) : NameableDeclaration { + + init { + check(value::class in acceptableConstantType) { "${value::class} not supported on constant type"} + } +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/domain/NativeDeclaration.kt b/klang/klang/src/main/kotlin/klang/domain/NativeDeclaration.kt index 9a457026..48129021 100644 --- a/klang/klang/src/main/kotlin/klang/domain/NativeDeclaration.kt +++ b/klang/klang/src/main/kotlin/klang/domain/NativeDeclaration.kt @@ -5,6 +5,9 @@ import mu.KotlinLogging private val logger = KotlinLogging.logger {} +/** + * This sealed interface represents a native C/C++ or Objective-C declaration. + */ sealed interface NativeDeclaration { fun merge(other: T) { logger.debug { "merging $this with $other is not relevant" } @@ -30,10 +33,40 @@ sealed interface NativeDeclaration { } } -interface NameableDeclaration : NativeDeclaration { - val name: String +/** + * This interface represents a nameable declaration. + */ +interface NameableDeclaration : SourceableDeclaration { + val name: NotBlankString } interface ResolvableDeclaration { fun DeclarationRepository.resolve() +} + +/** + * Represents the origin of a native declaration. + */ +sealed interface DeclarationOrigin { + + /** + * Represents an unknown origin of a native declaration. + */ + object Unknown : DeclarationOrigin + + /** + * Represents a platform-specific declaration like libc. + */ + object Platform : DeclarationOrigin + + /** + * Represents a header file used for native declarations in a library. + * + * @property file The path to the header file. + */ + class LibraryHeader(val file: String) : DeclarationOrigin +} + +interface SourceableDeclaration : NativeDeclaration { + val source: DeclarationOrigin } \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/domain/NativeEnumeration.kt b/klang/klang/src/main/kotlin/klang/domain/NativeEnumeration.kt index 539379cf..ef289eb2 100644 --- a/klang/klang/src/main/kotlin/klang/domain/NativeEnumeration.kt +++ b/klang/klang/src/main/kotlin/klang/domain/NativeEnumeration.kt @@ -5,10 +5,11 @@ import klang.DeclarationRepository val AnonymousEnumeration = "AnonymousEnumeration" data class NativeEnumeration( - override val name: String, + override val name: NotBlankString, var values: List> = emptyList(), //TODO add support for other types - var type: TypeRef = typeOf("int").unchecked("Type 'int' not found") + var type: TypeRef = typeOf("int").unchecked("Type 'int' not found"), + override val source: DeclarationOrigin = DeclarationOrigin.Unknown ) : NameableDeclaration, ResolvableDeclaration { override fun merge(other: T) { diff --git a/klang/klang/src/main/kotlin/klang/domain/NativeFunction.kt b/klang/klang/src/main/kotlin/klang/domain/NativeFunction.kt index cdb91cc8..21d196d0 100644 --- a/klang/klang/src/main/kotlin/klang/domain/NativeFunction.kt +++ b/klang/klang/src/main/kotlin/klang/domain/NativeFunction.kt @@ -3,13 +3,14 @@ package klang.domain import klang.DeclarationRepository data class NativeFunction( - override val name: String, + override val name: NotBlankString, var returnType: TypeRef, - val arguments: List + val arguments: List, + override val source: DeclarationOrigin = DeclarationOrigin.Unknown ): NameableDeclaration, NativeDeclaration, ResolvableDeclaration { data class Argument( - val name: String?, + val name: NotBlankString?, var type: TypeRef ) : ResolvableDeclaration { diff --git a/klang/klang/src/main/kotlin/klang/domain/NativeStructure.kt b/klang/klang/src/main/kotlin/klang/domain/NativeStructure.kt index 3c859b36..991d68d9 100644 --- a/klang/klang/src/main/kotlin/klang/domain/NativeStructure.kt +++ b/klang/klang/src/main/kotlin/klang/domain/NativeStructure.kt @@ -2,22 +2,45 @@ package klang.domain import klang.DeclarationRepository -data class NativeStructure( - override val name: String, - var fields: List> = listOf(), - var isUnion: Boolean = false, -): NameableDeclaration, ResolvableDeclaration { +/** + * Interface representing a field in the native structure, + * which can be either a TypeRef or a NativeStructure + */ +sealed interface StructureField { + val name: String +} + +data class TypeRefField(override val name: String, val type: TypeRef) : StructureField +data class SubStructureField(override val name: String, val structure: NativeStructure) : StructureField +/** + * Represents a native structure declaration. + * + * @property name The name of the structure + * @property fields The list of fields in the structure, each represented by a StructureField + * @property isUnion Indicates whether the structure is a union + */ +data class NativeStructure( + override val name: NotBlankString, + var fields: List = listOf(), + var isUnion: Boolean = false, + override val source: DeclarationOrigin = DeclarationOrigin.Unknown, +) : NameableDeclaration, ResolvableDeclaration { override fun merge(other: T) { if (other is NativeStructure) { - fields += other.fields + fields = other.fields } else super.merge(other) } override fun DeclarationRepository.resolve() { - fields = fields.map { (name, type) -> - (name to with(type) { resolveType() }) - .also { (_, typeRef) -> resolve(typeRef) } + fields = fields.map { field -> + when (field) { + is TypeRefField -> TypeRefField(field.name, with(field.type) { resolveType() }) + .also { resolve(it.type) } + + is SubStructureField -> SubStructureField(field.name, field.structure) + .also { with(it.structure) { resolve() } } + } } } } diff --git a/klang/klang/src/main/kotlin/klang/domain/NativeTypeAlias.kt b/klang/klang/src/main/kotlin/klang/domain/NativeTypeAlias.kt index d59308bb..f93f5ad5 100644 --- a/klang/klang/src/main/kotlin/klang/domain/NativeTypeAlias.kt +++ b/klang/klang/src/main/kotlin/klang/domain/NativeTypeAlias.kt @@ -3,12 +3,15 @@ package klang.domain import klang.DeclarationRepository data class NativeTypeAlias( - override val name: String, - var typeRef: TypeRef + override val name: NotBlankString, + var typeRef: TypeRef, + override val source: DeclarationOrigin = DeclarationOrigin.Unknown ) :NameableDeclaration, NativeDeclaration, ResolvableDeclaration { override fun DeclarationRepository.resolve() { - typeRef = with(typeRef) { resolveType() } + if (typeRef is UnresolvedTypeRef) { + typeRef = with(typeRef) { resolveType() } + } typeRef.resolveIfFunctionPointerType(this) } diff --git a/klang/klang/src/main/kotlin/klang/domain/NativeVariable.kt b/klang/klang/src/main/kotlin/klang/domain/NativeVariable.kt index e770d20b..a1a0a82c 100644 --- a/klang/klang/src/main/kotlin/klang/domain/NativeVariable.kt +++ b/klang/klang/src/main/kotlin/klang/domain/NativeVariable.kt @@ -1,3 +1,7 @@ package klang.domain -data class NativeVariable(override val name: String, val type: String): NameableDeclaration, NativeDeclaration \ No newline at end of file +data class NativeVariable( + override val name: NotBlankString, + val type: String, + override val source: DeclarationOrigin +): NameableDeclaration, NativeDeclaration \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/domain/NotBlankString.kt b/klang/klang/src/main/kotlin/klang/domain/NotBlankString.kt new file mode 100644 index 00000000..ef46f499 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/domain/NotBlankString.kt @@ -0,0 +1,19 @@ +package klang.domain + +fun notBlankString(value: String) = value.takeIf(String::isNotBlank) + ?.let { NotBlankString(value) } + +@JvmInline +value class NotBlankString(val value: String) : Comparable by value, CharSequence by value { + + init { + check(value.isNotBlank()) { + error("value cannot be blank") + } + } + + override fun toString(): String { + return value + } + +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/domain/ObjectiveCCategory.kt b/klang/klang/src/main/kotlin/klang/domain/ObjectiveCCategory.kt index 8935eb61..ab2f242e 100644 --- a/klang/klang/src/main/kotlin/klang/domain/ObjectiveCCategory.kt +++ b/klang/klang/src/main/kotlin/klang/domain/ObjectiveCCategory.kt @@ -5,9 +5,10 @@ import klang.DeclarationRepository internal val AnonymousCategoryName = "AnonymousCategory" data class ObjectiveCCategory( - override val name: String, + override val name: NotBlankString, var superType: TypeRef, - val methods: List + val methods: List, + override val source: DeclarationOrigin = DeclarationOrigin.Unknown ) : NameableDeclaration, ResolvableDeclaration { override fun DeclarationRepository.resolve() { diff --git a/klang/klang/src/main/kotlin/klang/domain/ObjectiveCClass.kt b/klang/klang/src/main/kotlin/klang/domain/ObjectiveCClass.kt index 9397a29e..adbbbe4c 100644 --- a/klang/klang/src/main/kotlin/klang/domain/ObjectiveCClass.kt +++ b/klang/klang/src/main/kotlin/klang/domain/ObjectiveCClass.kt @@ -3,28 +3,31 @@ package klang.domain import klang.DeclarationRepository data class ObjectiveCClass( - override val name: String, + override val name: NotBlankString, var superType: TypeRef?, var protocols: Set, var properties: List, var methods: List, - var categories: Set = setOf() + var categories: Set = setOf(), + override val source: DeclarationOrigin = DeclarationOrigin.Unknown ) : NameableDeclaration, ResolvableDeclaration { data class Property( - override val name: String, + override val name: NotBlankString, val type: String, val assign: Boolean? = null, val readwrite: Boolean? = null, val nonatomic: Boolean? = null, - val unsafe_unretained: Boolean? = null + val unsafe_unretained: Boolean? = null, + override val source: DeclarationOrigin= DeclarationOrigin.Unknown ) : NameableDeclaration data class Method( - override val name: String, + override val name: NotBlankString, var returnType: TypeRef, val instance: Boolean, - val arguments: List = listOf() + val arguments: List = listOf(), + override val source: DeclarationOrigin = DeclarationOrigin.Unknown ) : NameableDeclaration, ResolvableDeclaration { data class Argument( val name: String, @@ -58,7 +61,7 @@ data class ObjectiveCClass( categories = declarations .asSequence() .filterIsInstance() - .filter { it.superType.referenceAsString == name } + .filter { it.superType.referenceAsString == name.value } .toSet() methods.forEach { with(it) { resolve() } } diff --git a/klang/klang/src/main/kotlin/klang/domain/ObjectiveCProtocol.kt b/klang/klang/src/main/kotlin/klang/domain/ObjectiveCProtocol.kt index f500105b..44e4c779 100644 --- a/klang/klang/src/main/kotlin/klang/domain/ObjectiveCProtocol.kt +++ b/klang/klang/src/main/kotlin/klang/domain/ObjectiveCProtocol.kt @@ -1,8 +1,9 @@ package klang.domain data class ObjectiveCProtocol( - override val name: String, + override val name: NotBlankString, val protocols: Set, var properties: List, - var methods: List + var methods: List, + override val source: DeclarationOrigin = DeclarationOrigin.Unknown ) : NameableDeclaration \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/domain/PrimitiveType.kt b/klang/klang/src/main/kotlin/klang/domain/PrimitiveType.kt index b53d6e8b..a2e091f8 100644 --- a/klang/klang/src/main/kotlin/klang/domain/PrimitiveType.kt +++ b/klang/klang/src/main/kotlin/klang/domain/PrimitiveType.kt @@ -3,14 +3,16 @@ package klang.domain sealed class PrimitiveType: NameableDeclaration data object VoidType: PrimitiveType() { - override val name: String = "void" + override val name: NotBlankString = NotBlankString("void") + override val source: DeclarationOrigin = DeclarationOrigin.Platform } -class FixeSizeType(val size: Int, override val name: String, val isFloating: Boolean = false): PrimitiveType() -class PlatformDependantSizeType(val size: IntRange, override val name: String): PrimitiveType() +class FixeSizeType(val size: Int, override val name: NotBlankString, val isFloating: Boolean = false, override val source: DeclarationOrigin = DeclarationOrigin.Platform): PrimitiveType() +class PlatformDependantSizeType(val size: IntRange, override val name: NotBlankString, override val source: DeclarationOrigin = DeclarationOrigin.Platform): PrimitiveType() data object StringType: PrimitiveType() { - override val name: String = "char *" + override val name: NotBlankString = NotBlankString("char *") + override val source: DeclarationOrigin = DeclarationOrigin.Platform } diff --git a/klang/klang/src/main/kotlin/klang/domain/TypeRef.kt b/klang/klang/src/main/kotlin/klang/domain/TypeRef.kt index fbdade40..e495b260 100644 --- a/klang/klang/src/main/kotlin/klang/domain/TypeRef.kt +++ b/klang/klang/src/main/kotlin/klang/domain/TypeRef.kt @@ -9,7 +9,8 @@ import mu.KotlinLogging private val logger = KotlinLogging.logger {} -fun Either.unchecked(message: String = "unchecked Either lead to error") = getOrNull() ?: error(message) +fun Either.unchecked(message: String = "unchecked Either lead to error") = getOrNull() + ?: error(message) fun typeOf(reference: String): Either = either { var isArray = false @@ -81,7 +82,7 @@ fun typeOf(reference: String): Either = either { } UnresolvedTypeRef( reference, - typeName, + NotBlankString(typeName), isConstant, isPointer, isStructure, @@ -98,7 +99,7 @@ fun typeOf(reference: String): Either = either { sealed interface TypeRef { val referenceAsString: String - val typeName: String + val typeName: NotBlankString val isConstant: Boolean val isPointer: Boolean val isStructure: Boolean @@ -111,8 +112,9 @@ sealed interface TypeRef { val isCallback: Boolean fun DeclarationRepository.resolveType(): TypeRef = when { + this@TypeRef is ResolvedTypeRef -> this@TypeRef isCallback -> ResolvedTypeRef(this@TypeRef, typeName.toFunctionPointerType()) - isPointer && typeName == "char" -> ResolvedTypeRef(this@TypeRef, StringType) + isPointer && typeName == NotBlankString("char") -> ResolvedTypeRef(this@TypeRef, StringType) else -> findDeclarationByName(typeName) ?.let { ResolvedTypeRef(this@TypeRef, it) } ?: (this@TypeRef.also { logger.warn { "fail to resolve type : $it" } }) @@ -120,10 +122,10 @@ sealed interface TypeRef { } -internal fun String.toFunctionPointerType(): FunctionPointerType { - val returnType = substringBefore("(").let { typeOf(it).unchecked() } +internal fun NotBlankString.toFunctionPointerType(): FunctionPointerType { + val returnType = value.substringBefore("(").let { typeOf(it).unchecked() } - val arguments = substringAfter("(*)") + val arguments = value.substringAfter("(*)") .replace("(", "") .replace(")", "") .split(",") @@ -137,17 +139,17 @@ internal fun String.toFunctionPointerType(): FunctionPointerType { class UnresolvedTypeRef internal constructor( override val referenceAsString: String, - override val typeName: String, - override val isConstant: Boolean, - override val isPointer: Boolean, - override val isStructure: Boolean, - override val isEnumeration: Boolean, - override val isNullable: Boolean?, - override val isVolatile: Boolean, - override val isUnion: Boolean, - override val isCallback: Boolean, - override var isArray: Boolean, - override var arraySize: Int?, + override val typeName: NotBlankString, + override val isConstant: Boolean = false, + override val isPointer: Boolean = false, + override val isStructure: Boolean = false, + override val isEnumeration: Boolean = false, + override val isNullable: Boolean? = null, + override val isVolatile: Boolean = false, + override val isUnion: Boolean = false, + override val isCallback: Boolean = false, + override var isArray: Boolean = false, + override var arraySize: Int? = null, ) : TypeRef { override fun toString() = "UnresolvedType($typeName from declaration $referenceAsString)" @@ -159,6 +161,7 @@ class UnresolvedTypeRef internal constructor( override fun hashCode(): Int { return typeName.hashCode() } + } class ResolvedTypeRef internal constructor(private val typeRef: TypeRef, val type: NativeDeclaration) : diff --git a/klang/klang/src/main/kotlin/klang/generator/BindingGenerator.kt b/klang/klang/src/main/kotlin/klang/generator/BindingGenerator.kt new file mode 100644 index 00000000..e79f3b86 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/generator/BindingGenerator.kt @@ -0,0 +1,17 @@ +package klang.generator + +import klang.DeclarationRepository +import java.io.File + +interface BindingGenerator { + + /** + * Generates Kotlin files based on the given declaration repository. + * + * @param outputDirectory The directory where the Kotlin files will be generated. + * @param basePackage The base package name for the generated Kotlin classes. + * @param libraryName The name of the library. + */ + fun DeclarationRepository.generateKotlinFiles(outputDirectory: File, basePackage: String, libraryName: String): List + +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/generator/JnaBindingGenerator.kt b/klang/klang/src/main/kotlin/klang/generator/JnaBindingGenerator.kt new file mode 100644 index 00000000..d3a1f171 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/generator/JnaBindingGenerator.kt @@ -0,0 +1,41 @@ +package klang.generator + +import klang.DeclarationRepository +import klang.domain.* +import klang.generator.internal.jna.generateKotlinFile +import java.io.File + +object JnaBindingGenerator: BindingGenerator { + + override fun DeclarationRepository.generateKotlinFiles(outputDirectory: File, basePackage: String, libraryName: String): List { + + outputDirectory.deleteRecursively() + outputDirectory.mkdirs() + + val declarations = findLibraryDeclaration() + val files = mutableListOf() + + files += declarations + .filterIsInstance() + .generateKotlinFile(outputDirectory, basePackage) + + files += declarations + .filterIsInstance() + .generateKotlinFile(outputDirectory, basePackage, libraryName) + + files += declarations + .filterIsInstance() + .generateKotlinFile(outputDirectory, basePackage) + + files += declarations + .filterIsInstance() + .generateKotlinFile(outputDirectory, basePackage) + + files += declarations + .filterIsInstance>() + .generateKotlinFile(outputDirectory, basePackage) + + return files.toList() + } + +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/generator/NativeEnumeration.kt b/klang/klang/src/main/kotlin/klang/generator/NativeEnumeration.kt deleted file mode 100644 index 4d3f6d6c..00000000 --- a/klang/klang/src/main/kotlin/klang/generator/NativeEnumeration.kt +++ /dev/null @@ -1,16 +0,0 @@ -package klang.generator - -import com.squareup.kotlinpoet.FileSpec -import klang.domain.NativeEnumeration -import klang.mapper.toSpecAsEnumeration -import java.io.File - -fun List.generateKotlinFile(outputDirectory: File, packageName: String) { - - assert(outputDirectory.isDirectory) { "Output directory must be a directory" } - - FileSpec.builder(packageName, "Enumerations") - .also { builder -> forEach { builder.addType(it.toSpecAsEnumeration(packageName)) } } - .build() - .writeTo(outputDirectory) -} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/generator/NativeFunction.kt b/klang/klang/src/main/kotlin/klang/generator/NativeFunction.kt deleted file mode 100644 index 2e724753..00000000 --- a/klang/klang/src/main/kotlin/klang/generator/NativeFunction.kt +++ /dev/null @@ -1,20 +0,0 @@ -package klang.generator - -import com.squareup.kotlinpoet.FileSpec -import klang.domain.NativeFunction -import klang.mapper.generateInterfaceLibrarySpec -import klang.mapper.toInterfaceSpec -import java.io.File - -fun List.generateKotlinFile(outputDirectory: File, packageName: String, libraryName: String) { - - assert(outputDirectory.isDirectory) { "Output directory must be a directory" } - - val libraryInterfaceName = "${libraryName}Library" - - FileSpec.builder(packageName, "Functions") - .addProperty(generateInterfaceLibrarySpec(packageName, libraryInterfaceName, libraryName)) - .addType(toInterfaceSpec(packageName, libraryInterfaceName)) - .build() - .writeTo(outputDirectory) -} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/generator/TypeAlias.kt b/klang/klang/src/main/kotlin/klang/generator/TypeAlias.kt deleted file mode 100644 index 98263733..00000000 --- a/klang/klang/src/main/kotlin/klang/generator/TypeAlias.kt +++ /dev/null @@ -1,28 +0,0 @@ -package klang.generator - -import com.squareup.kotlinpoet.FileSpec -import com.squareup.kotlinpoet.TypeAliasSpec -import com.squareup.kotlinpoet.TypeSpec -import klang.domain.NativeTypeAlias -import klang.mapper.toSpec -import java.io.File - -fun List.generateKotlinFile(outputDirectory: File, packageName: String) { - - assert(outputDirectory.isDirectory) { "Output directory must be a directory" } - - FileSpec.builder(packageName, "TypeAlias") - .also { fileSpec -> - asSequence() - .map { typeAlias -> typeAlias.toSpec(packageName) } - .forEach { - when (it) { - is TypeAliasSpec -> fileSpec.addTypeAlias(it) - is TypeSpec -> fileSpec.addType(it) - } - } - } - .build() - .writeTo(outputDirectory) - -} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/generator/internal/jna/NativeConstant.kt b/klang/klang/src/main/kotlin/klang/generator/internal/jna/NativeConstant.kt new file mode 100644 index 00000000..48656fb4 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/generator/internal/jna/NativeConstant.kt @@ -0,0 +1,26 @@ +package klang.generator.internal.jna + +import com.squareup.kotlinpoet.FileSpec +import klang.domain.NativeConstant +import klang.generator.internal.jna.helper.getSourceFile +import klang.mapper.toSpec +import java.io.File + +private const val fileName = "Constants" + + +internal fun List>.generateKotlinFile(outputDirectory: File, packageName: String): File { + check(outputDirectory.isDirectory) { "Output directory must be a directory" } + getSpecBuilder(packageName) + .writeTo(outputDirectory) + + return outputDirectory.getSourceFile(fileName, packageName) +} + +private fun List>.getSpecBuilder(packageName: String): FileSpec { + return FileSpec.builder(packageName, fileName) + .also { builder -> forEach { builder.addProperty(it.toSpec(packageName)) } } + .build() +} + + diff --git a/klang/klang/src/main/kotlin/klang/generator/internal/jna/NativeEnumeration.kt b/klang/klang/src/main/kotlin/klang/generator/internal/jna/NativeEnumeration.kt new file mode 100644 index 00000000..58fc3545 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/generator/internal/jna/NativeEnumeration.kt @@ -0,0 +1,22 @@ +package klang.generator.internal.jna + +import com.squareup.kotlinpoet.FileSpec +import klang.domain.NativeEnumeration +import klang.generator.internal.jna.helper.getSourceFile +import klang.mapper.toSpecAsEnumeration +import java.io.File + +private const val fileName = "Enumerations" + +internal fun List.generateKotlinFile(outputDirectory: File, packageName: String): File { + + check(outputDirectory.isDirectory) { "Output directory must be a directory" } + + FileSpec.builder(packageName, fileName) + .also { builder -> forEach { builder.addType(it.toSpecAsEnumeration(packageName)) } } + .build() + .writeTo(outputDirectory) + + + return outputDirectory.getSourceFile(fileName, packageName) +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/generator/internal/jna/NativeFunction.kt b/klang/klang/src/main/kotlin/klang/generator/internal/jna/NativeFunction.kt new file mode 100644 index 00000000..6f228349 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/generator/internal/jna/NativeFunction.kt @@ -0,0 +1,28 @@ +package klang.generator.internal.jna + +import com.squareup.kotlinpoet.FileSpec +import klang.domain.NativeFunction +import klang.generator.internal.jna.helper.getSourceFile +import klang.mapper.generateInterfaceLibrarySpec +import klang.mapper.toFunctionsSpec +import klang.mapper.toInterfaceSpec +import java.io.File + +private const val fileName = "Functions" + +internal fun List.generateKotlinFile(outputDirectory: File, packageName: String, libraryName: String): File { + + check(outputDirectory.isDirectory) { "Output directory must be a directory" } + + val libraryInterfaceName = "${libraryName}Library" + + FileSpec.builder(packageName, fileName) + .addProperty(generateInterfaceLibrarySpec(packageName, libraryInterfaceName, libraryName)) + .addType(toInterfaceSpec(packageName, libraryInterfaceName)) + .also { builder -> toFunctionsSpec(packageName, "lib$libraryInterfaceName").forEach(builder::addFunction) } + .build() + .writeTo(outputDirectory) + + + return outputDirectory.getSourceFile(fileName, packageName) +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/generator/Structure.kt b/klang/klang/src/main/kotlin/klang/generator/internal/jna/Structure.kt similarity index 55% rename from klang/klang/src/main/kotlin/klang/generator/Structure.kt rename to klang/klang/src/main/kotlin/klang/generator/internal/jna/Structure.kt index fd51ddbd..8301faa6 100644 --- a/klang/klang/src/main/kotlin/klang/generator/Structure.kt +++ b/klang/klang/src/main/kotlin/klang/generator/internal/jna/Structure.kt @@ -1,19 +1,24 @@ -package klang.generator +package klang.generator.internal.jna import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.TypeSpec import klang.domain.NativeStructure +import klang.generator.internal.jna.helper.getSourceFile import klang.mapper.toSpec import java.io.File -fun List.generateKotlinFile(outputDirectory: File, packageName: String) { +private const val fileName = "Structures" - assert(outputDirectory.isDirectory) { "Output directory must be a directory" } +fun List.generateKotlinFile(outputDirectory: File, packageName: String): File { - FileSpec.builder(packageName, "Structures") + check(outputDirectory.isDirectory) { "Output directory must be a directory" } + + FileSpec.builder(packageName, fileName) .also { builder -> forEach { builder.addTypes(it.toSpec(packageName)) } } .build() .writeTo(outputDirectory) + + return outputDirectory.getSourceFile(fileName, packageName) } private fun FileSpec.Builder.addTypes(typeSpecs: List) = typeSpecs.forEach(::addType) diff --git a/klang/klang/src/main/kotlin/klang/generator/internal/jna/TypeAlias.kt b/klang/klang/src/main/kotlin/klang/generator/internal/jna/TypeAlias.kt new file mode 100644 index 00000000..9034e218 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/generator/internal/jna/TypeAlias.kt @@ -0,0 +1,36 @@ +package klang.generator.internal.jna + +import com.squareup.kotlinpoet.FileSpec +import com.squareup.kotlinpoet.TypeAliasSpec +import com.squareup.kotlinpoet.TypeSpec +import klang.domain.NativeTypeAlias +import klang.generator.internal.jna.helper.getSourceFile +import klang.mapper.toSpec +import java.io.File + +private const val fileName = "TypeAlias" + +internal fun List.generateKotlinFile(outputDirectory: File, packageName: String): File { + check(outputDirectory.isDirectory) { "Output directory must be a directory" } + + generateFileSpec(this, packageName) + .build() + .writeTo(outputDirectory) + + return outputDirectory.getSourceFile(fileName, packageName) +} + +private fun generateFileSpec(typeAliases: List, packageName: String): FileSpec.Builder { + return FileSpec.builder(packageName, fileName) + .apply { + typeAliases + .asSequence() + .flatMap { typeAlias -> typeAlias.toSpec(packageName) } + .forEach { + when (it) { + is TypeAliasSpec -> addTypeAlias(it) + is TypeSpec -> addType(it) + } + } + } +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/generator/internal/jna/helper/file.kt b/klang/klang/src/main/kotlin/klang/generator/internal/jna/helper/file.kt new file mode 100644 index 00000000..30f6539b --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/generator/internal/jna/helper/file.kt @@ -0,0 +1,17 @@ +package klang.generator.internal.jna.helper + +import java.io.File + +internal fun File.getSourceFile(fileName: String, packageName: String): File { + var outputDirectory = this + packageName.split(".").forEach { + outputDirectory = outputDirectory.resolve(it) + } + return outputDirectory.resolve(fileName.toKotlinFile()) +} + +private const val kotlinExtension = ".kt" + +private fun String.toKotlinFile(): String { + return "$this$kotlinExtension" +} diff --git a/klang/klang/src/main/kotlin/klang/helper/File.kt b/klang/klang/src/main/kotlin/klang/helper/File.kt new file mode 100644 index 00000000..923de962 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/helper/File.kt @@ -0,0 +1,22 @@ +package klang.helper + +import java.io.File + + +/** + * Checks if the file does not exist. + * + * @return true if the file does not exist, false otherwise. + */ +fun File.doesNotExists(): Boolean = exists().not() + +/** + * Checks if the given directory is empty. + * + * @return true if the directory is empty, false otherwise. + * @throws IllegalStateException if the file is not a directory. + */ +fun File.isDirectoryEmpty(): Boolean { + if (isDirectory.not()) error("$this is not a directory") + return listFiles()?.any() != true +} diff --git a/klang/klang/src/main/kotlin/klang/helper/HeaderManager.kt b/klang/klang/src/main/kotlin/klang/helper/HeaderManager.kt new file mode 100644 index 00000000..08849a42 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/helper/HeaderManager.kt @@ -0,0 +1,63 @@ +package klang.helper + +import OperatingSystem +import klang.domain.NotBlankString +import mu.KotlinLogging +import operatingSystem +import java.nio.file.Files +import java.nio.file.Path +import kotlin.io.path.ExperimentalPathApi +import kotlin.io.path.absolutePathString +import kotlin.io.path.deleteRecursively +import kotlin.io.path.exists + +object HeaderManager { + + private val logger = KotlinLogging.logger {} + + fun putPlatformHeaderAt(headerDirectoryPath: Path) { + + check(headerDirectoryPath.exists()) { "path ${headerDirectoryPath.absolutePathString()} does not exists" } + + val cHeadersFile = "/c-${inferPlatformSuffix()}-headers.zip" + unzipFromClasspath(cHeadersFile, headerDirectoryPath.toFile()) + + if (operatingSystem == OperatingSystem.MAC) { + val darwinHeaders = "/darwin-headers.zip" + unzipFromClasspath(darwinHeaders, headerDirectoryPath.toFile()) + } + + } + + fun listPlatformHeadersFromPath(headerDirectoryPath: Path) = when (operatingSystem) { + OperatingSystem.MAC -> arrayOf( + headerDirectoryPath.resolve("c").absolutePathString(), + headerDirectoryPath.resolve("darwin-headers").absolutePathString(), + ) + else -> arrayOf( + headerDirectoryPath.resolve("c").absolutePathString() + ) + } + + fun inferPlatformSuffix() = when (operatingSystem) { + OperatingSystem.MAC -> "darwin" + OperatingSystem.LINUX -> "linux" + else -> error("Operating system $operatingSystem not supported") + } + + fun createTemporaryHeaderDirectory(directoryName: String = "headers") = createTemporaryHeaderDirectory(NotBlankString(directoryName)) + .also { logger.info { "did create a temporary directory at ${it.absolutePathString()}" } } + + @OptIn(ExperimentalPathApi::class) + fun createTemporaryHeaderDirectory(directoryName: NotBlankString): Path = Files.createTempDirectory("headers") + .also(::deleteDirectoryOnShutdown) +} + +@OptIn(ExperimentalPathApi::class) +private fun deleteDirectoryOnShutdown(it: Path) { + Runtime.getRuntime().addShutdownHook(object : Thread() { + override fun run() { + it.deleteRecursively() + } + }) +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/helper/Platform.kt b/klang/klang/src/main/kotlin/klang/helper/Platform.kt new file mode 100644 index 00000000..8c35c7a2 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/helper/Platform.kt @@ -0,0 +1,27 @@ +import java.util.* + +/** + * Represents an operating system. + */ +enum class OperatingSystem { + LINUX, WINDOWS, MAC, UNKNOWN +} + +/** + * Lazily initializes and retrieves the operating system on which the code is running. + * The operating system is inferred from the value of the `os.name` system property. + * Supported operating systems are WINDOWS, LINUX, MAC, and UNKNOWN. + * + * @return The inferred operating system. + */ +val operatingSystem by lazy { inferOperatingSystem() } + +private fun inferOperatingSystem(): OperatingSystem { + val os = System.getProperty("os.name").lowercase(Locale.getDefault()) + return when { + os.contains("win") -> OperatingSystem.WINDOWS + os.contains("nix") || os.contains("nux") -> OperatingSystem.LINUX + os.contains("mac") -> OperatingSystem.MAC + else -> OperatingSystem.UNKNOWN + } +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/helper/Zip.kt b/klang/klang/src/main/kotlin/klang/helper/Zip.kt new file mode 100644 index 00000000..f4dfa595 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/helper/Zip.kt @@ -0,0 +1,57 @@ +package klang.helper + +import mu.KotlinLogging +import java.io.File +import java.io.FileInputStream +import java.io.InputStream +import java.util.zip.ZipInputStream + +private object ZipHelper + +private val logger = KotlinLogging.logger {} + +/** + * Unzips a file from the classpath to a target directory. + * + * @param sourceFile The name of the file to unzip from the classpath. + * @param targetPath The target directory to unzip the file to. + */ +fun unzipFromClasspath(sourceFile: String, targetPath: File) { + logger.info { "will unzip file $sourceFile to ${targetPath.absolutePath}" } + getResourceAsStream(sourceFile) + .decompress(targetPath) +} + +/** + * Unzips the source file to the specified target path. + * + * @param sourceFile The source file to unzip. + * @param targetPath The target path to unzip the source file to. + */ +fun unzip(sourceFile: File, targetPath: File) { + FileInputStream(sourceFile) + .decompress(targetPath) +} + +private fun getResourceAsStream(sourceFile: String) = ZipHelper::class.java.getResourceAsStream(sourceFile) + ?: error("$sourceFile not found on classpath") + +private fun InputStream.decompress(targetPath: File) { + targetPath.mkdirs() + + ZipInputStream(this).use { + generateSequence { it.nextEntry } + .forEach { entry -> + val file = File(targetPath, entry.name) + if (entry.isDirectory) { + file.mkdirs() + } else { + file.parentFile.mkdirs() + file.outputStream().use { output -> + it.copyTo(output) + } + } + } + } +} + diff --git a/klang/klang/src/main/kotlin/klang/mapper/Enumeration.kt b/klang/klang/src/main/kotlin/klang/mapper/Enumeration.kt index 48f08548..499e626a 100644 --- a/klang/klang/src/main/kotlin/klang/mapper/Enumeration.kt +++ b/klang/klang/src/main/kotlin/klang/mapper/Enumeration.kt @@ -3,7 +3,7 @@ package klang.mapper import com.squareup.kotlinpoet.* import klang.domain.NativeEnumeration -internal fun NativeEnumeration.toSpecAsEnumeration(packageName: String) = ClassName(packageName, name) +internal fun NativeEnumeration.toSpecAsEnumeration(packageName: String) = ClassName(packageName, name.value) .let { enumerationClass -> val valueType = type.toType(packageName) val valueName = "value" diff --git a/klang/klang/src/main/kotlin/klang/mapper/Function.kt b/klang/klang/src/main/kotlin/klang/mapper/Function.kt index cc12dde5..c1ed3774 100644 --- a/klang/klang/src/main/kotlin/klang/mapper/Function.kt +++ b/klang/klang/src/main/kotlin/klang/mapper/Function.kt @@ -2,6 +2,9 @@ package klang.mapper import com.squareup.kotlinpoet.* import klang.domain.NativeFunction +import klang.domain.NativeTypeAlias +import klang.domain.ResolvedTypeRef +import klang.domain.TypeRef internal fun generateInterfaceLibrarySpec(packageName: String, name: String, libraryName: String) = PropertySpec .builder("lib$name", ClassName(packageName, name)) @@ -12,18 +15,31 @@ internal fun List.toInterfaceSpec(packageName: String, name: Str .let { interfaceClass -> TypeSpec.interfaceBuilder(interfaceClass) .addSuperinterface(jnaLibrary) - .addFunctions(map { it.toSpec(packageName) }) + .addFunctions(map { it.toInterfaceFunSpec(packageName) }) .build() } -private fun NativeFunction.toSpec(packageName: String) = FunSpec - .builder(name) - .addModifiers(KModifier.PUBLIC, KModifier.ABSTRACT) - .returns(returnType.toType(packageName)) +internal fun List.toFunctionsSpec(packageName: String, libraryName: String) = map { + it.toInterfaceFunSpec(packageName) { + "return $libraryName.${it.name}(${it.arguments.mapIndexed { index, argument -> argument.name?.value ?: "parameter$index" }.joinToString(", ")})" + } + } + +private fun NativeFunction.toInterfaceFunSpec(packageName: String, bodyProvider: (() -> String)? = null) = FunSpec + .builder(name.value) + .addModifiers(if(bodyProvider == null) listOf(KModifier.PUBLIC, KModifier.ABSTRACT) else listOf(KModifier.PUBLIC)) + .returns(returnType.toType(packageName).copy(nullable = returnType.checkIfNullable())) .addParameters(arguments.mapIndexed { index, argument -> argument.toSpec(packageName, index) }) + .also { if(bodyProvider != null) it.addStatement(bodyProvider()) } .build() private fun NativeFunction.Argument.toSpec(packageName: String, index: Int) = ParameterSpec - .builder(name ?: "parameter$index", type.toType(packageName).copy(nullable = type.isNullable ?: true)) - .addKdoc("mapped from ${type.referenceAsString}") + .builder(name?.value ?: "parameter$index", type.toType(packageName).copy(nullable = type.checkIfNullable())) + //TODO find how to escape % + .addKdoc("mapped from ${type.referenceAsString.replace("%", "")}") .build() + + +private fun TypeRef.checkIfNullable() = isNullable ?: isPointer || checkIfNativeTypeAliasAndNullable() + +private fun TypeRef.checkIfNativeTypeAliasAndNullable(): Boolean = ((this as? ResolvedTypeRef)?.type as? NativeTypeAlias)?.typeRef?.checkIfNullable() ?: false \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/mapper/FunctionPointerType.kt b/klang/klang/src/main/kotlin/klang/mapper/FunctionPointerType.kt index 24f77e08..75c69bee 100644 --- a/klang/klang/src/main/kotlin/klang/mapper/FunctionPointerType.kt +++ b/klang/klang/src/main/kotlin/klang/mapper/FunctionPointerType.kt @@ -14,7 +14,7 @@ internal fun FunctionPointerType.toCallbackSpec(name: String, packageName: Strin .addModifiers(KModifier.ABSTRACT) .addParameters( arguments - .map { it.toType(packageName) } + .map { it.toType(packageName, fromFunction = true) } .mapIndexed { index, type -> ParameterSpec .builder("param${index + 1}", type) diff --git a/klang/klang/src/main/kotlin/klang/mapper/JnaDefinitions.kt b/klang/klang/src/main/kotlin/klang/mapper/JnaDefinitions.kt index d1c20d44..c4824ce4 100644 --- a/klang/klang/src/main/kotlin/klang/mapper/JnaDefinitions.kt +++ b/klang/klang/src/main/kotlin/klang/mapper/JnaDefinitions.kt @@ -3,6 +3,7 @@ package klang.mapper import com.squareup.kotlinpoet.ClassName internal val jnaPointer by lazy { ClassName("com.sun.jna", "Pointer") } +internal val jnaNullablePointer by lazy { jnaPointer.copy(nullable = true) } internal val jnaCallback by lazy { ClassName("com.sun.jna", "Callback") } internal val jnaStructure by lazy { ClassName("com.sun.jna", "Structure") } internal val jnaUnion by lazy { ClassName("com.sun.jna", "Union") } diff --git a/klang/klang/src/main/kotlin/klang/mapper/NativeConstant.kt b/klang/klang/src/main/kotlin/klang/mapper/NativeConstant.kt new file mode 100644 index 00000000..59affb09 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/mapper/NativeConstant.kt @@ -0,0 +1,17 @@ +package klang.mapper + +import com.squareup.kotlinpoet.PropertySpec +import klang.domain.NativeConstant + +internal fun NativeConstant<*>.toSpec(packageName: String) = PropertySpec.builder(name.toString(), value::class) + .initializer(when(value) { + is String -> "\"$value\"" + is Double -> value.toString() + is Long -> when (value) { + Long.MAX_VALUE -> "Long.MAX_VALUE" + Long.MIN_VALUE -> "Long.MIN_VALUE" + else -> "${value}L" + } + else -> error("unsupported constant type ${value::class} on code generation") + }) + .build() diff --git a/klang/klang/src/main/kotlin/klang/mapper/ObjectiveC.kt b/klang/klang/src/main/kotlin/klang/mapper/ObjectiveC.kt index 04a2c974..a8ad1f6a 100644 --- a/klang/klang/src/main/kotlin/klang/mapper/ObjectiveC.kt +++ b/klang/klang/src/main/kotlin/klang/mapper/ObjectiveC.kt @@ -1,10 +1,12 @@ package klang.mapper -import com.squareup.kotlinpoet.* -import klang.domain.NativeStructure +import com.squareup.kotlinpoet.ClassName +import com.squareup.kotlinpoet.FunSpec +import com.squareup.kotlinpoet.ParameterSpec +import com.squareup.kotlinpoet.TypeSpec import klang.domain.ObjectiveCClass -internal fun ObjectiveCClass.toSpec() = ClassName("", name) +internal fun ObjectiveCClass.toSpec() = ClassName("", name.value) .let { structureClass -> TypeSpec.classBuilder(structureClass) .superclass(nsobjectDefinition) diff --git a/klang/klang/src/main/kotlin/klang/mapper/Structure.kt b/klang/klang/src/main/kotlin/klang/mapper/Structure.kt index af995d9a..791f5224 100644 --- a/klang/klang/src/main/kotlin/klang/mapper/Structure.kt +++ b/klang/klang/src/main/kotlin/klang/mapper/Structure.kt @@ -3,7 +3,7 @@ package klang.mapper import com.squareup.kotlinpoet.* import klang.domain.* -internal fun NativeStructure.toSpec(packageName: String) = ClassName("", name) +internal fun NativeStructure.toSpec(packageName: String) = ClassName("", name.value) .let { structureClass -> generateFunctionPointerTypeInterface(packageName) + when { fields.isEmpty() -> toSpecWithNoAttributes(structureClass) @@ -13,7 +13,10 @@ internal fun NativeStructure.toSpec(packageName: String) = ClassName("", name) } private fun NativeStructure.generateFunctionPointerTypeInterface(packageName: String) = fields - .mapNotNull { it.toFunctionPointerTypeInterface(packageName, name) } + //TODO support SubStructureField + .filterIsInstance() + .map { it.name to it.type } + .mapNotNull { it.toFunctionPointerTypeInterface(packageName, name.value) } private fun Pair.toFunctionPointerTypeInterface(packageName: String, structureName: String) = let { (fieldName, typeRef) -> @@ -52,7 +55,11 @@ private fun NativeStructure.toUnionSpec(packageName: String, structureClass: Cla .build() ) .apply { - fields.forEach { (name, typeRef) -> + fields + //TODO support SubStructureField + .filterIsInstance() + .map { it.name to it.type } + .forEach { (name, typeRef) -> addProperty( propertySpec(name, typeRef, packageName) ) @@ -72,7 +79,13 @@ private fun NativeStructure.toSpecWithAttributes(packageName: String, structureC TypeSpec.classBuilder(structureClass) .addAnnotation( AnnotationSpec.builder(jnaFieldOrder) - .addMember(fields.joinToString(", ") { "\"${it.first}\"" }) + .addMember( + fields + //TODO support SubStructureField + .filterIsInstance() + .map { it.name to it.type } + .joinToString(", ") { "\"${it.first}\"" } + ) .build() ) .addModifiers(KModifier.OPEN) @@ -90,7 +103,11 @@ private fun NativeStructure.toSpecWithAttributes(packageName: String, structureC .build() ) .apply { - fields.forEach { (name, typeRef) -> + fields + //TODO support SubStructureField + .filterIsInstance() + .map { it.name to it.type } + .forEach { (name, typeRef) -> addProperty( propertySpec(name, typeRef, packageName) ) @@ -151,15 +168,18 @@ private fun ResolvedTypeRef.toPropertySpec( val rootType = type.rootType() val type = when { - rootType is NativeStructure -> toType(packageName) + rootType is NativeStructure -> toType(packageName, fromStructure = true) // If FunctionPointerType generate an interface or use the one defined by the typealias rootType is FunctionPointerType -> when (type) { - is NativeTypeAlias -> ClassName(packageName, type.name) + is NativeTypeAlias -> ClassName(packageName, type.name.value) else -> ClassName(packageName, generateNativePointerName(nativeStructure, name)) }.copy(nullable = true) - rootType is StringType -> toType(packageName) - rootType is PrimitiveType && isPointer.not() -> toType(packageName) + rootType is StringType -> toType(packageName).copy(nullable = true) + rootType is PrimitiveType && isPointer.not() -> when { + isArray && type is NativeTypeAlias && rootType is FixeSizeType -> ClassName(packageName, "${type.name}${'$'}Array") + else -> toType(packageName) + } rootType is NativeEnumeration && isPointer.not() -> when (rootType.type) { is ResolvedTypeRef -> rootType.type.toType(packageName) else -> null @@ -170,13 +190,14 @@ private fun ResolvedTypeRef.toPropertySpec( val defaultValue = when { rootType is NativeStructure -> when { - isPointer -> "${rootType.name}()" + isPointer -> "null" else -> "${rootType.name}()" } - rootType is StringType -> "\"\"" + rootType is StringType -> "null" isPointer -> "null" rootType is FixeSizeType -> when { isArray -> when { + this.type is NativeTypeAlias -> "`${this.type.name}${'$'}Array`(${arraySize ?: 0})" rootType.isFloating && rootType.size == 32 -> "FloatArray(${arraySize ?: 0})" rootType.isFloating && rootType.size == 64 -> "DoubleArray(${arraySize ?: 0})" rootType.size == 8 -> "ByteArray(${arraySize ?: 0})" @@ -211,7 +232,7 @@ private fun generateNativePointerName(structureName: String, fieldName: String) "${structureName}${fieldName.replaceFirstChar { it.uppercaseChar() }}Function" private fun generateNativePointerName(nativeStructure: NativeStructure, fieldName: String) = - generateNativePointerName(nativeStructure.name, fieldName) + generateNativePointerName(nativeStructure.name.value, fieldName) private fun TypeRef.defaultPropertySpec( name: String diff --git a/klang/klang/src/main/kotlin/klang/mapper/Type.kt b/klang/klang/src/main/kotlin/klang/mapper/Type.kt index 9dc3f486..dea3d012 100644 --- a/klang/klang/src/main/kotlin/klang/mapper/Type.kt +++ b/klang/klang/src/main/kotlin/klang/mapper/Type.kt @@ -5,31 +5,34 @@ import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy import klang.domain.* // TODO add tests -internal fun TypeRef.toType(packageName: String, nullable: Boolean = false) = when { +internal fun TypeRef.toType(packageName: String, nullable: Boolean = false, fromStructure: Boolean = false, fromFunction: Boolean = false) = when { isPointer -> when { this is ResolvedTypeRef -> when (this.type.rootType()) { is StringType -> when { isArray -> ClassName("kotlin", "Array").parameterizedBy(ClassName("kotlin", "String")) - else -> ClassName("kotlin", "String") + else -> ClassName("kotlin", "String").copy(nullable = fromFunction) } - is NativeStructure -> ClassName(packageName, typeName) - is FunctionPointerType -> jnaCallback - is PrimitiveType -> jnaPointer - else -> ClassName(packageName, typeName) + is NativeStructure -> when (fromStructure) { + true -> jnaNullablePointer + else -> ClassName(packageName, typeName.value) + } + is FunctionPointerType -> jnaCallback.copy(nullable = fromFunction) + is PrimitiveType -> jnaPointer.copy(nullable = fromFunction) + else -> ClassName(packageName, typeName.value) } else -> jnaPointer } - + this is ResolvedTypeRef && type is NativeTypeAlias -> ClassName(packageName, type.name.value) this is ResolvedTypeRef -> when (this.type.rootType()) { is FunctionPointerType -> jnaCallback is VoidType -> ClassName("kotlin", "Unit") is PrimitiveType -> toPrimitiveType(packageName) - else -> ClassName(packageName, typeName) + else -> ClassName(packageName, typeName.value) } - else -> ClassName(packageName, typeName) + else -> ClassName(packageName, typeName.value) }.let { if (nullable) it.copy(nullable = true) else it } // @see https://github.com/java-native-access/jna/blob/master/www/Mappings.md @@ -84,6 +87,6 @@ private fun ResolvedTypeRef.toPrimitiveType(packageName: String): ClassName = th // Default else -> null } - } ?: ClassName(packageName, typeName) + } ?: ClassName(packageName, typeName.value) } \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/mapper/TypeAlias.kt b/klang/klang/src/main/kotlin/klang/mapper/TypeAlias.kt index 7509179b..11cf02ba 100644 --- a/klang/klang/src/main/kotlin/klang/mapper/TypeAlias.kt +++ b/klang/klang/src/main/kotlin/klang/mapper/TypeAlias.kt @@ -2,14 +2,13 @@ package klang.mapper import arrow.core.raise.either import arrow.core.raise.ensure -import com.squareup.kotlinpoet.* -import klang.domain.FunctionPointerType -import klang.domain.NativeTypeAlias -import klang.domain.ResolvedTypeRef -import klang.domain.unchecked +import com.squareup.kotlinpoet.ClassName +import com.squareup.kotlinpoet.TypeAliasSpec +import com.squareup.kotlinpoet.TypeSpec +import klang.domain.* internal fun NativeTypeAlias.toSpec(packageName: String) = when { - typeRef.isCallback -> toCallbackSpec(packageName).unchecked() + typeRef.isCallback -> toCallbackSpec(packageName).unchecked().let { listOf(it) } else -> toTypeAliasSpec(packageName) } @@ -19,13 +18,34 @@ internal fun NativeTypeAlias.toCallbackSpec( val typeRef = typeRef ensure(typeRef is ResolvedTypeRef) { "typeRef should be resolved" } ensure(typeRef.type is FunctionPointerType) { "Type must be a function pointer" } - typeRef.type.toCallbackSpec(name, packageName) - + typeRef.type.toCallbackSpec(name.value, packageName) } private fun NativeTypeAlias.toTypeAliasSpec(packageName: String) = TypeAliasSpec - .builder(name, typeRef.toType(packageName)) + .builder(name.value, typeRef.toType(packageName)) .build() + .let { toTypeAliasArraySpec(packageName)?.let { arrayIt -> listOf(it, arrayIt) } ?: listOf(it) } + +private fun NativeTypeAlias.toTypeAliasArraySpec(packageName: String) = typeRef.let { typeRef -> + when(typeRef is ResolvedTypeRef && typeRef.type.rootType() is FixeSizeType) { + true -> TypeAliasSpec + .builder("${name.value}${'$'}Array", (typeRef.type.rootType() as FixeSizeType).toArrayType()) + .build() + false -> null + } +} +private fun FixeSizeType.toArrayType() = when { + // Floating + size == 32 && isFloating -> ClassName("kotlin", "FloatArray") + size == 64 && isFloating -> ClassName("kotlin", "DoubleArray") + // Integer + size == 8 -> ClassName("kotlin", "ByteArray") + size == 16 -> ClassName("kotlin", "ShortArray") + size == 32 -> ClassName("kotlin", "IntArray") + size == 64 -> ClassName("kotlin", "LongArray") + // Default + else -> error("unreachable statement") + } diff --git a/klang/klang/src/main/kotlin/klang/parser/json/domain/Node.kt b/klang/klang/src/main/kotlin/klang/parser/json/domain/Node.kt index 990485a3..b64359ac 100644 --- a/klang/klang/src/main/kotlin/klang/parser/json/domain/Node.kt +++ b/klang/klang/src/main/kotlin/klang/parser/json/domain/Node.kt @@ -1,6 +1,5 @@ package klang.parser.json.domain -import arrow.core.raise.either import kotlinx.serialization.json.* import mu.KotlinLogging diff --git a/klang/klang/src/main/kotlin/klang/parser/json/type/NativeEnumeration.kt b/klang/klang/src/main/kotlin/klang/parser/json/type/NativeEnumeration.kt index e64eb05f..8a58424f 100644 --- a/klang/klang/src/main/kotlin/klang/parser/json/type/NativeEnumeration.kt +++ b/klang/klang/src/main/kotlin/klang/parser/json/type/NativeEnumeration.kt @@ -2,6 +2,7 @@ package klang.parser.json.type import klang.domain.AnonymousEnumeration import klang.domain.NativeEnumeration +import klang.domain.NotBlankString import klang.parser.json.domain.TranslationUnitKind import klang.parser.json.domain.TranslationUnitNode import klang.parser.json.domain.json @@ -10,12 +11,12 @@ import kotlinx.serialization.json.jsonPrimitive import kotlinx.serialization.json.longOrNull internal fun TranslationUnitNode.toNativeTypeDefEnumeration(sibling: TranslationUnitNode) = NativeEnumeration( - name = sibling.json.typeAliasName(), + name = NotBlankString(sibling.json.typeAliasName()), values = this.extractFields() ) internal fun TranslationUnitNode.toNativeEnumeration() = NativeEnumeration( - name = json.typeAliasName(), + name = NotBlankString(json.typeAliasName()), values = this.extractFields() ) diff --git a/klang/klang/src/main/kotlin/klang/parser/json/type/NativeFunction.kt b/klang/klang/src/main/kotlin/klang/parser/json/type/NativeFunction.kt index cd4584dd..2cb35b5d 100644 --- a/klang/klang/src/main/kotlin/klang/parser/json/type/NativeFunction.kt +++ b/klang/klang/src/main/kotlin/klang/parser/json/type/NativeFunction.kt @@ -1,17 +1,14 @@ package klang.parser.json.type -import klang.domain.NativeFunction -import klang.domain.typeOf -import klang.domain.unchecked +import klang.domain.* import klang.parser.json.domain.TranslationUnitKind import klang.parser.json.domain.TranslationUnitNode import klang.parser.json.domain.json import kotlinx.serialization.json.JsonObject -import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive internal fun TranslationUnitNode.toNativeFunction() = NativeFunction( - name = json.functionName(), + name = NotBlankString(json.functionName()), returnType = typeOf(json.type().adapt()).unchecked("fail to create type ${json.type()}"), arguments = arguments() ) @@ -21,10 +18,10 @@ private fun TranslationUnitNode.arguments() = .map { it.extractArguments() } private fun TranslationUnitNode.extractArguments(): NativeFunction.Argument { - val name = json.nullableName() + val name = json.nullableName() ?: "" val type = json.nullableType() ?: error("no type for : $this") - return NativeFunction.Argument(name, typeOf(type).unchecked("fail to create type $type")) + return NativeFunction.Argument(notBlankString(name), typeOf(type).unchecked("fail to create type $type")) } private fun String.adapt() = let { it.substring(0, it.indexOf("(")) } diff --git a/klang/klang/src/main/kotlin/klang/parser/json/type/NativeStructure.kt b/klang/klang/src/main/kotlin/klang/parser/json/type/NativeStructure.kt index 2fd799af..4e4216bb 100644 --- a/klang/klang/src/main/kotlin/klang/parser/json/type/NativeStructure.kt +++ b/klang/klang/src/main/kotlin/klang/parser/json/type/NativeStructure.kt @@ -1,24 +1,21 @@ package klang.parser.json.type -import klang.domain.NativeStructure -import klang.domain.TypeRef -import klang.domain.typeOf +import klang.domain.* import klang.parser.json.domain.TranslationUnitKind import klang.parser.json.domain.TranslationUnitNode import klang.parser.json.domain.json import kotlinx.serialization.json.JsonObject -import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive internal fun TranslationUnitNode.toNativeTypeDefStructure(sibling: TranslationUnitNode) = NativeStructure( - name = sibling.json.name(), + name = NotBlankString(sibling.json.name()), fields = this.extractFields(), isUnion = json.isUnion() ) internal fun TranslationUnitNode.toNativeStructure() = NativeStructure( - name = json.name(), + name = NotBlankString(json.name()), fields = this.extractFields(), isUnion = json.isUnion() ) @@ -34,19 +31,19 @@ private fun TranslationUnitNode.isTypeDefStructure( && sibling[index + 1].content.first == TranslationUnitKind.TypedefDecl && json.nullableName() == null -private fun TranslationUnitNode.extractFields(): List> = +private fun TranslationUnitNode.extractFields(): List = children.filter { it.content.first == TranslationUnitKind.FieldDecl } .map { it.extractField() } -private fun TranslationUnitNode.extractField(): Pair { +private fun TranslationUnitNode.extractField(): StructureField { val name = json.nullableName() ?: "" // Some field can use empty name to get specific alignment (see: __darwin_fp_control as example) val value = json.nullableType() ?.let(::typeOf) ?.getOrNull() ?: error("no type for : $this") - return name to value + return TypeRefField(name, value) } private fun JsonObject.isUnion(): Boolean { diff --git a/klang/klang/src/main/kotlin/klang/parser/json/type/NativeTypeAlias.kt b/klang/klang/src/main/kotlin/klang/parser/json/type/NativeTypeAlias.kt index 15896d57..9b46deaa 100644 --- a/klang/klang/src/main/kotlin/klang/parser/json/type/NativeTypeAlias.kt +++ b/klang/klang/src/main/kotlin/klang/parser/json/type/NativeTypeAlias.kt @@ -1,12 +1,13 @@ package klang.parser.json.type import klang.domain.NativeTypeAlias +import klang.domain.NotBlankString import klang.domain.typeOf import klang.domain.unchecked import klang.parser.json.domain.TranslationUnitNode import klang.parser.json.domain.json internal fun TranslationUnitNode.toNativeTypeAlias()= NativeTypeAlias( - name = json.name(), + name = NotBlankString(json.name()), typeRef = json.type().let(::typeOf).unchecked("fail to parse type $this") ) \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/parser/json/type/NodeParsing.kt b/klang/klang/src/main/kotlin/klang/parser/json/type/NodeParsing.kt index 78f70961..91bf346c 100644 --- a/klang/klang/src/main/kotlin/klang/parser/json/type/NodeParsing.kt +++ b/klang/klang/src/main/kotlin/klang/parser/json/type/NodeParsing.kt @@ -1,6 +1,5 @@ package klang.parser.json.type -import klang.domain.UnresolvedTypeRef import klang.domain.typeOf import kotlinx.serialization.json.* diff --git a/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCCategory.kt b/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCCategory.kt index 81e5dbde..2e12f603 100644 --- a/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCCategory.kt +++ b/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCCategory.kt @@ -11,7 +11,7 @@ import kotlinx.serialization.json.jsonPrimitive internal fun TranslationUnitNode.toObjectiveCCategory(): ObjectiveCCategory { return ObjectiveCCategory( - name = json.nullableName() ?: AnonymousCategoryName, + name = NotBlankString(json.nullableName() ?: AnonymousCategoryName), superType = json.superType(), methods = json.methods() ) @@ -32,7 +32,7 @@ private fun JsonObject.methods(): List = inner() ?.map { it.toMethod() } ?: listOf() private fun JsonObject.toMethod() = ObjectiveCClass.Method( - name = name(), + name = NotBlankString(name()), returnType = returnType(), instance = booleanValueOf("instance"), arguments = arguments() diff --git a/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCClass.kt b/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCClass.kt index 164f7cd9..ba7f5905 100644 --- a/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCClass.kt +++ b/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCClass.kt @@ -1,7 +1,6 @@ package klang.parser.json.type import arrow.core.Either -import arrow.core.getOrElse import klang.domain.* import klang.parser.json.domain.TranslationUnitKind import klang.parser.json.domain.TranslationUnitNode @@ -13,7 +12,7 @@ import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive internal fun TranslationUnitNode.toObjectiveCClass(): ObjectiveCClass { - val name = json.name() + val name = NotBlankString(json.name()) return ObjectiveCClass( name = name, superType = json.superType(), @@ -45,7 +44,7 @@ private fun JsonObject.methods(): List = inner() ?.map { it.toMethod() } ?: listOf() private fun JsonObject.toMethod() = ObjectiveCClass.Method( - name = name(), + name = NotBlankString(name()), returnType = returnType(), instance = booleanValueOf("instance"), arguments = arguments() @@ -65,7 +64,7 @@ private fun JsonObject.properties(): List = inner() ?.map { it.toProperty() } ?: listOf() private fun JsonObject.toProperty(): ObjectiveCClass.Property = ObjectiveCClass.Property( - name = name(), + name = NotBlankString(name()), type = type(), assign = nullableBooleanValueOf("assign"), readwrite = nullableBooleanValueOf("readwrite"), diff --git a/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCProtocol.kt b/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCProtocol.kt index 23a58cef..79867c6c 100644 --- a/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCProtocol.kt +++ b/klang/klang/src/main/kotlin/klang/parser/json/type/ObjectiveCProtocol.kt @@ -1,16 +1,18 @@ package klang.parser.json.type -import arrow.core.getOrElse import klang.domain.* import klang.parser.json.domain.TranslationUnitKind import klang.parser.json.domain.TranslationUnitNode import klang.parser.json.domain.json import klang.parser.json.domain.kind -import kotlinx.serialization.json.* +import kotlinx.serialization.json.JsonObject +import kotlinx.serialization.json.jsonArray +import kotlinx.serialization.json.jsonObject +import kotlinx.serialization.json.jsonPrimitive internal fun TranslationUnitNode.toObjectiveCProtocol(): ObjectiveCProtocol { return ObjectiveCProtocol( - name = json.name(), + name = NotBlankString(json.name()), protocols = json.protocols(), properties = json.properties(), methods = json.methods() @@ -29,7 +31,7 @@ private fun JsonObject.methods(): List = inner() ?.map { it.toMethod() } ?: listOf() private fun JsonObject.toMethod() = ObjectiveCClass.Method( - name = name(), + name = NotBlankString(name()), returnType = returnType(), instance = booleanValueOf("instance"), arguments = arguments() @@ -49,7 +51,7 @@ private fun JsonObject.properties(): List = inner() ?.map { it.toProperty() } ?: listOf() private fun JsonObject.toProperty(): ObjectiveCClass.Property = ObjectiveCClass.Property( - name = name(), + name = NotBlankString(name()), type = type(), assign = nullableBooleanValueOf("assign"), readwrite = nullableBooleanValueOf("readwrite"), diff --git a/klang/klang/src/main/kotlin/klang/parser/libclang/LibClangParser.kt b/klang/klang/src/main/kotlin/klang/parser/libclang/LibClangParser.kt index a13b0dcd..dfe0302d 100644 --- a/klang/klang/src/main/kotlin/klang/parser/libclang/LibClangParser.kt +++ b/klang/klang/src/main/kotlin/klang/parser/libclang/LibClangParser.kt @@ -1,103 +1,48 @@ package klang.parser.libclang import klang.DeclarationRepository -import klang.InMemoryDeclarationRepository -import klang.domain.* -import klang.jvm.AbstractIndexerCallback -import klang.jvm.CursorKind -import klang.jvm.DeclarationInfo -import klang.jvm.createIndex -import klang.parser.libclang.type.declareFunction -import klang.parser.tools.OneTimeProvider import mu.KotlinLogging +import java.io.File +import java.nio.file.Path +import kotlin.io.path.absolutePathString +import kotlin.io.path.exists private val logger = KotlinLogging.logger {} -internal data class ParsingContext( - var currentDefinition: NativeDeclaration? = null, - var lastTypeDefName: OneTimeProvider = OneTimeProvider(), - val declarationRepository: DeclarationRepository = InMemoryDeclarationRepository() -) { - inline fun getCurrentDefinitionAs(): T { - return (currentDefinition as? T) - ?: throw IllegalStateException("Expected ${T::class.simpleName}") - } -} - -fun parseFile(file: String) = - ParsingContext() - .parse(file) { info: DeclarationInfo -> - logger.debug { "parsing unit at ${info.location}" } - when (info.cursor.kind) { - CursorKind.TYPEDEF_DECL -> when { - isEnumOrStruct(info) -> storeSpelling(info) - else -> declareTypeAlias(info) - } - - CursorKind.ENUM_DECL -> declareEnumeration(info) - CursorKind.STRUCT_DECL -> declareStructure(info) - CursorKind.ENUM_CONSTANT_DECL -> updateEnumerationField(info) - CursorKind.FIELD_DECL -> updateStructureField(info) - CursorKind.FUNCTION_DECL -> declareFunction(info) - - else -> println("not found ${info.cursor.kind} ${info.cursor.spelling}") - } - - } - +fun DeclarationRepository.parseFile( + fileAsString: String, + filePathAsString: String? = null, + headerPathsAsString: Array = arrayOf(), + macros: Map = mapOf() +): DeclarationRepository { -private fun ParsingContext.parse(file: String, block: ParsingContext.(DeclarationInfo) -> Unit) = - createIndex(excludeDeclarationsFromPCH = false, displayDiagnostics = false) - .use { index -> - index.indexSourceFile(object : AbstractIndexerCallback() { - override fun indexDeclaration(info: DeclarationInfo) { - block(info) - } - }, file) - }.let { declarationRepository } + val fileToParse = computeFile(filePathAsString, fileAsString) + val path = computePath(filePathAsString) + val headerPaths = computeHeadersPaths(headerPathsAsString) -private fun isEnumOrStruct(info: DeclarationInfo) = info.cursor.children().isNotEmpty() - && info.cursor.children().first().kind in listOf(CursorKind.ENUM_DECL, CursorKind.STRUCT_DECL) + logger.info { + "will parse file at ${fileToParse.absolutePath} and paths ${headerPaths.map { it.toFile().absolutePath }}" + } -private fun ParsingContext.declareTypeAlias(info: DeclarationInfo) { - val name = info.cursor.spelling - val type = info.cursor.underlyingType.spelling - currentDefinition = NativeTypeAlias( - name = name, - typeRef = type.let(::typeOf).unchecked("fail to parse type $this") - ).also(declarationRepository::save) + return parseFile(fileToParse, path, headerPaths, macros) } -private fun ParsingContext.updateStructureField(info: DeclarationInfo) { - val name = info.cursor.spelling - val value = typeOf(info.cursor.type.spelling).unchecked("fail to parse type $this") - currentDefinition = getCurrentDefinitionAs().let { - declarationRepository.update(it) { - it.copy(fields = it.fields + (name to value)) - } - } -} +private fun computeHeadersPaths(headerPathsAsString: Array) = + headerPathsAsString.map { Path.of(it).also { check(it.exists()) { "File not found ${it.absolutePathString()}" } } }.toTypedArray() -private fun ParsingContext.updateEnumerationField(info: DeclarationInfo) { - val name = info.cursor.spelling - val value = info.cursor.getEnumConstantValue() - currentDefinition = getCurrentDefinitionAs().let { - declarationRepository.update(it) { - it.copy(values = it.values + (name to value)) - } - } -} +private fun computePath(filePathAsString: String?) = filePathAsString?.let { Path.of(it) } + ?.also { check(it.exists()) } -private fun ParsingContext.declareStructure(info: DeclarationInfo) { - currentDefinition = NativeStructure(lastTypeDefName.consume() ?: info.cursor.spelling) - .also(declarationRepository::save) -} +private fun computeFile(filePathAsString: String?, fileAsString: String) = when (filePathAsString != null) { + true -> filePathAsString.let { "$it/$fileAsString" } + .let(::File) -private fun ParsingContext.declareEnumeration(info: DeclarationInfo) { - currentDefinition = NativeEnumeration(lastTypeDefName.consume() ?: info.cursor.spelling) - .also(declarationRepository::save) -} + false -> File(fileAsString) +}.also { check(it.exists()) } -private fun ParsingContext.storeSpelling(info: DeclarationInfo) { - lastTypeDefName.store(info.cursor.spelling) -} \ No newline at end of file +private fun DeclarationRepository.parseFile( + file: File, + filePath: Path? = null, + headerPaths: Array, + macros: Map +) = parseFileWithPanama(file.absolutePath, filePath, headerPaths, macros) \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/parser/libclang/PanamaLibclangParser.kt b/klang/klang/src/main/kotlin/klang/parser/libclang/PanamaLibclangParser.kt new file mode 100644 index 00000000..b2f12ca4 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/parser/libclang/PanamaLibclangParser.kt @@ -0,0 +1,87 @@ +package klang.parser.libclang + +import klang.DeclarationRepository +import klang.InMemoryDeclarationRepository +import klang.domain.DeclarationOrigin +import klang.domain.NameableDeclaration +import klang.domain.NativeConstant +import klang.domain.notBlankString +import klang.parse +import klang.parser.libclang.panama.OriginProcessor.toOrigin +import klang.parser.libclang.panama.toNativeConstant +import klang.parser.libclang.panama.toNativeEnumeration +import klang.parser.libclang.panama.toNativeStructure +import klang.parser.libclang.panama.toNativeTypeAlias +import mu.KotlinLogging +import org.openjdk.jextract.Declaration +import org.openjdk.jextract.Declaration.Scoped +import org.openjdk.jextract.Declaration.Typedef +import org.openjdk.jextract.impl.TypeImpl +import java.nio.file.Path +import kotlin.io.path.pathString + +private val logger = KotlinLogging.logger {} + +fun DeclarationRepository.parseFileWithPanama(file: String, filePath: Path?, headerPaths: Array, macros: Map): DeclarationRepository = apply { + val header = Path.of(file) + + var clangArguments = filePath?.let { "-I${it.toFile().absolutePath}" } + ?.let { arrayOf(it) } + ?: arrayOf() + clangArguments += headerPaths.map { "-I${it.toFile().absolutePath}" } + + clangArguments += macros.map { (key, value) -> "-D${key}${value?.let { "=$it" } ?: ""}" } + + val topLevel = parse( + listOf(header), + *clangArguments + ) + + check(topLevel.kind() == Declaration.Scoped.Kind.TOPLEVEL) + + topLevel.members() + .asSequence() + .filter { it.declarationIsOnFilePath(filePath) } + .map { + val origin = it.pos().toOrigin(filePath) + when (it) { + is Scoped -> it.scopedToLocalDeclaration(origin = origin) + is Typedef -> it.typeDefToLocalDeclaration(origin) + is Declaration.Function -> it.toNativeTypeAlias(origin) + is Declaration.Constant -> it.toNativeConstant(origin) + else -> { + logger.error { "not found $it" } + null + } + } + } + .filterNotNull() + .forEach { save(it) } + + } + + + +internal fun Declaration.declarationIsOnFilePath(filePath: Path?): Boolean = filePath + ?.pathString + ?.let { pos().path().parent.pathString.contains(it) } ?: true + +private fun Typedef.typeDefToLocalDeclaration(origin: DeclarationOrigin): NameableDeclaration? = type().let { type -> + when (type) { + is TypeImpl.DeclaredImpl -> type.tree().scopedToLocalDeclaration(name(), origin) + else -> toNativeTypeAlias(origin) + } +} + +private fun Scoped.scopedToLocalDeclaration(name: String? = null, origin: DeclarationOrigin): NameableDeclaration? { + return when (kind()) { + Declaration.Scoped.Kind.ENUM -> toNativeEnumeration(name, origin) + Declaration.Scoped.Kind.STRUCT -> toNativeStructure(name, origin = origin) + Declaration.Scoped.Kind.UNION -> toNativeStructure(name, isUnion = true, origin) + + else -> { + logger.error { "not found ${kind()}" } + null + } + } +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeConstant.kt b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeConstant.kt new file mode 100644 index 00000000..038b17a0 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeConstant.kt @@ -0,0 +1,23 @@ +package klang.parser.libclang.panama + +import klang.domain.DeclarationOrigin +import klang.domain.NameableDeclaration +import klang.domain.NativeConstant +import klang.domain.notBlankString +import mu.KotlinLogging +import org.openjdk.jextract.Declaration + +private val logger = KotlinLogging.logger {} + +internal fun Declaration.Constant.toNativeConstant(origin: DeclarationOrigin): NameableDeclaration? = + notBlankString(name()) + .also { if (it == null) logger.warn { "nameless constant at ${pos()}" } } + ?.let { it to value() } + ?.let { (name, value) -> + when (value) { + is String -> NativeConstant(name, value, origin) + is Long -> NativeConstant(name, value, origin) + is Double -> NativeConstant(name, value, origin) + else -> error("unsupported constant of type ${value::class.java.name}") + } + } diff --git a/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeEnumeration.kt b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeEnumeration.kt new file mode 100644 index 00000000..ac1a14b8 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeEnumeration.kt @@ -0,0 +1,22 @@ +package klang.parser.libclang.panama + +import klang.domain.DeclarationOrigin +import klang.domain.NativeEnumeration +import klang.domain.notBlankString +import org.openjdk.jextract.Declaration + +internal fun Declaration.Scoped.toNativeEnumeration(name: String?, origin: DeclarationOrigin) = + notBlankString(name ?: name())?.let { it to members().toEnumValues()} + ?.let {(name, values) -> + NativeEnumeration( + name, + values, + source = origin + ) + } + + +private fun List.toEnumValues(): List> = filterIsInstance() + .map { + it.name() to it.value().toString().toLong() + } \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeFunction.kt b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeFunction.kt new file mode 100644 index 00000000..b94bc01e --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeFunction.kt @@ -0,0 +1,17 @@ +package klang.parser.libclang.panama + +import klang.domain.* +import org.openjdk.jextract.Declaration +import org.openjdk.jextract.Declaration.Variable + +internal fun Declaration.Function.toNativeTypeAlias(origin: DeclarationOrigin): NameableDeclaration = NativeFunction( + NotBlankString(name()), + returnType = type().toTypeRef(), + arguments = parameters().map { it.toArgument() }, + source = origin +) + +private fun Variable.toArgument() = NativeFunction.Argument( + notBlankString(name()), + type().toTypeRef() +) \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeStructure.kt b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeStructure.kt new file mode 100644 index 00000000..81ecaec8 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeStructure.kt @@ -0,0 +1,28 @@ +package klang.parser.libclang.panama + +import klang.domain.* +import org.openjdk.jextract.Declaration +import org.openjdk.jextract.impl.TypeImpl + +internal fun Declaration.Scoped.toNativeStructure(name: String?, isUnion: Boolean = false, origin: DeclarationOrigin) = Triple( + name ?: name(), + members().toStructureFields(), + isUnion +).let { (name, fields, isUnion) -> + NativeStructure( + NotBlankString(name), + fields, + isUnion, + origin + ) +} + +private fun List.toStructureFields(): List = filterIsInstance() + .mapNotNull { it.toStructureField() } + +private fun Declaration.Variable.toStructureField(): TypeRefField? = (name() to type()) + .let { (name, type) -> + when {type is TypeImpl.DeclaredImpl && type.tree().kind() == Declaration.Scoped.Kind.UNION -> null + else -> TypeRefField(name, type.toTypeRef()) + } + } \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeTypeAlias.kt b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeTypeAlias.kt new file mode 100644 index 00000000..849fbe7a --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/NativeTypeAlias.kt @@ -0,0 +1,10 @@ +package klang.parser.libclang.panama + +import klang.domain.DeclarationOrigin +import klang.domain.NameableDeclaration +import klang.domain.NativeTypeAlias +import klang.domain.NotBlankString +import org.openjdk.jextract.Declaration + +internal fun Declaration.Typedef.toNativeTypeAlias(origin: DeclarationOrigin): NameableDeclaration? = (name() to type().toTypeRef()) + .let { (name, typeRef) -> NativeTypeAlias(NotBlankString(name), typeRef, origin) } diff --git a/klang/klang/src/main/kotlin/klang/parser/libclang/panama/OriginProcessor.kt b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/OriginProcessor.kt new file mode 100644 index 00000000..31d45fea --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/OriginProcessor.kt @@ -0,0 +1,21 @@ +package klang.parser.libclang.panama + +import klang.domain.DeclarationOrigin +import org.openjdk.jextract.Position +import java.nio.file.Path +import kotlin.io.path.absolutePathString + +object OriginProcessor { + + internal fun Position?.toOrigin(filePath: Path?): DeclarationOrigin = when { + filePath == null || this == null -> DeclarationOrigin.Unknown + else -> when { + isInFilePath(filePath) -> DeclarationOrigin.LibraryHeader(path().absolutePathString()) + else -> DeclarationOrigin.Platform + } + } + + private fun Position.isInFilePath(filePath: Path) = + path().absolutePathString().contains(filePath.absolutePathString()) + +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/parser/libclang/panama/TypeRef.kt b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/TypeRef.kt new file mode 100644 index 00000000..57ce09e5 --- /dev/null +++ b/klang/klang/src/main/kotlin/klang/parser/libclang/panama/TypeRef.kt @@ -0,0 +1,86 @@ +package klang.parser.libclang.panama + +import klang.domain.* +import org.openjdk.jextract.Type +import org.openjdk.jextract.Type.Delegated +import org.openjdk.jextract.impl.TypeImpl +import java.lang.foreign.ValueLayout + +internal fun Type.toTypeRef(): TypeRef = when (this) { + is Delegated -> when (kind()) { + Delegated.Kind.TYPEDEF -> typeOf(name().get()).unchecked() + Delegated.Kind.POINTER -> type().let { type -> + when (type) { + is TypeImpl.FunctionImpl -> UnresolvedTypeRef( + toString(), + NotBlankString(type.toTypeString()), + isPointer = true, + isCallback = true + ) + else -> type.toTypeString().removeConstPrefix().removePointerSuffix() + .let { typeName -> UnresolvedTypeRef(toString(), NotBlankString(typeName), isPointer = true) } + } + } + + Delegated.Kind.SIGNED -> typeOf(type().toTypeString()).unchecked() + Delegated.Kind.UNSIGNED -> typeOf("unsigned " + type().toTypeString()).unchecked() + Delegated.Kind.ATOMIC -> TODO("unsupported yet") + Delegated.Kind.VOLATILE -> TODO("unsupported yet") + Delegated.Kind.COMPLEX -> TODO("unsupported yet") + null -> TODO("unsupported yet") + } + + is TypeImpl.FunctionImpl -> returnType().toTypeRef() + is TypeImpl.PrimitiveImpl -> typeOf(toTypeString()).unchecked() + is TypeImpl.ArrayImpl -> typeOf(toTypeString()).unchecked() + is TypeImpl.DeclaredImpl -> typeOf(toTypeString()).unchecked() + else -> TODO("unsupported yet") +} + +//TODO find a better way to handle this +private fun String.removePointerSuffix(): String = removeSuffix(" *") + +//TODO find a better way to handle this +private fun String.removeConstPrefix(): String = removePrefix("const ") + +private fun Type.toTypeString(): String = when (this) { + is TypeImpl.DeclaredImpl -> toTypeString() + is TypeImpl.PrimitiveImpl -> kind().typeName() + is TypeImpl.QualifiedImpl -> name() + .orElseGet { type().toTypeString() } + + is TypeImpl.ArrayImpl -> elementType().toTypeString() + .let { typeAsString -> countElements()?.let { "$typeAsString[$it]" } ?: "$typeAsString[]" } + + is TypeImpl.FunctionImpl -> functionToTypeString() + is TypeImpl.PointerImpl -> "${type().toTypeString()} *" + else -> TODO("unsupported yet with $this") +} + +private fun TypeImpl.FunctionImpl.functionToTypeString(): String { + return returnType().toTypeString() + "( ${argumentTypes().toTypeString()} )" +} + +private fun List.toTypeString(): String = map { + it.toTypeRef().typeName +}.joinToString(",") + +@Suppress("INACCESSIBLE_TYPE") +private fun TypeImpl.DeclaredImpl.toTypeString(): String = tree().name() + .takeIf { it.isNotEmpty() } +// if declared name is not accessible, we try to get type name directly + ?: tree().layout()?.orElse(null)?.let { + when { + it is ValueLayout.OfInt && it.byteSize() == 4L -> "int" + else -> error("fail to get type name from type ${it.javaClass.name}") + } + } + ?: error("fail to get type name") + +private fun TypeImpl.ArrayImpl.countElements() = elementCount().let { elementCount -> + when (elementCount.isEmpty) { + true -> null + else -> elementCount.asLong + } + +} \ No newline at end of file diff --git a/klang/klang/src/main/kotlin/klang/parser/libclang/type/NativeFunction.kt b/klang/klang/src/main/kotlin/klang/parser/libclang/type/NativeFunction.kt deleted file mode 100644 index 70d0863d..00000000 --- a/klang/klang/src/main/kotlin/klang/parser/libclang/type/NativeFunction.kt +++ /dev/null @@ -1,24 +0,0 @@ -package klang.parser.libclang.type - -import klang.domain.NativeFunction -import klang.domain.typeOf -import klang.domain.unchecked -import klang.jvm.Cursor -import klang.jvm.DeclarationInfo -import klang.parser.libclang.ParsingContext - -internal fun ParsingContext.declareFunction(info: DeclarationInfo) { - currentDefinition = NativeFunction( - name = info.cursor.spelling, - returnType = typeOf(info.cursor.returnType()).unchecked("fail to create type"), - arguments = info.cursor.arguments() - ).also(declarationRepository::save) -} - -private fun Cursor.arguments() = children() - .map { NativeFunction.Argument(it.spelling, typeOf( it.type.spelling).unchecked("fail to create type")) } - -private fun Cursor.returnType() = type.spelling - .let { it.substring(0, it.indexOf("(")) } - .trim() - diff --git a/klang/klang/src/main/kotlin/klang/parser/tools/OneTimeProvider.kt b/klang/klang/src/main/kotlin/klang/parser/tools/OneTimeProvider.kt deleted file mode 100644 index 23568ad8..00000000 --- a/klang/klang/src/main/kotlin/klang/parser/tools/OneTimeProvider.kt +++ /dev/null @@ -1,14 +0,0 @@ -package klang.parser.tools - -class OneTimeProvider(private var value: T? = null) { - - fun store(value: T) { - this.value = value - } - - fun consume(): T? { - val value = this.value - this.value = null - return value - } -} \ No newline at end of file diff --git a/klang/klang/src/main/resources/c-darwin-headers.zip b/klang/klang/src/main/resources/c-darwin-headers.zip new file mode 100644 index 00000000..3a4d179b Binary files /dev/null and b/klang/klang/src/main/resources/c-darwin-headers.zip differ diff --git a/klang/klang/src/main/resources/c-linux-headers.zip b/klang/klang/src/main/resources/c-linux-headers.zip new file mode 100644 index 00000000..831ac4d0 Binary files /dev/null and b/klang/klang/src/main/resources/c-linux-headers.zip differ diff --git a/klang/klang/src/main/resources/darwin-headers.zip b/klang/klang/src/main/resources/darwin-headers.zip new file mode 100644 index 00000000..446cdbc7 Binary files /dev/null and b/klang/klang/src/main/resources/darwin-headers.zip differ diff --git a/klang/klang/src/test/c/functions.h b/klang/klang/src/test/c/functions.h index e1ef3337..5154d030 100644 --- a/klang/klang/src/test/c/functions.h +++ b/klang/klang/src/test/c/functions.h @@ -4,5 +4,11 @@ enum EnumName { Value2 = 0x1 }; +struct StructName { + enum EnumName* field1; + char field3; +}; + char function(int *a, void* b, enum EnumName myEnum); -void* function2(); \ No newline at end of file +void* function2(); +struct StructName* function3(); \ No newline at end of file diff --git a/klang/klang/src/test/c/functions.h.ast b/klang/klang/src/test/c/functions.h.ast index beffd0d4..2d43f472 100644 --- a/klang/klang/src/test/c/functions.h.ast +++ b/klang/klang/src/test/c/functions.h.ast @@ -1,29 +1,33 @@ -TranslationUnitDecl 0x55fc13dc4e58 <> -|-TypedefDecl 0x55fc13dc5680 <> implicit __int128_t '__int128' -| `-BuiltinType 0x55fc13dc5420 '__int128' -|-TypedefDecl 0x55fc13dc56f0 <> implicit __uint128_t 'unsigned __int128' -| `-BuiltinType 0x55fc13dc5440 'unsigned __int128' -|-TypedefDecl 0x55fc13dc59f8 <> implicit __NSConstantString 'struct __NSConstantString_tag' -| `-RecordType 0x55fc13dc57d0 'struct __NSConstantString_tag' -| `-Record 0x55fc13dc5748 '__NSConstantString_tag' -|-TypedefDecl 0x55fc13dc5a90 <> implicit __builtin_ms_va_list 'char *' -| `-PointerType 0x55fc13dc5a50 'char *' -| `-BuiltinType 0x55fc13dc4f00 'char' -|-TypedefDecl 0x55fc13dc5d88 <> implicit __builtin_va_list 'struct __va_list_tag[1]' -| `-ConstantArrayType 0x55fc13dc5d30 'struct __va_list_tag[1]' 1 -| `-RecordType 0x55fc13dc5b70 'struct __va_list_tag' -| `-Record 0x55fc13dc5ae8 '__va_list_tag' -|-EnumDecl 0x55fc13e21050 line:2:6 EnumName -| |-EnumConstantDecl 0x55fc13e21150 col:3 Value1 'int' -| | `-ConstantExpr 0x55fc13e21130 'int' +TranslationUnitDecl 0x559512f6ce58 <> +|-TypedefDecl 0x559512f6d680 <> implicit __int128_t '__int128' +| `-BuiltinType 0x559512f6d420 '__int128' +|-TypedefDecl 0x559512f6d6f0 <> implicit __uint128_t 'unsigned __int128' +| `-BuiltinType 0x559512f6d440 'unsigned __int128' +|-TypedefDecl 0x559512f6d9f8 <> implicit __NSConstantString 'struct __NSConstantString_tag' +| `-RecordType 0x559512f6d7d0 'struct __NSConstantString_tag' +| `-Record 0x559512f6d748 '__NSConstantString_tag' +|-TypedefDecl 0x559512f6da90 <> implicit __builtin_ms_va_list 'char *' +| `-PointerType 0x559512f6da50 'char *' +| `-BuiltinType 0x559512f6cf00 'char' +|-TypedefDecl 0x559512f6dd88 <> implicit __builtin_va_list 'struct __va_list_tag[1]' +| `-ConstantArrayType 0x559512f6dd30 'struct __va_list_tag[1]' 1 +| `-RecordType 0x559512f6db70 'struct __va_list_tag' +| `-Record 0x559512f6dae8 '__va_list_tag' +|-EnumDecl 0x559512fc90b0 line:2:6 EnumName +| |-EnumConstantDecl 0x559512fc91b0 col:3 Value1 'int' +| | `-ConstantExpr 0x559512fc9190 'int' | | |-value: Int 2 -| | `-IntegerLiteral 0x55fc13e21110 'int' 2 -| `-EnumConstantDecl 0x55fc13e211e0 col:3 Value2 'int' -| `-ConstantExpr 0x55fc13e211c0 'int' +| | `-IntegerLiteral 0x559512fc9170 'int' 2 +| `-EnumConstantDecl 0x559512fc9240 col:3 Value2 'int' +| `-ConstantExpr 0x559512fc9220 'int' | |-value: Int 1 -| `-IntegerLiteral 0x55fc13e211a0 'int' 1 -|-FunctionDecl 0x55fc13e214d8 col:6 function 'char (int *, void *, enum EnumName)' -| |-ParmVarDecl 0x55fc13e21270 col:20 a 'int *' -| |-ParmVarDecl 0x55fc13e212f0 col:29 b 'void *' -| `-ParmVarDecl 0x55fc13e213b0 col:46 myEnum 'enum EnumName':'enum EnumName' -`-FunctionDecl 0x55fc13e21630 col:7 function2 'void *()' +| `-IntegerLiteral 0x559512fc9200 'int' 1 +|-RecordDecl 0x559512fc9290 line:7:8 struct StructName definition +| |-FieldDecl 0x559512fc93e0 col:20 field1 'enum EnumName *' +| `-FieldDecl 0x559512fc9440 col:10 field3 'char' +|-FunctionDecl 0x559512fc96f8 col:6 function 'char (int *, void *, enum EnumName)' +| |-ParmVarDecl 0x559512fc94d0 col:20 a 'int *' +| |-ParmVarDecl 0x559512fc9550 col:29 b 'void *' +| `-ParmVarDecl 0x559512fc95d8 col:46 myEnum 'enum EnumName':'enum EnumName' +|-FunctionDecl 0x559512fc9850 col:7 function2 'void *()' +`-FunctionDecl 0x559512fc9a20 col:20 function3 'struct StructName *()' diff --git a/klang/klang/src/test/c/functions.h.ast.json b/klang/klang/src/test/c/functions.h.ast.json index fbbbd430..15f5278d 100644 --- a/klang/klang/src/test/c/functions.h.ast.json +++ b/klang/klang/src/test/c/functions.h.ast.json @@ -1,5 +1,5 @@ { - "id": "0x7ff61a81e008", + "id": "0x55cf8740be58", "kind": "TranslationUnitDecl", "loc": {}, "range": { @@ -8,7 +8,7 @@ }, "inner": [ { - "id": "0x7ff61a81e830", + "id": "0x55cf8740c680", "kind": "TypedefDecl", "loc": {}, "range": { @@ -22,7 +22,7 @@ }, "inner": [ { - "id": "0x7ff61a81e5d0", + "id": "0x55cf8740c420", "kind": "BuiltinType", "type": { "qualType": "__int128" @@ -31,7 +31,7 @@ ] }, { - "id": "0x7ff61a81e8a0", + "id": "0x55cf8740c6f0", "kind": "TypedefDecl", "loc": {}, "range": { @@ -45,7 +45,7 @@ }, "inner": [ { - "id": "0x7ff61a81e5f0", + "id": "0x55cf8740c440", "kind": "BuiltinType", "type": { "qualType": "unsigned __int128" @@ -54,7 +54,7 @@ ] }, { - "id": "0x7ff61a81ebb0", + "id": "0x55cf8740c9f8", "kind": "TypedefDecl", "loc": {}, "range": { @@ -68,13 +68,13 @@ }, "inner": [ { - "id": "0x7ff61a81e980", + "id": "0x55cf8740c7d0", "kind": "RecordType", "type": { "qualType": "struct __NSConstantString_tag" }, "decl": { - "id": "0x7ff61a81e8f8", + "id": "0x55cf8740c748", "kind": "RecordDecl", "name": "__NSConstantString_tag" } @@ -82,7 +82,7 @@ ] }, { - "id": "0x7ff61a81ec58", + "id": "0x55cf8740ca90", "kind": "TypedefDecl", "loc": {}, "range": { @@ -96,14 +96,14 @@ }, "inner": [ { - "id": "0x7ff61a81ec10", + "id": "0x55cf8740ca50", "kind": "PointerType", "type": { "qualType": "char *" }, "inner": [ { - "id": "0x7ff61a81e0b0", + "id": "0x55cf8740bf00", "kind": "BuiltinType", "type": { "qualType": "char" @@ -114,7 +114,7 @@ ] }, { - "id": "0x7ff61a81ef48", + "id": "0x55cf8740cd88", "kind": "TypedefDecl", "loc": {}, "range": { @@ -128,7 +128,7 @@ }, "inner": [ { - "id": "0x7ff61a81eef0", + "id": "0x55cf8740cd30", "kind": "ConstantArrayType", "type": { "qualType": "struct __va_list_tag[1]" @@ -136,13 +136,13 @@ "size": 1, "inner": [ { - "id": "0x7ff61a81ed30", + "id": "0x55cf8740cb70", "kind": "RecordType", "type": { "qualType": "struct __va_list_tag" }, "decl": { - "id": "0x7ff61a81ecb0", + "id": "0x55cf8740cae8", "kind": "RecordDecl", "name": "__va_list_tag" } @@ -152,11 +152,11 @@ ] }, { - "id": "0x7ff61a866000", + "id": "0x55cf874680b0", "kind": "EnumDecl", "loc": { "offset": 6, - "file": "./functions.h", + "file": "/workspace/functions.h", "line": 2, "col": 6, "tokLen": 8 @@ -177,7 +177,7 @@ "name": "EnumName", "inner": [ { - "id": "0x7ff61a866100", + "id": "0x55cf874681b0", "kind": "EnumConstantDecl", "loc": { "offset": 19, @@ -203,7 +203,7 @@ }, "inner": [ { - "id": "0x7ff61a8660e0", + "id": "0x55cf87468190", "kind": "ConstantExpr", "range": { "begin": { @@ -224,7 +224,7 @@ "value": "2", "inner": [ { - "id": "0x7ff61a8660c0", + "id": "0x55cf87468170", "kind": "IntegerLiteral", "range": { "begin": { @@ -249,7 +249,7 @@ ] }, { - "id": "0x7ff61a866190", + "id": "0x55cf87468240", "kind": "EnumConstantDecl", "loc": { "offset": 35, @@ -275,7 +275,7 @@ }, "inner": [ { - "id": "0x7ff61a866170", + "id": "0x55cf87468220", "kind": "ConstantExpr", "range": { "begin": { @@ -296,7 +296,7 @@ "value": "1", "inner": [ { - "id": "0x7ff61a866150", + "id": "0x55cf87468200", "kind": "IntegerLiteral", "range": { "begin": { @@ -323,48 +323,128 @@ ] }, { - "id": "0x7ff61a866488", - "kind": "FunctionDecl", + "id": "0x55cf87468290", + "kind": "RecordDecl", "loc": { - "offset": 57, + "offset": 59, "line": 7, + "col": 8, + "tokLen": 10 + }, + "range": { + "begin": { + "offset": 52, + "col": 1, + "tokLen": 6 + }, + "end": { + "offset": 116, + "line": 10, + "col": 1, + "tokLen": 1 + } + }, + "name": "StructName", + "tagUsed": "struct", + "completeDefinition": true, + "inner": [ + { + "id": "0x55cf874683e0", + "kind": "FieldDecl", + "loc": { + "offset": 91, + "line": 8, + "col": 20, + "tokLen": 6 + }, + "range": { + "begin": { + "offset": 76, + "col": 5, + "tokLen": 4 + }, + "end": { + "offset": 91, + "col": 20, + "tokLen": 6 + } + }, + "name": "field1", + "type": { + "qualType": "enum EnumName *" + } + }, + { + "id": "0x55cf87468440", + "kind": "FieldDecl", + "loc": { + "offset": 108, + "line": 9, + "col": 10, + "tokLen": 6 + }, + "range": { + "begin": { + "offset": 103, + "col": 5, + "tokLen": 4 + }, + "end": { + "offset": 108, + "col": 10, + "tokLen": 6 + } + }, + "name": "field3", + "type": { + "qualType": "char" + } + } + ] + }, + { + "id": "0x55cf874686f8", + "kind": "FunctionDecl", + "loc": { + "offset": 125, + "line": 12, "col": 6, "tokLen": 8 }, "range": { "begin": { - "offset": 52, + "offset": 120, "col": 1, "tokLen": 4 }, "end": { - "offset": 103, + "offset": 171, "col": 52, "tokLen": 1 } }, "name": "function", - "mangledName": "_function", + "mangledName": "function", "type": { "qualType": "char (int *, void *, enum EnumName)" }, "inner": [ { - "id": "0x7ff61a866228", + "id": "0x55cf874684d0", "kind": "ParmVarDecl", "loc": { - "offset": 71, + "offset": 139, "col": 20, "tokLen": 1 }, "range": { "begin": { - "offset": 66, + "offset": 134, "col": 15, "tokLen": 3 }, "end": { - "offset": 71, + "offset": 139, "col": 20, "tokLen": 1 } @@ -375,21 +455,21 @@ } }, { - "id": "0x7ff61a8662a8", + "id": "0x55cf87468550", "kind": "ParmVarDecl", "loc": { - "offset": 80, + "offset": 148, "col": 29, "tokLen": 1 }, "range": { "begin": { - "offset": 74, + "offset": 142, "col": 23, "tokLen": 4 }, "end": { - "offset": 80, + "offset": 148, "col": 29, "tokLen": 1 } @@ -400,21 +480,21 @@ } }, { - "id": "0x7ff61a866360", + "id": "0x55cf874685d8", "kind": "ParmVarDecl", "loc": { - "offset": 97, + "offset": 165, "col": 46, "tokLen": 6 }, "range": { "begin": { - "offset": 83, + "offset": 151, "col": 32, "tokLen": 4 }, "end": { - "offset": 97, + "offset": 165, "col": 46, "tokLen": 6 } @@ -428,31 +508,58 @@ ] }, { - "id": "0x7ff61a8665e0", + "id": "0x55cf87468850", "kind": "FunctionDecl", "loc": { - "offset": 112, - "line": 8, + "offset": 180, + "line": 13, "col": 7, "tokLen": 9 }, "range": { "begin": { - "offset": 106, + "offset": 174, "col": 1, "tokLen": 4 }, "end": { - "offset": 122, + "offset": 190, "col": 17, "tokLen": 1 } }, "name": "function2", - "mangledName": "_function2", + "mangledName": "function2", "type": { "qualType": "void *()" } + }, + { + "id": "0x55cf87468a20", + "kind": "FunctionDecl", + "loc": { + "offset": 212, + "line": 14, + "col": 20, + "tokLen": 9 + }, + "range": { + "begin": { + "offset": 193, + "col": 1, + "tokLen": 6 + }, + "end": { + "offset": 222, + "col": 30, + "tokLen": 1 + } + }, + "name": "function3", + "mangledName": "function3", + "type": { + "qualType": "struct StructName *()" + } } ] } \ No newline at end of file diff --git a/klang/klang/src/test/c/types.h b/klang/klang/src/test/c/types.h new file mode 100644 index 00000000..cdc7c98a --- /dev/null +++ b/klang/klang/src/test/c/types.h @@ -0,0 +1,20 @@ + + +typedef signed char signed_char_t; +typedef signed int signed_int_t; +typedef signed short signed_short_t; +typedef signed long signed_long_t; +typedef signed long long signed_long_long_t; + +typedef unsigned char unsigned_char_t; +typedef unsigned int unsigned_int_t; +typedef unsigned short unsigned_short_t; +typedef unsigned long unsigned_long_t; +typedef unsigned long long unsigned_long_long_t; + +typedef int arr_of_int_t[10]; +typedef float arr_of_float_t[10]; +typedef char arr_of_char_t[10]; +typedef double arr_of_double_t[10]; +typedef unsigned_char_t arr_of_unsigned_char_t[10]; +typedef int arr_of_int_t2[]; \ No newline at end of file diff --git a/klang/klang/src/test/kotlin/klang/domain/EnumerationTypeResolving.kt b/klang/klang/src/test/kotlin/klang/domain/EnumerationTypeResolving.kt index c0a8769a..155cf38f 100644 --- a/klang/klang/src/test/kotlin/klang/domain/EnumerationTypeResolving.kt +++ b/klang/klang/src/test/kotlin/klang/domain/EnumerationTypeResolving.kt @@ -3,17 +3,18 @@ package klang.domain import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter class EnumerationTypeResolving : FreeSpec({ val enumeration = NativeEnumeration( - name = "MyEnumeration", + name = NotBlankString("MyEnumeration"), values = listOf("first" to 1L) ) InMemoryDeclarationRepository().also { repository -> repository.save(enumeration) - repository.resolveTypes() + repository.resolveTypes(allDeclarationsFilter) } "should resolve enumeration type as primitive" { diff --git a/klang/klang/src/test/kotlin/klang/domain/NotBlankStringTest.kt b/klang/klang/src/test/kotlin/klang/domain/NotBlankStringTest.kt new file mode 100644 index 00000000..1845be23 --- /dev/null +++ b/klang/klang/src/test/kotlin/klang/domain/NotBlankStringTest.kt @@ -0,0 +1,32 @@ +package klang.domain + +import io.kotest.assertions.throwables.shouldThrow +import io.kotest.core.spec.style.FreeSpec +import io.kotest.matchers.shouldBe +import io.kotest.matchers.shouldNotBe + +class NotBlankStringTest : FreeSpec({ + + "should return null on blank string" { + listOf("", " ", "\t").forEach { + notBlankString(it) shouldBe null + } + } + + "should not return null on not blank string" { + notBlankString("a") shouldNotBe null + } + + "should throw an error if string is blank" { + listOf("", " ", "\t").forEach { + shouldThrow { + NotBlankString(it) + } + } + } + + "should not throw an error if string is not blank" { + NotBlankString("a") + } + +}) diff --git a/klang/klang/src/test/kotlin/klang/domain/StringTypeResolving.kt b/klang/klang/src/test/kotlin/klang/domain/StringTypeResolving.kt index 13fd03c7..9762a969 100644 --- a/klang/klang/src/test/kotlin/klang/domain/StringTypeResolving.kt +++ b/klang/klang/src/test/kotlin/klang/domain/StringTypeResolving.kt @@ -3,18 +3,19 @@ package klang.domain import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.parser.testType class StringTypeResolving : FreeSpec({ val nativeTypeAlias = NativeTypeAlias( - name = "MyString", + name = NotBlankString("MyString"), typeRef = testType("char *") ) InMemoryDeclarationRepository().also { repository -> repository.save(nativeTypeAlias) - repository.resolveTypes() + repository.resolveTypes(allDeclarationsFilter) } "should resolve string type as primitive" { diff --git a/klang/klang/src/test/kotlin/klang/domain/TypeRefTest.kt b/klang/klang/src/test/kotlin/klang/domain/TypeRefTest.kt index aaf689ec..d16187fe 100644 --- a/klang/klang/src/test/kotlin/klang/domain/TypeRefTest.kt +++ b/klang/klang/src/test/kotlin/klang/domain/TypeRefTest.kt @@ -9,20 +9,20 @@ class TypeRefTest : FreeSpec({ "test FunctionPointerType parsing" { TestData.basicFunctionPointer.toFunctionPointerType().apply { returnType.apply { - typeName shouldBe "void" + typeName shouldBe NotBlankString("void") isPointer shouldBe false } arguments.size shouldBe 3 arguments[0].apply { - typeName shouldBe "void" + typeName shouldBe NotBlankString("void") isPointer shouldBe true } arguments[1].apply { - typeName shouldBe "char" + typeName shouldBe NotBlankString("char") isPointer shouldBe true } arguments[2].apply { - typeName shouldBe "int" + typeName shouldBe NotBlankString("int") isPointer shouldBe false } } @@ -38,7 +38,7 @@ class TypeRefTest : FreeSpec({ isStructure shouldBe false isEnumeration shouldBe false isNullable shouldBe null - typeName shouldBe "void" + typeName shouldBe NotBlankString("void") } } } @@ -54,7 +54,7 @@ class TypeRefTest : FreeSpec({ isStructure shouldBe false isEnumeration shouldBe false isNullable shouldBe null - typeName shouldBe "int" + typeName shouldBe NotBlankString("int") } } } @@ -71,7 +71,7 @@ class TypeRefTest : FreeSpec({ isStructure shouldBe false isEnumeration shouldBe false isNullable shouldBe null - typeName shouldBe "int" + typeName shouldBe NotBlankString("int") } } } @@ -87,7 +87,7 @@ class TypeRefTest : FreeSpec({ isStructure shouldBe false isEnumeration shouldBe false isNullable shouldBe null - typeName shouldBe "unsigned int" + typeName shouldBe NotBlankString("unsigned int") } } } @@ -103,7 +103,7 @@ class TypeRefTest : FreeSpec({ isStructure shouldBe true isEnumeration shouldBe false isNullable shouldBe null - typeName shouldBe "AnyStruct" + typeName shouldBe NotBlankString("AnyStruct") } } } @@ -119,7 +119,7 @@ class TypeRefTest : FreeSpec({ isStructure shouldBe false isEnumeration shouldBe true isNullable shouldBe null - typeName shouldBe "AnyEnum" + typeName shouldBe NotBlankString("AnyEnum") } } } diff --git a/klang/klang/src/test/kotlin/klang/e2e/TypeDefCallbackTest.kt b/klang/klang/src/test/kotlin/klang/e2e/TypeDefCallbackTest.kt new file mode 100644 index 00000000..0ff2d1bf --- /dev/null +++ b/klang/klang/src/test/kotlin/klang/e2e/TypeDefCallbackTest.kt @@ -0,0 +1,102 @@ +package klang.e2e + +import io.kotest.matchers.shouldBe +import io.kotest.matchers.shouldNotBe +import klang.allDeclarationsFilter +import klang.domain.* +import klang.parser.* +import java.io.File + +class TypeDefCallbackTest : ParserTestCommon({ + + "typedef callback" - { + // Given + createHeader("typedef-callback.h") { + """ + typedef struct MyStructImpl* MyStruct; + + typedef enum MyEnum { + val1 = 0x00000000, + val2 = 0x00000001 + } MyEnum; + + typedef void (*MyCallback)(MyEnum status, MyStruct adapter, char const * message, void * userdata); + """.trimIndent() + // When + }.parseIt { + + // Hardfixe until callback are working TODO FIX + resolveTypes(allDeclarationsFilter) + (findTypeAliasByName("MyCallback") ?: error("MyCallback should exist")) + .let { callback -> + (((callback.typeRef as? ResolvedTypeRef)?.type as? FunctionPointerType) ?: error("should be resolved")) + .let { function -> + val arguments = function.arguments.toMutableList() + arguments[0] = typeOf("MyEnum").unchecked() + arguments[1] = typeOf("MyStruct").unchecked() + arguments[2] = typeOf("char *").unchecked() + arguments[3] = typeOf("void *").unchecked() + function.arguments = arguments.toList() + } + } + + // And + resolveTypes(allDeclarationsFilter) + + //Then + "test parsing result" { + val myCallback = findTypeAliasByName("MyCallback") + .also { + it shouldNotBe null + (it?.typeRef is ResolvedTypeRef) shouldBe true + (it?.typeRef as ResolvedTypeRef).apply { + (type is FunctionPointerType) shouldBe true + (type as FunctionPointerType).let { pointerFunctionType -> + (pointerFunctionType.returnType is ResolvedTypeRef) shouldBe true + (pointerFunctionType.returnType as ResolvedTypeRef).type shouldBe VoidType + pointerFunctionType.arguments.forEach { (it is ResolvedTypeRef) shouldBe true } + val arguments = pointerFunctionType.arguments.map { it as ResolvedTypeRef } + arguments.size shouldBe 4 + arguments[0].type shouldBe findEnumerationByName("MyEnum") + arguments[1].type shouldBe findTypeAliasByName("MyStruct") + arguments[2].type shouldBe StringType + arguments[3].type shouldBe VoidType + arguments[3].isPointer shouldBe true + } + } + } + } + + // And + }.generateJNABinding { files -> + "test JNA binding" { + files.firstOrNull { it.name.contains("TypeAlias") } + .let { it shouldNotBe null } + ?.let(File::readText) + ?.let { + it shouldBe """ + |package test + | + |import com.sun.jna.Callback + |import com.sun.jna.Pointer + |import kotlin.Int + |import kotlin.String + | + |public typealias MyStruct = MyStructImpl + | + |public interface MyCallback : Callback { + | public operator fun invoke( + | param1: Int, + | param2: MyStruct, + | param3: String?, + | param4: Pointer?, + | ) + |} + | + """.trimMargin() + } + } + + } + } +}) diff --git a/klang/klang/src/test/kotlin/klang/generator/CallbackGenerationTest.kt b/klang/klang/src/test/kotlin/klang/generator/CallbackGenerationTest.kt index 1c8e3b28..d2089674 100644 --- a/klang/klang/src/test/kotlin/klang/generator/CallbackGenerationTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/CallbackGenerationTest.kt @@ -3,7 +3,9 @@ package klang.generator import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.NativeTypeAlias +import klang.domain.NotBlankString import klang.mapper.toSpec import klang.parser.TestData import klang.parser.testType @@ -11,21 +13,21 @@ import klang.parser.testType class CallbackGenerationTest : FreeSpec({ val callback = NativeTypeAlias( - name = "MyCallback", + name = NotBlankString("MyCallback"), typeRef = testType(TestData.basicFunctionPointer), ) InMemoryDeclarationRepository().apply { save(callback) - resolveTypes() + resolveTypes(allDeclarationsFilter) } "generate kotlin callback" { - callback.toSpec("test").toString() shouldBe """ + callback.toSpec("test").first().toString() shouldBe """ |public interface MyCallback : com.sun.jna.Callback { | public operator fun invoke( - | param1: com.sun.jna.Pointer, - | param2: kotlin.String, + | param1: com.sun.jna.Pointer?, + | param2: kotlin.String?, | param3: kotlin.Int, | ) |} diff --git a/klang/klang/src/test/kotlin/klang/generator/EnumerationGenerationTest.kt b/klang/klang/src/test/kotlin/klang/generator/EnumerationGenerationTest.kt index 7939232d..1ecf9aa4 100644 --- a/klang/klang/src/test/kotlin/klang/generator/EnumerationGenerationTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/EnumerationGenerationTest.kt @@ -3,13 +3,15 @@ package klang.generator import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.NativeEnumeration +import klang.domain.NotBlankString import klang.mapper.toSpecAsEnumeration class EnumerationGenerationTest : FreeSpec({ val enumeration = NativeEnumeration( - name = "MyEnum", + name = NotBlankString("MyEnum"), values = listOf( Pair("FIRST", 1), Pair("SECOND", 2), @@ -19,7 +21,7 @@ class EnumerationGenerationTest : FreeSpec({ InMemoryDeclarationRepository().apply { save(enumeration) - resolveTypes() + resolveTypes(allDeclarationsFilter) } "generate kotlin enumeration" { diff --git a/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationTest.kt b/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationTest.kt index 19aef080..17e30f92 100644 --- a/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationTest.kt @@ -3,7 +3,11 @@ package klang.generator import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter +import klang.domain.NativeEnumeration +import klang.domain.NotBlankString import klang.mapper.generateInterfaceLibrarySpec +import klang.mapper.toFunctionsSpec import klang.mapper.toInterfaceSpec import klang.parser.TestData @@ -12,11 +16,13 @@ class FunctionGenerationTest : FreeSpec({ val functions = TestData.functions.map { it.copy() } InMemoryDeclarationRepository().apply { + NativeEnumeration(NotBlankString("EnumName")) + .also { save(it) } functions.forEach { save(it) } - resolveTypes() + resolveTypes(allDeclarationsFilter) } - "generate kotlin functions" { + "generate kotlin interface functions" { functions.toInterfaceSpec("", "Interface").toString() shouldBe """ |public interface Interface : com.sun.jna.Library { | /** @@ -27,15 +33,37 @@ class FunctionGenerationTest : FreeSpec({ | public fun function( | a: com.sun.jna.Pointer?, | b: com.sun.jna.Pointer?, - | myEnum: EnumName?, + | myEnum: kotlin.Int, | ): kotlin.Byte | - | public fun function2(): com.sun.jna.Pointer + | public fun function2(): com.sun.jna.Pointer? + | + | public fun function3(): com.sun.jna.Pointer? |} | """.trimMargin() } + "generate kotlin functions" { + functions.toFunctionsSpec("", "Library").joinToString("\n") shouldBe """ + |/** + | * @param a mapped from int * + | * @param b mapped from void * + | * @param myEnum mapped from enum EnumName + | */ + |public fun function( + | a: com.sun.jna.Pointer?, + | b: com.sun.jna.Pointer?, + | myEnum: kotlin.Int, + |): kotlin.Byte = Library.function(a, b, myEnum) + | + |public fun function2(): com.sun.jna.Pointer? = Library.function2() + | + |public fun function3(): com.sun.jna.Pointer? = Library.function3() + | + """.trimMargin() + } + "generate kotlin functions library" { generateInterfaceLibrarySpec("Interface", "Library", "Name").toString() shouldBe """ |val libLibrary: Interface.Library by lazy { klang.internal.NativeLoad("Name") } diff --git a/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationWithStructurePointerTest.kt b/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationWithStructurePointerTest.kt index c2c3aab1..3b307901 100644 --- a/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationWithStructurePointerTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationWithStructurePointerTest.kt @@ -3,39 +3,41 @@ package klang.generator import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.NativeFunction import klang.domain.NativeStructure -import klang.mapper.generateInterfaceLibrarySpec +import klang.domain.NotBlankString +import klang.domain.TypeRefField +import klang.mapper.toFunctionsSpec import klang.mapper.toInterfaceSpec -import klang.parser.TestData import klang.parser.testType class FunctionGenerationWithStructurePointerTest : FreeSpec({ val structure = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf( - "field1" to testType("int"), - "field2" to testType("char"), + TypeRefField("field1", testType("int")), + TypeRefField("field2", testType("char")), ) ) val function = NativeFunction( - name = "function", + name = NotBlankString("function"), returnType = testType("void"), arguments = listOf( - NativeFunction.Argument("structure", testType("MyStructure *")), + NativeFunction.Argument(NotBlankString("structure"), testType("MyStructure *")), ) ) InMemoryDeclarationRepository().apply { save(function) save(structure) - resolveTypes() + resolveTypes(allDeclarationsFilter) } - "generate kotlin functions" { + "generate kotlin interface functions" { listOf(function).toInterfaceSpec("test", "Interface").toString() shouldBe """ |public interface Interface : com.sun.jna.Library { | /** @@ -47,4 +49,14 @@ class FunctionGenerationWithStructurePointerTest : FreeSpec({ """.trimMargin() } + "generate kotlin functions" { + listOf(function).toFunctionsSpec("test", "Interface").joinToString() shouldBe """ + |/** + | * @param structure mapped from MyStructure * + | */ + |public fun function(structure: test.MyStructure?): kotlin.Unit = Interface.function(structure) + | + """.trimMargin() + } + }) \ No newline at end of file diff --git a/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationWithTypeDefTest.kt b/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationWithTypeDefTest.kt new file mode 100644 index 00000000..2fbcb92f --- /dev/null +++ b/klang/klang/src/test/kotlin/klang/generator/FunctionGenerationWithTypeDefTest.kt @@ -0,0 +1,45 @@ +package klang.generator + +import io.kotest.core.spec.style.FreeSpec +import io.kotest.matchers.shouldBe +import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter +import klang.domain.NativeFunction +import klang.domain.NativeTypeAlias +import klang.domain.NotBlankString +import klang.domain.typeOf +import klang.mapper.generateInterfaceLibrarySpec +import klang.mapper.toFunctionsSpec +import klang.mapper.toInterfaceSpec +import klang.parser.TestData +import klang.parser.testType + +class FunctionGenerationWithTypeDefTest : FreeSpec({ + + val function = NativeFunction( + NotBlankString("function"), + testType("MyType"), + listOf(NativeFunction.Argument(NotBlankString("a"), testType("MyType"))) + ) + + InMemoryDeclarationRepository().apply { + + NativeTypeAlias(NotBlankString("MyType"), testType("void *")) + .also { save((it)) } + + save(function) + + resolveTypes(allDeclarationsFilter) + } + + "generate kotlin interface functions" { + listOf(function).toFunctionsSpec("", "libInterface").first().toString() shouldBe """ + |/** + | * @param a mapped from MyType + | */ + |public fun function(a: MyType?): MyType? = libInterface.function(a) + | + """.trimMargin() + } + +}) \ No newline at end of file diff --git a/klang/klang/src/test/kotlin/klang/generator/NativeConstantGenerationTest.kt b/klang/klang/src/test/kotlin/klang/generator/NativeConstantGenerationTest.kt new file mode 100644 index 00000000..d000c265 --- /dev/null +++ b/klang/klang/src/test/kotlin/klang/generator/NativeConstantGenerationTest.kt @@ -0,0 +1,53 @@ +package klang.generator + +import io.kotest.core.spec.style.FreeSpec +import io.kotest.matchers.shouldBe +import klang.domain.NativeConstant +import klang.domain.NotBlankString +import klang.mapper.toSpec + +class NativeConstantGenerationTest : FreeSpec({ + + "generate kotlin string constant" { + NativeConstant(NotBlankString("CONSTANT"), "1").toSpec("test").apply { + toString() shouldBe """ + |val CONSTANT: kotlin.String = "1" + | + """.trimMargin() + } + } + + "generate kotlin long constant" { + NativeConstant(NotBlankString("CONSTANT"), 1L).toSpec("test").apply { + toString() shouldBe """ + |val CONSTANT: kotlin.Long = 1L + | + """.trimMargin() + } + + NativeConstant(NotBlankString("CONSTANT"), Long.MAX_VALUE).toSpec("test").apply { + toString() shouldBe """ + |val CONSTANT: kotlin.Long = Long.MAX_VALUE + | + """.trimMargin() + } + + NativeConstant(NotBlankString("CONSTANT"), Long.MIN_VALUE).toSpec("test").apply { + toString() shouldBe """ + |val CONSTANT: kotlin.Long = Long.MIN_VALUE + | + """.trimMargin() + } + } + + "generate kotlin double constant" { + NativeConstant(NotBlankString("CONSTANT"), 1.1).toSpec("test").apply { + toString() shouldBe """ + |val CONSTANT: kotlin.Double = 1.1 + | + """.trimMargin() + } + } + + +}) \ No newline at end of file diff --git a/klang/klang/src/test/kotlin/klang/generator/ObjectiveCGenerationTest.kt b/klang/klang/src/test/kotlin/klang/generator/ObjectiveCGenerationTest.kt index 8796d6a4..12ab8be8 100644 --- a/klang/klang/src/test/kotlin/klang/generator/ObjectiveCGenerationTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/ObjectiveCGenerationTest.kt @@ -2,13 +2,15 @@ package klang.generator import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe -import klang.domain.* +import klang.domain.NotBlankString +import klang.domain.ObjectiveCClass +import klang.domain.typeOf import klang.mapper.toSpec class ObjectiveCGenerationTest : FreeSpec({ val objectiveC = ObjectiveCClass( - name = "MyObjectiveCClass", + name = NotBlankString("MyObjectiveCClass"), superType = typeOf("NSObject").getOrNull(), protocols = setOf(), properties = listOf(), diff --git a/klang/klang/src/test/kotlin/klang/generator/TypeAliasGenerationTest.kt b/klang/klang/src/test/kotlin/klang/generator/TypeAliasGenerationTest.kt index f6d2e245..c7e54a83 100644 --- a/klang/klang/src/test/kotlin/klang/generator/TypeAliasGenerationTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/TypeAliasGenerationTest.kt @@ -3,17 +3,18 @@ package klang.generator import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.NativeTypeAlias +import klang.domain.NotBlankString import klang.mapper.toSpec import klang.parser.TestData -import klang.parser.TestData.basicFunctionPointer import klang.parser.testType class TypeAliasGenerationTest : FreeSpec({ "test type alias generation with void *" { - TestData.typeDef[0].toSpec("klang") + TestData.typeDef[0].toSpec("klang").first() .toString() shouldBe """ |public typealias NewType = com.sun.jna.Pointer | @@ -23,11 +24,30 @@ class TypeAliasGenerationTest : FreeSpec({ "test type alias generation with OldStructureType *" { - TestData.typeDef[1].toSpec("klang") + TestData.typeDef[1].toSpec("klang").first() .toString() shouldBe """ |public typealias NewStructureType = com.sun.jna.Pointer | """.trimMargin() } + + "test type alias generation with primitive type" { + val alias = NativeTypeAlias( + name = NotBlankString("NewType"), + typeRef = testType("int") + ) + + InMemoryDeclarationRepository().apply { + save(alias) + resolveTypes(allDeclarationsFilter) + } + + alias.toSpec("klang").joinToString("") shouldBe """ + |public typealias NewType = kotlin.Int + |public typealias `NewType${'$'}Array` = kotlin.IntArray + | + """.trimMargin() + } + }) \ No newline at end of file diff --git a/klang/klang/src/test/kotlin/klang/generator/UnionGenerationTest.kt b/klang/klang/src/test/kotlin/klang/generator/UnionGenerationTest.kt index 493ede1a..b4c08a25 100644 --- a/klang/klang/src/test/kotlin/klang/generator/UnionGenerationTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/UnionGenerationTest.kt @@ -3,28 +3,31 @@ package klang.generator import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.NativeStructure +import klang.domain.NotBlankString +import klang.domain.TypeRefField import klang.mapper.toSpec import klang.parser.testType class UnionGenerationTest : FreeSpec({ val structure = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf( - "first" to testType("long"), - "second" to testType("int"), - "third" to testType("float"), - "fourth" to testType("double"), - "fifth" to testType("void *"), - "string" to testType("char *"), + TypeRefField("first", testType("long")), + TypeRefField("second", testType("int")), + TypeRefField("third", testType("float")), + TypeRefField("fourth", testType("double")), + TypeRefField("fifth", testType("void *")), + TypeRefField("string", testType("char *")) ), isUnion = true, ) InMemoryDeclarationRepository().apply { save(structure) - resolveTypes() + resolveTypes(allDeclarationsFilter) } "generate kotlin union" { @@ -66,7 +69,7 @@ public open class MyStructure : com.sun.jna.Union { * mapped from char * */ @kotlin.jvm.JvmField - public var string: kotlin.String = "" + public var string: kotlin.String? = null public constructor(pointer: com.sun.jna.Pointer?) : super(pointer) @@ -92,7 +95,7 @@ public open class MyStructure : com.sun.jna.Union { val structureWithNoFields = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf() ) diff --git a/klang/klang/src/test/kotlin/klang/generator/StructureGenerationTest.kt b/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationTest.kt similarity index 79% rename from klang/klang/src/test/kotlin/klang/generator/StructureGenerationTest.kt rename to klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationTest.kt index efd0a10a..624ac4d7 100644 --- a/klang/klang/src/test/kotlin/klang/generator/StructureGenerationTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationTest.kt @@ -1,29 +1,32 @@ -package klang.generator +package klang.generator.structure import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.NativeStructure +import klang.domain.NotBlankString +import klang.domain.TypeRefField import klang.mapper.toSpec import klang.parser.testType class StructureGenerationTest : FreeSpec({ val structure = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf( - "first" to testType("long"), - "second" to testType("int"), - "third" to testType("float"), - "fourth" to testType("double"), - "fifth" to testType("void *"), - "string" to testType("char *"), + TypeRefField("first", testType("long")), + TypeRefField("second", testType("int")), + TypeRefField("third", testType("float")), + TypeRefField("fourth", testType("double")), + TypeRefField("fifth", testType("void *")), + TypeRefField("string", testType("char *")) ) ) InMemoryDeclarationRepository().apply { save(structure) - resolveTypes() + resolveTypes(allDeclarationsFilter) } "generate kotlin structure" { @@ -66,7 +69,7 @@ public open class MyStructure : com.sun.jna.Structure { * mapped from char * */ @kotlin.jvm.JvmField - public var string: kotlin.String = "" + public var string: kotlin.String? = null public constructor(pointer: com.sun.jna.Pointer?) : super(pointer) @@ -87,7 +90,7 @@ public open class MyStructure : com.sun.jna.Structure { val structureWithNoFields = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf() ) diff --git a/klang/klang/src/test/kotlin/klang/generator/StructureGenerationWithCallbackTest.kt b/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithCallbackTest.kt similarity index 83% rename from klang/klang/src/test/kotlin/klang/generator/StructureGenerationWithCallbackTest.kt rename to klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithCallbackTest.kt index 9ce63b81..7f90c683 100644 --- a/klang/klang/src/test/kotlin/klang/generator/StructureGenerationWithCallbackTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithCallbackTest.kt @@ -1,10 +1,13 @@ -package klang.generator +package klang.generator.structure import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.NativeStructure import klang.domain.NativeTypeAlias +import klang.domain.NotBlankString +import klang.domain.TypeRefField import klang.mapper.toSpec import klang.parser.TestData.basicFunctionPointer import klang.parser.testType @@ -12,22 +15,22 @@ import klang.parser.testType class StructureGenerationWithCallbackTest : FreeSpec({ val structure = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf( - "callback" to testType(basicFunctionPointer), - "callback2" to testType("MyAlias"), + TypeRefField("callback", testType(basicFunctionPointer)), + TypeRefField("callback2", testType("MyAlias")) ) ) val typeAlias = NativeTypeAlias( - name = "MyAlias", + name = NotBlankString("MyAlias"), typeRef = testType(basicFunctionPointer) ) InMemoryDeclarationRepository().apply { save(structure) save(typeAlias) - resolveTypes() + resolveTypes(allDeclarationsFilter) } "generate kotlin structure with callback" { @@ -37,8 +40,8 @@ class StructureGenerationWithCallbackTest : FreeSpec({ callback.toString() shouldBe """ |public interface MyStructureCallbackFunction : com.sun.jna.Callback { | public operator fun invoke( - | param1: com.sun.jna.Pointer, - | param2: kotlin.String, + | param1: com.sun.jna.Pointer?, + | param2: kotlin.String?, | param3: kotlin.Int, | ) |} @@ -79,7 +82,7 @@ public open class MyStructure : com.sun.jna.Structure { val structureWithNoFields = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf() ) diff --git a/klang/klang/src/test/kotlin/klang/generator/StructureGenerationWithEnumerationTest.kt b/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithEnumerationTest.kt similarity index 84% rename from klang/klang/src/test/kotlin/klang/generator/StructureGenerationWithEnumerationTest.kt rename to klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithEnumerationTest.kt index c692c568..d3428397 100644 --- a/klang/klang/src/test/kotlin/klang/generator/StructureGenerationWithEnumerationTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithEnumerationTest.kt @@ -1,31 +1,34 @@ -package klang.generator +package klang.generator.structure import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.NativeEnumeration import klang.domain.NativeStructure +import klang.domain.NotBlankString +import klang.domain.TypeRefField import klang.mapper.toSpec import klang.parser.testType class StructureGenerationWithEnumerationTest : FreeSpec({ val structure = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf( - "enumeration" to testType("MyEnumeration"), + TypeRefField("enumeration", testType("MyEnumeration")), ) ) val enumeration = NativeEnumeration( - name = "MyEnumeration", + name = NotBlankString("MyEnumeration"), values = listOf("first" to 1L) ) InMemoryDeclarationRepository().apply { save(structure) save(enumeration) - resolveTypes() + resolveTypes(allDeclarationsFilter) } "generate kotlin structure with enumeration" { @@ -59,7 +62,7 @@ public open class MyStructure : com.sun.jna.Structure { val structureWithNoFields = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf() ) diff --git a/klang/klang/src/test/kotlin/klang/generator/StructureGenerationWithPrimitiveArrayTest.kt b/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithPrimitiveArrayTest.kt similarity index 85% rename from klang/klang/src/test/kotlin/klang/generator/StructureGenerationWithPrimitiveArrayTest.kt rename to klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithPrimitiveArrayTest.kt index 44eed472..87258aac 100644 --- a/klang/klang/src/test/kotlin/klang/generator/StructureGenerationWithPrimitiveArrayTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithPrimitiveArrayTest.kt @@ -1,27 +1,30 @@ -package klang.generator +package klang.generator.structure import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.NativeStructure +import klang.domain.NotBlankString +import klang.domain.TypeRefField import klang.mapper.toSpec import klang.parser.testType class StructureGenerationWithPrimitiveArrayTest : FreeSpec({ val structure = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf( - "first" to testType("int[10]").also { + TypeRefField("first", testType("int[10]").also { it.isArray = true it.arraySize = 10 - }, + }), ) ) InMemoryDeclarationRepository().apply { save(structure) - resolveTypes() + resolveTypes(allDeclarationsFilter) } "generate kotlin structure with primitive array" { @@ -55,7 +58,7 @@ public open class MyStructure : com.sun.jna.Structure { val structureWithNoFields = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf() ) diff --git a/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithTypeAliasAndArray.kt b/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithTypeAliasAndArray.kt new file mode 100644 index 00000000..c249f5f2 --- /dev/null +++ b/klang/klang/src/test/kotlin/klang/generator/structure/StructureGenerationWithTypeAliasAndArray.kt @@ -0,0 +1,69 @@ +package klang.generator.structure + +import io.kotest.core.spec.style.FreeSpec +import io.kotest.matchers.shouldBe +import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter +import klang.domain.NativeStructure +import klang.domain.NativeTypeAlias +import klang.domain.NotBlankString +import klang.domain.TypeRefField +import klang.mapper.toSpec +import klang.parser.testType + +class StructureGenerationWithTypeAliasAndArray : FreeSpec({ + + val alias = NativeTypeAlias( + name = NotBlankString("NewType"), + typeRef = testType("int") + ) + + val structure = NativeStructure( + name = NotBlankString("MyStructure"), + fields = listOf( + TypeRefField("first", testType("NewType")), + TypeRefField("second", testType("NewType[4]")), + ) + ) + + InMemoryDeclarationRepository().apply { + save(alias) + save(structure) + resolveTypes(allDeclarationsFilter) + } + + "generate kotlin structure" { + structure.toSpec("test").apply { + size shouldBe 1 + first().toString() shouldBe """ +@com.sun.jna.Structure.FieldOrder("first", "second") +public open class MyStructure : com.sun.jna.Structure { + /** + * mapped from NewType + */ + @kotlin.jvm.JvmField + public var first: test.NewType = 0 + + /** + * mapped from NewType[4] + */ + @kotlin.jvm.JvmField + public var second: test.`NewType${'$'}Array` = `NewType${'$'}Array`(4) + + public constructor(pointer: com.sun.jna.Pointer?) : super(pointer) + + public constructor() + + public class ByReference( + pointer: com.sun.jna.Pointer? = null, + ) : MyStructure(pointer), com.sun.jna.Structure.ByReference + + public class ByValue( + pointer: com.sun.jna.Pointer? = null, + ) : MyStructure(pointer), com.sun.jna.Structure.ByValue +} + + """.trimIndent() + } + } +}) diff --git a/klang/klang/src/test/kotlin/klang/generator/StructureWithStructureGenerationTest.kt b/klang/klang/src/test/kotlin/klang/generator/structure/StructureWithStructureGenerationTest.kt similarity index 72% rename from klang/klang/src/test/kotlin/klang/generator/StructureWithStructureGenerationTest.kt rename to klang/klang/src/test/kotlin/klang/generator/structure/StructureWithStructureGenerationTest.kt index c2bcdf45..4a79fe1b 100644 --- a/klang/klang/src/test/kotlin/klang/generator/StructureWithStructureGenerationTest.kt +++ b/klang/klang/src/test/kotlin/klang/generator/structure/StructureWithStructureGenerationTest.kt @@ -1,46 +1,56 @@ -package klang.generator +package klang.generator.structure import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.NativeStructure +import klang.domain.NotBlankString +import klang.domain.TypeRefField import klang.mapper.toSpec import klang.parser.testType class StructureWithStructureGenerationTest : FreeSpec({ val structure = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf( - "structure" to testType("struct MyOtherStructure"), + TypeRefField("structure", testType("MyOtherStructure")), + TypeRefField("structure2", testType("MyOtherStructure *")), ) ) val otherStructure = NativeStructure( - name = "MyOtherStructure", + name = NotBlankString("MyOtherStructure"), fields = listOf( - "structure" to testType("long"), + TypeRefField("structure", testType("long")), ) ) InMemoryDeclarationRepository().apply { save(otherStructure) save(structure) - resolveTypes() + resolveTypes(allDeclarationsFilter) } "generate kotlin structure" { structure.toSpec("test").apply { size shouldBe 1 first().toString() shouldBe """ -@com.sun.jna.Structure.FieldOrder("structure") +@com.sun.jna.Structure.FieldOrder("structure", "structure2") public open class MyStructure : com.sun.jna.Structure { /** - * mapped from struct MyOtherStructure + * mapped from MyOtherStructure */ @kotlin.jvm.JvmField public var structure: test.MyOtherStructure = MyOtherStructure() + /** + * mapped from MyOtherStructure * + */ + @kotlin.jvm.JvmField + public var structure2: com.sun.jna.Pointer? = null + public constructor(pointer: com.sun.jna.Pointer?) : super(pointer) public constructor() @@ -60,7 +70,7 @@ public open class MyStructure : com.sun.jna.Structure { val structureWithNoFields = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf() ) diff --git a/klang/klang/src/test/kotlin/klang/mapper/EnumerationMapperTest.kt b/klang/klang/src/test/kotlin/klang/mapper/EnumerationMapperTest.kt index 4579d346..782a6b5a 100644 --- a/klang/klang/src/test/kotlin/klang/mapper/EnumerationMapperTest.kt +++ b/klang/klang/src/test/kotlin/klang/mapper/EnumerationMapperTest.kt @@ -3,11 +3,12 @@ package klang.mapper import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import klang.domain.NativeEnumeration +import klang.domain.NotBlankString class EnumerationMapperTest : FreeSpec({ val enumeration = NativeEnumeration( - name = "MyEnum", + name = NotBlankString("MyEnum"), values = listOf( "FIRST" to 1, "SECOND" to 2, @@ -17,7 +18,7 @@ class EnumerationMapperTest : FreeSpec({ "generate kotlin enumeration specifications" { enumeration.toSpecAsEnumeration("mypackage").apply { - name shouldBe enumeration.name + name shouldBe enumeration.name.value enumConstants.size shouldBe enumeration.values.size enumConstants.map { it.key } shouldBe enumeration.values.map { it.first } } diff --git a/klang/klang/src/test/kotlin/klang/mapper/TypeTest.kt b/klang/klang/src/test/kotlin/klang/mapper/TypeTest.kt index 03a93b64..9b3f7e81 100644 --- a/klang/klang/src/test/kotlin/klang/mapper/TypeTest.kt +++ b/klang/klang/src/test/kotlin/klang/mapper/TypeTest.kt @@ -1,9 +1,11 @@ package klang.mapper +import com.squareup.kotlinpoet.ClassName import io.kotest.core.spec.style.FreeSpec import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import klang.InMemoryDeclarationRepository +import klang.allDeclarationsFilter import klang.domain.* import klang.parser.TestData import klang.parser.testType @@ -11,20 +13,20 @@ import klang.parser.testType class TypeTest : FreeSpec({ val structure = NativeStructure( - name = "MyStructure", + name = NotBlankString("MyStructure"), fields = listOf( - "callback" to testType(TestData.basicFunctionPointer), - "callback2" to testType("MyAlias"), + TypeRefField("callback", testType(TestData.basicFunctionPointer)), + TypeRefField("callback2", testType("MyAlias")), ) ) val typeAlias = NativeTypeAlias( - name = "MyAlias", + name = NotBlankString("MyAlias"), typeRef = testType(TestData.basicFunctionPointer) ) val primitiveArrayTypeAlias = NativeTypeAlias( - name = "MyAliasWithPrimitiveArray", + name = NotBlankString("MyAliasWithPrimitiveArray"), typeRef = testType("int[10]") ) @@ -32,15 +34,15 @@ class TypeTest : FreeSpec({ save(structure) save(typeAlias) save(primitiveArrayTypeAlias) - resolveTypes() + resolveTypes(allDeclarationsFilter) } "toType" { - structure.fields[0].second.toType("test") shouldBe jnaCallback - structure.fields[1].second.toType("test") shouldBe jnaCallback + (structure.fields[0] as TypeRefField).type.toType("test") shouldBe jnaCallback + (structure.fields[1]as TypeRefField).type.toType("test") shouldBe ClassName("test", "MyAlias") primitiveArrayTypeAlias.typeRef .let { it as? ResolvedTypeRef } - .also { it shouldNotBe null } + .also { it shouldNotBe null } ?.also { (it.type is FixeSizeType) shouldBe true it.isArray shouldBe true diff --git a/klang/klang/src/test/kotlin/klang/parser/ParserTestCommon.kt b/klang/klang/src/test/kotlin/klang/parser/ParserTestCommon.kt index 02604cfe..9b6d90d2 100644 --- a/klang/klang/src/test/kotlin/klang/parser/ParserTestCommon.kt +++ b/klang/klang/src/test/kotlin/klang/parser/ParserTestCommon.kt @@ -2,14 +2,20 @@ package klang.parser import io.kotest.core.annotation.Ignored import io.kotest.core.spec.style.FreeSpec -import io.kotest.core.spec.style.StringSpec import io.kotest.core.spec.style.scopes.FreeSpecContainerScope -import io.kotest.core.spec.style.scopes.FreeSpecTerminalScope import io.kotest.matchers.shouldBe import klang.DeclarationRepository +import klang.InMemoryDeclarationRepository +import klang.domain.NativeConstant import klang.domain.NativeStructure -import klang.domain.TypeRef +import klang.domain.NotBlankString +import klang.generator.JnaBindingGenerator +import klang.helper.HeaderManager import klang.parser.json.ParserRepository +import klang.parser.libclang.parseFile +import java.io.File +import java.nio.charset.StandardCharsets +import java.nio.file.Files @Ignored open class ParserTestCommon(body: FreeSpec.() -> Unit = {}) : FreeSpec({ @@ -25,7 +31,35 @@ open class ParserTestCommon(body: FreeSpec.() -> Unit = {}) : FreeSpec({ body() }) - suspend fun FreeSpecContainerScope.validateEnumerations(repository: DeclarationRepository, enumerations: List>>>) { +suspend fun File.parseIt(block: suspend DeclarationRepository.() -> Unit): DeclarationRepository = + InMemoryDeclarationRepository() + .parseFile(name, parent) + .also { it.block() } + +suspend fun DeclarationRepository.generateJNABinding(block: suspend (List) -> Unit) { + with(JnaBindingGenerator) { + generateKotlinFiles( + HeaderManager.createTemporaryHeaderDirectory().toFile(), + "test", + "test" + ).let { block(it) } + } +} + +fun createHeader(fileName: String, function: () -> String): File { + val tempDirectory = HeaderManager.createTemporaryHeaderDirectory() + val headerFile = tempDirectory.resolve(fileName) + val content = function() + check(content.isNotBlank()) { "header code should not be blank" } + Files.write(headerFile, content.toByteArray(StandardCharsets.UTF_8)) + + return headerFile.toFile() +} + +suspend fun FreeSpecContainerScope.validateEnumerations( + repository: DeclarationRepository, + enumerations: List>>> +) { enumerations.forEach { (name, values) -> "test $name" { repository.findEnumerationByName(name) @@ -35,7 +69,10 @@ open class ParserTestCommon(body: FreeSpec.() -> Unit = {}) : FreeSpec({ } } -suspend fun FreeSpecContainerScope.validateStructures(repository: DeclarationRepository, structures: List) { +suspend fun FreeSpecContainerScope.validateStructures( + repository: DeclarationRepository, + structures: List +) { structures.forEach { (name, fields, isUnion) -> "test $name" { repository.findStructureByName(name) @@ -45,3 +82,16 @@ suspend fun FreeSpecContainerScope.validateStructures(repository: DeclarationRep } } } + +suspend fun FreeSpecContainerScope.validateConstants( + repository: DeclarationRepository, + constants: List> +) { + constants.forEach { (name, value, _) -> + "expected $name with value $value" { + repository.findConstantByName(name) + .also { it?.name shouldBe name } + .also { it?.value shouldBe value } + } + } +} diff --git a/klang/klang/src/test/kotlin/klang/parser/TestData.kt b/klang/klang/src/test/kotlin/klang/parser/TestData.kt index 7a61708e..b42438d8 100644 --- a/klang/klang/src/test/kotlin/klang/parser/TestData.kt +++ b/klang/klang/src/test/kotlin/klang/parser/TestData.kt @@ -2,7 +2,9 @@ package klang.parser import klang.domain.* -fun testType(name: String) = typeOf(name).let { +fun testType(name: String) = testType(NotBlankString(name)) + +fun testType(name: NotBlankString) = typeOf(name.value).let { it.unchecked("fail to create type $name, cause: ${it.leftOrNull()}") } @@ -10,28 +12,34 @@ object TestData { val functions = listOf( NativeFunction( - name = "function", + name = NotBlankString("function"), returnType = testType("char"), arguments = listOf( - NativeFunction.Argument("a", testType("int *")), - NativeFunction.Argument("b", testType("void *")), - NativeFunction.Argument("myEnum", testType("enum EnumName")), + NativeFunction.Argument(NotBlankString("a"), testType("int *")), + NativeFunction.Argument(NotBlankString("b"), testType("void *")), + NativeFunction.Argument(NotBlankString("myEnum"), testType("enum EnumName")), ) ), NativeFunction( - name = "function2", + name = NotBlankString("function2"), returnType = testType("void *"), arguments = listOf() + ), + + NativeFunction( + name = NotBlankString("function3"), + returnType = testType("struct StructName *"), + arguments = listOf() ) ) val objectiveCEnumeration = listOf( - "MyEnum" to listOf( + NotBlankString("MyEnum") to listOf( "kValue1" to 0L, "kValue2" to 1L, "kValue3" to 2L ), - "MyEnum2" to listOf( + NotBlankString("MyEnum2") to listOf( "kValue4" to 0L, "kValue5" to 1L, "kValue6" to 2L @@ -40,34 +48,34 @@ object TestData { val objectiveCCategory = listOf( ObjectiveCCategory( - name = "MyCategory", + name = NotBlankString("MyCategory"), superType = testType("MyClass"), methods = listOf( - ObjectiveCClass.Method("newMethod", testType("void"), true), + ObjectiveCClass.Method(NotBlankString("newMethod"), testType("void"), true), ) ) ) val objectiveCProtocol = listOf( ObjectiveCProtocol( - name = "MyProtocol", + name = NotBlankString("MyProtocol"), protocols = setOf("NSObject"), properties = listOf(), methods = listOf( - ObjectiveCClass.Method("method1", testType("void"), true), - ObjectiveCClass.Method("method2", testType("NSString *"), true) + ObjectiveCClass.Method(NotBlankString("method1"), testType("void"), true), + ObjectiveCClass.Method(NotBlankString("method2"), testType("NSString *"), true) ) ) ) val objectiveCClass = listOf( ObjectiveCClass( - name = "TestClass", + name = NotBlankString("TestClass"), superType = testType("NSObject"), protocols = setOf(testType("NSCopying")), properties = listOf( ObjectiveCClass.Property( - "testProperty", + NotBlankString("testProperty"), "NSString *", nonatomic = true, assign = true, @@ -76,9 +84,9 @@ object TestData { ) ), methods = listOf( - ObjectiveCClass.Method("testMethod", testType("void"), true), + ObjectiveCClass.Method(NotBlankString("testMethod"), testType("void"), true), ObjectiveCClass.Method( - "testMethod:withParameter:", testType("BOOL"), false, listOf( + NotBlankString("testMethod:withParameter:"), testType("BOOL"), false, listOf( ObjectiveCClass.Method.Argument("parameter", testType("NSString *")), ObjectiveCClass.Method.Argument("testParameter", testType("NSString *")), ) @@ -88,8 +96,8 @@ object TestData { ) val enumerations = listOf( - "EnumName" to listOf("Value1" to 0x2L, "Value2" to 0x1L), - "EnumNameWithoutExplicitValues" to listOf( + NotBlankString("EnumName") to listOf("Value1" to 0x2L, "Value2" to 0x1L), + NotBlankString("EnumNameWithoutExplicitValues") to listOf( "EnumNameWithoutExplicitValues_Value1" to 0L, "EnumNameWithoutExplicitValues_Value2" to 1L ) @@ -97,11 +105,11 @@ object TestData { val union = listOf( NativeStructure( - name = "MyUnion", + name = NotBlankString("MyUnion"), fields = listOf( - "i" to testType("int"), - "f" to testType("float"), - "c" to testType("char"), + TypeRefField("i", testType("int")), + TypeRefField("f", testType("float")), + TypeRefField("c", testType("char")), ), isUnion = true @@ -111,19 +119,19 @@ object TestData { val structures = listOf( NativeStructure( - name = "StructName", + name = NotBlankString("StructName"), fields = listOf( - "field1" to testType("enum EnumName *"), - "field2" to testType("EnumName2"), - "field3" to testType("char") + TypeRefField("field1", testType("enum EnumName *")), + TypeRefField("field2", testType("EnumName2")), + TypeRefField("field3", testType("char")) ) ), NativeStructure( - name = "StructName2", + name = NotBlankString("StructName2"), fields = listOf( - "field1" to testType("struct StructName"), - "field2" to testType("struct StructName *"), - "field3" to testType("char") + TypeRefField("field1", testType("struct StructName")), + TypeRefField("field2", testType("struct StructName *")), + TypeRefField("field3", testType("char")) ) ) ) @@ -131,33 +139,120 @@ object TestData { val typeDefStructures = listOf( NativeStructure( - name = "StructName", + name = NotBlankString("StructName"), fields = listOf( - "field1" to testType("enum EnumName *"), - "field2" to testType("EnumName2"), - "field3" to testType("char") + TypeRefField("field1", testType("enum EnumName *")), + TypeRefField("field2", testType("EnumName2")), + TypeRefField("field3", testType("char")) ) ), NativeStructure( - name = "StructName2", + name = NotBlankString("StructName2"), fields = listOf( - "field1" to testType("StructName"), - "field2" to testType("StructName *"), - "field3" to testType("char") + TypeRefField("field1", testType("StructName")), + TypeRefField("field2", testType("StructName *")), + TypeRefField("field3", testType("char")) ) ) ) val typeDef = listOf( NativeTypeAlias( - name = "NewType", + name = NotBlankString("NewType"), typeRef = testType("void *") ), NativeTypeAlias( - name = "NewStructureType", + name = NotBlankString("NewStructureType"), typeRef = testType("struct OldStructureType *") ) ) - const val basicFunctionPointer = "void (*)(void *, char *, int)" + val basicFunctionPointer = NotBlankString("void (*)(void *, char *, int)") + + val exaustiveTypeDef = listOf( + NativeTypeAlias( + name = NotBlankString("signed_char_t"), + typeRef = testType("char") + ), + NativeTypeAlias( + name = NotBlankString("signed_int_t"), + typeRef = testType("int") + ), + NativeTypeAlias( + name = NotBlankString("signed_short_t"), + typeRef = testType("short") + ), + NativeTypeAlias( + name = NotBlankString("signed_long_t"), + typeRef = testType("long") + ), + NativeTypeAlias( + name = NotBlankString("signed_long_long_t"), + typeRef = testType("long long") + ), + NativeTypeAlias( + name = NotBlankString("unsigned_char_t"), + typeRef = testType("unsigned char") + ), + NativeTypeAlias( + name = NotBlankString("unsigned_int_t"), + typeRef = testType("unsigned int") + ), + NativeTypeAlias( + name = NotBlankString("unsigned_short_t"), + typeRef = testType("unsigned short") + ), + NativeTypeAlias( + name = NotBlankString("unsigned_long_t"), + typeRef = testType("unsigned long") + ), + NativeTypeAlias( + name = NotBlankString("unsigned_long_long_t"), + typeRef = testType("unsigned long long") + ), + NativeTypeAlias( + name = NotBlankString("arr_of_int_t"), + typeRef = testType("int[10]") + ), + NativeTypeAlias( + name = NotBlankString("arr_of_float_t"), + typeRef = testType("float[10]") + ), + NativeTypeAlias( + name = NotBlankString("arr_of_char_t"), + typeRef = testType("char[10]") + ), + NativeTypeAlias( + name = NotBlankString("arr_of_double_t"), + typeRef = testType("double[10]") + ), + NativeTypeAlias( + name = NotBlankString("arr_of_unsigned_char_t"), + typeRef = testType("char[10]") + ) + ) + + val stringConstants = listOf( + NativeConstant(NotBlankString("STRING_CONSTANT1"), "Hello"), + NativeConstant(NotBlankString("STRING_CONSTANT2"), "World"), + NativeConstant(NotBlankString("STRING_CONSTANT3"), "AI"), + NativeConstant(NotBlankString("STRING_CONSTANT4"), "Programming"), + NativeConstant(NotBlankString("STRING_CONSTANT5"), "Assistant") + ) + + val longConstants = listOf( + NativeConstant(NotBlankString("LONG_CONSTANT1"), 10000000000L), + NativeConstant(NotBlankString("LONG_CONSTANT2"), 20000000000L), + NativeConstant(NotBlankString("LONG_CONSTANT3"), 30000000000L), + NativeConstant(NotBlankString("LONG_CONSTANT4"), 40000000000L), + NativeConstant(NotBlankString("LONG_CONSTANT5"), 50000000000L) + ) + + val doubleConstants = listOf( + NativeConstant(NotBlankString("DOUBLE_CONSTANT1"), 1.11), + NativeConstant(NotBlankString("DOUBLE_CONSTANT2"), 2.22), + NativeConstant(NotBlankString("DOUBLE_CONSTANT3"), 3.33), + NativeConstant(NotBlankString("DOUBLE_CONSTANT4"), 4.44), + NativeConstant(NotBlankString("DOUBLE_CONSTANT5"), 5.55) + ) } \ No newline at end of file diff --git a/klang/klang/src/test/kotlin/klang/parser/json/darwin/CocoaItTest.kt b/klang/klang/src/test/kotlin/klang/parser/json/darwin/CocoaItTest.kt index 2b163789..53e369b6 100644 --- a/klang/klang/src/test/kotlin/klang/parser/json/darwin/CocoaItTest.kt +++ b/klang/klang/src/test/kotlin/klang/parser/json/darwin/CocoaItTest.kt @@ -26,7 +26,7 @@ class CocoaItTest : FreeSpec({ declarations .asSequence() .filterIsInstance() - .filter { it.name == "NSWindow" } + .filter { it.name.value == "NSWindow" } .forEach { println(it) } } diff --git a/klang/klang/src/test/kotlin/klang/parser/json/darwin/FoundationItTest.kt b/klang/klang/src/test/kotlin/klang/parser/json/darwin/FoundationItTest.kt index 9a7b0e0d..206cafca 100644 --- a/klang/klang/src/test/kotlin/klang/parser/json/darwin/FoundationItTest.kt +++ b/klang/klang/src/test/kotlin/klang/parser/json/darwin/FoundationItTest.kt @@ -25,7 +25,7 @@ class FoundationItTest : FreeSpec({ declarations .asSequence() .filterIsInstance() - .filter { it.name.startsWith("NS") } + .filter { it.name.value.startsWith("NS") } .forEach { println(it) } } diff --git a/klang/klang/src/test/kotlin/klang/parser/json/darwin/MetalItTest.kt b/klang/klang/src/test/kotlin/klang/parser/json/darwin/MetalItTest.kt index 5d6d48bd..89a31e7e 100644 --- a/klang/klang/src/test/kotlin/klang/parser/json/darwin/MetalItTest.kt +++ b/klang/klang/src/test/kotlin/klang/parser/json/darwin/MetalItTest.kt @@ -25,7 +25,7 @@ class MetalItTest : FreeSpec({ declarations .asSequence() .filterIsInstance() - .filter { it.name.startsWith("NS") } + .filter { it.name.value.startsWith("NS") } .forEach { println(it) } } diff --git a/klang/klang/src/test/kotlin/klang/parser/libclang/CConstantParserTest.kt b/klang/klang/src/test/kotlin/klang/parser/libclang/CConstantParserTest.kt new file mode 100644 index 00000000..2090688f --- /dev/null +++ b/klang/klang/src/test/kotlin/klang/parser/libclang/CConstantParserTest.kt @@ -0,0 +1,68 @@ +package klang.parser.libclang + +import io.kotest.matchers.shouldBe +import io.kotest.matchers.shouldNotBe +import klang.parser.* +import mu.KotlinLogging + +private val logger = KotlinLogging.logger {} + +class CConstantParserTest : ParserTestCommon({ + + "test parsing of string constants" - { + // Given + createHeader("string-constants.h") { + """ + #define STRING_CONSTANT1 "Hello" + #define STRING_CONSTANT2 "World" + #define STRING_CONSTANT3 "AI" + #define STRING_CONSTANT4 "Programming" + #define STRING_CONSTANT5 "Assistant" + """.trimIndent() + // When + }.parseIt { + + //Then + validateConstants(this, TestData.stringConstants) + } + } + + "test parsing of long constants" - { + // Given + createHeader("long-constants.h") { + """ + #define LONG_CONSTANT1 10000000000L + #define LONG_CONSTANT2 20000000000L + #define LONG_CONSTANT3 30000000000L + #define LONG_CONSTANT4 40000000000L + #define LONG_CONSTANT5 50000000000L + """.trimIndent() + // When + }.parseIt { + + //Then + validateConstants(this, TestData.longConstants) + } + } + + "test parsing of double constants" - { + // Given + createHeader("double-constants.h") { + """ + #define DOUBLE_CONSTANT1 1.11 + #define DOUBLE_CONSTANT2 2.22 + #define DOUBLE_CONSTANT3 3.33 + #define DOUBLE_CONSTANT4 4.44 + #define DOUBLE_CONSTANT5 5.55 + """.trimIndent() + // When + }.parseIt { + + //Then + validateConstants(this, TestData.doubleConstants) + } + } + +}) + + diff --git a/klang/klang/src/test/kotlin/klang/parser/libclang/LibClangParserTest.kt b/klang/klang/src/test/kotlin/klang/parser/libclang/LibClangParserTest.kt index f250ef1c..3d44f60a 100644 --- a/klang/klang/src/test/kotlin/klang/parser/libclang/LibClangParserTest.kt +++ b/klang/klang/src/test/kotlin/klang/parser/libclang/LibClangParserTest.kt @@ -1,6 +1,7 @@ package klang.parser.libclang import io.kotest.matchers.shouldBe +import klang.InMemoryDeclarationRepository import klang.parser.ParserTestCommon import klang.parser.TestData import klang.parser.validateEnumerations @@ -8,12 +9,40 @@ import klang.parser.validateStructures class LibClangParserTest : ParserTestCommon({ + "test types parsing" - { + // Given + val filePath = "src/test/c/types.h" + + // When + val repository = InMemoryDeclarationRepository().parseFile(filePath) + + // Then + TestData.exaustiveTypeDef.forEach { (name, type) -> + "test $name" { + repository.findTypeAliasByName(name) + .also { it?.name shouldBe name } + .also { it?.typeRef shouldBe type } + } + } + } + + "test union parsing" - { + // Given + val filePath = "src/test/c/union.h" + + // When + val repository = InMemoryDeclarationRepository().parseFile(filePath) + + // Then + validateStructures(repository, TestData.union) + } + "test enum parsing" - { // Given val filePath = "src/test/c/enum.h" // When - val repository = parseFile(filePath) + val repository = InMemoryDeclarationRepository().parseFile(filePath) // Then validateEnumerations(repository, TestData.enumerations) @@ -24,7 +53,7 @@ class LibClangParserTest : ParserTestCommon({ val filePath = "src/test/c/typedef-enum.h" // When - val repository = parseFile(filePath) + val repository = InMemoryDeclarationRepository().parseFile(filePath) // Then validateEnumerations(repository, TestData.enumerations) @@ -36,7 +65,7 @@ class LibClangParserTest : ParserTestCommon({ val filePath = "src/test/c/struct.h" // When - val repository = parseFile(filePath) + val repository = InMemoryDeclarationRepository().parseFile(filePath) // Then validateStructures(repository, TestData.structures) @@ -47,50 +76,47 @@ class LibClangParserTest : ParserTestCommon({ val filePath = "src/test/c/typedef-struct.h" // When - val repository = parseFile(filePath) + val repository = InMemoryDeclarationRepository().parseFile(filePath) // Then validateStructures(repository, TestData.typeDefStructures) } - "typedef parsing" { + "typedef parsing" - { // Given val filePath = "src/test/c/typedef.h" // When - val repository = parseFile(filePath) + val repository = InMemoryDeclarationRepository().parseFile(filePath) // Then TestData.typeDef.forEach { (name, type) -> - repository.findTypeAliasByName(name) - .also { it?.name shouldBe name } - .also { it?.typeRef shouldBe type } + "test $name" { + repository.findTypeAliasByName(name) + .also { it?.name shouldBe name } + .also { it?.typeRef shouldBe type } + } } } - "function parsing" { + "function parsing" - { // Given val filePath = "src/test/c/functions.h" // When - val repository = parseFile(filePath) + val repository = InMemoryDeclarationRepository().parseFile(filePath) // Then - repository.findFunctionByName("function") - .also { it?.name shouldBe "function" } - .also { it?.returnType shouldBe "char" } - .also { - it?.arguments - ?.map { (name, type) -> name to type }shouldBe listOf( - "a" to "int *", - "b" to "void *", - "myEnum" to "enum EnumName" - ) + TestData + .functions + .forEach { function -> + "test function with name ${function.name}" { + repository.findFunctionByName(function.name) + .also { it?.name shouldBe function.name} + .also { it?.returnType shouldBe function.returnType } + .also { it?.arguments shouldBe function.arguments } + } } - - repository.findFunctionByName("function2") - .also { it?.name shouldBe "function2" } - .also { it?.returnType shouldBe "void *" } - .also { it?.arguments shouldBe listOf() } } + }) \ No newline at end of file diff --git a/klang/klang/src/test/kotlin/klang/parser/libclang/SDL2ItTest.kt b/klang/klang/src/test/kotlin/klang/parser/libclang/SDL2ItTest.kt new file mode 100644 index 00000000..26233c0e --- /dev/null +++ b/klang/klang/src/test/kotlin/klang/parser/libclang/SDL2ItTest.kt @@ -0,0 +1,70 @@ +package klang.parser.libclang + +import io.kotest.matchers.shouldBe +import io.kotest.matchers.shouldNotBe +import klang.DeclarationRepository +import klang.InMemoryDeclarationRepository +import klang.domain.NativeEnumeration +import klang.helper.HeaderManager +import klang.helper.HeaderManager.inferPlatformSuffix +import klang.helper.unzipFromClasspath +import klang.parser.ParserTestCommon +import mu.KotlinLogging +import java.nio.file.Path +import kotlin.io.path.absolutePathString + +private val logger = KotlinLogging.logger {} + +class SDL2ItTest : ParserTestCommon({ + + "test SDL2 parsing" { + + // Given + val (tempDirectory, otherHeaderTempDirectoryPath) = initSDL2HeaderDirectory() + val SDL2header = "SDL2/SDL.h" + val SDL2OpenglESheader = "SDL2/SDL_opengles2.h" + val SDL2SysHeader = "SDL2/SDL_syswm.h" + val filePath = tempDirectory.absolutePathString() + val headerPaths = HeaderManager.listPlatformHeadersFromPath(otherHeaderTempDirectoryPath) + + // When + val repository = InMemoryDeclarationRepository() + .parseFile(SDL2header, filePath, headerPaths) + .parseFile(SDL2OpenglESheader, filePath, headerPaths, mapOf("SDL_USE_BUILTIN_OPENGL_DEFINITIONS" to "1")) + // And + .also(DeclarationRepository::resolveTypes) + // And + .also { it.parseFile(SDL2SysHeader, filePath, headerPaths) } + + // Then + repository.apply { + val libraryDeclarations = findLibraryDeclaration() + + libraryDeclarations.filterIsInstance() + .forEach { + logger.info("testing ${it.name} enumeration") + it.name.value.isNotBlank() shouldBe true + it.values.isEmpty() shouldNotBe true + } + + findFunctionByName("SDL_ReportAssertion") shouldNotBe null + findFunctionByName("glGetString") shouldNotBe null + findStructureByName("SDL_Rect") shouldNotBe null + } + + } +}) + +private fun initSDL2HeaderDirectory(): Pair { + val tempDirectoryPath = HeaderManager.createTemporaryHeaderDirectory("SDL2") + val otherHeaderTempDirectoryPath = HeaderManager.createTemporaryHeaderDirectory("headers") + + logger.info { "will use directory ${tempDirectoryPath.absolutePathString()} to parse SDL2" } + + HeaderManager.putPlatformHeaderAt(otherHeaderTempDirectoryPath) + + val sdl2HeadersFile = "/SDL2-headers-${inferPlatformSuffix()}.zip" + unzipFromClasspath(sdl2HeadersFile, tempDirectoryPath.toFile()) + + return tempDirectoryPath to otherHeaderTempDirectoryPath +} diff --git a/klang/klang/src/test/resources/SDL2-headers-darwin.zip b/klang/klang/src/test/resources/SDL2-headers-darwin.zip new file mode 100644 index 00000000..53aae810 Binary files /dev/null and b/klang/klang/src/test/resources/SDL2-headers-darwin.zip differ diff --git a/klang/klang/src/test/resources/SDL2-headers-linux.zip b/klang/klang/src/test/resources/SDL2-headers-linux.zip new file mode 100644 index 00000000..25a7d23f Binary files /dev/null and b/klang/klang/src/test/resources/SDL2-headers-linux.zip differ diff --git a/klang/settings.gradle.kts b/klang/settings.gradle.kts index a7cff26f..63354c85 100644 --- a/klang/settings.gradle.kts +++ b/klang/settings.gradle.kts @@ -2,4 +2,5 @@ rootProject.name = "klang-toolkit" include("docker-toolkit", "klang", "libclang", "toolkit-old") include("gradle-plugin") +include("jextract") findProject(":gradle-plugin")?.name = "klang-gradle-plugin" diff --git a/klang/toolkit-old/src/main/kotlin/klang/parser/TypeMaker.kt b/klang/toolkit-old/src/main/kotlin/klang/parser/TypeMaker.kt index e469b266..14730b26 100644 --- a/klang/toolkit-old/src/main/kotlin/klang/parser/TypeMaker.kt +++ b/klang/toolkit-old/src/main/kotlin/klang/parser/TypeMaker.kt @@ -54,7 +54,7 @@ class TypeMaker(private val treeMaker: TreeMaker, val parsingContext: ParsingCon } fun declareClass(scopeClass: Scoped, type: Type) { - assert(type.kind == TypeKind.Record) { "illegal state with kind ${type.kind} instead of ${TypeKind.Record}" } + check(type.kind == TypeKind.Record) { "illegal state with kind ${type.kind} instead of ${TypeKind.Record}" } parsingContext.addTyped(type, Typed.Declared(scopeClass.cursor.fullName, scopeClass)) } diff --git a/klang/toolkit-old/src/test/kotlin/klang/TestUtils.kt b/klang/toolkit-old/src/test/kotlin/klang/TestUtils.kt index 2f4b3cd7..1d5a23d4 100644 --- a/klang/toolkit-old/src/test/kotlin/klang/TestUtils.kt +++ b/klang/toolkit-old/src/test/kotlin/klang/TestUtils.kt @@ -18,7 +18,7 @@ fun createOrCompare(actual: String, expectedFileName: String) { val out = PrintWriter(File(expectedFileName)) out.print(actual) out.close() - assert(actual == "") { + check(actual == "") { "Expected file wasn't found, it will be created" } } catch (ee: IOException) { diff --git a/run-ubuntu-amd64.sh b/run-ubuntu-amd64.sh new file mode 100644 index 00000000..67b2c7f4 --- /dev/null +++ b/run-ubuntu-amd64.sh @@ -0,0 +1 @@ +docker run -v $(pwd):/app -w /app -it ubuntu-all-tools:jdk21-adm64