diff --git a/doc/changelog.dox b/doc/changelog.dox index 417be9494..3705cb822 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -60,6 +60,8 @@ See also: @webgl_extension{WEBGL,multi_draw_instanced_base_vertex_base_instance} extensions, however there's no Emscripten entrypoints for those yet which means these can'be implemented right now. +- Added a @ref GL::AbstractTexture::target() getter to simplify interaction + with raw GL code @subsubsection changelog-latest-new-math Math library diff --git a/src/Magnum/GL/AbstractTexture.h b/src/Magnum/GL/AbstractTexture.h index dca71a53d..c60b24581 100644 --- a/src/Magnum/GL/AbstractTexture.h +++ b/src/Magnum/GL/AbstractTexture.h @@ -332,6 +332,12 @@ class MAGNUM_GL_EXPORT AbstractTexture: public AbstractObject { /** @brief OpenGL texture ID */ GLuint id() const { return _id; } + /** + * @brief OpenGL texture target + * @m_since_latest + */ + GLenum target() const { return _target; } + /** * @brief Release OpenGL object * diff --git a/src/Magnum/GL/Test/AbstractTextureGLTest.cpp b/src/Magnum/GL/Test/AbstractTextureGLTest.cpp index 4a4f37e40..f1cb013b7 100644 --- a/src/Magnum/GL/Test/AbstractTextureGLTest.cpp +++ b/src/Magnum/GL/Test/AbstractTextureGLTest.cpp @@ -96,6 +96,7 @@ void AbstractTextureGLTest::construct() { MAGNUM_VERIFY_NO_GL_ERROR(); CORRADE_VERIFY(texture.id() > 0); + CORRADE_COMPARE(texture.target(), GL_TEXTURE_2D); } MAGNUM_VERIFY_NO_GL_ERROR();