This is a snapshot of a work-in-progress documentation theme. If you feel lost, miss something, or want to see the original Doxygen docs instead, head over to the archived version of this documentation page.

Magnum::DebugTools namespace

Debug tools.

Contents

Debugging helpers, renderers and profilers.

This library is built if WITH_DEBUGTOOLS is enabled when building Magnum. To use this library with CMake, you need to request the DebugTools component of the Magnum package and link to the Magnum::DebugTools target:

find_package(Magnum REQUIRED DebugTools)

# ...
target_link_libraries(your-app Magnum::DebugTools)

See Downloading and building, Usage with CMake and Debugging helpers for more information.

Classes

class CompareImage
Image comparator.
template<UnsignedInt dimensions>
class ForceRenderer
Force renderer.
class ForceRendererOptions
Force renderer options.
template<UnsignedInt dimensions>
class ObjectRenderer
Object renderer.
class ObjectRendererOptions
Object renderer options.
class Profiler
Profiler.
class ResourceManager
Resource manager for debug tools.
template<UnsignedInt dimensions>
class ShapeRenderer
Shape renderer.
class ShapeRendererOptions
Shape renderer options.

Typedefs

using ForceRenderer2D = ForceRenderer<2>
Two-dimensional force renderer.
using ForceRenderer3D = ForceRenderer<3>
Three-dimensional force renderer.
using ObjectRenderer2D = ObjectRenderer<2>
Two-dimensional object renderer.
using ObjectRenderer3D = ObjectRenderer<3>
Three-dimensional object renderer.
using ShapeRenderer2D = ShapeRenderer<2>
Two-dimensional shape renderer.
using ShapeRenderer3D = ShapeRenderer<3>
Three-dimensional shape renderer.

Functions

template<class T>
auto bufferSubData(Buffer& buffer, GLintptr offset, GLsizeiptr size) -> Containers::Array<T>
Buffer subdata.
template<class T = char>
auto bufferData(Buffer& buffer) -> Containers::Array<T>
Buffer data.
void textureSubImage(Texture2D& texture, Int level, const Range2Di& range, Image2D& image)
Read range of given texture mip level to image.
auto textureSubImage(Texture2D& texture, Int level, const Range2Di& range, Image2D&& image) -> Image2D
Read range of given texture mip level to image.
void textureSubImage(Texture2D& texture, Int level, const Range2Di& range, BufferImage2D& image, BufferUsage usage)
Read range of given texture mip level to buffer image.
auto textureSubImage(Texture2D& texture, Int level, const Range2Di& range, BufferImage2D&& image, BufferUsage usage) -> BufferImage2D
Read range of given texture mip level to buffer image.
void textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, Image2D& image)
Read range of given cube map texture coordinate mip level to image.
auto textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, Image2D&& image) -> Image2D
Read range of given cube map texture coordinate mip level to image.
void textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, BufferImage2D& image, BufferUsage usage)
Read range of given cube map texture coordinate mip level to buffer image.
auto textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, BufferImage2D&& image, BufferUsage usage) -> BufferImage2D
Read range of given cube map texture coordinate mip level to buffer image.

Function documentation

template<class T>
Containers::Array<T> Magnum::DebugTools::bufferSubData(Buffer& buffer, GLintptr offset, GLsizeiptr size)

Buffer subdata.

Emulates Buffer::subData() call on platforms that don't support it (such as OpenGL ES) by using Buffer::map().

template<class T = char>
Containers::Array<T> Magnum::DebugTools::bufferData(Buffer& buffer)

Buffer data.

Emulates Buffer::data() call on platforms that don't support it (such as OpenGL ES) by using Buffer::map().

void Magnum::DebugTools::textureSubImage(Texture2D& texture, Int level, const Range2Di& range, Image2D& image)

Read range of given texture mip level to image.

Emulates Texture2D::subImage() call on platforms that don't support it (such as OpenGL ES) by creating a framebuffer object and using Framebuffer::read(). On desktop OpenGL, if ARB_get_texture_sub_image is available, it's just an alias to Texture2D::subImage().

Note that only PixelFormat and PixelType values that are marked as framebuffer readable are supported. In addition, on OpenGL ES 3.0, images with PixelType::Float are supported – they are reinterpreted as PixelType::UnsignedInt using additional shader and floatBitsToUint() GLSL function and then reinterpreted back to PixelType::Float when read to client memory.

Image2D Magnum::DebugTools::textureSubImage(Texture2D& texture, Int level, const Range2Di& range, Image2D&& image)

Read range of given texture mip level to image.

Convenience alternative to the above, example usage: Image2D image = DebugTools::textureSubImage(texture, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte});

void Magnum::DebugTools::textureSubImage(Texture2D& texture, Int level, const Range2Di& range, BufferImage2D& image, BufferUsage usage)

Read range of given texture mip level to buffer image.

Emulates Texture2D::subImage() call on platforms that don't support it (such as OpenGL ES) by creating a framebuffer object and using Framebuffer::read(). On desktop OpenGL, if ARB_get_texture_sub_image is available, it's just an alias to Texture2D::subImage().

Note that only PixelFormat and PixelType values that are marked as framebuffer readable are supported.

BufferImage2D Magnum::DebugTools::textureSubImage(Texture2D& texture, Int level, const Range2Di& range, BufferImage2D&& image, BufferUsage usage)

Read range of given texture mip level to buffer image.

Convenience alternative to the above, example usage: BufferImage2D image = DebugTools::textureSubImage(texture, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);

void Magnum::DebugTools::textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, Image2D& image)

Read range of given cube map texture coordinate mip level to image.

Emulates CubeMapTexture::subImage() call on platforms that don't support it (such as OpenGL ES) by creating a framebuffer object and using Framebuffer::read().

Note that only PixelFormat and PixelType values that are marked as framebuffer readable are supported.

Image2D Magnum::DebugTools::textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, Image2D&& image)

Read range of given cube map texture coordinate mip level to image.

Convenience alternative to the above, example usage: Image2D image = DebugTools::textureSubImage(texture, CubeMapCoordinate::PositiveX, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte});

void Magnum::DebugTools::textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, BufferImage2D& image, BufferUsage usage)

Read range of given cube map texture coordinate mip level to buffer image.

Emulates CubeMapTexture::subImage() call on platforms that don't support it (such as OpenGL ES) by creating a framebuffer object and using Framebuffer::read().

Note that only PixelFormat and PixelType values that are marked as framebuffer readable are supported.

BufferImage2D Magnum::DebugTools::textureSubImage(CubeMapTexture& texture, CubeMapCoordinate coordinate, Int level, const Range2Di& range, BufferImage2D&& image, BufferUsage usage)

Read range of given cube map texture coordinate mip level to buffer image.

Convenience alternative to the above, example usage: BufferImage2D image = DebugTools::textureSubImage(texture, CubeMapCoordinate::PositiveX, 0, rect, {PixelFormat::RGBA, PixelType::UnsignedByte}, BufferUsage::StaticRead);