Bug #3608
WGLWidget does not work in WidgetSet mode
0%
Description
I have trying to have multiple WGLWidget displayed in a web page using WidgetSet mode but it is not working. In a normal Application mode it works as expected.
To do dome testing I added WText Widget under WGLWidget and WText widget works fine in both Application and WidgetSet mode.
I have attached the source code. It is adapted Hello WidgetSet example (https://github.com/kdeforche/wt/tree/master/examples/feature/widgetset)
Files
Updated by Wim Dumon over 8 years ago
Thank you for the test case. Indeed I can reproduce this error.
The reason is that Wt did not perform the test to confirm the presence of webgl. You'd need to pass this manually, or Wt will fall-back to server side rendering.
The attached html file sets the webgl flag for widget set mode.
We use this code to detect WebGL presence in the client:
if (window.WebGLRenderingContext) { var canvas = document.createElement("canvas"); var ctx = null; try { ctx = canvas.getContext('webgl', {antialias: true}); } catch (e) {} if (ctx == null) { try { ctx = canvas.getContext('experimental-webgl'); } catch (e) {} } if (ctx != null) { otherInfo += "&webGL=true"; } }
Best regards,
Wim.
Updated by Koen Deforche over 8 years ago
- Status changed from New to Resolved
- Assignee set to Wim Dumon