Browse Source

DebugTools: documentation updates for the new theme.

pull/231/head
Vladimír Vondruš 8 years ago
parent
commit
055858d357
  1. 36
      src/Magnum/CubeMapTexture.h
  2. 24
      src/Magnum/CubeMapTextureArray.h
  3. 2
      src/Magnum/DebugTools/DebugTools.h
  4. 16
      src/Magnum/DebugTools/ForceRenderer.h
  5. 8
      src/Magnum/DebugTools/ObjectRenderer.h
  6. 10
      src/Magnum/DebugTools/Profiler.h
  7. 10
      src/Magnum/DebugTools/ShapeRenderer.h
  8. 14
      src/Magnum/DebugTools/TextureImage.h
  9. 18
      src/Magnum/Texture.h
  10. 24
      src/Magnum/TextureArray.h

36
src/Magnum/CubeMapTexture.h

@ -543,7 +543,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* @fn_gl{PixelStore}, then @fn_gl2_keyword{GetTextureImage,GetTexImage} * @fn_gl{PixelStore}, then @fn_gl2_keyword{GetTextureImage,GetTexImage}
* @requires_gl45 Extension @extension{ARB,direct_state_access} * @requires_gl45 Extension @extension{ARB,direct_state_access}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void image(Int level, Image3D& image); void image(Int level, Image3D& image);
@ -565,7 +566,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* means that @p usage might get ignored. * means that @p usage might get ignored.
* @requires_gl45 Extension @extension{ARB,direct_state_access} * @requires_gl45 Extension @extension{ARB,direct_state_access}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void image(Int level, BufferImage3D& image, BufferUsage usage); void image(Int level, BufferImage3D& image, BufferUsage usage);
@ -592,7 +594,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* @fn_gl2_keyword{GetCompressedTextureImage,GetCompressedTexImage} * @fn_gl2_keyword{GetCompressedTextureImage,GetCompressedTexImage}
* @requires_gl45 Extension @extension{ARB,direct_state_access} * @requires_gl45 Extension @extension{ARB,direct_state_access}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedImage(Int level, CompressedImage3D& image); void compressedImage(Int level, CompressedImage3D& image);
@ -614,7 +617,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* contain the new data, which means that @p usage might get ignored. * contain the new data, which means that @p usage might get ignored.
* @requires_gl45 Extension @extension{ARB,direct_state_access} * @requires_gl45 Extension @extension{ARB,direct_state_access}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedImage(Int level, CompressedBufferImage3D& image, BufferUsage usage); void compressedImage(Int level, CompressedBufferImage3D& image, BufferUsage usage);
@ -655,7 +659,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* @fn_gl_extension_keyword{GetTextureImage,EXT,direct_state_access}, * @fn_gl_extension_keyword{GetTextureImage,EXT,direct_state_access},
* eventually @fn_gl_keyword{GetTexImage} * eventually @fn_gl_keyword{GetTexImage}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void image(CubeMapCoordinate coordinate, Int level, Image2D& image); void image(CubeMapCoordinate coordinate, Int level, Image2D& image);
@ -676,7 +681,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* storage is not reallocated if it is large enough to contain the new * storage is not reallocated if it is large enough to contain the new
* data, which means that @p usage might get ignored. * data, which means that @p usage might get ignored.
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void image(CubeMapCoordinate coordinate, Int level, BufferImage2D& image, BufferUsage usage); void image(CubeMapCoordinate coordinate, Int level, BufferImage2D& image, BufferUsage usage);
@ -717,7 +723,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* @fn_gl_extension_keyword{GetCompressedTextureImage,EXT,direct_state_access}, * @fn_gl_extension_keyword{GetCompressedTextureImage,EXT,direct_state_access},
* eventually @fn_gl_keyword{GetCompressedTexImage} * eventually @fn_gl_keyword{GetCompressedTexImage}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedImage(CubeMapCoordinate coordinate, Int level, CompressedImage2D& image); void compressedImage(CubeMapCoordinate coordinate, Int level, CompressedImage2D& image);
@ -739,7 +746,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* enough to contain the new data, which means that @p usage might get * enough to contain the new data, which means that @p usage might get
* ignored. * ignored.
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D& image, BufferUsage usage); void compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D& image, BufferUsage usage);
@ -760,7 +768,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* for more information. * for more information.
* @requires_gl45 Extension @extension{ARB,get_texture_sub_image} * @requires_gl45 Extension @extension{ARB,get_texture_sub_image}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void subImage(Int level, const Range3Di& range, Image3D& image) { void subImage(Int level, const Range3Di& range, Image3D& image) {
AbstractTexture::subImage<3>(level, range, image); AbstractTexture::subImage<3>(level, range, image);
@ -783,7 +792,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* for more information. * for more information.
* @requires_gl45 Extension @extension{ARB,get_texture_sub_image} * @requires_gl45 Extension @extension{ARB,get_texture_sub_image}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void subImage(Int level, const Range3Di& range, BufferImage3D& image, BufferUsage usage) { void subImage(Int level, const Range3Di& range, BufferImage3D& image, BufferUsage usage) {
AbstractTexture::subImage<3>(level, range, image, usage); AbstractTexture::subImage<3>(level, range, image, usage);
@ -810,7 +820,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* @ref CompressedPixelStorage::compressedBlockDataSize() are not * @ref CompressedPixelStorage::compressedBlockDataSize() are not
* set to non-zero values * set to non-zero values
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedSubImage(Int level, const Range3Di& range, CompressedImage3D& image) { void compressedSubImage(Int level, const Range3Di& range, CompressedImage3D& image) {
AbstractTexture::compressedSubImage<3>(level, range, image); AbstractTexture::compressedSubImage<3>(level, range, image);
@ -837,7 +848,8 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture {
* @ref CompressedPixelStorage::compressedBlockDataSize() are not * @ref CompressedPixelStorage::compressedBlockDataSize() are not
* set to non-zero values * set to non-zero values
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D& image, BufferUsage usage) { void compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D& image, BufferUsage usage) {
AbstractTexture::compressedSubImage<3>(level, range, image, usage); AbstractTexture::compressedSubImage<3>(level, range, image, usage);

24
src/Magnum/CubeMapTextureArray.h

@ -457,7 +457,8 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* *
* See @ref Texture::image(Int, Image&) for more information. * See @ref Texture::image(Int, Image&) for more information.
* @requires_gl Texture image queries are not available in OpenGL ES. * @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround. * See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void image(Int level, Image3D& image) { void image(Int level, Image3D& image) {
AbstractTexture::image<3>(level, image); AbstractTexture::image<3>(level, image);
@ -479,7 +480,8 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* See @ref Texture::image(Int, BufferImage&, BufferUsage) for more * See @ref Texture::image(Int, BufferImage&, BufferUsage) for more
* information. * information.
* @requires_gl Texture image queries are not available in OpenGL ES. * @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround. * See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void image(Int level, BufferImage3D& image, BufferUsage usage) { void image(Int level, BufferImage3D& image, BufferUsage usage) {
AbstractTexture::image<3>(level, image, usage); AbstractTexture::image<3>(level, image, usage);
@ -501,7 +503,8 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* See @ref Texture::compressedImage(Int, CompressedImage&) for more * See @ref Texture::compressedImage(Int, CompressedImage&) for more
* information. * information.
* @requires_gl Texture image queries are not available in OpenGL ES. * @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround. * See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedImage(Int level, CompressedImage3D& image) { void compressedImage(Int level, CompressedImage3D& image) {
AbstractTexture::compressedImage<3>(level, image); AbstractTexture::compressedImage<3>(level, image);
@ -523,7 +526,8 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* See @ref Texture::compressedImage(Int, CompressedBufferImage&, BufferUsage) * See @ref Texture::compressedImage(Int, CompressedBufferImage&, BufferUsage)
* for more information. * for more information.
* @requires_gl Texture image queries are not available in OpenGL ES. * @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround. * See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedImage(Int level, CompressedBufferImage3D& image, BufferUsage usage) { void compressedImage(Int level, CompressedBufferImage3D& image, BufferUsage usage) {
AbstractTexture::compressedImage<3>(level, image, usage); AbstractTexture::compressedImage<3>(level, image, usage);
@ -546,7 +550,8 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* for more information. * for more information.
* @requires_gl45 Extension @extension{ARB,get_texture_sub_image} * @requires_gl45 Extension @extension{ARB,get_texture_sub_image}
* @requires_gl Texture image queries are not available in OpenGL ES. * @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround. * See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void subImage(Int level, const Range3Di& range, Image3D& image) { void subImage(Int level, const Range3Di& range, Image3D& image) {
AbstractTexture::subImage<3>(level, range, image); AbstractTexture::subImage<3>(level, range, image);
@ -569,7 +574,8 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* for more information. * for more information.
* @requires_gl45 Extension @extension{ARB,get_texture_sub_image} * @requires_gl45 Extension @extension{ARB,get_texture_sub_image}
* @requires_gl Texture image queries are not available in OpenGL ES. * @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround. * See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void subImage(Int level, const Range3Di& range, BufferImage3D& image, BufferUsage usage) { void subImage(Int level, const Range3Di& range, BufferImage3D& image, BufferUsage usage) {
AbstractTexture::subImage<3>(level, range, image, usage); AbstractTexture::subImage<3>(level, range, image, usage);
@ -596,7 +602,8 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* @ref CompressedPixelStorage::compressedBlockDataSize() are not * @ref CompressedPixelStorage::compressedBlockDataSize() are not
* set to non-zero values * set to non-zero values
* @requires_gl Texture image queries are not available in OpenGL ES. * @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround. * See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedSubImage(Int level, const Range3Di& range, CompressedImage3D& image) { void compressedSubImage(Int level, const Range3Di& range, CompressedImage3D& image) {
AbstractTexture::compressedSubImage<3>(level, range, image); AbstractTexture::compressedSubImage<3>(level, range, image);
@ -623,7 +630,8 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture {
* @ref CompressedPixelStorage::compressedBlockDataSize() are not * @ref CompressedPixelStorage::compressedBlockDataSize() are not
* set to non-zero values * set to non-zero values
* @requires_gl Texture image queries are not available in OpenGL ES. * @requires_gl Texture image queries are not available in OpenGL ES.
* See @ref Framebuffer::read() for possible workaround. * See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D& image, BufferUsage usage) { void compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D& image, BufferUsage usage) {
AbstractTexture::compressedSubImage<3>(level, range, image, usage); AbstractTexture::compressedSubImage<3>(level, range, image, usage);

2
src/Magnum/DebugTools/DebugTools.h

@ -26,7 +26,7 @@
*/ */
/** @file /** @file
* @brief Forward declarations for @ref Magnum::DebugTools namespace * @brief Forward declarations for the @ref Magnum::DebugTools namespace
*/ */
#include "Magnum/Types.h" #include "Magnum/Types.h"

16
src/Magnum/DebugTools/ForceRenderer.h

@ -53,7 +53,7 @@ class ForceRendererOptions {
* @brief Set color of rendered arrow * @brief Set color of rendered arrow
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is 100% opaque white. * Default is @cpp 0xffffffff_rgbaf @ce.
*/ */
ForceRendererOptions& setColor(const Color4& color) { ForceRendererOptions& setColor(const Color4& color) {
_color = color; _color = color;
@ -67,7 +67,7 @@ class ForceRendererOptions {
* @brief Set scale of rendered arrow * @brief Set scale of rendered arrow
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is `1.0f`. * Default is @cpp 1.0f @ce.
*/ */
ForceRendererOptions& setSize(Float size) { ForceRendererOptions& setSize(Float size) {
_size = size; _size = size;
@ -85,11 +85,11 @@ class ForceRendererOptions {
Visualizes force pushing on object by an arrow of the same direction and size. Visualizes force pushing on object by an arrow of the same direction and size.
See @ref debug-tools-renderers for more information. See @ref debug-tools-renderers for more information.
@anchor DebugTools-ForceRenderer-usage @section DebugTools-ForceRenderer-usage Basic usage
## Basic usage
Example code: Example code:
@code
@code{.cpp}
DebugTools::ResourceManager::instance().set("my", DebugTools::ForceRendererOptions() DebugTools::ResourceManager::instance().set("my", DebugTools::ForceRendererOptions()
.setScale(5.0f) .setScale(5.0f)
.setColor(Color3::fromHSV(120.0_degf, 1.0f, 0.7f)); .setColor(Color3::fromHSV(120.0_degf, 1.0f, 0.7f));
@ -114,9 +114,9 @@ template<UnsignedInt dimensions> class MAGNUM_DEBUGTOOLS_EXPORT ForceRenderer: p
* more information. * more information.
* @param drawables Drawable group * @param drawables Drawable group
* *
* The renderer is automatically added to object's features, @p force is * The renderer is automatically added to object's features, @p force
* saved as reference to original vector and thus it must be available * is saved as reference to original vector and thus it must be
* for the whole lifetime of the renderer. * available for the whole lifetime of the renderer.
*/ */
explicit ForceRenderer(SceneGraph::AbstractObject<dimensions, Float>& object, const VectorTypeFor<dimensions, Float>& forcePosition, const VectorTypeFor<dimensions, Float>& force, ResourceKey options = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* drawables = nullptr); explicit ForceRenderer(SceneGraph::AbstractObject<dimensions, Float>& object, const VectorTypeFor<dimensions, Float>& forcePosition, const VectorTypeFor<dimensions, Float>& force, ResourceKey options = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* drawables = nullptr);

8
src/Magnum/DebugTools/ObjectRenderer.h

@ -52,7 +52,7 @@ class ObjectRendererOptions {
* @brief Set size of the rendered axes * @brief Set size of the rendered axes
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is `1.0f`. * Default is @cpp 1.0f @ce.
*/ */
ObjectRendererOptions& setSize(Float size) { ObjectRendererOptions& setSize(Float size) {
_size = size; _size = size;
@ -69,11 +69,11 @@ class ObjectRendererOptions {
Visualizes object position, rotation and scale using colored axes. See Visualizes object position, rotation and scale using colored axes. See
@ref debug-tools-renderers for more information. @ref debug-tools-renderers for more information.
@anchor DebugTools-ObjectRenderer-usage @section DebugTools-ObjectRenderer-usage Basic usage
## Basic usage
Example code: Example code:
@code
@code{.cpp}
// Create some options // Create some options
DebugTools::ResourceManager::instance().set("my", DebugTools::ObjectRendererOptions().setSize(0.3f)); DebugTools::ResourceManager::instance().set("my", DebugTools::ObjectRendererOptions().setSize(0.3f));

10
src/Magnum/DebugTools/Profiler.h

@ -45,7 +45,8 @@ namespace Magnum { namespace DebugTools {
Measures time passed during specified sections of each frame. It's meant to be Measures time passed during specified sections of each frame. It's meant to be
used in rendering and event loops (e.g. @ref Platform::Sdl2Application::drawEvent()), used in rendering and event loops (e.g. @ref Platform::Sdl2Application::drawEvent()),
but it's possible to use it standalone elsewhere. Example usage: but it's possible to use it standalone elsewhere. Example usage:
@code
@code{.cpp}
DebugTools::Profiler p; DebugTools::Profiler p;
// Register named sections // Register named sections
@ -94,7 +95,8 @@ p.printStatistics();
@endcode @endcode
It's possible to start profiler only for certain parts of the code and then It's possible to start profiler only for certain parts of the code and then
stop it again using @ref stop(), if you are not interested in profiling the rest. stop it again using @ref stop(), if you are not interested in profiling the
rest.
@todo Some unit testing @todo Some unit testing
@todo More time intervals @todo More time intervals
@ -121,7 +123,7 @@ class MAGNUM_DEBUGTOOLS_EXPORT Profiler {
* @brief Set measure duration * @brief Set measure duration
* *
* Measured data are averaged through given frame count. Default value * Measured data are averaged through given frame count. Default value
* is 60. * is @cpp 60 @ce.
* @attention This function cannot be called if profiling is enabled. * @attention This function cannot be called if profiling is enabled.
*/ */
void setMeasureDuration(std::size_t frames); void setMeasureDuration(std::size_t frames);
@ -169,7 +171,7 @@ class MAGNUM_DEBUGTOOLS_EXPORT Profiler {
/** /**
* @brief Start profiling of "other" section * @brief Start profiling of "other" section
* *
* Same as calling `start(DebugTools::Profiler::otherSection)`. * Same as calling @cpp start(DebugTools::Profiler::otherSection) @ce.
* @note Does nothing if profiling is disabled. * @note Does nothing if profiling is disabled.
*/ */
void start() { start(otherSection); } void start() { start(otherSection); }

10
src/Magnum/DebugTools/ShapeRenderer.h

@ -86,7 +86,7 @@ class ShapeRendererOptions {
* @brief Set color of rendered shape * @brief Set color of rendered shape
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is 100% opaque white. * Default is @cpp 0xffffffff_rgbaf @ce.
*/ */
ShapeRendererOptions& setColor(const Color4& color) { ShapeRendererOptions& setColor(const Color4& color) {
_color = color; _color = color;
@ -101,7 +101,7 @@ class ShapeRendererOptions {
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Size of rendered crosshairs, representing @ref Shapes::Point shapes. * Size of rendered crosshairs, representing @ref Shapes::Point shapes.
* Default is `0.25f`. * Default is @cpp 0.25f @ce.
*/ */
ShapeRendererOptions& setPointSize(Float size) { ShapeRendererOptions& setPointSize(Float size) {
_pointSize = size; _pointSize = size;
@ -120,11 +120,11 @@ class ShapeRendererOptions {
Visualizes collision shapes using wireframe primitives. See Visualizes collision shapes using wireframe primitives. See
@ref debug-tools-renderers for more information. @ref debug-tools-renderers for more information.
@anchor DebugTools-ShapeRenderer-usage @section DebugTools-ShapeRenderer-usage Basic usage
## Basic usage
Example code: Example code:
@code
@code{.cpp}
// Create some options // Create some options
DebugTools::ResourceManager::instance().set("red", DebugTools::ResourceManager::instance().set("red",
DebugTools::ShapeRendererOptions().setColor({1.0f, 0.0f, 0.0f})); DebugTools::ShapeRendererOptions().setColor({1.0f, 0.0f, 0.0f}));

14
src/Magnum/DebugTools/TextureImage.h

@ -44,7 +44,7 @@ is available, it's just an alias to @ref Texture2D::subImage().
Note that only @ref Magnum::PixelFormat "PixelFormat" and @ref PixelType values Note that only @ref Magnum::PixelFormat "PixelFormat" and @ref PixelType values
that are marked as framebuffer readable are supported. In addition, on OpenGL that are marked as framebuffer readable are supported. In addition, on OpenGL
ES 3.0, images with @ref PixelType::Float are supported -- they are ES 3.0, images with @ref PixelType::Float are supported --- they are
reinterpreted as @ref PixelType::UnsignedInt using additional shader and reinterpreted as @ref PixelType::UnsignedInt using additional shader and
`floatBitsToUint()` GLSL function and then reinterpreted back to `floatBitsToUint()` GLSL function and then reinterpreted back to
@ref PixelType::Float when read to client memory. @ref PixelType::Float when read to client memory.
@ -55,7 +55,8 @@ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(Texture2D& texture, Int level, con
@brief Read range of given texture mip level to image @brief Read range of given texture mip level to image
Convenience alternative to the above, example usage: Convenience alternative to the above, example usage:
@code
@code{.cpp}
Image2D image = DebugTools::textureSubImage(texture, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}); Image2D image = DebugTools::textureSubImage(texture, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte});
@endcode @endcode
*/ */
@ -77,7 +78,8 @@ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(CubeMapTexture& texture, CubeMapCo
@brief Read range of given cube map texture coordinate mip level to image @brief Read range of given cube map texture coordinate mip level to image
Convenience alternative to the above, example usage: Convenience alternative to the above, example usage:
@code
@code{.cpp}
Image2D image = DebugTools::textureSubImage(texture, CubeMapCoordinate::PositiveX, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}); Image2D image = DebugTools::textureSubImage(texture, CubeMapCoordinate::PositiveX, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte});
@endcode @endcode
*/ */
@ -103,7 +105,8 @@ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(Texture2D& texture, Int level, con
@brief Read range of given texture mip level to buffer image @brief Read range of given texture mip level to buffer image
Convenience alternative to the above, example usage: Convenience alternative to the above, example usage:
@code
@code{.cpp}
BufferImage2D image = DebugTools::textureSubImage(texture, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); BufferImage2D image = DebugTools::textureSubImage(texture, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
@endcode @endcode
*/ */
@ -127,7 +130,8 @@ MAGNUM_DEBUGTOOLS_EXPORT void textureSubImage(CubeMapTexture& texture, CubeMapCo
@brief Read range of given cube map texture coordinate mip level to buffer image @brief Read range of given cube map texture coordinate mip level to buffer image
Convenience alternative to the above, example usage: Convenience alternative to the above, example usage:
@code
@code{.cpp}
BufferImage2D image = DebugTools::textureSubImage(texture, CubeMapCoordinate::PositiveX, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead); BufferImage2D image = DebugTools::textureSubImage(texture, CubeMapCoordinate::PositiveX, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);
@endcode @endcode
*/ */

18
src/Magnum/Texture.h

@ -788,7 +788,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @fn_gl_extension_keyword{GetTextureImage,EXT,direct_state_access}, * @fn_gl_extension_keyword{GetTextureImage,EXT,direct_state_access},
* eventually @fn_gl_keyword{GetTexImage} * eventually @fn_gl_keyword{GetTexImage}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void image(Int level, Image<dimensions>& image) { void image(Int level, Image<dimensions>& image) {
AbstractTexture::image<dimensions>(level, image); AbstractTexture::image<dimensions>(level, image);
@ -814,7 +815,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* reallocated if it is large enough to contain the new data, which * reallocated if it is large enough to contain the new data, which
* means that @p usage might get ignored. * means that @p usage might get ignored.
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
* @todo Make it more flexible (usable with * @todo Make it more flexible (usable with
* @extension{ARB,buffer_storage}, avoiding relocations...) * @extension{ARB,buffer_storage}, avoiding relocations...)
*/ */
@ -861,7 +863,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @fn_gl_extension_keyword{GetCompressedTextureImage,EXT,direct_state_access}, * @fn_gl_extension_keyword{GetCompressedTextureImage,EXT,direct_state_access},
* eventually @fn_gl_keyword{GetCompressedTexImage} * eventually @fn_gl_keyword{GetCompressedTexImage}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedImage(Int level, CompressedImage<dimensions>& image) { void compressedImage(Int level, CompressedImage<dimensions>& image) {
AbstractTexture::compressedImage<dimensions>(level, image); AbstractTexture::compressedImage<dimensions>(level, image);
@ -887,7 +890,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* information. The storage is not reallocated if it is large enough to * information. The storage is not reallocated if it is large enough to
* contain the new data, which means that @p usage might get ignored. * contain the new data, which means that @p usage might get ignored.
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
* @todo Make it more flexible (usable with * @todo Make it more flexible (usable with
* @extension{ARB,buffer_storage}, avoiding relocations...) * @extension{ARB,buffer_storage}, avoiding relocations...)
*/ */
@ -985,7 +989,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @ref CompressedPixelStorage::compressedBlockDataSize() are not * @ref CompressedPixelStorage::compressedBlockDataSize() are not
* set to non-zero values * set to non-zero values
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedSubImage(Int level, const RangeTypeFor<dimensions, Int>& range, CompressedImage<dimensions>& image) { void compressedSubImage(Int level, const RangeTypeFor<dimensions, Int>& range, CompressedImage<dimensions>& image) {
AbstractTexture::compressedSubImage<dimensions>(level, range, image); AbstractTexture::compressedSubImage<dimensions>(level, range, image);
@ -1016,7 +1021,8 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @ref CompressedPixelStorage::compressedBlockDataSize() are not * @ref CompressedPixelStorage::compressedBlockDataSize() are not
* set to non-zero values * set to non-zero values
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedSubImage(Int level, const RangeTypeFor<dimensions, Int>& range, CompressedBufferImage<dimensions>& image, BufferUsage usage) { void compressedSubImage(Int level, const RangeTypeFor<dimensions, Int>& range, CompressedBufferImage<dimensions>& image, BufferUsage usage) {
AbstractTexture::compressedSubImage<dimensions>(level, range, image, usage); AbstractTexture::compressedSubImage<dimensions>(level, range, image, usage);

24
src/Magnum/TextureArray.h

@ -481,7 +481,8 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* *
* See @ref Texture::image(Int, Image&) for more information. * See @ref Texture::image(Int, Image&) for more information.
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void image(Int level, Image<dimensions+1>& image) { void image(Int level, Image<dimensions+1>& image) {
AbstractTexture::image<dimensions+1>(level, image); AbstractTexture::image<dimensions+1>(level, image);
@ -503,7 +504,8 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* See @ref Texture::image(Int, BufferImage&, BufferUsage) for more * See @ref Texture::image(Int, BufferImage&, BufferUsage) for more
* information. * information.
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void image(Int level, BufferImage<dimensions+1>& image, BufferUsage usage) { void image(Int level, BufferImage<dimensions+1>& image, BufferUsage usage) {
AbstractTexture::image<dimensions+1>(level, image, usage); AbstractTexture::image<dimensions+1>(level, image, usage);
@ -525,7 +527,8 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* See @ref Texture::compressedImage(Int, CompressedImage&) for more * See @ref Texture::compressedImage(Int, CompressedImage&) for more
* information. * information.
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedImage(Int level, CompressedImage<dimensions+1>& image) { void compressedImage(Int level, CompressedImage<dimensions+1>& image) {
AbstractTexture::compressedImage<dimensions+1>(level, image); AbstractTexture::compressedImage<dimensions+1>(level, image);
@ -547,7 +550,8 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* See @ref Texture::compressedImage(Int, CompressedBufferImage&, BufferUsage) * See @ref Texture::compressedImage(Int, CompressedBufferImage&, BufferUsage)
* for more information. * for more information.
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedImage(Int level, CompressedBufferImage<dimensions+1>& image, BufferUsage usage) { void compressedImage(Int level, CompressedBufferImage<dimensions+1>& image, BufferUsage usage) {
AbstractTexture::compressedImage<dimensions+1>(level, image, usage); AbstractTexture::compressedImage<dimensions+1>(level, image, usage);
@ -570,7 +574,8 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* for more information. * for more information.
* @requires_gl45 Extension @extension{ARB,get_texture_sub_image} * @requires_gl45 Extension @extension{ARB,get_texture_sub_image}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, Image<dimensions+1>& image) { void subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, Image<dimensions+1>& image) {
AbstractTexture::subImage<dimensions+1>(level, range, image); AbstractTexture::subImage<dimensions+1>(level, range, image);
@ -593,7 +598,8 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* for more information. * for more information.
* @requires_gl45 Extension @extension{ARB,get_texture_sub_image} * @requires_gl45 Extension @extension{ARB,get_texture_sub_image}
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, BufferImage<dimensions+1>& image, BufferUsage usage) { void subImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, BufferImage<dimensions+1>& image, BufferUsage usage) {
AbstractTexture::subImage<dimensions+1>(level, range, image, usage); AbstractTexture::subImage<dimensions+1>(level, range, image, usage);
@ -620,7 +626,8 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* @ref CompressedPixelStorage::compressedBlockDataSize() are not * @ref CompressedPixelStorage::compressedBlockDataSize() are not
* set to non-zero values * set to non-zero values
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedSubImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, CompressedImage<dimensions+1>& image) { void compressedSubImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, CompressedImage<dimensions+1>& image) {
AbstractTexture::compressedSubImage<dimensions+1>(level, range, image); AbstractTexture::compressedSubImage<dimensions+1>(level, range, image);
@ -647,7 +654,8 @@ template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
* @ref CompressedPixelStorage::compressedBlockDataSize() are not * @ref CompressedPixelStorage::compressedBlockDataSize() are not
* set to non-zero values * set to non-zero values
* @requires_gl Texture image queries are not available in OpenGL ES or * @requires_gl Texture image queries are not available in OpenGL ES or
* WebGL. See @ref Framebuffer::read() for possible workaround. * WebGL. See @ref Framebuffer::read() or @ref DebugTools::textureSubImage()
* for possible workarounds.
*/ */
void compressedSubImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, CompressedBufferImage<dimensions+1>& image, BufferUsage usage) { void compressedSubImage(Int level, const RangeTypeFor<dimensions+1, Int>& range, CompressedBufferImage<dimensions+1>& image, BufferUsage usage) {
AbstractTexture::compressedSubImage<dimensions+1>(level, range, image, usage); AbstractTexture::compressedSubImage<dimensions+1>(level, range, image, usage);

Loading…
Cancel
Save