summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_qpa.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-08-06 15:10:20 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2010-08-06 15:10:20 +0200
commit47bed030ffedded5914d8309bf2e1cccc1fd78d0 (patch)
tree6e497e442549b6bc405995a4a2b45c6ce6b600f0 /src/opengl/qgl_qpa.cpp
parent1d8ce23abdb0bd980292e4a9c8d87c019585150a (diff)
Added reduced config to glxconfig
should help if there are not many glxconfigs available. Also made QGLTemporaryContext use a QWidget again instead of a QGLWidget; This allows us to ask for a smaller window size before making the context.
Diffstat (limited to 'src/opengl/qgl_qpa.cpp')
-rw-r--r--src/opengl/qgl_qpa.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index d87e668e1f..c328819e58 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -244,7 +244,7 @@ void QGLContext::generateFontDisplayLists(const QFont & fnt, int listBase)
class QGLTemporaryContextPrivate
{
public:
- QGLWidget *widget;
+ QWidget *widget;
QGLContext *context;
};
@@ -254,13 +254,19 @@ QGLTemporaryContext::QGLTemporaryContext(bool, QWidget *)
d->context = const_cast<QGLContext *>(QGLContext::currentContext());
if (d->context)
d->context->doneCurrent();
- d->widget = new QGLWidget;
- d->widget->makeCurrent();
+ d->widget = new QWidget;
+ d->widget->setGeometry(0,0,3,3);
+ QPlatformWindowFormat format = d->widget->platformWindowFormat();
+ format.setWindowApi(QPlatformWindowFormat::OpenGL);
+ d->widget->winId();
+
+
+ d->widget->platformWindow()->glContext()->makeCurrent();
}
QGLTemporaryContext::~QGLTemporaryContext()
{
- d->widget->doneCurrent();
+ d->widget->platformWindow()->glContext()->doneCurrent();
if (d->context)
d->context->makeCurrent();
delete d->widget;