| 1 |
// Copyright (C) 2022 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause |
| 3 |
|
| 4 |
#include <QApplication> |
| 5 |
#include <QSurfaceFormat> |
| 6 |
#include "mainwindow.h" |
| 7 |
|
| 8 |
int main( int argc, char ** argv ) |
| 9 |
{ |
| 10 |
QApplication a( argc, argv ); |
| 11 |
|
| 12 |
QCoreApplication::setApplicationName("Qt QOpenGLWidget Stereoscopic Rendering Example"); |
| 13 |
QCoreApplication::setOrganizationName("QtProject"); |
| 14 |
QCoreApplication::setApplicationVersion(QT_VERSION_STR); |
| 15 |
|
| 16 |
//! [1] |
| 17 |
QSurfaceFormat format; |
| 18 |
format.setDepthBufferSize(24); |
| 19 |
format.setStencilBufferSize(8); |
| 20 |
|
| 21 |
// Enable stereoscopic rendering support |
| 22 |
format.setStereo(true); |
| 23 |
|
| 24 |
QSurfaceFormat::setDefaultFormat(format); |
| 25 |
//! [1] |
| 26 |
|
| 27 |
MainWindow mw; |
| 28 |
mw.resize(1280, 720); |
| 29 |
mw.show(); |
| 30 |
return a.exec(); |
| 31 |
} |