Browse Source

Documentation updates for the new theme in the root namespace.

Also adding search keywords for hopefully all OpenGL APIs.
pull/231/head
Vladimír Vondruš 8 years ago
parent
commit
8181158697
  1. 5
      doc/opengl-mapping.dox
  2. 99
      src/Magnum/AbstractFramebuffer.h
  3. 3
      src/Magnum/AbstractObject.h
  4. 19
      src/Magnum/AbstractQuery.h
  5. 119
      src/Magnum/AbstractShaderProgram.h
  6. 79
      src/Magnum/AbstractTexture.h
  7. 48
      src/Magnum/Attribute.h
  8. 194
      src/Magnum/Buffer.h
  9. 10
      src/Magnum/BufferImage.h
  10. 43
      src/Magnum/BufferTexture.h
  11. 1
      src/Magnum/BufferTextureFormat.h
  12. 4
      src/Magnum/Color.h
  13. 6
      src/Magnum/ColorFormat.h
  14. 21
      src/Magnum/Context.h
  15. 149
      src/Magnum/CubeMapTexture.h
  16. 135
      src/Magnum/CubeMapTextureArray.h
  17. 130
      src/Magnum/DebugOutput.h
  18. 58
      src/Magnum/DefaultFramebuffer.h
  19. 6
      src/Magnum/DimensionTraits.h
  20. 144
      src/Magnum/Framebuffer.h
  21. 8
      src/Magnum/Image.h
  22. 2
      src/Magnum/ImageFormat.h
  23. 8
      src/Magnum/ImageReference.h
  24. 12
      src/Magnum/ImageView.h
  25. 240
      src/Magnum/Magnum.h
  26. 170
      src/Magnum/Mesh.h
  27. 16
      src/Magnum/MeshView.h
  28. 59
      src/Magnum/MultisampleTexture.h
  29. 2
      src/Magnum/OpenGLTester.h
  30. 3
      src/Magnum/PixelFormat.h
  31. 66
      src/Magnum/PixelStorage.h
  32. 26
      src/Magnum/PrimitiveQuery.h
  33. 92
      src/Magnum/RectangleTexture.h
  34. 37
      src/Magnum/Renderbuffer.h
  35. 1
      src/Magnum/RenderbufferFormat.h
  36. 145
      src/Magnum/Renderer.h
  37. 8
      src/Magnum/Resource.h
  38. 78
      src/Magnum/ResourceManager.h
  39. 26
      src/Magnum/SampleQuery.h
  40. 39
      src/Magnum/Sampler.h
  41. 229
      src/Magnum/Shader.h
  42. 291
      src/Magnum/Texture.h
  43. 141
      src/Magnum/TextureArray.h
  44. 1
      src/Magnum/TextureFormat.h
  45. 40
      src/Magnum/TimeQuery.h
  46. 17
      src/Magnum/Timeline.h
  47. 78
      src/Magnum/TransformFeedback.h
  48. 32
      src/Magnum/Version.h

5
doc/opengl-mapping.dox

@ -31,6 +31,11 @@ namespace Magnum {
@tableofcontents
@m_footernavigation
@m_div{m-note m-success} Note that you can also use the search functionality to
find out which OpenGL API corresponds to which Magnum function, class or enum
value. Just enter name of an OpenGL function, define or GLSL name into the
search box. @m_enddiv
Legend:
- *not needed* --- given feature is implemented in a way that makes the
function unnecessary

99
src/Magnum/AbstractFramebuffer.h

@ -65,6 +65,7 @@ typedef Containers::EnumSet<FramebufferClear> FramebufferClearMask;
@brief Mask for framebuffer blitting
@see @ref AbstractFramebuffer, @ref FramebufferBlitMask
@m_enum_values_as_keywords
@requires_gl30 Extension @extension{ARB,framebuffer_object}
@requires_gles30 Extension @extension{ANGLE,framebuffer_blit} or
@extension{NV,framebuffer_blit} in OpenGL ES 2.0.
@ -96,6 +97,7 @@ typedef Containers::EnumSet<FramebufferBlit> FramebufferBlitMask;
@brief Framebuffer blit filtering
@see @ref AbstractFramebuffer::blit()
@m_enum_values_as_keywords
@requires_gl30 Extension @extension{ARB,framebuffer_object}
@requires_gles30 Extension @extension{ANGLE,framebuffer_blit} or
@extension{NV,framebuffer_blit} in OpenGL ES 2.0.
@ -111,6 +113,7 @@ enum class FramebufferBlitFilter: GLenum {
@brief Framebuffer target
@see @ref DefaultFramebuffer::checkStatus(), @ref Framebuffer::checkStatus()
@m_enum_values_as_keywords
@requires_gl30 Extension @extension{ARB,framebuffer_object}
*/
enum class FramebufferTarget: GLenum {
@ -158,7 +161,7 @@ See @ref DefaultFramebuffer and @ref Framebuffer for more information.
@section AbstractFramebuffer-performance-optimization Performance optimizations and security
The engine tracks currently bound framebuffer and current viewport to avoid
unnecessary calls to @fn_gl{BindFramebuffer} and @fn_gl{Viewport} when
unnecessary calls to @fn_gl_keyword{BindFramebuffer} and @fn_gl{Viewport} when
switching framebuffers. Framebuffer limits and implementation-defined values
(such as @ref maxViewportSize()) are cached, so repeated queries don't result
in repeated @fn_gl{Get} calls. See also @ref Context::resetState() and
@ -183,7 +186,8 @@ class MAGNUM_EXPORT AbstractFramebuffer {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls.
* @see @ref setViewport(), @fn_gl{Get} with @def_gl{MAX_VIEWPORT_DIMS}
* @see @ref setViewport(), @fn_gl{Get} with
* @def_gl_keyword{MAX_VIEWPORT_DIMS}
*/
static Vector2i maxViewportSize();
@ -196,7 +200,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @webgl_extension{WEBGL,draw_buffers} is not available in WebGL 1.0,
* returns `0`.
* @see @ref DefaultFramebuffer::mapForDraw(), @ref Framebuffer::mapForDraw(),
* @fn_gl{Get} with @def_gl{MAX_DRAW_BUFFERS}
* @fn_gl{Get} with @def_gl_keyword{MAX_DRAW_BUFFERS}
*/
static Int maxDrawBuffers();
@ -208,7 +212,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* OpenGL calls. If extension @extension{ARB,blend_func_extended} (part
* of OpenGL 3.3) is not available, returns `0`.
* @see @ref DefaultFramebuffer::mapForDraw(), @ref Framebuffer::mapForDraw(),
* @fn_gl{Get} with @def_gl{MAX_DUAL_SOURCE_DRAW_BUFFERS}
* @fn_gl{Get} with @def_gl_keyword{MAX_DUAL_SOURCE_DRAW_BUFFERS}
* @requires_gl Multiple blending inputs are not available in
* OpenGL ES or WebGL.
*/
@ -232,8 +236,8 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* available, @p source framebuffer is bound to @ref FramebufferTarget::Read
* and @p destination framebuffer to @ref FramebufferTarget::Draw
* before the operation (if not already).
* @see @fn_gl2{BlitNamedFramebuffer,BlitFramebuffer}, eventually
* @fn_gl{BlitFramebuffer}
* @see @fn_gl2_keyword{BlitNamedFramebuffer,BlitFramebuffer}, eventually
* @fn_gl_keyword{BlitFramebuffer}
* @requires_gles30 Extension @extension{ANGLE,framebuffer_blit} or
* @extension{NV,framebuffer_blit} in OpenGL ES 2.0.
* @requires_webgl20 Framebuffer blit is not available in WebGL 1.0.
@ -260,14 +264,14 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* dimensions.
* @see @ref setViewport(), @ref DefaultFramebuffer::mapForRead(),
* @ref Framebuffer::mapForRead(), @ref DefaultFramebuffer::mapForDraw(),
* @ref Framebuffer::mapForDraw(), @fn_gl{BindFramebuffer},
* @ref Framebuffer::mapForDraw(), @fn_gl_keyword{BindFramebuffer},
* @fn_gl{Viewport}
*/
void bind();
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief bind()
* @brief @copybrief bind()
* @deprecated Use parameter-less @ref bind() instead.
*/
CORRADE_DEPRECATED("use parameter-less bind() instead") void bind(FramebufferTarget) {
@ -287,7 +291,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* rectangle. Initial value in @ref DefaultFramebuffer is set to cover
* whole window, in @ref Framebuffer the initial value is specified in
* constructor.
* @see @ref maxViewportSize(), @fn_gl{Viewport}
* @see @ref maxViewportSize(), @fn_gl_keyword{Viewport}
*/
AbstractFramebuffer& setViewport(const Range2Di& rectangle);
@ -302,7 +306,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* fully overwrite it later.
* @see @ref Renderer::setClearColor(), @ref Renderer::setClearDepth(),
* @ref Renderer::setClearStencil(), @fn_gl{BindFramebuffer},
* @fn_gl{Clear}
* @fn_gl_keyword{Clear}
* @deprecated_gl Prefer to use @ref Framebuffer::clearColor() "*Framebuffer::clearColor()"
* / @ref clearDepth() / @ref clearDepthStencil() instead of
* @ref Renderer::setClearColor() / @ref Renderer::setClearDepth()
@ -317,8 +321,8 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @param depth Value to clear with
* @return Reference to self (for method chaining)
*
* @see @ref clear(), @fn_gl{ClearNamedFramebuffer}, eventually
* @fn_gl{BindFramebuffer}, then @fn_gl{ClearBuffer}
* @see @ref clear(), @fn_gl_keyword{ClearNamedFramebuffer}, eventually
* @fn_gl{BindFramebuffer}, then @fn_gl_keyword{ClearBuffer}
* @requires_gl30 Direct framebuffer clearing is not available in
* OpenGL 2.1.
* @requires_gles30 Direct framebuffer clearing is not available in
@ -331,8 +335,8 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @param stencil Value to clear with
* @return Reference to self (for method chaining)
*
* @see @ref clear(), @fn_gl{ClearNamedFramebuffer}, eventually
* @fn_gl{BindFramebuffer}, then @fn_gl{ClearBuffer}
* @see @ref clear(), @fn_gl_keyword{ClearNamedFramebuffer}, eventually
* @fn_gl{BindFramebuffer}, then @fn_gl_keyword{ClearBuffer}
* @requires_gl30 Direct framebuffer clearing is not available in
* OpenGL 2.1.
* @requires_gles30 Direct framebuffer clearing is not available in
@ -346,8 +350,8 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @param stencil Stencil value to clear with
* @return Reference to self (for method chaining)
*
* @see @ref clear(), @fn_gl{ClearNamedFramebuffer}, eventually
* @fn_gl{BindFramebuffer}, then @fn_gl{ClearBuffer}
* @see @ref clear(), @fn_gl_keyword{ClearNamedFramebuffer}, eventually
* @fn_gl{BindFramebuffer}, then @fn_gl_keyword{ClearBuffer}
* @requires_gl30 Direct framebuffer clearing is not available in
* OpenGL 2.1.
* @requires_gles30 Direct framebuffer clearing is not available in
@ -368,7 +372,8 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* If @extension{ARB,robustness} is available, the operation is
* protected from buffer overflow.
* @see @fn_gl{BindFramebuffer}, then @fn_gl{PixelStore} and
* @fn_gl{ReadPixels} or @fn_gl_extension{ReadnPixels,ARB,robustness}
* @fn_gl_keyword{ReadPixels} or
* @fn_gl_extension_keyword{ReadnPixels,ARB,robustness}
*/
void read(const Range2Di& rectangle, Image2D& image);
@ -384,7 +389,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief read(const Range2Di&, Image2D&)
* @brief @copybrief read(const Range2Di&, Image2D&)
* @deprecated Use @ref read(const Range2Di&, Image2D&) instead.
*/
CORRADE_DEPRECATED("use read(const Range2Di&, Image2D& instead) instead") void read(const Vector2i& offset, const Vector2i& size, Image2D& image) {
@ -423,7 +428,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief read(const Range2Di&, BufferImage2D&, BufferUsage)
* @brief @copybrief read(const Range2Di&, BufferImage2D&, BufferUsage)
* @deprecated Use @ref read(const Range2Di&, BufferImage2D&, BufferUsage)
* instead.
*/
@ -450,7 +455,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* operation.
* @see @ref Texture1D::maxSize(), @fn_gl{BindFramebuffer}, then
* @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexImage1D}
* @fn_gl_keyword{CopyTexImage1D}
* @requires_gl 1D textures are not available in OpenGL ES or WebGL.
* @deprecated_gl Prefer to use @ref Texture1D::setStorage() and
* @ref copySubImage() instead.
@ -473,7 +478,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* operation.
* @see @ref Texture2D::maxSize(), @fn_gl{BindFramebuffer}, then
* @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexImage2D}
* @fn_gl_keyword{CopyTexImage2D}
* @deprecated_gl Prefer to use @ref Texture2D::setStorage() and
* @ref copySubImage() instead.
*/
@ -494,7 +499,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* operation.
* @see @ref Texture2D::maxSize(), @fn_gl{BindFramebuffer}, then
* @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexImage2D}
* @fn_gl_keyword{CopyTexImage2D}
* @requires_gl31 Extension @extension{ARB,texture_rectangle}
* @requires_gl Rectangle textures are not available in OpenGL ES and
* WebGL.
@ -520,7 +525,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* operation.
* @see @ref Texture2D::maxSize(), @fn_gl{BindFramebuffer}, then
* @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexImage2D}
* @fn_gl_keyword{CopyTexImage2D}
* @deprecated_gl Prefer to use @ref CubeMapTexture::setStorage() and
* @ref copySubImage() instead.
*/
@ -542,7 +547,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* operation.
* @see @ref Texture2D::maxSize(), @fn_gl{BindFramebuffer}, then
* @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexImage2D}
* @fn_gl_keyword{CopyTexImage2D}
* @requires_gl 1D array textures are not available in OpenGL ES or
* WebGL, only 2D ones.
* @deprecated_gl Prefer to use @ref Texture1DArray::setStorage() and
@ -565,10 +570,10 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* available, the texture is bound before the operation (if not
* already).
* @see @ref Texture1D::setStorage(), @fn_gl{BindFramebuffer}, then
* @fn_gl2{CopyTextureSubImage1D,CopyTexSubImage1D},
* @fn_gl_extension{CopyTextureSubImage1D,EXT,direct_state_access},
* @fn_gl2_keyword{CopyTextureSubImage1D,CopyTexSubImage1D},
* @fn_gl_extension_keyword{CopyTextureSubImage1D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexSubImage1D}
* @fn_gl_keyword{CopyTexSubImage1D}
* @requires_gl 1D textures are not available in OpenGL ES or WebGL.
*/
void copySubImage(const Range2Di& rectangle, Texture1D& texture, Int level, Int offset);
@ -586,8 +591,8 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* available, the texture is bound before the operation (if not
* already).
* @see @ref Texture2D::setStorage(), @fn_gl{BindFramebuffer}, then
* @fn_gl2{CopyTextureSubImage2D,CopyTexSubImage2D},
* @fn_gl_extension{CopyTextureSubImage2D,EXT,direct_state_access},
* @fn_gl2_keyword{CopyTextureSubImage2D,CopyTexSubImage2D},
* @fn_gl_extension_keyword{CopyTextureSubImage2D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexSubImage2D}
*/
@ -605,10 +610,10 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* available, the texture is bound before the operation (if not
* already).
* @see @ref RectangleTexture::setStorage(), @fn_gl{BindFramebuffer},
* then @fn_gl2{CopyTextureSubImage2D,CopyTexSubImage2D},
* @fn_gl_extension{CopyTextureSubImage2D,EXT,direct_state_access},
* then @fn_gl2_keyword{CopyTextureSubImage2D,CopyTexSubImage2D},
* @fn_gl_extension_keyword{CopyTextureSubImage2D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexSubImage2D}
* @fn_gl_keyword{CopyTexSubImage2D}
* @requires_gl Rectangle textures are not available in OpenGL ES and
* WebGL.
*/
@ -628,10 +633,10 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @extension{EXT,direct_state_access} desktop extension is available,
* the texture is bound before the operation (if not already).
* @see @ref CubeMapTexture::setStorage(), @fn_gl{BindFramebuffer},
* then @fn_gl2{CopyTextureSubImage3D,CopyTexSubImage3D},
* @fn_gl_extension{CopyTextureSubImage2D,EXT,direct_state_access},
* then @fn_gl2_keyword{CopyTextureSubImage3D,CopyTexSubImage3D},
* @fn_gl_extension_keyword{CopyTextureSubImage2D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexSubImage2D}
* @fn_gl_keyword{CopyTexSubImage2D}
*/
void copySubImage(const Range2Di& rectangle, CubeMapTexture& texture, Int level, const Vector3i& offset);
@ -648,10 +653,10 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* available, the texture is bound before the operation (if not
* already).
* @see @ref Texture3D::setStorage(), @fn_gl{BindFramebuffer}, then
* @fn_gl2{CopyTextureSubImage3D,CopyTexSubImage3D},
* @fn_gl_extension{CopyTextureSubImage3D,EXT,direct_state_access},
* @fn_gl2_keyword{CopyTextureSubImage3D,CopyTexSubImage3D},
* @fn_gl_extension_keyword{CopyTextureSubImage3D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexSubImage3D}
* @fn_gl_keyword{CopyTexSubImage3D}
* @requires_gles30 Extension @extension{OES,texture_3D} in OpenGL
* ES 2.0.
* @requires_webgl20 Only 2D textures are available in WebGL 1.0.
@ -672,10 +677,10 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* available, the texture is bound before the operation (if not
* already).
* @see @ref Texture1DArray::setStorage(), @fn_gl{BindFramebuffer},
* then @fn_gl2{CopyTextureSubImage2D,CopyTexSubImage2D},
* @fn_gl_extension{CopyTextureSubImage2D,EXT,direct_state_access},
* then @fn_gl2_keyword{CopyTextureSubImage2D,CopyTexSubImage2D},
* @fn_gl_extension_keyword{CopyTextureSubImage2D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexSubImage2D}
* @fn_gl_keyword{CopyTexSubImage2D}
* @requires_gl 1D array textures are not available in OpenGL ES or
* WebGL, only 2D ones.
*/
@ -695,10 +700,10 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* available, the texture is bound before the operation (if not
* already).
* @see @ref Texture2DArray::setStorage(), @fn_gl{BindFramebuffer},
* then @fn_gl2{CopyTextureSubImage3D,CopyTexSubImage3D},
* @fn_gl_extension{CopyTextureSubImage3D,EXT,direct_state_access},
* then @fn_gl2_keyword{CopyTextureSubImage3D,CopyTexSubImage3D},
* @fn_gl_extension_keyword{CopyTextureSubImage3D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexSubImage3D}
* @fn_gl_keyword{CopyTexSubImage3D}
* @requires_gl30 Extension @extension{EXT,texture_array}
* @requires_gles30 Array textures are not available in OpenGL ES 2.0.
* @requires_webgl20 Array textures are not available in WebGL 1.0.
@ -721,10 +726,10 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* available, the texture is bound before the operation (if not
* already).
* @see @ref CubeMapTextureArray::setStorage(), @fn_gl{BindFramebuffer},
* then @fn_gl2{CopyTextureSubImage3D,CopyTexSubImage3D},
* @fn_gl_extension{CopyTextureSubImage3D,EXT,direct_state_access},
* then @fn_gl2_keyword{CopyTextureSubImage3D,CopyTexSubImage3D},
* @fn_gl_extension_keyword{CopyTextureSubImage3D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CopyTexSubImage3D}
* @fn_gl_keyword{CopyTexSubImage3D}
* @requires_gl40 Extension @extension{ARB,texture_cube_map_array}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_es_extension Extension @extension{ANDROID,extension_pack_es31a}/

3
src/Magnum/AbstractObject.h

@ -96,7 +96,8 @@ class MAGNUM_EXPORT AbstractObject {
* @ref AbstractTexture::setLabel(), @ref Buffer::setLabel(),
* @ref BufferTexture::setLabel(), @ref Framebuffer::setLabel(),
* @ref Mesh::setLabel(), @ref Renderbuffer::setLabel(),
* @ref Shader::setLabel(), @fn_gl{Get} with @def_gl{MAX_LABEL_LENGTH}
* @ref Shader::setLabel(), @fn_gl{Get} with
* @def_gl_keyword{MAX_LABEL_LENGTH}
* @requires_gles Debug output is not available in WebGL.
*/
static Int maxLabelLength();

19
src/Magnum/AbstractQuery.h

@ -90,8 +90,8 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function returns empty string.
* @see @fn_gl{GetObjectLabel} with @def_gl{QUERY} or
* @fn_gl_extension{GetObjectLabel,EXT,debug_label} with
* @see @fn_gl_keyword{GetObjectLabel} with @def_gl{QUERY} or
* @fn_gl_extension_keyword{GetObjectLabel,EXT,debug_label} with
* @def_gl{QUERY_OBJECT_EXT}
* @requires_gles Debug output is not available in WebGL.
*/
@ -105,8 +105,8 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function does nothing.
* @see @ref maxLabelLength(), @fn_gl{ObjectLabel} with
* @def_gl{QUERY} or @fn_gl_extension{LabelObject,EXT,debug_label}
* @see @ref maxLabelLength(), @fn_gl_keyword{ObjectLabel} with
* @def_gl{QUERY} or @fn_gl_extension_keyword{LabelObject,EXT,debug_label}
* with @def_gl{QUERY_OBJECT_EXT}
* @requires_gles Debug output is not available in WebGL.
*/
@ -123,7 +123,7 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject {
/**
* @brief Whether the result is available
*
* @see @fn_gl{GetQueryObject} with @def_gl{QUERY_RESULT_AVAILABLE}
* @see @fn_gl_keyword{GetQueryObject} with @def_gl{QUERY_RESULT_AVAILABLE}
*/
bool resultAvailable();
@ -134,7 +134,7 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject {
*
* Note that this function is blocking until the result is available.
* See @ref resultAvailable().
* @see @fn_gl{GetQueryObject} with @def_gl{QUERY_RESULT}
* @see @fn_gl_keyword{GetQueryObject} with @def_gl{QUERY_RESULT}
* @requires_gl33 Extension @extension{ARB,timer_query} for result
* type @ref Magnum::UnsignedLong "UnsignedLong" and @ref Magnum::Long "Long"
* @requires_es_extension Extension @extension{EXT,disjoint_timer_query}
@ -149,7 +149,7 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject {
* @brief Begin query
*
* Begins counting until @ref end() is called.
* @see @fn_gl{BeginQuery}
* @see @fn_gl_keyword{BeginQuery}
*/
void begin();
@ -157,7 +157,7 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject {
* @brief End query
*
* The result can be then retrieved by calling @ref result().
* @see @fn_gl{EndQuery}
* @see @fn_gl_keyword{EndQuery}
*/
void end();
@ -167,7 +167,8 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject {
*
* Deletes assigned OpenGL query.
* @see @ref PrimitiveQuery::wrap(), @ref SampleQuery::wrap(),
* @ref TimeQuery::wrap(), @ref release(), @fn_gl{DeleteQueries}
* @ref TimeQuery::wrap(), @ref release(),
* @fn_gl_keyword{DeleteQueries}
*/
~AbstractQuery();

119
src/Magnum/AbstractShaderProgram.h

@ -485,8 +485,8 @@ also @ref Attribute::DataType enum for additional type options.
@section AbstractShaderProgram-performance-optimization Performance optimizations
The engine tracks currently used shader program to avoid unnecessary calls to
@fn_gl{UseProgram}. Shader limits (such as @ref maxVertexAttributes()) are
cached, so repeated queries don't result in repeated @fn_gl{Get} calls. See
@fn_gl_keyword{UseProgram}. Shader limits (such as @ref maxVertexAttributes())
are cached, so repeated queries don't result in repeated @fn_gl{Get} calls. See
also @ref Context::resetState() and @ref Context::State::Shaders.
If extension @extension{ARB,separate_shader_objects} (part of OpenGL 4.1),
@ -495,7 +495,7 @@ extension or OpenGL ES 3.1 is available, uniform setting functions use DSA
functions to avoid unnecessary calls to @fn_gl{UseProgram}. See @ref setUniform()
documentation for more information.
To achieve least state changes, set all uniforms in one run -- method chaining
To achieve least state changes, set all uniforms in one run --- method chaining
comes in handy.
@see @ref portability-shaders
@ -516,6 +516,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @brief Buffer mode for transform feedback
*
* @see @ref setTransformFeedbackOutputs()
* @m_enum_values_as_keywords
* @requires_gl30 Extension @extension{EXT,transform_feedback}
* @requires_gles30 Transform feedback is not available in OpenGL ES
* 2.0.
@ -536,7 +537,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls.
* @see @ref Mesh::maxVertexAttributes(),
* @ref Attribute, @fn_gl{Get} with @def_gl{MAX_VERTEX_ATTRIBS}
* @ref Attribute, @fn_gl{Get} with @def_gl_keyword{MAX_VERTEX_ATTRIBS}
*/
static Int maxVertexAttributes();
@ -546,8 +547,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_atomic_counters}
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_ATOMIC_COUNTER_BUFFER_SIZE}
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_ATOMIC_COUNTER_BUFFER_SIZE}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Atomic counters are not available in WebGL.
*/
@ -558,8 +559,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,compute_shader}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_COMPUTE_SHARED_MEMORY_SIZE}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_COMPUTE_SHARED_MEMORY_SIZE}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Compute shaders are not available in WebGL.
*/
@ -570,8 +571,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,compute_shader}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_COMPUTE_WORK_GROUP_INVOCATIONS}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_COMPUTE_WORK_GROUP_INVOCATIONS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Compute shaders are not available in WebGL.
*/
@ -584,7 +585,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* OpenGL calls. If neither extension @extension{ARB,compute_shader}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns zero
* vector.
* @see @fn_gl{Get} with @def_gl{MAX_COMPUTE_WORK_GROUP_COUNT}
* @see @fn_gl{Get} with @def_gl_keyword{MAX_COMPUTE_WORK_GROUP_COUNT}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Compute shaders are not available in WebGL.
*/
@ -597,7 +598,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* OpenGL calls. If neither extension @extension{ARB,compute_shader}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns zero
* vector.
* @see @fn_gl{Get} with @def_gl{MAX_COMPUTE_WORK_GROUP_SIZE}
* @see @fn_gl{Get} with @def_gl_keyword{MAX_COMPUTE_WORK_GROUP_SIZE}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Compute shaders are not available in WebGL.
*/
@ -608,8 +609,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,shader_image_load_store}
* (part of OpenGL 4.2) or OpenGL ES 3.1 is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_IMAGE_UNITS}
* (part of OpenGL 4.2) or OpenGL ES 3.1 is not available, returns
* @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_IMAGE_UNITS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Shader image load/store is not available in WebGL.
*/
@ -622,8 +624,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,shader_image_load_store}
* (part of OpenGL 4.2) is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_IMAGE_SAMPLES}
* (part of OpenGL 4.2) is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_IMAGE_SAMPLES}
* @requires_gl Multisample image load/store is not available in OpenGL
* ES or WebGL.
*/
@ -638,8 +640,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_image_load_store}
* (part of OpenGL 4.2) nor extension @extension{ARB,shader_storage_buffer_object}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_COMBINED_SHADER_OUTPUT_RESOURCES}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns
* @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_COMBINED_SHADER_OUTPUT_RESOURCES}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Shader image load/store is not available in WebGL.
*/
@ -650,8 +653,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_storage_buffer_object}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_SHADER_STORAGE_BLOCK_SIZE}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns
* @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_SHADER_STORAGE_BLOCK_SIZE}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Shader storage is not available in WebGL.
*/
@ -663,8 +667,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,uniform_buffer_object}
* (part of OpenGL 3.1) is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_UNIFORM_BLOCK_SIZE}
* (part of OpenGL 3.1) is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_UNIFORM_BLOCK_SIZE}
* @requires_gles30 Uniform blocks are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform blocks are not available in WebGL 1.0.
*/
@ -676,8 +680,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,explicit_uniform_location}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_UNIFORM_LOCATIONS}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns
* @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_UNIFORM_LOCATIONS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Explicit uniform location is not available in WebGL.
*/
@ -689,8 +694,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{EXT,gpu_shader4} (part of
* OpenGL 3.0) is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MIN_PROGRAM_TEXEL_OFFSET}
* OpenGL 3.0) is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MIN_PROGRAM_TEXEL_OFFSET}
* @requires_gles30 Texture lookup with offset is not available in
* OpenGL ES 2.0.
* @requires_webgl20 Texture lookup with offset is not available in
@ -703,8 +708,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{EXT,gpu_shader4} (part of
* OpenGL 3.0) is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_PROGRAM_TEXEL_OFFSET}
* OpenGL 3.0) is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_PROGRAM_TEXEL_OFFSET}
* @requires_gles30 Texture lookup with offset is not available in
* OpenGL ES 2.0.
* @requires_webgl20 Texture lookup with offset is not available in
@ -717,7 +722,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @brief Constructor
*
* Creates one OpenGL shader program.
* @see @fn_gl{CreateProgram}
* @see @fn_gl_keyword{CreateProgram}
*/
explicit AbstractShaderProgram();
@ -744,7 +749,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @brief Destructor
*
* Deletes associated OpenGL shader program.
* @see @fn_gl{DeleteProgram}
* @see @fn_gl_keyword{DeleteProgram}
*/
virtual ~AbstractShaderProgram() = 0;
@ -766,8 +771,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function returns empty string.
* @see @fn_gl{GetObjectLabel} with @def_gl{PROGRAM} or
* @fn_gl_extension{GetObjectLabel,EXT,debug_label} with
* @see @fn_gl_keyword{GetObjectLabel} with @def_gl{PROGRAM} or
* @fn_gl_extension_keyword{GetObjectLabel,EXT,debug_label} with
* @def_gl{PROGRAM_OBJECT_EXT}
* @requires_gles Debug output is not available in WebGL.
*/
@ -781,8 +786,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function does nothing.
* @see @ref maxLabelLength(), @fn_gl{ObjectLabel} with
* @def_gl{PROGRAM} or @fn_gl_extension{LabelObject,EXT,debug_label}
* @see @ref maxLabelLength(), @fn_gl_keyword{ObjectLabel} with
* @def_gl{PROGRAM} or @fn_gl_extension_keyword{LabelObject,EXT,debug_label}
* with @def_gl{PROGRAM_OBJECT_EXT}
* @requires_gles Debug output is not available in WebGL.
*/
@ -800,9 +805,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @brief Validate program
*
* Returns validation status and optional validation message.
* @see @fn_gl{ValidateProgram}, @fn_gl{GetProgram} with
* @see @fn_gl_keyword{ValidateProgram}, @fn_gl_keyword{GetProgram} with
* @def_gl{VALIDATE_STATUS}, @def_gl{INFO_LOG_LENGTH},
* @fn_gl{GetProgramInfoLog}
* @fn_gl_keyword{GetProgramInfoLog}
*/
std::pair<bool, std::string> validate();
@ -833,15 +838,15 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
/**
* @brief Link the shader
*
* Returns `false` if linking of any shader failed, `true` if
* everything succeeded. Linker message (if any) is printed to error
* Returns @cpp false @ce if linking of any shader failed, @cpp true @ce
* if everything succeeded. Linker message (if any) is printed to error
* output. All attached shaders must be compiled with
* @ref Shader::compile() before linking. The operation is batched in a
* way that allows the driver to link multiple shaders simultaneously
* (i.e. in multiple threads).
* @see @fn_gl{LinkProgram}, @fn_gl{GetProgram} with
* @see @fn_gl_keyword{LinkProgram}, @fn_gl_keyword{GetProgram} with
* @def_gl{LINK_STATUS} and @def_gl{INFO_LOG_LENGTH},
* @fn_gl{GetProgramInfoLog}
* @fn_gl_keyword{GetProgramInfoLog}
*/
static bool link(std::initializer_list<std::reference_wrapper<AbstractShaderProgram>> shaders);
@ -850,7 +855,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @brief Allow retrieving program binary
*
* Initially disabled.
* @see @fn_gl{ProgramParameter} with @def_gl{PROGRAM_BINARY_RETRIEVABLE_HINT}
* @see @fn_gl_keyword{ProgramParameter} with
* @def_gl{PROGRAM_BINARY_RETRIEVABLE_HINT}
* @requires_gl41 Extension @extension{ARB,get_program_binary}
* @requires_gles30 Always allowed in OpenGL ES 2.0.
* @requires_gles Binary program representations are not supported in
@ -866,7 +872,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @brief Allow the program to be bound to individual pipeline stages
*
* Initially disabled.
* @see @fn_gl{ProgramParameter} with @def_gl{PROGRAM_SEPARABLE}
* @see @fn_gl_keyword{ProgramParameter} with @def_gl{PROGRAM_SEPARABLE}
* @requires_gl41 Extension @extension{ARB,separate_shader_objects}
* @requires_es_extension Extension
* @extension2{EXT,separate_shader_objects,separate_shader_objects.gles}
@ -884,7 +890,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
/**
* @brief Attach shader
*
* @see @fn_gl{AttachShader}
* @see @fn_gl_keyword{AttachShader}
*/
void attachShader(Shader& shader);
@ -904,7 +910,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* Binds attribute to location which is used later for binding vertex
* buffers.
* @see @fn_gl{BindAttribLocation}
* @see @fn_gl_keyword{BindAttribLocation}
* @deprecated_gl Preferred usage is to specify attribute location
* explicitly in the shader instead of using this function. See
* @ref AbstractShaderProgram-attribute-location "class documentation"
@ -923,13 +929,14 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
/**
* @brief Bind fragment data to given location and color input index
* @param location Location
* @param index Blend equation color input index (`0` or `1`)
* @param index Blend equation color input index (@cpp 0 @ce or
* @cpp 1 @ce)
* @param name Fragment output variable name
*
* Binds fragment data to location which is used later for framebuffer
* operations. See also @ref Renderer::BlendFunction for more
* information about using color input index.
* @see @fn_gl{BindFragDataLocationIndexed}
* @see @fn_gl_keyword{BindFragDataLocationIndexed}
* @deprecated_gl Preferred usage is to specify attribute location
* explicitly in the shader instead of using this function. See
* @ref AbstractShaderProgram-attribute-location "class documentation"
@ -953,8 +960,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @param name Fragment output variable name
*
* The same as @ref bindFragmentDataLocationIndexed(), but with `index`
* set to `0`.
* @see @fn_gl{BindFragDataLocation}
* set to @cpp 0 @ce.
* @see @fn_gl_keyword{BindFragDataLocation}
* @deprecated_gl Preferred usage is to specify attribute location
* explicitly in the shader instead of using this function. See
* @ref AbstractShaderProgram-attribute-location "class documentation"
@ -992,7 +999,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* output to be recorded into next buffer binding point and
* `gl_SkipComponents#` causes the transform feedback to offset the
* following output variable by `#` components.
* @see @fn_gl{TransformFeedbackVaryings}
* @see @fn_gl_keyword{TransformFeedbackVaryings}
* @deprecated_gl Preferred usage is to specify transform feedback
* outputs explicitly in the shader instead of using this
* function. See @ref AbstractShaderProgram-transform-feedback "class documentation"
@ -1025,8 +1032,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @param name Uniform name
*
* If given uniform is not found in the linked shader, a warning is
* printed and `-1` is returned.
* @see @ref setUniform(), @fn_gl{GetUniformLocation}
* printed and @cpp -1 @ce is returned.
* @see @ref setUniform(), @fn_gl_keyword{GetUniformLocation}
* @deprecated_gl Preferred usage is to specify uniform location
* explicitly in the shader instead of using this function. See
* @ref AbstractShaderProgram-uniform-location "class documentation"
@ -1048,7 +1055,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* If given uniform block name is not found in the linked shader, a
* warning is printed and @cpp 0xffffffffu @ce is returned.
* @see @ref setUniformBlockBinding(), @fn_gl{GetUniformBlockIndex}
* @see @ref setUniformBlockBinding(),
* @fn_gl_keyword{GetUniformBlockIndex}
* @requires_gl31 Extension @extension{ARB,uniform_buffer_object}
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
@ -1115,8 +1123,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* OpenGL ES 3.1 is available, the shader is marked for use before the
* operation.
* @see @ref setUniform(Int, const T&), @ref uniformLocation(),
* @fn_gl{UseProgram}, @fn_gl{Uniform} or @fn_gl{ProgramUniform}/
* @fn_gl_extension{ProgramUniform,EXT,direct_state_access}.
* @fn_gl{UseProgram}, @fn_gl_keyword{Uniform} or
* @fn_gl_keyword{ProgramUniform} /
* @fn_gl_extension_keyword{ProgramUniform,EXT,direct_state_access}.
*/
void setUniform(Int location, Containers::ArrayView<const Float> values);
void setUniform(Int location, Containers::ArrayView<const Math::Vector<2, Float>> values); /**< @overload */
@ -1208,7 +1217,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @param binding Uniform block binding
*
* @see @ref uniformBlockIndex(), @ref Buffer::maxUniformBindings(),
* @fn_gl{UniformBlockBinding}
* @fn_gl_keyword{UniformBlockBinding}
* @requires_gl31 Extension @extension{ARB,uniform_buffer_object}
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0.

79
src/Magnum/AbstractTexture.h

@ -69,12 +69,13 @@ documentation for details.
@section AbstractTexture-performance-optimization Performance optimizations and security
The engine tracks currently bound textures and images in all available texture
units to avoid unnecessary calls to @fn_gl{ActiveTexture}, @fn_gl{BindTexture}
and @fn_gl{BindImageTexture}. Texture configuration functions use dedicated
highest available texture unit to not affect active bindings in user units.
Texture limits and implementation-defined values (such as @ref maxColorSamples())
are cached, so repeated queries don't result in repeated @fn_gl{Get} calls. See
also @ref Context::resetState() and @ref Context::State::Textures.
units to avoid unnecessary calls to @fn_gl_keyword{ActiveTexture},
@fn_gl_keyword{BindTexture} and @fn_gl_keyword{BindImageTexture}. Texture
configuration functions use dedicated highest available texture unit to not
affect active bindings in user units. Texture limits and implementation-defined
values (such as @ref maxColorSamples()) are cached, so repeated queries don't
result in repeated @fn_gl{Get} calls. See also @ref Context::resetState() and
@ref Context::State::Textures.
If @extension{ARB,direct_state_access} (part of OpenGL 4.5) is available,
@ref bind(Int) and @ref unbind(Int) use @fn_gl{BindTextureUnit}. Otherwise, if
@ -104,7 +105,7 @@ However, if @extension{ARB,direct_state_access} is not available and both
available, the robust version is preferred over DSA.
To achieve least state changes, fully configure each texture in one run --
method chaining comes in handy -- and try to have often used textures in
method chaining comes in handy --- and try to have often used textures in
dedicated units, not occupied by other textures. First configure the texture
and *then* set the data, so OpenGL can optimize them to match the settings. To
avoid redundant consistency checks and memory reallocations when updating
@ -142,7 +143,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls.
* @see @fn_gl{Get} with @def_gl{MAX_TEXTURE_LOD_BIAS}
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TEXTURE_LOD_BIAS}
* @requires_gles30 Texture LOD bias doesn't have
* implementation-defined range in OpenGL ES 2.0.
* @requires_webgl20 Texture LOD bias doesn't have
@ -157,8 +158,9 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,texture_multisample}
* (part of OpenGL 3.2) nor OpenGL ES 3.1 is available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_COLOR_TEXTURE_SAMPLES}
* (part of OpenGL 3.2) nor OpenGL ES 3.1 is available, returns
* @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_COLOR_TEXTURE_SAMPLES}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Multisample textures are not available in WebGL.
*/
@ -169,8 +171,9 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,texture_multisample}
* (part of OpenGL 3.2) nor OpenGL ES 3.1 is available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_DEPTH_TEXTURE_SAMPLES}
* (part of OpenGL 3.2) nor OpenGL ES 3.1 is available, returns
* @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_DEPTH_TEXTURE_SAMPLES}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Multisample textures are not available in WebGL.
*/
@ -181,8 +184,9 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,texture_multisample}
* (part of OpenGL 3.2) nor OpenGL ES 3.1 is available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_INTEGER_SAMPLES}
* (part of OpenGL 3.2) nor OpenGL ES 3.1 is available, returns
* @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_INTEGER_SAMPLES}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Multisample textures are not available in WebGL.
*/
@ -200,9 +204,10 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* @ref AbstractShaderProgram subclasses. See its documentation
* for more information.
* @see @ref bind(), @ref Shader::maxCombinedTextureImageUnits(),
* @fn_gl{BindTextureUnit}, @fn_gl{BindTextures},
* @fn_gl_extension{BindMultiTexture,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture} and @fn_gl{BindTexture}
* @fn_gl_keyword{BindTextureUnit}, @fn_gl_keyword{BindTextures},
* @fn_gl_extension_keyword{BindMultiTexture,EXT,direct_state_access},
* eventually @fn_gl_keyword{ActiveTexture} and
* @fn_gl_keyword{BindTexture}
*/
static void unbind(Int textureUnit);
@ -216,7 +221,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* @ref AbstractShaderProgram subclasses. See its documentation
* for more information.
* @see @ref bind(), @ref Shader::maxCombinedTextureImageUnits(),
* @fn_gl{BindTextures}
* @fn_gl_keyword{BindTextures}
*/
static void unbind(Int firstTextureUnit, std::size_t count);
@ -224,14 +229,15 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* @brief Bind textures to given range of texture units
*
* Binds first texture in the list to @p firstTextureUnit, second to
* `firstTextureUnit + 1` etc. If any texture is `nullptr`, given
* texture unit is unbound. If @extension{ARB,multi_bind} (part of
* OpenGL 4.4) is not available, the feature is emulated with sequence
* of @ref bind(Int) / @ref unbind(Int) calls.
* `firstTextureUnit + 1` etc. If any texture is @cpp nullptr @ce,
* given texture unit is unbound. If @extension{ARB,multi_bind} (part
* of OpenGL 4.4) is not available, the feature is emulated with
* sequence of @ref bind(Int) / @ref unbind(Int) calls.
* @note This function is meant to be used only internally from
* @ref AbstractShaderProgram subclasses. See its documentation
* for more information.
* @see @ref Shader::maxCombinedTextureImageUnits(), @fn_gl{BindTextures}
* @see @ref Shader::maxCombinedTextureImageUnits(),
* @fn_gl_keyword{BindTextures}
*/
static void bind(Int firstTextureUnit, std::initializer_list<AbstractTexture*> textures);
@ -246,7 +252,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* @ref Texture::bindImageLayered() "*Texture::bindImageLayered()",
* @ref unbindImages(), @ref bindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gles31 Shader image load/store is not available in OpenGL
* ES 3.0 and older.
@ -267,7 +273,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* @ref Texture::bindImageLayered() "*Texture::bindImageLayered()",
* @ref unbindImage(), @ref bindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTextures}
* @fn_gl_keyword{BindImageTextures}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gl44 Extension @extension{ARB,multi_bind}
* @requires_gl Multi bind is not available in OpenGL ES and WebGL.
@ -281,8 +287,8 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
*
* Binds first level of given texture in the list to @p firstImageUnit,
* second to `firstTextureUnit + 1` etc. 3D, cube map and array
* textures are bound as layered targets. If any texture is `nullptr`,
* given image unit is unbound.
* textures are bound as layered targets. If any texture is
* @cpp nullptr @ce, given image unit is unbound.
* @note This function is meant to be used only internally from
* @ref AbstractShaderProgram subclasses. See its documentation
* for more information.
@ -290,7 +296,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* @ref Texture::bindImageLayered() "*Texture::bindImageLayered()",
* @ref unbindImages(), @ref unbindImage(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTextures}
* @fn_gl_keyword{BindImageTextures}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gl44 Extension @extension{ARB,multi_bind}
* @requires_gl Multi bind is not available in OpenGL ES and WebGL.
@ -314,7 +320,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* @ref CubeMapTextureArray::wrap(),
* @ref MultisampleTexture::wrap(), @ref RectangleTexture::wrap(),
* @ref Texture::wrap(), @ref TextureArray::wrap(),
* @ref release(), @fn_gl{DeleteTextures}
* @ref release(), @fn_gl_keyword{DeleteTextures}
*/
~AbstractTexture();
@ -349,8 +355,8 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function returns empty string.
* @see @fn_gl{GetObjectLabel} or
* @fn_gl_extension{GetObjectLabel,EXT,debug_label} with
* @see @fn_gl_keyword{GetObjectLabel} or
* @fn_gl_extension_keyword{GetObjectLabel,EXT,debug_label} with
* @def_gl{TEXTURE}
* @requires_gles Debug output is not available in WebGL.
*/
@ -364,8 +370,8 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function does nothing.
* @see @ref maxLabelLength(), @fn_gl{ObjectLabel} or
* @fn_gl_extension{LabelObject,EXT,debug_label} with
* @see @ref maxLabelLength(), @fn_gl_keyword{ObjectLabel} or
* @fn_gl_extension_keyword{LabelObject,EXT,debug_label} with
* @def_gl{TEXTURE}
* @requires_gles Debug output is not available in WebGL.
*/
@ -391,9 +397,10 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* for more information.
* @see @ref bind(Int, std::initializer_list<AbstractTexture*>),
* @ref unbind(), @ref Shader::maxCombinedTextureImageUnits(),
* @fn_gl{BindTextureUnit}, @fn_gl{BindTextures},
* @fn_gl_extension{BindMultiTexture,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture} and @fn_gl{BindTexture}
* @fn_gl_keyword{BindTextureUnit}, @fn_gl_keyword{BindTextures},
* @fn_gl_extension_keyword{BindMultiTexture,EXT,direct_state_access},
* eventually @fn_gl_keyword{ActiveTexture} and
* @fn_gl_keyword{BindTexture}
*/
void bind(Int textureUnit);

48
src/Magnum/Attribute.h

@ -43,17 +43,17 @@ namespace Implementation { template<class> struct Attribute; }
@brief Base class for attribute location and type
For use in @ref AbstractShaderProgram subclasses. Template parameter @p location
is vertex attribute location, number between `0` and
is vertex attribute location, number between @cpp 0 @ce and
@ref AbstractShaderProgram::maxVertexAttributes(). To ensure compatibility, you
should always have vertex attribute with location `0`.
should always have vertex attribute with location @cpp 0 @ce.
Template parameter @p T is the type which is used for shader attribute, e.g.
@ref Vector4i for `ivec4`. DataType is type of passed data when adding vertex
buffers to mesh. By default it is the same as type used in shader (e.g.
@ref Vector4i for @glsl ivec4 @ce. DataType is type of passed data when adding
vertex buffers to mesh. By default it is the same as type used in shader (e.g.
@ref DataType::Int for @ref Vector4i). It's also possible to pass integer data
to floating-point shader inputs. In this case you may want to normalize the
values (e.g. color components from 0-255 to 0.0f - 1.0f) -- see
@ref DataOption::Normalized.
values (e.g. color components from @cpp 0 @ce -- @cpp 255 @ce to @cpp 0.0f @ce -- @cpp 1.0f @ce)
--- see @ref DataOption::Normalized.
Only some types are allowed as attribute types, see @ref AbstractShaderProgram-types
for more information.
@ -100,29 +100,31 @@ template<UnsignedInt location, class T> class Attribute {
*
* Count of components passed to the shader. If passing smaller count
* of components than corresponding type has, unspecified components
* are set to default values (second and third to `0`, fourth to `1`).
* are set to default values (second and third to @cpp 0 @ce, fourth to
* @cpp 1 @ce).
* @see @ref Attribute()
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
enum class Components: GLint {
/**
* Only first component is specified. Second, third and fourth
* component are set to `0`, `0`, `1`, respectively. Only for
* scalar and vector types, not matrices.
* component are set to @cpp 0 @ce, @cpp 0 @ce, @cpp 1 @ce,
* respectively. Only for scalar and vector types, not matrices.
*/
One = 1,
/**
* First two components are specified. Third and fourth component
* are set to `0`, `1`, respectively. Only for two, three and
* four-component vector types and 2x2, 3x2 and 4x2 matrix types.
* are set to @cpp 0 @ce, @cpp 1 @ce, respectively. Only for two,
* three and four-component vector types and 2x2, 3x2 and 4x2
* matrix types.
*/
Two = 2,
/**
* First three components are specified. Fourth component is set to
* `1`. Only for three and four-component vector types, 2x3, 3x3
* and 4x3 matrix types.
* @cpp 1 @ce. Only for three and four-component vector types, 2x3,
* 3x3 and 4x3 matrix types.
*/
Three = 3,
@ -137,6 +139,7 @@ template<UnsignedInt location, class T> class Attribute {
* Four components with BGRA ordering. Only for four-component
* float vector type. Must be used along with @ref DataType::UnsignedByte
* and @ref DataOption::Normalized.
* @m_keywords{GL_BGRA}
* @requires_gl32 Extension @extension{ARB,vertex_array_bgra}
* @requires_gl Only RGBA component ordering is supported in OpenGL
* ES and WebGL.
@ -153,6 +156,7 @@ template<UnsignedInt location, class T> class Attribute {
*
* Type of data passed to shader.
* @see @ref Type, @ref DataOptions, @ref Attribute()
* @m_enum_values_as_keywords
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
enum class DataType: GLenum {
@ -350,28 +354,30 @@ class DynamicAttribute {
*
* Count of components passed to the shader. If passing smaller count
* of components than corresponding type has, unspecified components
* are set to default values (second and third to `0`, fourth to `1`).
* are set to default values (second and third to @cpp 0 @ce, fourth to
* @cpp 1 @ce).
* @see @ref DynamicAttribute()
*/
enum class Components: GLint {
/**
* Only first component is specified. Second, third and fourth
* component are set to `0`, `0`, `1`, respectively. Only for
* scalar and vector types, not matrices.
* component are set to @cpp 0 @ce, @cpp 0 @ce, @cpp 1 @ce,
* respectively. Only for scalar and vector types, not matrices.
*/
One = 1,
/**
* First two components are specified. Third and fourth component
* are set to `0`, `1`, respectively. Only for two, three and
* four-component vector types and 2x2, 3x2 and 4x2 matrix types.
* are set to @cpp 0 @ce, @cpp 1 @ce, respectively. Only for two,
* three and four-component vector types and 2x2, 3x2 and 4x2
* matrix types.
*/
Two = 2,
/**
* First three components are specified. Fourth component is set to
* `1`. Only for three and four-component vector types, 2x3, 3x3
* and 4x3 matrix types.
* @cpp 1 @ce. Only for three and four-component vector types, 2x3,
* 3x3 and 4x3 matrix types.
*/
Three = 3,
@ -386,6 +392,7 @@ class DynamicAttribute {
* Four components with BGRA ordering. Only for four-component
* float vector type. Must be used along with @ref DataType::UnsignedByte
* and @ref Kind::GenericNormalized.
* @m_keywords{GL_BGRA}
* @requires_gl32 Extension @extension{ARB,vertex_array_bgra}
* @requires_gl Only RGBA component ordering is supported in OpenGL
* ES and WebGL.
@ -399,6 +406,7 @@ class DynamicAttribute {
*
* Type of data passed to shader.
* @see @ref Kind, @ref DynamicAttribute()
* @m_enum_values_as_keywords
*/
enum class DataType: GLenum {
UnsignedByte = GL_UNSIGNED_BYTE, /**< Unsigned byte */

194
src/Magnum/Buffer.h

@ -51,6 +51,7 @@ namespace Magnum {
@brief Buffer usage
@see @ref Buffer, @ref Buffer::setData(Containers::ArrayView<const void>, BufferUsage)
@m_enum_values_as_keywords
*/
enum class BufferUsage: GLenum {
/** Set once by the application and used infrequently for drawing. */
@ -140,45 +141,52 @@ namespace Implementation { struct BufferState; }
Encapsulates one OpenGL buffer object and provides functions for convenient
data updates.
## Data updating
@section Buffer-data-updating Data updating
Default way to set or update buffer data with @ref setData() or @ref setSubData()
is to use @ref Corrade::Containers::ArrayView. See its documentation for
more information about automatic conversions etc.
@code
@code{.cpp}
Containers::ArrayView<Vector3> data;
buffer.setData(data, BufferUsage::StaticDraw);
@endcode
There is also overload for array-like containers from STL, such as `std::vector`
or `std::array`:
@code
There is also overload for array-like containers from STL, such as
@ref std::vector or @ref std::array "std::array":
@code{.cpp}
std::vector<Vector3> data;
buffer.setData(data, BufferUsage::StaticDraw);
@endcode
@anchor Buffer-data-mapping
## Memory mapping
@section Buffer-data-mapping Memory mapping
Buffer data can be also updated asynchronously. First you need to allocate
the buffer to desired size by passing `nullptr` to @ref setData(), e.g.:
@code
the buffer to desired size by passing @cpp nullptr @ce to @ref setData(), e.g.:
@code{.cpp}
buffer.setData({nullptr, 200*sizeof(Vector3)}, BufferUsage::StaticDraw);
@endcode
Then you can map the buffer to client memory and operate with the memory
directly. After you are done with the operation, call @ref unmap() to unmap the
buffer again. The @ref map() functions return a view on `char` array and you
may want to cast it to some useful type first using @ref Containers::arrayCast():
@code
@code{.cpp}
Containers::ArrayView<Vector3> data = Containers::arrayCast<Vector3>(buffer.map(0, 200*sizeof(Vector3), Buffer::MapFlag::Write|Buffer::MapFlag::InvalidateBuffer));
CORRADE_INTERNAL_ASSERT(data);
for(Vector3& d: data)
d = ...;
CORRADE_INTERNAL_ASSERT_OUTPUT(buffer.unmap());
@endcode
If you are updating only a few discrete portions of the buffer, you can use
@ref MapFlag::FlushExplicit and @ref flushMappedRange() to reduce number of
memory operations performed by OpenGL on unmapping. Example:
@code
@code{.cpp}
Containers::ArrayView<Vector3> data = Containers::arrayCast<Vector3>(buffer.map(0, 200*sizeof(Vector3), Buffer::MapFlag::Write|Buffer::MapFlag::FlushExplicit));
CORRADE_INTERNAL_ASSERT(data);
for(std::size_t i: {7, 27, 56, 128}) {
@ -188,7 +196,7 @@ for(std::size_t i: {7, 27, 56, 128}) {
CORRADE_INTERNAL_ASSERT_OUTPUT(buffer.unmap());
@endcode
## WebGL restrictions
@section Buffer-webgl-restrictions WebGL restrictions
Buffers in @ref MAGNUM_TARGET_WEBGL "WebGL" need to be bound only to one unique
target, i.e., @ref Buffer bound to @ref Buffer::Target::Array cannot be later
@ -196,7 +204,8 @@ rebound to @ref Buffer::Target::ElementArray. However, Magnum by default uses
any sufficient target when binding the buffer internally (e.g. for setting
data). To avoid GL errors, set target hint to desired target, either in
constructor or using @ref Buffer::setTargetHint():
@code
@code{.cpp}
Buffer vertices{Buffer::Target::Array};
Buffer indices{Buffer::Target::ElementArray};
@endcode
@ -204,17 +213,17 @@ Buffer indices{Buffer::Target::ElementArray};
To ease up the development, @ref Mesh checks proper target hint when adding
vertex and index buffers in WebGL.
## Performance optimizations
@section Buffer-performance-optimizations Performance optimizations
The engine tracks currently bound buffers to avoid unnecessary calls to
@fn_gl{BindBuffer}. If the buffer is already bound to some target, functions
@ref copy(), @ref setData(), @ref setSubData(), @ref map(), @ref mapRead(),
@ref flushMappedRange() and @ref unmap() use that target instead of binding the
buffer to some specific target. You can also use @ref setTargetHint() to
possibly reduce unnecessary rebinding. Buffer limits and implementation-defined
values (such as @ref maxUniformBindings()) are cached, so repeated queries
don't result in repeated @fn_gl{Get} calls. See also @ref Context::resetState()
and @ref Context::State::Buffers.
@fn_gl_keyword{BindBuffer}. If the buffer is already bound to some target,
functions @ref copy(), @ref setData(), @ref setSubData(), @ref map(),
@ref mapRead(), @ref flushMappedRange() and @ref unmap() use that target
instead of binding the buffer to some specific target. You can also use
@ref setTargetHint() to possibly reduce unnecessary rebinding. Buffer limits
and implementation-defined values (such as @ref maxUniformBindings()) are
cached, so repeated queries don't result in repeated @fn_gl{Get} calls. See
also @ref Context::resetState() and @ref Context::State::Buffers.
If either @extension{ARB,direct_state_access} (part of OpenGL 4.5) or
@extension{EXT,direct_state_access} desktop extension is available, functions
@ -237,6 +246,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @brief Buffer target
*
* @see @ref Buffer(), @ref setTargetHint()
* @m_enum_values_as_keywords
*/
enum class TargetHint: GLenum {
/** Used for storing vertex attributes. */
@ -365,6 +375,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @brief Buffer binding target
*
* @see @ref bind(), @ref unbind()
* @m_enum_values_as_keywords
*/
enum class Target: GLenum {
#ifdef MAGNUM_BUILD_DEPRECATED
@ -489,7 +500,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief BufferUsage
* @brief @copybrief BufferUsage
* @deprecated Use @ref BufferUsage instead.
*/
typedef CORRADE_DEPRECATED("use BufferUsage instead") BufferUsage Usage;
@ -500,6 +511,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @brief Memory mapping access
*
* @see @ref map(MapAccess)
* @m_enum_values_as_keywords
* @requires_es_extension Extension @extension{OES,mapbuffer} or
* @extension{CHROMIUM,map_sub}
* @requires_gles Buffer mapping is not available in WebGL.
@ -535,6 +547,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @brief Memory mapping flag
*
* @see @ref MapFlags, @ref map(GLintptr, GLsizeiptr, MapFlags)
* @m_enum_values_as_keywords
* @requires_gl30 Extension @extension{ARB,map_buffer_range}
* @requires_gles30 Extension @extension{EXT,map_buffer_range} in
* OpenGL ES 2.0.
@ -617,9 +630,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,map_buffer_alignment}
* (part of OpenGL 4.2) is not available, returns `1`.
* (part of OpenGL 4.2) is not available, returns @cpp 1 @ce.
* @see @ref map(), @ref mapRead(), @fn_gl{Get} with
* @def_gl{MIN_MAP_BUFFER_ALIGNMENT}
* @def_gl_keyword{MIN_MAP_BUFFER_ALIGNMENT}
* @requires_gl No minimal value is specified for OpenGL ES. Buffer
* mapping is not available in WebGL.
*/
@ -633,9 +646,10 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_atomic_counters}
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns `0`.
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns
* @cpp 0 @ce.
* @see @ref bind(), @ref unbind(), @fn_gl{Get} with
* @def_gl{MAX_ATOMIC_COUNTER_BUFFER_BINDINGS}
* @def_gl_keyword{MAX_ATOMIC_COUNTER_BUFFER_BINDINGS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Atomic counters are not available in WebGL.
*/
@ -646,9 +660,10 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_storage_buffer_object}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`.
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns
* @cpp 0 @ce.
* @see @ref bind(), @ref unbind(), @fn_gl{Get} with
* @def_gl{MAX_SHADER_STORAGE_BUFFER_BINDINGS}
* @def_gl_keyword{MAX_SHADER_STORAGE_BUFFER_BINDINGS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Shader storage is not available in WebGL.
*/
@ -660,8 +675,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,uniform_buffer_object}
* (part of OpenGL 3.1) is not available, returns `1`.
* @see @ref bind(), @fn_gl{Get} with @def_gl{UNIFORM_BUFFER_OFFSET_ALIGNMENT}
* (part of OpenGL 3.1) is not available, returns @cpp 1 @ce.
* @see @ref bind(), @fn_gl{Get} with
* @def_gl_keyword{UNIFORM_BUFFER_OFFSET_ALIGNMENT}
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/
@ -673,8 +689,10 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_storage_buffer_object}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `1`.
* @see @ref bind(), @fn_gl{Get} with @def_gl{SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns
* @cpp 1 @ce.
* @see @ref bind(), @fn_gl{Get} with
* @def_gl_keyword{SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Shader storage is not available in WebGL.
*/
@ -686,9 +704,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,uniform_buffer_object}
* (part of OpenGL 3.1) is not available, returns `0`.
* (part of OpenGL 3.1) is not available, returns @cpp 0 @ce.
* @see @ref bind(), @ref unbind(), @fn_gl{Get} with
* @def_gl{MAX_UNIFORM_BUFFER_BINDINGS}
* @def_gl_keyword{MAX_UNIFORM_BUFFER_BINDINGS}
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/
@ -703,7 +721,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* for more information.
* @see @ref bind(), @ref maxAtomicCounterBindings(),
* @ref maxShaderStorageBindings(), @ref maxUniformBindings(),
* @fn_gl{BindBufferBase}
* @fn_gl_keyword{BindBufferBase}
* @requires_gl30 No form of indexed buffer binding is available in
* OpenGL 2.1, see particular @ref Target values for
* version/extension requirements.
@ -729,7 +747,8 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* for more information.
* @see @ref unbind(Target, UnsignedInt), @ref maxAtomicCounterBindings(),
* @ref maxShaderStorageBindings(), @ref maxUniformBindings(),
* @fn_gl{BindBuffersBase} or @fn_gl{BindBufferBase}
* @fn_gl_keyword{BindBuffersBase} or
* @fn_gl_keyword{BindBufferBase}
* @requires_gl30 No form of indexed buffer binding is available in
* OpenGL 2.1, see particular @ref Target values for
* version/extension requirements.
@ -762,7 +781,8 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @ref maxAtomicCounterBindings(), @ref maxShaderStorageBindings(),
* @ref maxUniformBindings(), @ref shaderStorageOffsetAlignment(),
* @ref uniformOffsetAlignment(), @ref TransformFeedback::attachBuffers(),
* @fn_gl{BindBuffersRange} or @fn_gl{BindBufferRange}
* @fn_gl_keyword{BindBuffersRange} or
* @fn_gl_keyword{BindBufferRange}
* @requires_gl30 No form of indexed buffer binding is available in
* OpenGL 2.1, see particular @ref Target values for
* version/extension requirements.
@ -790,8 +810,8 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* for more information.
* @see @ref bind(Target, UnsignedInt), @ref maxAtomicCounterBindings(),
* @ref maxShaderStorageBindings(), @ref maxUniformBindings(),
* @ref TransformFeedback::attachBuffers(), @fn_gl{BindBuffersBase}
* or @fn_gl{BindBufferBase}
* @ref TransformFeedback::attachBuffers(),
* @fn_gl_keyword{BindBuffersBase} or @fn_gl_keyword{BindBufferBase}
* @requires_gl30 No form of indexed buffer binding is available in
* OpenGL 2.1, see particular @ref Target values for
* version/extension requirements.
@ -816,9 +836,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* nor @extension{EXT,direct_state_access} desktop extension is
* available, @p read buffer is bound for reading and @p write buffer
* is bound for writing before the copy is performed (if not already).
* @see @fn_gl2{CopyNamedBufferSubData,CopyBufferSubData},
* @fn_gl_extension{NamedCopyBufferSubData,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{CopyBufferSubData}
* @see @fn_gl2_keyword{CopyNamedBufferSubData,CopyBufferSubData},
* @fn_gl_extension_keyword{NamedCopyBufferSubData,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl_keyword{CopyBufferSubData}
* @requires_gl31 Extension @extension{ARB,copy_buffer}
* @requires_gles30 Buffer copying is not available in OpenGL ES 2.0.
* @requires_webgl20 Buffer copying is not available in WebGL 1.0.
@ -856,8 +876,8 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* Creates new OpenGL buffer object. If @extension{ARB,direct_state_access}
* (part of OpenGL 4.5) is not available, the buffer is created on
* first use.
* @see @ref Buffer(NoCreateT), @ref wrap(), @fn_gl{CreateBuffers},
* eventually @fn_gl{GenBuffers}
* @see @ref Buffer(NoCreateT), @ref wrap(), @fn_gl_keyword{CreateBuffers},
* eventually @fn_gl_keyword{GenBuffers}
*/
explicit Buffer(TargetHint targetHint = TargetHint::Array);
@ -876,7 +896,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief Buffer(TargetHint)
* @brief @copybrief Buffer(TargetHint)
* @deprecated Use @ref Buffer(TargetHint) instead.
*/
CORRADE_DEPRECATED("use Buffer(TargetHint) instead") explicit Buffer(Target targetHint): Buffer{static_cast<TargetHint>(targetHint)} {}
@ -893,7 +913,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @brief Destructor
*
* Deletes associated OpenGL buffer object.
* @see @ref wrap(), @ref release(), @fn_gl{DeleteBuffers}
* @see @ref wrap(), @ref release(), @fn_gl_keyword{DeleteBuffers}
*/
~Buffer();
@ -927,8 +947,8 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function returns empty string.
* @see @fn_gl{GetObjectLabel} with @def_gl{BUFFER} or
* @fn_gl_extension{GetObjectLabel,EXT,debug_label} with
* @see @fn_gl_keyword{GetObjectLabel} with @def_gl{BUFFER} or
* @fn_gl_extension_keyword{GetObjectLabel,EXT,debug_label} with
* @def_gl{BUFFER_OBJECT_EXT}
* @requires_gles Debug output is not available in WebGL.
*/
@ -942,9 +962,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function does nothing.
* @see @ref maxLabelLength(), @fn_gl{ObjectLabel} with @def_gl{BUFFER}
* or @fn_gl_extension{LabelObject,EXT,debug_label} with
* @def_gl{BUFFER_OBJECT_EXT}
* @see @ref maxLabelLength(), @fn_gl_keyword{ObjectLabel} with
* @def_gl{BUFFER} or @fn_gl_extension_keyword{LabelObject,EXT,debug_label}
* with @def_gl{BUFFER_OBJECT_EXT}
* @requires_gles Debug output is not available in WebGL.
*/
Buffer& setLabel(const std::string& label) {
@ -982,7 +1002,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief setTargetHint(TargetHint)
* @brief @copybrief setTargetHint(TargetHint)
* @deprecated Use @ref setTargetHint(TargetHint) instead.
*/
CORRADE_DEPRECATED("use setTargetHint(TargetHint) instead") Buffer& setTargetHint(Target hint) {
@ -1005,7 +1025,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @ref maxAtomicCounterBindings(), @ref maxShaderStorageBindings(),
* @ref maxUniformBindings(), @ref shaderStorageOffsetAlignment(),
* @ref uniformOffsetAlignment(), @ref TransformFeedback::attachBuffer(),
* @fn_gl{BindBufferRange}
* @fn_gl_keyword{BindBufferRange}
* @requires_gl30 No form of indexed buffer binding is available in
* OpenGL 2.1, see particular @ref Target values for
* version/extension requirements.
@ -1030,7 +1050,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @see @ref bind(Target, UnsignedInt, std::initializer_list<Buffer*>),
* @ref maxAtomicCounterBindings(), @ref maxShaderStorageBindings(),
* @ref maxUniformBindings(), @ref TransformFeedback::attachBuffer(),
* @fn_gl{BindBufferBase}
* @fn_gl_keyword{BindBufferBase}
* @requires_gl30 No form of indexed buffer binding is available in
* OpenGL 2.1, see particular @ref Target values for
* version/extension requirements.
@ -1051,9 +1071,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the buffer is bound to hinted target before the operation
* (if not already).
* @see @ref setTargetHint(), @fn_gl2{GetNamedBufferParameter,GetBufferParameter},
* @fn_gl_extension{GetNamedBufferParameter,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{GetBufferParameter}
* @see @ref setTargetHint(), @fn_gl2_keyword{GetNamedBufferParameter,GetBufferParameter},
* @fn_gl_extension_keyword{GetNamedBufferParameter,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl_keyword{GetBufferParameter}
*/
Int size();
@ -1069,9 +1089,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @fn_gl2{GetNamedBufferParameter,GetBufferParameter},
* @fn_gl_extension{GetNamedBufferParameter,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{GetBufferParameter}
* with @def_gl{BUFFER_SIZE}, then @fn_gl2{GetNamedBufferSubData,GetBufferSubData},
* @fn_gl_extension{GetNamedBufferSubData,EXT,direct_state_access},
* eventually @fn_gl{GetBufferSubData}
* with @def_gl{BUFFER_SIZE}, then @fn_gl2_keyword{GetNamedBufferSubData,GetBufferSubData},
* @fn_gl_extension_keyword{GetNamedBufferSubData,EXT,direct_state_access},
* eventually @fn_gl_keyword{GetBufferSubData}
* @requires_gl Buffer data queries are not available in OpenGL ES and
* WebGL. Use @ref map(), @ref mapRead() or @ref DebugTools::bufferData()
* in OpenGL ES instead.
@ -1079,7 +1099,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
Containers::Array<char> data();
#ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief data()
/** @brief @copybrief data()
* @deprecated Use non-templated @ref subData() and @ref Containers::arrayCast()
* instead.
*/
@ -1097,9 +1117,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @extension{EXT,direct_state_access} is available, the buffer is
* bound to hinted target before the operation (if not already).
* @see @ref size(), @ref data(), @ref setSubData(), @ref setTargetHint(),
* @fn_gl2{GetNamedBufferSubData,GetBufferSubData},
* @fn_gl_extension{GetNamedBufferSubData,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{GetBufferSubData}
* @fn_gl2_keyword{GetNamedBufferSubData,GetBufferSubData},
* @fn_gl_extension_keyword{GetNamedBufferSubData,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl_keyword{GetBufferSubData}
* @requires_gl Buffer data queries are not available in OpenGL ES and
* WebGL. Use @ref map(), @ref mapRead() or @ref DebugTools::bufferData()
* in OpenGL ES instead.
@ -1107,7 +1127,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
Containers::Array<char> subData(GLintptr offset, GLsizeiptr size);
#ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief subData()
/** @brief @copybrief subData()
* @deprecated Use non-templated @ref subData() and @ref Containers::arrayCast() instead
*/
/* MinGW complains loudly if the declaration doesn't also have inline */
@ -1125,9 +1145,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the buffer is bound to hinted target before the operation
* (if not already).
* @see @ref setTargetHint(), @fn_gl2{NamedBufferData,BufferData},
* @fn_gl_extension{NamedBufferData,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{BufferData}
* @see @ref setTargetHint(), @fn_gl2_keyword{NamedBufferData,BufferData},
* @fn_gl_extension_keyword{NamedBufferData,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl_keyword{BufferData}
*/
Buffer& setData(Containers::ArrayView<const void> data, BufferUsage usage);
@ -1153,9 +1173,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the buffer is bound to hinted target before the operation
* (if not already).
* @see @ref setTargetHint(), @fn_gl2{NamedBufferSubData,BufferSubData},
* @fn_gl_extension{NamedBufferSubData,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{BufferSubData}
* @see @ref setTargetHint(), @fn_gl2_keyword{NamedBufferSubData,BufferSubData},
* @fn_gl_extension_keyword{NamedBufferSubData,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl_keyword{BufferSubData}
*/
Buffer& setSubData(GLintptr offset, Containers::ArrayView<const void> data);
@ -1177,7 +1197,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
*
* If running on OpenGL ES or extension @extension{ARB,invalidate_subdata}
* (part of OpenGL 4.3) is not available, this function does nothing.
* @see @ref MapFlag::InvalidateBuffer, @fn_gl{InvalidateBufferData}
* @see @ref MapFlag::InvalidateBuffer, @fn_gl_keyword{InvalidateBufferData}
*/
Buffer& invalidateData();
@ -1189,7 +1209,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
*
* If running on OpenGL ES or extension @extension{ARB,invalidate_subdata}
* (part of OpenGL 4.3) is not available, this function does nothing.
* @see @ref MapFlag::InvalidateRange, @fn_gl{InvalidateBufferData}
* @see @ref MapFlag::InvalidateRange, @fn_gl_keyword{InvalidateBufferData}
*/
Buffer& invalidateSubData(GLintptr offset, GLsizeiptr length);
@ -1197,16 +1217,16 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
/**
* @brief Map buffer to client memory
* @param access Access
* @return Pointer to mapped buffer data or `nullptr` on error
* @return Pointer to mapped buffer data or @cpp nullptr @ce on error
*
* If neither @extension{ARB,direct_state_access} (part of OpenGL 4.5)
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the buffer is bound to hinted target before the operation
* (if not already).
* @see @ref mapRead(), @ref minMapAlignment(), @ref unmap(),
* @ref setTargetHint(), @fn_gl2{MapNamedBuffer,MapBuffer},
* @fn_gl_extension{MapNamedBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{MapBuffer}
* @ref setTargetHint(), @fn_gl2_keyword{MapNamedBuffer,MapBuffer},
* @fn_gl_extension_keyword{MapNamedBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl_keyword{MapBuffer}
* @requires_es_extension Extension @extension{OES,mapbuffer} in
* OpenGL ES 2.0, use @ref map(GLintptr, GLsizeiptr, MapFlags) in
* OpenGL ES 3.0 instead.
@ -1251,9 +1271,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* (if not already).
* @see @ref mapRead(), @ref minMapAlignment(), @ref flushMappedRange(),
* @ref unmap(), @ref map(MapAccess), @ref setTargetHint(),
* @fn_gl2{MapNamedBufferRange,MapBufferRange},
* @fn_gl_extension{MapNamedBufferRange,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{MapBufferRange}
* @fn_gl2_keyword{MapNamedBufferRange,MapBufferRange},
* @fn_gl_extension_keyword{MapNamedBufferRange,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl_keyword{MapBufferRange}
* @requires_gl30 Extension @extension{ARB,map_buffer_range}
* @requires_gles30 Extension @extension{EXT,map_buffer_range} in
* OpenGL ES 2.0.
@ -1294,9 +1314,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the buffer is bound to hinted target before the operation
* (if not already).
* @see @ref setTargetHint(), @fn_gl2{FlushMappedNamedBufferRange,FlushMappedBufferRange},
* @fn_gl_extension{FlushMappedNamedBufferRange,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{FlushMappedBufferRange}
* @see @ref setTargetHint(), @fn_gl2_keyword{FlushMappedNamedBufferRange,FlushMappedBufferRange},
* @fn_gl_extension_keyword{FlushMappedNamedBufferRange,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl_keyword{FlushMappedBufferRange}
* @requires_gl30 Extension @extension{ARB,map_buffer_range}
* @requires_gles30 Extension @extension{EXT,map_buffer_range} in
* OpenGL ES 2.0.
@ -1316,9 +1336,9 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @extension{EXT,direct_state_access} desktop extension is available,
* the buffer is bound to hinted target before the operation (if not
* already).
* @see @ref setTargetHint(), @fn_gl2{UnmapNamedBuffer,UnmapBuffer},
* @fn_gl_extension{UnmapNamedBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl{UnmapBuffer}
* @see @ref setTargetHint(), @fn_gl2_keyword{UnmapNamedBuffer,UnmapBuffer},
* @fn_gl_extension_keyword{UnmapNamedBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindBuffer} and @fn_gl_keyword{UnmapBuffer}
* @requires_gles30 Extension @extension{OES,mapbuffer} in OpenGL
* ES 2.0.
* @requires_gles Buffer mapping is not available in WebGL.

10
src/Magnum/BufferImage.h

@ -83,8 +83,8 @@ template<UnsignedInt dimensions> class BufferImage {
* @param buffer Buffer
* @param dataSize Buffer data size
*
* If @p dataSize is 0, the buffer is unconditionally reallocated on
* the first call to @ref setData().
* If @p dataSize is @cpp 0 @ce, the buffer is unconditionally
* reallocated on the first call to @ref setData().
*/
explicit BufferImage(PixelStorage storage, PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size, Buffer&& buffer, std::size_t dataSize) noexcept;
@ -94,7 +94,7 @@ template<UnsignedInt dimensions> class BufferImage {
explicit BufferImage(PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size, Buffer&& buffer, std::size_t dataSize) noexcept: BufferImage{{}, format, type, size, std::move(buffer), dataSize} {}
#ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief BufferImage(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<const void>, BufferUsage)
/** @brief @copybrief BufferImage(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<const void>, BufferUsage)
* @deprecated Use @ref BufferImage(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<const void>, BufferUsage)
* instead.
*/
@ -202,7 +202,7 @@ template<UnsignedInt dimensions> class BufferImage {
* @param data Image data
* @param usage Image buffer usage
*
* Updates the image buffer with given data. Passing `nullptr`
* Updates the image buffer with given data. Passing @cpp nullptr @ce
* zero-sized @p data will not reallocate current storage, but expects
* that current data size is large enough for the new parameters.
* @see @ref Buffer::setData()
@ -219,7 +219,7 @@ template<UnsignedInt dimensions> class BufferImage {
}
#ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief setData(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<const void>, BufferUsage)
/** @brief @copybrief setData(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<const void>, BufferUsage)
* @deprecated Use @ref setData(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<const void>, BufferUsage)
* instead.
*/

43
src/Magnum/BufferTexture.h

@ -42,7 +42,7 @@ namespace Magnum {
This texture is, unlike classic textures such as @ref Texture, used as simple
data source, without any unnecessary interpolation and wrapping methods.
## Usage
@section BufferTexture-usage Usage
Texture data are stored in buffer and after binding the buffer to the texture
using @ref setBuffer(), you can fill the buffer at any time using data setting
@ -54,7 +54,8 @@ for whole texture lifetime. On the other hand it allows you to use one buffer
for more textures or store more than one data in it.
Example usage:
@code
@code{.cpp}
Buffer buffer;
BufferTexture texture;
texture.setBuffer(BufferTextureFormat::RGB32F, buffer);
@ -65,12 +66,13 @@ constexpr static Vector3 data[] = {
buffer.setData(data, BufferUsage::StaticDraw);
@endcode
In shader, the texture is used via `samplerBuffer`, `isamplerBuffer` or
`usamplerBuffer`. Unlike in classic textures, coordinates for buffer textures
are integer coordinates passed to `texelFetch()`. See @ref AbstractShaderProgram
documentation for more information about usage in shaders.
In shader, the texture is used via @glsl samplerBuffer @ce,
@glsl isamplerBuffer @ce or @glsl usamplerBuffer @ce. Unlike in classic
textures, coordinates for buffer textures are integer coordinates passed to
@glsl texelFetch() @ce. See @ref AbstractShaderProgram documentation for more
information about usage in shaders.
## Performance optimizations
@section BufferTexture-performance-optimizations Performance optimizations
If either @extension{ARB,direct_state_access} (part of OpenGL 4.5) or
@extension{EXT,direct_state_access} is available, @ref setBuffer() functions
@ -96,8 +98,8 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If @extension{ARB,texture_buffer_object} (part of
* OpenGL 3.1) is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_TEXTURE_BUFFER_SIZE}
* OpenGL 3.1) is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TEXTURE_BUFFER_SIZE}
*/
static Int maxSize();
@ -106,8 +108,8 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,texture_buffer_range}
* (part of OpenGL 4.3) is not available, returns `1`.
* @see @fn_gl{Get} with @def_gl{TEXTURE_BUFFER_OFFSET_ALIGNMENT}
* (part of OpenGL 4.3) is not available, returns @cpp 1 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{TEXTURE_BUFFER_OFFSET_ALIGNMENT}
*/
static Int offsetAlignment();
@ -132,8 +134,9 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture {
* Creates new OpenGL texture object. If @extension{ARB,direct_state_access}
* (part of OpenGL 4.5) is not available, the texture is created on
* first use.
* @see @ref BufferTexture(NoCreateT), @ref wrap(), @fn_gl{CreateTextures}
* with @def_gl{TEXTURE_BUFFER}, eventually @fn_gl{GenTextures}
* @see @ref BufferTexture(NoCreateT), @ref wrap(),
* @fn_gl_keyword{CreateTextures} with @def_gl{TEXTURE_BUFFER},
* eventually @fn_gl_keyword{GenTextures}
*/
explicit BufferTexture():
#ifndef MAGNUM_TARGET_GLES
@ -172,7 +175,7 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture {
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref unbindImage(), @ref unbindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gles31 Shader image load/store is not available in OpenGL
* ES 3.0 and older.
@ -194,10 +197,10 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture {
* (part of OpenGL 4.5) nor @extension{EXT,direct_state_access} is
* available, the texture is bound before the operation (if not
* already).
* @see @ref maxSize(), @fn_gl2{TextureBuffer,TexBuffer},
* @fn_gl_extension{TextureBuffer,EXT,direct_state_access},
* @see @ref maxSize(), @fn_gl2_keyword{TextureBuffer,TexBuffer},
* @fn_gl_extension_keyword{TextureBuffer,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexBuffer}
* @fn_gl_keyword{TexBuffer}
*/
BufferTexture& setBuffer(BufferTextureFormat internalFormat, Buffer& buffer);
@ -215,10 +218,10 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture {
* (part of OpenGL 4.5) nor @extension{EXT,direct_state_access} is
* available, the texture is bound before the operation (if not
* already).
* @see @ref maxSize(), @fn_gl2{TextureBufferRange,TexBufferRange},
* @fn_gl_extension{TextureBufferRange,EXT,direct_state_access},
* @see @ref maxSize(), @fn_gl2_keyword{TextureBufferRange,TexBufferRange},
* @fn_gl_extension_keyword{TextureBufferRange,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexBufferRange}
* @fn_gl_keyword{TexBufferRange}
* @requires_gl43 Extension @extension{ARB,texture_buffer_range}
*/
BufferTexture& setBuffer(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size);

1
src/Magnum/BufferTextureFormat.h

@ -40,6 +40,7 @@ namespace Magnum {
@brief Internal buffer texture format
@see @ref BufferTexture
@m_enum_values_as_keywords
@requires_gl31 Extension @extension{ARB,texture_buffer_object}
@requires_gles30 Not defined in OpenGL ES 2.0.
@requires_es_extension Extension @extension{ANDROID,extension_pack_es31a}/

4
src/Magnum/Color.h

@ -40,14 +40,14 @@ CORRADE_DEPRECATED_FILE("use Magnum/Math/Color.h instead")
namespace Magnum {
/** @copybrief Math::Color3
/** @brief @copybrief Math::Color3
* @deprecated Use @ref Math::Color3 instead.
*/
#ifndef CORRADE_MSVC2015_COMPATIBILITY /* Multiple definitions still broken */
template<class T> using BasicColor3 CORRADE_DEPRECATED_ALIAS("use Math::Color3 instead") = Math::Color3<T>;
#endif
/** @copybrief Math::Color4
/** @brief @copybrief Math::Color4
* @deprecated Use @ref Math::Color4 instead.
*/
#ifndef CORRADE_MSVC2015_COMPATIBILITY /* Multiple definitions still broken */

6
src/Magnum/ColorFormat.h

@ -37,17 +37,17 @@ CORRADE_DEPRECATED_FILE("use Magnum/PixelFormat.h instead")
namespace Magnum {
/** @copybrief PixelFormat
/** @brief @copybrief PixelFormat
* @deprecated Use @ref PixelFormat instead.
*/
typedef CORRADE_DEPRECATED("use PixelFormat instead") PixelFormat ColorFormat;
/** @copybrief PixelType
/** @brief @copybrief PixelType
* @deprecated Use @ref PixelType instead.
*/
typedef CORRADE_DEPRECATED("use PixelType instead") PixelType ColorType;
/** @copybrief CompressedPixelFormat
/** @brief @copybrief CompressedPixelFormat
* @deprecated Use @ref CompressedPixelFormat instead.
*/
typedef CORRADE_DEPRECATED("use CompressedPixelFormat instead") CompressedPixelFormat CompressedColorFormat;

21
src/Magnum/Context.h

@ -131,6 +131,7 @@ class MAGNUM_EXPORT Context {
*
* @see @ref Flags, @ref flags(),
* @ref Platform::Sdl2Application::Configuration::setFlags() "Platform::*Application::Configuration::setFlags()"
* @m_enum_values_as_keywords
* @requires_gles Context flags are not available in WebGL.
*/
enum class Flag: GLint {
@ -347,7 +348,8 @@ class MAGNUM_EXPORT Context {
*
* The result is *not* cached, repeated queries will result in repeated
* OpenGL calls.
* @see @ref rendererString(), @fn_gl{GetString} with @def_gl{VENDOR}
* @see @ref rendererString(), @fn_gl{GetString} with
* @def_gl_keyword{VENDOR}
*/
std::string vendorString() const;
@ -356,7 +358,8 @@ class MAGNUM_EXPORT Context {
*
* The result is *not* cached, repeated queries will result in repeated
* OpenGL calls.
* @see @ref vendorString(), @fn_gl{GetString} with @def_gl{RENDERER}
* @see @ref vendorString(), @fn_gl{GetString} with
* @def_gl_keyword{RENDERER}
*/
std::string rendererString() const;
@ -366,7 +369,7 @@ class MAGNUM_EXPORT Context {
* The result is *not* cached, repeated queries will result in repeated
* OpenGL calls.
* @see @ref shadingLanguageVersionString(), @ref version(),
* @fn_gl{GetString} with @def_gl{VERSION}
* @fn_gl{GetString} with @def_gl_keyword{VERSION}
*/
std::string versionString() const;
@ -376,7 +379,7 @@ class MAGNUM_EXPORT Context {
* The result is *not* cached, repeated queries will result in repeated
* OpenGL calls.
* @see @ref versionString(), @ref version(), @fn_gl{GetString} with
* @def_gl{SHADING_LANGUAGE_VERSION}
* @def_gl_keyword{SHADING_LANGUAGE_VERSION}
*/
std::string shadingLanguageVersionString() const;
@ -386,8 +389,8 @@ class MAGNUM_EXPORT Context {
* The result is *not* cached, repeated queries will result in repeated
* OpenGL calls.
* @see @ref versionString(), @ref version(), @fn_gl{Get} with
* @def_gl{NUM_SHADING_LANGUAGE_VERSIONS}, @fn_gl{GetString} with
* @def_gl{SHADING_LANGUAGE_VERSION}
* @def_gl_keyword{NUM_SHADING_LANGUAGE_VERSIONS}, @fn_gl{GetString}
* with @def_gl_keyword{SHADING_LANGUAGE_VERSION}
*/
std::vector<std::string> shadingLanguageVersionStrings() const;
@ -399,8 +402,8 @@ class MAGNUM_EXPORT Context {
* reported by the driver (even those not supported by Magnum), see
* @ref supportedExtensions(), @ref Extension::extensions() or
* @ref isExtensionSupported() for alternatives.
* @see @fn_gl{Get} with @def_gl{NUM_EXTENSIONS}, @fn_gl{GetString}
* with @def_gl{EXTENSIONS}
* @see @fn_gl{Get} with @def_gl_keyword{NUM_EXTENSIONS},
* @fn_gl{GetString} with @def_gl_keyword{EXTENSIONS}
*/
std::vector<std::string> extensionStrings() const;
@ -430,7 +433,7 @@ class MAGNUM_EXPORT Context {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls.
* @see @fn_gl{Get} with @def_gl{CORE_PROFILE_MASK}
* @see @fn_gl{Get} with @def_gl_keyword{CORE_PROFILE_MASK}
* @requires_gl Not available on OpenGL ES or WebGL.
*/
bool isCoreProfile();

149
src/Magnum/CubeMapTexture.h

@ -64,13 +64,14 @@ turned upside down (+Y is top):
| +Y |
+----+
## Basic usage
@section CubeMapTexture-usage Basic usage
See @ref Texture documentation for introduction.
Common usage is to fully configure all texture parameters and then set the
data from e.g. set of Image objects:
@code
@code{.cpp}
Image2D positiveX(PixelFormat::RGBA, PixelType::UnsignedByte, {256, 256}, data);
// ...
@ -83,10 +84,10 @@ texture.setMagnificationFilter(Sampler::Filter::Linear)
// ...
@endcode
In shader, the texture is used via `samplerCube`, `samplerCubeShadow`,
`isamplerCube` or `usamplerCube`. Unlike in classic textures, coordinates for
cube map textures is signed three-part vector from the center of the cube,
which intersects one of the six sides of the cube map. See
In shader, the texture is used via @cpp samplerCube @ce, @cpp samplerCubeShadow @ce,
@cpp isamplerCube @ce or @cpp usamplerCube @ce. Unlike in classic textures,
coordinates for cube map textures is signed three-part vector from the center
of the cube, which intersects one of the six sides of the cube map. See
@ref AbstractShaderProgram for more information about usage in shaders.
@see @ref Renderer::Feature::SeamlessCubeMapTexture, @ref CubeMapTextureArray,
@ -99,7 +100,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
public:
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief CubeMapCoordinate
* @brief @copybrief CubeMapCoordinate
* @deprecated Use @ref CubeMapCoordinate instead.
*/
typedef CORRADE_DEPRECATED("use CubeMapCoordinate instead") CubeMapCoordinate Coordinate;
@ -110,13 +111,13 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls.
* @see @fn_gl{Get} with @def_gl{MAX_CUBE_MAP_TEXTURE_SIZE}
* @see @fn_gl{Get} with @def_gl_keyword{MAX_CUBE_MAP_TEXTURE_SIZE}
*/
static Vector2i maxSize();
#ifndef MAGNUM_TARGET_GLES
/**
* @copybrief Texture::compressedBlockSize()
* @brief @copybrief Texture::compressedBlockSize()
*
* See @ref Texture::compressedBlockSize() for more information.
* @requires_gl43 Extension @extension{ARB,internalformat_query2}
@ -128,14 +129,14 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
}
/**
* @copybrief Texture::compressedBlockDataSize()
* @brief @copybrief Texture::compressedBlockDataSize()
*
* See @ref Texture::compressedBlockDataSize() for more information.
* @requires_gl43 Extension @extension{ARB,internalformat_query2}
* @requires_gl Compressed texture queries are not available in OpenGL
* ES.
* @see @ref compressedBlockSize(), @fn_gl{Getinternalformat} with
* @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE}
* @see @ref compressedBlockSize(), @fn_gl_keyword{GetInternalformat}
* with @def_gl_keyword{TEXTURE_COMPRESSED_BLOCK_SIZE}
*/
static Int compressedBlockDataSize(TextureFormat format) {
return AbstractTexture::compressedBlockDataSize(GL_TEXTURE_CUBE_MAP, format);
@ -163,8 +164,9 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* Creates new OpenGL texture object. If @extension{ARB,direct_state_access}
* (part of OpenGL 4.5) is not available, the texture is created on
* first use.
* @see @ref CubeMapTexture(NoCreateT), @ref wrap(), @fn_gl{CreateTextures}
* with @def_gl{TEXTURE_CUBE_MAP}, eventually @fn_gl{GenTextures}
* @see @ref CubeMapTexture(NoCreateT), @ref wrap(),
* @fn_gl_keyword{CreateTextures} with @def_gl{TEXTURE_CUBE_MAP},
* eventually @fn_gl_keyword{GenTextures}
*/
explicit CubeMapTexture(): AbstractTexture(GL_TEXTURE_CUBE_MAP) {}
@ -196,7 +198,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gles31 Shader image load/store is not available in OpenGL
* ES 3.0 and older.
@ -219,7 +221,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref bindImage(), @ref unbindImage(), @ref unbindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gles31 Shader image load/store is not available in OpenGL
* ES 3.0 and older.
@ -232,7 +234,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#ifndef MAGNUM_TARGET_GLES2
/**
* @copybrief Texture::setBaseLevel()
* @brief @copybrief Texture::setBaseLevel()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBaseLevel() for more information.
@ -247,7 +249,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
/**
* @copybrief Texture::setMaxLevel()
* @brief @copybrief Texture::setMaxLevel()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMaxLevel() for more information.
@ -263,7 +265,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#endif
/**
* @copybrief Texture::setMinificationFilter()
* @brief @copybrief Texture::setMinificationFilter()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMinificationFilter() for more information.
@ -274,7 +276,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setMagnificationFilter()
* @brief @copybrief Texture::setMagnificationFilter()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMagnificationFilter() for more information.
@ -286,7 +288,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#ifndef MAGNUM_TARGET_GLES2
/**
* @copybrief Texture::setMinLod()
* @brief @copybrief Texture::setMinLod()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMinLod() for more information.
@ -301,7 +303,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setMaxLod()
* @brief @copybrief Texture::setMaxLod()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMaxLod() for more information.
@ -318,7 +320,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#ifndef MAGNUM_TARGET_GLES
/**
* @copybrief Texture::setLodBias()
* @brief @copybrief Texture::setLodBias()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setLodBias() for more information.
@ -332,7 +334,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#endif
/**
* @copybrief Texture::setWrapping()
* @brief @copybrief Texture::setWrapping()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setWrapping() for more information.
@ -344,7 +346,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#ifndef MAGNUM_TARGET_WEBGL
/**
* @copybrief Texture::setBorderColor(const Color4&)
* @brief @copybrief Texture::setBorderColor(const Color4&)
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Color4&) for more
@ -361,7 +363,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#ifndef MAGNUM_TARGET_GLES2
/**
* @copybrief Texture::setBorderColor(const Vector4ui&)
* @brief @copybrief Texture::setBorderColor(const Vector4ui&)
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Vector4ui&) for more
@ -394,7 +396,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#endif
/**
* @copybrief Texture::setMaxAnisotropy()
* @brief @copybrief Texture::setMaxAnisotropy()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMaxAnisotropy() for more information.
@ -406,7 +408,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#ifndef MAGNUM_TARGET_WEBGL
/**
* @copybrief Texture::setSRGBDecode()
* @brief @copybrief Texture::setSRGBDecode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setSRGBDecode() for more information.
@ -425,7 +427,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
/**
* @copybrief Texture::setSwizzle()
* @brief @copybrief Texture::setSwizzle()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setSwizzle() for more information.
@ -441,7 +443,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
/**
* @copybrief Texture::setCompareMode()
* @brief @copybrief Texture::setCompareMode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompareMode() for more information.
@ -456,7 +458,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setCompareFunction()
* @brief @copybrief Texture::setCompareFunction()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompareFunction() for more information.
@ -473,7 +475,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
/**
* @copybrief Texture::setDepthStencilMode()
* @brief @copybrief Texture::setDepthStencilMode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setDepthStencilMode() for more information.
@ -489,7 +491,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#endif
/**
* @copybrief Texture::setStorage()
* @brief @copybrief Texture::setStorage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setStorage() for more information.
@ -502,7 +504,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
/**
* @copybrief Texture::imageSize()
* @brief @copybrief Texture::imageSize()
*
* If @extension{ARB,direct_state_access} (part of OpenGL 4.5) is not
* available, it is assumed that faces have the same size and just the
@ -517,7 +519,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief imageSize()
* @brief @copybrief imageSize()
* @deprecated Use @ref imageSize(Int) instead.
*/
CORRADE_DEPRECATED("use imageSize(Int) instead") Vector2i imageSize(CubeMapCoordinate, Int level) {
@ -538,7 +540,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* The operation is protected from buffer overflow.
* @see @fn_gl2{GetTextureLevelParameter,GetTexLevelParameter} with
* @def_gl{TEXTURE_WIDTH}, @def_gl{TEXTURE_HEIGHT}, then
* @fn_gl{PixelStore}, then @fn_gl2{GetTextureImage,GetTexImage}
* @fn_gl{PixelStore}, then @fn_gl2_keyword{GetTextureImage,GetTexImage}
* @requires_gl45 Extension @extension{ARB,direct_state_access}
* @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround.
@ -548,7 +550,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
@ -569,7 +572,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
@ -585,7 +589,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* @def_gl{TEXTURE_COMPRESSED_IMAGE_SIZE},
* @def_gl{TEXTURE_INTERNAL_FORMAT}, @def_gl{TEXTURE_WIDTH},
* @def_gl{TEXTURE_HEIGHT}, then
* @fn_gl2{GetCompressedTextureImage,GetCompressedTexImage}
* @fn_gl2_keyword{GetCompressedTextureImage,GetCompressedTexImage}
* @requires_gl45 Extension @extension{ARB,direct_state_access}
* @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround.
@ -595,7 +599,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage3D image = texture.compressedImage(0, {});
* @endcode
*/
@ -616,7 +621,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage3D image = texture.compressedImage(0, {}, BufferUsage::StaticRead);
* @endcode
*/
@ -644,9 +650,10 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{GetTexLevelParameter} with @def_gl{TEXTURE_WIDTH},
* @def_gl{TEXTURE_HEIGHT}, then @fn_gl{PixelStore}, then
* @fn_gl{GetTextureSubImage}, @fn_gl_extension{GetnTexImage,ARB,robustness},
* @fn_gl_extension{GetTextureImage,EXT,direct_state_access},
* eventually @fn_gl{GetTexImage}
* @fn_gl_keyword{GetTextureSubImage},
* @fn_gl_extension_keyword{GetnTexImage,ARB,robustness},
* @fn_gl_extension_keyword{GetTextureImage,EXT,direct_state_access},
* eventually @fn_gl_keyword{GetTexImage}
* @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround.
*/
@ -655,7 +662,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image2D image = texture.image(CubeMapCoordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
@ -675,7 +683,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage2D image = texture.image(CubeMapCoordinate::PositiveX, 0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
@ -703,10 +712,10 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* @def_gl{TEXTURE_COMPRESSED_IMAGE_SIZE},
* @def_gl{TEXTURE_INTERNAL_FORMAT}, @def_gl{TEXTURE_WIDTH},
* @def_gl{TEXTURE_HEIGHT}, then @fn_gl{PixelStore}, then
* @fn_gl{GetCompressedTextureSubImage},
* @fn_gl_extension{GetnCompressedTexImage,ARB,robustness},
* @fn_gl_extension{GetCompressedTextureImage,EXT,direct_state_access},
* eventually @fn_gl{GetCompressedTexImage}
* @fn_gl_keyword{GetCompressedTextureSubImage},
* @fn_gl_extension_keyword{GetnCompressedTexImage,ARB,robustness},
* @fn_gl_extension_keyword{GetCompressedTextureImage,EXT,direct_state_access},
* eventually @fn_gl_keyword{GetCompressedTexImage}
* @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround.
*/
@ -715,7 +724,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {});
* @endcode
*/
@ -736,14 +746,15 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage2D image = texture.compressedImage(CubeMapCoordinate::PositiveX, 0, {}, BufferUsage::StaticRead);
* @endcode
*/
CompressedBufferImage2D compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D&& image, BufferUsage usage);
/**
* @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
* @brief @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
*
* See @ref Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
* for more information.
@ -758,14 +769,15 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image3D image = texture.subImage(0, range, {PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
Image3D subImage(Int level, const Range3Di& range, Image3D&& image);
/**
* @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
* @brief @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
*
* See @ref Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
* for more information.
@ -780,14 +792,15 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage3D image = texture.subImage(0, range, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
BufferImage3D subImage(Int level, const Range3Di& range, BufferImage3D&& image, BufferUsage usage);
/**
* @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
* @brief @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
*
* See @ref Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
* for more information.
@ -806,14 +819,15 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage3D image = texture.compressedSubImage(0, range, {});
* @endcode
*/
CompressedImage3D compressedSubImage(Int level, const Range3Di& range, CompressedImage3D&& image);
/**
* @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
* @brief @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
*
* See @ref Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
* for more information.
@ -832,7 +846,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage3D image = texture.compressedSubImage(0, range, {}, BufferUsage::StaticRead);
* @endcode
*/
@ -840,7 +855,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#endif
/**
* @copybrief Texture::setImage()
* @brief @copybrief Texture::setImage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setImage() for more information.
@ -881,7 +896,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#endif
/**
* @copybrief Texture::setCompressedImage()
* @brief @copybrief Texture::setCompressedImage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompressedImage() for more information.
@ -986,7 +1001,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#endif
/**
* @copybrief Texture::setSubImage()
* @brief @copybrief Texture::setSubImage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setSubImage() for more information.
@ -1014,7 +1029,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#endif
/**
* @copybrief Texture::setCompressedSubImage()
* @brief @copybrief Texture::setCompressedSubImage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompressedSubImage() for more information.
@ -1042,7 +1057,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
#endif
/**
* @copybrief Texture::generateMipmap()
* @brief @copybrief Texture::generateMipmap()
* @return Reference to self (for method chaining)
*
* See @ref Texture::generateMipmap() for more information.
@ -1054,14 +1069,14 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
}
/**
* @copybrief Texture::invalidateImage()
* @brief @copybrief Texture::invalidateImage()
*
* See @ref Texture::invalidateImage() for more information.
*/
void invalidateImage(Int level) { AbstractTexture::invalidateImage(level); }
/**
* @copybrief Texture::invalidateSubImage()
* @brief @copybrief Texture::invalidateSubImage()
*
* Z coordinate is equivalent to number of texture face, i.e.
* @ref Coordinate::PositiveX is `0` and so on, in the same order as in

135
src/Magnum/CubeMapTextureArray.h

@ -43,7 +43,7 @@ namespace Magnum {
See @ref CubeMapTexture documentation for introduction.
## Usage
@section CubeMapTextureArray-usage Usage
See @ref Texture documentation for introduction.
@ -51,7 +51,8 @@ Common usage is to specify each layer and face separately using @ref setSubImage
You have to allocate the memory for all layers and faces first by calling
@ref setStorage(). Example: array with 4 layers of cube maps, each cube map
consisting of six 64x64 images, i.e. 24 layers total:
@code
@code{.cpp}
CubeMapTextureArray texture;
texture.setMagnificationFilter(Sampler::Filter::Linear)
// ...
@ -69,12 +70,13 @@ for(std::size_t i = 0; i != 4; i += 6) {
texture.generateMipmap();
@endcode
In shader, the texture is used via `samplerCubeArray`, `samplerCubeArrayShadow`,
`isamplerCubeArray` or `usamplerCubeArray`. Unlike in classic textures,
coordinates for cube map texture arrays is signed four-part vector. First three
parts define vector from the center of the cube which intersects with one of
the six sides of the cube map, fourth part is layer in the array. See
@ref AbstractShaderProgram for more information about usage in shaders.
In shader, the texture is used via @glsl samplerCubeArray @ce,
@glsl samplerCubeArrayShadow @ce, @glsl isamplerCubeArray @ce or
@glsl usamplerCubeArray @ce. Unlike in classic textures, coordinates for cube
map texture arrays is signed four-part vector. First three parts define vector
from the center of the cube which intersects with one of the six sides of the
cube map, fourth part is layer in the array. See @ref AbstractShaderProgram for
more information about usage in shaders.
@see @ref Renderer::Feature::SeamlessCubeMapTexture, @ref CubeMapTexture,
@ref Texture, @ref TextureArray, @ref RectangleTexture, @ref BufferTexture,
@ -93,14 +95,14 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If @extension{ARB,texture_cube_map_array} (part of
* OpenGL 4.0) is not available, returns zero vector.
* @see @fn_gl{Get} with @def_gl{MAX_CUBE_MAP_TEXTURE_SIZE} and
* @def_gl{MAX_ARRAY_TEXTURE_LAYERS}
* @see @fn_gl{Get} with @def_gl_keyword{MAX_CUBE_MAP_TEXTURE_SIZE} and
* @def_gl_keyword{MAX_ARRAY_TEXTURE_LAYERS}
*/
static Vector3i maxSize();
#ifndef MAGNUM_TARGET_GLES
/**
* @copybrief Texture::compressedBlockSize()
* @brief @copybrief Texture::compressedBlockSize()
*
* See @ref Texture::compressedBlockSize() for more information.
* @requires_gl43 Extension @extension{ARB,internalformat_query2}
@ -112,14 +114,14 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::compressedBlockDataSize()
* @brief @copybrief Texture::compressedBlockDataSize()
*
* See @ref Texture::compressedBlockDataSize() for more information.
* @requires_gl43 Extension @extension{ARB,internalformat_query2}
* @requires_gl Compressed texture queries are not available in OpenGL
* ES.
* @see @ref compressedBlockSize(), @fn_gl{Getinternalformat} with
* @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE}
* @see @ref compressedBlockSize(), @fn_gl_keyword{GetInternalformat}
* with @def_gl_keyword{TEXTURE_COMPRESSED_BLOCK_SIZE}
*/
static Int compressedBlockDataSize(TextureFormat format) {
return AbstractTexture::compressedBlockDataSize(GL_TEXTURE_CUBE_MAP_ARRAY, format);
@ -148,8 +150,8 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* (part of OpenGL 4.5) is not available, the texture is created on
* first use.
* @see @ref CubeMapTextureArray(NoCreateT), @ref wrap(),
* @fn_gl{CreateTextures} with @def_gl{TEXTURE_CUBE_MAP_ARRAY},
* eventually @fn_gl{GenTextures}
* @fn_gl_keyword{CreateTextures} with @def_gl{TEXTURE_CUBE_MAP_ARRAY},
* eventually @fn_gl_keyword{GenTextures}
*/
explicit CubeMapTextureArray():
#ifndef MAGNUM_TARGET_GLES
@ -185,7 +187,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* @param format Image format
*
* Layer is equivalent to layer * 6 + number of texture face, i.e. +X
* is `0` and so on, in order of (+X, -X, +Y, -Y, +Z, -Z).
* is @cpp 0 @ce and so on, in order of (+X, -X, +Y, -Y, +Z, -Z).
* @note This function is meant to be used only internally from
* @ref AbstractShaderProgram subclasses. See its documentation
* for more information.
@ -224,7 +226,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setBaseLevel()
* @brief @copybrief Texture::setBaseLevel()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBaseLevel() for more information.
@ -235,7 +237,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMaxLevel()
* @brief @copybrief Texture::setMaxLevel()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMaxLevel() for more information.
@ -246,7 +248,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMinificationFilter()
* @brief @copybrief Texture::setMinificationFilter()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMinificationFilter() for more information.
@ -257,7 +259,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMagnificationFilter()
* @brief @copybrief Texture::setMagnificationFilter()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMagnificationFilter() for more information.
@ -268,7 +270,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMinLod()
* @brief @copybrief Texture::setMinLod()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMinLod() for more information.
@ -279,7 +281,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMaxLod()
* @brief @copybrief Texture::setMaxLod()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMaxLod() for more information.
@ -291,7 +293,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
#ifndef MAGNUM_TARGET_GLES
/**
* @copybrief Texture::setLodBias()
* @brief @copybrief Texture::setLodBias()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setLodBias() for more information.
@ -305,7 +307,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
#endif
/**
* @copybrief Texture::setWrapping()
* @brief @copybrief Texture::setWrapping()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setWrapping() for more information.
@ -316,7 +318,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setBorderColor(const Color4&)
* @brief @copybrief Texture::setBorderColor(const Color4&)
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Color4&) for more
@ -331,7 +333,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setBorderColor(const Vector4ui&)
* @brief @copybrief Texture::setBorderColor(const Vector4ui&)
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Vector4ui&) for more
@ -356,7 +358,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMaxAnisotropy()
* @brief @copybrief Texture::setMaxAnisotropy()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMaxAnisotropy() for more information.
@ -367,7 +369,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setSRGBDecode()
* @brief @copybrief Texture::setSRGBDecode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setSRGBDecode() for more information.
@ -381,7 +383,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setSwizzle()
* @brief @copybrief Texture::setSwizzle()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setSwizzle() for more information.
@ -393,7 +395,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setCompareMode()
* @brief @copybrief Texture::setCompareMode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompareMode() for more information.
@ -404,7 +406,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setCompareFunction()
* @brief @copybrief Texture::setCompareFunction()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompareFunction() for more information.
@ -415,7 +417,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setDepthStencilMode()
* @brief @copybrief Texture::setDepthStencilMode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setDepthStencilMode() for more information.
@ -427,7 +429,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setStorage()
* @brief @copybrief Texture::setStorage()
* @return Reference to self (for method chaining)
*
* Z coordinate of @p size must be multiple of 6.
@ -441,7 +443,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::imageSize()
* @brief @copybrief Texture::imageSize()
*
* See @ref Texture::imageSize() for more information.
*/
@ -451,7 +453,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
#ifndef MAGNUM_TARGET_GLES
/**
* @copybrief Texture::image(Int, Image&)
* @brief @copybrief Texture::image(Int, Image&)
*
* See @ref Texture::image(Int, Image&) for more information.
* @requires_gl Texture image queries are not available in OpenGL ES.
@ -464,14 +466,15 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
Image3D image(Int level, Image3D&& image);
/**
* @copybrief Texture::image(Int, BufferImage&, BufferUsage)
* @brief @copybrief Texture::image(Int, BufferImage&, BufferUsage)
*
* See @ref Texture::image(Int, BufferImage&, BufferUsage) for more
* information.
@ -485,14 +488,15 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
BufferImage3D image(Int level, BufferImage3D&& image, BufferUsage usage);
/**
* @copybrief Texture::compressedImage(Int, CompressedImage&)
* @brief @copybrief Texture::compressedImage(Int, CompressedImage&)
*
* See @ref Texture::compressedImage(Int, CompressedImage&) for more
* information.
@ -506,14 +510,15 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage3D image = texture.compressedImage(0, {});
* @endcode
*/
CompressedImage3D compressedImage(Int level, CompressedImage3D&& image);
/**
* @copybrief Texture::compressedImage(Int, CompressedBufferImage&, BufferUsage)
* @brief @copybrief Texture::compressedImage(Int, CompressedBufferImage&, BufferUsage)
*
* See @ref Texture::compressedImage(Int, CompressedBufferImage&, BufferUsage)
* for more information.
@ -527,14 +532,15 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage3D image = texture.compressedImage(0, {}, BufferUsage::StaticRead);
* @endcode
*/
CompressedBufferImage3D compressedImage(Int level, CompressedBufferImage3D&& image, BufferUsage usage);
/**
* @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
* @brief @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
*
* See @ref Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
* for more information.
@ -549,14 +555,15 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image3D image = texture.subImage(0, range, {PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
Image3D subImage(Int level, const Range3Di& range, Image3D&& image);
/**
* @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
* @brief @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
*
* See @ref Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
* for more information.
@ -571,14 +578,15 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage3D image = texture.subImage(0, range, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
BufferImage3D subImage(Int level, const Range3Di& range, BufferImage3D&& image, BufferUsage usage);
/**
* @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
* @brief @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
*
* See @ref Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
* for more information.
@ -597,14 +605,15 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage3D image = texture.compressedSubImage(0, range, {});
* @endcode
*/
CompressedImage3D compressedSubImage(Int level, const Range3Di& range, CompressedImage3D&& image);
/**
* @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
* @brief @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
*
* See @ref Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
* for more information.
@ -623,7 +632,8 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage3D image = texture.compressedSubImage(0, range, {}, BufferUsage::StaticRead);
* @endcode
*/
@ -631,7 +641,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
#endif
/**
* @copybrief Texture::setImage()
* @brief @copybrief Texture::setImage()
* @return Reference to self (for method chaining)
*
* Sets texture image data from three-dimensional image for all cube
@ -667,7 +677,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setCompressedImage()
* @brief @copybrief Texture::setCompressedImage()
* @return Reference to self (for method chaining)
*
* Sets texture image data from three-dimensional image for all cube
@ -703,11 +713,12 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setSubImage()
* @brief @copybrief Texture::setSubImage()
* @return Reference to self (for method chaining)
*
* Z coordinate is equivalent to layer * 6 + number of texture face,
* i.e. +X is `0` and so on, in order of (+X, -X, +Y, -Y, +Z, -Z).
* i.e. +X is @cpp 0 @ce and so on, in order of (+X, -X, +Y, -Y, +Z,
* -Z).
*
* See @ref Texture::setSubImage() for more information.
*/
@ -728,11 +739,12 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setCompressedSubImage()
* @brief @copybrief Texture::setCompressedSubImage()
* @return Reference to self (for method chaining)
*
* Z coordinate is equivalent to layer * 6 + number of texture face,
* i.e. +X is `0` and so on, in order of (+X, -X, +Y, -Y, +Z, -Z).
* i.e. +X is @cpp 0 @ce and so on, in order of (+X, -X, +Y, -Y, +Z,
* -Z).
*
* See @ref Texture::setCompressedSubImage() for more information.
*/
@ -753,7 +765,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::generateMipmap()
* @brief @copybrief Texture::generateMipmap()
* @return Reference to self (for method chaining)
*
* See @ref Texture::generateMipmap() for more information.
@ -765,17 +777,18 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::invalidateImage()
* @brief @copybrief Texture::invalidateImage()
*
* See @ref Texture::invalidateImage() for more information.
*/
void invalidateImage(Int level) { AbstractTexture::invalidateImage(level); }
/**
* @copybrief Texture::invalidateSubImage()
* @brief @copybrief Texture::invalidateSubImage()
*
* Z coordinate is equivalent to layer * 6 + number of texture face,
* i.e. +X is `0` and so on, in order of (+X, -X, +Y, -Y, +Z, -Z).
* i.e. +X is @cpp 0 @ce and so on, in order of (+X, -X, +Y, -Y, +Z,
* -Z).
*
* See @ref Texture::invalidateSubImage() for more information.
*/

130
src/Magnum/DebugOutput.h

@ -54,9 +54,9 @@ Manages OpenGL debug output. The debug messages are emitted either from driver
(such as GL error descriptions and various performance and optimization hints)
or from third party software and the application itself using @ref DebugMessage
and @ref DebugGroup, which can be also used to mark various portions of command
stream in various graphics debuggers, such as Apitrace or gDEBugger.
stream in various graphics debuggers, such as ApiTrace or gDEBugger.
## Basic usage
@section Magnum-DebugOutput-usage Basic usage
Support for debug output is provided by OpenGL 4.3 or @extension{KHR,debug}
(desktop/ES extension, covered also by @extension{ANDROID,extension_pack_es31a}).
@ -78,7 +78,7 @@ application itself by setting up message callback using @ref setCallback() or
@ref Renderer::Feature::DebugOutputSynchronous. Example usage, completely with
@ref DebugGroup and @link DebugMessage @endlink:
@code
@code{.cpp}
Renderer::enable(Renderer::Feature::DebugOutput);
Renderer::enable(Renderer::Feature::DebugOutputSynchronous);
DebugOutput::setDefaultCallback();
@ -103,10 +103,12 @@ DebugOutput::setEnabled(DebugOutput::Source::Api, DebugOutput::Type::Other, {131
With default callback the group entering/leaving and the inserted message (and
possibly also other messages) will be printed on standard output:
> Debug output: application debug group enter (42): Scene rendering\n
> Debug output: application marker (1337): Rendering transparent mesh\n
> ...\n
> Debug output: application debug group leave (42): Scene rendering
@code{.shell-session}
Debug output: application debug group enter (42): Scene rendering
Debug output: application marker (1337): Rendering transparent mesh
...
Debug output: application debug group leave (42): Scene rendering
@endcode
If only @extension{EXT,debug_marker} or @extension{GREMEDY,string_marker} are
supported, only user-inserted messages and debug groups are supported and they
@ -133,6 +135,7 @@ class MAGNUM_EXPORT DebugOutput {
* @brief Message source
*
* @see @ref setEnabled()
* @m_enum_values_as_keywords
*/
enum class Source: GLenum {
/** OpenGL */
@ -182,6 +185,7 @@ class MAGNUM_EXPORT DebugOutput {
* @brief Message type
*
* @see @ref setEnabled()
* @m_enum_values_as_keywords
*/
enum class Type: GLenum {
/** OpenGL error */
@ -252,6 +256,7 @@ class MAGNUM_EXPORT DebugOutput {
* @brief Message severity
*
* @see @ref setEnabled()
* @m_enum_values_as_keywords
*/
enum class Severity: GLenum {
/**
@ -302,8 +307,8 @@ class MAGNUM_EXPORT DebugOutput {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If OpenGL 4.3 is not supported and @extension{KHR,debug}
* desktop or ES extension (covered also by @extension{ANDROID,extension_pack_es31a})
* is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_DEBUG_LOGGED_MESSAGES}
* is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_DEBUG_LOGGED_MESSAGES}
*/
static Int maxLoggedMessages();
@ -313,8 +318,8 @@ class MAGNUM_EXPORT DebugOutput {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If OpenGL 4.3 is not supported and @extension{KHR,debug}
* desktop or ES extension (covered also by @extension{ANDROID,extension_pack_es31a})
* is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_DEBUG_MESSAGE_LENGTH}
* is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_DEBUG_MESSAGE_LENGTH}
*/
static Int maxMessageLength();
@ -330,7 +335,8 @@ class MAGNUM_EXPORT DebugOutput {
* If OpenGL 4.3 is not supported and @extension{KHR,debug} desktop or
* ES extension (covered also by @extension{ANDROID,extension_pack_es31a})
* is not available, this function does nothing.
* @see @ref Renderer::Feature::DebugOutput, @fn_gl{DebugMessageControl}
* @see @ref Renderer::Feature::DebugOutput,
* @fn_gl_keyword{DebugMessageControl}
*/
static void setEnabled(Source source, Type type, std::initializer_list<UnsignedInt> ids, bool enabled) {
setEnabledInternal(GLenum(source), GLenum(type), GL_DONT_CARE, ids, enabled);
@ -386,7 +392,7 @@ class MAGNUM_EXPORT DebugOutput {
* available, this function does nothing.
* @see @ref setDefaultCallback(),
* @ref Renderer::Feature::DebugOutputSynchronous,
* @fn_gl{DebugMessageCallback}
* @fn_gl_keyword{DebugMessageCallback}
*/
static void setCallback(Callback callback, const void* userParam = nullptr);
@ -396,12 +402,15 @@ class MAGNUM_EXPORT DebugOutput {
* See @ref setCallback() for more information. The message is printed
* to @ref Corrade::Utility::Debug "Debug" output in the following
* format:
* @code
*
* @code{.cpp}
* DebugMessage::insert(DebugMessage::Source::Application,
* DebugMessage::Type::Marker, 1337, DebugOutput::Severity::Notification, "Hello from OpenGL command stream!");
* @endcode
*
* > Debug output: application marker (1337): Hello from OpenGL command stream!
* @code{.shell-session}
* Debug output: application marker (1337): Hello from OpenGL command stream!
* @endcode
*/
static void setDefaultCallback();
@ -430,10 +439,10 @@ MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugOutput::Severity value);
@brief Debug message
Allows inserting messages GL command stream with labels, useful for example
with conjunction with various graphics debuggers, such as Apitrace or
with conjunction with various graphics debuggers, such as ApiTrace or
gDEBugger.
## Basic usage
@section DebugMessage-usage Basic usage
See @ref DebugOutput for introduction.
@ -442,12 +451,14 @@ If OpenGL 4.3 is supported or @extension{KHR,debug} desktop or ES extension
default debug output callback is enabled for given kind of messages, the
inserted message will be printed on standard output in the following form:
@code
@code{.cpp}
DebugMessage::insert(DebugMessage::Source::Application, DebugMessage::Type::Marker,
1337, DebugOutput::Severity::Notification, "Hello from OpenGL command stream!");
@endcode
> Debug output: application marker (1337): Hello from OpenGL command stream!
@code{.shell-session}
Debug output: application marker (1337): Hello from OpenGL command stream!
@endcode
If only @extension{EXT,debug_marker} or @extension{GREMEDY,string_marker} are
available, the message can be seen only through graphics debugger.
@ -456,14 +467,14 @@ If OpenGL 4.3 is not supported and neither @extension{KHR,debug} nor
@extension{EXT,debug_marker} nor @extension{GREMEDY,string_marker} are
available, the function is essentially a no-op.
## Performance notes
@section DebugMessage-performance-notes Performance notes
If you ensure that you always use the `const char` overload of @ref insert()
and the debug output is either not supported or turned off, the calls will not
result in any allocations and thus won't have any negative performance effects.
If you ensure that you always use the @cpp const char @ce overload of
@ref insert() and the debug output is either not supported or turned off, the
calls will not result in any allocations and thus won't have any negative
performance effects.
@see @ref DebugGroup
@requires_gles Debug output is not available in WebGL.
*/
class MAGNUM_EXPORT DebugMessage {
@ -474,6 +485,7 @@ class MAGNUM_EXPORT DebugMessage {
* @brief Message source
*
* @see @ref insert()
* @todoc use m_enum_values_as_keywords once deprecated values are gone
*/
enum class Source: GLenum {
#ifdef MAGNUM_BUILD_DEPRECATED
@ -493,14 +505,20 @@ class MAGNUM_EXPORT DebugMessage {
ShaderCompiler CORRADE_DEPRECATED_ENUM("use DebugOutput::Source::ShaderCompiler instead") = GLenum(DebugOutput::Source::ShaderCompiler),
#endif
/** External debugger or third-party middleware */
/**
* External debugger or third-party middleware
* @m_keywords{GL_DEBUG_SOURCE_THIRD_PARTY}
*/
#ifndef MAGNUM_TARGET_GLES
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY,
#else
ThirdParty = GL_DEBUG_SOURCE_THIRD_PARTY_KHR,
#endif
/** The application */
/**
* The application
* @m_keywords{GL_DEBUG_SOURCE_APPLICATION}
*/
#ifndef MAGNUM_TARGET_GLES
Application = GL_DEBUG_SOURCE_APPLICATION,
#else
@ -519,6 +537,7 @@ class MAGNUM_EXPORT DebugMessage {
* @brief Message type
*
* @see @ref insert()
* @m_enum_values_as_keywords
*/
enum class Type: GLenum {
/** OpenGL error */
@ -572,32 +591,32 @@ class MAGNUM_EXPORT DebugMessage {
};
#ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief DebugOutput::Severity
/** @brief @copybrief DebugOutput::Severity
* @deprecated Use @ref DebugOutput::Severity instead.
*/
CORRADE_DEPRECATED("use DebugOutput::Severity instead") typedef DebugOutput::Severity Severity;
/** @copybrief DebugOutput::Callback
/** @brief @copybrief DebugOutput::Callback
* @deprecated Use @ref DebugOutput::Callback instead.
*/
/* Can't mark this as deprecated because compiler then complains when I use it as a parameter in setCallback() */
typedef CORRADE_DEPRECATED("use DebugOutput::Callback instead") void(*Callback)(DebugMessage::Source, DebugMessage::Type, UnsignedInt, DebugOutput::Severity, const std::string&, const void*);
/** @copybrief DebugOutput::maxLoggedMessages()
/** @brief @copybrief DebugOutput::maxLoggedMessages()
* @deprecated Use @ref DebugOutput::maxLoggedMessages() instead.
*/
CORRADE_DEPRECATED("use DebugOutput::maxLoggedMessages() instead") static Int maxLoggedMessages() {
return DebugOutput::maxLoggedMessages();
}
/** @copybrief DebugOutput::maxMessageLength()
/** @brief @copybrief DebugOutput::maxMessageLength()
* @deprecated Use @ref DebugOutput::maxMessageLength() instead.
*/
CORRADE_DEPRECATED("use DebugOutput::maxMessageLength() instead") static Int maxMessageLength() {
return DebugOutput::maxMessageLength();
}
/** @copybrief DebugOutput::setEnabled()
/** @brief @copybrief DebugOutput::setEnabled()
* @deprecated Use @ref DebugOutput::setEnabled() instead.
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
@ -632,14 +651,14 @@ class MAGNUM_EXPORT DebugMessage {
}
#endif
/** @copybrief DebugOutput::setCallback()
/** @brief @copybrief DebugOutput::setCallback()
* @deprecated Use @ref DebugOutput::setCallback() instead.
*/
CORRADE_DEPRECATED("use DebugOutput::setCallback() instead") static void setCallback(DebugOutput::Callback callback, const void* userParam = nullptr) {
DebugOutput::setCallback(reinterpret_cast<DebugOutput::Callback>(callback), userParam);
}
/** @copybrief DebugOutput::setDefaultCallback()
/** @brief @copybrief DebugOutput::setDefaultCallback()
* @deprecated Use @ref DebugOutput::setDefaultCallback() instead.
*/
CORRADE_DEPRECATED("use DebugOutput::setDefaultCallback() instead") static void setDefaultCallback() {
@ -664,9 +683,10 @@ class MAGNUM_EXPORT DebugMessage {
* If @extension{KHR,debug} is not available and only @extension{EXT,debug_marker}
* or @extension{GREMEDY,string_marker} are available, only @p string
* is used and all other parameters are ignored.
* @see @ref DebugOutput::maxMessageLength(), @fn_gl{DebugMessageInsert},
* @fn_gl_extension{InsertEventMarker,EXT,debug_marker} or
* @fn_gl_extension{StringMarker,GREMEDY,string_marker}
* @see @ref DebugOutput::maxMessageLength(),
* @fn_gl_keyword{DebugMessageInsert},
* @fn_gl_extension_keyword{InsertEventMarker,EXT,debug_marker} or
* @fn_gl_extension_keyword{StringMarker,GREMEDY,string_marker}
*/
static void insert(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, const std::string& string) {
insertInternal(source, type, id, severity, {string.data(), string.size()});
@ -702,13 +722,14 @@ MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugMessage::Type value);
Allows marking portions of GL command stream with labels, useful for example
with conjunction with various graphics debuggers, such as Apitrace or gDEBugger.
## Basic usage
@section DebugGroup-usage Basic usage
See @ref DebugOutput for introduction.
Easiest way is to push debug group by creating instance and pop it
automatically at the end of scope:
@code
@code{.cpp}
{
// Push debug group
DebugGroup group{DebugGroup::Source::Application, 42, "Scene rendering"};
@ -723,7 +744,8 @@ automatically at the end of scope:
If, for some reason, you need to pop in different scope, you can call @ref push()
and @ref pop() manually:
@code
@code{.cpp}
DebugGroup group;
group.push(DebugGroup::Source::Application, 42, "Scene rendering");
@ -741,8 +763,10 @@ the default debug output callback is enabled for these kinds of messages, the
group entering and leaving will be printed on standard output in the following
form:
> Debug output: application debug group enter (42): Scene rendering\n
> Debug output: application debug group leave (42): Scene rendering
@code{.shell-session}
Debug output: application debug group enter (42): Scene rendering
Debug output: application debug group leave (42): Scene rendering
@endcode
If only @extension{EXT,debug_marker} is available, the group can be seen only
through graphics debugger.
@ -756,7 +780,7 @@ no-op.
similarly for @ref pop(). So if you want to have nested debug groups, you
need to create one instance for each level.
## Interaction with debug output volume control
@section DebugGroup-volume-control Interaction with debug output volume control
Besides putting hierarchical messages in debug output, the group also affects
settings done by @ref DebugOutput::setEnabled(). Entering debug group inherits
@ -767,14 +791,14 @@ to state set in parent debug group. No state is preserved, thus calling
@ref push() after previous @ref pop() will not restore settings done when the
group was active previously.
## Performance notes
@section DebugGroup-performance-notes Performance notes
If you ensure that you always use the `const char` overload of @ref push()
and the debug output is either not supported or turned off, the calls will not
result in any allocations and thus won't have any negative performance effects.
If you ensure that you always use the @cpp const char @ce overload of
@ref push() and the debug output is either not supported or turned off, the
calls will not result in any allocations and thus won't have any negative
performance effects.
@see @ref DebugMessage
@requires_gles Debug output is not available in WebGL.
*/
class MAGNUM_EXPORT DebugGroup {
@ -808,8 +832,8 @@ class MAGNUM_EXPORT DebugGroup {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If OpenGL 4.3 is not supported and @extension{KHR,debug}
* desktop or ES extension (covered also by @extension{ANDROID,extension_pack_es31a})
* is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_DEBUG_GROUP_STACK_DEPTH}
* is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_DEBUG_GROUP_STACK_DEPTH}
*/
static Int maxStackDepth();
@ -857,8 +881,8 @@ class MAGNUM_EXPORT DebugGroup {
* @extension{EXT,debug_marker} is available, only @p message is used
* and all other parameters are ignored.
* @see @ref pop(), @ref maxStackDepth(), @ref DebugOutput::maxMessageLength(),
* @ref Renderer::Error::StackOverflow, @fn_gl{PushDebugGroup} or
* @fn_gl_extension{PushGroupMarker,EXT,debug_marker}
* @ref Renderer::Error::StackOverflow, @fn_gl_keyword{PushDebugGroup}
* or @fn_gl_extension_keyword{PushGroupMarker,EXT,debug_marker}
*/
void push(Source source, UnsignedInt id, const std::string& message) {
pushInternal(source, id, {message.data(), message.size()});
@ -884,8 +908,8 @@ class MAGNUM_EXPORT DebugGroup {
* @extension{EXT,debug_marker} is available, this function does
* nothing.
* @see @ref push(), @ref Renderer::Error::StackUnderflow,
* @fn_gl{PopDebugGroup} or
* @fn_gl_extension{PopGroupMarker,EXT,debug_marker}
* @fn_gl_keyword{PopDebugGroup} or
* @fn_gl_extension_keyword{PopGroupMarker,EXT,debug_marker}
*/
void pop();

58
src/Magnum/DefaultFramebuffer.h

@ -40,14 +40,14 @@ Default framebuffer, i.e. the actual screen surface. It is automatically
created when @ref Context is created and it is available through global
variable @ref defaultFramebuffer.
@anchor DefaultFramebuffer-usage
## Usage
@section DefaultFramebuffer-usage Usage
When you are using only the default framebuffer, the usage is simple. You
must ensure that it is properly resized when application surface is resized,
i.e. you must pass the new size in your @ref Platform::Sdl2Application::viewportEvent() "viewportEvent()"
implementation, for example:
@code
@code{.cpp}
void viewportEvent(const Vector2i& size) override {
defaultFramebuffer.setViewport({{}, size});
@ -58,7 +58,8 @@ void viewportEvent(const Vector2i& size) override {
Next thing you probably want is to clear all used buffers before performing
any drawing in your @ref Platform::Sdl2Application::drawEvent() "drawEvent()"
implementation, for example:
@code
@code{.cpp}
void drawEvent() override {
defaultFramebuffer.clear(FramebufferClear::Color|FramebufferClear::Depth);
@ -69,7 +70,7 @@ void drawEvent() override {
See documentation of particular functions and @ref Framebuffer documentation for
more involved usage, usage of non-default or multiple framebuffers.
## Performance optimizations
@section DefaultFramebuffer-performance-optimizations Performance optimizations
See also @ref AbstractFramebuffer-performance-optimization "relevant section in AbstractFramebuffer".
@ -87,6 +88,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* @brief Status
*
* @see @ref checkStatus()
* @m_enum_values_as_keywords
* @requires_gl30 Extension @extension{ARB,framebuffer_object}
*/
enum class Status: GLenum {
@ -112,6 +114,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* @brief Draw attachment
*
* @see @ref mapForDraw()
* @m_enum_values_as_keywords
* @requires_gles30 Extension @extension{EXT,draw_buffers} in OpenGL
* ES 2.0.
* @requires_webgl20 Extension @webgl_extension{WEBGL,draw_buffers} in
@ -168,6 +171,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* @brief Read attachment
*
* @see @ref mapForRead()
* @m_enum_values_as_keywords
* @requires_gles30 Extension @extension2{NV,read_buffer,GL_NV_read_buffer}
* in OpenGL ES 2.0.
* @requires_webgl20 Framebuffer read mapping is not available in WebGL
@ -249,6 +253,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* @brief Invalidation attachment
*
* @see @ref invalidate()
* @m_enum_values_as_keywords
* @requires_gl43 Extension @extension{ARB,invalidate_subdata}
* @requires_gles30 Extension @extension{EXT,discard_framebuffer} in
* OpenGL ES 2.0.
@ -336,9 +341,9 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* @extension{APPLE,framebuffer_multisample}, @extension{ANGLE,framebuffer_blit}
* or @extension{NV,framebuffer_blit} is available and also on WebGL
* 1.0.
* @see @fn_gl2{CheckNamedFramebufferStatus,CheckFramebufferStatus},
* @fn_gl_extension{CheckNamedFramebufferStatus,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{CheckFramebufferStatus}
* @see @fn_gl2_keyword{CheckNamedFramebufferStatus,CheckFramebufferStatus},
* @fn_gl_extension_keyword{CheckNamedFramebufferStatus,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl_keyword{CheckFramebufferStatus}
* @requires_gl30 Extension @extension{ARB,framebuffer_object}
*/
Status checkStatus(FramebufferTarget target);
@ -349,8 +354,8 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* @param color Value to clear with
* @return Reference to self (for method chaining)
*
* @see @ref clear(), @fn_gl{ClearNamedFramebuffer}, eventually
* @fn_gl{BindFramebuffer}, then @fn_gl{ClearBuffer}
* @see @ref clear(), @fn_gl_keyword{ClearNamedFramebuffer}, eventually
* @fn_gl{BindFramebuffer}, then @fn_gl_keyword{ClearBuffer}
* @requires_gl30 Direct framebuffer clearing is not available in
* OpenGL 2.1.
* @requires_gles30 Direct framebuffer clearing is not available in
@ -373,7 +378,8 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* attachments. Shader outputs which are not listed are not used, you
* can achieve the same by passing @ref DrawAttachment::None as
* attachment. Example usage:
* @code
*
* @code{.cpp}
* defaultFramebuffer.mapForDraw({{MyShader::ColorOutput, DefaultFramebuffer::DrawAttachment::Back},
* {MyShader::NormalOutput, DefaultFramebuffer::DrawAttachment::None}});
* @endcode
@ -383,9 +389,9 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref maxDrawBuffers(), @ref maxDualSourceDrawBuffers(),
* @ref mapForRead(), @fn_gl2{NamedFramebufferDrawBuffers,DrawBuffers},
* @fn_gl_extension{FramebufferDrawBuffers,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{DrawBuffers}
* @ref mapForRead(), @fn_gl2_keyword{NamedFramebufferDrawBuffers,DrawBuffers},
* @fn_gl_extension_keyword{FramebufferDrawBuffers,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl_keyword{DrawBuffers}
* @requires_gles30 Extension @extension{EXT,draw_buffers} in OpenGL
* ES 2.0.
* @requires_webgl20 Extension @webgl_extension{WEBGL,draw_buffers} in
@ -405,10 +411,10 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref mapForRead(), @fn_gl2{NamedFramebufferDrawBuffer,DrawBuffer},
* @fn_gl_extension{FramebufferDrawBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{DrawBuffer} or
* @fn_gl{DrawBuffers} in OpenGL ES 3.0
* @see @ref mapForRead(), @fn_gl2_keyword{NamedFramebufferDrawBuffer,DrawBuffer},
* @fn_gl_extension_keyword{FramebufferDrawBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl_keyword{DrawBuffer}
* or @fn_gl{DrawBuffers} in OpenGL ES 3.0
* @requires_gles30 Extension @extension{EXT,draw_buffers} in OpenGL
* ES 2.0.
* @requires_webgl20 Extension @webgl_extension{WEBGL,draw_buffers} in
@ -426,9 +432,9 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref mapForDraw(), @fn_gl2{NamedFramebufferReadBuffer,ReadBuffer},
* @fn_gl_extension{FramebufferReadBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{ReadBuffer}
* @see @ref mapForDraw(), @fn_gl2_keyword{NamedFramebufferReadBuffer,ReadBuffer},
* @fn_gl_extension_keyword{FramebufferReadBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl_keyword{ReadBuffer}
* @requires_gles30 Extension @extension2{NV,read_buffer,GL_NV_read_buffer}
* in OpenGL ES 2.0.
* @requires_webgl20 Framebuffer read mapping is not available in WebGL
@ -446,9 +452,9 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* If @extension{ARB,direct_state_access} (part of OpenGL 4.5) is not
* available, the framebuffer is bound before the operation (if not
* already).
* @see @fn_gl2{InvalidateNamedFramebufferData,InvalidateFramebuffer},
* eventually @fn_gl{InvalidateFramebuffer} or
* @fn_gl_extension{DiscardFramebuffer,EXT,discard_framebuffer}
* @see @fn_gl2_keyword{InvalidateNamedFramebufferData,InvalidateFramebuffer},
* eventually @fn_gl_keyword{InvalidateFramebuffer} or
* @fn_gl_extension_keyword{DiscardFramebuffer,EXT,discard_framebuffer}
* on OpenGL ES 2.0
* @requires_webgl20 Framebuffer invalidation is not available in WebGL
* 1.0.
@ -468,8 +474,8 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref invalidate(std::initializer_list<InvalidationAttachment>),
* @fn_gl2{InvalidateNamedFramebufferSubData,InvalidateSubFramebuffer},
* eventually @fn_gl{InvalidateSubFramebuffer}
* @fn_gl2_keyword{InvalidateNamedFramebufferSubData,InvalidateSubFramebuffer},
* eventually @fn_gl_keyword{InvalidateSubFramebuffer}
* @requires_gles30 Use @ref invalidate(std::initializer_list<InvalidationAttachment>)
* in OpenGL ES 2.0 instead.
* @requires_webgl20 Framebuffer invalidation is not available in WebGL

6
src/Magnum/DimensionTraits.h

@ -72,7 +72,7 @@ template<UnsignedInt dimensions, class T> struct DimensionTraits {
/**
@brief Vector type for given dimension count and type
Convenience alternative to `typename DimensionTraits<dimensions, T>::VectorType`.
Convenience alternative to @cpp typename DimensionTraits<dimensions, T>::VectorType @ce.
See @ref DimensionTraits::VectorType for more information.
*/
template<UnsignedInt dimensions, class T> using VectorTypeFor = typename DimensionTraits<dimensions, T>::VectorType;
@ -80,7 +80,7 @@ template<UnsignedInt dimensions, class T> using VectorTypeFor = typename Dimensi
/**
@brief Range type for given dimension count and type
Convenience alternative to `typename DimensionTraits<dimensions, T>::RangeType`.
Convenience alternative to @cpp typename DimensionTraits<dimensions, T>::RangeType @ce.
See @ref DimensionTraits::RangeType for more information.
*/
template<UnsignedInt dimensions, class T> using RangeTypeFor = typename DimensionTraits<dimensions, T>::RangeType;
@ -88,7 +88,7 @@ template<UnsignedInt dimensions, class T> using RangeTypeFor = typename Dimensio
/**
@brief Matrix type for given dimension count and type
Convenience alternative to `typename DimensionTraits<dimensions, T>::MatrixType`.
Convenience alternative to @cpp typename DimensionTraits<dimensions, T>::MatrixType @ce.
See @ref DimensionTraits::MatrixType for more information.
*/
template<UnsignedInt dimensions, class T> using MatrixTypeFor = typename DimensionTraits<dimensions, T>::MatrixType;

144
src/Magnum/Framebuffer.h

@ -93,7 +93,7 @@ void drawEvent() {
}
@endcode
## Performance optimizations
@section Framebuffer-performance-optimizations Performance optimizations
See also @ref AbstractFramebuffer-performance-optimization "relevant section in AbstractFramebuffer".
@ -117,6 +117,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @see @ref mapForDraw(), @ref attachRenderbuffer(),
* @ref attachTexture(), @ref attachCubeMapTexture(),
* @ref attachTextureLayer()
* @m_keywords{GL_COLOR_ATTACHMENTn}
* @requires_gles30 Extension @extension{EXT,draw_buffers} or
* @extension{NV,draw_buffers} for @ref mapForDraw() and
* extension @extension{NV,fbo_color_attachments} for `attach*()`
@ -153,7 +154,11 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
*/
class MAGNUM_EXPORT DrawAttachment {
public:
/** @brief No attachment */
/**
* @brief No attachment
*
* @m_keywords{GL_NONE}
*/
static const DrawAttachment None;
/** @brief Color attachment */
@ -181,16 +186,25 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
*/
class MAGNUM_EXPORT BufferAttachment {
public:
/** @brief Depth buffer */
/**
* @brief Depth buffer
*
* @m_keywords{GL_DEPTH_ATTACHMENT}
*/
static const BufferAttachment Depth;
/** @brief Stencil buffer */
/**
* @brief Stencil buffer
*
* @m_keywords{GL_STENCIL_ATTACHMENT}
*/
static const BufferAttachment Stencil;
#if !defined(MAGNUM_TARGET_GLES2) || defined(MAGNUM_TARGET_WEBGL)
/**
* @brief Both depth and stencil buffer
*
* @m_keywords{GL_DEPTH_STENCIL_ATTACHMENT}
* @requires_gles30 Combined depth and stencil attachment is
* not available in OpenGL ES 2.0. Attach the same object
* to both @ref BufferAttachment::Depth and
@ -226,10 +240,18 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
*/
class MAGNUM_EXPORT InvalidationAttachment {
public:
/** @brief Invalidate depth buffer */
/**
* @brief Invalidate depth buffer
*
* @m_keywords{GL_DEPTH_ATTACHMENT}
*/
static const InvalidationAttachment Depth;
/** @brief Invalidate stencil buffer */
/**
* @brief Invalidate stencil buffer
*
* @m_keywords{GL_STENCIL_ATTACHMENT}
*/
static const InvalidationAttachment Stencil;
/** @brief Invalidate color buffer */
@ -250,6 +272,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @brief Status
*
* @see @ref checkStatus()
* @m_enum_values_as_keywords
*/
enum class Status: GLenum {
/** The framebuffer is complete */
@ -318,7 +341,8 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @extension{NV,fbo_color_attachments} extension is available in
* OpenGL ES 2.0 and @webgl_extension{WEBGL,draw_buffers} is not
* available in WebGL 1.0, returns `0`.
* @see @ref mapForDraw(), @fn_gl{Get} with @def_gl{MAX_COLOR_ATTACHMENTS}
* @see @ref mapForDraw(), @fn_gl{Get} with
* @def_gl_keyword{MAX_COLOR_ATTACHMENTS}
*/
static Int maxColorAttachments();
@ -345,7 +369,8 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* (part of OpenGL 4.5) is not available, the framebuffer is created on
* first use.
* @see @ref Framebuffer(NoCreateT), @ref wrap(), @ref setViewport(),
* @fn_gl{CreateFramebuffers}, eventually @fn_gl{GenFramebuffers}
* @fn_gl_keyword{CreateFramebuffers}, eventually
* @fn_gl_keyword{GenFramebuffers}
*/
explicit Framebuffer(const Range2Di& viewport);
@ -373,7 +398,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @brief Destructor
*
* Deletes associated OpenGL framebuffer object.
* @see @ref wrap(), @ref release(), @fn_gl{DeleteFramebuffers}
* @see @ref wrap(), @ref release(), @fn_gl_keyword{DeleteFramebuffers}
*/
~Framebuffer();
@ -407,8 +432,8 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function returns empty string.
* @see @fn_gl{GetObjectLabel} or
* @fn_gl_extension{GetObjectLabel,EXT,debug_label} with
* @see @fn_gl_keyword{GetObjectLabel} or
* @fn_gl_extension_keyword{GetObjectLabel,EXT,debug_label} with
* @def_gl{FRAMEBUFFER}
* @requires_gles Debug output is not available in WebGL.
*/
@ -422,8 +447,8 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function does nothing.
* @see @ref maxLabelLength(), @fn_gl{ObjectLabel} or
* @fn_gl_extension{LabelObject,EXT,debug_label} with
* @see @ref maxLabelLength(), @fn_gl_keyword{ObjectLabel} or
* @fn_gl_extension_keyword{LabelObject,EXT,debug_label} with
* @def_gl{FRAMEBUFFER}
* @requires_gles Debug output is not available in WebGL.
*/
@ -450,9 +475,9 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @extension{APPLE,framebuffer_multisample}, @extension{ANGLE,framebuffer_blit}
* or @extension{NV,framebuffer_blit} is available and also on WebGL
* 1.0.
* @see @fn_gl2{CheckNamedFramebufferStatus,CheckFramebufferStatus},
* @fn_gl_extension{CheckNamedFramebufferStatus,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{CheckFramebufferStatus}
* @see @fn_gl2_keyword{CheckNamedFramebufferStatus,CheckFramebufferStatus},
* @fn_gl_extension_keyword{CheckNamedFramebufferStatus,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl_keyword{CheckFramebufferStatus}
*/
Status checkStatus(FramebufferTarget target);
@ -463,8 +488,8 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @param color Value to clear with
* @return Reference to self (for method chaining)
*
* @see @ref clear(), @fn_gl{ClearNamedFramebuffer}, eventually
* @fn_gl{BindFramebuffer}, then @fn_gl{ClearBuffer}
* @see @ref clear(), @fn_gl_keyword{ClearNamedFramebuffer}, eventually
* @fn_gl{BindFramebuffer}, then @fn_gl_keyword{ClearBuffer}
* @requires_gl30 Direct framebuffer clearing is not available in
* OpenGL 2.1.
* @requires_gles30 Direct framebuffer clearing is not available in
@ -487,7 +512,8 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* color attachment IDs. Shader outputs which are not listed are not
* used, you can achieve the same by passing @ref Framebuffer::DrawAttachment::None
* as color attachment ID. Example usage:
* @code
*
* @code{.cpp}
* framebuffer.mapForDraw({{MyShader::ColorOutput, Framebuffer::ColorAttachment(0)},
* {MyShader::NormalOutput, Framebuffer::DrawAttachment::None}});
* @endcode
@ -498,9 +524,9 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* already).
* @see @ref maxDrawBuffers(), @ref maxDualSourceDrawBuffers(),
* @ref maxColorAttachments(), @ref mapForRead(),
* @fn_gl2{NamedFramebufferDrawBuffers,DrawBuffers},
* @fn_gl_extension{FramebufferDrawBuffers,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{DrawBuffers}
* @fn_gl2_keyword{NamedFramebufferDrawBuffers,DrawBuffers},
* @fn_gl_extension_keyword{FramebufferDrawBuffers,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl_keyword{DrawBuffers}
* @requires_gles30 Extension @extension{EXT,draw_buffers} or
* @extension{NV,draw_buffers} in OpenGL ES 2.0.
* @requires_webgl20 Extension @webgl_extension{WEBGL,draw_buffers} in
@ -521,10 +547,10 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref maxColorAttachments(), @ref mapForRead(),
* @fn_gl2{NamedFramebufferDrawBuffer,DrawBuffer},
* @fn_gl_extension{FramebufferDrawBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{DrawBuffer} (or
* @fn_gl{DrawBuffers} in OpenGL ES)
* @fn_gl2_keyword{NamedFramebufferDrawBuffer,DrawBuffer},
* @fn_gl_extension_keyword{FramebufferDrawBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl_keyword{DrawBuffer}
* (or @fn_gl_keyword{DrawBuffers} in OpenGL ES)
* @requires_gles30 Extension @extension{EXT,draw_buffers} or
* @extension{NV,draw_buffers} in OpenGL ES 2.0.
* @requires_webgl20 Extension @webgl_extension{WEBGL,draw_buffers} in
@ -542,9 +568,9 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref mapForDraw(), @fn_gl2{NamedFramebufferReadBuffer,ReadBuffer},
* @fn_gl_extension{FramebufferReadBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{ReadBuffer}
* @see @ref mapForDraw(), @fn_gl2_keyword{NamedFramebufferReadBuffer,ReadBuffer},
* @fn_gl_extension_keyword{FramebufferReadBuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl_keyword{ReadBuffer}
* @requires_gles30 Extension @extension2{NV,read_buffer,GL_NV_read_buffer}
* in OpenGL ES 2.0.
* @requires_webgl20 Framebuffer read mapping is not available in WebGL
@ -562,9 +588,9 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* If @extension{ARB,direct_state_access} (part of OpenGL 4.5) is not
* available, the framebuffer is bound before the operation (if not
* already).
* @see @fn_gl2{InvalidateNamedFramebufferData,InvalidateFramebuffer},
* eventually @fn_gl{InvalidateFramebuffer} or
* @fn_gl_extension{DiscardFramebuffer,EXT,discard_framebuffer}
* @see @fn_gl2_keyword{InvalidateNamedFramebufferData,InvalidateFramebuffer},
* eventually @fn_gl_keyword{InvalidateFramebuffer} or
* @fn_gl_extension_keyword{DiscardFramebuffer,EXT,discard_framebuffer}
* on OpenGL ES 2.0
* @requires_webgl20 Framebuffer invalidation is not available in WebGL
* 1.0.
@ -584,8 +610,8 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref invalidate(std::initializer_list<InvalidationAttachment>),
* @fn_gl2{InvalidateNamedFramebufferSubData,InvalidateSubFramebuffer},
* eventually @fn_gl{InvalidateSubFramebuffer}
* @fn_gl2_keyword{InvalidateNamedFramebufferSubData,InvalidateSubFramebuffer},
* eventually @fn_gl_keyword{InvalidateSubFramebuffer}
* @requires_gles30 Use @ref invalidate(std::initializer_list<InvalidationAttachment>)
* in OpenGL ES 2.0 instead.
* @requires_webgl20 Framebuffer invalidation is not available in WebGL
@ -604,9 +630,9 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref detach(), @fn_gl2{NamedFramebufferRenderbuffer,FramebufferRenderbuffer},
* @fn_gl_extension{NamedFramebufferRenderbuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{FramebufferRenderbuffer}
* @see @ref detach(), @fn_gl2_keyword{NamedFramebufferRenderbuffer,FramebufferRenderbuffer},
* @fn_gl_extension_keyword{NamedFramebufferRenderbuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl_keyword{FramebufferRenderbuffer}
*/
Framebuffer& attachRenderbuffer(BufferAttachment attachment, Renderbuffer& renderbuffer);
@ -623,10 +649,10 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref detach(), @ref attachCubeMapTexture(),
* @fn_gl2{NamedFramebufferTexture,FramebufferTexture},
* @fn_gl_extension{NamedFramebufferTexture1D,EXT,direct_state_access},
* @fn_gl2_keyword{NamedFramebufferTexture,FramebufferTexture},
* @fn_gl_extension_keyword{NamedFramebufferTexture1D,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and
* @fn_gl2{FramebufferTexture1D,FramebufferTexture}
* @fn_gl2_keyword{FramebufferTexture1D,FramebufferTexture}
* @requires_gl Only 2D and 3D textures are available in OpenGL ES and
* WebGL.
*/
@ -645,10 +671,10 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref detach(), @ref attachCubeMapTexture(),
* @fn_gl2{NamedFramebufferTexture,FramebufferTexture},
* @fn_gl_extension{NamedFramebufferTexture2D,EXT,direct_state_access},
* @fn_gl2_keyword{NamedFramebufferTexture,FramebufferTexture},
* @fn_gl_extension_keyword{NamedFramebufferTexture2D,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and
* @fn_gl2{FramebufferTexture2D,FramebufferTexture}
* @fn_gl2_keyword{FramebufferTexture2D,FramebufferTexture}
* @requires_gles30 Extension @extension{OES,fbo_render_mipmap} to
* render to @p level different than `0` in OpenGL ES 2.0.
* @requires_webgl20 Extension @webgl_extension{OES,fbo_render_mipmap}
@ -688,9 +714,10 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref detach(), @ref attachTexture(),
* @fn_gl2{NamedFramebufferTextureLayer,FramebufferTextureLayer},
* @fn_gl_extension{NamedFramebufferTexture2D,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl2{FramebufferTexture2D,FramebufferTexture}
* @fn_gl2_keyword{NamedFramebufferTextureLayer,FramebufferTextureLayer},
* @fn_gl_extension_keyword{NamedFramebufferTexture2D,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and
* @fn_gl2_keyword{FramebufferTexture2D,FramebufferTexture}
* @requires_gles30 Extension @extension{OES,fbo_render_mipmap} to
* render to @p level different than `0` in OpenGL ES 2.0.
* @requires_webgl20 Extension @webgl_extension{OES,fbo_render_mipmap}
@ -711,11 +738,12 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the framebuffer is bound before the operation (if not
* already).
* @see @ref detach(), @fn_gl2{NamedFramebufferTextureLayer,FramebufferTextureLayer},
* @fn_gl_extension{NamedFramebufferTextureLayer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl2{FramebufferTextureLayer,FramebufferTexture}
* or @fn_gl_extension{FramebufferTexture3D,OES,texture_3D} in
* OpenGL ES 2.0
* @see @ref detach(), @fn_gl2_keyword{NamedFramebufferTextureLayer,FramebufferTextureLayer},
* @fn_gl_extension_keyword{NamedFramebufferTextureLayer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and
* @fn_gl2_keyword{FramebufferTextureLayer,FramebufferTexture}
* or @fn_gl_extension_keyword{FramebufferTexture3D,OES,texture_3D}
* in OpenGL ES 2.0
* @requires_gles30 Extension @extension{OES,texture_3D} in OpenGL
* ES 2.0.
* @requires_gles30 Extension @extension{OES,fbo_render_mipmap} to
@ -778,9 +806,10 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* extension is available, the framebuffer is bound before the
* operation (if not already).
* @see @ref detach(), @ref attachTexture(),
* @fn_gl2{NamedFramebufferTexture,FramebufferTexture},
* @fn_gl_extension{NamedFramebufferTexture,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{FramebufferTexture}
* @fn_gl2_keyword{NamedFramebufferTexture,FramebufferTexture},
* @fn_gl_extension_keyword{NamedFramebufferTexture,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and
* @fn_gl_keyword{FramebufferTexture}
* @requires_gl32 Extension @extension{ARB,geometry_shader4}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_es_extension Extension @extension{ANDROID,extension_pack_es31a}/
@ -850,9 +879,10 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* already).
* @see @ref attachRenderbuffer(), @ref attachTexture(),
* @ref attachCubeMapTexture(), @ref attachTextureLayer(),
* @fn_gl2{NamedFramebufferRenderbuffer,FramebufferRenderbuffer},
* @fn_gl_extension{NamedFramebufferRenderbuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and @fn_gl{FramebufferRenderbuffer}
* @fn_gl2_keyword{NamedFramebufferRenderbuffer,FramebufferRenderbuffer},
* @fn_gl_extension_keyword{NamedFramebufferRenderbuffer,EXT,direct_state_access},
* eventually @fn_gl{BindFramebuffer} and
* @fn_gl_keyword{FramebufferRenderbuffer}
*/
Framebuffer& detach(BufferAttachment attachment);

8
src/Magnum/Image.h

@ -67,7 +67,7 @@ template<UnsignedInt dimensions> class Image {
explicit Image(PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size, Containers::Array<char>&& data) noexcept: Image{{}, format, type, size, std::move(data)} {}
#ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief Image(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&)
/** @brief @copybrief Image(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&)
* @deprecated Use @ref Image(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&)
* instead.
*/
@ -85,8 +85,8 @@ template<UnsignedInt dimensions> class Image {
* @param format Format of pixel data
* @param type Data type of pixel data
*
* Dimensions are set to zero and data pointer to `nullptr`, call
* @ref setData() to fill the image with data or use
* Dimensions are set to zero and data pointer to @cpp nullptr @ce,
* call @ref setData() to fill the image with data or use
* @ref Texture::image() "*Texture::image()"/
* @ref Texture::subImage() "*Texture::subImage()"/
* @ref AbstractFramebuffer::read() "*Framebuffer::read()" to fill the
@ -200,7 +200,7 @@ template<UnsignedInt dimensions> class Image {
}
#ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief setData(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&)
/** @brief @copybrief setData(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&)
* @deprecated Use @ref setData(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::Array<char>&&)
* instead.
*/

2
src/Magnum/ImageFormat.h

@ -41,6 +41,7 @@ namespace Magnum {
@see @ref Texture::bindImage() "*Texture::bindImage()",
@ref Texture::bindImageLayered() "*Texture::bindImageLayered()"
@m_enum_values_as_keywords
@requires_gl42 Extension @extension{ARB,shader_image_load_store}
@requires_gles31 Shader image load/store is not available in OpenGL ES 3.0 and
older.
@ -57,6 +58,7 @@ enum class ImageAccess: GLenum {
@see @ref Texture::bindImage() "*Texture::bindImage()",
@ref Texture::bindImageLayered() "*Texture::bindImageLayered()"
@m_enum_values_as_keywords
@requires_gl42 Extension @extension{ARB,shader_image_load_store}
@requires_gles31 Shader image load/store is not available in OpenGL ES 3.0 and
older.

8
src/Magnum/ImageReference.h

@ -37,24 +37,24 @@ CORRADE_DEPRECATED_FILE("use Magnum/ImageView.h instead")
namespace Magnum {
/** @copybrief ImageView
/** @brief @copybrief ImageView
* @deprecated Use @ref ImageView instead.
*/
#ifndef CORRADE_MSVC2015_COMPATIBILITY /* Multiple definitions still broken */
template<UnsignedInt dimensions> using CORRADE_DEPRECATED_ALIAS("use ImageView instead") ImageReference = ImageView<dimensions>;
#endif
/** @copybrief ImageView1D
/** @brief @copybrief ImageView1D
* @deprecated Use @ref ImageView1D instead.
*/
typedef CORRADE_DEPRECATED("use ImageView1D instead") ImageView1D ImageReference1D;
/** @copybrief ImageView2D
/** @brief @copybrief ImageView2D
* @deprecated Use @ref ImageView2D instead.
*/
typedef CORRADE_DEPRECATED("use ImageView2D instead") ImageView2D ImageReference2D;
/** @copybrief ImageView3D
/** @brief @copybrief ImageView3D
* @deprecated Use @ref ImageView3D instead.
*/
typedef CORRADE_DEPRECATED("use ImageView3D instead") ImageView3D ImageReference3D;

12
src/Magnum/ImageView.h

@ -84,7 +84,7 @@ template<UnsignedInt dimensions> class ImageView {
explicit ImageView(PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size, Containers::ArrayView<const void> data) noexcept: ImageView{{}, format, type, size, data} {}
#ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief ImageView(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<const void>)
/** @brief @copybrief ImageView(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<const void>)
* @deprecated Use @ref ImageView(PixelFormat, PixelType, const VectorTypeFor<dimensions, Int>&, Containers::ArrayView<const void>) instead.
*/
explicit CORRADE_DEPRECATED("use ImageView(PixelFormat, PixelType, const VectorTypeFor&, Containers::ArrayView) instead") ImageView(PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size, const void* data) noexcept: ImageView{{}, format, type, size, {reinterpret_cast<const char*>(data), Implementation::imageDataSizeFor(format, type, size)}} {}
@ -108,8 +108,8 @@ template<UnsignedInt dimensions> class ImageView {
* @param type Data type of pixel data
* @param size Image size
*
* Data pointer is set to `nullptr`, call @ref setData() to fill the
* image with data.
* Data pointer is set to @cpp nullptr @ce, call @ref setData() to fill
* the image with data.
*/
constexpr explicit ImageView(PixelStorage storage, PixelFormat format, PixelType type, const VectorTypeFor<dimensions, Int>& size) noexcept: _storage{storage}, _format{format}, _type{type}, _size{size}, _data{nullptr} {}
@ -168,7 +168,7 @@ template<UnsignedInt dimensions> class ImageView {
}
#ifdef MAGNUM_BUILD_DEPRECATED
/** @copybrief setData(Containers::ArrayView<const void>)
/** @brief @copybrief setData(Containers::ArrayView<const void>)
* @deprecated Use @ref setData(Containers::ArrayView<const void>)
* instead.
*/
@ -262,8 +262,8 @@ template<UnsignedInt dimensions> class CompressedImageView {
* @param format Format of compressed pixel data
* @param size Image size
*
* Data pointer is set to `nullptr`, call @ref setData() to fill the
* image with data.
* Data pointer is set to @cpp nullptr @ce, call @ref setData() to fill
* the image with data.
* @requires_gl42 Extension @extension{ARB,compressed_texture_pixel_storage}
* @requires_gl Compressed pixel storage is hardcoded in OpenGL ES and
* WebGL.

240
src/Magnum/Magnum.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Forward declarations for @ref Magnum namespace
* @brief Forward declarations for the @ref Magnum namespace
*/
#include <Corrade/Utility/Utility.h>
@ -187,10 +187,20 @@ typedef std::uint16_t UnsignedShort;
/** @brief Signed short (16bit) */
typedef std::int16_t Short;
/** @brief Unsigned int (32bit) */
/**
@brief Unsigned int (32bit)
Equivalent to GLSL @glsl uint @ce.
@m_keyword{uint,GLSL uint,}
*/
typedef std::uint32_t UnsignedInt;
/** @brief Signed int (32bit) */
/**
@brief Signed int (32bit)
Equivalent to GLSL @glsl int @ce.
@m_keyword{int,GLSL int,}
*/
typedef std::int32_t Int;
#ifndef MAGNUM_TARGET_WEBGL
@ -209,37 +219,87 @@ typedef std::uint64_t UnsignedLong;
typedef std::int64_t Long;
#endif
/** @brief Float (32bit) */
/**
@brief Float (32bit)
Equivalent to GLSL @glsl float @ce.
@m_keyword{float,GLSL float,}
*/
typedef float Float;
/** @brief Half (16bit) */
typedef Math::Half Half;
/** @brief Two-component float vector */
/**
@brief Two-component float vector
Equivalent to GLSL @glsl vec2 @ce.
@m_keyword{vec2,GLSL vec2,}
*/
typedef Math::Vector2<Float> Vector2;
/** @brief Three-component float vector */
/**
@brief Three-component float vector
Equivalent to GLSL @glsl vec3 @ce.
@m_keyword{vec3,GLSL vec3,}
*/
typedef Math::Vector3<Float> Vector3;
/** @brief Four-component float vector */
/**
@brief Four-component float vector
Equivalent to GLSL @glsl vec4 @ce.
@m_keyword{vec4,GLSL vec4,}
*/
typedef Math::Vector4<Float> Vector4;
/** @brief Two-component unsigned integer vector */
/**
@brief Two-component unsigned integer vector
Equivalent to GLSL @glsl uvec2 @ce.
@m_keyword{uvec2,GLSL uvec2,}
*/
typedef Math::Vector2<UnsignedInt> Vector2ui;
/** @brief Three-component unsigned integer vector */
/**
@brief Three-component unsigned integer vector
Equivalent to GLSL @glsl uvec3 @ce.
@m_keyword{uvec3,GLSL uvec3,}
*/
typedef Math::Vector3<UnsignedInt> Vector3ui;
/** @brief Four-component unsigned integer vector */
/**
@brief Four-component unsigned integer vector
Equivalent to GLSL @glsl uvec4 @ce.
@m_keyword{uvec4,GLSL uvec4,}
*/
typedef Math::Vector4<UnsignedInt> Vector4ui;
/** @brief Two-component signed integer vector */
/**
@brief Two-component signed integer vector
Equivalent to GLSL @glsl ivec2 @ce.
@m_keyword{ivec2,GLSL ivec2,}
*/
typedef Math::Vector2<Int> Vector2i;
/** @brief Three-component signed integer vector */
/**
@brief Three-component signed integer vector
Equivalent to GLSL @glsl ivec3 @ce.
@m_keyword{ivec3,GLSL ivec3,}
*/
typedef Math::Vector3<Int> Vector3i;
/** @brief Four-component signed integer vector */
/**
@brief Four-component signed integer vector
Equivalent to GLSL @glsl ivec4 @ce.
@m_keyword{ivec4,GLSL ivec4,}
*/
typedef Math::Vector4<Int> Vector4i;
/** @brief Three-component (RGB) float color */
@ -271,52 +331,93 @@ typedef Math::Color4<UnsignedByte> Color4ub;
/**
@brief 3x3 float transformation matrix
Equivalent to GLSL @glsl mat3 @ce.
@see @ref Matrix3x3
@m_keyword{mat3,GLSL mat3,}
*/
typedef Math::Matrix3<Float> Matrix3;
/**
@brief 4x4 float transformation matrix
Equivalent to GLSL @glsl mat4 @ce.
@see @ref Matrix4x4
@m_keyword{mat4,GLSL mat4,}
*/
typedef Math::Matrix4<Float> Matrix4;
/** @brief 2x2 float matrix */
/**
@brief 2x2 float matrix
Equivalent to GLSL @glsl mat2x2 @ce.
@m_keyword{mat2x2,GLSL mat2x2,}
*/
typedef Math::Matrix2x2<Float> Matrix2x2;
/**
@brief 3x3 float matrix
Note that this is different from @ref Matrix3, which contains additional
functions for transformations in 2D.
Equivalent to GLSL @glsl mat3x3 @ce. Note that this is different from
@ref Matrix3, which contains additional functions for transformations in 2D.
@m_keyword{mat3x3,GLSL mat3x3,}
*/
typedef Math::Matrix3x3<Float> Matrix3x3;
/**
@brief 4x4 float matrix
Note that this is different from @ref Matrix4, which contains additional
functions for transformations in 3D.
Equivalent to GLSL @glsl mat4x4 @ce. Note that this is different from
@ref Matrix4, which contains additional functions for transformations in 3D.
@m_keyword{mat4x4,GLSL mat4x4,}
*/
typedef Math::Matrix4x4<Float> Matrix4x4;
/** @brief Float matrix with 2 columns and 3 rows */
/**
@brief Float matrix with 2 columns and 3 rows
Equivalent to GLSL @glsl mat2x3 @ce.
@m_keyword{mat2x3,GLSL mat2x3,}
*/
typedef Math::Matrix2x3<Float> Matrix2x3;
/** @brief Float matrix with 3 columns and 2 rows */
/**
@brief Float matrix with 3 columns and 2 rows
Equivalent to GLSL @glsl mat3x2 @ce.
@m_keyword{mat3x2,GLSL mat3x2,}
*/
typedef Math::Matrix3x2<Float> Matrix3x2;
/** @brief Float matrix with 2 columns and 4 rows */
/**
@brief Float matrix with 2 columns and 4 rows
Equivalent to GLSL @glsl mat2x4 @ce.
@m_keyword{mat2x4,GLSL mat2x4,}
*/
typedef Math::Matrix2x4<Float> Matrix2x4;
/** @brief Float matrix with 4 columns and 2 rows */
/**
@brief Float matrix with 4 columns and 2 rows
Equivalent to GLSL @glsl mat2x4 @ce.
@m_keyword{mat2x4,GLSL mat2x4,}
*/
typedef Math::Matrix4x2<Float> Matrix4x2;
/** @brief Float matrix with 3 columns and 4 rows */
/**
@brief Float matrix with 3 columns and 4 rows
Equivalent to GLSL @glsl mat3x4 @ce.
@m_keyword{mat3x4,GLSL mat3x4,}
*/
typedef Math::Matrix3x4<Float> Matrix3x4;
/** @brief Float matrix with 4 columns and 3 rows */
/**
@brief Float matrix with 4 columns and 3 rows
Equivalent to GLSL @glsl mat4x3 @ce.
@m_keyword{mat4x3,GLSL mat4x3,}
*/
typedef Math::Matrix4x3<Float> Matrix4x3;
/** @brief Float two-dimensional quadratic Bézier curve */
@ -380,67 +481,128 @@ typedef Math::Frustum<Float> Frustum;
See @ref types for more information.
*/
/** @brief Double (64bit) */
/**
@brief Double (64bit)
Equivalent to GLSL @glsl double @ce.
@m_keyword{double,GLSL double,}
*/
typedef double Double;
/** @brief Two-component double vector */
/**
@brief Two-component double vector
Equivalent to GLSL @glsl dvec2 @ce.
@m_keyword{dvec2,GLSL dvec2,}
*/
typedef Math::Vector2<Double> Vector2d;
/** @brief Three-component double vector */
/**
@brief Three-component double vector
Equivalent to GLSL @glsl dvec3 @ce.
@m_keyword{dvec3,GLSL dvec3,}
*/
typedef Math::Vector3<Double> Vector3d;
/** @brief Four-component double vector */
/**
@brief Four-component double vector
Equivalent to GLSL @glsl dvec4 @ce.
@m_keyword{dvec4,GLSL dvec4,}
*/
typedef Math::Vector4<Double> Vector4d;
/**
@brief 3x3 double transformation matrix
Equivalent to GLSL @glsl dmat3 @ce.
@see @ref Matrix3x3d
@m_keyword{dmat3,GLSL dmat3,}
*/
typedef Math::Matrix3<Double> Matrix3d;
/**
@brief 4x4 double transformation matrix
Equivalent to GLSL @glsl dmat4 @ce.
@see @ref Matrix4x4d
@m_keyword{dmat4,GLSL dmat4,}
*/
typedef Math::Matrix4<Double> Matrix4d;
/** @brief 2x2 double matrix */
/**
@brief 2x2 double matrix
Equivalent to GLSL @glsl dmat2x2 @ce.
@m_keyword{dmat2x2,GLSL dmat2x2,}
*/
typedef Math::Matrix2x2<Double> Matrix2x2d;
/**
@brief 3x3 double matrix
Note that this is different from @ref Matrix3d, which contains additional
functions for transformations in 2D.
Equivalent to GLSL @glsl dmat3x3 @ce. Note that this is different from
@ref Matrix3d, which contains additional functions for transformations in 2D.
@m_keyword{dmat3x3,GLSL dmat3x3,}
*/
typedef Math::Matrix3x3<Double> Matrix3x3d;
/**
@brief 4x4 double matrix
Note that this is different from @ref Matrix4d, which contains additional
functions for transformations in 3D.
Equivalent to GLSL @glsl dmat4x4 @ce. Note that this is different from
@ref Matrix4d, which contains additional functions for transformations in 3D.
@m_keyword{dmat4x4,GLSL dmat4x4,}
*/
typedef Math::Matrix4x4<Double> Matrix4x4d;
/** @brief Double matrix with 2 columns and 3 rows */
/**
@brief Double matrix with 2 columns and 3 rows
Equivalent to GLSL @glsl dmat2x3 @ce.
@m_keyword{dmat2x3,GLSL dmat2x3,}
*/
typedef Math::Matrix2x3<Double> Matrix2x3d;
/** @brief Double matrix with 3 columns and 2 rows */
/**
@brief Double matrix with 3 columns and 2 rows
Equivalent to GLSL @glsl dmat3x2 @ce.
@m_keyword{dmat3x2,GLSL dmat3x2,}
*/
typedef Math::Matrix3x2<Double> Matrix3x2d;
/** @brief Double matrix with 2 columns and 4 rows */
/**
@brief Double matrix with 2 columns and 4 rows
Equivalent to GLSL @glsl dmat2x4 @ce.
@m_keyword{dmat2x4,GLSL dmat2x4,}
*/
typedef Math::Matrix2x4<Double> Matrix2x4d;
/** @brief Double matrix with 4 columns and 2 rows */
/**
@brief Double matrix with 4 columns and 2 rows
Equivalent to GLSL @glsl dmat4x2 @ce.
@m_keyword{dmat4x2,GLSL dmat4x2,}
*/
typedef Math::Matrix4x2<Double> Matrix4x2d;
/** @brief Double matrix with 3 columns and 4 rows */
/**
@brief Double matrix with 3 columns and 4 rows
Equivalent to GLSL @glsl dmat3x4 @ce.
@m_keyword{dmat3x4,GLSL dmat3x4,}
*/
typedef Math::Matrix3x4<Double> Matrix3x4d;
/** @brief Double matrix with 4 columns and 3 rows */
/**
@brief Double matrix with 4 columns and 3 rows
Equivalent to GLSL @glsl dmat4x3 @ce.
@m_keyword{dmat4x3,GLSL dmat4x3,}
*/
typedef Math::Matrix4x3<Double> Matrix4x3d;
/** @brief Double two-dimensional quadratic Bézier curve */

170
src/Magnum/Mesh.h

@ -47,6 +47,7 @@ namespace Magnum {
* @brief Mesh primitive type
*
* @see @ref Mesh::primitive(), @ref Mesh::setPrimitive()
* @m_enum_values_as_keywords
*/
enum class MeshPrimitive: GLenum {
/** Single points. */
@ -128,8 +129,7 @@ namespace Implementation { struct MeshState; }
/**
@brief Mesh
@anchor Mesh-configuration
## Mesh configuration
@section Mesh-configuration Mesh configuration
You have to specify at least primitive and vertex/index count using
@ref setPrimitive() and @ref setCount(). Then fill your vertex buffers with
@ -154,11 +154,11 @@ different usage) or store data for more meshes in one buffer.
If vertex/index count or instance count is zero, the mesh is empty and no draw
commands are issued when calling @ref draw().
### Example mesh configuration
@subsection Mesh-configuration-example Example mesh configuration
#### Basic non-indexed mesh
@subsubsection Mesh-configuration-example-basic Basic non-indexed mesh
@code
@code{.cpp}
// Custom shader, needing only position data
class MyShader: public AbstractShaderProgram {
public:
@ -181,9 +181,9 @@ mesh.setPrimitive(MeshPrimitive::Triangles)
.addVertexBuffer(vertexBuffer, 0, MyShader::Position{});
@endcode
#### Interleaved vertex data
@subsubsection Mesh-configuration-interleaved Interleaved vertex data
@code
@code{.cpp}
// Non-indexed primitive with positions and normals
Trade::MeshData3D plane = Primitives::Plane::solid();
@ -198,9 +198,9 @@ mesh.setPrimitive(plane.primitive())
.addVertexBuffer(buffer, 0, Shaders::Phong::Position{}, Shaders::Phong::Normal{});
@endcode
#### Indexed mesh
@subsubsection Mesh-configuration-indexed Indexed mesh
@code
@code{.cpp}
// Custom shader
class MyShader: public AbstractShaderProgram {
public:
@ -233,7 +233,7 @@ mesh.setPrimitive(MeshPrimitive::Triangles)
Or using @ref MeshTools::interleave() and @ref MeshTools::compressIndices():
@code
@code{.cpp}
// Indexed primitive
Trade::MeshData3D cube = Primitives::Cube::solid();
@ -262,9 +262,9 @@ mesh.setPrimitive(plane.primitive())
Or, if you plan to use the mesh with stock shaders, you can just use
@ref MeshTools::compile().
#### Specific formats of vertex data
@subsubsection Mesh-configuration-formats Specific formats of vertex data
@code
@code{.cpp}
// Custom shader with colors specified as four floating-point values
class MyShader: public AbstractShaderProgram {
public:
@ -308,8 +308,7 @@ mesh.addVertexBuffer(colorBuffer, 0, MyShader::Color{
MyShader::Color::DataOption::Normalized});
@endcode
@anchor Mesh-configuration-dynamic
#### Dynamically specified attributes
@subsubsection Mesh-configuration-dynamic Dynamically specified attributes
In some cases, for example when the shader code is fully generated at runtime,
it's not possible to know attribute locations and types at compile time. In
@ -318,7 +317,8 @@ that case, there are overloads of @ref addVertexBuffer() and
@ref Attribute typedefs. Adding a RGB attribute at location 3 normalized from
unsigned byte to float with one byte padding at the end could then look like
this:
@code
@code{.cpp}
mesh.addVertexBuffer(colorBuffer, 0, 4, DynamicAttribute{
DynamicAttribute::Kind::GenericNormalized, 3,
DynamicAttribute::Components::Three,
@ -326,30 +326,29 @@ mesh.addVertexBuffer(colorBuffer, 0, 4, DynamicAttribute{
});
@endcode
## Rendering meshes
@section Mesh-rendering Rendering meshes
Basic workflow is: bind specific framebuffer for drawing (if needed), set up
respective shader (see
@ref AbstractShaderProgram-rendering-workflow "AbstractShaderProgram documentation"
for more infromation) and call @ref Mesh::draw().
## WebGL restrictions
@section Mesh-webgl-restrictions WebGL restrictions
@ref MAGNUM_TARGET_WEBGL "WebGL" puts some restrictions on vertex buffer
layout, see @ref addVertexBuffer() documentation for details.
@anchor Mesh-performance-optimization
## Performance optimizations
@section Mesh-performance-optimization Performance optimizations
If @extension{ARB,vertex_array_object} (part of OpenGL 3.0), OpenGL ES 3.0,
WebGL 2.0, @extension{OES,vertex_array_object} in OpenGL ES 2.0 or
@webgl_extension{OES,vertex_array_object} in WebGL 1.0 is supported, VAOs are
used instead of binding the buffers and specifying vertex attribute pointers
in each @ref draw() call. The engine tracks currently bound VAO and currently
active shader program to avoid unnecessary calls to @fn_gl{BindVertexArray} and
@fn_gl{UseProgram}. Mesh limits and implementation-defined values (such as
@ref maxElementIndex()) are cached, so repeated queries don't result in
repeated @fn_gl{Get} calls.
active shader program to avoid unnecessary calls to @fn_gl_keyword{BindVertexArray}
and @fn_gl_keyword{UseProgram}. Mesh limits and implementation-defined values
(such as @ref maxElementIndex()) are cached, so repeated queries don't result
in repeated @fn_gl{Get} calls.
If @extension{EXT,direct_state_access} desktop extension and VAOs are
available, DSA functions are used for specifying attribute locations to avoid
@ -369,6 +368,7 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* @brief Index type
*
* @see @ref setIndexBuffer(), @ref indexSize()
* @m_enum_values_as_keywords
*/
enum class IndexType: GLenum {
UnsignedByte = GL_UNSIGNED_BYTE, /**< Unsigned byte */
@ -386,7 +386,7 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief AbstractShaderProgram::maxVertexAttributes()
* @brief @copybrief AbstractShaderProgram::maxVertexAttributes()
* @deprecated Use @ref AbstractShaderProgram::maxVertexAttributes() instead.
*/
CORRADE_DEPRECATED("use AbstractShaderProgram::maxVertexAttributes() instead") static Int maxVertexAttributes();
@ -399,8 +399,9 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,ES3_compatibility} (part
* of OpenGL 4.3) is not available, returns max representable 32-bit
* value (@f$ 2^32 - 1 @f$).
* @see @ref setIndexBuffer(), @fn_gl{Get} with @def_gl{MAX_ELEMENT_INDEX}
* value (@cpp 0xffffffffu @ce).
* @see @ref setIndexBuffer(), @fn_gl{Get} with
* @def_gl_keyword{MAX_ELEMENT_INDEX}
* @requires_gles30 No upper limit is specified for index values in
* OpenGL ES 2.0.
* @requires_webgl20 No upper limit is specified for index values in
@ -417,7 +418,8 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls.
* @see @ref setIndexBuffer(), @fn_gl{Get} with @def_gl{MAX_ELEMENTS_INDICES}
* @see @ref setIndexBuffer(), @fn_gl{Get} with
* @def_gl_keyword{MAX_ELEMENTS_INDICES}
* @requires_gles30 Ranged element draw is not supported in OpenGL ES
* 2.0.
* @requires_webgl20 Ranged element draw is not supported in WebGL 1.0.
@ -429,7 +431,8 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls.
* @see @ref setIndexBuffer(), @fn_gl{Get} with @def_gl{MAX_ELEMENTS_VERTICES}
* @see @ref setIndexBuffer(), @fn_gl{Get} with
* @def_gl_keyword{MAX_ELEMENTS_VERTICES}
* @requires_gles30 Ranged element draw is not supported in OpenGL ES
* 2.0.
* @requires_webgl20 Ranged element draw is not supported in WebGL 1.0.
@ -477,12 +480,12 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* If @extension{ARB,vertex_array_object} (part of OpenGL 3.0), OpenGL
* ES 3.0, WebGL 2.0, @extension{OES,vertex_array_object} in OpenGL
* ES 2.0 or @webgl_extension{OES,vertex_array_object} in WebGL 1.0 is
* available, vertex array object is created. If @extension{ARB,direct_state_access}
* (part of OpenGL 4.5) is not available, the vertex array object is
* created on first use.
* available, vertex array object is created. If
* @extension{ARB,direct_state_access} (part of OpenGL 4.5) is not
* available, the vertex array object is created on first use.
* @see @ref Mesh(NoCreateT), @ref wrap(), @ref setPrimitive(),
* @ref setCount(), @fn_gl{CreateVertexArrays}, eventually
* @fn_gl{GenVertexArrays}
* @ref setCount(), @fn_gl_keyword{CreateVertexArrays}, eventually
* @fn_gl_keyword{GenVertexArrays}
*/
explicit Mesh(MeshPrimitive primitive = MeshPrimitive::Triangles);
@ -512,7 +515,7 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* ES 3.0, WebGL 2.0, @extension{OES,vertex_array_object} in OpenGL
* ES 2.0 or @webgl_extension{OES,vertex_array_object} in WebGL 1.0 is
* available, associated vertex array object is deleted.
* @see @ref wrap(), @ref release(), @fn_gl{DeleteVertexArrays}
* @see @ref wrap(), @ref release(), @fn_gl_keyword{DeleteVertexArrays}
*/
~Mesh();
@ -556,8 +559,8 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function returns empty string.
* @see @fn_gl{GetObjectLabel} with @def_gl{VERTEX_ARRAY} or
* @fn_gl_extension{GetObjectLabel,EXT,debug_label} with
* @see @fn_gl_keyword{GetObjectLabel} with @def_gl{VERTEX_ARRAY} or
* @fn_gl_extension_keyword{GetObjectLabel,EXT,debug_label} with
* @def_gl{VERTEX_ARRAY_OBJECT_EXT}
* @requires_gles Debug output is not available in WebGL.
*/
@ -571,8 +574,8 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function does nothing.
* @see @ref maxLabelLength(), @fn_gl{ObjectLabel} with
* @def_gl{VERTEX_ARRAY} or @fn_gl_extension{LabelObject,EXT,debug_label}
* @see @ref maxLabelLength(), @fn_gl_keyword{ObjectLabel} with
* @def_gl{VERTEX_ARRAY} or @fn_gl_extension_keyword{LabelObject,EXT,debug_label}
* with @def_gl{VERTEX_ARRAY_OBJECT_EXT}
* @requires_gles Debug output is not available in WebGL.
*/
@ -622,10 +625,10 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* @return Reference to self (for method chaining)
*
* If the mesh is indexed, the value is treated as index count,
* otherwise the value is vertex count. If set to `0`, no draw commands
* are issued when calling @ref draw(AbstractShaderProgram&). Ignored
* when calling @ref draw(AbstractShaderProgram&, TransformFeedback&, UnsignedInt).
* Default is `0`.
* otherwise the value is vertex count. If set to @cpp 0 @ce, no draw
* commands are issued when calling @ref draw(AbstractShaderProgram&).
* Ignored when calling @ref draw(AbstractShaderProgram&, TransformFeedback&, UnsignedInt).
* Default is @cpp 0 @ce.
* @see @ref isIndexed(), @ref setBaseVertex(), @ref setInstanceCount()
*/
Mesh& setCount(Int count) {
@ -643,7 +646,7 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* Sets number of vertices of which the vertex buffer will be offset
* when drawing. Ignored when calling
* @ref draw(AbstractShaderProgram&, TransformFeedback&, UnsignedInt).
* Default is `0`.
* Default is @cpp 0 @ce.
* @see @ref setCount(), @ref setBaseInstance()
* @requires_gl32 Extension @extension{ARB,draw_elements_base_vertex}
* for indexed meshes
@ -662,11 +665,11 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* @brief Set instance count
* @return Reference to self (for method chaining)
*
* If set to `1`, non-instanced draw commands are issued when calling
* @ref draw(AbstractShaderProgram&) or
* If set to @cpp 1 @ce, non-instanced draw commands are issued when
* calling @ref draw(AbstractShaderProgram&) or
* @ref draw(AbstractShaderProgram&, TransformFeedback&, UnsignedInt).
* If set to `0`, no draw commands are issued altogether. Default is
* `1`.
* If set to @cpp 0 @ce, no draw commands are issued at all. Default is
* @cpp 1 @ce.
* @see @ref setBaseInstance(), @ref setCount(),
* @ref addVertexBufferInstanced()
* @requires_gl31 Extension @extension{ARB,draw_instanced} if using
@ -693,7 +696,7 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* @return Reference to self (for method chaining)
*
* Ignored when calling @ref draw(AbstractShaderProgram&, TransformFeedback&, UnsignedInt).
* Default is `0`.
* Default is @cpp 0 @ce.
* @see @ref setInstanceCount(), @ref setBaseVertex()
* @requires_gl42 Extension @extension{ARB,base_instance}
* @requires_gl Base instance cannot be specified in OpenGL ES or
@ -722,7 +725,8 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* want to draw it with @ref Shaders::Phong, but it accepts only
* position and normal, so you have to skip weight and texture
* coordinate in each vertex:
* @code
*
* @code{.cpp}
* Buffer buffer;
* Mesh mesh;
* mesh.addVertexBuffer(buffer, 76, // initial array offset
@ -736,7 +740,8 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* more times with explicitly specified gaps before and after the
* attributes. This can be used for e.g. runtime-dependent
* configuration, as it isn't dependent on the variadic template:
* @code
*
* @code{.cpp}
* mesh.addVertexBuffer(buffer, 76, 4, Shaders::Phong::Position(), 20)
* .addVertexBuffer(buffer, 76, 24, Shaders::Phong::Normal(), 0);
* @endcode
@ -746,7 +751,8 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* be done by specifying one attribute at a time with specific offset.
* Above example with weight, position, texture coordinate and normal
* arrays one after another (non-interleaved):
* @code
*
* @code{.cpp}
* Int vertexCount = 352;
* mesh.addVertexBuffer(buffer, 76 + 4*vertexCount, Shaders::Phong::Position())
* .addVertexBuffer(buffer, 76 + 24*vertexCount, Shaders::Phong::Normal());
@ -762,11 +768,11 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* mesh and delete it afterwards.
*
* @see @ref addVertexBufferInstanced(), @ref setPrimitive(),
* @ref setCount(), @fn_gl{BindVertexArray},
* @fn_gl{EnableVertexAttribArray}, @fn_gl{BindBuffer},
* @fn_gl{VertexAttribPointer} or
* @ref setCount(), @fn_gl_keyword{BindVertexArray},
* @fn_gl_keyword{EnableVertexAttribArray}, @fn_gl{BindBuffer},
* @fn_gl_keyword{VertexAttribPointer} or
* @fn_gl_extension{EnableVertexArrayAttrib,EXT,direct_state_access},
* @fn_gl_extension{VertexArrayVertexAttribOffset,EXT,direct_state_access}
* @fn_gl_extension_keyword{VertexArrayVertexAttribOffset,EXT,direct_state_access}
* @requires_gles In WebGL the data must be properly aligned (e.g. all
* float data must start at addresses divisible by four). Also the
* maximum stride of attribute data must be at most 255 bytes.
@ -784,7 +790,7 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
*
* Similar to the above function, the @p divisor parameter specifies
* number of instances that will pass until new data are fetched from
* the buffer. Setting it to `0` is equivalent to calling
* the buffer. Setting it to @cpp 0 @ce is equivalent to calling
* @ref addVertexBuffer().
*
* If @extension{ARB,vertex_array_object} (part of OpenGL 3.0), OpenGL
@ -794,12 +800,12 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
*
* @see @ref setPrimitive(), @ref setCount(), @ref setInstanceCount(),
* @ref setBaseInstance(),
* @fn_gl{BindVertexArray}, @fn_gl{EnableVertexAttribArray},
* @fn_gl{BindBuffer}, @fn_gl{VertexAttribPointer},
* @fn_gl{VertexAttribDivisor} or
* @fn_gl_extension{EnableVertexArrayAttrib,EXT,direct_state_access},
* @fn_gl_extension{VertexArrayVertexAttribOffset,EXT,direct_state_access},
* @fn_gl_extension{VertexArrayVertexAttribDivisor,EXT,direct_state_access}
* @fn_gl{BindVertexArray}, @fn_gl_keyword{EnableVertexAttribArray},
* @fn_gl{BindBuffer}, @fn_gl_keyword{VertexAttribPointer},
* @fn_gl_keyword{VertexAttribDivisor} or
* @fn_gl_extension_keyword{EnableVertexArrayAttrib,EXT,direct_state_access},
* @fn_gl_extension_keyword{VertexArrayVertexAttribOffset,EXT,direct_state_access},
* @fn_gl_extension_keyword{VertexArrayVertexAttribDivisor,EXT,direct_state_access}
* @requires_gl33 Extension @extension{ARB,instanced_arrays}
* @requires_gles30 Extension @extension{ANGLE,instanced_arrays},
* @extension{EXT,instanced_arrays} or
@ -849,8 +855,8 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
*
* The smaller range is specified with @p start and @p end the less
* memory operations are needed (and possibly some optimizations),
* improving draw performance. Specifying `0` for both parameters
* behaves the same as @ref setIndexBuffer(Buffer&, GLintptr, IndexType).
* improving draw performance. Specifying @cpp 0 @ce for both
* parameters behaves the same as @ref setIndexBuffer(Buffer&, GLintptr, IndexType).
* On OpenGL ES 2.0 this function behaves always as
* @ref setIndexBuffer(Buffer&, GLintptr, IndexType), as this
* functionality is not available there.
@ -900,16 +906,16 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* @ref draw(AbstractShaderProgram&, TransformFeedback&, UnsignedInt),
* @ref MeshView::draw(AbstractShaderProgram&),
* @ref MeshView::draw(AbstractShaderProgram&, std::initializer_list<std::reference_wrapper<MeshView>>),
* @fn_gl{UseProgram}, @fn_gl{EnableVertexAttribArray},
* @fn_gl{BindBuffer}, @fn_gl{VertexAttribPointer},
* @fn_gl{DisableVertexAttribArray} or @fn_gl{BindVertexArray},
* @fn_gl{DrawArrays}/@fn_gl{DrawArraysInstanced}/
* @fn_gl{DrawArraysInstancedBaseInstance} or @fn_gl{DrawElements}/
* @fn_gl{DrawRangeElements}/@fn_gl{DrawElementsBaseVertex}/
* @fn_gl{DrawRangeElementsBaseVertex}/@fn_gl{DrawElementsInstanced}/
* @fn_gl{DrawElementsInstancedBaseInstance}/
* @fn_gl{DrawElementsInstancedBaseVertex}/
* @fn_gl{DrawElementsInstancedBaseVertexBaseInstance}
* @fn_gl_keyword{UseProgram}, @fn_gl_keyword{EnableVertexAttribArray},
* @fn_gl{BindBuffer}, @fn_gl_keyword{VertexAttribPointer},
* @fn_gl_keyword{DisableVertexAttribArray} or @fn_gl_keyword{BindVertexArray},
* @fn_gl_keyword{DrawArrays}/@fn_gl_keyword{DrawArraysInstanced}/
* @fn_gl_keyword{DrawArraysInstancedBaseInstance} or @fn_gl_keyword{DrawElements}/
* @fn_gl_keyword{DrawRangeElements}/@fn_gl_keyword{DrawElementsBaseVertex}/
* @fn_gl_keyword{DrawRangeElementsBaseVertex}/@fn_gl_keyword{DrawElementsInstanced}/
* @fn_gl_keyword{DrawElementsInstancedBaseInstance}/
* @fn_gl_keyword{DrawElementsInstancedBaseVertex}/
* @fn_gl_keyword{DrawElementsInstancedBaseVertexBaseInstance}
* @requires_gl32 Extension @extension{ARB,draw_elements_base_vertex}
* if the mesh is indexed and @ref baseVertex() is not `0`.
* @requires_gl33 Extension @extension{ARB,instanced_arrays} if
@ -940,17 +946,17 @@ class MAGNUM_EXPORT Mesh: public AbstractObject {
* buffers in this mesh. Everything set by @ref setCount(),
* @ref setBaseInstance(), @ref setBaseVertex() and @ref setIndexBuffer()
* is ignored, the mesh is drawn as non-indexed and the vertex count is
* taken from the @p xfb object. If @p stream is `0`, non-stream draw
* command is used. If @extension{ARB,vertex_array_object} (part of
* OpenGL 3.0) is available, the associated vertex array object is
* taken from the @p xfb object. If @p stream is @cpp 0 @ce, non-stream
* draw command is used. If @extension{ARB,vertex_array_object} (part
* of OpenGL 3.0) is available, the associated vertex array object is
* bound instead of setting up the mesh from scratch.
* @see @ref setInstanceCount(), @ref draw(AbstractShaderProgram&),
* @ref MeshView::draw(AbstractShaderProgram&, TransformFeedback&, UnsignedInt),
* @fn_gl{UseProgram}, @fn_gl{EnableVertexAttribArray},
* @fn_gl{BindBuffer}, @fn_gl{VertexAttribPointer},
* @fn_gl{DisableVertexAttribArray} or @fn_gl{BindVertexArray},
* @fn_gl{DrawTransformFeedback}/@fn_gl{DrawTransformFeedbackInstanced} or
* @fn_gl{DrawTransformFeedbackStream}/@fn_gl{DrawTransformFeedbackStreamInstanced}
* @fn_gl_keyword{UseProgram}, @fn_gl_keyword{EnableVertexAttribArray},
* @fn_gl{BindBuffer}, @fn_gl_keyword{VertexAttribPointer},
* @fn_gl_keyword{DisableVertexAttribArray} or @fn_gl_keyword{BindVertexArray},
* @fn_gl_keyword{DrawTransformFeedback}/@fn_gl_keyword{DrawTransformFeedbackInstanced} or
* @fn_gl_keyword{DrawTransformFeedbackStream}/@fn_gl_keyword{DrawTransformFeedbackStreamInstanced}
* @requires_gl40 Extension @extension{ARB,transform_feedback2}
* @requires_gl40 Extension @extension{ARB,transform_feedback3} if
* @p stream is not `0`

16
src/Magnum/MeshView.h

@ -75,10 +75,10 @@ class MAGNUM_EXPORT MeshView {
* @attention All meshes must be views of the same original mesh and
* must not be instanced.
* @see @ref draw(AbstractShaderProgram&), @fn_gl{UseProgram},
* @fn_gl{EnableVertexAttribArray}, @fn_gl{BindBuffer},
* @fn_gl{VertexAttribPointer}, @fn_gl{DisableVertexAttribArray}
* or @fn_gl{BindVertexArray}, @fn_gl{MultiDrawArrays} or
* @fn_gl{MultiDrawElements}/@fn_gl{MultiDrawElementsBaseVertex}
* @fn_gl_keyword{EnableVertexAttribArray}, @fn_gl{BindBuffer},
* @fn_gl_keyword{VertexAttribPointer}, @fn_gl_keyword{DisableVertexAttribArray}
* or @fn_gl{BindVertexArray}, @fn_gl_keyword{MultiDrawArrays} or
* @fn_gl_keyword{MultiDrawElements}/@fn_gl_keyword{MultiDrawElementsBaseVertex}
* @requires_gl32 Extension @extension{ARB,draw_elements_base_vertex}
* if the mesh is indexed and @ref baseVertex() is not `0`.
* @requires_gl Specifying base vertex for indexed meshes is not
@ -117,7 +117,7 @@ class MAGNUM_EXPORT MeshView {
* @return Reference to self (for method chaining)
*
* Ignored when calling @ref draw(AbstractShaderProgram&, TransformFeedback&, UnsignedInt).
* Default is `0`.
* Default is @cpp 0 @ce.
*/
MeshView& setCount(Int count) {
_count = count;
@ -133,7 +133,7 @@ class MAGNUM_EXPORT MeshView {
*
* Sets number of vertices of which the vertex buffer will be offset
* when drawing. Ignored when calling @ref draw(AbstractShaderProgram&, TransformFeedback&, UnsignedInt).
* Default is `0`.
* Default is @cpp 0 @ce.
* @requires_gl32 Extension @extension{ARB,draw_elements_base_vertex}
* for indexed meshes
* @requires_gl Base vertex cannot be specified for indexed meshes in
@ -181,7 +181,7 @@ class MAGNUM_EXPORT MeshView {
* @brief Set instance count
* @return Reference to self (for method chaining)
*
* Default is `1`.
* Default is @cpp 1 @ce.
* @requires_gl31 Extension @extension{ARB,draw_instanced} if using
* @ref draw(AbstractShaderProgram&)
* @requires_gl42 Extension @extension{ARB,transform_feedback_instanced}
@ -206,7 +206,7 @@ class MAGNUM_EXPORT MeshView {
* @return Reference to self (for method chaining)
*
* Ignored when calling @ref draw(AbstractShaderProgram&, TransformFeedback&, UnsignedInt).
* Default is `0`.
* Default is @cpp 0 @ce.
* @requires_gl42 Extension @extension{ARB,base_instance}
* @requires_gl Base instance cannot be specified in OpenGL ES or
* WebGL.

59
src/Magnum/MultisampleTexture.h

@ -58,10 +58,11 @@ namespace Implementation {
@brief Multisample texture sample locations
@see @ref MultisampleTexture::setStorage()
@m_enum_values_as_keywords
*/
enum class MultisampleTextureSampleLocations: GLboolean {
NotFixed = GL_FALSE,
Fixed = GL_TRUE
NotFixed = GL_FALSE, /**< Not fixed */
Fixed = GL_TRUE /**< Fixed */
};
/**
@ -71,19 +72,20 @@ Template class for 2D mulitsample texture and 2D multisample texture array.
Used only from shaders for manual multisample resolve and other operations. See
also @ref AbstractTexture documentation for more information.
## Usage
@section MultisampleTexture-usage Usage
As multisample textures have no sampler state, the only thing you need is to
set storage:
@code
@code{.cpp}
MultisampleTexture2D texture;
texture.setStorage(16, TextureFormat::RGBA8, {1024, 1024});
@endcode
In shader, the texture is used via `sampler2DMS`/`sampler2DMSArray`,
`isampler2DMS`/`isampler2DMSArray` or `usampler2DMS`/`usampler2DMSArray`. See
@ref AbstractShaderProgram documentation for more information about usage in
shaders.
In shader, the texture is used via @glsl sampler2DMS @ce / @glsl sampler2DMSArray @ce,
@glsl isampler2DMS @ce / @glsl isampler2DMSArray @ce or @glsl usampler2DMS @ce
/ @glsl usampler2DMSArray @ce. See @ref AbstractShaderProgram documentation for
more information about usage in shaders.
Note that multisample textures don't support compressed formats.
@ -113,8 +115,8 @@ template<UnsignedInt dimensions> class MultisampleTexture: public AbstractTextur
* OpenGL calls. If neither extension @extension{ARB,texture_multisample}
* (part of OpenGL 3.2) nor OpenGL ES 3.1 is available, returns zero
* vector.
* @see @fn_gl{Get} with @def_gl{MAX_TEXTURE_SIZE} and
* @def_gl{MAX_3D_TEXTURE_SIZE}
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TEXTURE_SIZE} and
* @def_gl_keyword{MAX_3D_TEXTURE_SIZE}
*/
static VectorTypeFor<dimensions, Int> maxSize() {
return Implementation::maxMultisampleTextureSize<dimensions>();
@ -144,9 +146,9 @@ template<UnsignedInt dimensions> class MultisampleTexture: public AbstractTextur
* (part of OpenGL 4.5) is not available, the texture is created on
* first use.
* @see @ref MultisampleTexture(NoCreateT), @ref wrap(),
* @fn_gl{CreateTextures} with @def_gl{TEXTURE_2D_MULTISAMPLE} or
* @def_gl{TEXTURE_2D_MULTISAMPLE_ARRAY}, eventually
* @fn_gl{GenTextures}
* @fn_gl_keyword{CreateTextures} with @def_gl{TEXTURE_2D_MULTISAMPLE}
* or @def_gl{TEXTURE_2D_MULTISAMPLE_ARRAY}, eventually
* @fn_gl_keyword{GenTextures}
*/
explicit MultisampleTexture(): AbstractTexture(Implementation::multisampleTextureTarget<dimensions>()) {}
@ -176,7 +178,7 @@ template<UnsignedInt dimensions> class MultisampleTexture: public AbstractTextur
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
*/
#ifndef DOXYGEN_GENERATING_OUTPUT
@ -200,7 +202,7 @@ template<UnsignedInt dimensions> class MultisampleTexture: public AbstractTextur
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_es_extension Extension @extension{ANDROID,extension_pack_es31a}/
* @extension{OES,texture_storage_multisample_2d_array} for
@ -226,7 +228,7 @@ template<UnsignedInt dimensions> class MultisampleTexture: public AbstractTextur
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref bindImage(), @ref unbindImages(), @ref unbindImage(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_es_extension Extension @extension{ANDROID,extension_pack_es31a}/
* @extension{OES,texture_storage_multisample_2d_array} for
@ -258,25 +260,18 @@ template<UnsignedInt dimensions> class MultisampleTexture: public AbstractTextur
* is emulated using plain @extension{ARB,texture_multisample}
* functionality.
* @see @ref maxSize(), @ref maxColorSamples(), @ref maxDepthSamples(),
* @ref maxIntegerSamples(), @fn_gl2{TextureStorage2DMultisample,TexStorage2DMultisample} /
* @fn_gl2{TextureStorage3DMultisample,TexStorage3DMultisample},
* @fn_gl_extension{TextureStorage2DMultisample,EXT,direct_state_access} /
* @fn_gl_extension{TextureStorage3DMultisample,EXT,direct_state_access},
* @ref maxIntegerSamples(), @fn_gl2_keyword{TextureStorage2DMultisample,TexStorage2DMultisample} /
* @fn_gl2_keyword{TextureStorage3DMultisample,TexStorage3DMultisample},
* @fn_gl_extension_keyword{TextureStorage2DMultisample,EXT,direct_state_access} /
* @fn_gl_extension_keyword{TextureStorage3DMultisample,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture}
* and @fn_gl{TexStorage2DMultisample} / @fn_gl{TexStorage3DMultisample}
* or @fn_gl{TexImage2DMultisample} / @fn_gl{TexImage3DMultisample}
* @todoc Remove the workaround when it stops breaking Doxygen layout so badly
* and @fn_gl_keyword{TexStorage2DMultisample} / @fn_gl_keyword{TexStorage3DMultisample}
* or @fn_gl_keyword{TexImage2DMultisample} / @fn_gl_keyword{TexImage3DMultisample}
*/
/* The default parameter value was chosen based on discussion in
ARB_texture_multisample specs (fixed locations is treated as the
special case) */
MultisampleTexture<dimensions>& setStorage(Int samples, TextureFormat internalFormat, const VectorTypeFor<dimensions, Int>& size, MultisampleTextureSampleLocations sampleLocations =
#ifndef DOXYGEN_GENERATING_OUTPUT
MultisampleTextureSampleLocations::NotFixed
#else
NotFixed
#endif
) {
MultisampleTexture<dimensions>& setStorage(Int samples, TextureFormat internalFormat, const VectorTypeFor<dimensions, Int>& size, MultisampleTextureSampleLocations sampleLocations = MultisampleTextureSampleLocations::NotFixed) {
DataHelper<dimensions>::setStorageMultisample(*this, samples, internalFormat, size, GLboolean(sampleLocations));
return *this;
}
@ -293,14 +288,14 @@ template<UnsignedInt dimensions> class MultisampleTexture: public AbstractTextur
}
/**
* @copybrief Texture::invalidateImage()
* @brief @copybrief Texture::invalidateImage()
*
* See @ref Texture::invalidateImage() for more information.
*/
void invalidateImage() { AbstractTexture::invalidateImage(0); }
/**
* @copybrief Texture::invalidateSubImage()
* @brief @copybrief Texture::invalidateSubImage()
*
* See @ref Texture::invalidateSubImage() for more information.
*/

2
src/Magnum/OpenGLTester.h

@ -101,7 +101,7 @@ to run single isolated test cases.
On platforms that support it, the OpenGL context is created with synchronous
debug output, meaning that every OpenGL error is directly reported to standard
output. While it is possible, the tester class doesn't abort the test cases
upon encountering a GL error -- this should be done explicitly with
upon encountering a GL error --- this should be done explicitly with
@ref MAGNUM_VERIFY_NO_ERROR() instead, as the debug output is not available on
all platforms and not all GL errors are fatal.

3
src/Magnum/PixelFormat.h

@ -51,6 +51,7 @@ See documentation of these values for possible limitations when using OpenGL ES
2.0 or WebGL.
@see @ref Image, @ref ImageView, @ref BufferImage, @ref Trade::ImageData
@m_enum_values_as_keywords
*/
enum class PixelFormat: GLenum {
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
@ -333,6 +334,7 @@ See documentation of these values for possible limitations when using OpenGL ES
2.0 or WebGL.
@see @ref Image, @ref ImageView, @ref BufferImage, @ref Trade::ImageData
@m_enum_values_as_keywords
*/
enum class PixelType: GLenum {
/** Each component unsigned byte. */
@ -584,6 +586,7 @@ Equivalent to `Compressed*` values of @ref TextureFormat enum.
@see @ref CompressedImage, @ref CompressedImageView, @ref CompressedBufferImage,
@ref Trade::ImageData
@m_enum_values_as_keywords
*/
enum class CompressedPixelFormat: GLenum {
#ifndef MAGNUM_TARGET_GLES

66
src/Magnum/PixelStorage.h

@ -49,13 +49,13 @@ Descibes how to interpret data which are read from or stored into @ref Image,
@ref Texture::image() "*Texture::image()", @ref Texture::subImage() "*Texture::subImage()"
and @ref AbstractFramebuffer::read() "*Framebuffer::read()".
## Performance optimizations
@section PixelFormat-performance-optimizations Performance optimizations
The storage mode is applied either right before doing image upload using
@fn_gl{PixelStore} with @def_gl{UNPACK_*} parameters or right before doing
image download using @fn_gl{PixelStore} with @def_gl{PACK_*}. The engine tracks
currently used pixel pack/unpack parameters to avoid unnecessary calls to
@fn_gl{PixelStore}. See also @ref Context::resetState() and
@fn_gl_keyword{PixelStore} with @def_gl{UNPACK_*} parameters or right before
doing image download using @fn_gl{PixelStore} with @def_gl{PACK_*}. The engine
tracks currently used pixel pack/unpack parameters to avoid unnecessary calls
to @fn_gl{PixelStore}. See also @ref Context::resetState() and
@ref Context::State::PixelStorage.
@see @ref CompressedPixelStorage
@ -77,7 +77,7 @@ class MAGNUM_EXPORT PixelStorage {
* @brief Default constructor
*
* Sets all parameters to default values, i.e. all values set to
* `false`/`0` except for alignment, which is `4`.
* @cpp false @ce / @cpp 0 @ce except for alignment, which is @cpp 4 @ce.
*/
constexpr /*implicit*/ PixelStorage() noexcept;
@ -100,9 +100,10 @@ class MAGNUM_EXPORT PixelStorage {
/**
* @brief Enable or disable byte order reversion
*
* Not applicable for @ref CompressedPixelStorage. Default is `false`.
* @see @fn_gl{PixelStore} with @def_gl{PACK_SWAP_BYTES}/
* @def_gl{UNPACK_SWAP_BYTES}
* Not applicable for @ref CompressedPixelStorage. Default is
* @cpp false @ce.
* @see @fn_gl{PixelStore} with @def_gl_keyword{PACK_SWAP_BYTES}/
* @def_gl_keyword{UNPACK_SWAP_BYTES}
* @requires_gl Not available in OpenGL ES or WebGL.
*/
PixelStorage& setSwapBytes(bool enabled) {
@ -118,9 +119,10 @@ class MAGNUM_EXPORT PixelStorage {
* @brief Set row alignment
*
* Not applicable for @ref CompressedPixelStorage. Valid values are
* `1`, `2`, `4` and `8`. Default is `4`.
* @see @fn_gl{PixelStore} with @def_gl{PACK_ALIGNMENT}/
* @def_gl{UNPACK_ALIGNMENT}
* @cpp 1 @ce, @cpp 2 @ce, @cpp 4 @ce and @cpp 8 @ce. Default is
* @cpp 4 @ce.
* @see @fn_gl{PixelStore} with @def_gl_keyword{PACK_ALIGNMENT}/
* @def_gl_keyword{UNPACK_ALIGNMENT}
*/
PixelStorage& setAlignment(Int alignment) {
_alignment = alignment;
@ -141,10 +143,10 @@ class MAGNUM_EXPORT PixelStorage {
/**
* @brief Set row length
*
* Used only on 2D and 3D images. If set to `0`, size information from
* actual image is used. Default is `0`.
* @see @fn_gl{PixelStore} with @def_gl{UNPACK_ROW_LENGTH}/
* @def_gl{PACK_ROW_LENGTH}
* Used only on 2D and 3D images. If set to @cpp 0 @ce, size
* information from actual image is used. Default is @cpp 0 @ce.
* @see @fn_gl{PixelStore} with @def_gl_keyword{UNPACK_ROW_LENGTH}/
* @def_gl_keyword{PACK_ROW_LENGTH}
* @requires_gles30 Extension @extension{EXT,unpack_subimage}/
* @extension{NV,pack_subimage} in OpenGL ES 2.0.
* @requires_webgl20 Row length specification is not available in WebGL
@ -170,10 +172,10 @@ class MAGNUM_EXPORT PixelStorage {
/**
* @brief Set image height
*
* Used only on 3D images. If set to `0`, size information from actual
* image is used. Default is `0`.
* @see @fn_gl{PixelStore} with @def_gl{UNPACK_IMAGE_HEIGHT}/
* @def_gl{PACK_IMAGE_HEIGHT}
* Used only on 3D images. If set to @cpp 0 @ce, size information from
* actual image is used. Default is @cpp 0 @ce.
* @see @fn_gl{PixelStore} with @def_gl_keyword{UNPACK_IMAGE_HEIGHT}/
* @def_gl_keyword{PACK_IMAGE_HEIGHT}
* @requires_gles30 Image height specification is not available in
* OpenGL ES 2.0
* @requires_webgl20 Image height specification is not available in
@ -194,12 +196,13 @@ class MAGNUM_EXPORT PixelStorage {
* @brief Set pixel, row and image skipping
*
* The Y value is used only for 2D and 3D images, the Z value is used
* only for 3D images. Default is `0`. On OpenGL ES 2.0 and WebGL 1.0
* the functionality is emulated by increasing the data pointer.
* @see @fn_gl{PixelStore} with @def_gl{UNPACK_SKIP_PIXELS}/
* @def_gl{PACK_SKIP_PIXELS}, @def_gl{UNPACK_SKIP_ROWS}/
* @def_gl{PACK_SKIP_ROWS}, @def_gl{UNPACK_SKIP_IMAGES}/
* @def_gl{PACK_SKIP_IMAGES}
* only for 3D images. Default is @cpp 0 @ce. On OpenGL ES 2.0 and
* WebGL 1.0 the functionality is emulated by increasing the data
* pointer.
* @see @fn_gl{PixelStore} with @def_gl_keyword{UNPACK_SKIP_PIXELS}/
* @def_gl_keyword{PACK_SKIP_PIXELS}, @def_gl_keyword{UNPACK_SKIP_ROWS}/
* @def_gl_keyword{PACK_SKIP_ROWS}, @def_gl_keyword{UNPACK_SKIP_IMAGES}/
* @def_gl_keyword{PACK_SKIP_IMAGES}
* @requires_gl Image skip specification is available only for unpack
* in OpenGL ES and WebGL.
*/
@ -276,7 +279,7 @@ class MAGNUM_EXPORT CompressedPixelStorage: public PixelStorage {
* @brief Default constructor
*
* Sets all parameters to default values, i.e. all values set to
* `false`/`0` except for alignment, which is `4`.
* @cpp false @ce / @cpp 0 @ce except for alignment, which is @cpp 4 @ce.
*/
#ifndef CORRADE_MSVC2015_COMPATIBILITY /* What am I doing wrong? */
constexpr
@ -297,8 +300,9 @@ class MAGNUM_EXPORT CompressedPixelStorage: public PixelStorage {
/**
* @brief Set compressed block size
*
* If set to `0` for given dimension, size information from particular
* compressed format is used. Default is `0` in all dimensions.
* If set to @cpp 0 @ce for given dimension, size information from
* particular compressed format is used. Default is @cpp 0 @ce in all
* dimensions.
*/
CompressedPixelStorage& setCompressedBlockSize(const Vector3i& size) {
_blockSize = size;
@ -311,8 +315,8 @@ class MAGNUM_EXPORT CompressedPixelStorage: public PixelStorage {
/**
* @brief Set compressed block data size (in bytes)
*
* If set to `0`, size information from particular compressed format is
* used. Default is `0` in all dimensions.
* If set to @cpp 0 @ce, size information from particular compressed
* format is used. Default is @cpp 0 @ce in all dimensions.
*/
CompressedPixelStorage& setCompressedBlockDataSize(Int size) {
_blockDataSize = size;

26
src/Magnum/PrimitiveQuery.h

@ -45,7 +45,8 @@ namespace Magnum {
Queries count of generated primitives from vertex shader, geometry shader or
transform feedback. Example usage:
@code
@code{.cpp}
PrimitiveQuery q;
q.begin(PrimitiveQuery::Target::PrimitivesGenerated);
@ -59,6 +60,7 @@ if(!q.resultAvailable()) {
// ...or block until the result is available
UnsignedInt primitiveCount = q.result<UnsignedInt>();
@endcode
@see @ref SampleQuery, @ref TimeQuery, @ref TransformFeedback
@requires_gl30 Extension @extension{EXT,transform_feedback}
@requires_gles30 Only sample queries are available in OpenGL ES 2.0.
@ -66,7 +68,12 @@ UnsignedInt primitiveCount = q.result<UnsignedInt>();
*/
class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery {
public:
/** @brief Query target */
/**
* @brief Query target
*
* @see @ref PrimitiveQuery(Target)
* @m_enum_values_as_keywords
*/
enum class Target: GLenum {
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
/**
@ -138,7 +145,7 @@ class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief PrimitiveQuery(Target)
* @brief @copybrief PrimitiveQuery(Target)
* @deprecated Use @ref PrimitiveQuery(Target) instead.
*/
CORRADE_DEPRECATED("use PrimitiveQuery(Target) instead") explicit PrimitiveQuery() {}
@ -151,7 +158,8 @@ class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery {
* (part of OpenGL 4.5) is not available, the query is created on first
* use.
* @see @ref PrimitiveQuery(NoCreateT), @ref wrap(),
* @fn_gl{CreateQueries}, eventually @fn_gl{GenQueries}
* @fn_gl_keyword{CreateQueries}, eventually
* @fn_gl_keyword{GenQueries}
*/
explicit PrimitiveQuery(Target target): AbstractQuery(GLenum(target)) {}
@ -172,14 +180,14 @@ class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery {
* @brief Begin query
*
* Begins counting until @ref end() is called. Equivalent to calling
* @ref begin(UnsignedInt) with @p index set to `0`.
* @see @fn_gl{BeginQuery}
* @ref begin(UnsignedInt) with @p index set to @cpp 0 @ce.
* @see @fn_gl_keyword{BeginQuery}
*/
void begin();
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief begin()
* @brief @copybrief begin()
* @deprecated Use @ref begin() instead.
*/
CORRADE_DEPRECATED("use begin() instead") void begin(Target target);
@ -190,7 +198,7 @@ class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery {
* @brief Begin indexed query
*
* Begins counting until @ref end() is called.
* @see @fn_gl{BeginQueryIndexed}
* @see @fn_gl_keyword{BeginQueryIndexed}
* @requires_gl40 Extension @extension{ARB,transform_feedback3}
* @requires_gl Indexed queries are not available in OpenGL ES or WebGL.
*/
@ -203,7 +211,7 @@ class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery {
* Ends the non-indexed or indexed query started with @ref begin() or
* @ref begin(UnsignedInt). The result can be then retrieved by calling
* @ref result().
* @see @fn_gl{EndQuery}, @fn_gl2{EndQueryIndexed,BeginQueryIndexed}
* @see @fn_gl_keyword{EndQuery}, @fn_gl2_keyword{EndQueryIndexed,BeginQueryIndexed}
* @requires_gl40 Extension @extension{ARB,transform_feedback3} for
* indexed queries
* @requires_gl Indexed queries are not available in OpenGL ES or

92
src/Magnum/RectangleTexture.h

@ -43,11 +43,12 @@ namespace Magnum {
See also @ref AbstractTexture documentation for more information.
## Usage
@section RectangleTexture-usage Usage
Common usage is to fully configure all texture parameters and then set the
data from e.g. @ref Image2D. Example configuration:
@code
@code{.cpp}
Image2D image(PixelFormat::RGBA, PixelType::UnsignedByte, {526, 137}, data);
RectangleTexture texture;
@ -59,9 +60,10 @@ texture.setMagnificationFilter(Sampler::Filter::Linear)
.setSubImage({}, image);
@endcode
In shader, the texture is used via `sampler2DRect`, `sampler2DRectShadow`,
`isampler2DRect` or `usampler2DRect`. See @ref AbstractShaderProgram
documentation for more information about usage in shaders.
In shader, the texture is used via @glsl sampler2DRect @ce,
@glsl sampler2DRectShadow @ce, @glsl isampler2DRect @ce or @glsl usampler2DRect @ce.
See @ref AbstractShaderProgram documentation for more information about usage
in shaders.
@see @ref Texture, @ref TextureArray, @ref CubeMapTexture,
@ref CubeMapTextureArray, @ref BufferTexture, @ref MultisampleTexture
@ -76,12 +78,12 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If @extension{ARB,texture_rectangle} (part of
* OpenGL 3.1) is not available, returns zero vector.
* @see @fn_gl{Get} with @def_gl{MAX_RECTANGLE_TEXTURE_SIZE}
* @see @fn_gl{Get} with @def_gl_keyword{MAX_RECTANGLE_TEXTURE_SIZE}
*/
static Vector2i maxSize();
/**
* @copybrief Texture::compressedBlockSize()
* @brief @copybrief Texture::compressedBlockSize()
*
* See @ref Texture::compressedBlockSize() for more information.
* @requires_gl43 Extension @extension{ARB,internalformat_query2}
@ -91,12 +93,12 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::compressedBlockDataSize()
* @brief @copybrief Texture::compressedBlockDataSize()
*
* See @ref Texture::compressedBlockDataSize() for more information.
* @requires_gl43 Extension @extension{ARB,internalformat_query2}
* @see @ref compressedBlockSize(), @fn_gl{Getinternalformat} with
* @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE}
* @see @ref compressedBlockSize(), @fn_gl_keyword{GetInternalformat}
* with @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE}
*/
static Int compressedBlockDataSize(TextureFormat format) {
return AbstractTexture::compressedBlockDataSize(GL_TEXTURE_RECTANGLE, format);
@ -124,8 +126,8 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
* (part of OpenGL 4.5) is not available, the texture is created on
* first use.
* @see @ref RectangleTexture(NoCreateT), @ref wrap(),
* @fn_gl{CreateTextures} with @def_gl{TEXTURE_RECTANGLE},
* eventually @fn_gl{GenTextures}
* @fn_gl_keyword{CreateTextures} with @def_gl{TEXTURE_RECTANGLE},
* eventually @fn_gl_keyword{GenTextures}
*/
explicit RectangleTexture(): AbstractTexture(GL_TEXTURE_RECTANGLE) {}
@ -154,7 +156,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref unbindImage(), @ref unbindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
*/
void bindImage(Int imageUnit, ImageAccess access, ImageFormat format) {
@ -162,7 +164,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setMinificationFilter()
* @brief @copybrief Texture::setMinificationFilter()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMinificationFilter() for more information.
@ -174,7 +176,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setMagnificationFilter()
* @brief @copybrief Texture::setMagnificationFilter()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMagnificationFilter() for more information.
@ -185,7 +187,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setWrapping()
* @brief @copybrief Texture::setWrapping()
* @return Reference to self (for method chaining)
*
* Sets wrapping type for coordinates out of @f$ [ 0, size - 1 ] @f$
@ -201,7 +203,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setBorderColor(const Color4&)
* @brief @copybrief Texture::setBorderColor(const Color4&)
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Color4&) for more
@ -213,7 +215,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setBorderColor(const Vector4ui&)
* @brief @copybrief Texture::setBorderColor(const Vector4ui&)
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Vector4ui&) for more
@ -234,7 +236,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setMaxAnisotropy()
* @brief @copybrief Texture::setMaxAnisotropy()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMaxAnisotropy() for more information.
@ -245,7 +247,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setSRGBDecode()
* @brief @copybrief Texture::setSRGBDecode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setSRGBDecode() for more information.
@ -257,7 +259,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setSwizzle()
* @brief @copybrief Texture::setSwizzle()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setSwizzle() for more information.
@ -269,7 +271,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setCompareMode()
* @brief @copybrief Texture::setCompareMode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompareMode() for more information.
@ -280,7 +282,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setCompareFunction()
* @brief @copybrief Texture::setCompareFunction()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompareFunction() for more information.
@ -291,7 +293,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setDepthStencilMode()
* @brief @copybrief Texture::setDepthStencilMode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setDepthStencilMode() for more information.
@ -303,7 +305,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setStorage()
* @brief @copybrief Texture::setStorage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setStorage() for more information.
@ -333,7 +335,8 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image2D image = texture.image({PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
@ -352,7 +355,8 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage2D image = texture.image({PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
@ -371,7 +375,8 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage2D image = texture.compressedimage({});
* @endcode
*/
@ -390,14 +395,15 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage2D image = texture.compressedImage({}, BufferUsage::StaticRead);
* @endcode
*/
CompressedBufferImage2D compressedImage(CompressedBufferImage2D&& image, BufferUsage usage);
/**
* @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
* @brief @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
*
* See @ref Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
* for more information.
@ -410,14 +416,15 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image2D image = texture.subImage(range, {PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
Image2D subImage(const Range2Di& range, Image2D&& image);
/**
* @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
* @brief @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
*
* See @ref Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
* for more information.
@ -430,14 +437,15 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage2D image = texture.subImage(range, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
BufferImage2D subImage(const Range2Di& range, BufferImage2D&& image, BufferUsage usage);
/**
* @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
* @brief @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
*
* See @ref Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
* for more information.
@ -454,14 +462,15 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage2D image = texture.compressedSubImage(range, {});
* @endcode
*/
CompressedImage2D compressedSubImage(const Range2Di& range, CompressedImage2D&& image);
/**
* @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
* @brief @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
*
* See @ref Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
* for more information.
@ -478,14 +487,15 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage2D image = texture.compressedSubImage(range, {}, BufferUsage::StaticRead);
* @endcode
*/
CompressedBufferImage2D compressedSubImage(const Range2Di& range, CompressedBufferImage2D&& image, BufferUsage usage);
/**
* @copybrief Texture::setImage()
* @brief @copybrief Texture::setImage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setImage() for more information.
@ -516,7 +526,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setCompressedImage()
* @brief @copybrief Texture::setCompressedImage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompressedImage() for more information.
@ -547,7 +557,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setSubImage()
* @brief @copybrief Texture::setSubImage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setSubImage() for more information.
@ -569,7 +579,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture {
}
/**
* @copybrief Texture::setCompressedSubImage()
* @brief @copybrief Texture::setCompressedSubImage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompressedSubImage() for more information.

37
src/Magnum/Renderbuffer.h

@ -45,7 +45,7 @@ namespace Implementation { struct FramebufferState; }
Attachable to framebuffer as render target, see @ref Framebuffer documentation
for more information.
## Performance optimizations
@section Renderbuffer-performance-optimizations Performance optimizations
The engine tracks currently bound renderbuffer to avoid unnecessary calls to
@fn_gl{BindRenderbuffer} in @ref setStorage(). Renderbuffer limits and
@ -70,7 +70,7 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls.
* @see @ref setStorage(), @ref setStorageMultisample(), @fn_gl{Get}
* with @def_gl{MAX_RENDERBUFFER_SIZE}
* with @def_gl_keyword{MAX_RENDERBUFFER_SIZE}
*/
static Int maxSize();
@ -81,8 +81,10 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither OpenGL ES 3.0 nor ES extension
* @extension{ANGLE,framebuffer_multisample} /
* @extension{NV,framebuffer_multisample} is available, returns `0`.
* @see @ref setStorageMultisample(), @fn_gl{Get} with @def_gl{MAX_SAMPLES}
* @extension{NV,framebuffer_multisample} is available, returns
* @cpp 0 @ce.
* @see @ref setStorageMultisample(), @fn_gl{Get} with
* @def_gl_keyword{MAX_SAMPLES}
* @requires_webgl20 Multisample framebuffers are not available in
* WebGL 1.0.
*/
@ -111,7 +113,8 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject {
* (part of OpenGL 4.5) is not available, the renderbuffer is created
* on first use.
* @see @ref Renderbuffer(NoCreateT), @ref wrap(),
* @fn_gl{CreateRenderbuffers}, eventually @fn_gl{GenRenderbuffers}
* @fn_gl_keyword{CreateRenderbuffers}, eventually
* @fn_gl_keyword{GenRenderbuffers}
*/
explicit Renderbuffer();
@ -139,7 +142,7 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject {
* @brief Destructor
*
* Deletes associated OpenGL renderbuffer object.
* @see @ref wrap(), @ref release(), @fn_gl{DeleteRenderbuffers}
* @see @ref wrap(), @ref release(), @fn_gl_keyword{DeleteRenderbuffers}
*/
~Renderbuffer();
@ -173,8 +176,8 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function returns empty string.
* @see @fn_gl{GetObjectLabel} or
* @fn_gl_extension{GetObjectLabel,EXT,debug_label} with
* @see @fn_gl_keyword{GetObjectLabel} or
* @fn_gl_extension_keyword{GetObjectLabel,EXT,debug_label} with
* @def_gl{RENDERBUFFER}
* @requires_gles Debug output is not available in WebGL.
*/
@ -188,8 +191,8 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function does nothing.
* @see @ref maxLabelLength(), @fn_gl{ObjectLabel} or
* @fn_gl_extension{LabelObject,EXT,debug_label} with
* @see @ref maxLabelLength(), @fn_gl_keyword{ObjectLabel} or
* @fn_gl_extension_keyword{LabelObject,EXT,debug_label} with
* @def_gl{RENDERBUFFER}
* @requires_gles Debug output is not available in WebGL.
*/
@ -212,9 +215,10 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject {
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the renderbuffer is bound before the operation (if not
* already).
* @see @ref maxSize(), @fn_gl2{NamedRenderbufferStorage,RenderbufferStorage},
* @fn_gl_extension{NamedRenderbufferStorage,EXT,direct_state_access},
* eventually @fn_gl{BindRenderbuffer} and @fn_gl{RenderbufferStorage}
* @see @ref maxSize(), @fn_gl2_keyword{NamedRenderbufferStorage,RenderbufferStorage},
* @fn_gl_extension_keyword{NamedRenderbufferStorage,EXT,direct_state_access},
* eventually @fn_gl{BindRenderbuffer} and
* @fn_gl_keyword{RenderbufferStorage}
*/
void setStorage(RenderbufferFormat internalFormat, const Vector2i& size);
@ -230,9 +234,10 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject {
* available, the renderbuffer is bound before the operation (if not
* already).
* @see @ref maxSize(), @ref maxSamples(),
* @fn_gl2{NamedRenderbufferStorageMultisample,RenderbufferStorageMultisample},
* @fn_gl_extension{NamedRenderbufferStorageMultisample,EXT,direct_state_access},
* eventually @fn_gl{BindRenderbuffer} and @fn_gl{RenderbufferStorageMultisample}
* @fn_gl2_keyword{NamedRenderbufferStorageMultisample,RenderbufferStorageMultisample},
* @fn_gl_extension_keyword{NamedRenderbufferStorageMultisample,EXT,direct_state_access},
* eventually @fn_gl{BindRenderbuffer} and
* @fn_gl_keyword{RenderbufferStorageMultisample}
* @requires_gles30 Extension @extension{ANGLE,framebuffer_multisample}
* or @extension{NV,framebuffer_multisample} in OpenGL ES 2.0.
* @requires_webgl20 Multisample framebuffers are not available in

1
src/Magnum/RenderbufferFormat.h

@ -37,6 +37,7 @@ namespace Magnum {
@brief Internal renderbuffer format
@see @ref Renderbuffer
@m_enum_values_as_keywords
@requires_gl30 Extension @extension{ARB,framebuffer_object}
@todo RGB, RGB8 ES only (ES3 + @extension{OES,rgb8_rgba8})
*/

145
src/Magnum/Renderer.h

@ -61,6 +61,7 @@ class MAGNUM_EXPORT Renderer {
* @ref setStencilFunction(PolygonFacing, StencilFunction, Int, UnsignedInt),
* @ref setStencilOperation(PolygonFacing, StencilOperation, StencilOperation, StencilOperation),
* @ref setStencilMask(PolygonFacing, UnsignedInt)
* @m_enum_values_as_keywords
*/
enum class PolygonFacing: GLenum {
Front = GL_FRONT, /**< Front-facing polygons */
@ -75,6 +76,7 @@ class MAGNUM_EXPORT Renderer {
*
* All features are disabled by default unless specified otherwise.
* @see @ref enable(), @ref disable(), @ref setFeature()
* @m_enum_values_as_keywords
*/
enum class Feature: GLenum {
#ifndef MAGNUM_TARGET_WEBGL
@ -231,7 +233,7 @@ class MAGNUM_EXPORT Renderer {
#ifndef MAGNUM_TARGET_GLES
/**
* Programmable point size. If enabled, the point size is taken
* from vertex/geometry shader builtin `gl_PointSize`.
* from vertex/geometry shader builtin @glsl gl_PointSize @ce.
* @see @ref setPointSize()
* @requires_gl Always enabled on OpenGL ES and WebGL.
*/
@ -278,14 +280,14 @@ class MAGNUM_EXPORT Renderer {
/**
* @brief Enable feature
*
* @see @ref disable(), @ref setFeature(), @fn_gl{Enable}
* @see @ref disable(), @ref setFeature(), @fn_gl_keyword{Enable}
*/
static void enable(Feature feature);
/**
* @brief Disable feature
*
* @see @ref enable(), @ref setFeature(), @fn_gl{Disable}
* @see @ref enable(), @ref setFeature(), @fn_gl_keyword{Disable}
*/
static void disable(Feature feature);
@ -293,9 +295,11 @@ class MAGNUM_EXPORT Renderer {
* @brief Enable or disable feature
*
* Convenience equivalent to the following:
* @code
*
* @code{.cpp}
* enabled ? Renderer::enable(feature) : Renderer::disable(feature)
* @endcode
*
* Prefer to use @ref enable() and @ref disable() directly to avoid
* unnecessary branching.
*/
@ -305,6 +309,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Hint
*
* @see @ref setHint()
* @m_enum_values_as_keywords
* @todo other hints
*/
enum class Hint: GLenum {
@ -335,6 +340,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Hint mode
*
* @see @ref setHint()
* @m_enum_values_as_keywords
*/
enum class HintMode: GLenum {
Fastest = GL_FASTEST, /**< Most efficient option. */
@ -346,7 +352,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Set hint
*
* Initial value is @ref HintMode::DontCare for all targets.
* @see @fn_gl{Hint}
* @see @fn_gl_keyword{Hint}
*/
static void setHint(Hint target, HintMode mode);
@ -357,9 +363,9 @@ class MAGNUM_EXPORT Renderer {
/**
* @brief Set clear color
*
* Initial value is `{0.125f, 0.125f, 0.125f, 1.0f}`.
* Initial value is @cpp 0x1f1f1f_rgbf @ce.
* @see @ref Framebuffer::clearColor() "*Framebuffer::clearColor()",
* @fn_gl{ClearColor}
* @fn_gl_keyword{ClearColor}
* @deprecated_gl Prefer to use @ref Framebuffer::clearColor() "*Framebuffer::clearColor()"
* instead of @ref setClearColor() and
* @ref AbstractFramebuffer::clear() as it leads to less state
@ -371,9 +377,10 @@ class MAGNUM_EXPORT Renderer {
/**
* @brief Set clear depth
*
* Initial value is `1.0`.
* Initial value is @cpp 1.0 @ce.
* @see @ref Feature::DepthTest, @ref AbstractFramebuffer::clearDepth(),
* @ref AbstractFramebuffer::clearDepthStencil(), @fn_gl{ClearDepth}
* @ref AbstractFramebuffer::clearDepthStencil(),
* @fn_gl_keyword{ClearDepth}
* @requires_gl See @ref setClearDepth(Float), which is available in
* OpenGL ES and WebGL.
* @deprecated_gl Prefer to use @ref AbstractFramebuffer::clearDepth()
@ -391,7 +398,8 @@ class MAGNUM_EXPORT Renderer {
* is not available, this function behaves exactly as
* @ref setClearDepth(Double).
* @see @ref Feature::DepthTest, @ref AbstractFramebuffer::clearDepth(),
* @ref AbstractFramebuffer::clearDepthStencil(), @fn_gl{ClearDepth}
* @ref AbstractFramebuffer::clearDepthStencil(),
* @fn_gl_keyword{ClearDepth}
* @deprecated_gl Prefer to use @ref AbstractFramebuffer::clearDepth()
* / @ref AbstractFramebuffer::clearDepthStencil() instead of
* @ref setClearDepth() and @ref AbstractFramebuffer::clear() as
@ -402,9 +410,10 @@ class MAGNUM_EXPORT Renderer {
/**
* @brief Set clear stencil
*
* Initial value is `0`.
* Initial value is @cpp 0 @ce.
* @see @ref Feature::StencilTest, @ref AbstractFramebuffer::clearStencil(),
* @ref AbstractFramebuffer::clearDepthStencil(), @fn_gl{ClearStencil}
* @ref AbstractFramebuffer::clearDepthStencil(),
* @fn_gl_keyword{ClearStencil}
* @deprecated_gl Prefer to use @ref AbstractFramebuffer::clearStencil()
* / @ref AbstractFramebuffer::clearDepthStencil() instead of
* @ref setClearStencil() and @ref AbstractFramebuffer::clear() as
@ -420,12 +429,13 @@ class MAGNUM_EXPORT Renderer {
* @brief Front facing polygon winding
*
* @see @ref setFrontFace()
* @m_enum_values_as_keywords
*/
enum class FrontFace: GLenum {
/** @brief Counterclockwise polygons are front facing (default). */
/** Counterclockwise polygons are front facing (default). */
CounterClockWise = GL_CCW,
/** @brief Clockwise polygons are front facing. */
/** Clockwise polygons are front facing. */
ClockWise = GL_CW
};
@ -433,7 +443,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Set front-facing polygon winding
*
* Initial value is @ref FrontFace::CounterClockWise.
* @see @ref setFaceCullingMode(), @fn_gl{FrontFace}
* @see @ref setFaceCullingMode(), @fn_gl_keyword{FrontFace}
*/
static void setFrontFace(FrontFace mode);
@ -443,7 +453,7 @@ class MAGNUM_EXPORT Renderer {
* Initial value is @ref PolygonFacing::Back. If set to both front and
* back, only points and lines are drawn.
* @see @ref Feature::FaceCulling, @ref setFrontFace(),
* @fn_gl{CullFace}
* @fn_gl_keyword{CullFace}
*/
static void setFaceCullingMode(PolygonFacing mode);
@ -452,16 +462,17 @@ class MAGNUM_EXPORT Renderer {
* @brief Provoking vertex
*
* @see @ref setProvokingVertex()
* @m_enum_values_as_keywords
* @requires_gl32 Extension @extension{ARB,provoking_vertex}. Older
* versions behave always like @ref ProvokingVertex::LastVertexConvention.
* @requires_gl OpenGL ES and WebGL behave always like
* @ref ProvokingVertex::LastVertexConvention.
*/
enum class ProvokingVertex: GLenum {
/** @brief Use first vertex of each polygon. */
/** Use first vertex of each polygon. */
FirstVertexConvention = GL_FIRST_VERTEX_CONVENTION,
/** @brief Use last vertex of each polygon (default). */
/** Use last vertex of each polygon (default). */
LastVertexConvention = GL_LAST_VERTEX_CONVENTION
};
@ -469,7 +480,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Set provoking vertex
*
* Initial value is @ref ProvokingVertex::LastVertexConvention.
* @see @fn_gl{ProvokingVertex}
* @see @fn_gl_keyword{ProvokingVertex}
* @requires_gl32 Extension @extension{ARB,provoking_vertex}. Older
* versions behave always like the default.
* @requires_gl OpenGL ES and WebGL behave always like the default.
@ -482,6 +493,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Polygon mode
*
* @see @ref setPolygonMode()
* @m_enum_values_as_keywords
* @requires_es_extension Extension @extension{NV,polygon_mode}.
* Otherwise behaves always like @ref PolygonMode::Fill. See
* @ref Mesh::setPrimitive() for possible workaround.
@ -522,7 +534,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Set polygon drawing mode
*
* Initial value is @ref PolygonMode::Fill.
* @see @fn_gl{PolygonMode}
* @see @fn_gl_keyword{PolygonMode}
* @requires_es_extension Extension @extension{NV,polygon_mode}.
* Otherwise behaves always like the default. See
* @ref Mesh::setPrimitive() for possible workaround.
@ -545,8 +557,8 @@ class MAGNUM_EXPORT Renderer {
/**
* @brief Set line width
*
* Initial value is `1.0f`.
* @see @fn_gl{LineWidth}
* Initial value is @cpp 1.0f @ce.
* @see @fn_gl_keyword{LineWidth}
*/
static void setLineWidth(Float width);
@ -554,8 +566,8 @@ class MAGNUM_EXPORT Renderer {
/**
* @brief Set point size
*
* Initial value is `1.0f`.
* @see @ref Feature::ProgramPointSize, @fn_gl{PointSize}
* Initial value is @cpp 1.0f @ce.
* @see @ref Feature::ProgramPointSize, @fn_gl_keyword{PointSize}
* @requires_gl Use `gl_PointSize` builtin vertex shader variable in
* OpenGL ES and WebGL instead.
*/
@ -570,7 +582,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Set scissor rectangle
*
* Initial value is set to cover whole window.
* @see @ref Feature::ScissorTest, @fn_gl{Scissor}
* @see @ref Feature::ScissorTest, @fn_gl_keyword{Scissor}
*/
static void setScissor(const Range2Di& rectangle);
@ -582,6 +594,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Stencil function
*
* @see @ref setStencilFunction(), @ref DepthFunction
* @m_enum_values_as_keywords
*/
enum class StencilFunction: GLenum {
Never = GL_NEVER, /**< Never pass the test. */
@ -598,10 +611,11 @@ class MAGNUM_EXPORT Renderer {
* @brief Stencil operation
*
* @see @ref setStencilOperation()
* @m_enum_values_as_keywords
*/
enum class StencilOperation: GLenum {
Keep = GL_KEEP, /**< Keep the current value. */
Zero = GL_ZERO, /**< Set the stencil buffer value to `0`. */
Zero = GL_ZERO, /**< Set the stencil buffer value to @cpp 0 @ce. */
/**
* Set the stencil value to reference value specified by
@ -644,9 +658,9 @@ class MAGNUM_EXPORT Renderer {
* @param facing Affected polygon facing
* @param function Stencil function. Initial value is
* @ref StencilFunction::Always.
* @param referenceValue Reference value. Initial value is `0`.
* @param referenceValue Reference value. Initial value is @cpp 0 @ce.
* @param mask Mask for both reference and buffer value.
* Initial value is all `1`s.
* Initial value is all @cpp 1 @ce s.
*
* @see @ref Feature::StencilTest, @ref setStencilFunction(StencilFunction, Int, UnsignedInt),
* @ref setStencilOperation(), @fn_gl{StencilFuncSeparate}
@ -661,7 +675,7 @@ class MAGNUM_EXPORT Renderer {
* The same as @ref setStencilFunction(PolygonFacing, StencilFunction, Int, UnsignedInt)
* with @p facing set to @ref PolygonFacing::FrontAndBack.
* @see @ref Feature::StencilTest, @ref setStencilOperation(),
* @fn_gl{StencilFunc}
* @fn_gl_keyword{StencilFunc}
*/
static void setStencilFunction(StencilFunction function, Int referenceValue, UnsignedInt mask);
@ -676,7 +690,7 @@ class MAGNUM_EXPORT Renderer {
*
* Initial value for all fields is @ref StencilOperation::Keep.
* @see @ref Feature::StencilTest, @ref setStencilOperation(StencilOperation, StencilOperation, StencilOperation),
* @ref setStencilFunction(), @fn_gl{StencilOpSeparate}
* @ref setStencilFunction(), @fn_gl_keyword{StencilOpSeparate}
*/
static void setStencilOperation(PolygonFacing facing, StencilOperation stencilFail, StencilOperation depthFail, StencilOperation depthPass);
@ -686,7 +700,7 @@ class MAGNUM_EXPORT Renderer {
* The same as @ref setStencilOperation(PolygonFacing, StencilOperation, StencilOperation, StencilOperation)
* with @p facing set to @ref PolygonFacing::FrontAndBack.
* @see @ref Feature::StencilTest, @ref setStencilFunction(),
* @fn_gl{StencilOp}
* @fn_gl_keyword{StencilOp}
*/
static void setStencilOperation(StencilOperation stencilFail, StencilOperation depthFail, StencilOperation depthPass);
@ -705,7 +719,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Set depth function
*
* Initial value is @ref DepthFunction::Less.
* @see @ref Feature::DepthTest, @fn_gl{DepthFunc}
* @see @ref Feature::DepthTest, @fn_gl_keyword{DepthFunc}
*/
static void setDepthFunction(DepthFunction function);
@ -716,9 +730,10 @@ class MAGNUM_EXPORT Renderer {
/**
* @brief Mask color writes
*
* Set to `false` to disallow writing to given color channel. Initial
* values are all `true`.
* @see @ref setDepthMask(), @ref setStencilMask(), @fn_gl{ColorMask}
* Set to @cpp false @ce to disallow writing to given color channel.
* Initial values are all @cpp true @ce.
* @see @ref setDepthMask(), @ref setStencilMask(),
* @fn_gl_keyword{ColorMask}
* @todo Masking only given draw buffer
*/
static void setColorMask(GLboolean allowRed, GLboolean allowGreen, GLboolean allowBlue, GLboolean allowAlpha);
@ -726,20 +741,21 @@ class MAGNUM_EXPORT Renderer {
/**
* @brief Mask depth writes
*
* Set to `false` to disallow writing to depth buffer. Initial value
* is `true`.
* @see @ref setColorMask(), @ref setStencilMask(), @fn_gl{DepthMask}
* Set to @cpp false @ce to disallow writing to depth buffer. Initial
* value is @cpp true @ce.
* @see @ref setColorMask(), @ref setStencilMask(),
* @fn_gl_keyword{DepthMask}
*/
static void setDepthMask(GLboolean allow);
/**
* @brief Mask stencil writes
*
* Set given bit to `0` to disallow writing stencil value for given
* faces to it. Initial value is all `1`s.
* Set given bit to @cpp 0 @ce to disallow writing stencil value for
* given faces to it. Initial value is all @cpp 1 @ce s.
*
* @see @ref setStencilMask(UnsignedInt), @ref setColorMask(),
* @ref setDepthMask(), @fn_gl{StencilMaskSeparate}
* @ref setDepthMask(), @fn_gl_keyword{StencilMaskSeparate}
* @requires_gles In WebGL the mask must be the same for both front and
* back polygon facing.
*/
@ -750,7 +766,7 @@ class MAGNUM_EXPORT Renderer {
*
* The same as calling @ref setStencilMask(PolygonFacing, UnsignedInt)
* with `facing` set to @ref PolygonFacing::FrontAndBack.
* @see @fn_gl{StencilMask}
* @see @fn_gl_keyword{StencilMask}
*/
static void setStencilMask(UnsignedInt allowBits);
@ -767,6 +783,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Blend equation
*
* @see @ref setBlendEquation()
* @m_enum_values_as_keywords
*/
enum class BlendEquation: GLenum {
Add = GL_FUNC_ADD, /**< `source + destination` */
@ -986,6 +1003,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Blend function
*
* @see @ref setBlendFunction()
* @m_enum_values_as_keywords
*/
enum class BlendFunction: GLenum {
/** Zero (@f$ RGB = (0.0, 0.0, 0.0); A = 0.0 @f$) */
@ -1117,7 +1135,7 @@ class MAGNUM_EXPORT Renderer {
* (framebuffer). Initial value is @ref BlendEquation::Add.
* @see @ref Feature::Blending, @ref setBlendEquation(BlendEquation, BlendEquation),
* @ref setBlendFunction(), @ref setBlendColor(),
* @fn_gl{BlendEquation}
* @fn_gl_keyword{BlendEquation}
*/
static void setBlendEquation(BlendEquation equation);
@ -1126,7 +1144,7 @@ class MAGNUM_EXPORT Renderer {
*
* See @ref setBlendEquation(BlendEquation) for more information.
* @see @ref Feature::Blending, @ref setBlendFunction(),
* @ref setBlendColor(), @fn_gl{BlendEquationSeparate}
* @ref setBlendColor(), @fn_gl_keyword{BlendEquationSeparate}
*/
static void setBlendEquation(BlendEquation rgb, BlendEquation alpha);
@ -1139,7 +1157,7 @@ class MAGNUM_EXPORT Renderer {
*
* @see @ref Feature::Blending, @ref setBlendFunction(BlendFunction, BlendFunction, BlendFunction, BlendFunction),
* @ref setBlendEquation(), @ref setBlendColor(),
* @fn_gl{BlendFunc}
* @fn_gl_keyword{BlendFunc}
* @requires_gles In WebGL, constant color and constant alpha cannot be
* used together as source and destination factors.
*/
@ -1151,7 +1169,7 @@ class MAGNUM_EXPORT Renderer {
* See @ref setBlendFunction(BlendFunction, BlendFunction) for more
* information.
* @see @ref Feature::Blending, @ref setBlendEquation(),
* @ref setBlendColor(), @fn_gl{BlendFuncSeparate}
* @ref setBlendColor(), @fn_gl_keyword{BlendFuncSeparate}
*/
static void setBlendFunction(BlendFunction sourceRgb, BlendFunction destinationRgb, BlendFunction sourceAlpha, BlendFunction destinationAlpha);
@ -1162,7 +1180,7 @@ class MAGNUM_EXPORT Renderer {
* @ref BlendFunction::ConstantColor, @ref BlendFunction::OneMinusConstantColor,
* @ref BlendFunction::ConstantAlpha and @ref BlendFunction::OneMinusConstantAlpha.
* @see @ref Feature::Blending, @ref setBlendEquation(),
* @ref setBlendFunction(), @fn_gl{BlendColor}
* @ref setBlendFunction(), @fn_gl_keyword{BlendColor}
*/
static void setBlendColor(const Color4& color);
@ -1178,7 +1196,7 @@ class MAGNUM_EXPORT Renderer {
* @extension2{KHR,blend_equation_advanced_coherent,blend_equation_advanced}
* is not available or when @extension2{KHR,blend_equation_advanced_coherent,blend_equation_advanced}
* is available and @ref Feature::BlendAdvancedCoherent is turned off.
* @see @ref BlendEquation, @fn_gl_extension{BlendBarrier,KHR,blend_equation_advanced}
* @see @ref BlendEquation, @fn_gl_extension_keyword{BlendBarrier,KHR,blend_equation_advanced}
* @requires_extension Extension @extension{KHR,blend_equation_advanced}
* @requires_es_extension Extension @extension2{KHR,blend_equation_advanced,blend_equation_advanced}
* @requires_gles Advanced blend equations are not available in WebGL.
@ -1195,12 +1213,13 @@ class MAGNUM_EXPORT Renderer {
* @brief Logical operation
*
* @see @ref setLogicOperation()
* @m_enum_values_as_keywords
* @requires_gl Logical operations on framebuffer are not available in
* OpenGL ES and WebGL.
*/
enum class LogicOperation: GLenum {
Clear = GL_CLEAR, /**< `0` */
Set = GL_SET, /**< `1` */
Clear = GL_CLEAR, /**< @cpp 0 @ce <b></b> */
Set = GL_SET, /**< @cpp 1 @ce <b></b> */
Copy = GL_COPY, /**< `source` */
CopyInverted = GL_COPY_INVERTED,/**< `~source` */
Noop = GL_NOOP, /**< `destination` */
@ -1220,7 +1239,7 @@ class MAGNUM_EXPORT Renderer {
/**
* @brief Set logical operation
*
* @see @ref Feature::LogicOperation, @fn_gl{LogicOp}
* @see @ref Feature::LogicOperation, @fn_gl_keyword{LogicOp}
* @requires_gl Logical operations on framebuffer are not available in
* OpenGL ES and WebGL.
*/
@ -1234,7 +1253,7 @@ class MAGNUM_EXPORT Renderer {
/**
* @brief Flush the pipeline
*
* @see @ref finish(), @fn_gl{Flush}
* @see @ref finish(), @fn_gl_keyword{Flush}
*/
static void flush() { glFlush(); }
@ -1242,7 +1261,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Finish the pipeline
*
* Blocks until all commands in the pipeline are finished.
* @see @ref flush(), @fn_gl{Finish}
* @see @ref flush(), @fn_gl_keyword{Finish}
*/
static void finish() { glFinish(); }
@ -1252,6 +1271,7 @@ class MAGNUM_EXPORT Renderer {
*
* @see @ref MemoryBarriers, @ref setMemoryBarrier(),
* @ref setMemoryBarrierByRegion()
* @m_enum_values_as_keywords
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gles31 Shader image load/store is not available in OpenGL
* ES 3.0 and older.
@ -1325,7 +1345,7 @@ class MAGNUM_EXPORT Renderer {
* Calling the function ensures that operations on particular data
* after the barrier will reflect all data modifications before the
* barrier.
* @see @ref setMemoryBarrierByRegion(), @fn_gl{MemoryBarrier}
* @see @ref setMemoryBarrierByRegion(), @fn_gl_keyword{MemoryBarrier}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gles31 Shader load/store is not available in OpenGL ES 3.0 and older.
* @requires_gles Shader load/store is not available in WebGL.
@ -1348,7 +1368,7 @@ class MAGNUM_EXPORT Renderer {
* - @ref MemoryBarrier::TextureFetch
* - @ref MemoryBarrier::Uniform
*
* @see @fn_gl{MemoryBarrierByRegion}
* @see @fn_gl_keyword{MemoryBarrierByRegion}
* @requires_gl45 Extension @extension{ARB,ES3_1_compatibility}
* @requires_gles31 Shader load/store is not available in OpenGL ES 3.0
* and older.
@ -1366,7 +1386,7 @@ class MAGNUM_EXPORT Renderer {
* Calling the function ensures that texel fetches in drawing
* operations after the barrier will reflect texel writes before the
* barrier.
* @see @fn_gl{TextureBarrier}
* @see @fn_gl_keyword{TextureBarrier}
* @requires_gl45 Extension @extension{ARB,texture_barrier}
* @requires_gl Texture barrier is not available in OpenGL ES or WebGL.
*/
@ -1383,6 +1403,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Error status
*
* @see @ref error()
* @m_enum_values_as_keywords
*/
enum class Error: GLenum {
/** No error has been recorded */
@ -1399,7 +1420,8 @@ class MAGNUM_EXPORT Renderer {
/**
* The framebuffer object is not complete.
* @see AbstractFramebuffer::checkStatus()
* @see @ref DefaultFramebuffer::checkStatus(),
* @ref Framebuffer::checkStatus()
* @requires_gl30 Extension @extension{ARB,framebuffer_object}
*/
InvalidFramebufferOperation = GL_INVALID_FRAMEBUFFER_OPERATION,
@ -1444,7 +1466,7 @@ class MAGNUM_EXPORT Renderer {
* Returns error flag, if any set. If there aren't any more error
* flags, returns @ref Error::NoError. Thus this function should be
* always called in a loop until it returns @ref Error::NoError.
* @see @fn_gl{GetError}
* @see @fn_gl_keyword{GetError}
*/
static Error error() { return static_cast<Error>(glGetError()); }
@ -1494,8 +1516,8 @@ class MAGNUM_EXPORT Renderer {
* @ref Platform::Sdl2Application::Configuration::Flag::RobustAccess "Platform::*Application::Configuration::Flag::RobustAccess"
* flag.
*
* @see @ref graphicsResetStatus(), @fn_gl{Get} with
* @def_gl{RESET_NOTIFICATION_STRATEGY_ARB}
* @see @ref graphicsResetStatus(), @fn_gl_keyword{Get} with
* @def_gl_keyword{RESET_NOTIFICATION_STRATEGY_ARB}
* @requires_gles Graphics reset notification is not available in
* WebGL.
*/
@ -1505,6 +1527,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Graphics reset status
*
* @see @ref resetNotificationStrategy(), @ref graphicsResetStatus()
* @m_enum_values_as_keywords
* @requires_gles Graphics reset notification is not available in
* WebGL.
*/
@ -1567,7 +1590,7 @@ class MAGNUM_EXPORT Renderer {
* @extension{ARB,robustness_share_group_isolation} indicates that no
* other share group will be affected by the graphics reset.
* @see @ref resetNotificationStrategy(),
* @fn_gl_extension{GetGraphicsResetStatus,ARB,robustness}
* @fn_gl_extension_keyword{GetGraphicsResetStatus,ARB,robustness}
* @requires_gles Graphics reset notification is not available in
* WebGL.
*/

8
src/Magnum/Resource.h

@ -166,10 +166,10 @@ class Resource {
/**
* @brief Whether the resource is available
*
* Returns `false` when resource is not loaded and no fallback is
* available (i.e. @ref state() is either
* Returns @cpp false @ce when resource is not loaded and no fallback
* is available (i.e. @ref state() is either
* @ref ResourceState::NotLoaded, @ref ResourceState::Loading or
* @ref ResourceState::NotFound), `true` otherwise.
* @ref ResourceState::NotFound), @cpp true @ce otherwise.
*/
operator bool() {
acquire();
@ -179,7 +179,7 @@ class Resource {
/**
* @brief Pointer to resource data
*
* Returns `nullptr` if the resource is not loaded.
* Returns @cpp nullptr @ce if the resource is not loaded.
*/
operator U*() {
acquire();

78
src/Magnum/ResourceManager.h

@ -43,13 +43,13 @@ namespace Magnum {
enum class ResourceDataState: UnsignedByte {
/**
* The resource is currently loading. Parameter @p data in
* @ref ResourceManager::set() should be set to `nullptr`.
* @ref ResourceManager::set() should be set to @cpp nullptr @ce.
*/
Loading = UnsignedByte(ResourceState::Loading),
/**
* The resource was not found. Parameter @p data in
* @ref ResourceManager::set() should be set to `nullptr`.
* @ref ResourceManager::set() should be set to @cpp nullptr @ce.
*/
NotFound = UnsignedByte(ResourceState::NotFound),
@ -186,7 +186,7 @@ template<class ...Types> struct ResourceManagerImplementation<ResourceManagerLoc
Provides storage for arbitrary set of types, accessible globally using
@ref instance().
## Usage
@section ResourceMananger-usage Usage
Each resource is referenced from @ref Resource class. For optimizing
performance, each resource can be set as mutable or final. Mutable resources
@ -212,35 +212,49 @@ Resource state and policy is configured when setting the resource data in
final resources cannot obviously be set as mutable again.
Basic usage is:
- Typedef'ing manager of desired types, creating its instance.
@code
typedef ResourceManager<Mesh, Texture2D, AbstractShaderProgram> MyResourceManager;
MyResourceManager manager;
@endcode
- Filling the manager with resource data and acquiring the resources. Note
<ul>
<li>
Typedef'ing manager of desired types, creating its instance.
@code{.cpp}
typedef ResourceManager<Mesh, Texture2D, AbstractShaderProgram> MyResourceManager;
MyResourceManager manager;
@endcode
</li>
<li>
Filling the manager with resource data and acquiring the resources. Note
that a resource can be acquired with @ref get() even before the manager
contains the data for it, as long as the resource data are not accessed (or
fallback is provided).
@code
MyResourceManager& manager = MyResourceManager::instance();
Resource<Texture2D> texture{manager.get<Texture2D>("texture")};
Resource<AbstractShaderProgram, MyShader> shader{manager.get<AbstractShaderProgram, MyShader>("shader")};
Resource<Mesh> cube{manager.get<Mesh>("cube")};
// The manager doesn't have data for the cube yet, add them
if(!cube) {
Mesh* mesh = new Mesh;
// ...
manager.set(cube.key(), mesh, ResourceDataState::Final, ResourcePolicy::Resident);
}
@endcode
- Using the resource data.
@code
shader->setTexture(*texture);
cube->draw(*shader);
@endcode
- Destroying resource references and deleting manager instance when nothing
@code{.cpp}
MyResourceManager& manager = MyResourceManager::instance();
Resource<Texture2D> texture{manager.get<Texture2D>("texture")};
Resource<AbstractShaderProgram, MyShader> shader{manager.get<AbstractShaderProgram, MyShader>("shader")};
Resource<Mesh> cube{manager.get<Mesh>("cube")};
// The manager doesn't have data for the cube yet, add them
if(!cube) {
Mesh* mesh = new Mesh;
// ...
manager.set(cube.key(), mesh, ResourceDataState::Final, ResourcePolicy::Resident);
}
@endcode
</li>
<li>
Using the resource data.
@code{.cpp}
shader->setTexture(*texture);
cube->draw(*shader);
@endcode
</li>
<li>
Destroying resource references and deleting manager instance when nothing
references the resources anymore.
</li>
</ul>
@see @ref AbstractResourceLoader
*/
@ -269,7 +283,7 @@ template<class... Types> class ResourceManager: private Implementation::Resource
/**
* @brief Destructor
*
* Sets global instance pointer to `nullptr`.
* Sets global instance pointer to @cpp nullptr @ce.
* @see @ref instance()
*/
~ResourceManager();
@ -287,7 +301,8 @@ template<class... Types> class ResourceManager: private Implementation::Resource
* responsibility of proper casting on the user, the acquired resource
* can be defined to cast the type automatically when accessing the
* data. This is commonly used for shaders, e.g.:
* @code
*
* @code{.cpp}
* Resource<AbstractShaderProgram, MyShader> shader = manager->get<AbstractShaderProgram, MyShader>("shader");
* @endcode
*/
@ -429,7 +444,8 @@ template<class... Types> class ResourceManager: private Implementation::Resource
/**
* @brief Set loader for given type of resources
* @param loader Loader or `nullptr` if unsetting previous loader.
* @param loader Loader or @cpp nullptr @ce if unsetting previous
* loader.
* @return Reference to self (for method chaining)
*
* See @ref AbstractResourceLoader documentation for more information.

26
src/Magnum/SampleQuery.h

@ -46,7 +46,8 @@ namespace Magnum {
Queries count of samples passed from fragment shader or boolean value
indicating whether any samples passed. Can be used for example for conditional
rendering:
@code
@code{.cpp}
SampleQuery q;
q.begin(SampleQuery::Target::AnySamplesPassed);
@ -58,12 +59,14 @@ if(q.result<bool>()) {
// ...
}
@endcode
This approach has some drawbacks, as the rendering is blocked until result is
available for the CPU to decide. This can be improved by using conditional
rendering on GPU itself. The drawing commands will be sent to the GPU and
processed or discarded later, so CPU can continue executing the code without
waiting for the result.
@code
@code{.cpp}
SampleQuery q;
q.begin(SampleQuery::Target::AnySamplesPassed);
@ -82,7 +85,11 @@ q.endConditionalRender();
*/
class SampleQuery: public AbstractQuery {
public:
/** @brief Query target */
/**
* @brief Query target
*
* @m_enum_values_as_keywords
*/
enum class Target: GLenum {
#ifndef MAGNUM_TARGET_GLES
/**
@ -124,6 +131,7 @@ class SampleQuery: public AbstractQuery {
/**
* @brief Conditional render mode
*
* @m_enum_values_as_keywords
* @requires_gl30 Extension @extension{NV,conditional_render}
* @requires_gl Conditional rendering is not available in OpenGL ES or
* WebGL.
@ -203,7 +211,7 @@ class SampleQuery: public AbstractQuery {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief SampleQuery(Target)
* @brief @copybrief SampleQuery(Target)
* @deprecated Use @ref SampleQuery(Target) instead.
*/
CORRADE_DEPRECATED("use SampleQuery(Target) instead") explicit SampleQuery() {}
@ -215,8 +223,8 @@ class SampleQuery: public AbstractQuery {
* Creates new OpenGL query object. If @extension{ARB,direct_state_access}
* (part of OpenGL 4.5) is not available, the query is created on first
* use.
* @see @ref SampleQuery(NoCreateT), @ref wrap(), @fn_gl{CreateQueries},
* eventually @fn_gl{GenQueries}
* @see @ref SampleQuery(NoCreateT), @ref wrap(),
* @fn_gl_keyword{CreateQueries}, eventually @fn_gl_keyword{GenQueries}
*/
explicit SampleQuery(Target target): AbstractQuery(GLenum(target)) {}
@ -235,7 +243,7 @@ class SampleQuery: public AbstractQuery {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief AbstractQuery::begin()
* @brief @copybrief AbstractQuery::begin()
* @deprecated Use @ref begin() instead.
*/
CORRADE_DEPRECATED("use begin() instead") void begin(Target target) {
@ -249,7 +257,7 @@ class SampleQuery: public AbstractQuery {
/**
* @brief Begin conditional rendering based on result value
*
* @see @fn_gl{BeginConditionalRender}
* @see @fn_gl_keyword{BeginConditionalRender}
* @requires_gl30 Extension @extension{NV,conditional_render}
* @requires_gl Conditional rendering is not available in OpenGL ES or
* WebGL.
@ -261,7 +269,7 @@ class SampleQuery: public AbstractQuery {
/**
* @brief End conditional render
*
* @see @fn_gl{EndConditionalRender}
* @see @fn_gl_keyword{EndConditionalRender}
* @requires_gl30 Extension @extension{NV,conditional_render}
* @requires_gl Conditional rendering is not available in OpenGL ES or
* WebGL.

39
src/Magnum/Sampler.h

@ -48,6 +48,7 @@ class MAGNUM_EXPORT Sampler {
*
* @see @ref Texture::setMinificationFilter() "*Texture::setMinificationFilter()",
* @ref Texture::setMagnificationFilter() "*Texture::setMagnificationFilter()"
* @m_enum_values_as_keywords
*/
enum class Filter: GLint {
Nearest = GL_NEAREST, /**< Nearest neighbor filtering */
@ -77,12 +78,14 @@ class MAGNUM_EXPORT Sampler {
/**
* Select nearest mip level. **Unavailable on rectangle textures.**
* @m_keywords{GL_NEAREST_MIPMAP_NEAREST}
*/
Nearest = GL_NEAREST_MIPMAP_NEAREST & ~GL_NEAREST,
/**
* Linear interpolation of nearest mip levels. **Unavailable on
* rectangle textures.**
* @m_keywords{GL_NEAREST_MIPMAP_LINEAR}
* @requires_gles30 Extension @extension{OES,texture_float_linear} /
* @extension2{OES,texture_half_float_linear,OES_texture_float_linear}
* for linear interpolation of textures with
@ -100,6 +103,7 @@ class MAGNUM_EXPORT Sampler {
* @brief Texture wrapping
*
* @see @ref Texture::setWrapping() "*Texture::setWrapping()"
* @m_enum_values_as_keywords
*/
enum class Wrapping: GLint {
/** Repeat texture. **Unavailable on rectangle textures.** */
@ -153,6 +157,7 @@ class MAGNUM_EXPORT Sampler {
*
* @see @ref CompareFunction,
* @ref Texture::setCompareMode() "*Texture::setCompareMode()"
* @m_enum_values_as_keywords
* @requires_gles30 Extension @extension{EXT,shadow_samplers} in
* OpenGL ES 2.0.
* @requires_webgl20 Depth texture comparison is not available in WebGL
@ -178,48 +183,49 @@ class MAGNUM_EXPORT Sampler {
* @ref CompareMode::CompareRefToTexture.
* @see @ref Texture::setCompareFunction() "*Texture::setCompareFunction()",
* @ref Texture::setCompareMode() "*Texture::setCompareMode()"
* @m_enum_values_as_keywords
* @requires_gles30 Extension @extension{EXT,shadow_samplers} in
* OpenGL ES 2.0.
* @requires_webgl20 Depth texture comparison is not available in WebGL
* 1.0.
*/
enum class CompareFunction: GLenum {
Never = GL_NEVER, /**< Always `0.0` */
Always = GL_ALWAYS, /**< Always `1.0` */
Never = GL_NEVER, /**< Always @glsl 0.0 @ce */
Always = GL_ALWAYS, /**< Always @glsl 1.0 @ce */
/**
* `1.0` when texture coordinate is less than depth value, `0.0`
* otherwise
* @glsl 1.0 @ce when texture coordinate is less than depth value,
* @glsl 0.0 @ce otherwise
*/
Less = GL_LESS,
/**
* `1.0` when texture coordinate is less than or equal to depth
* value, `0.0` otherwise
* @glsl 1.0 @ce when texture coordinate is less than or equal to depth
* value, @glsl 0.0 @ce otherwise
*/
LessOrEqual = GL_LEQUAL,
/**
* `1.0` when texture coordinate is equal to depth value, `0.0`
* otherwise
* @glsl 1.0 @ce when texture coordinate is equal to depth value,
* @glsl 0.0 @ce otherwise
*/
Equal = GL_EQUAL,
/**
* `0.0` when texture coordinate is equal to depth value, `1.0`
* otherwise
* @glsl 0.0 @ce when texture coordinate is equal to depth value,
* @glsl 1.0 @ce otherwise
*/
NotEqual = GL_NOTEQUAL,
/**
* `1.0` when texture coordinate is greater than or equal to depth
* value, `0.0` otherwise
* @glsl 1.0 @ce when texture coordinate is greater than or equal
* to depth value, @glsl 0.0 @ce otherwise
*/
GreaterOrEqual = GL_GEQUAL,
/**
* `1.0` when texture coordinate is greater than depth value, `0.0`
* otherwise
* @glsl 1.0 @ce when texture coordinate is greater than depth
* value, @glsl 0.0 @ce otherwise
*/
Greater = GL_GREATER
};
@ -230,6 +236,7 @@ class MAGNUM_EXPORT Sampler {
* @brief Depth/stencil texture mode
*
* @see @ref Texture::setDepthStencilMode() "*Texture::setDepthStencilMode()"
* @m_enum_values_as_keywords
* @requires_gl43 Extension @extension{ARB,stencil_texturing}
* @requires_gles31 Stencil texturing is not available in OpenGL ES 3.0
* and older.
@ -249,8 +256,8 @@ class MAGNUM_EXPORT Sampler {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{EXT,texture_filter_anisotropic}
* (desktop or ES) is not available, returns `0.0f`.
* @see @fn_gl{Get} with @def_gl{MAX_TEXTURE_MAX_ANISOTROPY_EXT}
* (desktop or ES) is not available, returns @cpp 0.0f @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TEXTURE_MAX_ANISOTROPY_EXT}
*/
static Float maxMaxAnisotropy();
};

229
src/Magnum/Shader.h

@ -44,7 +44,7 @@ namespace Magnum {
See @ref AbstractShaderProgram for usage information.
## Performance optimizations
@section Shader-performance-optimizations Performance optimizations
Shader limits and implementation-defined values (such as @ref maxUniformComponents())
are cached, so repeated queries don't result in repeated @fn_gl{Get} calls.
@ -63,6 +63,7 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* @ref maxUniformBlocks(),
* @ref maxUniformComponents(),
* @ref maxCombinedUniformComponents()
* @m_enum_values_as_keywords
*/
enum class Type: GLenum {
Vertex = GL_VERTEX_SHADER, /**< Vertex shader */
@ -129,9 +130,9 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. In OpenGL ES 2.0 the four-component vector count is
* queried and multiplied with 4.
* @see @fn_gl{Get} with @def_gl{MAX_VERTEX_OUTPUT_COMPONENTS},
* @def_gl{MAX_VARYING_COMPONENTS} in OpenGL <3.2 or
* @def_gl{MAX_VARYING_VECTORS} in OpenGL ES 2.0
* @see @fn_gl{Get} with @def_gl_keyword{MAX_VERTEX_OUTPUT_COMPONENTS},
* @def_gl_keyword{MAX_VARYING_COMPONENTS} in OpenGL <3.2 or
* @def_gl_keyword{MAX_VARYING_VECTORS} in OpenGL ES 2.0
*/
static Int maxVertexOutputComponents();
@ -145,8 +146,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* OpenGL calls. If neither @extension{ARB,tessellation_shader} (part
* of OpenGL 4.0) nor @extension{ANDROID,extension_pack_es31a}/
* @extension{EXT,tessellation_shader} ES extension is available,
* returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_TESS_CONTROL_INPUT_COMPONENTS}
* returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TESS_CONTROL_INPUT_COMPONENTS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gl Tessellation shaders are not available in WebGL.
*/
@ -159,8 +160,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* OpenGL calls. If neither @extension{ARB,tessellation_shader} (part
* of OpenGL 4.0) nor @extension{ANDROID,extension_pack_es31a}/
* @extension{EXT,tessellation_shader} ES extension is available,
* returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_TESS_CONTROL_OUTPUT_COMPONENTS}
* returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TESS_CONTROL_OUTPUT_COMPONENTS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gl Tessellation shaders are not available in WebGL.
*/
@ -173,8 +174,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* OpenGL calls. If neither @extension{ARB,tessellation_shader} (part
* of OpenGL 4.0) nor @extension{ANDROID,extension_pack_es31a}/
* @extension{EXT,tessellation_shader} ES extension is available,
* returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS}
* returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gl Tessellation shaders are not available in WebGL.
*/
@ -187,8 +188,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* OpenGL calls. If neither @extension{ARB,tessellation_shader} (part
* of OpenGL 4.0) nor @extension{ANDROID,extension_pack_es31a}/
* @extension{EXT,tessellation_shader} ES extension is available,
* returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_TESS_EVALUATION_INPUT_COMPONENTS}
* returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TESS_EVALUATION_INPUT_COMPONENTS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gl Tessellation shaders are not available in WebGL.
*/
@ -201,8 +202,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* OpenGL calls. If neither @extension{ARB,tessellation_shader} (part
* of OpenGL 4.0) nor @extension{ANDROID,extension_pack_es31a}/
* @extension{EXT,tessellation_shader} ES extension is available,
* returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_TESS_EVALUATION_OUTPUT_COMPONENTS}
* returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TESS_EVALUATION_OUTPUT_COMPONENTS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gl Tessellation shaders are not available in WebGL.
*/
@ -215,8 +216,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* OpenGL calls. If neither @extension{ARB,geometry_shader4} (part of
* OpenGL 3.2) nor @extension{ANDROID,extension_pack_es31a}/
* @extension{EXT,geometry_shader} ES extension is not available,
* returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_GEOMETRY_INPUT_COMPONENTS}
* returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_GEOMETRY_INPUT_COMPONENTS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Geometry shaders are not available in WebGL.
*/
@ -229,8 +230,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* OpenGL calls. If neither @extension{ARB,geometry_shader4} (part of
* OpenGL 3.2) nor @extension{ANDROID,extension_pack_es31a}/
* @extension{EXT,geometry_shader} ES extension is not available,
* returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_GEOMETRY_OUTPUT_COMPONENTS}
* returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_GEOMETRY_OUTPUT_COMPONENTS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Geometry shaders are not available in WebGL.
*/
@ -243,8 +244,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* OpenGL calls. If neither @extension{ARB,geometry_shader4} (part of
* OpenGL 3.2) nor @extension{ANDROID,extension_pack_es31a}/
* @extension{EXT,geometry_shader} ES extension is not available,
* returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS}
* returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Geometry shaders are not available in WebGL.
*/
@ -257,9 +258,9 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. In OpenGL ES 2.0 the four-component vector count is
* queried and multiplied with 4.
* @see @fn_gl{Get} with @def_gl{MAX_FRAGMENT_INPUT_COMPONENTS},
* @def_gl{MAX_VARYING_COMPONENTS} in OpenGL <3.2 or
* @def_gl{MAX_VARYING_VECTORS} in OpenGL ES 2.0
* @see @fn_gl{Get} with @def_gl_keyword{MAX_FRAGMENT_INPUT_COMPONENTS},
* @def_gl_keyword{MAX_VARYING_COMPONENTS} in OpenGL <3.2 or
* @def_gl_keyword{MAX_VARYING_VECTORS} in OpenGL ES 2.0
*/
static Int maxFragmentInputComponents();
@ -268,17 +269,17 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If particular shader stage is not available, returns
* `0`. In OpenGL ES 2.0 the four-component vector count is queried and
* multiplied with 4.
* @cpp 0 @ce. In OpenGL ES 2.0 the four-component vector count is
* queried and multiplied with 4.
* @see @ref maxCombinedUniformComponents(),
* @fn_gl{Get} with @def_gl{MAX_VERTEX_UNIFORM_COMPONENTS},
* @def_gl{MAX_TESS_CONTROL_UNIFORM_COMPOENTS},
* @def_gl{MAX_TESS_EVALUATION_UNIFORM_COMPONENTS},
* @def_gl{MAX_GEOMETRY_UNIFORM_COMPONENTS},
* @def_gl{MAX_COMPUTE_UNIFORM_COMPONENTS},
* @def_gl{MAX_FRAGMENT_UNIFORM_COMPONENTS} or
* @def_gl{MAX_VERTEX_UNIFORM_VECTORS},
* @def_gl{MAX_FRAGMENT_UNIFORM_VECTORS} in OpenGL ES 2.0
* @fn_gl{Get} with @def_gl_keyword{MAX_VERTEX_UNIFORM_COMPONENTS},
* @def_gl_keyword{MAX_TESS_CONTROL_UNIFORM_COMPOENTS},
* @def_gl_keyword{MAX_TESS_EVALUATION_UNIFORM_COMPONENTS},
* @def_gl_keyword{MAX_GEOMETRY_UNIFORM_COMPONENTS},
* @def_gl_keyword{MAX_COMPUTE_UNIFORM_COMPONENTS},
* @def_gl_keyword{MAX_FRAGMENT_UNIFORM_COMPONENTS} or
* @def_gl_keyword{MAX_VERTEX_UNIFORM_VECTORS},
* @def_gl_keyword{MAX_FRAGMENT_UNIFORM_VECTORS} in OpenGL ES 2.0
*/
static Int maxUniformComponents(Type type);
@ -289,14 +290,14 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_atomic_counters}
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available or if particular
* shader stage is not available, returns `0`.
* shader stage is not available, returns @cpp 0 @ce.
* @see @ref maxCombinedAtomicCounterBuffers(), @ref maxAtomicCounters(),
* @fn_gl{Get} with @def_gl{MAX_VERTEX_ATOMIC_COUNTER_BUFFERS},
* @def_gl{MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS},
* @def_gl{MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS},
* @def_gl{MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS},
* @def_gl{MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS} or
* @def_gl{MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS}
* @fn_gl{Get} with @def_gl_keyword{MAX_VERTEX_ATOMIC_COUNTER_BUFFERS},
* @def_gl_keyword{MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS},
* @def_gl_keyword{MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS},
* @def_gl_keyword{MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS},
* @def_gl_keyword{MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS} or
* @def_gl_keyword{MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Atomic counters are not available in WebGL.
*/
@ -307,9 +308,9 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_atomic_counters}
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns `0`.
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns @cpp 0 @ce.
* @see @ref maxAtomicCounterBuffers(), @ref maxCombinedAtomicCounters(),
* @fn_gl{Get} with @def_gl{MAX_COMBINED_ATOMIC_COUNTER_BUFFERS}
* @fn_gl{Get} with @def_gl_keyword{MAX_COMBINED_ATOMIC_COUNTER_BUFFERS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Atomic counters are not available in WebGL.
*/
@ -321,14 +322,14 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_atomic_counters}
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available or if particular
* shader stage is not available, returns `0`.
* shader stage is not available, returns @cpp 0 @ce.
* @see @ref maxCombinedAtomicCounters(), @ref maxAtomicCounterBuffers(),
* @fn_gl{Get} with @def_gl{MAX_VERTEX_ATOMIC_COUNTERS},
* @def_gl{MAX_TESS_CONTROL_ATOMIC_COUNTERS},
* @def_gl{MAX_TESS_EVALUATION_ATOMIC_COUNTERS},
* @def_gl{MAX_GEOMETRY_ATOMIC_COUNTERS},
* @def_gl{MAX_COMPUTE_ATOMIC_COUNTERS} or
* @def_gl{MAX_FRAGMENT_ATOMIC_COUNTERS}
* @fn_gl{Get} with @def_gl_keyword{MAX_VERTEX_ATOMIC_COUNTERS},
* @def_gl_keyword{MAX_TESS_CONTROL_ATOMIC_COUNTERS},
* @def_gl_keyword{MAX_TESS_EVALUATION_ATOMIC_COUNTERS},
* @def_gl_keyword{MAX_GEOMETRY_ATOMIC_COUNTERS},
* @def_gl_keyword{MAX_COMPUTE_ATOMIC_COUNTERS} or
* @def_gl_keyword{MAX_FRAGMENT_ATOMIC_COUNTERS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Atomic counters are not available in WebGL.
*/
@ -339,9 +340,9 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_atomic_counters}
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns `0`.
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns @cpp 0 @ce.
* @see @ref maxAtomicCounters(), @ref maxCombinedAtomicCounterBuffers(),
* @fn_gl{Get} with @def_gl{MAX_COMBINED_ATOMIC_COUNTERS}
* @fn_gl{Get} with @def_gl_keyword{MAX_COMBINED_ATOMIC_COUNTERS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Atomic counters are not available in WebGL.
*/
@ -353,14 +354,14 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_image_load_store}
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available or if particular
* shader stage is not available, returns `0`.
* shader stage is not available, returns @cpp 0 @ce.
* @see @ref maxCombinedImageUniforms(),
* @fn_gl{Get} with @def_gl{MAX_VERTEX_IMAGE_UNIFORMS},
* @def_gl{MAX_TESS_CONTROL_IMAGE_UNIFORMS},
* @def_gl{MAX_TESS_EVALUATION_IMAGE_UNIFORMS},
* @def_gl{MAX_GEOMETRY_IMAGE_UNIFORMS},
* @def_gl{MAX_COMPUTE_IMAGE_UNIFORMS} or
* @def_gl{MAX_FRAGMENT_IMAGE_UNIFORMS}
* @fn_gl{Get} with @def_gl_keyword{MAX_VERTEX_IMAGE_UNIFORMS},
* @def_gl_keyword{MAX_TESS_CONTROL_IMAGE_UNIFORMS},
* @def_gl_keyword{MAX_TESS_EVALUATION_IMAGE_UNIFORMS},
* @def_gl_keyword{MAX_GEOMETRY_IMAGE_UNIFORMS},
* @def_gl_keyword{MAX_COMPUTE_IMAGE_UNIFORMS} or
* @def_gl_keyword{MAX_FRAGMENT_IMAGE_UNIFORMS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Shader image load/store is not available in WebGL.
*/
@ -371,9 +372,9 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_image_load_store}
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns `0`.
* (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns @cpp 0 @ce.
* @see @ref maxImageUniforms(),
* @fn_gl{Get} with @def_gl{MAX_COMBINED_IMAGE_UNIFORMS}
* @fn_gl{Get} with @def_gl_keyword{MAX_COMBINED_IMAGE_UNIFORMS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Shader image load/store is not available in WebGL.
*/
@ -385,14 +386,14 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_storage_buffer_object}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available or if particular
* shader stage is not available, returns `0`.
* shader stage is not available, returns @cpp 0 @ce.
* @see @ref maxCombinedShaderStorageBlocks(),
* @fn_gl{Get} with @def_gl{MAX_VERTEX_SHADER_STORAGE_BLOCKS},
* @def_gl{MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS},
* @def_gl{MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS},
* @def_gl{MAX_GEOMETRY_SHADER_STORAGE_BLOCKS},
* @def_gl{MAX_COMPUTE_SHADER_STORAGE_BLOCKS} or
* @def_gl{MAX_FRAGMENT_SHADER_STORAGE_BLOCKS}
* @fn_gl{Get} with @def_gl_keyword{MAX_VERTEX_SHADER_STORAGE_BLOCKS},
* @def_gl_keyword{MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS},
* @def_gl_keyword{MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS},
* @def_gl_keyword{MAX_GEOMETRY_SHADER_STORAGE_BLOCKS},
* @def_gl_keyword{MAX_COMPUTE_SHADER_STORAGE_BLOCKS} or
* @def_gl_keyword{MAX_FRAGMENT_SHADER_STORAGE_BLOCKS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Shader image load/store is not available in WebGL.
*/
@ -403,9 +404,9 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither extension @extension{ARB,shader_storage_buffer_object}
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`.
* (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns @cpp 0 @ce.
* @see @ref maxShaderStorageBlocks(),
* @fn_gl{Get} with @def_gl{MAX_COMBINED_SHADER_STORAGE_BLOCKS}
* @fn_gl{Get} with @def_gl_keyword{MAX_COMBINED_SHADER_STORAGE_BLOCKS}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_gles Shader storage is not available in WebGL.
*/
@ -417,14 +418,14 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If particular shader stage is not available, returns
* `0`.
* @cpp 0 @ce.
* @see @ref maxCombinedTextureImageUnits(),
* @fn_gl{Get} with @def_gl{MAX_VERTEX_TEXTURE_IMAGE_UNITS},
* @def_gl{MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS},
* @def_gl{MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS},
* @def_gl{MAX_GEOMETRY_TEXTURE_IMAGE_UNITS},
* @def_gl{MAX_COMPUTE_TEXTURE_IMAGE_UNITS},
* @def_gl{MAX_TEXTURE_IMAGE_UNITS}
* @fn_gl{Get} with @def_gl_keyword{MAX_VERTEX_TEXTURE_IMAGE_UNITS},
* @def_gl_keyword{MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS},
* @def_gl_keyword{MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS},
* @def_gl_keyword{MAX_GEOMETRY_TEXTURE_IMAGE_UNITS},
* @def_gl_keyword{MAX_COMPUTE_TEXTURE_IMAGE_UNITS},
* @def_gl_keyword{MAX_TEXTURE_IMAGE_UNITS}
*/
static Int maxTextureImageUnits(Type type);
@ -434,7 +435,7 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls.
* @see @ref maxTextureImageUnits(), @fn_gl{Get} with
* @def_gl{MAX_COMBINED_TEXTURE_IMAGE_UNITS}
* @def_gl_keyword{MAX_COMBINED_TEXTURE_IMAGE_UNITS}
*/
static Int maxCombinedTextureImageUnits();
@ -445,15 +446,15 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,uniform_buffer_objects}
* (part of OpenGL 3.1) or particular shader stage is not available,
* returns `0`.
* returns @cpp 0 @ce.
* @see @ref maxCombinedUniformBlocks(), @ref maxUniformComponents(),
* @ref maxCombinedUniformComponents(),
* @fn_gl{Get} with @def_gl{MAX_VERTEX_UNIFORM_BLOCKS},
* @def_gl{MAX_TESS_CONTROL_UNIFORM_BLOCKS},
* @def_gl{MAX_TESS_EVALUATION_UNIFORM_BLOCKS},
* @def_gl{MAX_GEOMETRY_UNIFORM_BLOCKS},
* @def_gl{MAX_COMPUTE_UNIFORM_BLOCKS} or
* @def_gl{MAX_FRAGMENT_UNIFORM_BLOCKS}
* @fn_gl{Get} with @def_gl_keyword{MAX_VERTEX_UNIFORM_BLOCKS},
* @def_gl_keyword{MAX_TESS_CONTROL_UNIFORM_BLOCKS},
* @def_gl_keyword{MAX_TESS_EVALUATION_UNIFORM_BLOCKS},
* @def_gl_keyword{MAX_GEOMETRY_UNIFORM_BLOCKS},
* @def_gl_keyword{MAX_COMPUTE_UNIFORM_BLOCKS} or
* @def_gl_keyword{MAX_FRAGMENT_UNIFORM_BLOCKS}
* @requires_gles30 Uniform blocks are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform blocks are not available in WebGL 1.0.
*/
@ -464,10 +465,10 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,uniform_buffer_objects}
* (part of OpenGL 3.1) is not available, returns `0`.
* (part of OpenGL 3.1) is not available, returns @cpp 0 @ce.
* @see @ref maxUniformBlocks(), @ref maxUniformComponents(),
* @ref maxCombinedUniformComponents(),
* @fn_gl{Get} with @def_gl{MAX_COMBINED_UNIFORM_BLOCKS}
* @fn_gl{Get} with @def_gl_keyword{MAX_COMBINED_UNIFORM_BLOCKS}
* @requires_gles30 Uniform blocks are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform blocks are not available in WebGL 1.0.
*/
@ -479,14 +480,14 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,uniform_buffer_objects}
* (part of OpenGL 3.1) or particular shader stage is not available,
* returns `0`.
* returns @cpp 0 @ce.
* @see @ref maxUniformComponents(), @ref maxUniformBlocks(),
* @fn_gl{Get} with @def_gl{MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS},
* @def_gl{MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS},
* @def_gl{MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS},
* @def_gl{MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS},
* @def_gl{MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS} or
* @def_gl{MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS}
* @fn_gl{Get} with @def_gl_keyword{MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS},
* @def_gl_keyword{MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS},
* @def_gl_keyword{MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS},
* @def_gl_keyword{MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS},
* @def_gl_keyword{MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS} or
* @def_gl_keyword{MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS}
* @requires_gles30 Uniform blocks are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform blocks are not available in WebGL 1.0.
*/
@ -496,14 +497,14 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
/**
* @brief Compile multiple shaders simultaneously
*
* Returns `false` if compilation of any shader failed, `true` if
* everything succeeded. Compiler messages (if any) are printed to
* error output. The operation is batched in a way that allows the
* driver to perform multiple compilations simultaneously (i.e. in
* multiple threads).
* @see @fn_gl{ShaderSource}, @fn_gl{CompileShader}, @fn_gl{GetShader}
* with @def_gl{COMPILE_STATUS} and @def_gl{INFO_LOG_LENGTH},
* @fn_gl{GetShaderInfoLog}
* Returns @cpp false @ce if compilation of any shader failed,
* @cpp true @ce if everything succeeded. Compiler messages (if any)
* are printed to error output. The operation is batched in a way that
* allows the driver to perform multiple compilations simultaneously
* (i.e. in multiple threads).
* @see @fn_gl_keyword{ShaderSource}, @fn_gl_keyword{CompileShader},
* @fn_gl_keyword{GetShader} with @def_gl{COMPILE_STATUS} and
* @def_gl{INFO_LOG_LENGTH}, @fn_gl_keyword{GetShaderInfoLog}
*/
static bool compile(std::initializer_list<std::reference_wrapper<Shader>> shaders);
@ -512,11 +513,11 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* @param version Target version
* @param type Shader type
*
* Creates empty OpenGL shader and adds @c \#version directive
* Creates empty OpenGL shader and adds @glsl #version @ce directive
* corresponding to @p version parameter at the beginning. If
* @ref Version::None is specified, (not) adding the @c \#version
* @ref Version::None is specified, (not) adding the @glsl #version @ce
* directive is left to the user.
* @see @fn_gl{CreateShader}
* @see @fn_gl_keyword{CreateShader}
*/
explicit Shader(Version version, Type type);
@ -530,7 +531,7 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* @brief Destructor
*
* Deletes associated OpenGL shader.
* @see @fn_gl{DeleteShader}
* @see @fn_gl_keyword{DeleteShader}
*/
~Shader();
@ -552,8 +553,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function returns empty string.
* @see @fn_gl{GetObjectLabel} with @def_gl{SHADER} or
* @fn_gl_extension{GetObjectLabel,EXT,debug_label} with
* @see @fn_gl_keyword{GetObjectLabel} with @def_gl{SHADER} or
* @fn_gl_extension_keyword{GetObjectLabel,EXT,debug_label} with
* @def_gl{SHADER_OBJECT_EXT}
* @requires_gles Debug output is not available in WebGL.
*/
@ -567,8 +568,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function does nothing.
* @see @ref maxLabelLength(), @fn_gl{ObjectLabel} with
* @def_gl{SHADER} or @fn_gl_extension{LabelObject,EXT,debug_label}
* @see @ref maxLabelLength(), @fn_gl_keyword{ObjectLabel} with
* @def_gl{SHADER} or @fn_gl_extension_keyword{LabelObject,EXT,debug_label}
* with @def_gl{SHADER_OBJECT_EXT}
* @requires_gles Debug output is not available in WebGL.
*/
@ -593,11 +594,11 @@ class MAGNUM_EXPORT Shader: public AbstractObject {
* @param source String with shader source
* @return Reference to self (for method chaining)
*
* Adds given source to source list, preceeded with @c \#line directive
* marking first line of the source as `n(1)` where n is number of
* added source. The source number `0` is @c \#version directive added
* in constructor, if any. If passed string is empty, the function does
* nothing.
* Adds given source to source list, preceeded with @glsl #line @ce
* directive marking first line of the source as `n(1)` where `n` is
* number of the added source. The source number `0` is
* @glsl #version @ce directive added in the constructor, if any. If
* passed string is empty, the function does nothing.
* @see @ref addFile()
*/
Shader& addSource(std::string source);

291
src/Magnum/Texture.h

@ -64,12 +64,13 @@ namespace Implementation {
Template class for one- to three-dimensional textures. See also
@ref AbstractTexture documentation for more information.
## Usage
@section Texture-usage Usage
Common usage is to fully configure all texture parameters and then set the
data from e.g. @ref Image. Example configuration of high quality texture with
trilinear anisotropic filtering, i.e. the best you can ask for:
@code
@code{.cpp}
Image2D image(PixelFormat::RGBA, PixelType::UnsignedByte, {4096, 4096}, data);
Texture2D texture;
@ -89,11 +90,12 @@ texture.setMagnificationFilter(Sampler::Filter::Linear)
of the mip chain or call @ref setMinificationFilter() with another value to
disable mipmapping.
In shader, the texture is used via `sampler1D`/`sampler2D`/`sampler3D`,
`sampler1DShadow`/`sampler2DShadow`/`sampler3DShadow`,
`isampler1D`/`isampler2D`/`isampler3D` or `usampler1D`/`usampler2D`/`usampler3D`.
See @ref AbstractShaderProgram documentation for more information about usage
in shaders.
In shader, the texture is used via @glsl sampler1D @ce / @glsl sampler2D @ce /
@glsl sampler3D @ce, @glsl sampler1DShadow @ce / @glsl sampler2DShadow @ce /
@glsl sampler3DShadow @ce, @glsl isampler1D @ce / @glsl isampler2D @ce /
@glsl isampler3D @ce or @glsl usampler1D @ce / @glsl usampler2D @ce /
@glsl usampler3D @ce. See @ref AbstractShaderProgram documentation for more
information about usage in shaders.
@see @ref Texture1D, @ref Texture2D, @ref Texture3D, @ref TextureArray,
@ref CubeMapTexture, @ref CubeMapTextureArray, @ref RectangleTexture,
@ -116,8 +118,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* OpenGL calls. For 3D textures in OpenGL ES 2.0, if
* @extension{OES,texture_3D} extension is not available, returns
* zero vector.
* @see @fn_gl{Get} with @def_gl{MAX_TEXTURE_SIZE},
* @def_gl{MAX_3D_TEXTURE_SIZE}
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TEXTURE_SIZE},
* @def_gl_keyword{MAX_3D_TEXTURE_SIZE}
*/
static VectorTypeFor<dimensions, Int> maxSize() {
return Implementation::maxTextureSize<dimensions>();
@ -129,9 +131,9 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
*
* If @p format is compressed, returns compressed block size (in
* pixels). For uncompressed formats returns zero vector.
* @see @ref compressedBlockDataSize(), @fn_gl{GetInternalformat} with
* @def_gl{TEXTURE_COMPRESSED_BLOCK_WIDTH},
* @def_gl{TEXTURE_COMPRESSED_BLOCK_HEIGHT}
* @see @ref compressedBlockDataSize(), @fn_gl_keyword{GetInternalformat}
* with @def_gl_keyword{TEXTURE_COMPRESSED_BLOCK_WIDTH},
* @def_gl_keyword{TEXTURE_COMPRESSED_BLOCK_HEIGHT}
* @requires_gl43 Extension @extension{ARB,internalformat_query2}
* @requires_gl Compressed texture queries are not available in OpenGL
* ES.
@ -145,8 +147,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
*
* If @p format is compressed, returns compressed block data size (in
* bytes). For uncompressed formats returns zero.
* @see @ref compressedBlockSize(), @fn_gl{GetInternalformat} with
* @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE}
* @see @ref compressedBlockSize(), @fn_gl_keyword{GetInternalformat}
* with @def_gl_keyword{TEXTURE_COMPRESSED_BLOCK_SIZE}
* @requires_gl43 Extension @extension{ARB,internalformat_query2}
* @requires_gl Compressed texture queries are not available in OpenGL
* ES.
@ -178,9 +180,9 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* Creates new OpenGL texture object. If @extension{ARB,direct_state_access}
* (part of OpenGL 4.5) is not available, the texture is created on
* first use.
* @see @ref Texture(NoCreateT), @ref wrap(), @fn_gl{CreateTextures}
* @see @ref Texture(NoCreateT), @ref wrap(), @fn_gl_keyword{CreateTextures}
* with @def_gl{TEXTURE_1D}, @def_gl{TEXTURE_2D} or
* @def_gl{TEXTURE_3D}, eventually @fn_gl{GenTextures}
* @def_gl{TEXTURE_3D}, eventually @fn_gl_keyword{GenTextures}
*/
explicit Texture(): AbstractTexture(Implementation::textureTarget<dimensions>()) {}
@ -212,7 +214,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gles31 Shader image load/store is not available in OpenGL
* ES 3.0 and older.
@ -240,7 +242,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gles31 Shader image load/store is not available in OpenGL
* ES 3.0 and older.
@ -291,12 +293,12 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* filtering. If neither @extension{ARB,direct_state_access} (part of
* OpenGL 4.5) nor @extension{EXT,direct_state_access} desktop
* extension is available, the texture is bound before the operation
* (if not already). Initial value is `0`.
* (if not already). Initial value is @cpp 0 @ce.
* @see @ref setMaxLevel(), @ref setMinificationFilter(),
* @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_BASE_LEVEL}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_BASE_LEVEL}
* @requires_gles30 Base level is always `0` in OpenGL ES 2.0.
* @requires_webgl20 Base level is always `0` in WebGL 1.0.
*/
@ -319,10 +321,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* (if not already). Initial value is `1000`, which is clamped to count
* of levels specified when using @ref setStorage().
* @see @ref setBaseLevel(), @ref setMinificationFilter(),
* @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_MAX_LEVEL}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_MAX_LEVEL}
* @requires_gles30 Extension @extension{APPLE,texture_max_level},
* otherwise the max level is always set to largest possible value
* in OpenGL ES 2.0.
@ -349,10 +351,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* (if not already). Initial value is {@ref Sampler::Filter::Nearest,
* @ref Sampler::Mipmap::Linear}.
* @see @ref setMagnificationFilter(), @ref setBaseLevel(),
* @ref setMaxLevel(), @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @ref setMaxLevel(), @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_MIN_FILTER}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_MIN_FILTER}
*/
Texture<dimensions>& setMinificationFilter(Sampler::Filter filter, Sampler::Mipmap mipmap = Sampler::Mipmap::Base) {
AbstractTexture::setMinificationFilter(filter, mipmap);
@ -369,10 +371,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* of OpenGL 4.5) nor @extension{EXT,direct_state_access} desktop
* extension is available, the texture is bound before the operation
* (if not already). Initial value is @ref Sampler::Filter::Linear.
* @see @ref setMinificationFilter(), @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @see @ref setMinificationFilter(), @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_MAG_FILTER}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_MAG_FILTER}
*/
Texture<dimensions>& setMagnificationFilter(Sampler::Filter filter) {
AbstractTexture::setMagnificationFilter(filter);
@ -388,11 +390,11 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @extension{ARB,direct_state_access} (part of OpenGL 4.5) nor
* @extension{EXT,direct_state_access} desktop extension is available,
* the texture is bound before the operation (if not already). Initial
* value is `-1000.0f`.
* @see @ref setMaxLod(), @ref setLodBias(), @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* value is @cpp -1000.0f @ce.
* @see @ref setMaxLod(), @ref setLodBias(), @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_MIN_LOD}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_MIN_LOD}
* @requires_gles30 Texture LOD parameters are not available in OpenGL
* ES 2.0.
* @requires_webgl20 Texture LOD parameters are not available in WebGL
@ -411,11 +413,11 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @extension{ARB,direct_state_access} (part of OpenGL 4.5) nor
* @extension{EXT,direct_state_access} desktop extension is available,
* the texture is bound before the operation (if not already). Initial
* value is `1000.0f`.
* @see @ref setMinLod(), @ref setLodBias(), @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* value is @cpp 1000.0f @ce.
* @see @ref setMinLod(), @ref setLodBias(), @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_MAX_LOD}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_MAX_LOD}
* @requires_gles30 Texture LOD parameters are not available in OpenGL
* ES 2.0.
* @requires_webgl20 Texture LOD parameters are not available in WebGL
@ -436,12 +438,12 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* neither @extension{ARB,direct_state_access} (part of OpenGL 4.5) nor
* @extension{EXT,direct_state_access} is available, the texture is
* bound before the operation (if not already). Initial value is
* `0.0f`.
* @cpp 0.0f @ce.
* @see @ref maxLodBias(), @ref setMinLod(), @ref setMaxLod(),
* @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_LOD_BIAS}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_LOD_BIAS}
* @requires_gl Texture LOD bias can be specified only directly in
* fragment shader in OpenGL ES and WebGL.
*/
@ -461,11 +463,11 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the texture is bound before the operation (if not
* already). Initial value is @ref Sampler::Wrapping::Repeat.
* @see @ref setBorderColor(), @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @see @ref setBorderColor(), @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_WRAP_S},
* @def_gl{TEXTURE_WRAP_T}, @def_gl{TEXTURE_WRAP_R}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_WRAP_S},
* @def_gl_keyword{TEXTURE_WRAP_T}, @def_gl_keyword{TEXTURE_WRAP_R}
*/
Texture<dimensions>& setWrapping(const Array<dimensions, Sampler::Wrapping>& wrapping) {
DataHelper<dimensions>::setWrapping(*this, wrapping);
@ -481,11 +483,11 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* If neither @extension{ARB,direct_state_access} (part of OpenGL 4.5)
* nor @extension{EXT,direct_state_access} is available, the texture is
* bound before the operation (if not already). Initial value is
* `{0.0f, 0.0f, 0.0f, 0.0f}`.
* @see @ref setWrapping(), @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @cpp 0x00000000_rgbaf @ce.
* @see @ref setWrapping(), @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_BORDER_COLOR}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_BORDER_COLOR}
* @requires_es_extension Extension @extension{ANDROID,extension_pack_es31a}/
* @extension{EXT,texture_border_clamp} or
* @extension{NV,texture_border_clamp}
@ -506,11 +508,11 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @extension{ARB,direct_state_access} (part of OpenGL 4.5) nor
* @extension{EXT,direct_state_access} is available, the texture is
* bound before the operation (if not already). Initial value is
* `{0, 0, 0, 0}`.
* @see @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @cpp {0, 0, 0, 0} @ce.
* @see @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_BORDER_COLOR}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_BORDER_COLOR}
* @requires_gl30 Extension @extension{EXT,texture_integer}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_es_extension Extension
@ -542,17 +544,18 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @brief Set max anisotropy
* @return Reference to self (for method chaining)
*
* Default value is `1.0f`, which means no anisotropy. Set to value
* greater than `1.0f` for anisotropic filtering. If extension
* @extension{EXT,texture_filter_anisotropic} (desktop or ES) is not
* available, this function does nothing. If neither
* Default value is @cpp 1.0f @ce, which means no anisotropy. Set to
* value greater than @cpp 1.0f @ce for anisotropic filtering. If
* extension @extension{EXT,texture_filter_anisotropic} (desktop or ES)
* is not available, this function does nothing. If neither
* @extension{ARB,direct_state_access} (part of OpenGL 4.5) nor
* @extension{EXT,direct_state_access} desktop extension is available,
* the texture is bound before the operation (if not already).
* @see @ref Sampler::maxMaxAnisotropy(), @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @see @ref Sampler::maxMaxAnisotropy(), @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_MAX_ANISOTROPY_EXT}
* @fn_gl_keyword{TexParameter} with
* @def_gl_keyword{TEXTURE_MAX_ANISOTROPY_EXT}
*/
Texture<dimensions>& setMaxAnisotropy(Float anisotropy) {
AbstractTexture::setMaxAnisotropy(anisotropy);
@ -568,11 +571,11 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @extension{ARB,direct_state_access} (part of OpenGL 4.5) nor
* @extension{EXT,direct_state_access} desktop extension is available,
* the texture is bound before the operation (if not already). Initial
* value is `true`.
* @see @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* value is @cpp true @ce.
* @see @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_SRGB_DECODE_EXT}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_SRGB_DECODE_EXT}
* @requires_extension Extension @extension{EXT,texture_sRGB_decode}
* @requires_es_extension OpenGL ES 3.0 or extension
* @extension{EXT,sRGB} and
@ -591,22 +594,25 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @brief Set component swizzle
* @return Reference to self (for method chaining)
*
* You can use letters `r`, `g`, `b`, `a` for addressing components or
* letters `0` and `1` for zero and one, similarly as in
* You can use letters @cpp 'r' @ce, @cpp 'g' @ce, @cpp 'b' @ce,
* @cpp 'a' @ce for addressing components or letters @cpp '0' @ce and
* @cpp '1' @ce for zero and one, similarly as in the
* @ref Math::swizzle() function. Example usage:
* @code
*
* @code{.cpp}
* texture.setSwizzle<'b', 'g', 'r', '0'>();
* @endcode
*
* If neither @extension{ARB,direct_state_access} (part of OpenGL 4.5)
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the texture is bound before the operation (if not
* already). Initial value is `rgba`.
* @see @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* already). Initial value is @cpp 'r', 'g', 'b', 'a' @ce.
* @see @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_SWIZZLE_RGBA} (or
* @def_gl{TEXTURE_SWIZZLE_R}, @def_gl{TEXTURE_SWIZZLE_G},
* @def_gl{TEXTURE_SWIZZLE_B} and @def_gl{TEXTURE_SWIZZLE_A}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_SWIZZLE_RGBA} (or
* @def_gl_keyword{TEXTURE_SWIZZLE_R}, @def_gl_keyword{TEXTURE_SWIZZLE_G},
* @def_gl_keyword{TEXTURE_SWIZZLE_B} and @def_gl_keyword{TEXTURE_SWIZZLE_A}
* separately in OpenGL ES)
* @requires_gl33 Extension @extension{ARB,texture_swizzle}
* @requires_gles30 Texture swizzle is not available in OpenGL ES 2.0.
@ -628,10 +634,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* available, the texture is bound before the operation (if not
* already). Initial value is @ref Sampler::CompareMode::None.
* @note Depth textures can be only 1D or 2D.
* @see @ref setCompareFunction(), @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @see @ref setCompareFunction(), @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_COMPARE_MODE}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_COMPARE_MODE}
* @requires_gles30 Extension @extension{EXT,shadow_samplers} in
* OpenGL ES 2.0.
* @requires_webgl20 Depth texture comparison is not available in WebGL
@ -653,10 +659,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* the texture is bound before the operation (if not already). Initial
* value is @ref Sampler::CompareFunction::LessOrEqual.
* @note Depth textures can be only 1D or 2D.
* @see @ref setCompareMode(), @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @see @ref setCompareMode(), @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{TEXTURE_COMPARE_FUNC}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{TEXTURE_COMPARE_FUNC}
* @requires_gles30 Extension @extension{EXT,shadow_samplers} in
* OpenGL ES 2.0.
* @requires_webgl20 Depth texture comparison is not available in WebGL
@ -679,10 +685,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* the texture is bound before the operation (if not already). Initial
* value is @ref Sampler::DepthStencilMode::DepthComponent.
* @note Depth textures can be only 1D or 2D.
* @see @fn_gl2{TextureParameter,TexParameter},
* @fn_gl_extension{TextureParameter,EXT,direct_state_access},
* @see @fn_gl2_keyword{TextureParameter,TexParameter},
* @fn_gl_extension_keyword{TextureParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexParameter} with @def_gl{DEPTH_STENCIL_TEXTURE_MODE}
* @fn_gl_keyword{TexParameter} with @def_gl_keyword{DEPTH_STENCIL_TEXTURE_MODE}
* @requires_gl43 Extension @extension{ARB,stencil_texturing}
* @requires_gles31 Stencil texturing is not available in OpenGL ES 3.0
* and older.
@ -711,13 +717,16 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* 4.2), OpenGL ES 3.0 nor @extension{EXT,texture_storage} in OpenGL
* ES 2.0 is available, the feature is emulated with sequence of
* @ref setImage() calls.
* @see @ref maxSize(), @ref setMaxLevel(), @fn_gl2{TextureStorage1D,TexStorage1D} /
* @fn_gl2{TextureStorage2D,TexStorage2D} / @fn_gl2{TextureStorage3D,TexStorage3D},
* @fn_gl_extension{TextureStorage1D,EXT,direct_state_access} /
* @fn_gl_extension{TextureStorage2D,EXT,direct_state_access} /
* @fn_gl_extension{TextureStorage3D,EXT,direct_state_access},
* @see @ref maxSize(), @ref setMaxLevel(),
* @fn_gl2_keyword{TextureStorage1D,TexStorage1D} /
* @fn_gl2_keyword{TextureStorage2D,TexStorage2D} /
* @fn_gl2_keyword{TextureStorage3D,TexStorage3D},
* @fn_gl_extension_keyword{TextureStorage1D,EXT,direct_state_access} /
* @fn_gl_extension_keyword{TextureStorage2D,EXT,direct_state_access} /
* @fn_gl_extension_keyword{TextureStorage3D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexStorage1D}/@fn_gl{TexStorage2D}/@fn_gl{TexStorage3D}
* @fn_gl_keyword{TexStorage1D} / @fn_gl_keyword{TexStorage2D} /
* @fn_gl_keyword{TexStorage3D}
* @todo allow the user to specify PixelType explicitly to avoid
* issues in WebGL (see setSubImage())
*/
@ -734,11 +743,12 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @extension{ARB,direct_state_access} (part of OpenGL 4.5) nor
* @extension{EXT,direct_state_access} desktop extension is available,
* the texture is bound before the operation (if not already).
* @see @ref image(), @fn_gl2{GetTextureLevelParameter,GetTexLevelParameter},
* @see @ref image(), @fn_gl2_keyword{GetTextureLevelParameter,GetTexLevelParameter},
* @fn_gl_extension{GetTextureLevelParameter,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{GetTexLevelParameter} with @def_gl{TEXTURE_WIDTH},
* @def_gl{TEXTURE_HEIGHT}, @def_gl{TEXTURE_DEPTH}
* @fn_gl_keyword{GetTexLevelParameter} with
* @def_gl_keyword{TEXTURE_WIDTH}, @def_gl_keyword{TEXTURE_HEIGHT},
* @def_gl_keyword{TEXTURE_DEPTH}
* @requires_gles31 Texture image size queries are not available in
* OpenGL ES 3.0 and older.
* @requires_gles Texture image size queries are not available in
@ -773,10 +783,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{GetTexLevelParameter} with @def_gl{TEXTURE_WIDTH},
* @def_gl{TEXTURE_HEIGHT}, @def_gl{TEXTURE_DEPTH}, then
* @fn_gl{PixelStore}, then @fn_gl2{GetTextureImage,GetTexImage},
* @fn_gl_extension{GetnTexImage,ARB,robustness},
* @fn_gl_extension{GetTextureImage,EXT,direct_state_access},
* eventually @fn_gl{GetTexImage}
* @fn_gl{PixelStore}, then @fn_gl2_keyword{GetTextureImage,GetTexImage},
* @fn_gl_extension_keyword{GetnTexImage,ARB,robustness},
* @fn_gl_extension_keyword{GetTextureImage,EXT,direct_state_access},
* eventually @fn_gl_keyword{GetTexImage}
* @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround.
*/
@ -787,7 +797,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image2D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
@ -814,7 +825,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage2D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
@ -844,10 +856,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @def_gl{TEXTURE_INTERNAL_FORMAT}, @def_gl{TEXTURE_WIDTH},
* @def_gl{TEXTURE_HEIGHT}, @def_gl{TEXTURE_DEPTH}, then
* @fn_gl{PixelStore}, then
* @fn_gl2{GetCompressedTextureImage,GetCompressedTexImage},
* @fn_gl_extension{GetnCompressedTexImage,ARB,robustness},
* @fn_gl_extension{GetCompressedTextureImage,EXT,direct_state_access},
* eventually @fn_gl{GetCompressedTexImage}
* @fn_gl2_keyword{GetCompressedTextureImage,GetCompressedTexImage},
* @fn_gl_extension_keyword{GetnCompressedTexImage,ARB,robustness},
* @fn_gl_extension_keyword{GetCompressedTextureImage,EXT,direct_state_access},
* eventually @fn_gl_keyword{GetCompressedTexImage}
* @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround.
*/
@ -858,7 +870,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage2D image = texture.compressedImage(0, {});
* @endcode
*/
@ -885,7 +898,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage2D image = texture.compressedImage(0, {}, BufferUsage::StaticRead);
* @endcode
*/
@ -902,7 +916,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* contain the new data.
*
* The operation is protected from buffer overflow.
* @see @fn_gl{GetTextureSubImage}
* @see @fn_gl_keyword{GetTextureSubImage}
* @requires_gl45 Extension @extension{ARB,get_texture_sub_image}
* @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround.
@ -914,7 +928,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image2D image = texture.subImage(0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
@ -942,7 +957,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage2D image = texture.subImage(0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
@ -962,7 +978,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @fn_gl{GetInternalformat} with @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE},
* @def_gl{TEXTURE_COMPRESSED_BLOCK_WIDTH} and
* @def_gl{TEXTURE_COMPRESSED_BLOCK_HEIGHT}, then
* @fn_gl{GetCompressedTextureSubImage}
* @fn_gl_keyword{GetCompressedTextureSubImage}
* @requires_gl45 Extension @extension{ARB,get_texture_sub_image}
* @requires_gl43 Extension @extension{ARB,internalformat_query2} if
* @ref CompressedPixelStorage::compressedBlockSize() and
@ -978,7 +994,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage2D image = texture.compressedSubImage(0, rect, {});
* @endcode
*/
@ -1008,7 +1025,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage2D image = texture.compressedSubImage(0, rect, {}, BufferUsage::StaticRead);
* @endcode
*/
@ -1029,8 +1047,9 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* equivalent in @extension{ARB,direct_state_access}, thus the texture
* needs to be bound to some texture unit before the operation.
* @see @ref maxSize(), @ref Framebuffer::copyImage(), @fn_gl{PixelStore},
* then @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexImage1D}
* / @fn_gl{TexImage2D} / @fn_gl{TexImage3D}
* then @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl_keyword{TexImage1D} / @fn_gl_keyword{TexImage2D} /
* @fn_gl_keyword{TexImage3D}
* @deprecated_gl Prefer to use @ref setStorage() and @ref setSubImage()
* instead.
*/
@ -1080,8 +1099,9 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* the texture needs to be bound to some texture unit before the
* operation.
* @see @ref maxSize(), @fn_gl{PixelStore}, then @fn_gl{ActiveTexture},
* @fn_gl{BindTexture} and @fn_gl{CompressedTexImage1D} /
* @fn_gl{CompressedTexImage2D} / @fn_gl{CompressedTexImage3D}
* @fn_gl{BindTexture} and @fn_gl_keyword{CompressedTexImage1D} /
* @fn_gl_keyword{CompressedTexImage2D} /
* @fn_gl_keyword{CompressedTexImage3D}
* @deprecated_gl Prefer to use @ref setStorage() and
* @ref setCompressedSubImage() instead.
*/
@ -1130,13 +1150,15 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* available, the texture is bound before the operation (if not
* already).
* @see @ref setStorage(), @ref Framebuffer::copySubImage(),
* @fn_gl{PixelStore}, @fn_gl2{TextureSubImage1D,TexSubImage1D} /
* @fn_gl2{TextureSubImage2D,TexSubImage2D} / @fn_gl2{TextureSubImage3D,TexSubImage3D},
* @fn_gl_extension{TextureSubImage1D,EXT,direct_state_access} /
* @fn_gl_extension{TextureSubImage2D,EXT,direct_state_access} /
* @fn_gl_extension{TextureSubImage3D,EXT,direct_state_access},
* @fn_gl{PixelStore}, @fn_gl2_keyword{TextureSubImage1D,TexSubImage1D} /
* @fn_gl2_keyword{TextureSubImage2D,TexSubImage2D} /
* @fn_gl2_keyword{TextureSubImage3D,TexSubImage3D},
* @fn_gl_extension_keyword{TextureSubImage1D,EXT,direct_state_access} /
* @fn_gl_extension_keyword{TextureSubImage2D,EXT,direct_state_access} /
* @fn_gl_extension_keyword{TextureSubImage3D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexSubImage1D} / @fn_gl{TexSubImage2D} / @fn_gl{TexSubImage3D}
* @fn_gl_keyword{TexSubImage1D} / @fn_gl_keyword{TexSubImage2D} /
* @fn_gl_keyword{TexSubImage3D}
* @requires_gles In @ref MAGNUM_TARGET_WEBGL "WebGL" the @ref PixelType
* of data passed in @p image must match the original one
* specified in @ref setImage(). It means that you might not be
@ -1184,15 +1206,16 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* available, the texture is bound before the operation (if not
* already).
* @see @ref setStorage(), @fn_gl{PixelStore},
* @fn_gl2{CompressedTextureSubImage1D,CompressedTexSubImage1D} /
* @fn_gl2{CompressedTextureSubImage2D,CompressedTexSubImage2D} /
* @fn_gl2{CompressedTextureSubImage3D,CompressedTexSubImage3D},
* @fn_gl_extension{CompressedTextureSubImage1D,EXT,direct_state_access} /
* @fn_gl_extension{CompressedTextureSubImage2D,EXT,direct_state_access} /
* @fn_gl_extension{CompressedTextureSubImage3D,EXT,direct_state_access},
* @fn_gl2_keyword{CompressedTextureSubImage1D,CompressedTexSubImage1D} /
* @fn_gl2_keyword{CompressedTextureSubImage2D,CompressedTexSubImage2D} /
* @fn_gl2_keyword{CompressedTextureSubImage3D,CompressedTexSubImage3D},
* @fn_gl_extension_keyword{CompressedTextureSubImage1D,EXT,direct_state_access} /
* @fn_gl_extension_keyword{CompressedTextureSubImage2D,EXT,direct_state_access} /
* @fn_gl_extension_keyword{CompressedTextureSubImage3D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CompressedTexSubImage1D} / @fn_gl{CompressedTexSubImage2D} /
* @fn_gl{CompressedTexSubImage3D}
* @fn_gl_keyword{CompressedTexSubImage1D} /
* @fn_gl_keyword{CompressedTexSubImage2D} /
* @fn_gl_keyword{CompressedTexSubImage3D}
*/
Texture<dimensions>& setCompressedSubImage(Int level, const VectorTypeFor<dimensions, Int>& offset, const CompressedImageView<dimensions>& image) {
DataHelper<Dimensions>::setCompressedSubImage(*this, level, offset, image);
@ -1230,10 +1253,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* nor @extension{EXT,direct_state_access} desktop extension is
* available, the texture is bound before the operation (if not
* already).
* @see @ref setMinificationFilter(), @fn_gl2{GenerateTextureMipmap,GenerateMipmap},
* @fn_gl_extension{GenerateTextureMipmap,EXT,direct_state_access},
* @see @ref setMinificationFilter(), @fn_gl2_keyword{GenerateTextureMipmap,GenerateMipmap},
* @fn_gl_extension_keyword{GenerateTextureMipmap,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{GenerateMipmap}
* @fn_gl_keyword{GenerateMipmap}
* @requires_gl30 Extension @extension{ARB,framebuffer_object}
*/
Texture<dimensions>& generateMipmap() {
@ -1247,7 +1270,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
*
* If running on OpenGL ES or extension @extension{ARB,invalidate_subdata}
* (part of OpenGL 4.3) is not available, this function does nothing.
* @see @ref invalidateSubImage(), @fn_gl{InvalidateTexImage}
* @see @ref invalidateSubImage(), @fn_gl_keyword{InvalidateTexImage}
*/
void invalidateImage(Int level) { AbstractTexture::invalidateImage(level); }
@ -1259,7 +1282,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
*
* If running on OpenGL ES or extension @extension{ARB,invalidate_subdata}
* (part of OpenGL 4.3) is not available, this function does nothing.
* @see @ref invalidateImage(), @fn_gl{InvalidateTexSubImage}
* @see @ref invalidateImage(), @fn_gl_keyword{InvalidateTexSubImage}
*/
void invalidateSubImage(Int level, const VectorTypeFor<dimensions, Int>& offset, const VectorTypeFor<dimensions, Int>& size) {
DataHelper<dimensions>::invalidateSubImage(*this, level, offset, size);

141
src/Magnum/TextureArray.h

@ -53,13 +53,14 @@ namespace Implementation {
Template class for one- and two-dimensional texture arrays. See also
@ref AbstractTexture documentation for more information.
## Usage
@section TextureArray-usage Usage
See @ref Texture documentation for introduction.
Common usage is to fully configure all texture parameters and then set the
data. Example configuration:
@code
@code{.cpp}
Texture2DArray texture;
texture.setMagnificationFilter(Sampler::Filter::Linear)
.setMinificationFilter(Sampler::Filter::Linear, Sampler::Mipmap::Linear)
@ -70,7 +71,8 @@ texture.setMagnificationFilter(Sampler::Filter::Linear)
It is often more convenient to first allocate the memory for all layers by
calling @ref setStorage() and then specify each layer separately using
@ref setSubImage():
@code
@code{.cpp}
texture.setStorage(levels, TextureFormat::RGBA8, {64, 64, 16});
for(std::size_t i = 0; i != 16; ++i) {
@ -79,10 +81,11 @@ for(std::size_t i = 0; i != 16; ++i) {
}
@endcode
In shader, the texture is used via `sampler1DArray`/`sampler2DArray`,
`sampler1DArrayShadow`/`sampler1DArrayShadow`, `isampler1DArray`/`isampler2DArray`
or `usampler1DArray`/`usampler2DArray`. See @ref AbstractShaderProgram
documentation for more information about usage in shaders.
In shader, the texture is used via @glsl sampler1DArray @ce / @glsl sampler2DArray @ce,
@glsl sampler1DArrayShadow @ce / @glsl sampler1DArrayShadow @ce, @glsl isampler1DArray @ce
/ @glsl isampler2DArray @ce or @glsl usampler1DArray @ce / @glsl usampler2DArray @ce.
See @ref AbstractShaderProgram documentation for more information about usage
in shaders.
@see @ref Texture1DArray, @ref Texture2DArray, @ref Texture,
@ref CubeMapTexture, @ref CubeMapTextureArray, @ref RectangleTexture,
@ -106,14 +109,14 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{EXT,texture_array} (part of
* OpenGL 3.0) is not available, returns zero vector.
* @see @fn_gl{Get} with @def_gl{MAX_TEXTURE_SIZE} and
* @def_gl{MAX_ARRAY_TEXTURE_LAYERS}
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TEXTURE_SIZE} and
* @def_gl_keyword{MAX_ARRAY_TEXTURE_LAYERS}
*/
static VectorTypeFor<dimensions+1, Int> maxSize();
#ifndef MAGNUM_TARGET_GLES
/**
* @copybrief Texture::compressedBlockSize()
* @brief @copybrief Texture::compressedBlockSize()
*
* See @ref Texture::compressedBlockSize() for more information.
* @requires_gl43 Extension @extension{ARB,internalformat_query2}
@ -125,14 +128,14 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::compressedBlockDataSize()
* @brief @copybrief Texture::compressedBlockDataSize()
*
* See @ref Texture::compressedBlockDataSize() for more information.
* @requires_gl43 Extension @extension{ARB,internalformat_query2}
* @requires_gl Compressed texture queries are not available in OpenGL
* ES.
* @see @ref compressedBlockSize(), @fn_gl{Getinternalformat} with
* @def_gl{TEXTURE_COMPRESSED_BLOCK_SIZE}
* @def_gl_keyword{TEXTURE_COMPRESSED_BLOCK_SIZE}
*/
static Int compressedBlockDataSize(TextureFormat format) {
return AbstractTexture::compressedBlockDataSize(Implementation::textureArrayTarget<dimensions>(), format);
@ -161,9 +164,9 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* Creates new OpenGL texture object. If @extension{ARB,direct_state_access}
* (part of OpenGL 4.5) is not available, the texture is created on
* first use.
* @see @ref TextureArray(NoCreateT), @ref wrap(), @fn_gl{CreateTextures}
* @see @ref TextureArray(NoCreateT), @ref wrap(), @fn_gl_keyword{CreateTextures}
* with @def_gl{TEXTURE_1D_ARRAY} or @def_gl{TEXTURE_2D_ARRAY},
* eventually @fn_gl{GenTextures}
* eventually @fn_gl_keyword{GenTextures}
*/
explicit TextureArray(): AbstractTexture(Implementation::textureArrayTarget<dimensions>()) {}
@ -195,7 +198,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref bindImageLayered(), @ref unbindImage(), @ref unbindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gles31 Shader image load/store is not available in OpenGL
* ES 3.0 and older.
@ -218,7 +221,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* @see @ref bindImages(Int, std::initializer_list<AbstractTexture*>),
* @ref bindImage(), @ref unbindImage(), @ref unbindImages(),
* @ref AbstractShaderProgram::maxImageUnits(),
* @fn_gl{BindImageTexture}
* @fn_gl_keyword{BindImageTexture}
* @requires_gl42 Extension @extension{ARB,shader_image_load_store}
* @requires_gles31 Shader image load/store is not available in OpenGL
* ES 3.0 and older.
@ -230,7 +233,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#endif
/**
* @copybrief Texture::setBaseLevel()
* @brief @copybrief Texture::setBaseLevel()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBaseLevel() for more information.
@ -241,7 +244,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMaxLevel()
* @brief @copybrief Texture::setMaxLevel()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMaxLevel() for more information.
@ -252,7 +255,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMinificationFilter()
* @brief @copybrief Texture::setMinificationFilter()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMinificationFilter() for more information.
@ -263,7 +266,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMagnificationFilter()
* @brief @copybrief Texture::setMagnificationFilter()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMagnificationFilter() for more information.
@ -274,7 +277,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMinLod()
* @brief @copybrief Texture::setMinLod()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMinLod() for more information.
@ -285,7 +288,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setMaxLod()
* @brief @copybrief Texture::setMaxLod()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMaxLod() for more information.
@ -297,7 +300,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#ifndef MAGNUM_TARGET_GLES
/**
* @copybrief Texture::setLodBias()
* @brief @copybrief Texture::setLodBias()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setLodBias() for more information.
@ -311,7 +314,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#endif
/**
* @copybrief Texture::setWrapping()
* @brief @copybrief Texture::setWrapping()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setWrapping() for more information.
@ -323,7 +326,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#ifndef MAGNUM_TARGET_WEBGL
/**
* @copybrief Texture::setBorderColor(const Color4&)
* @brief @copybrief Texture::setBorderColor(const Color4&)
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Color4&) for more
@ -339,7 +342,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setBorderColor(const Vector4ui&)
* @brief @copybrief Texture::setBorderColor(const Vector4ui&)
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Vector4ui&) for more
@ -367,7 +370,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#endif
/**
* @copybrief Texture::setMaxAnisotropy()
* @brief @copybrief Texture::setMaxAnisotropy()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setMaxAnisotropy() for more information.
@ -379,7 +382,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#ifndef MAGNUM_TARGET_WEBGL
/**
* @copybrief Texture::setSRGBDecode()
* @brief @copybrief Texture::setSRGBDecode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setSRGBDecode() for more information.
@ -394,7 +397,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setSwizzle()
* @brief @copybrief Texture::setSwizzle()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setSwizzle() for more information.
@ -407,7 +410,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#endif
/**
* @copybrief Texture::setCompareMode()
* @brief @copybrief Texture::setCompareMode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompareMode() for more information.
@ -418,7 +421,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setCompareFunction()
* @brief @copybrief Texture::setCompareFunction()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompareFunction() for more information.
@ -430,7 +433,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#ifndef MAGNUM_TARGET_WEBGL
/**
* @copybrief Texture::setDepthStencilMode()
* @brief @copybrief Texture::setDepthStencilMode()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setDepthStencilMode() for more information.
@ -446,7 +449,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#endif
/**
* @copybrief Texture::setStorage()
* @brief @copybrief Texture::setStorage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setStorage() for more information.
@ -459,7 +462,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#ifndef MAGNUM_TARGET_WEBGL
/**
* @copybrief Texture::imageSize()
* @brief @copybrief Texture::imageSize()
*
* See @ref Texture::imageSize() for more information.
* @requires_gles31 Texture image size queries are not available in
@ -474,7 +477,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#ifndef MAGNUM_TARGET_GLES
/**
* @copybrief Texture::image(Int, Image&)
* @brief @copybrief Texture::image(Int, Image&)
*
* See @ref Texture::image(Int, Image&) for more information.
* @requires_gl Texture image queries are not available in OpenGL ES or
@ -487,14 +490,15 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
Image<dimensions+1> image(Int level, Image<dimensions+1>&& image);
/**
* @copybrief Texture::image(Int, BufferImage&, BufferUsage)
* @brief @copybrief Texture::image(Int, BufferImage&, BufferUsage)
*
* See @ref Texture::image(Int, BufferImage&, BufferUsage) for more
* information.
@ -508,14 +512,15 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage3D image = texture.image(0, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
BufferImage<dimensions+1> image(Int level, BufferImage<dimensions+1>&& image, BufferUsage usage);
/**
* @copybrief Texture::compressedImage(Int, CompressedImage&)
* @brief @copybrief Texture::compressedImage(Int, CompressedImage&)
*
* See @ref Texture::compressedImage(Int, CompressedImage&) for more
* information.
@ -529,14 +534,15 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage3D image = texture.compressedImage(0, {});
* @endcode
*/
CompressedImage<dimensions+1> compressedImage(Int level, CompressedImage<dimensions+1>&& image);
/**
* @copybrief Texture::compressedImage(Int, CompressedBufferImage&, BufferUsage)
* @brief @copybrief Texture::compressedImage(Int, CompressedBufferImage&, BufferUsage)
*
* See @ref Texture::compressedImage(Int, CompressedBufferImage&, BufferUsage)
* for more information.
@ -550,14 +556,15 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage3D image = texture.compressedImage(0, {}, BufferUsage::StaticRead);
* @endcode
*/
CompressedBufferImage<dimensions+1> compressedImage(Int level, CompressedBufferImage<dimensions+1>&& image, BufferUsage usage);
/**
* @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
* @brief @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
*
* See @ref Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, Image&)
* for more information.
@ -572,14 +579,15 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* Image3D image = texture.subImage(0, range, {PixelFormat::RGBA, PixelType::UnsignedByte});
* @endcode
*/
Image<dimensions+1> subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, Image<dimensions+1>&& image);
/**
* @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
* @brief @copybrief Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
*
* See @ref Texture::subImage(Int, const RangeTypeFor<dimensions, Int>&, BufferImage&, BufferUsage)
* for more information.
@ -594,14 +602,15 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* BufferImage3D image = texture.subImage(0, range, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
* @endcode
*/
BufferImage<dimensions+1> subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, BufferImage<dimensions+1>&& image, BufferUsage usage);
/**
* @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
* @brief @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
*
* See @ref Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedImage&)
* for more information.
@ -620,14 +629,15 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedImage3D image = texture.compressedSubImage(0, range, {});
* @endcode
*/
CompressedImage<dimensions+1> compressedSubImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, CompressedImage<dimensions+1>&& image);
/**
* @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
* @brief @copybrief Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
*
* See @ref Texture::compressedSubImage(Int, const RangeTypeFor<dimensions, Int>&, CompressedBufferImage&, BufferUsage)
* for more information.
@ -646,7 +656,8 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
/** @overload
*
* Convenience alternative to the above, example usage:
* @code
*
* @code{.cpp}
* CompressedBufferImage3D image = texture.compressedSubImage(0, range, {}, BufferUsage::StaticRead);
* @endcode
*/
@ -654,7 +665,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
#endif
/**
* @copybrief Texture::setImage()
* @brief @copybrief Texture::setImage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setImage() for more information.
@ -685,7 +696,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::setCompressedImage()
* @brief @copybrief Texture::setCompressedImage()
* @return Reference to self (for method chaining)
*
* See @ref Texture::setCompressedImage() for more information.
@ -728,12 +739,12 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* available, the texture is bound before the operation (if not
* already).
* @see @ref setStorage(), @fn_gl{PixelStore}, then
* @fn_gl2{TextureSubImage2D,TexSubImage2D}/
* @fn_gl2{TextureSubImage3D,TexSubImage3D},
* @fn_gl_extension{TextureSubImage2D,EXT,direct_state_access}/
* @fn_gl_extension{TextureSubImage3D,EXT,direct_state_access},
* @fn_gl2_keyword{TextureSubImage2D,TexSubImage2D}/
* @fn_gl2_keyword{TextureSubImage3D,TexSubImage3D},
* @fn_gl_extension_keyword{TextureSubImage2D,EXT,direct_state_access}/
* @fn_gl_extension_keyword{TextureSubImage3D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{TexSubImage2D}/@fn_gl{TexSubImage3D}
* @fn_gl_keyword{TexSubImage2D} / @fn_gl_keyword{TexSubImage3D}
*/
TextureArray<dimensions>& setSubImage(Int level, const VectorTypeFor<dimensions+1, Int>& offset, const ImageView<dimensions+1>& image) {
DataHelper<dimensions+1>::setSubImage(*this, level, offset, image);
@ -764,12 +775,12 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* available, the texture is bound before the operation (if not
* already).
* @see @ref setStorage(), @fn_gl{PixelStore}, then
* @fn_gl2{CompressedTextureSubImage2D,CompressedTexSubImage2D}/
* @fn_gl2{CompressedTextureSubImage3D,CompressedTexSubImage3D},
* @fn_gl_extension{CompressedTextureSubImage2D,EXT,direct_state_access}/
* @fn_gl_extension{CompressedTextureSubImage3D,EXT,direct_state_access},
* @fn_gl2_keyword{CompressedTextureSubImage2D,CompressedTexSubImage2D}/
* @fn_gl2_keyword{CompressedTextureSubImage3D,CompressedTexSubImage3D},
* @fn_gl_extension_keyword{CompressedTextureSubImage2D,EXT,direct_state_access}/
* @fn_gl_extension_keyword{CompressedTextureSubImage3D,EXT,direct_state_access},
* eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{CompressedTexSubImage2D}/@fn_gl{CompressedTexSubImage3D}
* @fn_gl_keyword{CompressedTexSubImage2D} / @fn_gl_keyword{CompressedTexSubImage3D}
*/
TextureArray<dimensions>& setCompressedSubImage(Int level, const VectorTypeFor<dimensions+1, Int>& offset, const CompressedImageView<dimensions+1>& image) {
DataHelper<dimensions+1>::setCompressedSubImage(*this, level, offset, image);
@ -788,7 +799,7 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::generateMipmap()
* @brief @copybrief Texture::generateMipmap()
* @return Reference to self (for method chaining)
*
* See @ref Texture::generateMipmap() for more information.
@ -800,14 +811,14 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
}
/**
* @copybrief Texture::invalidateImage()
* @brief @copybrief Texture::invalidateImage()
*
* See @ref Texture::invalidateImage() for more information.
*/
void invalidateImage(Int level) { AbstractTexture::invalidateImage(level); }
/**
* @copybrief Texture::invalidateSubImage()
* @brief @copybrief Texture::invalidateSubImage()
*
* See @ref Texture::invalidateSubImage() for more information.
*/

1
src/Magnum/TextureFormat.h

@ -44,6 +44,7 @@ documentation of these values for possible limitations when using OpenGL ES 2.0
or WebGL.
@see @ref Texture, @ref CubeMapTexture, @ref CubeMapTextureArray
@m_enum_values_as_keywords
*/
enum class TextureFormat: GLenum {
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))

40
src/Magnum/TimeQuery.h

@ -46,7 +46,8 @@ namespace Magnum {
Queries timestamp after all previous OpenGL calls have been processed. It can
query either duration of sequence of commands or absolute timestamp. Example
usage of both methods:
@code
@code{.cpp}
TimeQuery q1, q2;
q1.begin(TimeQuery::Target::TimeElapsed);
// rendering...
@ -57,7 +58,8 @@ q2.end();
UnsignedInt timeElapsed1 = q1.result<UnsignedInt>();
UnsignedInt timeElapsed2 = q2.result<UnsignedInt>();
@endcode
@code
@code{.cpp}
TimeQuery q1, q2, q3;
q1.timestamp();
// rendering...
@ -68,18 +70,24 @@ UnsignedInt tmp = q2.result<UnsignedInt>();
UnsignedInt timeElapsed1 = tmp-q1.result<UnsignedInt>();
UnsignedInt timeElapsed2 = q3.result<UnsignedInt>()-tmp;
@endcode
Using the latter results in fewer OpenGL calls when doing more measures.
@requires_gl33 Extension @extension{ARB,timer_query}
@requires_es_extension Extension @extension{EXT,disjoint_timer_query}
@requires_gles Time query is not available in WebGL.
@see @ref PrimitiveQuery, @ref SampleQuery
@todo timestamp with glGet + example usage
@todo @extension{EXT,disjoint_timer_query} -- GL_GPU_DISJOINT_EXT support? where?
@todo @extension{EXT,disjoint_timer_query} --- GL_GPU_DISJOINT_EXT support? where?
*/
class TimeQuery: public AbstractQuery {
public:
/** @brief Query target */
/**
* @brief Query target
*
* @m_enum_values_as_keywords
*/
enum class Target: GLenum {
/**
* Elapsed time. Use @ref result<UnsignedLong>() or @ref result<Long>()
@ -104,14 +112,6 @@ class TimeQuery: public AbstractQuery {
#endif
};
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief TimeQuery(Target)
* @deprecated Use @ref TimeQuery(Target) instead.
*/
CORRADE_DEPRECATED("use TimeQuery(Target) instead") explicit TimeQuery() {}
#endif
/**
* @brief Wrap existing OpenGL time query object
* @param id OpenGL time query ID
@ -128,14 +128,22 @@ class TimeQuery: public AbstractQuery {
return TimeQuery{id, target, flags};
}
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief TimeQuery(Target)
* @deprecated Use @ref TimeQuery(Target) instead.
*/
CORRADE_DEPRECATED("use TimeQuery(Target) instead") explicit TimeQuery() {}
#endif
/**
* @brief Constructor
*
* Creates new OpenGL query object. If @extension{ARB,direct_state_access}
* (part of OpenGL 4.5) is not available, the query is created on first
* use.
* @see @ref TimeQuery(NoCreateT), @ref wrap(), @fn_gl{CreateQueries},
* eventually @fn_gl{GenQueries}
* @see @ref TimeQuery(NoCreateT), @ref wrap(), @fn_gl_keyword{CreateQueries},
* eventually @fn_gl_keyword{GenQueries}
*/
explicit TimeQuery(Target target): AbstractQuery(GLenum(target)) {}
@ -169,7 +177,7 @@ class TimeQuery: public AbstractQuery {
*
* Use @ref result<UnsignedLong>() or @ref result<Long>() to retrieve
* the result.
* @see @fn_gl{QueryCounter} with @def_gl{TIMESTAMP}
* @see @fn_gl_keyword{QueryCounter} with @def_gl{TIMESTAMP}
*/
void timestamp() {
#ifndef MAGNUM_TARGET_GLES
@ -183,7 +191,7 @@ class TimeQuery: public AbstractQuery {
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @copybrief AbstractQuery::begin()
* @brief @copybrief AbstractQuery::begin()
* @deprecated Use @ref AbstractQuery::begin() instead.
*/
CORRADE_DEPRECATED("use begin() instead") void begin(Target target) {

17
src/Magnum/Timeline.h

@ -46,7 +46,7 @@ namespace Magnum {
Keeps track of time delta between frames. Can be used as source for animation
speed computations.
## Basic usage
@section Timeline-usage Basic usage
Construct the timeline on initialization so the instance is available for
whole lifetime of the application. Call @ref start() before first draw event is
@ -67,8 +67,9 @@ Note that on @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" the framerate is
governed by browser and you can't do anything about it.
Example usage:
@code
MyApplication::MyApplication(const Parameters& parameters): Platform::Application(parameters) {
@code{.cpp}
MyApplication::MyApplication(const Arguments& arguments): Platform::Application{arguments} {
// Initialization ...
// Enable VSync or set minimal loop period for the application, if
@ -115,8 +116,8 @@ class MAGNUM_EXPORT Timeline {
* @brief Set minimal frame time
* @return Reference to self (for method chaining)
*
* Default value is `0.0f`. Cannot be used on some platforms where
* blocking the main loop is not allowed (such as
* Default value is @cpp 0.0f @ce. Cannot be used on some platforms
* where blocking the main loop is not allowed (such as
* @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten").
* @deprecated Use @ref Platform::Sdl2Application::setSwapInterval() "Platform::*Application::setSwapInterval()" or
* @ref Platform::Sdl2Application::setMinimalLoopPeriod() "Platform::*Application::setMinimalLoopPeriod()"
@ -131,7 +132,7 @@ class MAGNUM_EXPORT Timeline {
/**
* @brief Start timeline
*
* Sets previous frame time and duration to `0`.
* Sets previous frame time and duration to @cpp 0 @ce.
* @see @ref stop(), @ref previousFrameDuration()
*/
void start();
@ -155,14 +156,14 @@ class MAGNUM_EXPORT Timeline {
* @brief Time at previous frame (in seconds)
*
* Returns time elapsed since start() was called. If the timeline is
* stopped, the function returns `0.0f`.
* stopped, the function returns @cpp 0.0f @ce.
*/
Float previousFrameTime() const;
/**
* @brief Duration of previous frame (in seconds)
*
* If the timeline is stopped, the function returns `0.0f`.
* If the timeline is stopped, the function returns @cpp 0.0f @ce.
*/
Float previousFrameDuration() const { return _previousFrameDuration; }

78
src/Magnum/TransformFeedback.h

@ -44,10 +44,10 @@ namespace Implementation { struct TransformFeedbackState; }
/**
@brief Transform feedback
## Performance optimizations
@section TransformFeedback-performance-optimizations Performance optimizations
The engine tracks currently bound transform feedback to avoid unnecessary calls
to @fn_gl{BindTransformFeedback}. Transform feedback limits and
to @fn_gl_keyword{BindTransformFeedback}. Transform feedback limits and
implementation-defined values (such as @ref maxSeparateComponents()) are
cached, so repeated queries don't result in repeated @fn_gl{Get} calls. See
also @ref Context::resetState() and @ref Context::State::TransformFeedback.
@ -71,13 +71,14 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @brief Transform feedback primitive mode
*
* @see @ref begin()
* @m_enum_values_as_keywords
*/
enum class PrimitiveMode: GLenum {
/**
* Points. If no geometry shader is present, allowed only in
* combination with @ref MeshPrimitive::Points mesh primitive type.
* If geometry shader is present, allowed only in combination with
* `points` output primitive type.
* @glsl points @ce output primitive type.
*/
Points = GL_POINTS,
@ -88,7 +89,7 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @ref MeshPrimitive::LineStripAdjacency and
* @ref MeshPrimitive::LinesAdjacency mesh primitive type. If
* geometry shader is present, allowed only in combination with
* `line_strip` output primitive type.
* @glsl line_strip @ce output primitive type.
*/
Lines = GL_LINES,
@ -99,7 +100,7 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @ref MeshPrimitive::TriangleStripAdjacency and
* @ref MeshPrimitive::TrianglesAdjacency mesh primitive type. If
* geometry shader is present, allowed only in commbination with
* `triangle_strip` output primitive type.
* @glsl triangle_strip @ce output primitive type.
*/
Triangles = GL_TRIANGLES
};
@ -109,8 +110,8 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{EXT,transform_feedback}
* (part of OpenGL 3.0) is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS}
* (part of OpenGL 3.0) is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS}
*/
static Int maxInterleavedComponents();
@ -119,8 +120,8 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{EXT,transform_feedback}
* (part of OpenGL 3.0) is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS}
* (part of OpenGL 3.0) is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS}
*/
static Int maxSeparateAttributes();
@ -129,8 +130,8 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{EXT,transform_feedback}
* (part of OpenGL 3.0) is not available, returns `0`.
* @see @fn_gl{Get} with @def_gl{MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS}
* (part of OpenGL 3.0) is not available, returns @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS}
*/
static Int maxSeparateComponents();
@ -142,7 +143,7 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* OpenGL calls. If extension @extension{ARB,transform_feedback3}
* (part of OpenGL 4.0) is not available, returns the same value as
* @ref maxSeparateAttributes().
* @see @fn_gl{Get} with @def_gl{MAX_TRANSFORM_FEEDBACK_BUFFERS}
* @see @fn_gl{Get} with @def_gl_keyword{MAX_TRANSFORM_FEEDBACK_BUFFERS}
* @requires_gl Use @ref maxSeparateAttributes() in OpenGL ES and
* WebGL.
*/
@ -153,8 +154,8 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If extension @extension{ARB,transform_feedback3} (part
* of OpenGL 4.0) is not available, returns `1`.
* @see @fn_gl{Get} with @def_gl{MAX_VERTEX_STREAMS}
* of OpenGL 4.0) is not available, returns @cpp 1 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_VERTEX_STREAMS}
* @requires_gl Multiple vertex streams are not available in OpenGL ES
* and WebGL.
*/
@ -183,8 +184,8 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @extension{ARB,direct_state_access} (part of OpenGL 4.5) is not
* available, the transform feedback object is created on first use.
* @see @ref TransformFeedback(NoCreateT), @ref wrap(),
* @fn_gl{CreateTransformFeedbacks}, eventually
* @fn_gl{GenTransformFeedbacks}
* @fn_gl_keyword{CreateTransformFeedbacks}, eventually
* @fn_gl_keyword{GenTransformFeedbacks}
*/
explicit TransformFeedback();
@ -212,7 +213,7 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @brief Destructor
*
* Deletes associated OpenGL transform feedback object.
* @see @ref wrap(), @ref release(), @fn_gl{DeleteTransformFeedbacks}
* @see @ref wrap(), @ref release(), @fn_gl_keyword{DeleteTransformFeedbacks}
*/
~TransformFeedback();
@ -246,7 +247,8 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function returns empty string.
* @see @fn_gl{GetObjectLabel} or @fn_gl_extension{GetObjectLabel,EXT,debug_label}
* @see @fn_gl_keyword{GetObjectLabel} or
* @fn_gl_extension_keyword{GetObjectLabel,EXT,debug_label}
* with @def_gl{TRANSFORM_FEEDBACK}
* @requires_gles Debug output is not available in WebGL.
*/
@ -260,8 +262,8 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @extension{KHR,debug} (covered also by @extension{ANDROID,extension_pack_es31a})
* nor @extension{EXT,debug_label} desktop or ES extension is
* available, this function does nothing.
* @see @ref maxLabelLength(), @fn_gl{ObjectLabel} or
* @fn_gl_extension{LabelObject,EXT,debug_label} with
* @see @ref maxLabelLength(), @fn_gl_keyword{ObjectLabel} or
* @fn_gl_extension_keyword{LabelObject,EXT,debug_label} with
* @def_gl{TRANSFORM_FEEDBACK}
* @requires_gles Debug output is not available in WebGL.
*/
@ -288,9 +290,9 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @ref AbstractShaderProgram subclasses. See its documentation
* for more information.
* @see @ref attachBuffers(), @ref maxBuffers()/@ref maxSeparateAttributes(),
* @fn_gl{TransformFeedbackBufferRange}, eventually
* @fn_gl{BindTransformFeedback} and @fn_gl{BindBuffersRange} or
* @fn_gl{BindBufferRange}
* @fn_gl_keyword{TransformFeedbackBufferRange}, eventually
* @fn_gl{BindTransformFeedback} and @fn_gl_keyword{BindBuffersRange}
* or @fn_gl_keyword{BindBufferRange}
*/
TransformFeedback& attachBuffer(UnsignedInt index, Buffer& buffer, GLintptr offset, GLsizeiptr size);
@ -306,9 +308,9 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @ref AbstractShaderProgram subclasses. See its documentation
* for more information.
* @see @ref attachBuffers(), @ref maxBuffers()/@ref maxSeparateAttributes(),
* @fn_gl{TransformFeedbackBufferRange}, eventually
* @fn_gl{BindTransformFeedback} and @fn_gl{BindBuffersRange} or
* @fn_gl{BindBufferRange}
* @fn_gl_keyword{TransformFeedbackBufferRange}, eventually
* @fn_gl{BindTransformFeedback} and @fn_gl_keyword{BindBuffersBase}
* or @fn_gl_keyword{BindBufferBase}
*/
TransformFeedback& attachBuffer(UnsignedInt index, Buffer& buffer);
@ -318,8 +320,8 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
*
* Attches first buffer in the list to @p firstIndex, second to
* `firstIndex + 1` etc. Second parameter is offset, third is size. If
* any buffer is `nullptr`, given attachment point is detached. The
* range of indices must respect @ref maxBuffers() (@ref maxSeparateComponents()
* any buffer is @cpp nullptr @ce, given attachment point is detached.
* The range of indices must respect @ref maxBuffers() (@ref maxSeparateComponents()
* in OpenGL ES or if @extension{ARB,transform_feedback3} (part of
* OpenGL 4.0) is not available). The offsets must be aligned to 4
* bytes. All the buffers must have allocated data store. If
@ -330,9 +332,9 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @note This function is meant to be used only internally from
* @ref AbstractShaderProgram subclasses. See its documentation
* for more information.
* @see @ref attachBuffer(), @fn_gl{TransformFeedbackBufferRange},
* @see @ref attachBuffer(), @fn_gl_keyword{TransformFeedbackBufferRange},
* eventually @fn_gl{BindTransformFeedback} and
* @fn_gl{BindBuffersRange} or @fn_gl{BindBufferRange}
* @fn_gl_keyword{BindBuffersRange} or @fn_gl_keyword{BindBufferRange}
*/
TransformFeedback& attachBuffers(UnsignedInt firstIndex, std::initializer_list<std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers);
@ -341,8 +343,8 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @return Reference to self (for method chaining)
*
* Attches first buffer in the list to @p firstIndex, second to
* `firstIndex + 1` etc. If any buffer is `nullptr`, given index is
* detached. The range of indices must respect @ref maxBuffers()
* `firstIndex + 1` etc. If any buffer is @cpp nullptr @ce, given index
* is detached. The range of indices must respect @ref maxBuffers()
* (@ref maxSeparateComponents() in OpenGL ES or if
* @extension{ARB,transform_feedback3} (part of OpenGL 4.0) is not
* available). All the buffers must have allocated data store. If
@ -353,9 +355,9 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* @note This function is meant to be used only internally from
* @ref AbstractShaderProgram subclasses. See its documentation
* for more information.
* @see @ref attachBuffer(), @fn_gl{TransformFeedbackBufferBase},
* @see @ref attachBuffer(), @fn_gl_keyword{TransformFeedbackBufferBase},
* eventually @fn_gl{BindTransformFeedback} and
* @fn_gl{BindBuffersBase} or @fn_gl{BindBufferBase}
* @fn_gl_keyword{BindBuffersBase} or @fn_gl_keyword{BindBufferBase}
*/
TransformFeedback& attachBuffers(UnsignedInt firstIndex, std::initializer_list<Buffer*> buffers);
@ -369,7 +371,7 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* primitive type) compatible with @p mode can be used. Only one
* transform feedback object can be active at a time.
* @see @ref pause(), @ref end(), @fn_gl{BindTransformFeedback} and
* @fn_gl{BeginTransformFeedback}
* @fn_gl_keyword{BeginTransformFeedback}
*/
void begin(AbstractShaderProgram& shader, PrimitiveMode mode);
@ -379,7 +381,7 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* Pausing transform feedback makes it inactive, allowing to use
* different shader, or starting another transform feedback.
* @see @ref resume(), @ref end(), @fn_gl{BindTransformFeedback} and
* @fn_gl{PauseTransformFeedback}
* @fn_gl_keyword{PauseTransformFeedback}
*/
void pause();
@ -391,7 +393,7 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
* still apply after resuming. Only one transform feedback object can
* be active at a time.
* @see @ref pause(), @ref end(), @fn_gl{BindTransformFeedback} and
* @fn_gl{ResumeTransformFeedback}
* @fn_gl_keyword{ResumeTransformFeedback}
*/
void resume();
@ -400,7 +402,7 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject {
*
* Ends transform feedback so the captured data can be used.
* @see @ref begin(), @fn_gl{BindTransformFeedback} and
* @fn_gl2{EndTransformFeedback,BeginTransformFeedback}
* @fn_gl2_keyword{EndTransformFeedback,BeginTransformFeedback}
*/
void end();

32
src/Magnum/Version.h

@ -48,23 +48,23 @@ namespace Implementation {
@see @ref version(), @ref Context, @ref MAGNUM_ASSERT_VERSION_SUPPORTED()
*/
enum class Version: Int {
None = 0xFFFF, /**< @brief Unspecified */
None = 0xFFFF, /**< Unspecified */
#ifndef MAGNUM_TARGET_GLES
GL210 = 210, /**< @brief OpenGL 2.1 / GLSL 1.20 */
GL300 = 300, /**< @brief OpenGL 3.0 / GLSL 1.30 */
GL310 = 310, /**< @brief OpenGL 3.1 / GLSL 1.40 */
GL320 = 320, /**< @brief OpenGL 3.2 / GLSL 1.50 */
GL330 = 330, /**< @brief OpenGL 3.3, GLSL 3.30 */
GL400 = 400, /**< @brief OpenGL 4.0, GLSL 4.00 */
GL410 = 410, /**< @brief OpenGL 4.1, GLSL 4.10 */
GL420 = 420, /**< @brief OpenGL 4.2, GLSL 4.20 */
GL430 = 430, /**< @brief OpenGL 4.3, GLSL 4.30 */
GL440 = 440, /**< @brief OpenGL 4.4, GLSL 4.40 */
GL450 = 450, /**< @brief OpenGL 4.5, GLSL 4.50 */
GL210 = 210, /**< OpenGL 2.1 / GLSL 1.20 */
GL300 = 300, /**< OpenGL 3.0 / GLSL 1.30 */
GL310 = 310, /**< OpenGL 3.1 / GLSL 1.40 */
GL320 = 320, /**< OpenGL 3.2 / GLSL 1.50 */
GL330 = 330, /**< OpenGL 3.3, GLSL 3.30 */
GL400 = 400, /**< OpenGL 4.0, GLSL 4.00 */
GL410 = 410, /**< OpenGL 4.1, GLSL 4.10 */
GL420 = 420, /**< OpenGL 4.2, GLSL 4.20 */
GL430 = 430, /**< OpenGL 4.3, GLSL 4.30 */
GL440 = 440, /**< OpenGL 4.4, GLSL 4.40 */
GL450 = 450, /**< OpenGL 4.5, GLSL 4.50 */
#endif
/**
* @brief OpenGL ES 2.0 or WebGL 1.0, GLSL ES 1.00
* OpenGL ES 2.0 or WebGL 1.0, GLSL ES 1.00.
*
* On desktop OpenGL, all related functionality is present in extension
* @extension{ARB,ES2_compatibility} (OpenGL 4.1), so testing for this
@ -78,7 +78,7 @@ enum class Version: Int {
#endif
/**
* @brief OpenGL ES 3.0 or WebGL 2.0, GLSL ES 3.00
* OpenGL ES 3.0 or WebGL 2.0, GLSL ES 3.00.
*
* On desktop OpenGL, all related functionality is present in extension
* @extension{ARB,ES3_compatibility} (OpenGL 4.3), so testing for this
@ -93,7 +93,7 @@ enum class Version: Int {
#ifndef MAGNUM_TARGET_WEBGL
/**
* @brief OpenGL ES 3.1, GLSL ES 3.10
* OpenGL ES 3.1, GLSL ES 3.10.
*
* On desktop OpenGL, all related functionality is present in extension
* @extension{ARB,ES3_1_compatibility} (OpenGL 4.5), so testing for this
@ -130,7 +130,7 @@ inline std::pair<Int, Int> version(Version version) {
/**
@brief Whether given version is OpenGL ES or WebGL
Always `true` on @ref MAGNUM_TARGET_GLES "OpenGL ES" and WebGL build.
Always @cpp true @ce on @ref MAGNUM_TARGET_GLES "OpenGL ES" and WebGL build.
*/
#ifndef MAGNUM_TARGET_GLES
constexpr bool isVersionES(Version version) {

Loading…
Cancel
Save