Browse Source

GL: add *Texture::target().

Useful when interacting with raw GL code.
pull/459/head
Vladimír Vondruš 6 years ago
parent
commit
851af4fded
  1. 2
      doc/changelog.dox
  2. 6
      src/Magnum/GL/AbstractTexture.h
  3. 1
      src/Magnum/GL/Test/AbstractTextureGLTest.cpp

2
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

6
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
*

1
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();

Loading…
Cancel
Save