Browse Source

GL: add getters for ObjectFlags to all GL object wrappers.

Mainly just for diagnostic purposes / testing, not really useful
otherwise.
pull/680/head
Vladimír Vondruš 10 months ago
parent
commit
ce466be335
  1. 8
      src/Magnum/GL/AbstractQuery.h
  2. 11
      src/Magnum/GL/AbstractTexture.h
  3. 10
      src/Magnum/GL/Buffer.h
  4. 2
      src/Magnum/GL/BufferTexture.h
  5. 2
      src/Magnum/GL/CubeMapTexture.h
  6. 2
      src/Magnum/GL/CubeMapTextureArray.h
  7. 10
      src/Magnum/GL/Framebuffer.h
  8. 10
      src/Magnum/GL/Mesh.h
  9. 2
      src/Magnum/GL/MultisampleTexture.h
  10. 2
      src/Magnum/GL/PipelineStatisticsQuery.h
  11. 2
      src/Magnum/GL/PrimitiveQuery.h
  12. 2
      src/Magnum/GL/RectangleTexture.h
  13. 10
      src/Magnum/GL/Renderbuffer.h
  14. 2
      src/Magnum/GL/SampleQuery.h
  15. 10
      src/Magnum/GL/Shader.h
  16. 5
      src/Magnum/GL/Test/AbstractQueryGLTest.cpp
  17. 4
      src/Magnum/GL/Test/AbstractTextureGLTest.cpp
  18. 3
      src/Magnum/GL/Test/BufferGLTest.cpp
  19. 4
      src/Magnum/GL/Test/FramebufferGLTest.cpp
  20. 3
      src/Magnum/GL/Test/MeshGLTest.cpp
  21. 5
      src/Magnum/GL/Test/RenderbufferGLTest.cpp
  22. 4
      src/Magnum/GL/Test/ShaderGLTest.cpp
  23. 4
      src/Magnum/GL/Test/TransformFeedbackGLTest.cpp
  24. 2
      src/Magnum/GL/Texture.h
  25. 2
      src/Magnum/GL/TextureArray.h
  26. 2
      src/Magnum/GL/TimeQuery.h
  27. 10
      src/Magnum/GL/TransformFeedback.h

8
src/Magnum/GL/AbstractQuery.h

@ -85,6 +85,14 @@ class MAGNUM_GL_EXPORT AbstractQuery: public AbstractObject {
*/ */
GLuint release(); GLuint release();
/**
* @brief Object flags
* @m_since_latest
*
* @see @ref wrap()
*/
ObjectFlags flags() const { return _flags; }
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
/** /**
* @brief Query label * @brief Query label

11
src/Magnum/GL/AbstractTexture.h

@ -351,6 +351,17 @@ class MAGNUM_GL_EXPORT AbstractTexture: public AbstractObject {
*/ */
GLuint release(); GLuint release();
/**
* @brief Object flags
* @m_since_latest
*
* @see @ref BufferTexture::wrap(), @ref CubeMapTexture::wrap(),
* @ref CubeMapTextureArray::wrap(),
* @ref MultisampleTexture::wrap(), @ref RectangleTexture::wrap(),
* @ref Texture::wrap(), @ref TextureArray::wrap()
*/
ObjectFlags flags() const { return _flags; }
/** /**
* @brief OpenGL texture target * @brief OpenGL texture target
* @m_since_latest * @m_since_latest

10
src/Magnum/GL/Buffer.h

@ -889,7 +889,7 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject {
* Unlike buffer created using constructor, the OpenGL object is by * Unlike buffer created using constructor, the OpenGL object is by
* default not deleted on destruction, use @p flags for different * default not deleted on destruction, use @p flags for different
* behavior. * behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static Buffer wrap(GLuint id, TargetHint targetHint = TargetHint::Array, ObjectFlags flags = {}) { static Buffer wrap(GLuint id, TargetHint targetHint = TargetHint::Array, ObjectFlags flags = {}) {
return Buffer{id, targetHint, flags}; return Buffer{id, targetHint, flags};
@ -1000,6 +1000,14 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject {
/* MinGW complains loudly if the declaration doesn't also have inline */ /* MinGW complains loudly if the declaration doesn't also have inline */
inline GLuint release(); inline GLuint release();
/**
* @brief Object flags
* @m_since_latest
*
* @see @ref wrap()
*/
ObjectFlags flags() const { return _flags; }
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
/** /**
* @brief Buffer label * @brief Buffer label

2
src/Magnum/GL/BufferTexture.h

@ -112,7 +112,7 @@ class MAGNUM_GL_EXPORT BufferTexture: public AbstractTexture {
* with target @def_gl{TEXTURE_BUFFER}. Unlike texture created using * with target @def_gl{TEXTURE_BUFFER}. Unlike texture created using
* constructor, the OpenGL object is by default not deleted on * constructor, the OpenGL object is by default not deleted on
* destruction, use @p flags for different behavior. * destruction, use @p flags for different behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static BufferTexture wrap(GLuint id, ObjectFlags flags = {}) { static BufferTexture wrap(GLuint id, ObjectFlags flags = {}) {
return BufferTexture{id, flags}; return BufferTexture{id, flags};

2
src/Magnum/GL/CubeMapTexture.h

@ -178,7 +178,7 @@ class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture {
* with target @def_gl{TEXTURE_CUBE_MAP}. Unlike texture created using * with target @def_gl{TEXTURE_CUBE_MAP}. Unlike texture created using
* constructor, the OpenGL object is by default not deleted on * constructor, the OpenGL object is by default not deleted on
* destruction, use @p flags for different behavior. * destruction, use @p flags for different behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static CubeMapTexture wrap(GLuint id, ObjectFlags flags = {}) { static CubeMapTexture wrap(GLuint id, ObjectFlags flags = {}) {
return CubeMapTexture{id, flags}; return CubeMapTexture{id, flags};

2
src/Magnum/GL/CubeMapTextureArray.h

@ -163,7 +163,7 @@ class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture {
* with target @def_gl{TEXTURE_CUBE_MAP_ARRAY}. Unlike texture created * with target @def_gl{TEXTURE_CUBE_MAP_ARRAY}. Unlike texture created
* using constructor, the OpenGL object is by default not deleted on * using constructor, the OpenGL object is by default not deleted on
* destruction, use @p flags for different behavior. * destruction, use @p flags for different behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static CubeMapTextureArray wrap(GLuint id, ObjectFlags flags = {}) { static CubeMapTextureArray wrap(GLuint id, ObjectFlags flags = {}) {
return CubeMapTextureArray{id, flags}; return CubeMapTextureArray{id, flags};

10
src/Magnum/GL/Framebuffer.h

@ -392,7 +392,7 @@ class MAGNUM_GL_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractO
* object. Unlike framebuffer created using constructor, the OpenGL * object. Unlike framebuffer created using constructor, the OpenGL
* object is by default not deleted on destruction, use @p flags for * object is by default not deleted on destruction, use @p flags for
* different behavior. * different behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static Framebuffer wrap(GLuint id, const Range2Di& viewport, ObjectFlags flags = {}) { static Framebuffer wrap(GLuint id, const Range2Di& viewport, ObjectFlags flags = {}) {
return Framebuffer{id, viewport, flags}; return Framebuffer{id, viewport, flags};
@ -459,6 +459,14 @@ class MAGNUM_GL_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractO
/* MinGW complains loudly if the declaration doesn't also have inline */ /* MinGW complains loudly if the declaration doesn't also have inline */
inline GLuint release(); inline GLuint release();
/**
* @brief Object flags
* @m_since_latest
*
* @see @ref wrap()
*/
ObjectFlags flags() const { return _flags; }
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
/** /**
* @brief Framebuffer label * @brief Framebuffer label

10
src/Magnum/GL/Mesh.h

@ -510,7 +510,7 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject {
* object. Unlike vertex array created using constructor, the OpenGL * object. Unlike vertex array created using constructor, the OpenGL
* object is by default not deleted on destruction, use @p flags for * object is by default not deleted on destruction, use @p flags for
* different behavior. * different behavior.
* @see @ref release() * @see @ref release(), @ref flags()
* @requires_gl30 Extension @gl_extension{ARB,vertex_array_object} * @requires_gl30 Extension @gl_extension{ARB,vertex_array_object}
* @requires_gles30 Extension @gl_extension{OES,vertex_array_object} in * @requires_gles30 Extension @gl_extension{OES,vertex_array_object} in
* OpenGL ES 2.0. * OpenGL ES 2.0.
@ -615,6 +615,14 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject {
*/ */
GLuint release(); GLuint release();
/**
* @brief Object flags
* @m_since_latest
*
* @see @ref wrap()
*/
ObjectFlags flags() const { return _flags; }
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
/** /**
* @brief Mesh label * @brief Mesh label

2
src/Magnum/GL/MultisampleTexture.h

@ -201,7 +201,7 @@ MultisampleTexture: public AbstractTexture {
* Unlike texture created using constructor, the OpenGL object is by * Unlike texture created using constructor, the OpenGL object is by
* default not deleted on destruction, use @p flags for different * default not deleted on destruction, use @p flags for different
* behavior. * behavior.
* @see @ref release() * @see @ref release(), @ref wrap()
*/ */
static MultisampleTexture<dimensions> wrap(GLuint id, ObjectFlags flags = {}) { static MultisampleTexture<dimensions> wrap(GLuint id, ObjectFlags flags = {}) {
return MultisampleTexture<dimensions>{id, flags}; return MultisampleTexture<dimensions>{id, flags};

2
src/Magnum/GL/PipelineStatisticsQuery.h

@ -119,7 +119,7 @@ class MAGNUM_GL_EXPORT PipelineStatisticsQuery: public AbstractQuery {
* Unlike query created using constructor, the OpenGL object is by * Unlike query created using constructor, the OpenGL object is by
* default not deleted on destruction, use @p flags for different * default not deleted on destruction, use @p flags for different
* behavior. * behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static PipelineStatisticsQuery wrap(GLuint id, Target target, ObjectFlags flags = {}) { static PipelineStatisticsQuery wrap(GLuint id, Target target, ObjectFlags flags = {}) {
return PipelineStatisticsQuery{id, target, flags}; return PipelineStatisticsQuery{id, target, flags};

2
src/Magnum/GL/PrimitiveQuery.h

@ -121,7 +121,7 @@ class MAGNUM_GL_EXPORT PrimitiveQuery: public AbstractQuery {
* Unlike query created using constructor, the OpenGL object is by * Unlike query created using constructor, the OpenGL object is by
* default not deleted on destruction, use @p flags for different * default not deleted on destruction, use @p flags for different
* behavior. * behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static PrimitiveQuery wrap(GLuint id, Target target, ObjectFlags flags = {}) { static PrimitiveQuery wrap(GLuint id, Target target, ObjectFlags flags = {}) {
return PrimitiveQuery{id, target, flags}; return PrimitiveQuery{id, target, flags};

2
src/Magnum/GL/RectangleTexture.h

@ -125,7 +125,7 @@ class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture {
* with target @def_gl{TEXTURE_RECTANGLE}. Unlike texture created using * with target @def_gl{TEXTURE_RECTANGLE}. Unlike texture created using
* constructor, the OpenGL object is by default not deleted on * constructor, the OpenGL object is by default not deleted on
* destruction, use @p flags for different behavior. * destruction, use @p flags for different behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static RectangleTexture wrap(GLuint id, ObjectFlags flags = {}) { static RectangleTexture wrap(GLuint id, ObjectFlags flags = {}) {
return RectangleTexture{id, flags}; return RectangleTexture{id, flags};

10
src/Magnum/GL/Renderbuffer.h

@ -109,7 +109,7 @@ class MAGNUM_GL_EXPORT Renderbuffer: public AbstractObject {
* object. Unlike renderbuffer created using constructor, the OpenGL * object. Unlike renderbuffer created using constructor, the OpenGL
* object is by default not deleted on destruction, use @p flags for * object is by default not deleted on destruction, use @p flags for
* different behavior. * different behavior.
* @see @ref release() * @see @ref release(), @ref wrap()
*/ */
static Renderbuffer wrap(GLuint id, ObjectFlags flags = {}) { static Renderbuffer wrap(GLuint id, ObjectFlags flags = {}) {
return Renderbuffer{id, flags}; return Renderbuffer{id, flags};
@ -178,6 +178,14 @@ class MAGNUM_GL_EXPORT Renderbuffer: public AbstractObject {
/* MinGW complains loudly if the declaration doesn't also have inline */ /* MinGW complains loudly if the declaration doesn't also have inline */
inline GLuint release(); inline GLuint release();
/**
* @brief Object flags
* @m_since_latest
*
* @see @ref wrap()
*/
ObjectFlags flags() const { return _flags; }
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
/** /**
* @brief Renderbuffer label * @brief Renderbuffer label

2
src/Magnum/GL/SampleQuery.h

@ -179,7 +179,7 @@ class MAGNUM_GL_EXPORT SampleQuery: public AbstractQuery {
* Unlike query created using constructor, the OpenGL object is by * Unlike query created using constructor, the OpenGL object is by
* default not deleted on destruction, use @p flags for different * default not deleted on destruction, use @p flags for different
* behavior. * behavior.
* @see @ref release(), @fn_gl{IsQuery} * @see @ref release(), @ref flags(), @fn_gl{IsQuery}
*/ */
static SampleQuery wrap(GLuint id, Target target, ObjectFlags flags = {}) { static SampleQuery wrap(GLuint id, Target target, ObjectFlags flags = {}) {
return SampleQuery{id, target, flags}; return SampleQuery{id, target, flags};

10
src/Magnum/GL/Shader.h

@ -575,7 +575,7 @@ class MAGNUM_GL_EXPORT Shader: public AbstractObject {
* Unlike a shader created using a constructor, the OpenGL object is by * Unlike a shader created using a constructor, the OpenGL object is by
* default not deleted on destruction, use @p flags for different * default not deleted on destruction, use @p flags for different
* behavior. * behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static Shader wrap(Type type, GLuint id, ObjectFlags flags = {}) { static Shader wrap(Type type, GLuint id, ObjectFlags flags = {}) {
return Shader{type, id, flags}; return Shader{type, id, flags};
@ -645,6 +645,14 @@ class MAGNUM_GL_EXPORT Shader: public AbstractObject {
/* MinGW complains loudly if the declaration doesn't also have inline */ /* MinGW complains loudly if the declaration doesn't also have inline */
inline GLuint release(); inline GLuint release();
/**
* @brief Object flags
* @m_since_latest
*
* @see @ref wrap()
*/
ObjectFlags flags() const { return _flags; }
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
/** /**
* @brief Shader label * @brief Shader label

5
src/Magnum/GL/Test/AbstractQueryGLTest.cpp

@ -24,6 +24,8 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/TestSuite/Compare/Numeric.h>
#include "Magnum/GL/Context.h" #include "Magnum/GL/Context.h"
#include "Magnum/GL/Extensions.h" #include "Magnum/GL/Extensions.h"
#include "Magnum/GL/OpenGLTester.h" #include "Magnum/GL/OpenGLTester.h"
@ -62,6 +64,9 @@ void AbstractQueryGLTest::construct() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_VERIFY(query.id() > 0); CORRADE_VERIFY(query.id() > 0);
CORRADE_COMPARE_AS(query.flags(),
ObjectFlag::DeleteOnDestruction,
TestSuite::Compare::GreaterOrEqual);
} }
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();

4
src/Magnum/GL/Test/AbstractTextureGLTest.cpp

@ -25,6 +25,7 @@
*/ */
#include <Corrade/Containers/String.h> #include <Corrade/Containers/String.h>
#include <Corrade/TestSuite/Compare/Numeric.h>
#include "Magnum/ImageView.h" #include "Magnum/ImageView.h"
#include "Magnum/GL/Context.h" #include "Magnum/GL/Context.h"
@ -88,6 +89,9 @@ void AbstractTextureGLTest::construct() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_VERIFY(texture.id() > 0); CORRADE_VERIFY(texture.id() > 0);
CORRADE_COMPARE_AS(texture.flags(),
ObjectFlag::DeleteOnDestruction,
TestSuite::Compare::GreaterOrEqual);
CORRADE_COMPARE(texture.target(), GL_TEXTURE_2D); CORRADE_COMPARE(texture.target(), GL_TEXTURE_2D);
} }

3
src/Magnum/GL/Test/BufferGLTest.cpp

@ -161,6 +161,9 @@ void BufferGLTest::construct() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_VERIFY(buffer.id() > 0); CORRADE_VERIFY(buffer.id() > 0);
CORRADE_COMPARE_AS(buffer.flags(),
ObjectFlag::DeleteOnDestruction,
TestSuite::Compare::GreaterOrEqual);
CORRADE_COMPARE(buffer.targetHint(), Buffer::TargetHint::Array); CORRADE_COMPARE(buffer.targetHint(), Buffer::TargetHint::Array);
CORRADE_COMPARE(buffer.size(), 0); CORRADE_COMPARE(buffer.size(), 0);
} }

4
src/Magnum/GL/Test/FramebufferGLTest.cpp

@ -29,6 +29,7 @@
#include <Corrade/Containers/StridedArrayView.h> #include <Corrade/Containers/StridedArrayView.h>
#include <Corrade/Containers/String.h> #include <Corrade/Containers/String.h>
#include <Corrade/TestSuite/Compare/Container.h> #include <Corrade/TestSuite/Compare/Container.h>
#include <Corrade/TestSuite/Compare/Numeric.h>
#include "Magnum/Image.h" #include "Magnum/Image.h"
#include "Magnum/ImageView.h" #include "Magnum/ImageView.h"
@ -383,6 +384,9 @@ void FramebufferGLTest::construct() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_VERIFY(framebuffer.id() > 0); CORRADE_VERIFY(framebuffer.id() > 0);
CORRADE_COMPARE_AS(framebuffer.flags(),
ObjectFlag::DeleteOnDestruction,
TestSuite::Compare::GreaterOrEqual);
CORRADE_COMPARE(framebuffer.viewport(), Range2Di({32, 16}, {128, 256})); CORRADE_COMPARE(framebuffer.viewport(), Range2Di({32, 16}, {128, 256}));
} }

3
src/Magnum/GL/Test/MeshGLTest.cpp

@ -789,6 +789,9 @@ void MeshGLTest::construct() {
#endif #endif
{ {
CORRADE_VERIFY(mesh.id() > 0); CORRADE_VERIFY(mesh.id() > 0);
CORRADE_COMPARE_AS(mesh.flags(),
ObjectFlag::DeleteOnDestruction,
TestSuite::Compare::GreaterOrEqual);
} }
} }

5
src/Magnum/GL/Test/RenderbufferGLTest.cpp

@ -24,6 +24,8 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/TestSuite/Compare/Numeric.h>
#include "Magnum/GL/Context.h" #include "Magnum/GL/Context.h"
#include "Magnum/GL/Extensions.h" #include "Magnum/GL/Extensions.h"
#include "Magnum/GL/OpenGLTester.h" #include "Magnum/GL/OpenGLTester.h"
@ -86,6 +88,9 @@ void RenderbufferGLTest::construct() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_VERIFY(renderbuffer.id() > 0); CORRADE_VERIFY(renderbuffer.id() > 0);
CORRADE_COMPARE_AS(renderbuffer.flags(),
ObjectFlag::DeleteOnDestruction,
TestSuite::Compare::GreaterOrEqual);
} }
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();

4
src/Magnum/GL/Test/ShaderGLTest.cpp

@ -29,6 +29,7 @@
#include <Corrade/Containers/String.h> #include <Corrade/Containers/String.h>
#include <Corrade/Containers/StringIterable.h> #include <Corrade/Containers/StringIterable.h>
#include <Corrade/TestSuite/Compare/Container.h> #include <Corrade/TestSuite/Compare/Container.h>
#include <Corrade/TestSuite/Compare/Numeric.h>
#include <Corrade/TestSuite/Compare/String.h> #include <Corrade/TestSuite/Compare/String.h>
#include <Corrade/Utility/System.h> #include <Corrade/Utility/System.h>
#include <Corrade/Utility/Path.h> #include <Corrade/Utility/Path.h>
@ -125,6 +126,9 @@ void ShaderGLTest::construct() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_VERIFY(shader.id() > 0); CORRADE_VERIFY(shader.id() > 0);
CORRADE_COMPARE_AS(shader.flags(),
ObjectFlag::DeleteOnDestruction,
TestSuite::Compare::GreaterOrEqual);
CORRADE_COMPARE(shader.type(), Shader::Type::Fragment); CORRADE_COMPARE(shader.type(), Shader::Type::Fragment);
/* There may be various workaround defines after, so check just that /* There may be various workaround defines after, so check just that
the first source is the version definition */ the first source is the version definition */

4
src/Magnum/GL/Test/TransformFeedbackGLTest.cpp

@ -29,6 +29,7 @@
#include <Corrade/Containers/String.h> #include <Corrade/Containers/String.h>
#include <Corrade/Containers/StringIterable.h> #include <Corrade/Containers/StringIterable.h>
#include <Corrade/Containers/Triple.h> #include <Corrade/Containers/Triple.h>
#include <Corrade/TestSuite/Compare/Numeric.h>
#include <Corrade/Utility/Format.h> #include <Corrade/Utility/Format.h>
#include "Magnum/Image.h" #include "Magnum/Image.h"
@ -159,6 +160,9 @@ void TransformFeedbackGLTest::construct() {
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();
CORRADE_VERIFY(feedback.id() > 0); CORRADE_VERIFY(feedback.id() > 0);
CORRADE_COMPARE_AS(feedback.flags(),
ObjectFlag::DeleteOnDestruction,
TestSuite::Compare::GreaterOrEqual);
} }
MAGNUM_VERIFY_NO_GL_ERROR(); MAGNUM_VERIFY_NO_GL_ERROR();

2
src/Magnum/GL/Texture.h

@ -257,7 +257,7 @@ Texture: public AbstractTexture {
* @def_gl{TEXTURE_3D} based on dimension count. Unlike texture created * @def_gl{TEXTURE_3D} based on dimension count. Unlike texture created
* using constructor, the OpenGL object is by default not deleted on * using constructor, the OpenGL object is by default not deleted on
* destruction, use @p flags for different behavior. * destruction, use @p flags for different behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static Texture<dimensions> wrap(GLuint id, ObjectFlags flags = {}) { static Texture<dimensions> wrap(GLuint id, ObjectFlags flags = {}) {
return Texture<dimensions>{id, flags}; return Texture<dimensions>{id, flags};

2
src/Magnum/GL/TextureArray.h

@ -235,7 +235,7 @@ TextureArray: public AbstractTexture {
* based on dimension count. Unlike texture created using constructor, * based on dimension count. Unlike texture created using constructor,
* the OpenGL object is by default not deleted on destruction, use * the OpenGL object is by default not deleted on destruction, use
* @p flags for different behavior. * @p flags for different behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static TextureArray<dimensions> wrap(GLuint id, ObjectFlags flags = {}) { static TextureArray<dimensions> wrap(GLuint id, ObjectFlags flags = {}) {
return TextureArray<dimensions>{id, flags}; return TextureArray<dimensions>{id, flags};

2
src/Magnum/GL/TimeQuery.h

@ -97,7 +97,7 @@ class MAGNUM_GL_EXPORT TimeQuery: public AbstractQuery {
* Unlike query created using constructor, the OpenGL object is by * Unlike query created using constructor, the OpenGL object is by
* default not deleted on destruction, use @p flags for different * default not deleted on destruction, use @p flags for different
* behavior. * behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static TimeQuery wrap(GLuint id, Target target, ObjectFlags flags = {}) { static TimeQuery wrap(GLuint id, Target target, ObjectFlags flags = {}) {
return TimeQuery{id, target, flags}; return TimeQuery{id, target, flags};

10
src/Magnum/GL/TransformFeedback.h

@ -181,7 +181,7 @@ class MAGNUM_GL_EXPORT TransformFeedback: public AbstractObject {
* object. Unlike renderbuffer created using constructor, the OpenGL * object. Unlike renderbuffer created using constructor, the OpenGL
* object is by default not deleted on destruction, use @p flags for * object is by default not deleted on destruction, use @p flags for
* different behavior. * different behavior.
* @see @ref release() * @see @ref release(), @ref flags()
*/ */
static TransformFeedback wrap(GLuint id, ObjectFlags flags = {}) { static TransformFeedback wrap(GLuint id, ObjectFlags flags = {}) {
return TransformFeedback{id, flags}; return TransformFeedback{id, flags};
@ -250,6 +250,14 @@ class MAGNUM_GL_EXPORT TransformFeedback: public AbstractObject {
/* MinGW complains loudly if the declaration doesn't also have inline */ /* MinGW complains loudly if the declaration doesn't also have inline */
inline GLuint release(); inline GLuint release();
/**
* @brief Object flags
* @m_since_latest
*
* @see @ref wrap()
*/
ObjectFlags flags() const { return _flags; }
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
/** /**
* @brief Transform feedback label * @brief Transform feedback label

Loading…
Cancel
Save