From 5bb4d064945db43d62ea24b5d23bf4b0b4420e38 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 20 Feb 2017 15:19:49 +0100 Subject: Add support for custom texture format in QOpenGLWidget ...in order to support sRGB framebuffers. Add a --srgb option to the qopenglwidget example to allow testing. [ChangeLog][QtWidgets][QOpenGLWidget] Added support for specifying custom internal texture formats in QOpenGLWidget in order to make it possible to have the widget backed by an sRGB-capable framebuffer. Task-number: QTBUG-50987 Change-Id: I112e2f0ab0b1478c69e601031aa0bafaa87fa847 Reviewed-by: Andy Nichols --- examples/opengl/qopenglwidget/main.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples/opengl/qopenglwidget/main.cpp') diff --git a/examples/opengl/qopenglwidget/main.cpp b/examples/opengl/qopenglwidget/main.cpp index d7aa791142b..f9b5731b8f8 100644 --- a/examples/opengl/qopenglwidget/main.cpp +++ b/examples/opengl/qopenglwidget/main.cpp @@ -61,6 +61,8 @@ int main( int argc, char ** argv ) QSurfaceFormat format; format.setDepthBufferSize(24); format.setStencilBufferSize(8); + if (QCoreApplication::arguments().contains(QStringLiteral("--srgb"))) + format.setColorSpace(QSurfaceFormat::sRGBColorSpace); if (QCoreApplication::arguments().contains(QStringLiteral("--multisample"))) format.setSamples(4); QSurfaceFormat::setDefaultFormat(format); -- cgit v1.2.3