From da2f627ba2117b6ef1791ff8971df2fc68c29d10 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 20 Mar 2013 13:20:14 +0100 Subject: improve openglwindow example a bit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I50e00c33c100beab975d0fcbfc4ccdd496cccbaf Reviewed-by: Samuel Rødal --- examples/gui/openglwindow/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/gui/openglwindow/main.cpp') diff --git a/examples/gui/openglwindow/main.cpp b/examples/gui/openglwindow/main.cpp index cd6dca3352..237680a889 100644 --- a/examples/gui/openglwindow/main.cpp +++ b/examples/gui/openglwindow/main.cpp @@ -80,7 +80,7 @@ int main(int argc, char **argv) QGuiApplication app(argc, argv); QSurfaceFormat format; - format.setSamples(4); + format.setSamples(16); TriangleWindow window; window.setFormat(format); @@ -136,7 +136,8 @@ void TriangleWindow::initialize() //! [5] void TriangleWindow::render() { - glViewport(0, 0, width(), height()); + const qreal retinaScale = devicePixelRatio(); + glViewport(0, 0, width() * retinaScale, height() * retinaScale); glClear(GL_COLOR_BUFFER_BIT); -- cgit v1.2.3