Project

General

Profile

Actions

Bug #3608

closed

WGLWidget does not work in WidgetSet mode

Added by Prasad Dixit over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
High
Assignee:
Target version:
-
Start date:
09/27/2014
Due date:
% Done:

0%

Estimated time:

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

GL_WidgetSet_Test.cpp (4.08 KB) GL_WidgetSet_Test.cpp Prasad Dixit, 09/27/2014 07:47 PM
Gl-App In Application mode.png (19.6 KB) Gl-App In Application mode.png Prasad Dixit, 09/27/2014 07:47 PM
Gl-App In WidgetSte mode.png (45.9 KB) Gl-App In WidgetSte mode.png Prasad Dixit, 09/27/2014 07:47 PM
test_wt_gl_widgetset.html (3.41 KB) test_wt_gl_widgetset.html Prasad Dixit, 09/27/2014 07:47 PM
test_wt_gl_widgetset.html (3.48 KB) test_wt_gl_widgetset.html corrected Wim Dumon, 09/29/2014 03:35 PM
Actions #1

Updated by Wim Dumon over 9 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.

Actions #2

Updated by Koen Deforche over 9 years ago

  • Status changed from New to Resolved
  • Assignee set to Wim Dumon
Actions #3

Updated by Koen Deforche over 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF