diff options
Diffstat (limited to 'src/render/io/texturedata.cpp')
-rw-r--r-- | src/render/io/texturedata.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/render/io/texturedata.cpp b/src/render/io/texturedata.cpp index cfccefff4..745e0f54e 100644 --- a/src/render/io/texturedata.cpp +++ b/src/render/io/texturedata.cpp @@ -54,14 +54,14 @@ TexImageData::TexImageData() void TexImageData::setImage(const QImage &image) { - QImage glImage = image.convertToFormat(QImage::Format_RGBA8888); m_width = image.width(); m_height = image.height(); m_depth = 1; + + QImage glImage = image.convertToFormat(QImage::Format_RGBA8888); QByteArray imageBytes((const char*) glImage.constBits(), glImage.byteCount()); setData(imageBytes, QOpenGLTexture::RGBA, QOpenGLTexture::UInt8); - m_format = image.hasAlphaChannel() ? QOpenGLTexture::RGBA8_UNorm : - QOpenGLTexture::RGB8_UNorm; + m_format = QOpenGLTexture::RGBA8_UNorm; } void TexImageData::setData(const QByteArray &data, QOpenGLTexture::PixelFormat fmt, QOpenGLTexture::PixelType ptype) |