diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp b/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp index 7498b3a304c..24085e5c134 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp @@ -13,6 +13,7 @@ int main(int argc, char** argv) application.setOrganizationDomain("geometryfactory.com"); application.setOrganizationName("GeometryFactory"); application.setApplicationName("Alpha Shape Reconstruction"); + application.setAttribute(Qt::AA_UseDesktopOpenGL); // Import resources from libCGALQt (Qt4 or Qt5). // See http://doc.trolltech.com/4.4/qdir.html#Q_INIT_RESOURCE diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt index 6161c34ca8f..2fe1e8b98e3 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt @@ -14,7 +14,7 @@ endif() find_package(CGAL COMPONENTS Qt5) include(${CGAL_USE_FILE}) -find_package(Qt5 COMPONENTS Xml Script OpenGL) +find_package(Qt5 COMPONENTS Xml Script OpenGL Svg) find_package(OpenGL) find_package(QGLViewer) @@ -37,7 +37,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_ #qt4_automoc( MainWindow.cpp Viewer.cpp) add_executable ( Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${RESOURCE_FILES} ) - qt5_use_modules(Alpha_shape_3 Xml Script OpenGL) + qt5_use_modules(Alpha_shape_3 Xml Script OpenGL Svg) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Alpha_shape_3 ) target_link_libraries( Alpha_shape_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.h b/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.h index 5029d8ea02a..08b774b5bb6 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.h +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/Viewer.h @@ -19,7 +19,7 @@ class Viewer : public QGLViewer, protected QOpenGLFunctions_3_3_Core{ int nr_of_facets; public: Viewer(QWidget* parent) - : QGLViewer(parent) + : QGLViewer(createContext(),parent) { are_buffers_initialized = false; } @@ -42,6 +42,16 @@ public: void draw(); 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); + } bool are_buffers_initialized; //Shaders elements int poly_vertexLocation;