src/opengl/qgl_wince.cpp
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
child 30 5dc02b23752f
--- a/src/opengl/qgl_wince.cpp	Tue Feb 02 00:43:10 2010 +0200
+++ b/src/opengl/qgl_wince.cpp	Wed Mar 31 11:06:36 2010 +0300
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -95,8 +95,27 @@
 
 #include <qcolor.h>
 
+/*
+    QGLTemporaryContext implementation
+*/
 
+class QGLTemporaryContextPrivate
+{
+public:
+    QGLWidget *widget;
+};
 
+QGLTemporaryContext::QGLTemporaryContext(bool, QWidget *)
+    : d(new QGLTemporaryContextPrivate)
+{
+    d->widget = new QGLWidget;
+    d->widget->makeCurrent();
+}
+
+QGLTemporaryContext::~QGLTemporaryContext()
+{
+    delete d->widget;
+}
 
 /*****************************************************************************
   QGLFormat Win32/WGL-specific code
@@ -136,11 +155,6 @@
     // Get the display and initialize it.
     d->eglContext = new QEglContext();
     d->eglContext->setApi(QEgl::OpenGL);
-    if (!d->eglContext->openDisplay(device())) {
-        delete d->eglContext;
-        d->eglContext = 0;
-        return false;
-    }
 
     // Construct the configuration we need for this surface.
     QEglProperties configProps;
@@ -627,21 +641,4 @@
     }
 }
 
-void QGLExtensions::init()
-{
-    static bool init_done = false;
-
-    if (init_done)
-        return;
-    init_done = true;
-
-    // We need a context current to initialize the extensions.
-    QGLWidget tmpWidget;
-    tmpWidget.makeCurrent();
-
-    init_extensions();
-
-    tmpWidget.doneCurrent();
-}
-
 QT_END_NAMESPACE