src/gui/egl/qegl_wince.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
--- a/src/gui/egl/qegl_wince.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/src/gui/egl/qegl_wince.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -87,20 +87,15 @@
     return surf;
 }
 
-EGLDisplay QEglContext::getDisplay(QPaintDevice *device)
+EGLNativeDisplayType QEglContext::nativeDisplay()
 {
-    EGLDisplay dpy = 0;
-    HWND win = (static_cast<QWidget*>(device))->winId();
-    HDC myDc = GetDC(win);
+    HDC myDc = GetDC(0);
+
     if (!myDc) {
-        qWarning("QEglContext::defaultDisplay(): WinCE display is not open");
+        qWarning("QEglContext::nativeDisplay(): WinCE display is not open");
+        return EGL_DEFAULT_DISPLAY;
     }
-    dpy = eglGetDisplay(EGLNativeDisplayType(myDc));
-    if (dpy == EGL_NO_DISPLAY) {
-        qWarning("QEglContext::defaultDisplay(): Falling back to EGL_DEFAULT_DISPLAY");
-        dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
-    }
-    return dpy;
+    return EGLNativeDisplayType(myDc);
 }
 
 // Set pixel format and other properties based on a paint device.