Downscale image to max OpenGL texture

This commit is contained in:
2023-02-10 09:11:38 +01:00
parent c47ecbedb8
commit 576df9c196
4 changed files with 20 additions and 3 deletions
+7 -3
View File
@@ -99,6 +99,7 @@ void ImageWidget::setImage(std::shared_ptr<RawImage> image, int index)
if(image == nullptr)return;
makeCurrent();
m_rawImage = image;
m_rawImage->downscaleTo(m_maxTextureSize);
m_imgWidth = image->width();
m_imgHeight = image->height();
@@ -398,9 +399,12 @@ void ImageWidget::initializeGL()
qDebug() << message;
});
qDebug() << (char*)f->glGetString(GL_VENDOR);
qDebug() << (char*)f->glGetString(GL_RENDERER);
qDebug() << (char*)f->glGetString(GL_VERSION);
qDebug() << "Vendor:" << (char*)f->glGetString(GL_VENDOR);
qDebug() << "Renderer:" << (char*)f->glGetString(GL_RENDERER);
qDebug() << "Version:" << (char*)f->glGetString(GL_VERSION);
f->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize);
f->glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &m_maxArrayLayers);
qDebug() << "Max texture size:" << m_maxTextureSize << "max layers:" << m_maxArrayLayers;
//MANUAL_MIPMAP_GEN = QString((const char*)f->glGetString(GL_VENDOR)).startsWith("ATI Technologies Inc", Qt::CaseInsensitive);