qt: Compatibility improvements
* Patch to build with Qt 5.11 and later by jriwanek * Attempt to fix viewport on hardware renderers
This commit is contained in:
@@ -32,7 +32,7 @@ extern "C" {
|
||||
|
||||
void HardwareRenderer::resizeGL(int w, int h)
|
||||
{
|
||||
glViewport(0, 0, w * devicePixelRatio(), h * devicePixelRatio());
|
||||
glViewport(0, 0, qRound(w * devicePixelRatio()), qRound(h * devicePixelRatio()));
|
||||
}
|
||||
|
||||
#define PROGRAM_VERTEX_ATTRIBUTE 0
|
||||
@@ -141,11 +141,11 @@ void HardwareRenderer::paintGL() {
|
||||
QVector<QVector2D> verts, texcoords;
|
||||
QMatrix4x4 mat;
|
||||
mat.setToIdentity();
|
||||
mat.ortho(QRect(0, 0, width(), height()));
|
||||
mat.ortho(QRectF(0, 0, (qreal)width(), (qreal)height()));
|
||||
verts.push_back(QVector2D((float)destination.x(), (float)destination.y()));
|
||||
verts.push_back(QVector2D((float)destination.x(), (float)destination.y() + destination.height()));
|
||||
verts.push_back(QVector2D((float)destination.x() + destination.width(), (float)destination.y() + destination.height()));
|
||||
verts.push_back(QVector2D((float)destination.x() + destination.width(), (float)destination.y()));
|
||||
verts.push_back(QVector2D((float)destination.x(), (float)destination.y() + (float)destination.height()));
|
||||
verts.push_back(QVector2D((float)destination.x() + (float)destination.width(), (float)destination.y() + (float)destination.height()));
|
||||
verts.push_back(QVector2D((float)destination.x() + (float)destination.width(), (float)destination.y()));
|
||||
texcoords.push_back(QVector2D((float)source.x() / 2048.f, (float)(source.y()) / 2048.f));
|
||||
texcoords.push_back(QVector2D((float)source.x() / 2048.f, (float)(source.y() + source.height()) / 2048.f));
|
||||
texcoords.push_back(QVector2D((float)(source.x() + source.width()) / 2048.f, (float)(source.y() + source.height()) / 2048.f));
|
||||
|
||||
Reference in New Issue
Block a user