summaryrefslogtreecommitdiffstats
path: root/examples/opengl/qopenglwidget/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl/qopenglwidget/main.cpp')
-rw-r--r--examples/opengl/qopenglwidget/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/opengl/qopenglwidget/main.cpp b/examples/opengl/qopenglwidget/main.cpp
index ea90dca62f..42fc772445 100644
--- a/examples/opengl/qopenglwidget/main.cpp
+++ b/examples/opengl/qopenglwidget/main.cpp
@@ -69,11 +69,15 @@ int main( int argc, char ** argv )
parser.addVersionOption();
QCommandLineOption multipleSampleOption("multisample", "Multisampling");
parser.addOption(multipleSampleOption);
+ QCommandLineOption srgbOption("srgb", "Use sRGB Color Space");
+ parser.addOption(srgbOption);
parser.process(a);
QSurfaceFormat format;
format.setDepthBufferSize(24);
format.setStencilBufferSize(8);
+ if (parser.isSet(srgbOption))
+ format.setColorSpace(QSurfaceFormat::sRGBColorSpace);
if (parser.isSet(multipleSampleOption))
format.setSamples(4);
QSurfaceFormat::setDefaultFormat(format);