summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/scene3d/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qt3d/scene3d/main.cpp')
-rw-r--r--examples/qt3d/scene3d/main.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/qt3d/scene3d/main.cpp b/examples/qt3d/scene3d/main.cpp
index 8886263f4..8d8bc581e 100644
--- a/examples/qt3d/scene3d/main.cpp
+++ b/examples/qt3d/scene3d/main.cpp
@@ -53,6 +53,20 @@
int main(int argc, char **argv)
{
+ {
+ // Set OpenGL requirements
+ QSurfaceFormat format = QSurfaceFormat::defaultFormat();
+#ifndef QT_OPENGL_ES_2
+ format.setVersion(4, 1);
+ format.setProfile(QSurfaceFormat::CoreProfile);
+ format.setSamples(4);
+#else
+ format.setVersion(3, 0);
+ format.setProfile(QSurfaceFormat::NoProfile);
+ format.setRenderableType(QSurfaceFormat::OpenGLES);
+#endif
+ QSurfaceFormat::setDefaultFormat(format);
+ }
QGuiApplication app(argc, argv);
QQuickView view;