qt_hardwarerenderer: Fix compilation with Qt 5.12

This commit is contained in:
Cacodemon345
2022-09-02 13:45:48 +06:00
committed by GitHub
parent 1e696006e5
commit a84a8615c5

View File

@@ -199,7 +199,10 @@ void HardwareRenderer::onBlit(int buf_idx, int x, int y, int w, int h) {
return;
}
m_context->makeCurrent(this);
m_texture->setData(x, y, 0, w, h, 0, QOpenGLTexture::PixelFormat::RGBA, QOpenGLTexture::PixelType::UInt8, (const void*)((uintptr_t)imagebufs[buf_idx].get() + (uintptr_t)(2048 * 4 * y + x * 4)), &m_transferOptions);
m_texture->bind();
glPixelStorei(GL_UNPACK_ROW_LENGTH, 2048);
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, QOpenGLTexture::PixelFormat::RGBA, QOpenGLTexture::PixelType::UInt8, (const void*)((uintptr_t)imagebufs[buf_idx].get() + (uintptr_t)(2048 * 4 * y + x * 4)));
m_texture->release();
buf_usage[buf_idx].clear();
source.setRect(x, y, w, h);
if (origSource != source) onResize(this->width(), this->height());