-
Notifications
You must be signed in to change notification settings - Fork 827
Description
Hi, I'm fairly new at WASM and WebGL and I have been trying to run the shader tutorial from DanRuta (https://github.com/DanRuta/webassembly-webgl-shaders) and my browser always runs into this error when running the index.html file.
The details of the error look like this:
`TypeError: GLctx is undefined[Weitere Informationen] appWASM.js:1:250880
_glCreateProgram http://localhost:8080/dist/appWASM.js:1
<anonym> http://localhost:8080/dist/appWASM.wasm:251208
<anonym> http://localhost:8080/dist/appWASM.wasm:251921
_createContext http://localhost:8080/dist/appWASM.js:1
ccall http://localhost:8080/dist/appWASM.js:1
createCanvas http://localhost:8080/:25
loadImage http://localhost:8080/:45`
I gather that there is some type error going on in the generated js file, but i'm really not familiar with it. Do you have any idea what could have caused this error?
Edit:
The build command I used was:
emcc -o ./dist/appWASM.js ./dev/cpp/emscripten.cpp -O3 -s ALLOW_MEMORY_GROWTH=1 -s USE_WEBGL2=1 -s WASM=1 -s NO_EXIT_RUNTIME=1 -std=c++1z -s EXTRA_EXPORTED_RUNTIME_METHODS="['ccall', 'cwrap']" -s LINKABLE=1 -s EXPORT_ALL=1