diff options
author | Tomi Korpipää <tomi.korpipaa@digia.com> | 2013-04-02 13:36:57 +0300 |
---|---|---|
committer | Mika Salmela <mika.salmela@digia.com> | 2013-04-02 14:15:27 +0300 |
commit | e2ea7fdba364264802174532122f7486a2924db0 (patch) | |
tree | 0d2c2211034275b4d113c5cf066da4b1a85e206b /src/datavis3d/engine/q3dwindow.cpp | |
parent | c10c2ae826ff4d2e6cf1872caf2ac65388922c83 (diff) |
Mac changes
Change-Id: I79f6ab9339e9f2b81190e19560794fbe322588af
Change-Id: I79f6ab9339e9f2b81190e19560794fbe322588af
Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'src/datavis3d/engine/q3dwindow.cpp')
-rw-r--r-- | src/datavis3d/engine/q3dwindow.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/datavis3d/engine/q3dwindow.cpp b/src/datavis3d/engine/q3dwindow.cpp index cf9f67ea..5521ce90 100644 --- a/src/datavis3d/engine/q3dwindow.cpp +++ b/src/datavis3d/engine/q3dwindow.cpp @@ -57,10 +57,7 @@ Q3DWindow::Q3DWindow(QWindow *parent) { setSurfaceType(QWindow::OpenGLSurface); QSurfaceFormat surfaceFormat; - //surfaceFormat.setDepthBufferSize(16000000); surfaceFormat.setSamples(4); - //surfaceFormat.setMajorVersion(2); - //surfaceFormat.setMinorVersion(1); surfaceFormat.setSwapBehavior(QSurfaceFormat::DoubleBuffer); //surfaceFormat.setRenderableType(QSurfaceFormat::OpenGLES); // OpenGL crashes with ANGLE, comment out or define OpenGLES setFormat(surfaceFormat); @@ -69,9 +66,9 @@ Q3DWindow::Q3DWindow(QWindow *parent) d_ptr->m_context->setFormat(requestedFormat()); d_ptr->m_context->create(); - d_ptr->m_context->makeCurrent(this); + //d_ptr->m_context->makeCurrent(this); // doesn't work with Mac - initializeOpenGLFunctions(); + //initializeOpenGLFunctions(); // doesn't work with Mac initialize(); } @@ -140,14 +137,15 @@ void Q3DWindow::renderNow() d_ptr->m_updatePending = false; + d_ptr->m_context->makeCurrent(this); // needed here for Mac + if (needsInit) { + initializeOpenGLFunctions(); // needed here for Mac getDevice(); initialize(); needsInit = false; } - d_ptr->m_context->makeCurrent(this); - render(); d_ptr->m_context->swapBuffers(this); |