Thanks for your quick reply ,  I prefer to  embed an OpenGL surface into 
QDialog . 

 

 

Thanks and Best Regards

Steve Zhou

 

From: Giulio Camuffo [mailto:[email protected]] 
Sent: Wednesday, August 06, 2014 5:34 PM
To: Steve (YiLiang) Zhou
Cc: wayland mailing list
Subject: Re: Help!! app qt4 upgrade to qt5 for wayland , can't get the 
QDialog's window handle which can cast to EGLNativeWindowType

 

 

 

2014-08-06 11:54 GMT+03:00 Steve (YiLiang) Zhou <[email protected]>:

Dear all,

I have app which was developed by qt4, and we want to port it to tizen ivi 
wayland platform, so I have to update our app to qt5.

We have a feature : drawing something based on egl on a qt window(we use 
QDialog). 

Egl need a EGLSurface and a EGLDisplay to get the feature work.

EGLSurface eglCreateWindowSurface(

EGLDisplay display,

 

EGLConfig config,

 

NativeWindowType native_window,

 

EGLint const * attrib_list);

In x11 based OS like ubuntu 12.04 , we use EGL_DEFAULT_DISPLAY to get display, 
the qt window’s winId()   to cast to NativeWindowType

It works well on X11 based OS.

But when it comes to wayland ,it will crash at eglCreateWindowSurface, I 
googled a lot ,but rarely got something useful.

Someone said that  to get eglCreateWindowSurface work on wayland ,the 
native_window has to be a wl_egl_window type. 

I tried to get it like bellow:

 

QDialog *dialog = new QDialog(mainW);

dialog->setGeometry(QRect(0, 0, 720, 430));

dialog->show();

 

QPlatformNativeInterface *native =

        QGuiApplication::platformNativeInterface();

   struct wl_display *wl_dpy = (struct wl_display *)

        native->nativeResourceForWindow("display", NULL);

    struct wl_surface *surface = static_cast<struct wl_surface *>(

        native->nativeResourceForWindow("surface", dialog->windowHandle()));

struct wl_egl_window * wl_wind = wl_egl_window_create(surface, 720,430 );

 

use the wl_wind and wl_dpy to eglCreateWindowSurface , the app didn’t crash 
,but the graphics we want to draw on the window can’t be seen.

 

Is there someone met this before? Can somebody give some advices?

 

QDialog doesn't draw using OpenGL, so there is no EGL surface attached to its 
wl_surface.

I'm not sure what you're trying to achieve. Do you want to embed an OpenGL 
surface into QDialog? Or do you just want an egl surface to draw into, with no 
QWidgets on top?

 

--

Giulio

 

         

         

        Thanks and Best Regards

        Steve Zhou

         

        CONFIDENTIALITY NOTICE: The information contained in this message may 
be privileged and/or confidential. If you are not the intended recipient, or 
responsible for delivering this message to the intended recipient, any review, 
forwarding, dissemination, distribution or copying of this communication or any 
attachment(s) is strictly prohibited. If you have received this message in 
error, please notify the sender immediately, and delete it and all attachments 
from your computer and network.

        
        _______________________________________________
        wayland-devel mailing list
        [email protected]
        http://lists.freedesktop.org/mailman/listinfo/wayland-devel

 


CONFIDENTIALITY NOTICE: The information contained in this message may be 
privileged and/or confidential. If you are not the intended recipient, or 
responsible for delivering this message to the intended recipient, any review, 
forwarding, dissemination, distribution or copying of this communication or any 
attachment(s) is strictly prohibited. If you have received this message in 
error, please notify the sender immediately, and delete it and all attachments 
from your computer and network.
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to