1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
// Copyright (c) 2015 GeometryFactory SARL (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL: https://github.com/CGAL/cgal/blob/v6.1.1/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h $
// $Id: include/CGAL/Qt/CreateOpenGLContext.h 08b27d3db14 $
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Laurent Rineau and Maxime Gimeno
#ifndef CGAL_QT_CREATE_OPENGL_CONTEXT_H
#define CGAL_QT_CREATE_OPENGL_CONTEXT_H
#include <CGAL/license/GraphicsView.h>
#include <QOpenGLContext>
namespace CGAL{
namespace Qt{
inline QOpenGLContext* createOpenGLContext()
{
QOpenGLContext *context = new QOpenGLContext();
QSurfaceFormat format;
format.setVersion(2,1);
format.setProfile(QSurfaceFormat::CompatibilityProfile);
context->setFormat(format);
context->create();
return context;
}
} // namespace Qt
} // namespace CGAL
#endif
|