From 5b0bf90d262ba6ece448c463d0fed5095cd5eb21 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sat, 24 May 2014 20:28:06 +0200 Subject: [PATCH] Introduce QOpenGLTexture::target() To extract the target of a given texture object. Somehow this accessor was missing. Change-Id: Ie43366bed3627a20204600e68e426b55abf37af6 Reviewed-by: Paul Lemire Reviewed-by: Sean Harmer Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopengltexture.cpp | 11 +++++++++++ src/gui/opengl/qopengltexture.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp index 8fefd43977..ac0b4f4e78 100644 --- a/src/gui/opengl/qopengltexture.cpp +++ b/src/gui/opengl/qopengltexture.cpp @@ -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 diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h index 4587dd2f76..113325f0f6 100644 --- a/src/gui/opengl/qopengltexture.h +++ b/src/gui/opengl/qopengltexture.h @@ -100,6 +100,8 @@ public: explicit QOpenGLTexture(const QImage& image, MipMapGeneration genMipMaps = GenerateMipMaps); ~QOpenGLTexture(); + Target target() const; + // Creation and destruction bool create(); void destroy();