Hello,
can you tell me how i can force an specific array type when i build nim to js?
Here is an simplified example:
type
WebGL2RenderingContext* = ref WebGL2RenderingContextObj
WebGL2RenderingContextObj {.importcpp.} = object
{.push importcpp.}
proc texImage2D* (ctx:WebGL2RenderingContext, pixels: auto)
{.pop.}
var gl: WebGL2RenderingContext
gl.texImage2D([0, 0, 255, 255])
Build with:
nim js -d:release "x.nim"
the output looks like this:
gl_385875975[0].texImage2D(new Int32Array([0, 0, 255, 255]));
How can i tell nim to use a Uint8Array instead of Int32Array? When nim decides to use the "new" keyword in js?
PS: Is there any tutorial about interfacing js with nim? The official site does have some examples, but not for that many problems. I have to look up many examples on github to get something to work, but i also want to understand what i am doing. :-)