From a57ac1b20e34decced0355935fe352eb55f51e5c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 Mar 2019 09:30:04 +0100 Subject: Add missing implementation of a QOpenGLTexture::setData() overload Change d15b02ff291e3124d9bb8ac3b06b704c292f52ab was missing the implementation of: void setData(int xOffset, int yOffset, int zOffset, int width, int height, int depth, int mipLevel, PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions * const options = nullptr); Change-Id: Ie0d1679cc54bc6bd6b51392a22707566d238845a Reviewed-by: Giuseppe D'Angelo --- src/gui/opengl/qopengltexture.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/gui/opengl/qopengltexture.cpp') diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index 1e4d627e2a..61a6202017 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -3523,6 +3523,35 @@ void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset, sourceType, data, options); } +/*! + \since 5.14 + \overload + + This overload is to be used to update a part of the texture. Parameters \a + xOffset, \a yOffset, \a zOffset specify the texel offsets within the + texture. Parameters \a width, \a height and \a depth specify the dimensions + of the sub image. The mip map level the sub image we want to + update is specified with \a mipLevel. + + The structure of the pixel data pointed to by \a data is specified by \a + sourceFormat and \a sourceType. The pixel data upload can optionally be + controlled by \a options. +*/ +void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset, + int width, int height, int depth, + int mipLevel, + PixelFormat sourceFormat, PixelType sourceType, + const void *data, const QOpenGLPixelTransferOptions * const options) +{ + Q_D(QOpenGLTexture); + Q_ASSERT(d->textureId); + d->setData(xOffset, yOffset, zOffset, + width, height, depth, + mipLevel, 0, 1, + QOpenGLTexture::CubeMapPositiveX, sourceFormat, + sourceType, data, options); +} + /*! \since 5.14 \overload -- cgit v1.2.3