summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltexture.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-03-18 09:30:04 +0100
committerPaul Lemire <paul.lemire@kdab.com>2019-03-26 06:07:21 +0000
commita57ac1b20e34decced0355935fe352eb55f51e5c (patch)
tree812e54e0c818408da09eff11a9ab2da9ece0ceb2 /src/gui/opengl/qopengltexture.cpp
parentd0f016ebfb86fcebcf72c37c489260a0d02147e7 (diff)
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 <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/gui/opengl/qopengltexture.cpp')
-rw-r--r--src/gui/opengl/qopengltexture.cpp29
1 files changed, 29 insertions, 0 deletions
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
@@ -3530,6 +3530,35 @@ void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset,
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
+
+ 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 and layerof the sub image we want to
update are specified with \a mipLevel and \a layer.