aboutsummaryrefslogtreecommitdiff
path: root/core/sys
diff options
context:
space:
mode:
authorAlex Riedl <alexanderbriedl@gmail.com>2025-08-09 10:47:07 -0500
committerAlex Riedl <alexanderbriedl@gmail.com>2025-08-09 10:47:07 -0500
commit277c6cac7175d78bd2e42db17e7ca7475ec6d574 (patch)
tree8f9333b7ced6e257f4874ee2de42e1834c079b08 /core/sys
parent786d454443a6ba3bc6d97b922305c6646776b1e2 (diff)
Fix some webgl bindings
Diffstat (limited to 'core/sys')
-rw-r--r--core/sys/wasm/js/odin.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/core/sys/wasm/js/odin.js b/core/sys/wasm/js/odin.js
index 37a57a59d..1fbcc886e 100644
--- a/core/sys/wasm/js/odin.js
+++ b/core/sys/wasm/js/odin.js
@@ -392,6 +392,9 @@ class WebGLInterface {
BindTexture: (target, texture) => {
this.ctx.bindTexture(target, texture ? this.textures[texture] : null)
},
+ BindRenderbuffer: (target, renderbuffer) => {
+ this.ctx.bindRenderbuffer(target, renderbuffer ? this.renderbuffers[renderbuffer] : null)
+ },
BlendColor: (red, green, blue, alpha) => {
this.ctx.blendColor(red, green, blue, alpha);
},
@@ -809,6 +812,40 @@ class WebGLInterface {
Uniform3i: (location, v0, v1, v2) => { this.ctx.uniform3i(this.uniforms[location], v0, v1, v2); },
Uniform4i: (location, v0, v1, v2, v3) => { this.ctx.uniform4i(this.uniforms[location], v0, v1, v2, v3); },
+ Uniform1fv: (location, count, addr) => {
+ let array = this.mem.loadF32Array(addr, 1*count);
+ this.ctx.uniform1fv(this.uniforms[location], array);
+ },
+ Uniform2fv: (location, count, addr) => {
+ let array = this.mem.loadF32Array(addr, 2*count);
+ this.ctx.uniform2fv(this.uniforms[location], array);
+ },
+ Uniform3fv: (location, count, addr) => {
+ let array = this.mem.loadF32Array(addr, 3*count);
+ this.ctx.uniform3fv(this.uniforms[location], array);
+ },
+ Uniform4fv: (location, count, addr) => {
+ let array = this.mem.loadF32Array(addr, 4*count);
+ this.ctx.uniform4fv(this.uniforms[location], array);
+ },
+
+ Uniform1iv: (location, count, addr) => {
+ let array = this.mem.loadI32Array(addr, 1*count);
+ this.ctx.uniform1iv(this.uniforms[location], array);
+ },
+ Uniform2iv: (location, count, addr) => {
+ let array = this.mem.loadI32Array(addr, 2*count);
+ this.ctx.uniform2iv(this.uniforms[location], array);
+ },
+ Uniform3iv: (location, count, addr) => {
+ let array = this.mem.loadI32Array(addr, 3*count);
+ this.ctx.uniform3iv(this.uniforms[location], array);
+ },
+ Uniform4iv: (location, count, addr) => {
+ let array = this.mem.loadI32Array(addr, 4*count);
+ this.ctx.uniform4iv(this.uniforms[location], array);
+ },
+
UniformMatrix2fv: (location, addr) => {
let array = this.mem.loadF32Array(addr, 2*2);
this.ctx.uniformMatrix2fv(this.uniforms[location], false, array);