Update opengl/overpainting example for high-dpi

Depends on I8e81a0c6af61df1c4497a5934e2b89bad6f616f0 to properly
render the overlay.

Change-Id: I7ef6b726cc06eb750e7c00beb4ec6e80e85866a1
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
This commit is contained in:
Gabriel de Dietrich 2013-05-15 19:34:02 +02:00 committed by The Qt Project
parent 27f68818c8
commit 7a85fccb8f

View File

@ -161,7 +161,8 @@ void GLWidget::paintEvent(QPaintEvent *event)
static GLfloat lightPosition[4] = { 0.5, 5.0, 7.0, 1.0 };
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
setupViewport(width(), height());
qreal pixelRatio = devicePixelRatio();
setupViewport(width() * pixelRatio, height() * pixelRatio);
//! [6]
//! [7]
@ -200,7 +201,8 @@ void GLWidget::paintEvent(QPaintEvent *event)
//! [11]
void GLWidget::resizeGL(int width, int height)
{
setupViewport(width, height);
qreal pixelRatio = devicePixelRatio();
setupViewport(width*pixelRatio, height*pixelRatio);
}
//! [11]