Files
cgal/GraphicsView/include/CGAL/Qt/CreateOpenGLContext.h
T
Laurent Rineau 1f13a625b1 restore the OpenGL format in DemosMainWindow
That still does not work well when the widget is a `QOpenGLWidget`.
We probably need to derive from that class, to call `glClearColor(..)`
in the `paintGL()` method.
2023-08-30 09:32:31 +02:00

32 lines
749 B
C++

// Copyright (c) 2015 GeometryFactory SARL (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-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 <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