]> OCCT Git - occt-copy.git/commit
0031070: Configuration - fix building issues when using Emscripten toolchain
authorkgv <kgv@opencascade.com>
Tue, 15 Oct 2019 23:42:33 +0000 (02:42 +0300)
committerosa <osa@opencascade.com>
Fri, 1 Nov 2019 07:09:17 +0000 (10:09 +0300)
commit48839a40467cb4fef2a3c7c9bbb495de941c4273
tree9c0d95c3c89847482b379a42803c01d75a0479bf
parent48b498d4e11fea0930d2db52adba30d129c9dfea
0031070: Configuration - fix building issues when using Emscripten toolchain

Handled __EMSCRIPTEN__ macros to:
- Workaround atomics (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is undefined, but GCC atomics are provided).
- Suppress non-standard header <sys/signal.h> warning.
- Return OSD_LinuxREDHAT.
- Avoid inclusion of XLib headers.
- Skip fontconfig library.
- Enable EGL+GLES path (translated by Emscripten into WebGL).
- Skip eglCreatePbufferSurface() not implemented by Emscripten EGL.

Fixed Graphic3d_Vec4.hxx usage within Quantity_ColorRGBA.hxx.

OpenGl_ShaderManager::defaultGlslVersion() now prefers GLSL 300 es when WebGL 2.0 is available,
as there no any OpenGL ES greater than 3.0 emulation so far.

Shaders_Declarations.glsl - added workaround for GLSL compilation on WebGL 1.0
by defining Light properties accessors as macros instead of functions
('[]' : Index expression must be constant).

OpenGl_FrameBuffer::Init() - added workaround for initialization of GL_DEPTH24_STENCIL8
depth-stencil attachment on WebGL 1.0 + GL_WEBGL_depth_texture extension.

OpenGl_Context::Vec4FromQuantityColor() now considers myIsSRgbActive flag
to handle use case, when Immediate Layer is drawn directly into window buffer,
which is not sRGB-ready.

Added new sample - OCCT WebGL viewer.
36 files changed:
dox/FILES_HTML.txt
dox/overview/images/sample_webgl.png [new file with mode: 0644]
dox/overview/overview.md
samples/webgl/.gitignore [new file with mode: 0644]
samples/webgl/CMakeLists.txt [new file with mode: 0644]
samples/webgl/ReadMe.md [new file with mode: 0644]
samples/webgl/WasmOcctView.cpp [new file with mode: 0644]
samples/webgl/WasmOcctView.h [new file with mode: 0644]
samples/webgl/WasmVKeys.h [new file with mode: 0644]
samples/webgl/main.cpp [new file with mode: 0644]
samples/webgl/occt-webgl-sample.html [new file with mode: 0644]
src/Aspect/Aspect_DisplayConnection.cxx
src/Aspect/Aspect_DisplayConnection.hxx
src/Aspect/Aspect_FBConfig.hxx
src/Aspect/Aspect_XWD.hxx
src/Font/Font_FontMgr.cxx
src/InterfaceGraphic/InterfaceGraphic.hxx
src/OSD/OSD_Chronometer.cxx
src/OSD/OSD_MemInfo.cxx
src/OSD/OSD_Path.cxx
src/OSD/OSD_signal.cxx
src/OpenGl/OpenGl_Context.cxx
src/OpenGl/OpenGl_FrameBuffer.cxx
src/OpenGl/OpenGl_GlFunctions.hxx
src/OpenGl/OpenGl_GraphicDriver.cxx
src/OpenGl/OpenGl_GraphicDriver.hxx
src/OpenGl/OpenGl_ShaderManager.cxx
src/OpenGl/OpenGl_Window.cxx
src/Quantity/Quantity_ColorRGBA.cxx
src/Shaders/Declarations.glsl
src/Shaders/DeclarationsImpl.glsl
src/Shaders/Shaders_DeclarationsImpl_glsl.pxx
src/Shaders/Shaders_Declarations_glsl.pxx
src/Standard/Standard_Atomic.hxx
src/Xw/Xw_Window.cxx
src/Xw/Xw_Window.hxx