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.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/examples/qt3d/scene3d/main.cpp b/examples/qt3d/scene3d/main.cpp
index 8886263f4..2a988a271 100644
--- a/examples/qt3d/scene3d/main.cpp
+++ b/examples/qt3d/scene3d/main.cpp
@@ -53,11 +53,25 @@
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;
- view.resize(500, 500);
+ view.resize(1024, 768);
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.setSource(QUrl("qrc:/main.qml"));
view.show();