Introduce QOpenGLTexture::target()

To extract the target of a given texture object. Somehow this
accessor was missing.

Change-Id: Ie43366bed3627a20204600e68e426b55abf37af6
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
Giuseppe D'Angelo 2014-05-24 20:28:06 +02:00 committed by The Qt Project
parent be0bfe09ee
commit 5b0bf90d26
2 changed files with 13 additions and 0 deletions

View File

@ -1482,6 +1482,17 @@ QOpenGLTexture::~QOpenGLTexture()
{
}
/*!
Returns the binding target of this texture.
\since 5.4
*/
QOpenGLTexture::Target QOpenGLTexture::target() const
{
Q_D(const QOpenGLTexture);
return d->target;
}
/*!
Creates the underlying OpenGL texture object. This requires a current valid
OpenGL context. If the texture object already exists, this function does

View File

@ -100,6 +100,8 @@ public:
explicit QOpenGLTexture(const QImage& image, MipMapGeneration genMipMaps = GenerateMipMaps);
~QOpenGLTexture();
Target target() const;
// Creation and destruction
bool create();
void destroy();