0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
authorkgv <kgv@opencascade.com>
Thu, 16 Jul 2020 13:15:22 +0000 (16:15 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 22 Jul 2020 16:24:38 +0000 (19:24 +0300)
commit7465bfa65ef4cc60242a1322c3650185f995497c
treec8244ede6945461c1e3ab65b0b03144b18fa2393
parentb939a13923e9630064b6840e1b46ceea8e4dc8d6
0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39

OpenGl_Context now skips loading functions related to mapping buffer,
which are required by OpenGL ES 3.0 specs but not provided by WebGL 2.0.
Message_PrinterSystemLog does not use a broken emscripten_log() anymore, which corrupted UNICODE strings.

WasmOcctView::initWindow() - callbacks now set using EMSCRIPTEN_EVENT_TARGET_WINDOW
instead of 0 used by older Emscripten API.

Mouse callbacks now track canvas element and use
EmscriptenMouseEvent::targetX/targetY instead of ::canvasX/canvasY
as the latter was broken.

Added emscripten_set_main_loop() setup to shut up eglSwapInterval() error message.
Fixed missing \0 at the end of string converted by toUtf8Array().
samples/webgl/WasmOcctView.cpp
samples/webgl/main.cpp
samples/webgl/occt-webgl-sample.html
src/Message/Message_PrinterSystemLog.cxx
src/OpenGl/OpenGl_Context.cxx
src/OpenGl/OpenGl_GlCore30.hxx