From 8c391c1cdf3ae7c741fefdfcc9570e9e0c8e92c6 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 7 Jul 2015 15:31:18 +0200 Subject: [PATCH] Windows context problems fixed - Called setAttribute(Qt::AA_UseDesktopOpenGL) in the main function. --- AABB_tree/demo/AABB_tree/Viewer.cpp | 9 --------- AABB_tree/demo/AABB_tree/Viewer.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/AABB_tree/demo/AABB_tree/Viewer.cpp b/AABB_tree/demo/AABB_tree/Viewer.cpp index 76fe6c3cf92..40f2ce75702 100644 --- a/AABB_tree/demo/AABB_tree/Viewer.cpp +++ b/AABB_tree/demo/AABB_tree/Viewer.cpp @@ -2,15 +2,6 @@ #include "Scene.h" #include #include -QGLContext* createContext() -{ - QOpenGLContext *context = new QOpenGLContext(); - QSurfaceFormat format; - format.setVersion(3,3); - format.setProfile(QSurfaceFormat::CompatibilityProfile); - context->setFormat(format); - return QGLContext::fromOpenGLContext(context); -} Viewer::Viewer(QWidget* parent) : QGLViewer(createContext(),parent), diff --git a/AABB_tree/demo/AABB_tree/Viewer.h b/AABB_tree/demo/AABB_tree/Viewer.h index c48dd40baf5..5991ff5bbf4 100644 --- a/AABB_tree/demo/AABB_tree/Viewer.h +++ b/AABB_tree/demo/AABB_tree/Viewer.h @@ -25,6 +25,16 @@ protected: virtual void mouseReleaseEvent(QMouseEvent* e); private: + static QGLContext* createContext() + { + QOpenGLContext *context = new QOpenGLContext(); + QSurfaceFormat format; + format.setVersion(3,3); + format.setProfile(QSurfaceFormat::CompatibilityProfile); + context->setFormat(format); + return QGLContext::fromOpenGLContext(context); + } + Scene* m_pScene; bool m_custom_mouse; QOpenGLContext *oglContext_;