### Initial Page Setup Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-queue-work-done-callback-info/-companion/allocate.html This JavaScript code handles initial page setup, including theme switching based on local storage or OS preferences, and replacing 'no-js' class with 'js'. ```JavaScript var pathToRoot = "../../../../\n"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### Initial JavaScript Setup Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-request-adapter-callback-info/[native]-by-value/callback.html This JavaScript code snippet handles initial page setup, including dark mode preference detection from localStorage and applying the 'theme-dark' class to the HTML element if necessary. It also replaces 'no-js' with 'js' class on the document element. ```JavaScript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### Initial JavaScript for Page Setup Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-functions/wgpu-device-get-limits.html This JavaScript code is responsible for initial page setup, including toggling the 'js' class and handling dark mode preferences based on local storage or OS settings. ```JavaScript var pathToRoot = "../..\/..\/.."; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### JavaScript Theme and Path Setup Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-vertex-state/[android]-by-reference/constant-count.html This script handles initial page setup, including replacing 'no-js' with 'js' classes, and managing dark mode preferences based on OS settings or local storage. It also defines a base path for assets. ```javascript var pathToRoot = "../../../../\"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### JavaScript Page Setup Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-functions/wgpu-device-get-adapter-info.html Initializes page elements and handles dark mode preference based on OS settings or local storage. ```JavaScript var pathToRoot = "../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### get Function Documentation Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-buffer-binding-layout/index.html Documentation for the 'get' function, likely used for memory segment access. ```APIDOC get (Function) jvm: open fun get(layout: StructLayout, offset: Long): MemorySegment ``` -------------------------------- ### Kotlin CStructure get Method Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/ffi/[jvm]-c-structure/get.html Provides the signature and documentation for the 'get' method in the CStructure class. This method is used to retrieve a MemorySegment from a given offset, specified by either a ValueLayout or a StructLayout. ```APIDOC wgpu4k-native/ffi/[[jvm]]CStructure/get open fun [get](get.html)(layout: ValueLayout, offset: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [MemorySegment](../-memory-segment/index.html) - Retrieves a MemorySegment based on a ValueLayout and an offset. open fun [get](get.html)(layout: StructLayout, offset: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)): [MemorySegment](../-memory-segment/index.html) - Retrieves a MemorySegment based on a StructLayout and an offset. Parameters: - layout: The layout defining the structure or value to retrieve. - offset: The starting offset within the memory segment. Returns: - A MemorySegment representing the data at the specified offset according to the layout. ``` -------------------------------- ### JavaScript Initialization and Theme Toggling Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-surface-source-xlib-window/[jvm]-by-reference/handler.html This script handles the initial setup of the documentation page, including switching between light and dark modes based on user preferences or local storage settings. ```javascript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### JavaScript Documentation Initialization Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-surface-source-android-native-window/[native]-by-value/handler.html Initializes the documentation site by setting up theme switching based on local storage or OS preference, and resolving the root path. ```JavaScript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### get Function Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-vertex-buffer-layout/index.html Provides a 'get' function, likely for retrieving data or a native pointer from a structure. ```APIDOC get (Function): Retrieves data or a native pointer. Signature: get() : Any Context: jvm: Located within the C-Structure class. ``` -------------------------------- ### JavaScript: Theme and Navigation Setup Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-texture-binding-layout/-companion/next-in-chain-offset.html Initializes theme settings based on local storage or OS preference and sets up navigation paths for the documentation site. ```javascript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### MemorySegment get Methods Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/java.lang.foreign/-memory-segment/get.md Provides overloads for the get method of the MemorySegment class, allowing retrieval of primitive data types (Double, Float, Int, Short, Long) and MemorySegment instances from a specified offset. Each overload takes a ValueLayout or AddressLayout and a long offset. ```APIDOC MemorySegment.get Retrieves a value from the MemorySegment at a given offset. Overloads: 1. get(layout: ValueLayout.OfDouble?, offest: Long): Double - Retrieves a Double value. - Parameters: - layout: The ValueLayout for Double. - offest: The byte offset from the start of the segment. - Returns: The Double value at the specified offset. 2. get(layout: ValueLayout.OfFloat?, offest: Long): Float - Retrieves a Float value. - Parameters: - layout: The ValueLayout for Float. - offest: The byte offset from the start of the segment. - Returns: The Float value at the specified offset. 3. get(layout: ValueLayout.OfInt?, offest: Long): Int - Retrieves an Int value. - Parameters: - layout: The ValueLayout for Int. - offest: The byte offset from the start of the segment. - Returns: The Int value at the specified offset. 4. get(layout: ValueLayout.OfShort?, offest: Long): Short - Retrieves a Short value. - Parameters: - layout: The ValueLayout for Short. - offest: The byte offset from the start of the segment. - Returns: The Short value at the specified offset. 5. get(layout: ValueLayout.OfLong?, offest: Long): Long - Retrieves a Long value. - Parameters: - layout: The ValueLayout for Long. - offest: The byte offset from the start of the segment. - Returns: The Long value at the specified offset. 6. get(layout: AddressLayout?, offest: Long): MemorySegment - Retrieves a MemorySegment (pointer) value. - Parameters: - layout: The AddressLayout. - offest: The byte offset from the start of the segment. - Returns: The MemorySegment at the specified offset. ``` -------------------------------- ### WGPUBufferDescriptor get Function Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-buffer-descriptor/index.html Details the 'get' function for WGPUBufferDescriptor, likely used to retrieve a native structure or value. ```APIDOC Functions: get: - Signature: get() - Description: Retrieves the underlying native structure or value. - Context: jvm-c-structure ``` -------------------------------- ### JavaScript Theme and Path Setup Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-request-adapter-status_-success.html This script initializes the page by setting up the 'js' class, handling dark mode preferences from local storage, and applying the 'theme-dark' class if necessary. It also defines a base path for resources. ```javascript var pathToRoot = "../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### get Function Documentation Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-uncaptured-error-callback-info/index.html Documentation for the 'get' function, which retrieves a MemorySegment from a StructLayout at a specified offset. This is typically used for low-level memory manipulation. ```APIDOC get Function Retrieves a MemorySegment from a StructLayout at a specified offset. Signature: - jvm: open fun get(layout: StructLayout, offset: Long): MemorySegment Parameters: - layout: The StructLayout defining the structure. - offset: The offset within the structure to retrieve the segment from. Returns: A MemorySegment representing the requested portion of the structure. ``` -------------------------------- ### get Function (JVM C-Structure) Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-multisample-state/index.html The 'get' function, specific to JVM C-structures, retrieves a MemorySegment based on layout and offset. It is an open function. ```APIDOC open fun get(layout: StructLayout, offset: Long): MemorySegment ``` -------------------------------- ### JavaScript Initialization Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-depth-stencil-state/[jvm]-by-reference/index.html This script handles initial page setup, including toggling the table of contents and applying dark mode based on local storage or OS preferences. ```javascript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### WGPUTexelCopyBufferLayout.bytesPerRow Property Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-texel-copy-buffer-layout/index.md Specifies the number of bytes between the start of one row and the start of the next row in the buffer. Declared as unsigned integer (UInt) with common and platform-specific actualizations. ```APIDOC expect abstract var bytesPerRow: UInt // Common actual abstract var bytesPerRow: UInt // Android, JVM, Native ``` -------------------------------- ### JavaScript: Page Initialization and Theme Handling Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu.android/-w-g-p-u-render-bundle-descriptor/label.html This script handles initial page setup, including setting the base path and managing the dark mode theme based on OS preferences or local storage settings. ```javascript var pathToRoot = "../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### C-Structure Get Methods (JVM) Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-string-view/index.html Provides documentation for 'get' methods within a JVM C-structure context, used for retrieving memory segments based on layout and offset. ```APIDOC open fun get(layout: StructLayout, offset: Long): MemorySegment open fun get(layout: ValueLayout, offset: Long): MemorySegment ``` -------------------------------- ### JavaScript Initialization Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-surface-descriptor/-companion/next-in-chain-layout.html This script handles the initial setup of the documentation page, including enabling JavaScript support and managing dark mode preferences based on local storage or OS settings. ```javascript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### MemorySegment Data Access (Get) Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/java.lang.foreign/-memory-segment/index.md Provides documentation for the 'get' methods, which allow reading data of various primitive types from the memory segment at a specified offset. ```APIDOC Functions: - get(layout: ValueLayout.OfDouble?, offset: Long): Double - Reads a Double value from the memory segment at the given offset. - get(layout: ValueLayout.OfFloat?, offset: Long): Float - Reads a Float value from the memory segment at the given offset. - get(layout: ValueLayout.OfInt?, offset: Long): Int - Reads an Int value from the memory segment at the given offset. - get(layout: ValueLayout.OfLong?, offset: Long): Long - Reads a Long value from the memory segment at the given offset. - get(layout: ValueLayout.OfShort?, offset: Long): Short - Reads a Short value from the memory segment at the given offset. - get(layout: AddressLayout?, offset: Long): MemorySegment - Reads a MemorySegment (address) from the memory segment at the given offset. - Parameters: - layout: The ValueLayout specifying the type and size of data to read. - offset: The byte offset from the start of the MemorySegment. - Returns: The value read from the specified offset. ``` -------------------------------- ### JavaScript Initialization and Theme Toggling Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-adapter-info/[native]-by-reference/handler.html This script handles initial page setup, replacing 'no-js' with 'js' classes, and manages dark mode persistence using localStorage, respecting OS preferences. ```javascript var pathToRoot = "../../../../\n"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### wgpuRenderBundleEncoderDrawIndexed API Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/index.html Draws primitives using indexed vertex data. This function is part of the wgpu API for rendering and specifies the number of indices, instances, starting index, base vertex, and starting instance. ```kotlin actual fun wgpuRenderBundleEncoderDrawIndexed(handler: WGPURenderBundleEncoder?, indexCount: UInt, instanceCount: UInt, firstIndex: UInt, baseVertex: Int, firstInstance: UInt) expect fun wgpuRenderBundleEncoderDrawIndexed(handler: WGPURenderBundleEncoder?, indexCount: UInt, instanceCount: UInt, firstIndex: UInt, baseVertex: Int, firstInstance: UInt) ``` -------------------------------- ### JavaScript Initialization Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-programmable-stage-descriptor/[android]-by-reference/entry-point.html This script handles initial page setup, including setting the root path and managing dark mode preferences based on local storage or OS settings. ```javascript var pathToRoot = "../../../../\\"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### WGPUVertexBufferLayout arrayStride Property Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-vertex-buffer-layout/[android]-by-reference/array-stride.html API documentation for the `arrayStride` property within the `WGPUVertexBufferLayout` class. This property defines the byte offset between the start of one vertex buffer and the start of the next. ```APIDOC WGPUVertexBufferLayout open override var arrayStride: ULong android Represents the stride in bytes between consecutive vertex buffers in a vertex buffer layout. This value is used to determine the memory layout of vertex data. ``` -------------------------------- ### JavaScript Theme and Path Handling Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-create-compute-pipeline-async-callback-info/[native]-by-reference/callback.html Handles dark mode switching based on local storage and OS preference, and sets up the base path for the documentation site. This script is part of the documentation generation boilerplate. ```JavaScript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### Initialize Theme and JS Readiness Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-shader-source-w-g-s-l/[native]-by-reference/-by-reference.html This script initializes the page by setting up dark mode preferences based on local storage or OS settings and replacing 'no-js' with 'js' class for JavaScript readiness. ```javascript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### WGPUTexelCopyBufferLayout bytesPerRow Property Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/io.ygdrasil.wgpu.android/-w-g-p-u-texel-copy-buffer-layout/bytes-per-row.md The bytesPerRow property specifies the number of bytes between the start of one row and the start of the next row in a texel buffer. This is crucial for correctly interpreting texture data in memory. It is an integer value. ```kotlin var bytesPerRow: Int ``` -------------------------------- ### Initial Page Setup Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-render-pass-depth-stencil-attachment/-companion/depth-clear-value-layout.html A JavaScript snippet that initializes the page by setting up dark mode preferences based on local storage and OS settings, and replaces 'no-js' class with 'js'. ```javascript var pathToRoot = "../../../../\"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### CStructure get Method - Kotlin Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/ffi/[jvm]-c-structure/get.md Provides methods to retrieve a MemorySegment from a CStructure at a specified offset, based on a ValueLayout or StructLayout. Useful for accessing data within native structures. ```APIDOC CStructure.get: - get(layout: ValueLayout, offset: Long): MemorySegment Retrieves a MemorySegment from a CStructure at a specified offset. Parameters: - layout: The layout of the value to retrieve. - offset: The offset from the start of the structure. Returns: A MemorySegment representing the value at the specified offset. - get(layout: StructLayout, offset: Long): MemorySegment Retrieves a MemorySegment from a CStructure at a specified offset. Parameters: - layout: The layout of the structure to retrieve. - offset: The offset from the start of the structure. Returns: A MemorySegment representing the structure at the specified offset. ``` -------------------------------- ### Theme and Path Initialization Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-create-render-pipeline-async-callback-info/[native]-by-reference/userdata2.html Initializes dark mode based on local storage or OS preference and sets up document classes for styling. ```javascript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### Page Initialization Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-request-adapter-options/-companion/allocate-array.html JavaScript code for initializing the documentation page, including theme switching based on OS preference or local storage. ```JavaScript var pathToRoot = "../../../../\"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### wgpuRenderPassEncoderDrawIndexed Kotlin Function Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/index.html Draws indexed primitives using vertex and index data. It takes the index count, instance count, starting index, base vertex offset, and starting instance index as parameters. ```Kotlin actual fun wgpuRenderPassEncoderDrawIndexed(handler: WGPURenderPassEncoder?, indexCount: UInt, instanceCount: UInt, firstIndex: UInt, baseVertex: Int, firstInstance: UInt) ``` -------------------------------- ### JavaScript Theme and DOM Setup Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-buffer-map-callback-info/[jvm]-by-reference/callback.html Initializes the documentation page by setting up dark mode preferences based on local storage or OS settings, and replacing 'no-js' with 'js' classes on the document element. ```javascript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### Theme and DOM Initialization Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-sampler-descriptor/-companion/allocate.html Initializes the page by setting up theme switching based on local storage or OS preferences and replacing 'no-js' class with 'js' for modern browser features. ```javascript var pathToRoot = "../../../../\n"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### MemorySegment get Methods Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/java.lang.foreign/-memory-segment/get.html Provides methods to retrieve primitive data types and MemorySegments from a MemorySegment at a specified offset. Supports various primitive types like Double, Float, Int, Short, Long, and AddressLayout. ```APIDOC MemorySegment.get Retrieves values from a MemorySegment at a given offset. Methods: fun get(layout: ValueLayout.OfDouble?, offest: Long): Double - Retrieves a Double value. - Parameters: - layout: The ValueLayout for Double. - offest: The offset within the MemorySegment. - Returns: The Double value at the specified offset. fun get(layout: ValueLayout.OfFloat?, offest: Long): Float - Retrieves a Float value. - Parameters: - layout: The ValueLayout for Float. - offest: The offset within the MemorySegment. - Returns: The Float value at the specified offset. fun get(layout: ValueLayout.OfInt?, offest: Long): Int - Retrieves an Int value. - Parameters: - layout: The ValueLayout for Int. - offest: The offset within the MemorySegment. - Returns: The Int value at the specified offset. fun get(layout: ValueLayout.OfShort?, offest: Long): Short - Retrieves a Short value. - Parameters: - layout: The ValueLayout for Short. - offest: The offset within the MemorySegment. - Returns: The Short value at the specified offset. fun get(layout: ValueLayout.OfLong?, offest: Long): Long - Retrieves a Long value. - Parameters: - layout: The ValueLayout for Long. - offest: The offset within the MemorySegment. - Returns: The Long value at the specified offset. fun get(layout: AddressLayout?, offest: Long): MemorySegment - Retrieves a MemorySegment (address) value. - Parameters: - layout: The AddressLayout. - offest: The offset within the MemorySegment. - Returns: The MemorySegment at the specified offset. ``` -------------------------------- ### wgpuRenderBundleEncoderDrawIndexed Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/io.ygdrasil.wgpu/index.md Encodes a draw command for indexed primitives. This function is available across common, Android, JVM, and native platforms. It requires parameters specifying the number of indices, instances, starting index, base vertex, and starting instance. ```APIDOC wgpuRenderBundleEncoderDrawIndexed(handler: WGPURenderBundleEncoder?, indexCount: UInt, instanceCount: UInt, firstIndex: UInt, baseVertex: Int, firstInstance: UInt) - Encodes a draw call using indexed vertex data. - Parameters: - handler: The WGPURenderBundleEncoder instance. - indexCount: The number of indices to draw. - instanceCount: The number of instances to draw. - firstIndex: The starting index in the index buffer. - baseVertex: A value added to each index value to offset the vertex data. - firstInstance: The starting instance ID for instanced drawing. ``` -------------------------------- ### JavaScript Theme and Path Initialization Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-string-view/[native]-by-value/-by-value.html Initializes theme switching based on OS preference or local storage, and sets up path variables. Uses `localStorage` and `window.matchMedia` for dark mode detection. ```javascript var pathToRoot = "../../../../\n"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### WGPUTexelCopyBufferLayout bytesPerRow Property Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-texel-copy-buffer-layout/[native]-by-value/bytes-per-row.md The bytesPerRow property defines the number of bytes between the start of one row and the start of the next row in a texel buffer. This is crucial for correctly interpreting data in memory layouts, especially for texture data. ```APIDOC WGPUTexelCopyBufferLayout: bytesPerRow: UInt Description: The number of bytes per row in the texel buffer. Type: UInt Access: read-only Native Implementation: Yes ``` -------------------------------- ### JavaScript Page Initialization Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-multisample-state/-companion/next-in-chain-layout.html This script handles initial page setup, including replacing the 'no-js' class with 'js' and managing dark mode preferences based on operating system settings or local storage. ```javascript var pathToRoot = "../../../../\n"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### Access bytesPerRow Property (Kotlin/Android) Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-texel-copy-buffer-layout/[android]-by-value/bytes-per-row.md This snippet details the `bytesPerRow` property, which is part of the `WGPUTexelCopyBufferLayout` structure. It defines the number of bytes between the start of one row and the start of the next in a buffer. This property is specific to the Android platform within the wgpu4k-native library. ```Kotlin open override var bytesPerRow: UInt ``` -------------------------------- ### WGPU Instance Creation API Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/navigation.html Details the function for creating a WGPU instance, which is the entry point for using the WGPU API. This function initializes the WGPU environment. ```APIDOC wgpuCreateInstance(): WGPUInstance - Creates a WGPU instance, the entry point for the WGPU API. - Returns: A new WGPUInstance object. ``` -------------------------------- ### WGPUTexelCopyBufferLayout.bytesPerRow Property Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-texel-copy-buffer-layout/bytes-per-row.md The bytesPerRow property defines the number of bytes between the start of one row and the start of the next row in a buffer. This is crucial for correctly interpreting texel data when copying between buffers and textures. It is declared as an abstract variable, with expect and actual implementations provided for multiplatform compatibility. ```APIDOC WGPUTexelCopyBufferLayout: bytesPerRow: UInt - Description: The number of bytes between the start of one row and the start of the next row. - Type: UInt - Availability: common, android, jvm, native - Declaration: expect abstract var bytesPerRow: UInt (common) - Declaration: actual abstract var bytesPerRow: UInt (android, jvm, native) ``` -------------------------------- ### Page Initialization and Theme Toggling Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu.android/-w-g-p-u-device-lost-callback-info/index.html This script handles initial page setup, replacing the 'no-js' class with 'js', and implements dark mode persistence based on user preference or OS settings. ```javascript var pathToRoot = "../../../\"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### JavaScript Theme Toggling and DOM Setup Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu.android/-w-g-p-u-compilation-info/-by-reference/-by-reference.html This script handles initial DOM setup by replacing 'no-js' with 'js' classes. It also manages dark mode preferences by checking local storage and operating system settings, applying a 'theme-dark' class to the HTML element accordingly. ```javascript var pathToRoot = "../../../../\"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### JavaScript Initialization and Theme Toggling Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu.android/-w-g-p-u-render-bundle-encoder-descriptor/index.html This snippet handles initial page setup, including replacing 'no-js' with 'js' classes and managing dark mode preferences based on local storage or OS settings. ```javascript var pathToRoot = "../.."; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### JavaScript Initialization and Theme Toggling Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-device-descriptor/handler.html This script handles initial page setup, including replacing 'no-js' with 'js' classes and managing dark mode preferences based on local storage or OS settings. ```javascript var pathToRoot = "../../../\"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### wgpuDeviceGetLostFuture Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-functions/index.html Gets a future that completes when the device is lost. ```APIDOC wgpuDeviceGetLostFuture(handler: MemorySegment): MemorySegment - Gets a future that completes when the device is lost. - Parameters: - handler: A MemorySegment representing the WGPU device. - Returns: A MemorySegment representing the future. ``` -------------------------------- ### JavaScript Theme and Initialization Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-bind-group-layout-entry/[native]-by-reference/handler.html Handles theme switching based on local storage or OS preference and initializes the page by replacing 'no-js' with 'js' class. ```javascript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### WGPU Wayland Surface: Get Display Native Address Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-surface-source-wayland-surface/[native]-by-reference/display.md This property provides access to the native display handle associated with a WGPU Wayland surface. It is intended for low-level integration with Wayland systems. The value returned is a nullable native address, representing the display pointer. ```kotlin //[wgpu4k-native](../../../../index.md)/[io.ygdrasil.wgpu](../../index.md)/[WGPUSurfaceSourceWaylandSurface](../index.md)/[[native]ByReference](index.md)/[display](display.md) # display [native] open override var [display](display.md): [NativeAddress](../../../ffi/-native-address/index.md)? ``` -------------------------------- ### Theme and Path Initialization Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-pop-error-scope-callback-info/[jvm]-by-reference/userdata2.html A JavaScript snippet that initializes the page by managing dark mode preferences based on local storage and OS settings, and replaces 'no-js' class with 'js'. ```javascript var pathToRoot = "../../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ``` -------------------------------- ### JavaScript Initialization Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu.android/-w-g-p-u-surface-source-x-c-b-window/-by-reference/index.html A JavaScript snippet found in the documentation's header, likely used for theme switching and initial page setup. ```javascript var pathToRoot = "../../../../\n"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode") if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } else { const savedDarkMode = JSON.parse(storage) if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark") } } ``` -------------------------------- ### Size and Array Conversion Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu.android/-w-g-p-u-sampler-descriptor/index.html Methods to get the size of the structure and convert its contents into arrays. ```APIDOC size(): Int Returns the number of elements or size of the structure. toaArray(p0: Array): Array Converts the structure's contents into an array of Structures, using a provided array as a buffer. toaArray(p0: Int): Array Converts the structure's contents into an array of Structures, with a specified initial capacity. ``` -------------------------------- ### Get Reference to WGPUBindGroupDescriptor Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/gfm/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-bind-group-descriptor/index.md Exposes a method to obtain a reference to a WGPUBindGroupDescriptor structure, specifically for the Android platform. ```kotlin open fun toReference(): WGPUBindGroupDescriptor.ByReference // For Android ``` -------------------------------- ### JavaScript Theme and Navigation Script Source: https://github.com/wgpu4k/wgpu4k-native/blob/main/doc/html/wgpu4k-native/io.ygdrasil.wgpu/-w-g-p-u-bind-group-descriptor/label.html This script handles the initialization of the documentation page, including theme switching (dark/light mode) based on user preferences or operating system settings, and sets up navigation elements. ```javascript var pathToRoot = "../../../"; document.documentElement.classList.replace("no-js","js"); const storage = localStorage.getItem("dokka-dark-mode"); if (storage == null) { const osDarkSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; if (osDarkSchemePreferred === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } else { const savedDarkMode = JSON.parse(storage); if(savedDarkMode === true) { document.getElementsByTagName("html")[0].classList.add("theme-dark"); } } ```