ReferenceError: _glGetString is not defined

21 views
Skip to first unread message

buggabugga

unread,
Jun 11, 2019, 7:04:28 PM6/11/19
to emscripten-discuss
Hi,

I'm trying to run glfw3.c test found here: https://github.com/emscripten-core/emscripten/blob/master/tests/glfw3.c, on emcc (Emscripten gcc/clang-like replacement) 1.38.30 ((unknown revision)), with the following command line:

emcc -s USE_GLFW=3 -s USE_WEBGL2=1 -lGL qqq.cpp -o qqq.html --emrun

I get errors when I run it in a browser (see below). Any help?

qqq.js:5574 Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.
requestFullscreen @ qqq.js:5574
createWindow @ qqq.js:5866
_glfwCreateWindow @ qqq.js:5950
(anonymous) @ wasm-0004ecb2-373:558
Module._main @ qqq.js:6890
callMain @ qqq.js:7170
doRun @ qqq.js:7228
(anonymous) @ qqq.js:7239
setTimeout (async)
run @ qqq.js:7235
runCaller @ qqq.js:7147
removeRunDependency @ qqq.js:1531
receiveInstance @ qqq.js:1643
receiveInstantiatedSource @ qqq.js:1670
Promise.then (async)
createWasm @ qqq.js:1686
Module.asm @ qqq.js:1716
(anonymous) @ qqq.js:6797
qqq.js:4414 emscripten_set_main_loop_timing: Cannot set timing mode for main loop since a main loop does not exist! Call emscripten_set_main_loop first to set one up.
_emscripten_set_main_loop_timing @ qqq.js:4414
_glfwSwapInterval @ qqq.js:6233
(anonymous) @ wasm-0004ecb2-373:792
Module._main @ qqq.js:6890
callMain @ qqq.js:7170
doRun @ qqq.js:7228
(anonymous) @ qqq.js:7239
setTimeout (async)
run @ qqq.js:7235
runCaller @ qqq.js:7147
removeRunDependency @ qqq.js:1531
receiveInstance @ qqq.js:1643
receiveInstantiatedSource @ qqq.js:1670
Promise.then (async)
createWasm @ qqq.js:1686
Module.asm @ qqq.js:1716
(anonymous) @ qqq.js:6797
qqq.html:1246 exception thrown: ReferenceError: _glGetString is not defined,ReferenceError: _glGetString is not defined
    at _glfwExtensionSupported (http://localhost:8080/qqq.js:5963:9)
    at wasm-function[373]:1708
    at Object.Module._main (http://localhost:8080/qqq.js:6890:33)
    at Object.callMain (http://localhost:8080/qqq.js:7170:30)
printErr @ qqq.html:1246
emrun_printErr @ qqq.js:7375
callMain @ qqq.js:7190
doRun @ qqq.js:7228
(anonymous) @ qqq.js:7239
setTimeout (async)
run @ qqq.js:7235
runCaller @ qqq.js:7147
removeRunDependency @ qqq.js:1531
receiveInstance @ qqq.js:1643
receiveInstantiatedSource @ qqq.js:1670
Promise.then (async)
createWasm @ qqq.js:1686
Module.asm @ qqq.js:1716
(anonymous) @ qqq.js:6797
qqq.js:5963 Uncaught ReferenceError: _glGetString is not defined
    at _glfwExtensionSupported (qqq.js:5963)
    at wasm-function[373]:1708
    at Object.Module._main (qqq.js:6890)
    at Object.callMain (qqq.js:7170)
    at doRun (qqq.js:7228)
    at qqq.js:7239
_glfwExtensionSupported @ qqq.js:5963
(anonymous) @ wasm-0004ecb2-373:794
Module._main @ qqq.js:6890
callMain @ qqq.js:7170
doRun @ qqq.js:7228
(anonymous) @ qqq.js:7239
setTimeout (async)
run @ qqq.js:7235
runCaller @ qqq.js:7147
removeRunDependency @ qqq.js:1531
receiveInstance @ qqq.js:1643
receiveInstantiatedSource @ qqq.js:1670
Promise.then (async)
createWasm @ qqq.js:1686
Module.asm @ qqq.js:1716
(anonymous) @ qqq.js:6797
qqq.js:5574 Uncaught (in promise) TypeError: fullscreen error
    at Object.requestFullscreen (qqq.js:5574)
    at Object.createWindow (qqq.js:5866)
    at _glfwCreateWindow (qqq.js:5950)
    at wasm-function[373]:1178
    at Object.Module._main (qqq.js:6890)
    at Object.callMain (qqq.js:7170)
    at doRun (qqq.js:7228)
    at qqq.js:7239

Alon Zakai

unread,
Jun 12, 2019, 12:12:56 PM6/12/19
to emscripte...@googlegroups.com
Looking in the test suite code that compiles it, in tests/test_browser.py, it is built with -s LEGACY_GL_EMULATION=1 as it depends on some legacy functionality in GL. It should work with that.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/016579ae-64bb-4eea-aa06-be37fc6a4325%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

キャロウ マーク

unread,
Jun 12, 2019, 1:10:27 PM6/12/19
to emscripte...@googlegroups.com


On Jun 12, 2019, at 9:12, Alon Zakai <alon...@gmail.com> wrote:

Looking in the test suite code that compiles it, in tests/test_browser.py, it is built with -s LEGACY_GL_EMULATION=1 as it depends on some legacy functionality in GL. It should work with that.

That seems counterintuitive}. The only part of glGetString that is legacy is passing it the GL_EXTENSIONS query. That is no longer supported in Core OpenGL, though it still is in OpenGL ES, even the most recent which is 3.2. So calling glGetString should not require LEGACY_GL_EMULATION=1.

Regards

    -Mark


signature.asc

Alon Zakai

unread,
Jun 12, 2019, 3:35:29 PM6/12/19
to emscripte...@googlegroups.com
Good point, thanks Mark! Yeah, looking more carefully, it should work without that flag. The bug was a missing dependency, fix in


- Alon


--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages