#include #include #include #include #include #include int main(int argc, char* argv[]) { QGuiApplication app(argc, argv); QGLFormat qgl_format(QGL::SampleBuffers); qgl_format.setVersion(3,3); qgl_format.setProfile(QGLFormat::CompatibilityProfile); QWindow window; QOpenGLContext context; QSurfaceFormat surface_format = QGLFormat::toSurfaceFormat(qgl_format); qDebug() << "compatibility profile.: " << (surface_format.profile() == QSurfaceFormat::CompatibilityProfile); context.setFormat(surface_format); context.create(); qDebug() << "compatibility profile.: " << (context.format().profile() == QSurfaceFormat::CompatibilityProfile); surface_format.setOption(QSurfaceFormat::DeprecatedFunctions); context.setFormat(surface_format); context.create(); qDebug() << "compatibility profile.: " << (context.format().profile() == QSurfaceFormat::CompatibilityProfile); }