AI tells me that currently only bindings for WebGL...
# multiplatform
l
AI tells me that currently only bindings for WebGL1 are available, and indeed - I've found WebGL bindings, but not WebGL2. What is the status of WebGL2 on WASM?
l
Thanks Robert. I can see those are 'Kotlin wrappers for popular JS libraries'. Unfortunately I have exactly 0 experience with JS or any frontend developemnt. I suspect that in order to use those, I need to pull the GL wrapper into my code and also some JS WebGL2 library? Is there an example app somewhere doing this or some tutorial?
r
You don't need a library. WebGL2 seems to be supported by latest browsers (https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext#browser_compatibility).
kotlin-browser
module contains just the bindings for browser APIs and it supports wasmJS target.
l
ok, so the WebGL2 library is built-in the browsers 🙂 So all I need to do is copy all those .kt files from kotlin-wrappers/kotlin-browser/src/webMain/generated/web/gl/ to my project's wasmMain directory?
r
you don't need to copy, artifacts for wasmJs are available on maven central
just add a dependnecy
l
so what dependency do I need to add to my build.gradle.kts?
r
implementation("org.jetbrains.kotlin-wrappers:kotlin-browser:2026.2.12")
l
ok thanks again Robert, I'll try with that!