Package-level declarations
Types
Kgl over the iOS OpenGLES.framework ES 3.0 bindings (platform.gles3.*). The class is the iOS counterpart of androidMain.AndroidKgl / jvmMain.JoglKgl — a thin marshalling layer that pins Kotlin arrays for the duration of each gl call and converts our Int-typed enum values to GLenum (UInt).
Opaque WebGL2 renderbuffer handle. The browser returns these from createRenderbuffer() and accepts them back in bind/framebuffer/delete calls; we never touch fields on them. Public because KglRenderbuffer (an actual data class) exposes the handle.
Opaque WebGL2 renderbuffer handle. The browser returns these from createRenderbuffer() and accepts them back in bind/framebuffer/delete calls; we never touch fields on them. Public because KglRenderbuffer (an actual data class) exposes the handle.
Opaque WebGL2 sync (fence) handle — same usage as WebGLRenderbuffer.
Opaque WebGL2 sync (fence) handle — same usage as WebGLRenderbuffer.
The web (js + wasmJs) Kgl, adding the one WebGL capability the common interface can't express: uploading a DOM image source (image / canvas / video / ImageBitmap) straight to texture level 0 via texImage2D(target, level, internalFormat, format, type, source), which has no buffer equivalent. Shared render code (earth.worldwind.render.image.ImageTexture, earth.worldwind.render.video.HtmlVideoTexture) reaches it by casting dc.gl as WebKgl; the concrete implementations (JsWebKgl on js, WasmJsWebKgl on wasmJs) stay per-target because the rest of their WebGL interop diverges (js dynamic zero-copy views vs wasm typed JsAny copies).
Properties
Bits for Kgl.mapAndCopyBufferRange. The combination WRITE_BIT | INVALIDATE_RANGE_BIT | UNSYNCHRONIZED_BIT is the standard "rename" upload idiom — the driver hands back fresh-mapped staging memory without waiting for the previous transfer to complete.
Per-channel sampler swizzle masks (GL 3.3+ / GLES 3.0+ / WebGL2). Setting GL_TEXTURE_SWIZZLE_A = GL_ONE on a texture makes the sampler return alpha=1.0 regardless of the actual texture bytes — useful for video frames where the decoder leaves the X byte undefined and we'd otherwise have to force-fill alpha on every frame on the CPU.
Functions
Rewrites GLSL ES 1.00 syntax in-place so it compiles under #version 300 es — run by Android / iOS shaderSource when a program opts into Kgl.glslVersion3. Same mapping as JoglKgl.translateLegacyGlsl / JsWebKgl.translateLegacyGlsl — keep them in sync; idempotent for already-modern sources. Fragments get a precision mediump default injected (ES 3.00 has none); a shader's own later precision block still overrides it.