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:
parent
27f68818c8
commit
7a85fccb8f
@ -161,7 +161,8 @@ void GLWidget::paintEvent(QPaintEvent *event)
|
|||||||
static GLfloat lightPosition[4] = { 0.5, 5.0, 7.0, 1.0 };
|
static GLfloat lightPosition[4] = { 0.5, 5.0, 7.0, 1.0 };
|
||||||
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
|
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
|
||||||
|
|
||||||
setupViewport(width(), height());
|
qreal pixelRatio = devicePixelRatio();
|
||||||
|
setupViewport(width() * pixelRatio, height() * pixelRatio);
|
||||||
//! [6]
|
//! [6]
|
||||||
|
|
||||||
//! [7]
|
//! [7]
|
||||||
@ -200,7 +201,8 @@ void GLWidget::paintEvent(QPaintEvent *event)
|
|||||||
//! [11]
|
//! [11]
|
||||||
void GLWidget::resizeGL(int width, int height)
|
void GLWidget::resizeGL(int width, int height)
|
||||||
{
|
{
|
||||||
setupViewport(width, height);
|
qreal pixelRatio = devicePixelRatio();
|
||||||
|
setupViewport(width*pixelRatio, height*pixelRatio);
|
||||||
}
|
}
|
||||||
//! [11]
|
//! [11]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user