Browse Source

Removed enum-referencing Doxygen workarounds.

In 1.8.5 it is now possible to reference directly to enum member.
Hooray! Also added explicit @ref here and there, fixing some referencing
bugs along the way.
pull/23/head
Vladimír Vondruš 13 years ago
parent
commit
13d5e2a50f
  1. 10
      doc/best-practices.dox
  2. 15
      src/AbstractFramebuffer.h
  3. 17
      src/AbstractResourceLoader.h
  4. 11
      src/AbstractShaderProgram.h
  5. 11
      src/AbstractTexture.h
  6. 13
      src/Audio/AbstractImporter.h
  7. 2
      src/Audio/Renderer.h
  8. 7
      src/Audio/Source.h
  9. 20
      src/Buffer.h
  10. 8
      src/Context.h
  11. 10
      src/CubeMapTexture.h
  12. 4
      src/CubeMapTextureArray.h
  13. 8
      src/DebugTools/ShapeRenderer.h
  14. 8
      src/DefaultFramebuffer.h
  15. 10
      src/Mesh.h
  16. 2
      src/Platform/GlutApplication.h
  17. 2
      src/Platform/NaClApplication.h
  18. 4
      src/Platform/Sdl2Application.h
  19. 127
      src/Renderer.h
  20. 6
      src/Resource.h
  21. 4
      src/ResourceManager.h
  22. 16
      src/SceneGraph/AbstractFeature.h
  23. 89
      src/SceneGraph/Animable.h
  24. 26
      src/Shaders/MeshVisualizer.h
  25. 17
      src/Shaders/Phong.h
  26. 41
      src/Text/AbstractFont.h
  27. 204
      src/Text/AbstractFontConverter.h
  28. 2
      src/Text/DistanceFieldGlyphCache.h
  29. 2
      src/Text/GlyphCache.h
  30. 24
      src/Texture.h
  31. 11
      src/TextureTools/DistanceField.h
  32. 22
      src/Trade/AbstractImageConverter.h
  33. 22
      src/Trade/AbstractImporter.h
  34. 12
      src/Trade/PhongMaterialData.h
  35. 2
      src/Trade/TextureData.h

10
doc/best-practices.dox

@ -56,11 +56,11 @@ information.
@subsubsection best-practices-nacl-buffer-types Native Client requires unique buffer binding @subsubsection best-practices-nacl-buffer-types Native Client requires unique buffer binding
As noted in the above link, buffers in NaCl implementation need to be bound As noted in the above link, buffers in NaCl implementation need to be bound
only to one unique target, i.e., Buffer bound to @ref Buffer::Target "Target::Array" only to one unique target, i.e., @ref Buffer bound to @ref Buffer::Target::Array
cannot be later rebound to @ref Buffer::Target "Target::ElementArray". However, cannot be later rebound to @ref Buffer::Target::ElementArray. However, %Magnum
%Magnum by default uses any sufficient target when binding the buffer by default uses any sufficient target when binding the buffer internally (e.g.
internally (e.g. for setting data or copying). To avoid this, set target hint for setting data or copying). To avoid this, set target hint to desired target,
to desired target, either in constructor or using Buffer::setTargetHint(). either in constructor or using @ref Buffer::setTargetHint().
To ease up the development, @ref Mesh checks proper target hint when adding To ease up the development, @ref Mesh checks proper target hint when adding
vertex and index buffers. vertex and index buffers.

15
src/AbstractFramebuffer.h

@ -157,12 +157,12 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @param mask Which buffers to perform blit operation on * @param mask Which buffers to perform blit operation on
* @param filter Interpolation filter * @param filter Interpolation filter
* *
* Binds @p source framebuffer to @ref FramebufferTarget "FramebufferTarget::Read" * Binds @p source framebuffer to @ref FramebufferTarget::Read and
* and @p destination framebuffer to @ref FramebufferTarget "FramebufferTarget::Draw" * @p destination framebuffer to @ref FramebufferTarget::Draw and
* and performs blitting operation. See DefaultFramebuffer::mapForRead(), * performs blitting operation. See @ref DefaultFramebuffer::mapForRead(),
* Framebuffer::mapForRead(), DefaultFramebuffer::mapForDraw() and * @ref Framebuffer::mapForRead(), @ref DefaultFramebuffer::mapForDraw()
* Framebuffer::mapForDraw() for specifying particular buffers for * and @ref Framebuffer::mapForDraw() for specifying particular buffers
* blitting operation. * for blitting operation.
* @see @fn_gl{BlitFramebuffer} * @see @fn_gl{BlitFramebuffer}
* @requires_gles30 %Extension @es_extension{ANGLE,framebuffer_blit} or * @requires_gles30 %Extension @es_extension{ANGLE,framebuffer_blit} or
* @es_extension{NV,framebuffer_blit} * @es_extension{NV,framebuffer_blit}
@ -179,8 +179,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* Convenience alternative to above function when source rectangle is * Convenience alternative to above function when source rectangle is
* the same as destination rectangle. As the image is copied * the same as destination rectangle. As the image is copied
* pixel-by-pixel, no interpolation is needed and thus * pixel-by-pixel, no interpolation is needed and thus
* @ref FramebufferBlitFilter "FramebufferBlitFilter::Nearest" * @ref FramebufferBlitFilter::Nearest filtering is used by default.
* filtering is used by default.
* @see @fn_gl{BlitFramebuffer} * @see @fn_gl{BlitFramebuffer}
* @requires_gles30 %Extension @es_extension{ANGLE,framebuffer_blit} or * @requires_gles30 %Extension @es_extension{ANGLE,framebuffer_blit} or
* @es_extension{NV,framebuffer_blit} * @es_extension{NV,framebuffer_blit}

17
src/AbstractResourceLoader.h

@ -140,9 +140,9 @@ template<class T> class AbstractResourceLoader {
* @brief Request resource to be loaded * @brief Request resource to be loaded
* *
* If the resource isn't yet loaded or loading, state of the resource * If the resource isn't yet loaded or loading, state of the resource
* is set to @ref Resource::ResourceState "ResourceState::Loading" and count of * is set to @ref ResourceState::Loading and count of requested
* requested features is incremented. Depending on implementation the * features is incremented. Depending on implementation the resource
* resource might be loaded synchronously or asynchronously. * might be loaded synchronously or asynchronously.
* *
* @see ResourceManager::state(), requestedCount(), notFoundCount(), * @see ResourceManager::state(), requestedCount(), notFoundCount(),
* loadedCount() * loadedCount()
@ -153,10 +153,9 @@ template<class T> class AbstractResourceLoader {
/** /**
* @brief Set loaded resource to resource manager * @brief Set loaded resource to resource manager
* *
* Also increments count of loaded resources. Parameter @p state * Also increments count of loaded resources. Parameter @p state must
* must be either @ref ResourceManager::ResourceDataState "ResourceDataState::Mutable" * be either @ref ResourceDataState::Mutable or @ref ResourceDataState::Final.
* or @ref ResourceManager::ResourceDataState "ResourceDataState::Final". See * See @ref ResourceManager::set() for more information.
* ResourceManager::set() for more information.
* @see loadedCount() * @see loadedCount()
*/ */
void set(ResourceKey key, T* data, ResourceDataState state, ResourcePolicy policy); void set(ResourceKey key, T* data, ResourceDataState state, ResourcePolicy policy);
@ -169,8 +168,8 @@ template<class T> class AbstractResourceLoader {
/** /**
* @brief Set loaded resource to resource manager * @brief Set loaded resource to resource manager
* *
* Same as above function with state set to @ref ResourceDataState "ResourceDataState::Final" * Same as above function with state set to @ref ResourceDataState::Final
* and policy to @ref ResourcePolicy "ResourcePolicy::Resident". * and policy to @ref ResourcePolicy::Resident.
*/ */
void set(ResourceKey key, T* data) { void set(ResourceKey key, T* data) {
set(key, data, ResourceDataState::Final, ResourcePolicy::Resident); set(key, data, ResourceDataState::Final, ResourcePolicy::Resident);

11
src/AbstractShaderProgram.h

@ -951,10 +951,9 @@ always have vertex attribute with location `0`.
Template parameter @p T is the type which is used for shader attribute, e.g. 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 @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. buffers to mesh. By default it is the same as type used in shader (e.g.
@ref DataType "DataType::Int" for @ref Vector4i). It's also possible to pass @ref DataType::Int for @ref Vector4i). It's also possible to pass integer data
integer data to floating-point shader inputs. In this case you may want to to floating-point shader inputs. In this case you may want to normalize the
normalize the values (e.g. color components from 0-255 to 0.0f - 1.0f) -- see values (e.g. color components from 0-255 to 0.0f - 1.0f) -- see @ref DataOption::Normalize.
@ref DataOption "DataOption::Normalize".
Only some types are allowed as attribute types, see @ref AbstractShaderProgram-types Only some types are allowed as attribute types, see @ref AbstractShaderProgram-types
or TypeTraits::AttributeType for more information. or TypeTraits::AttributeType for more information.
@ -1123,11 +1122,11 @@ template<UnsignedInt location, class T> class AbstractShaderProgram::Attribute {
/** /**
* @brief Constructor * @brief Constructor
* @param dataType Type of passed data. Default is the same as * @param dataType Type of passed data. Default is the same as
* type used in shader (e.g. DataType::Integer for Vector4i). * type used in shader (e.g. @ref DataType::Int for @ref Vector4i).
* @param dataOptions Data options. Default is no options. * @param dataOptions Data options. Default is no options.
* *
* Component count is set to the same value as in type used in shader * Component count is set to the same value as in type used in shader
* (e.g. @ref Components "Components::Three" for Vector3). * (e.g. @ref Components::Three for @ref Vector3).
*/ */
constexpr Attribute(DataType dataType = Implementation::Attribute<T>::DefaultDataType, DataOptions dataOptions = DataOptions()): _components(Implementation::Attribute<T>::DefaultComponents), _dataType(dataType), _dataOptions(dataOptions) {} constexpr Attribute(DataType dataType = Implementation::Attribute<T>::DefaultDataType, DataOptions dataOptions = DataOptions()): _components(Implementation::Attribute<T>::DefaultComponents), _dataType(dataType), _dataOptions(dataOptions) {}

11
src/AbstractTexture.h

@ -146,11 +146,10 @@ class MAGNUM_EXPORT AbstractTexture {
* Sets filter used when the object pixel size is smaller than the * Sets filter used when the object pixel size is smaller than the
* texture size. If @extension{EXT,direct_state_access} is not * texture size. If @extension{EXT,direct_state_access} is not
* available, the texture is bound to some layer before the operation. * available, the texture is bound to some layer before the operation.
* Initial value is (@ref Sampler::Filter "Sampler::Filter::Nearest", * Initial value is (@ref Sampler::Filter::Nearest, @ref Sampler::Mipmap::Linear).
* @ref Sampler::Mipmap "Sampler::Mipmap::Linear").
* @attention For rectangle textures only some modes are supported, * @attention For rectangle textures only some modes are supported,
* see @ref Sampler::Filter "Sampler::Filter" and @ref Sampler::Mipmap "Sampler::Mipmap" * see @ref Sampler::Filter and @ref Sampler::Mipmap documentation
* documentation for more information. * for more information.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter} * @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access} * or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_MIN_FILTER} * with @def_gl{TEXTURE_MIN_FILTER}
@ -165,7 +164,7 @@ class MAGNUM_EXPORT AbstractTexture {
* Sets filter used when the object pixel size is larger than largest * Sets filter used when the object pixel size is larger than largest
* texture size. If @extension{EXT,direct_state_access} is not * texture size. If @extension{EXT,direct_state_access} is not
* available, the texture is bound to some layer before the operation. * available, the texture is bound to some layer before the operation.
* Initial value is @ref Sampler::Filter "Sampler::Filter::Linear". * Initial value is @ref Sampler::Filter::Linear.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter} * @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access} * or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_MAG_FILTER} * with @def_gl{TEXTURE_MAG_FILTER}
@ -180,7 +179,7 @@ class MAGNUM_EXPORT AbstractTexture {
* @brief Set border color * @brief Set border color
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Border color when wrapping is set to @ref Sampler::Wrapping "Sampler::Wrapping::ClampToBorder". * Border color when wrapping is set to @ref Sampler::Wrapping::ClampToBorder.
* If @extension{EXT,direct_state_access} is not available, the texture * If @extension{EXT,direct_state_access} is not available, the texture
* is bound to some layer before the operation. Initial value is * is bound to some layer before the operation. Initial value is
* `{0.0f, 0.0f, 0.0f, 0.0f}`. * `{0.0f, 0.0f, 0.0f, 0.0f}`.

13
src/Audio/AbstractImporter.h

@ -49,8 +49,8 @@ checked by the implementation:
- Functions doOpenData() and doOpenFile() are called after the previous file - Functions doOpenData() and doOpenFile() are called after the previous file
was closed, function doClose() is called only if there is any file opened. was closed, function doClose() is called only if there is any file opened.
- Function doOpenData() is called only if @ref Feature "Feature::OpenData" - Function doOpenData() is called only if @ref Feature::OpenData is
is supported. supported.
- All `do*()` implementations working on opened file are called only if - All `do*()` implementations working on opened file are called only if
there is any file opened. there is any file opened.
*/ */
@ -91,8 +91,8 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractPlugin
* @brief Open raw data * @brief Open raw data
* *
* Closes previous file, if it was opened, and tries to open given * Closes previous file, if it was opened, and tries to open given
* file. Available only if @ref Feature "Feature::OpenData" is * file. Available only if @ref Feature::OpenData is supported. Returns
* supported. Returns `true` on success, `false` otherwise. * `true` on success, `false` otherwise.
* @see features(), openFile() * @see features(), openFile()
*/ */
bool openData(Containers::ArrayReference<const unsigned char> data); bool openData(Containers::ArrayReference<const unsigned char> data);
@ -139,9 +139,8 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractPlugin
/** /**
* @brief Implementation for openFile() * @brief Implementation for openFile()
* *
* If @ref Feature "Feature::OpenData" is supported, default * If @ref Feature::OpenData is supported, default implementation opens
* implementation opens the file and calls doOpenData() with its * the file and calls @ref doOpenData() with its contents.
* contents.
*/ */
virtual void doOpenFile(const std::string& filename); virtual void doOpenFile(const std::string& filename);

2
src/Audio/Renderer.h

@ -174,7 +174,7 @@ class Renderer {
/** /**
* @brief Set distance model * @brief Set distance model
* *
* Default is @ref DistanceModel "DistanceModel::InverseClamped". * Default is @ref DistanceModel::InverseClamped.
* @see @fn_al{DistanceModel} * @see @fn_al{DistanceModel}
*/ */
static void setDistanceModel(DistanceModel model) { static void setDistanceModel(DistanceModel model) {

7
src/Audio/Source.h

@ -347,10 +347,9 @@ class MAGNUM_AUDIO_EXPORT Source {
* @param buffer Buffer to attach or `nullptr` * @param buffer Buffer to attach or `nullptr`
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* If an buffer is attached, changes source type to * If an buffer is attached, changes source type to @ref Type::Static,
* @ref Type "Type::Static", if detached, changes source type to * if detached, changes source type to @ref Type::Undetermined. The
* @ref Type "Type::Undetermined". The buffer must be already filled * buffer must be already filled with data.
* with data.
* @see @ref type(), @fn_al{Sourcei} with @def_al{BUFFER} * @see @ref type(), @fn_al{Sourcei} with @def_al{BUFFER}
*/ */
Source& setBuffer(Buffer* buffer); Source& setBuffer(Buffer* buffer);

20
src/Buffer.h

@ -89,8 +89,8 @@ for(std::size_t i = 0; i != 200; ++i)
CORRADE_INTERNAL_ASSERT_OUTPUT(buffer.unmap()); CORRADE_INTERNAL_ASSERT_OUTPUT(buffer.unmap());
@endcode @endcode
If you are updating only a few discrete portions of the buffer, you can use If you are updating only a few discrete portions of the buffer, you can use
@ref MapFlag "MapFlag::FlushExplicit" and flushMappedRange() to reduce number @ref MapFlag::FlushExplicit and flushMappedRange() to reduce number of memory
of memory operations performed by OpenGL on unmapping. Example: operations performed by OpenGL on unmapping. Example:
@code @code
Vector3* data = static_cast<Vector3*>(buffer.map(0, 200*sizeof(Vector3), Buffer::MapFlag::Write|Buffer::MapFlag::FlushExplicit)); Vector3* data = static_cast<Vector3*>(buffer.map(0, 200*sizeof(Vector3), Buffer::MapFlag::Write|Buffer::MapFlag::FlushExplicit));
for(std::size_t i: {7, 27, 56, 128}) { for(std::size_t i: {7, 27, 56, 128}) {
@ -382,7 +382,7 @@ class MAGNUM_EXPORT Buffer {
/** /**
* Previous contents of the entire buffer may be discarded. May * Previous contents of the entire buffer may be discarded. May
* not be used in combination with @ref MapFlag "MapFlag::Read". * not be used in combination with @ref MapFlag::Read.
* @see invalidateData() * @see invalidateData()
*/ */
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
@ -393,7 +393,7 @@ class MAGNUM_EXPORT Buffer {
/** /**
* Previous contents of mapped range may be discarded. May not * Previous contents of mapped range may be discarded. May not
* be used in combination with @ref MapFlag "MapFlag::Read". * be used in combination with @ref MapFlag::Read.
* @see invalidateSubData() * @see invalidateSubData()
*/ */
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
@ -405,7 +405,7 @@ class MAGNUM_EXPORT Buffer {
/** /**
* Only one or more discrete subranges of the mapping will be * Only one or more discrete subranges of the mapping will be
* modified. See flushMappedRange() for more information. May only * modified. See flushMappedRange() for more information. May only
* be used in conjuction with @ref MapFlag "MapFlag::Write". * be used in conjuction with @ref MapFlag::Write.
*/ */
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
FlushExplicit = GL_MAP_FLUSH_EXPLICIT_BIT, FlushExplicit = GL_MAP_FLUSH_EXPLICIT_BIT,
@ -683,7 +683,7 @@ class MAGNUM_EXPORT Buffer {
* *
* If running on OpenGL ES or extension @extension{ARB,invalidate_subdata} * If running on OpenGL ES or extension @extension{ARB,invalidate_subdata}
* is not available, this function does nothing. * is not available, this function does nothing.
* @see @ref MapFlag "MapFlag::InvalidateBuffer", @fn_gl{InvalidateBufferData} * @see @ref MapFlag::InvalidateBuffer, @fn_gl{InvalidateBufferData}
*/ */
Buffer& invalidateData() { Buffer& invalidateData() {
(this->*invalidateImplementation)(); (this->*invalidateImplementation)();
@ -698,7 +698,7 @@ class MAGNUM_EXPORT Buffer {
* *
* If running on OpenGL ES or extension @extension{ARB,invalidate_subdata} * If running on OpenGL ES or extension @extension{ARB,invalidate_subdata}
* is not available, this function does nothing. * is not available, this function does nothing.
* @see @ref MapFlag "MapFlag::InvalidateRange", @fn_gl{InvalidateBufferData} * @see @ref MapFlag::InvalidateRange, @fn_gl{InvalidateBufferData}
*/ */
Buffer& invalidateSubData(GLintptr offset, GLsizeiptr length) { Buffer& invalidateSubData(GLintptr offset, GLsizeiptr length) {
(this->*invalidateSubImplementation)(offset, length); (this->*invalidateSubImplementation)(offset, length);
@ -753,8 +753,8 @@ class MAGNUM_EXPORT Buffer {
* @brief Map buffer to client memory * @brief Map buffer to client memory
* @param offset Offset into the buffer * @param offset Offset into the buffer
* @param length Length of the mapped memory * @param length Length of the mapped memory
* @param flags Flags. At least @ref MapFlag "MapFlag::Read" or * @param flags Flags. At least @ref MapFlag::Read or @ref MapFlag::Write
* @ref MapFlag "MapFlag::Write" must be specified. * must be specified.
* @return Pointer to buffer data * @return Pointer to buffer data
* *
* If @extension{EXT,direct_state_access} is not available and the * If @extension{EXT,direct_state_access} is not available and the
@ -776,7 +776,7 @@ class MAGNUM_EXPORT Buffer {
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Flushes specified subsection of mapped range. Use only if you called * Flushes specified subsection of mapped range. Use only if you called
* map() with @ref MapFlag "MapFlag::FlushExplicit" flag. See * map() with @ref MapFlag::FlushExplicit flag. See
* @ref Buffer-data-mapping "class documentation" for usage example. * @ref Buffer-data-mapping "class documentation" for usage example.
* *
* If @extension{EXT,direct_state_access} is not available and the * If @extension{EXT,direct_state_access} is not available and the

8
src/Context.h

@ -67,7 +67,7 @@ enum class Version: Int {
* *
* All the functionality is present in OpenGL 4.2 (extension * All the functionality is present in OpenGL 4.2 (extension
* @extension{ARB,ES2_compatibility}), so on desktop OpenGL this is * @extension{ARB,ES2_compatibility}), so on desktop OpenGL this is
* equivalent to @ref Version "Version::GL410". * equivalent to @ref Version::GL410.
*/ */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
GLES200 = 410, GLES200 = 410,
@ -80,7 +80,7 @@ enum class Version: Int {
* *
* All the functionality is present in OpenGL 4.3 (extension * All the functionality is present in OpenGL 4.3 (extension
* @extension{ARB,ES3_compatibility}), so on desktop OpenGL this is the * @extension{ARB,ES3_compatibility}), so on desktop OpenGL this is the
* equivalent to @ref Version "Version::GL430". * equivalent to @ref Version::GL430.
*/ */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
GLES300 = 430 GLES300 = 430
@ -315,8 +315,8 @@ class MAGNUM_EXPORT Context {
* @endcode * @endcode
* *
* If no version from the list is supported, returns lowest available * If no version from the list is supported, returns lowest available
* OpenGL version (@ref Version "Version::GL210" for desktop OpenGL, * OpenGL version (@ref Version::GL210 for desktop OpenGL, @ref Version::GLES200
* @ref Version "Version::GLES200" for OpenGL ES). * for OpenGL ES).
*/ */
Version supportedVersion(std::initializer_list<Version> versions) const; Version supportedVersion(std::initializer_list<Version> versions) const;

10
src/CubeMapTexture.h

@ -73,8 +73,8 @@ is signed three-part vector from the center of the cube, which intersects one
of the six sides of the cube map. See also AbstractShaderProgram for more of the six sides of the cube map. See also AbstractShaderProgram for more
information about usage in shaders. information about usage in shaders.
@see @ref Renderer::Feature "Renderer::Feature::SeamlessCubeMapTexture", @see @ref Renderer::Feature::SeamlessCubeMapTexture, @ref CubeMapTextureArray,
CubeMapTextureArray, Texture, BufferTexture @ref Texture, @ref BufferTexture
*/ */
class CubeMapTexture: public AbstractTexture { class CubeMapTexture: public AbstractTexture {
public: public:
@ -213,10 +213,10 @@ class CubeMapTexture: public AbstractTexture {
* @param size Size of invalidated data * @param size Size of invalidated data
* *
* Z coordinate is equivalent to number of texture face, i.e. * Z coordinate is equivalent to number of texture face, i.e.
* @ref Coordinate "Coordinate::PositiveX" is `0` and so on, in the * @ref Coordinate::PositiveX is `0` and so on, in the same order as in
* same order as in the enum. * the enum.
* *
* See Texture::invalidateSubImage() for more information. * See @ref Texture::invalidateSubImage() for more information.
*/ */
void invalidateSubImage(Int level, const Vector3i& offset, const Vector3i& size) { void invalidateSubImage(Int level, const Vector3i& offset, const Vector3i& size) {
DataHelper<3>::invalidateSubImage(this, level, offset, size); DataHelper<3>::invalidateSubImage(this, level, offset, size);

4
src/CubeMapTextureArray.h

@ -75,8 +75,8 @@ 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 also the six sides of the cube map, fourth part is layer in the array. See also
AbstractShaderProgram for more information about usage in shaders. AbstractShaderProgram for more information about usage in shaders.
@see @ref Renderer::Feature "Renderer::Feature::SeamlessCubeMapTexture", @see @ref Renderer::Feature::SeamlessCubeMapTexture, @ref CubeMapTexture,
CubeMapTexture, Texture, BufferTexture @ref Texture, @ref BufferTexture
@requires_gl40 %Extension @extension{ARB,texture_cube_map_array} @requires_gl40 %Extension @extension{ARB,texture_cube_map_array}
@requires_gl Cube map texture arrays are not available in OpenGL ES. @requires_gl Cube map texture arrays are not available in OpenGL ES.
*/ */

8
src/DebugTools/ShapeRenderer.h

@ -62,8 +62,8 @@ class ShapeRendererOptions {
* @see setRenderMode() * @see setRenderMode()
*/ */
enum class RenderMode: UnsignedByte { enum class RenderMode: UnsignedByte {
Wireframe, Wireframe, /**< Wireframe rendering */
Solid Solid /**< Solid rendering */
}; };
constexpr ShapeRendererOptions(): _color(1.0f), _pointSize(0.25f), _renderMode(RenderMode::Wireframe) {} constexpr ShapeRendererOptions(): _color(1.0f), _pointSize(0.25f), _renderMode(RenderMode::Wireframe) {}
@ -75,7 +75,7 @@ class ShapeRendererOptions {
* @brief Set shape rendering mode * @brief Set shape rendering mode
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is @ref RenderMode "RenderMode::Wireframe". * Default is @ref RenderMode::Wireframe.
*/ */
ShapeRendererOptions& setRenderMode(RenderMode mode) { ShapeRendererOptions& setRenderMode(RenderMode mode) {
_renderMode = mode; _renderMode = mode;
@ -103,7 +103,7 @@ class ShapeRendererOptions {
* @brief Set point size * @brief Set point size
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Size of rendered crosshairs, representing Shapes::Point shapes. * Size of rendered crosshairs, representing @ref Shapes::Point shapes.
* Default is `0.25f`. * Default is `0.25f`.
*/ */
ShapeRendererOptions& setPointSize(Float size) { ShapeRendererOptions& setPointSize(Float size) {

8
src/DefaultFramebuffer.h

@ -142,7 +142,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
/** /**
* Write output to back buffer. * Write output to back buffer.
* *
* On desktop OpenGL, this is equal to @ref DrawAttachment "DrawAttachment::BackLeft". * On desktop OpenGL, this is equal to @ref DrawAttachment::BackLeft.
*/ */
#ifdef MAGNUM_TARGET_GLES #ifdef MAGNUM_TARGET_GLES
Back = GL_BACK, Back = GL_BACK,
@ -153,7 +153,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
/** /**
* Write output to front buffer. * Write output to front buffer.
* *
* On desktop OpenGL, this is equal to @ref DrawAttachment "DrawAttachment::FrontLeft". * On desktop OpenGL, this is equal to @ref DrawAttachment::FrontLeft.
*/ */
#ifdef MAGNUM_TARGET_GLES #ifdef MAGNUM_TARGET_GLES
Front = GL_FRONT Front = GL_FRONT
@ -313,8 +313,8 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* *
* @p attachments is list of shader outputs mapped to buffer * @p attachments is list of shader outputs mapped to buffer
* attachments. %Shader outputs which are not listed are not used, you * attachments. %Shader outputs which are not listed are not used, you
* can achieve the same by passing @ref DrawAttachment "DrawAttachment::None" * can achieve the same by passing @ref DrawAttachment::None as
* as attachment. Example usage: * attachment. Example usage:
* @code * @code
* framebuffer.mapForDraw({{MyShader::ColorOutput, DefaultFramebuffer::DrawAttachment::BackLeft}, * framebuffer.mapForDraw({{MyShader::ColorOutput, DefaultFramebuffer::DrawAttachment::BackLeft},
* {MyShader::NormalOutput, DefaultFramebuffer::DrawAttachment::None}}); * {MyShader::NormalOutput, DefaultFramebuffer::DrawAttachment::None}});

10
src/Mesh.h

@ -381,9 +381,9 @@ class MAGNUM_EXPORT Mesh {
* @brief Set primitive type * @brief Set primitive type
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is @ref Primitive "Primitive::Triangles". * Default is @ref Primitive::Triangles.
* @see setVertexCount(), addVertexBuffer(), * @see @ref setVertexCount(), @ref addVertexBuffer(),
* addInterleavedVertexBuffer(), addVertexBufferStride() * @ref addInterleavedVertexBuffer(), @ref addVertexBufferStride()
*/ */
Mesh& setPrimitive(Primitive primitive) { Mesh& setPrimitive(Primitive primitive) {
_primitive = primitive; _primitive = primitive;
@ -834,7 +834,7 @@ template<> struct MAGNUM_EXPORT ConfigurationValue<Magnum::Mesh::Primitive> {
/** /**
* @brief Reads enum value as string * @brief Reads enum value as string
* *
* If the value is invalid, returns @ref Magnum::Mesh::Primitive "Mesh::Primitive::Points". * If the value is invalid, returns @ref Magnum::Mesh::Primitive::Points "Mesh::Primitive::Points".
*/ */
static Magnum::Mesh::Primitive fromString(const std::string& stringValue, ConfigurationValueFlags); static Magnum::Mesh::Primitive fromString(const std::string& stringValue, ConfigurationValueFlags);
}; };
@ -853,7 +853,7 @@ template<> struct MAGNUM_EXPORT ConfigurationValue<Magnum::Mesh::IndexType> {
/** /**
* @brief Read enum value as string * @brief Read enum value as string
* *
* If the value is invalid, returns @ref Magnum::Mesh::IndexType "Mesh::IndexType::UnsignedInt". * If the value is invalid, returns @ref Magnum::Mesh::IndexType::UnsignedInt "Mesh::IndexType::UnsignedInt".
*/ */
static Magnum::Mesh::IndexType fromString(const std::string& stringValue, ConfigurationValueFlags); static Magnum::Mesh::IndexType fromString(const std::string& stringValue, ConfigurationValueFlags);
}; };

2
src/Platform/GlutApplication.h

@ -322,7 +322,7 @@ class GlutApplication::Configuration {
* *
* Default is `0`, thus no multisampling. The actual sample count is * Default is `0`, thus no multisampling. The actual sample count is
* ignored, GLUT either enables it or disables. See also * ignored, GLUT either enables it or disables. See also
* @ref Renderer::Feature "Renderer::Feature::Multisampling". * @ref Renderer::Feature::Multisampling.
*/ */
Configuration& setSampleCount(Int count) { Configuration& setSampleCount(Int count) {
_sampleCount = count; _sampleCount = count;

2
src/Platform/NaClApplication.h

@ -333,7 +333,7 @@ class NaClApplication::Configuration {
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is `0`, thus no multisampling. See also * Default is `0`, thus no multisampling. See also
* @ref Renderer::Feature "Renderer::Feature::Multisampling". * @ref Renderer::Feature::Multisampling.
*/ */
Configuration& setSampleCount(Int count) { Configuration& setSampleCount(Int count) {
_sampleCount = count; _sampleCount = count;

4
src/Platform/Sdl2Application.h

@ -267,7 +267,7 @@ class Sdl2Application::Configuration {
* @brief Set window flags * @brief Set window flags
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is @ref Flag "Flag::Resizable". * Default is @ref Flag::Resizable.
*/ */
Configuration& setFlags(const Flags flags) { Configuration& setFlags(const Flags flags) {
_flags = flags; _flags = flags;
@ -282,7 +282,7 @@ class Sdl2Application::Configuration {
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is `0`, thus no multisampling. See also * Default is `0`, thus no multisampling. See also
* @ref Renderer::Feature "Renderer::Feature::Multisampling". * @ref Renderer::Feature::Multisampling.
*/ */
Configuration& setSampleCount(Int count) { Configuration& setSampleCount(Int count) {
_sampleCount = count; _sampleCount = count;

127
src/Renderer.h

@ -222,7 +222,7 @@ class MAGNUM_EXPORT Renderer {
/** /**
* @brief Set hint * @brief Set hint
* *
* Initial value is @ref HintMode "HintMode::DontCare" for all targets. * Initial value is @ref HintMode::DontCare for all targets.
* @see @fn_gl{Hint} * @see @fn_gl{Hint}
*/ */
static void setHint(Hint target, HintMode mode); static void setHint(Hint target, HintMode mode);
@ -244,7 +244,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Set clear depth * @brief Set clear depth
* *
* Initial value is `1.0`. * Initial value is `1.0`.
* @see @ref Feature "Feature::DepthTest", @fn_gl{ClearDepth} * @see @ref Feature::DepthTest, @fn_gl{ClearDepth}
* @requires_gl See setClearDepth(Float), which is available in OpenGL ES. * @requires_gl See setClearDepth(Float), which is available in OpenGL ES.
*/ */
static void setClearDepth(Double depth); static void setClearDepth(Double depth);
@ -253,7 +253,7 @@ class MAGNUM_EXPORT Renderer {
/** /**
* @overload * @overload
* *
* @see @ref Feature "Feature::DepthTest", @fn_gl{ClearDepth} * @see @ref Feature::DepthTest, @fn_gl{ClearDepth}
* If OpenGL ES, OpenGL 4.1 or extension @extension{ARB,ES2_compatibility} * If OpenGL ES, OpenGL 4.1 or extension @extension{ARB,ES2_compatibility}
* is not available, this function behaves exactly as setClearDepth(Double). * is not available, this function behaves exactly as setClearDepth(Double).
*/ */
@ -265,7 +265,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Set clear stencil * @brief Set clear stencil
* *
* Initial value is `0`. * Initial value is `0`.
* @see @ref Feature "Feature::StencilTest", @fn_gl{ClearStencil} * @see @ref Feature::StencilTest, @fn_gl{ClearStencil}
*/ */
static void setClearStencil(Int stencil); static void setClearStencil(Int stencil);
@ -297,9 +297,9 @@ class MAGNUM_EXPORT Renderer {
/** /**
* @brief Which polygon facing to cull * @brief Which polygon facing to cull
* *
* Initial value is @ref PolygonFacing "PolygonFacing::Back". If set to * Initial value is @ref PolygonFacing::Back. If set to both front and
* both front and back, only points and lines are drawn. * back, only points and lines are drawn.
* @see @ref Feature "Feature::FaceCulling", setFrontFace(), * @see @ref Feature::FaceCulling, setFrontFace(),
* @fn_gl{CullFace} * @fn_gl{CullFace}
*/ */
static void setFaceCullingMode(PolygonFacing mode); static void setFaceCullingMode(PolygonFacing mode);
@ -326,7 +326,7 @@ class MAGNUM_EXPORT Renderer {
/** /**
* @brief Set provoking vertex * @brief Set provoking vertex
* *
* Initial value is @ref ProvokingVertex "ProvokingVertex::LastVertexConvention". * Initial value is @ref ProvokingVertex::LastVertexConvention.
* @see @fn_gl{ProvokingVertex} * @see @fn_gl{ProvokingVertex}
* @requires_gl32 %Extension @extension{ARB,provoking_vertex}. Older * @requires_gl32 %Extension @extension{ARB,provoking_vertex}. Older
* versions behave always like the default. * versions behave always like the default.
@ -363,7 +363,7 @@ class MAGNUM_EXPORT Renderer {
/** /**
* @brief Set polygon drawing mode * @brief Set polygon drawing mode
* *
* Initial value is @ref PolygonMode "PolygonMode::Fill". * Initial value is @ref PolygonMode::Fill.
* @see @fn_gl{PolygonMode} * @see @fn_gl{PolygonMode}
* @requires_gl OpenGL ES behaves always like the default. See * @requires_gl OpenGL ES behaves always like the default. See
* @ref Magnum::Mesh::setPrimitive() "Mesh::setPrimitive()" for * @ref Magnum::Mesh::setPrimitive() "Mesh::setPrimitive()" for
@ -377,10 +377,8 @@ class MAGNUM_EXPORT Renderer {
* @param factor Scale factor * @param factor Scale factor
* @param units Offset units * @param units Offset units
* *
* @see @ref Feature "Feature::PolygonOffsetFill", * @see @ref Feature::PolygonOffsetFill, @ref Feature::PolygonOffsetLine,
* @ref Feature "Feature::PolygonOffsetLine", * @ref Feature::PolygonOffsetPoint, @fn_gl{PolygonOffset}
* @ref Feature "Feature::PolygonOffsetPoint",
* @fn_gl{PolygonOffset}
*/ */
static void setPolygonOffset(Float factor, Float units); static void setPolygonOffset(Float factor, Float units);
@ -397,7 +395,7 @@ class MAGNUM_EXPORT Renderer {
* @brief Set point size * @brief Set point size
* *
* Initial value is `1.0f`. * Initial value is `1.0f`.
* @see @ref Feature "Feature::ProgramPointSize", @fn_gl{PointSize} * @see @ref Feature::ProgramPointSize, @fn_gl{PointSize}
* @requires_gl In OpenGL ES use `gl_PointSize` builtin vertex shader * @requires_gl In OpenGL ES use `gl_PointSize` builtin vertex shader
* variable. * variable.
*/ */
@ -411,7 +409,7 @@ class MAGNUM_EXPORT Renderer {
/** /**
* @brief Set scissor rectangle * @brief Set scissor rectangle
* *
* @see @ref Feature "Feature::ScissorTest", @fn_gl{Scissor} * @see @ref Feature::ScissorTest, @fn_gl{Scissor}
*/ */
static void setScissor(const Rectanglei& rectangle); static void setScissor(const Rectanglei& rectangle);
@ -484,24 +482,22 @@ class MAGNUM_EXPORT Renderer {
* @brief Set stencil function * @brief Set stencil function
* @param facing Affected polygon facing * @param facing Affected polygon facing
* @param function Stencil function. Initial value is * @param function Stencil function. Initial value is
* @ref StencilFunction "StencilFunction::Always". * @ref StencilFunction::Always.
* @param referenceValue Reference value. Initial value is `0`. * @param referenceValue Reference value. Initial value is `0`.
* @param mask Mask for both reference and buffer value. * @param mask Mask for both reference and buffer value.
* Initial value is all `1`s. * Initial value is all `1`s.
* *
* @see @ref Feature "Feature::StencilTest", * @see @ref Feature::StencilTest, @ref setStencilFunction(StencilFunction, Int, UnsignedInt),
* setStencilFunction(StencilFunction, Int, UnsignedInt), * @ref setStencilOperation(), @fn_gl{StencilFuncSeparate}
* setStencilOperation(),
* @fn_gl{StencilFuncSeparate}
*/ */
static void setStencilFunction(PolygonFacing facing, StencilFunction function, Int referenceValue, UnsignedInt mask); static void setStencilFunction(PolygonFacing facing, StencilFunction function, Int referenceValue, UnsignedInt mask);
/** /**
* @brief Set stencil function * @brief Set stencil function
* *
* The same as setStencilFunction(PolygonFacing, StencilFunction, Int, UnsignedInt) * The same as @ref setStencilFunction(PolygonFacing, StencilFunction, Int, UnsignedInt)
* with @p facing set to @ref PolygonFacing "PolygonFacing::FrontAndBack". * with @p facing set to @ref PolygonFacing::FrontAndBack.
* @see @ref Feature "Feature::StencilTest", setStencilOperation(), * @see @ref Feature::StencilTest, @ref setStencilOperation(),
* @fn_gl{StencilFunc} * @fn_gl{StencilFunc}
*/ */
static void setStencilFunction(StencilFunction function, Int referenceValue, UnsignedInt mask); static void setStencilFunction(StencilFunction function, Int referenceValue, UnsignedInt mask);
@ -515,19 +511,18 @@ class MAGNUM_EXPORT Renderer {
* @param depthPass Action when both stencil and depth test * @param depthPass Action when both stencil and depth test
* pass * pass
* *
* Initial value for all fields is @ref StencilOperation "StencilOperation::Keep". * Initial value for all fields is @ref StencilOperation::Keep.
* @see @ref Feature "Feature::StencilTest", * @see @ref Feature::StencilTest, @ref setStencilOperation(StencilOperation, StencilOperation, StencilOperation),
* setStencilOperation(StencilOperation, StencilOperation, StencilOperation), * @ref setStencilFunction(), @fn_gl{StencilOpSeparate}
* setStencilFunction(), @fn_gl{StencilOpSeparate}
*/ */
static void setStencilOperation(PolygonFacing facing, StencilOperation stencilFail, StencilOperation depthFail, StencilOperation depthPass); static void setStencilOperation(PolygonFacing facing, StencilOperation stencilFail, StencilOperation depthFail, StencilOperation depthPass);
/** /**
* @brief Set stencil operation * @brief Set stencil operation
* *
* The same as setStencilOperation(PolygonFacing, StencilOperation, StencilOperation, StencilOperation) * The same as @ref setStencilOperation(PolygonFacing, StencilOperation, StencilOperation, StencilOperation)
* with @p facing set to @ref PolygonFacing "PolygonFacing::FrontAndBack". * with @p facing set to @ref PolygonFacing::FrontAndBack.
* @see @ref Feature "Feature::StencilTest", setStencilFunction(), * @see @ref Feature::StencilTest, @ref setStencilFunction(),
* @fn_gl{StencilOp} * @fn_gl{StencilOp}
*/ */
static void setStencilOperation(StencilOperation stencilFail, StencilOperation depthFail, StencilOperation depthPass); static void setStencilOperation(StencilOperation stencilFail, StencilOperation depthFail, StencilOperation depthPass);
@ -546,8 +541,8 @@ class MAGNUM_EXPORT Renderer {
/** /**
* @brief Set depth function * @brief Set depth function
* *
* Initial value is @ref DepthFunction "DepthFunction::Less". * Initial value is @ref DepthFunction::Less.
* @see @ref Feature "Feature::DepthTest", @fn_gl{DepthFunc} * @see @ref Feature::DepthTest, @fn_gl{DepthFunc}
*/ */
static void setDepthFunction(DepthFunction function); static void setDepthFunction(DepthFunction function);
@ -560,7 +555,7 @@ class MAGNUM_EXPORT Renderer {
* *
* Set to `false` to disallow writing to given color channel. Initial * Set to `false` to disallow writing to given color channel. Initial
* values are all `true`. * values are all `true`.
* @see setDepthMask(), setStencilMask(), @fn_gl{ColorMask} * @see @ref setDepthMask(), @ref setStencilMask(), @fn_gl{ColorMask}
* @todo Masking only given draw buffer * @todo Masking only given draw buffer
*/ */
static void setColorMask(GLboolean allowRed, GLboolean allowGreen, GLboolean allowBlue, GLboolean allowAlpha); static void setColorMask(GLboolean allowRed, GLboolean allowGreen, GLboolean allowBlue, GLboolean allowAlpha);
@ -587,8 +582,8 @@ class MAGNUM_EXPORT Renderer {
/** /**
* @brief Mask stencil writes * @brief Mask stencil writes
* *
* The same as calling setStencilMask(PolygonFacing, UnsignedInt) with * The same as calling @ref setStencilMask(PolygonFacing, UnsignedInt)
* `facing` set to @ref PolygonFacing "PolygonFacing::FrontAndBack". * with `facing` set to @ref PolygonFacing::FrontAndBack.
* @see @fn_gl{StencilMask} * @see @fn_gl{StencilMask}
*/ */
static void setStencilMask(UnsignedInt allowBits); static void setStencilMask(UnsignedInt allowBits);
@ -760,53 +755,52 @@ class MAGNUM_EXPORT Renderer {
* @brief Set blend equation * @brief Set blend equation
* *
* How to combine source color (pixel value) with destination color * How to combine source color (pixel value) with destination color
* (framebuffer). Initial value is @ref BlendEquation "BlendEquation::Add". * (framebuffer). Initial value is @ref BlendEquation::Add.
* @see @ref Feature "Feature::Blending", setBlendEquation(BlendEquation, BlendEquation), * @see @ref Feature::Blending, @ref setBlendEquation(BlendEquation, BlendEquation),
* setBlendFunction(), setBlendColor(), @fn_gl{BlendEquation} * @ref setBlendFunction(), @ref setBlendColor(),
* @fn_gl{BlendEquation}
*/ */
static void setBlendEquation(BlendEquation equation); static void setBlendEquation(BlendEquation equation);
/** /**
* @brief Set blend equation separately for RGB and alpha components * @brief Set blend equation separately for RGB and alpha components
* *
* See setBlendEquation(BlendEquation) for more information. * See @ref setBlendEquation(BlendEquation) for more information.
* @see @ref Feature "Feature::Blending", setBlendFunction(), * @see @ref Feature::Blending, @ref setBlendFunction(),
* setBlendColor(), @fn_gl{BlendEquationSeparate} * @ref setBlendColor(), @fn_gl{BlendEquationSeparate}
*/ */
static void setBlendEquation(BlendEquation rgb, BlendEquation alpha); static void setBlendEquation(BlendEquation rgb, BlendEquation alpha);
/** /**
* @brief Set blend function * @brief Set blend function
* @param source How the source blending factor is computed * @param source How the source blending factor is computed
* from pixel value. Initial value is @ref BlendFunction "BlendFunction::One". * from pixel value. Initial value is @ref BlendFunction::One.
* @param destination How the destination blending factor is * @param destination How the destination blending factor is
* computed from framebuffer. Initial value is @ref BlendFunction "BlendFunction::Zero". * computed from framebuffer. Initial value is @ref BlendFunction::Zero.
* *
* @see @ref Feature "Feature::Blending", * @see @ref Feature::Blending, @ref setBlendFunction(BlendFunction, BlendFunction, BlendFunction, BlendFunction),
* setBlendFunction(BlendFunction, BlendFunction, BlendFunction, BlendFunction), * @ref setBlendEquation(), @ref setBlendColor(),
* setBlendEquation(), setBlendColor(), @fn_gl{BlendFunc} * @fn_gl{BlendFunc}
*/ */
static void setBlendFunction(BlendFunction source, BlendFunction destination); static void setBlendFunction(BlendFunction source, BlendFunction destination);
/** /**
* @brief Set blend function separately for RGB and alpha components * @brief Set blend function separately for RGB and alpha components
* *
* See setBlendFunction(BlendFunction, BlendFunction) for more information. * See @ref setBlendFunction(BlendFunction, BlendFunction) for more information.
* @see @ref Feature "Feature::Blending", setBlendEquation(), * @see @ref Feature::Blending, @ref setBlendEquation(),
* setBlendColor(), @fn_gl{BlendFuncSeparate} * @ref setBlendColor(), @fn_gl{BlendFuncSeparate}
*/ */
static void setBlendFunction(BlendFunction sourceRgb, BlendFunction destinationRgb, BlendFunction sourceAlpha, BlendFunction destinationAlpha); static void setBlendFunction(BlendFunction sourceRgb, BlendFunction destinationRgb, BlendFunction sourceAlpha, BlendFunction destinationAlpha);
/** /**
* @brief Set blend color * @brief Set blend color
* *
* Sets constant color used in setBlendFunction() by * Sets constant color used in @ref setBlendFunction() by
* @ref BlendFunction "BlendFunction::ConstantColor", * @ref BlendFunction::ConstantColor, @ref BlendFunction::OneMinusConstantColor,
* @ref BlendFunction "BlendFunction::OneMinusConstantColor", * @ref BlendFunction::ConstantAlpha and @ref BlendFunction::OneMinusConstantAlpha.
* @ref BlendFunction "BlendFunction::ConstantAlpha" and * @see @ref Feature::Blending, @ref setBlendEquation(),
* @ref BlendFunction "BlendFunction::OneMinusConstantAlpha". * @ref setBlendFunction(), @fn_gl{BlendColor}
* @see @ref Feature "Feature::Blending", setBlendEquation(),
* setBlendFunction(), @fn_gl{BlendColor}
*/ */
static void setBlendColor(const Color4& color); static void setBlendColor(const Color4& color);
@ -818,7 +812,7 @@ class MAGNUM_EXPORT Renderer {
/** /**
* @brief Logical operation * @brief Logical operation
* *
* @see setLogicOperation() * @see @ref setLogicOperation()
* @requires_gl Logical operations on framebuffer are not available in * @requires_gl Logical operations on framebuffer are not available in
* OpenGL ES. * OpenGL ES.
*/ */
@ -844,7 +838,7 @@ class MAGNUM_EXPORT Renderer {
/** /**
* @brief Set logical operation * @brief Set logical operation
* *
* @see @ref Feature "Feature::LogicOperation", @fn_gl{LogicOp} * @see @ref Feature::LogicOperation, @fn_gl{LogicOp}
* @requires_gl Logical operations on framebuffer are not available in * @requires_gl Logical operations on framebuffer are not available in
* OpenGL ES. * OpenGL ES.
*/ */
@ -927,8 +921,8 @@ class MAGNUM_EXPORT Renderer {
* @brief Error status * @brief Error status
* *
* Returns error flag, if any set. If there aren't any more error * Returns error flag, if any set. If there aren't any more error
* flags, returns @ref Error "Error::NoError". Thus this function * flags, returns @ref Error::NoError. Thus this function should be
* should be always called in a loop until it returns @ref Error "Error::NoError". * always called in a loop until it returns @ref Error::NoError.
* @see @fn_gl{GetError} * @see @fn_gl{GetError}
*/ */
static Error error() { return static_cast<Error>(glGetError()); } static Error error() { return static_cast<Error>(glGetError()); }
@ -943,8 +937,8 @@ class MAGNUM_EXPORT Renderer {
*/ */
enum class ResetNotificationStrategy: GLint { enum class ResetNotificationStrategy: GLint {
/** /**
* No reset notification, thus graphicsResetStatus() will always * No reset notification, thus @ref graphicsResetStatus() will
* return @ref GraphicsResetStatus "GraphicsResetStatus::NoError". * always return @ref GraphicsResetStatus::NoError.
* However this doesn't mean that the context cannot be lost. * However this doesn't mean that the context cannot be lost.
*/ */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -955,7 +949,7 @@ class MAGNUM_EXPORT Renderer {
/** /**
* Graphics reset will result in context loss, cause of the reset * Graphics reset will result in context loss, cause of the reset
* can be queried with graphicsResetStatus(). * can be queried with @ref graphicsResetStatus().
*/ */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
LoseContextOnReset = GL_LOSE_CONTEXT_ON_RESET_ARB LoseContextOnReset = GL_LOSE_CONTEXT_ON_RESET_ARB
@ -970,7 +964,7 @@ class MAGNUM_EXPORT Renderer {
* The result is cached, repeated queries don't result in repeated * The result is cached, repeated queries don't result in repeated
* OpenGL calls. If OpenGL extension @extension{ARB,robustness} or ES * OpenGL calls. If OpenGL extension @extension{ARB,robustness} or ES
* extension @es_extension{EXT,robustness} is not available, this * extension @es_extension{EXT,robustness} is not available, this
* function always returns @ref ResetNotificationStrategy "ResetNotificationStrategy::NoResetNotification". * function always returns @ref ResetNotificationStrategy::NoResetNotification.
* @see graphicsResetStatus(), @fn_gl{Get} with @def_gl{RESET_NOTIFICATION_STRATEGY_ARB} * @see graphicsResetStatus(), @fn_gl{Get} with @def_gl{RESET_NOTIFICATION_STRATEGY_ARB}
*/ */
static ResetNotificationStrategy resetNotificationStrategy(); static ResetNotificationStrategy resetNotificationStrategy();
@ -1013,9 +1007,8 @@ class MAGNUM_EXPORT Renderer {
* *
* Reset causes all context state to be lost. If OpenGL extension * Reset causes all context state to be lost. If OpenGL extension
* @extension{ARB,robustness} or ES extension @es_extension{EXT,robustness} * @extension{ARB,robustness} or ES extension @es_extension{EXT,robustness}
* is not available, this function always returns * is not available, this function always returns @ref GraphicsResetStatus::NoError.
* @ref GraphicsResetStatus "GraphicsResetStatus::NoError". * @see @ref resetNotificationStrategy(), @fn_gl_extension{GetGraphicsResetStatus,ARB,robustness}
* @see resetNotificationStrategy(), @fn_gl_extension{GetGraphicsResetStatus,ARB,robustness}
*/ */
static GraphicsResetStatus graphicsResetStatus() { static GraphicsResetStatus graphicsResetStatus() {
return graphicsResetStatusImplementation(); return graphicsResetStatusImplementation();

6
src/Resource.h

@ -168,9 +168,9 @@ class Resource {
* @brief Whether the resource is available * @brief Whether the resource is available
* *
* Returns `false` when resource is not loaded and no fallback is * Returns `false` when resource is not loaded and no fallback is
* available (i.e. state() is either @ref ResourceState "ResourceState::NotLoaded", * available (i.e. state() is either @ref ResourceState::NotLoaded,
* @ref ResourceState "ResourceState::Loading" or * @ref ResourceState::Loading or @ref ResourceState::NotFound), `true`
* @ref ResourceState "ResourceState::NotFound"), true otherwise. * otherwise.
*/ */
operator bool() { operator bool() {
acquire(); acquire();

4
src/ResourceManager.h

@ -322,8 +322,8 @@ template<class... Types> class ResourceManager: private Implementation::Resource
* @brief Set resource data * @brief Set resource data
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Same as above with state set to @ref ResourceDataState "ResourceDataState::Final" * Same as above with state set to @ref ResourceDataState::Final and
* and policy to @ref ResourcePolicy "ResourcePolicy::Resident". * policy to @ref ResourcePolicy::Resident.
*/ */
template<class T> ResourceManager<Types...>& set(ResourceKey key, T* data) { template<class T> ResourceManager<Types...>& set(ResourceKey key, T* data) {
return set(key, data, ResourceDataState::Final, ResourcePolicy::Resident); return set(key, data, ResourceDataState::Final, ResourcePolicy::Resident);

16
src/SceneGraph/AbstractFeature.h

@ -267,23 +267,21 @@ template<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT Abstrac
/** /**
* @brief Clean data based on absolute transformation * @brief Clean data based on absolute transformation
* *
* When object is cleaned and * When object is cleaned and @ref CachedTransformation::Absolute is
* @ref CachedTransformation "CachedTransformation::Absolute" is * enabled in @ref setCachedTransformations(), this function is called
* enabled in setCachedTransformations(), this function is called to * to recalculate data based on absolute object transformation.
* recalculate data based on absolute object transformation.
* *
* Default implementation does nothing. * Default implementation does nothing.
* @see @ref scenegraph-caching, cleanInverted() * @see @ref scenegraph-caching, @ref cleanInverted()
*/ */
virtual void clean(const typename DimensionTraits<dimensions, T>::MatrixType& absoluteTransformationMatrix); virtual void clean(const typename DimensionTraits<dimensions, T>::MatrixType& absoluteTransformationMatrix);
/** /**
* @brief Clean data based on inverted absolute transformation * @brief Clean data based on inverted absolute transformation
* *
* When object is cleaned and * When object is cleaned and @ref CachedTransformation::InvertedAbsolute
* @ref CachedTransformation "CachedTransformation::InvertedAbsolute" * is enabled in @ref setCachedTransformations(), this function is
* is enabled in setCachedTransformations(), this function is called * called to recalculate data based on inverted absolute object
* to recalculate data based on inverted absolute object
* transformation. * transformation.
* *
* Default implementation does nothing. * Default implementation does nothing.

89
src/SceneGraph/Animable.h

@ -42,13 +42,13 @@ namespace Magnum { namespace SceneGraph {
enum class AnimationState: UnsignedByte { enum class AnimationState: UnsignedByte {
/** /**
* The animation is stopped. The animation will be started from the * The animation is stopped. The animation will be started from the
* beginning when state is changed to @ref AnimationState "AnimationState::Running". * beginning when state is changed to @ref AnimationState::Running.
*/ */
Stopped, Stopped,
/** /**
* The animation is stopped. The animation will continue from paused * The animation is stopped. The animation will continue from paused
* position when state is changed to @ref AnimationState "AnimationState::Running". * position when state is changed to @ref AnimationState::Running.
*/ */
Paused, Paused,
@ -121,11 +121,11 @@ void MyApplication::drawEvent() {
@section Animable-performance Using animable groups to improve performance @section Animable-performance Using animable groups to improve performance
AnimableGroup is optimized for case when no animation is running - it just AnimableGroup is optimized for case when no animation is running -- it just
puts itself to rest and waits until some animation changes its state to puts itself to rest and waits until some animation changes its state to
@ref AnimationState "AnimationState::Running" again. If you put animations @ref AnimationState::Running again. If you put animations which are not
which are not pernamently running to separate group, they will not be always pernamently running to separate group, they will not be always traversed when
traversed when calling AnimableGroup::step(), saving precious frame time. calling @ref AnimableGroup::step(), saving precious frame time.
@section Animable-explicit-specializations Explicit template specializations @section Animable-explicit-specializations Explicit template specializations
@ -167,12 +167,12 @@ template<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT Animabl
* @brief Set animation state * @brief Set animation state
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Note that changing state from @ref AnimationState "AnimationState::Stopped" * Note that changing state from @ref AnimationState::Stopped to
* to @ref AnimationState "AnimationState::Paused" is ignored and * @ref AnimationState::Paused is ignored and animation remains in
* animation remains in @ref AnimationState "AnimationState::Stopped" * @ref AnimationState::Stopped state. See also @ref animationStep()
* state. See also animationStep() for more information. * for more information.
* @see animationStarted(), animationPaused(), animationResumed(), * @see @ref animationStarted(), @ref animationPaused(),
* animationStopped() * @ref animationResumed(), @ref animationStopped()
*/ */
Animable<dimensions, T>& setState(AnimationState state); Animable<dimensions, T>& setState(AnimationState state);
@ -242,78 +242,69 @@ template<UnsignedInt dimensions, class T> class MAGNUM_SCENEGRAPH_EXPORT Animabl
* @param time Time from start of the animation * @param time Time from start of the animation
* @param delta Time delta for current frame * @param delta Time delta for current frame
* *
* This function is periodically called from AnimableGroup::step() if * This function is periodically called from @ref AnimableGroup::step()
* the animation state is set to @ref AnimationState "AnimationState::Running". * if the animation state is set to @ref AnimationState::Running. After
* After animation duration is exceeded and repeat is not enabled or * animation duration is exceeded and repeat is not enabled or repeat
* repeat count is exceeded, the animation state is set to * count is exceeded, the animation state is set to @ref AnimationState::Stopped.
* @ref AnimationState "AnimationState::Stopped".
* *
* If the animation is resumed from @ref AnimationState "AnimationState::Paused", * If the animation is resumed from @ref AnimationState::Paused, this
* this function is called with @p time continuing from the point * function is called with @p time continuing from the point when it
* when it was paused. If the animation is resumed from * was paused. If the animation is resumed from @ref AnimationState::Stopped,
* @ref AnimationState "AnimationState::Stopped", @p time starts with * @p time starts with zero.
* zero.
* *
* @see state(), duration(), isRepeated(), repeatCount() * @see @ref state(), @ref duration(), @ref isRepeated(),
* @ref repeatCount()
*/ */
virtual void animationStep(Float time, Float delta) = 0; virtual void animationStep(Float time, Float delta) = 0;
/** /**
* @brief Action on animation start * @brief Action on animation start
* *
* Called from AnimableGroup::step() when state is changed from * Called from @ref AnimableGroup::step() when state is changed from
* @ref AnimationState "AnimationState::Stopped" to * @ref AnimationState::Stopped to @ref AnimationState::Running and
* @ref AnimationState "AnimationState::Running" and before first * before first @ref animationStep() is called.
* animationStep() is called.
* *
* Default implementation does nothing. * Default implementation does nothing.
* * @see @ref setState()
* @see setState()
*/ */
virtual void animationStarted() {} virtual void animationStarted() {}
/** /**
* @brief Action on animation pause * @brief Action on animation pause
* *
* Called from AnimableGroup::step() when state changes from * Called from @ref AnimableGroup::step() when state changes from
* @ref AnimationState "AnimationState::Running" to * @ref AnimationState::Running to @ref AnimationState::Paused and
* @ref AnimationState "AnimationState::Paused" and after last * after last @ref animationStep() is called.
* animationStep() is called.
* *
* Default implementation does nothing. * Default implementation does nothing.
* * @see @ref setState()
* @see setState()
*/ */
virtual void animationPaused() {} virtual void animationPaused() {}
/** /**
* @brief Action on animation resume * @brief Action on animation resume
* *
* Called from AnimableGroup::step() when state changes from * Called from @ref AnimableGroup::step() when state changes from
* @ref AnimationState "AnimationState::Paused" to * @ref AnimationState::Paused to @ref AnimationState::Running and
* @ref AnimationState "AnimationState::Running" and before first * before first @ref animationStep() is called.
* animationStep() is called.
* *
* Default implementation does nothing. * Default implementation does nothing.
* * @see @ref setState()
* @see setState()
*/ */
virtual void animationResumed() {} virtual void animationResumed() {}
/** /**
* @brief Action on animation stop * @brief Action on animation stop
* *
* Called from AnimableGroup::step() when state changes from either * Called from @ref AnimableGroup::step() when state changes from
* @ref AnimationState "AnimationState::Running" or * either @ref AnimationState::Running or @ref AnimationState::Paused
* @ref AnimationState "AnimationState::Paused" to * to @ref AnimationState::Stopped and after last @ref animationStep()
* @ref AnimationState "AnimationState::Stopped" and after last * is called.
* animationStep() is called.
* *
* You may want to use this function to properly finish the animation * You may want to use this function to properly finish the animation
* in case the framerate is not high enough to have animationStep() * in case the framerate is not high enough to have @ref animationStep()
* called enough times. Default implementation does nothing. * called enough times. Default implementation does nothing.
* * @see @ref setState()
* @see setState()
*/ */
virtual void animationStopped() {} virtual void animationStopped() {}

26
src/Shaders/MeshVisualizer.h

@ -45,15 +45,15 @@ to be able to render.
@section ShadersMeshVisualizer-wireframe Wireframe visualization @section ShadersMeshVisualizer-wireframe Wireframe visualization
Wireframe visualization is done by enabling @ref Flag "Flag::Wireframe". It is Wireframe visualization is done by enabling @ref Flag::Wireframe. It is done
done either using geometry shaders or with help of additional vertex information. either using geometry shaders or with help of additional vertex information.
If you have geometry shaders available, you don't need to do anything else. If you have geometry shaders available, you don't need to do anything else.
@requires_gl32 %Extension @extension{ARB,geometry_shader4} for wireframe @requires_gl32 %Extension @extension{ARB,geometry_shader4} for wireframe
rendering using geometry shaders. rendering using geometry shaders.
If you don't have geometry shaders, you need to set @ref Flag "Flag::NoGeometryShader" If you don't have geometry shaders, you need to set @ref Flag::NoGeometryShader
(it's enabled by default in OpenGL ES) and use only **non-indexed** triangle (it's enabled by default in OpenGL ES) and use only **non-indexed** triangle
meshes (see MeshTools::duplicate() for possible solution). Additionaly, if you meshes (see MeshTools::duplicate() for possible solution). Additionaly, if you
have OpenGL < 3.1 or OpenGL ES 2.0, you need to provide also @ref VertexIndex have OpenGL < 3.1 or OpenGL ES 2.0, you need to provide also @ref VertexIndex
@ -71,7 +71,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
/** /**
* @brief Vertex index * @brief Vertex index
* *
* Used only in OpenGL < 3.1 and OpenGL ES 2.0 if @ref Flag "Flag::Wireframe" * Used only in OpenGL < 3.1 and OpenGL ES 2.0 if @ref Flag::Wireframe
* is enabled. This attribute specifies index of given vertex in * is enabled. This attribute specifies index of given vertex in
* triangle, i.e. `0` for first, `1` for second, `2` for third. In * triangle, i.e. `0` for first, `1` for second, `2` for third. In
* OpenGL 3.1, OpenGL ES 3.0 and newer this value is provided by the * OpenGL 3.1, OpenGL ES 3.0 and newer this value is provided by the
@ -87,7 +87,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
enum class Flag: UnsignedByte { enum class Flag: UnsignedByte {
/** /**
* Visualize wireframe. On OpenGL ES this also enables * Visualize wireframe. On OpenGL ES this also enables
* @ref Flag "Flag::NoGeometryShader". * @ref Flag::NoGeometryShader.
*/ */
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Wireframe = 1 << 0, Wireframe = 1 << 0,
@ -98,7 +98,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
/** /**
* Don't use geometry shader for wireframe visualization. If * Don't use geometry shader for wireframe visualization. If
* enabled, you might need to provide also VertexIndex attribute in * enabled, you might need to provide also VertexIndex attribute in
* the mesh. In OpenGL ES enabled alongside @ref Flag "Flag::Wireframe". * the mesh. In OpenGL ES enabled alongside @ref Flag::Wireframe.
*/ */
NoGeometryShader = 1 << 1 NoGeometryShader = 1 << 1
}; };
@ -125,8 +125,8 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
* @brief Set viewport size * @brief Set viewport size
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Has effect only if @ref Flag "Flag::Wireframe" is enabled and * Has effect only if @ref Flag::Wireframe is enabled and geometry
* geometry shaders are used. * shaders are used.
*/ */
MeshVisualizer& setViewportSize(const Vector2& size) { MeshVisualizer& setViewportSize(const Vector2& size) {
if(flags & Flag::Wireframe && !(flags & Flag::NoGeometryShader)) if(flags & Flag::Wireframe && !(flags & Flag::NoGeometryShader))
@ -150,7 +150,7 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Initial value is fully opaque black. Has effect only if * Initial value is fully opaque black. Has effect only if
* @ref Flag "Flag::Wireframe" is enabled. * @ref Flag::Wireframe is enabled.
*/ */
MeshVisualizer& setWireframeColor(const Color4& color) { MeshVisualizer& setWireframeColor(const Color4& color) {
if(flags & Flag::Wireframe) setUniform(wireframeColorUniform, color); if(flags & Flag::Wireframe) setUniform(wireframeColorUniform, color);
@ -161,8 +161,8 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
* @brief Set wireframe width * @brief Set wireframe width
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Initial value is `1.0f`. Has effect only if * Initial value is `1.0f`. Has effect only if @ref Flag::Wireframe is
* @ref Flag "Flag::Wireframe" is enabled. * enabled.
*/ */
MeshVisualizer& setWireframeWidth(Float width) { MeshVisualizer& setWireframeWidth(Float width) {
if(flags & Flag::Wireframe) setUniform(wireframeWidthUniform, width); if(flags & Flag::Wireframe) setUniform(wireframeWidthUniform, width);
@ -173,8 +173,8 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizer: public AbstractShaderProgram {
* @brief Set line smoothness * @brief Set line smoothness
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Initial value is `2.0f`. Has effect only if * Initial value is `2.0f`. Has effect only if @ref Flag::Wireframe is
* @ref Flag "Flag::Wireframe" is enabled. * enabled.
*/ */
MeshVisualizer& setSmoothness(Float smoothness); MeshVisualizer& setSmoothness(Float smoothness);

17
src/Shaders/Phong.h

@ -64,27 +64,26 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
/** /**
* @brief Texture coordinates * @brief Texture coordinates
* *
* Used only if one of @ref Flag "Flag::AmbientTexture", * Used only if one of @ref Flag::AmbientTexture, @ref Flag::DiffuseTexture
* @ref Flag "Flag::DiffuseTexture" or @ref Flag "Flag::SpecularTexture" * or @ref Flag::SpecularTexture is set.
* is set.
*/ */
typedef Attribute<2, Vector2> TextureCoordinates; typedef Attribute<2, Vector2> TextureCoordinates;
enum: Int { enum: Int {
/** /**
* Layer for ambient texture. Used only if @ref Flag "Flag::AmbientTexture" * Layer for ambient texture. Used only if @ref Flag::AmbientTexture
* is set. * is set.
*/ */
AmbientTextureLayer = 0, AmbientTextureLayer = 0,
/** /**
* Layer for diffuse texture. Used only if @ref Flag "Flag::DiffuseTexture" * Layer for diffuse texture. Used only if @ref Flag::DiffuseTexture
* is set. * is set.
*/ */
DiffuseTextureLayer = 1, DiffuseTextureLayer = 1,
/** /**
* Layer for specular texture. Used only if @ref Flag "Flag::SpecularTexture" * Layer for specular texture. Used only if @ref Flag::SpecularTexture
* is set. * is set.
*/ */
SpecularTextureLayer = 2 SpecularTextureLayer = 2
@ -122,7 +121,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* If not set, default value is `(0.0f, 0.0f, 0.0f)`. Has no effect if * If not set, default value is `(0.0f, 0.0f, 0.0f)`. Has no effect if
* @ref Flag "Flag::AmbientTexture" is set. * @ref Flag::AmbientTexture is set.
*/ */
Phong& setAmbientColor(const Color3& color); Phong& setAmbientColor(const Color3& color);
@ -130,7 +129,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* @brief Set diffuse color * @brief Set diffuse color
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Has no effect if @ref Flag "Flag::AmbientTexture" is used. * Has no effect if @ref Flag::AmbientTexture is used.
*/ */
Phong& setDiffuseColor(const Color3& color); Phong& setDiffuseColor(const Color3& color);
@ -139,7 +138,7 @@ class MAGNUM_SHADERS_EXPORT Phong: public AbstractShaderProgram {
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* If not set, default value is `(1.0f, 1.0f, 1.0f)`. Has no effect if * If not set, default value is `(1.0f, 1.0f, 1.0f)`. Has no effect if
* @ref Flag "Flag::SpecularTexture" is set. * @ref Flag::SpecularTexture is set.
*/ */
Phong& setSpecularColor(const Color3& color); Phong& setSpecularColor(const Color3& color);

41
src/Text/AbstractFont.h

@ -60,7 +60,7 @@ checked by the implementation:
after the previous file was closed, function doClose() is called only if after the previous file was closed, function doClose() is called only if
there is any file opened. there is any file opened.
- Functions doOpenData() and doOpenSingleData() are called only if - Functions doOpenData() and doOpenSingleData() are called only if
@ref Feature "Feature::OpenData" is supported. @ref Feature::OpenData is supported.
- All `do*()` implementations working on opened file are called only if - All `do*()` implementations working on opened file are called only if
there is any file opened. there is any file opened.
*/ */
@ -112,8 +112,8 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
* @param size Font size * @param size Font size
* *
* Closes previous file, if it was opened, and tries to open given * Closes previous file, if it was opened, and tries to open given
* file. Available only if @ref Feature "Feature::OpenData" is * file. Available only if @ref Feature::OpenData is supported. Returns
* supported. Returns `true` on success, `false` otherwise. * `true` on success, `false` otherwise.
*/ */
bool openData(const std::vector<std::pair<std::string, Containers::ArrayReference<const unsigned char>>>& data, Float size); bool openData(const std::vector<std::pair<std::string, Containers::ArrayReference<const unsigned char>>>& data, Float size);
@ -123,9 +123,9 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
* @param size Font size * @param size Font size
* *
* Closes previous file, if it was opened, and tries to open given * Closes previous file, if it was opened, and tries to open given
* file. Available only if @ref Feature "Feature::OpenData" is * file. Available only if @ref Feature::OpenData is supported and the
* supported and the plugin doesn't have @ref Feature "Feature::MultiFile". * plugin doesn't have @ref Feature::MultiFile. Returns `true` on
* Returns `true` on success, `false` otherwise. * success, `false` otherwise.
*/ */
bool openSingleData(Containers::ArrayReference<const unsigned char> data, Float size); bool openSingleData(Containers::ArrayReference<const unsigned char> data, Float size);
@ -135,10 +135,10 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
* @param size Font size * @param size Font size
* *
* Closes previous file, if it was opened, and tries to open given * Closes previous file, if it was opened, and tries to open given
* file. If the plugin has @ref Feature "Feature::MultiFile", the * file. If the plugin has @ref Feature::MultiFile, the function will
* function will use additional files in given path, all sharing common * use additional files in given path, all sharing common basename
* basename derived from @p filename. Returns `true` on success, * derived from @p filename. Returns `true` on success, `false`
* `false` otherwise. * otherwise.
*/ */
bool openFile(const std::string& filename, Float size); bool openFile(const std::string& filename, Float size);
@ -172,8 +172,8 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
* @param characters UTF-8 characters to render * @param characters UTF-8 characters to render
* *
* Fills the cache with given characters. Fonts having * Fills the cache with given characters. Fonts having
* @ref Feature "Feature::PreparedGlyphCache" do not support partial * @ref Feature::PreparedGlyphCache do not support partial glyph cache
* glyph cache filling, use createGlyphCache() instead. * filling, use @ref createGlyphCache() instead.
*/ */
void fillGlyphCache(GlyphCache& cache, const std::string& characters); void fillGlyphCache(GlyphCache& cache, const std::string& characters);
@ -181,9 +181,9 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
* @brief Create glyph cache * @brief Create glyph cache
* *
* Configures and fills glyph cache with the contents of whole font. * Configures and fills glyph cache with the contents of whole font.
* Available only if @ref Feature "Feature::PreparedGlyphCache" is * Available only if @ref Feature::PreparedGlyphCache is supported.
* supported. Other fonts support only partial glyph cache filling, * Other fonts support only partial glyph cache filling, see
* see fillGlyphCache(). * @ref fillGlyphCache().
*/ */
GlyphCache* createGlyphCache(); GlyphCache* createGlyphCache();
@ -218,8 +218,8 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
/** /**
* @brief Implementation for openData() * @brief Implementation for openData()
* *
* If the plugin doesn't have @ref Feature "Feature::MultiFile", * If the plugin doesn't have @ref Feature::MultiFile, default
* default implementation calls doOpenSingleData(). * implementation calls @ref doOpenSingleData().
*/ */
virtual void doOpenData(const std::vector<std::pair<std::string, Containers::ArrayReference<const unsigned char>>>& data, Float size); virtual void doOpenData(const std::vector<std::pair<std::string, Containers::ArrayReference<const unsigned char>>>& data, Float size);
@ -229,10 +229,9 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
/** /**
* @brief Implementation for openFile() * @brief Implementation for openFile()
* *
* If @ref Feature "Feature::OpenData" is supported and the plugin * If @ref Feature::OpenData is supported and the plugin doesn't have
* doesn't have @ref Feature "Feature::MultiFile", default * @ref Feature::MultiFile, default implementation opens the file and
* implementation opens the file and calls doOpenSingleData() with its * calls @ref doOpenSingleData() with its contents.
* contents.
*/ */
virtual void doOpenFile(const std::string& filename, Float size); virtual void doOpenFile(const std::string& filename, Float size);

204
src/Text/AbstractFontConverter.h

@ -50,13 +50,13 @@ exporting functions are converted to list of unique UTF-32 characters.
You don't need to do most of the redundant sanity checks, these things are You don't need to do most of the redundant sanity checks, these things are
checked by the implementation: checked by the implementation:
- Functions `doExportFontTo*()` are called only if @ref Feature "Feature::ExportFont" - Functions `doExportFontTo*()` are called only if @ref Feature::ExportFont
is supported, functions `doExportGlyphCacheTo*()` are called only if is supported, functions `doExportGlyphCacheTo*()` are called only if
@ref Feature "Feature::ExportGlyphCache" is supported. @ref Feature::ExportGlyphCache is supported.
- Functions `doImportGlyphCacheFrom*()` are called only if - Functions `doImportGlyphCacheFrom*()` are called only if
@ref Feature "Feature::ImportGlyphCache" is supported. @ref Feature::ImportGlyphCache is supported.
- Functions `doExport*To*Data()` and `doImport*From*Data()` are called only - Functions `doExport*To*Data()` and `doImport*From*Data()` are called only
if @ref Feature "Feature::ConvertData" is supported. if @ref Feature::ConvertData is supported.
- Function `doImport*FromData()` is called only if there is at least one data - Function `doImport*FromData()` is called only if there is at least one data
array passed. array passed.
*/ */
@ -67,33 +67,42 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
/** /**
* @brief Features supported by this converter * @brief Features supported by this converter
* *
* @see Features, features() * @see @ref Features, @ref features()
*/ */
enum class Feature: UnsignedByte { enum class Feature: UnsignedByte {
/** /**
* Exporting font using exportToFile() or exportToData() * Exporting font using @ref exportFontToFile(), @ref exportFontToData()
* @see @ref Feature "Feature::ConvertData" * or @ref exportFontToSingleData()
* @see @ref Feature::ConvertData
*/ */
ExportFont = 1 << 0, ExportFont = 1 << 0,
/** /**
* Export glyph cache using exportToFile() or exportToData() * Export glyph cache using @ref exportGlyphCacheToFile(),
* @see @ref Feature "Feature::ConvertData" * @ref exportGlyphCacheToData() or @ref exportGlyphCacheToSingleData()
* @see @ref Feature::ConvertData
*/ */
ExportGlyphCache = 1 << 1, ExportGlyphCache = 1 << 1,
/** /**
* Import glyph cache using importFromFile() or importFromData() * Import glyph cache using @ref importGlyphCacheFromFile(),
* @see @ref Feature "Feature::ConvertData" * @ref importGlyphCacheFromData() or @ref importGlyphCacheFromSingleData()
* @see @ref Feature::ConvertData
*/ */
ImportGlyphCache = 1 << 2, ImportGlyphCache = 1 << 2,
/** Convert from/to data using exportToData() or importFromData() */ /**
* Convert from/to data using @ref exportFontToData(),
* @ref exportFontToSingleData(), @ref exportGlyphCacheToData(),
* @ref exportGlyphCacheToSingleData(), @ref importGlyphCacheFromData()
* or @ref importGlyphCacheFromSingleData()
*/
ConvertData = 1 << 4, ConvertData = 1 << 4,
/** /**
* The format is multi-file, thus exportToSingleData() and * The format is multi-file, thus @ref exportFontToSingleData(),
* importFromSingleData() convenience functions cannot be used. * @ref exportGlyphCacheToSingleData() and @ref importGlyphCacheFromSingleData()
* convenience functions cannot be used.
*/ */
MultiFile = 1 << 5 MultiFile = 1 << 5
}; };
@ -121,38 +130,39 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
* @param filename Output filename * @param filename Output filename
* @param characters Characters to export * @param characters Characters to export
* *
* Available only if @ref Feature "Feature::ConvertData" and * Available only if @ref Feature::ConvertData and @ref Feature::ExportFont
* @ref Feature "Feature::ExportFont" is supported. Returns pairs of * is supported. Returns pairs of filename and data on success, empty
* filename and data on success, empty vector otherwise. All data will * vector otherwise. All data will be sharing common basename derived
* be sharing common basename derived from @p filename. If the plugin * from @p filename. If the plugin doesn't have @ref Feature::MultiFile,
* doesn't have @ref Feature "Feature::MultiFile", only one pair is * only one pair is returned, thus using @ref exportFontToSingleData()
* returned, thus using exportFontToSingleData() might be more convenient * might be more convenient in that case.
* in that case. * @see @ref features(), @ref exportFontToFile(),
* @see features(), exportFontToFile(), exportGlyphCacheToData() * @ref exportGlyphCacheToData()
*/ */
std::vector<std::pair<std::string, Containers::Array<unsigned char>>> exportFontToData(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const; std::vector<std::pair<std::string, Containers::Array<unsigned char>>> exportFontToData(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const;
/** /**
* @brief Export font to single raw data * @brief Export font to single raw data
* *
* Available only if @ref Feature "Feature::ConvertData" and * Available only if @ref Feature::ConvertData and @ref Feature::ExportFont
* @ref Feature "Feature::ExportFont" is supported and the plugin * is supported and the plugin doesn't have @ref Feature::MultiFile.
* doesn't have @ref Feature "Feature::MultiFile". Returns data on * Returns data on success, zero-sized array otherwise. See
* success, zero-sized array otherwise. See exportFontToData() for * @ref exportFontToData() for more information.
* more information. * @see @ref features(), @ref exportFontToFile(),
* @see features(), exportFontToFile(), importFromSingleData() * @ref exportGlyphCacheToSingleData()
*/ */
Containers::Array<unsigned char> exportFontToSingleData(AbstractFont& font, GlyphCache& cache, const std::string& characters) const; Containers::Array<unsigned char> exportFontToSingleData(AbstractFont& font, GlyphCache& cache, const std::string& characters) const;
/** /**
* @brief Export font to file * @brief Export font to file
* *
* Available only if @ref Feature "Feature::ExportFont" is supported. * Available only if @ref Feature::ExportFont is supported. If the
* If the plugin has @ref Feature "Feature::MultiFile", the function * plugin has @ref Feature::MultiFile, the function will create more
* will create more than one file in given path, all sharing common * than one file in given path, all sharing common basename derived
* basename derived from @p filename. Returns `true` on success, * from @p filename. Returns `true` on success, `false` otherwise. See
* `false` otherwise. See exportFontToData() for more information. * @ref exportFontToData() for more information.
* @see features(), exportFontToData(), exportGlyphCacheToFile() * @see @ref features(), @ref exportFontToData(),
* @ref exportGlyphCacheToFile()
*/ */
bool exportFontToFile(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const; bool exportFontToFile(AbstractFont& font, GlyphCache& cache, const std::string& filename, const std::string& characters) const;
@ -161,41 +171,42 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
* @param cache Populated glyph cache * @param cache Populated glyph cache
* @param filename Output filename * @param filename Output filename
* *
* Available only if @ref Feature "Feature::ConvertData" and * Available only if @ref Feature::ConvertData and @ref Feature::ExportGlyphCache
* @ref Feature "Feature::ExportGlyphCache" is supported. Returns pairs * is supported. Returns pairs of filename and data on success, empty
* of filename and data on success, empty vector otherwise. All data * vector otherwise. All data will be sharing common basename derived
* will be sharing common basename derived from @p filename. If the * from @p filename. If the plugin doesn't have @ref Feature::MultiFile,
* plugin doesn't have @ref Feature "Feature::MultiFile", only one pair * only one pair is returned, thus using @ref exportGlyphCacheToSingleData()
* is returned, thus using exportGlyphCacheToSingleData() might be more * might be more convenient in that case.
* convenient in that case.
* *
* All glyphs from given cache will be exported. If you want to export * All glyphs from given cache will be exported. If you want to export
* smaller subset, fill the cache with less characters. * smaller subset, fill the cache with less characters.
* @see features(), exportGlyphCacheToFile(), exportFontToData() * @see @ref features(), @ref exportGlyphCacheToFile(),
* @ref exportFontToData()
*/ */
std::vector<std::pair<std::string, Containers::Array<unsigned char>>> exportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const; std::vector<std::pair<std::string, Containers::Array<unsigned char>>> exportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const;
/** /**
* @brief Export glyph cache to single raw data * @brief Export glyph cache to single raw data
* *
* Available only if @ref Feature "Feature::ConvertData" and * Available only if @ref Feature::ConvertData and @ref Feature::ExportGlyphCache
* @ref Feature "Feature::ExportGlyphCache" is supported and the plugin * is supported and the plugin doesn't have @ref Feature::MultiFile.
* doesn't have @ref Feature "Feature::MultiFile". Returns data on * Returns data on success, zero-sized array otherwise. See
* success, zero-sized array otherwise. See exportGlyphCacheToData() * @ref exportGlyphCacheToData() for more information.
* for more information. * @see @ref features(), @ref exportGlyphCacheToFile(),
* @see features(), exportGlyphCacheToFile(), importGlyphCacheFromSingleData() * @ref importGlyphCacheFromSingleData()
*/ */
Containers::Array<unsigned char> exportGlyphCacheToSingleData(GlyphCache& cache) const; Containers::Array<unsigned char> exportGlyphCacheToSingleData(GlyphCache& cache) const;
/** /**
* @brief Export glyph cache to file * @brief Export glyph cache to file
* *
* Available only if @ref Feature "Feature::ExportGlyphCache" is * Available only if @ref Feature::ExportGlyphCache is supported. If
* supported. If the plugin has @ref Feature "Feature::MultiFile", the * the plugin has @ref Feature::MultiFile, the function will create
* function will create more than one file in given path, all sharing * more than one file in given path, all sharing common basename
* common basename derived from @p filename. Returns `true` on success, * derived from @p filename. Returns `true` on success, `false`
* `false` otherwise. * otherwise.
* @see features(), exportGlyphCacheToData(), exportFontToFile() * @see @ref features(), @ref exportGlyphCacheToData(),
* @ref exportFontToFile()
*/ */
bool exportGlyphCacheToFile(GlyphCache& cache, const std::string& filename) const; bool exportGlyphCacheToFile(GlyphCache& cache, const std::string& filename) const;
@ -203,37 +214,38 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
* @brief Import glyph cache from raw data * @brief Import glyph cache from raw data
* @param data Pairs of filename and file data * @param data Pairs of filename and file data
* *
* Available only if @ref Feature "Feature::ConvertData" and * Available only if @ref Feature::ConvertData and @ref Feature::ImportGlyphCache
* @ref Feature "Feature::ImportGlyphCache" is supported. Returns * is supported. Returns imported cache on success, `nullptr`
* imported cache on success, `nullptr` otherwise. If the plugin * otherwise. If the plugin doesn't have @ref Feature::MultiFile, only
* doesn't have @ref Feature "Feature::MultiFile", only one file is * one file is needed, thus using @ref importGlyphCacheFromSingleData()
* needed, thus using convertToSingleData() might be more convenient in * might be more convenient in that case.
* that case. * @see @ref features(), @ref importGlyphCacheFromFile(),
* @see features(), importFromFile(), exportToData() * @ref exportGlyphCacheToData()
*/ */
GlyphCache* importGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayReference<const unsigned char>>>& data) const; GlyphCache* importGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayReference<const unsigned char>>>& data) const;
/** /**
* @brief Import glyph cache from single raw data * @brief Import glyph cache from single raw data
* *
* Available only if @ref Feature "Feature::ConvertData" and * Available only if @ref Feature::ConvertData and @ref Feature::ImportGlyphCache
* @ref Feature "Feature::ImportGlyphCache" is supported and the plugin * is supported and the plugin doesn't have @ref Feature::MultiFile.
* doesn't have @ref Feature "Feature::MultiFile". Returns imported * Returns imported cache on success, `nullptr` otherwise. See
* cache on success, `nullptr` otherwise. See importFromData() for * @ref importGlyphCacheFromData() for multi-file conversion.
* multi-file conversion. * @see @ref features(), @ref importGlyphCacheFromFile(),
* @see features(), importFromFile(), exportToSingleData() * @ref exportFontToSingleData()
*/ */
GlyphCache* importGlyphCacheFromSingleData(Containers::ArrayReference<const unsigned char> data) const; GlyphCache* importGlyphCacheFromSingleData(Containers::ArrayReference<const unsigned char> data) const;
/** /**
* @brief Import glyph cache from file * @brief Import glyph cache from file
* *
* Available only if @ref Feature "Feature::ImportGlyphCache" is * Available only if @ref Feature::ImportGlyphCache is supported. If
* supported. If the plugin has @ref Feature "Feature::MultiFile", the * the plugin has @ref Feature::MultiFile, the function will use
* function will use additional files in given path, all sharing common * additional files in given path, all sharing common basename derived
* basename derived from @p filename. Returns imported cache on * from @p filename. Returns imported cache on success, `nullptr`
* success, `nullptr` otherwise. * otherwise.
* @see features(), importFromData(), exportToFile() * @see @ref features(), @ref importGlyphCacheFromData(),
* @ref exportGlyphCacheToFile()
*/ */
GlyphCache* importGlyphCacheFromFile(const std::string& filename) const; GlyphCache* importGlyphCacheFromFile(const std::string& filename) const;
@ -242,14 +254,14 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
#else #else
protected: protected:
#endif #endif
/** @brief Implementation for features() */ /** @brief Implementation for @ref features() */
virtual Features doFeatures() const = 0; virtual Features doFeatures() const = 0;
/** /**
* @brief Implementation for exportFontToData() * @brief Implementation for @ref exportFontToData()
* *
* If the plugin doesn't have @ref Feature "Feature::MultiFile", * If the plugin doesn't have @ref Feature::MultiFile, default
* default implementation calls doExportFontToSingleData(). * implementation calls @ref doExportFontToSingleData().
* @note On Windows uses `std::vector<char32_t>` instead of * @note On Windows uses `std::vector<char32_t>` instead of
* `std::u32string`. See @ref Corrade::Utility::Unicode::utf32() * `std::u32string`. See @ref Corrade::Utility::Unicode::utf32()
* for more information. * for more information.
@ -261,7 +273,7 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
#endif #endif
/** /**
* @brief Implementation for exportFontToSingleData() * @brief Implementation for @ref exportFontToSingleData()
* *
* @note On Windows uses `std::vector<char32_t>` instead of * @note On Windows uses `std::vector<char32_t>` instead of
* `std::u32string`. See @ref Corrade::Utility::Unicode::utf32() * `std::u32string`. See @ref Corrade::Utility::Unicode::utf32()
@ -274,11 +286,10 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
#endif #endif
/** /**
* @brief Implementation for exportFontToFile() * @brief Implementation for @ref exportFontToFile()
* *
* If @ref Feature "Feature::ConvertData" is supported, default * If @ref Feature::ConvertData is supported, default implementation
* implementation calls doExportFontToData() and saves the result to * calls doExportFontToData() and saves the result to given file(s).
* given file(s).
* @note On Windows uses `std::vector<char32_t>` instead of * @note On Windows uses `std::vector<char32_t>` instead of
* `std::u32string`. See @ref Corrade::Utility::Unicode::utf32() * `std::u32string`. See @ref Corrade::Utility::Unicode::utf32()
* for more information. * for more information.
@ -290,10 +301,10 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
#endif #endif
/** /**
* @brief Implementation for exportGlyphCacheToData() * @brief Implementation for @ref exportGlyphCacheToData()
* *
* If the plugin doesn't have @ref Feature "Feature::MultiFile", * If the plugin doesn't have @ref Feature::MultiFile, default
* default implementation calls doExportGlyphCacheToSingleData(). * implementation calls @ref doExportGlyphCacheToSingleData().
*/ */
virtual std::vector<std::pair<std::string, Containers::Array<unsigned char>>> doExportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const; virtual std::vector<std::pair<std::string, Containers::Array<unsigned char>>> doExportGlyphCacheToData(GlyphCache& cache, const std::string& filename) const;
@ -301,19 +312,19 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
virtual Containers::Array<unsigned char> doExportGlyphCacheToSingleData(GlyphCache& cache) const; virtual Containers::Array<unsigned char> doExportGlyphCacheToSingleData(GlyphCache& cache) const;
/** /**
* @brief Implementation for exportGlyphCacheToFile() * @brief Implementation for @ref exportGlyphCacheToFile()
* *
* If @ref Feature "Feature::ConvertData" is supported, default * If @ref Feature::ConvertData is supported, default implementation
* implementation calls doExportGlyphCacheToData() and saves the result * calls @ref doExportGlyphCacheToData() and saves the result to given
* to given file(s). * file(s).
*/ */
virtual bool doExportGlyphCacheToFile(GlyphCache& cache, const std::string& filename) const; virtual bool doExportGlyphCacheToFile(GlyphCache& cache, const std::string& filename) const;
/** /**
* @brief Implementation for importGlyphCacheFromData() * @brief Implementation for @ref importGlyphCacheFromData()
* *
* If the plugin doesn't have @ref Feature "Feature::MultiFile", * If the plugin doesn't have @ref Feature::MultiFile, default
* default implementation calls doImportGlyphCacheFromSingleData(). * implementation calls @ref doImportGlyphCacheFromSingleData().
*/ */
virtual GlyphCache* doImportGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayReference<const unsigned char>>>& data) const; virtual GlyphCache* doImportGlyphCacheFromData(const std::vector<std::pair<std::string, Containers::ArrayReference<const unsigned char>>>& data) const;
@ -321,12 +332,11 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
virtual GlyphCache* doImportGlyphCacheFromSingleData(Containers::ArrayReference<const unsigned char> data) const; virtual GlyphCache* doImportGlyphCacheFromSingleData(Containers::ArrayReference<const unsigned char> data) const;
/** /**
* @brief Implementation for importGlyphCacheFromFile() * @brief Implementation for @ref importGlyphCacheFromFile()
* *
* If @ref Feature "Feature::ConvertData" is supported and the plugin * If @ref Feature::ConvertData is supported and the plugin doesn't
* doesn't have @ref Feature "Feature::MultiFile", default * have @ref Feature::MultiFile, default implementation opens the file
* implementation opens the file and calls doImportGlyphCacheFromSingleData() * and calls @ref doImportGlyphCacheFromSingleData() with its contents.
* with its contents.
*/ */
virtual GlyphCache* doImportGlyphCacheFromFile(const std::string& filename) const; virtual GlyphCache* doImportGlyphCacheFromFile(const std::string& filename) const;

2
src/Text/DistanceFieldGlyphCache.h

@ -65,7 +65,7 @@ class MAGNUM_TEXT_EXPORT DistanceFieldGlyphCache: public GlyphCache {
* parameters. Sets internal texture format to red channel only. On * parameters. Sets internal texture format to red channel only. On
* desktop OpenGL requires @extension{ARB,texture_rg} (also part of * desktop OpenGL requires @extension{ARB,texture_rg} (also part of
* OpenGL ES 3.0), in ES2 uses @es_extension{EXT,texture_rg} if * OpenGL ES 3.0), in ES2 uses @es_extension{EXT,texture_rg} if
* available or @ref TextureFormat "TextureFormat::RGB" as fallback. * available or @ref TextureFormat::RGB as fallback.
* @todo Is Luminance format renderable anywhere? Also would it be * @todo Is Luminance format renderable anywhere? Also would it be
* possible to convert the RGB texture to Luminance after it has * possible to convert the RGB texture to Luminance after it has
* been rendered when blitting is not supported to save memory? * been rendered when blitting is not supported to save memory?

2
src/Text/GlyphCache.h

@ -87,7 +87,7 @@ class MAGNUM_TEXT_EXPORT GlyphCache {
* Sets internal texture format to red channel only. On desktop OpenGL * Sets internal texture format to red channel only. On desktop OpenGL
* requires @extension{ARB,texture_rg} (also part of OpenGL ES 3.0), in * requires @extension{ARB,texture_rg} (also part of OpenGL ES 3.0), in
* ES2 uses @es_extension{EXT,texture_rg}, if available, or * ES2 uses @es_extension{EXT,texture_rg}, if available, or
* @ref TextureFormat "TextureFormat::Luminance" as fallback. * @ref TextureFormat::Luminance as fallback.
*/ */
explicit GlyphCache(const Vector2i& originalSize, const Vector2i& size, const Vector2i& padding = Vector2i()); explicit GlyphCache(const Vector2i& originalSize, const Vector2i& size, const Vector2i& padding = Vector2i());

24
src/Texture.h

@ -73,8 +73,9 @@ information about usage in shaders.
@section Texture-array Texture arrays @section Texture-array Texture arrays
You can create texture arrays by passing @ref Target "Texture2D::Target::Texture1DArray" You can create texture arrays by passing
or @ref Target "Texture3D::Target::Texture2DArray" to constructor. @ref Target::Texture1DArray "Texture2D::Target::Texture1DArray" or
@ref Target::Texture2DArray "Texture3D::Target::Texture2DArray" to constructor.
It is possible to specify each layer separately using setSubImage(), but you It is possible to specify each layer separately using setSubImage(), but you
have to allocate the memory for all layers first either by calling setStorage() have to allocate the memory for all layers first either by calling setStorage()
@ -104,8 +105,10 @@ etc.).
@section Texture-multisample Multisample textures @section Texture-multisample Multisample textures
You can create multisample textures by passing @ref Target "Texture2D::Target::Texture2DMultisample" You can create multisample textures by passing
or @ref Target "Texture3D::Target::Texture2DMultisampleArray" to constructor. @ref Target::Texture2DMultisample "Texture2D::Target::Texture2DMultisample" or
@ref Target::Texture2DMultisampleArray "Texture3D::Target::Texture2DMultisampleArray"
to constructor.
@todoc finish this when fully implemented @todoc finish this when fully implemented
@ -115,13 +118,13 @@ or @ref Target "Texture3D::Target::Texture2DMultisampleArray" to constructor.
@section Texture-rectangle Rectangle textures @section Texture-rectangle Rectangle textures
Rectangle texture is created by passing @ref Target "Target::Rectangle" to Rectangle texture is created by passing @ref Target::Rectangle "Texture2D::Target::Rectangle"
constructor. In shader, the texture is used via `sampler2DRect` and friends. to constructor. In shader, the texture is used via `sampler2DRect` and friends.
Unlike `sampler2D`, which accepts coordinates between 0 and 1, `sampler2DRect` Unlike `sampler2D`, which accepts coordinates between 0 and 1, `sampler2DRect`
accepts coordinates between 0 and `textureSizeInGivenDirection-1`. Note that accepts coordinates between 0 and `textureSizeInGivenDirection-1`. Note that
rectangle textures don't support mipmapping and repeating wrapping modes, see rectangle textures don't support mipmapping and repeating wrapping modes, see
@ref Sampler::Filter "Sampler::Filter", @ref Sampler::Mipmap "Sampler::Mipmap" @ref Sampler::Filter, @ref Sampler::Mipmap and @ref generateMipmap()
and generateMipmap() documentation for more information. documentation for more information.
@requires_gl31 %Extension @extension{ARB,texture_rectangle} for rectangle @requires_gl31 %Extension @extension{ARB,texture_rectangle} for rectangle
textures. textures.
@ -255,10 +258,9 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* textures and (0, textureSizeInGivenDirection-1) for rectangle * textures and (0, textureSizeInGivenDirection-1) for rectangle
* textures. If @extension{EXT,direct_state_access} is not available, * textures. If @extension{EXT,direct_state_access} is not available,
* the texture is bound to some layer before the operation. Initial * the texture is bound to some layer before the operation. Initial
* value is @ref Sampler::Wrapping "Sampler::Wrapping::Repeat". * value is @ref Sampler::Wrapping::Repeat.
* @attention For rectangle textures only some modes are supported, * @attention For rectangle textures only some modes are supported,
* see @ref Sampler::Wrapping "Sampler::Wrapping" documentation * see @ref Sampler::Wrapping documentation for more information.
* for more information.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter} * @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access} * or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_WRAP_S}, @def_gl{TEXTURE_WRAP_T}, * with @def_gl{TEXTURE_WRAP_S}, @def_gl{TEXTURE_WRAP_T},

11
src/TextureTools/DistanceField.h

@ -75,12 +75,11 @@ http://www.valvesoftware.com/publications/2007/SIGGRAPH2007_AlphaTestedMagnifica
@note If internal format of @p output texture is not renderable, this function @note If internal format of @p output texture is not renderable, this function
prints message to error output and does nothing. In desktop OpenGL and prints message to error output and does nothing. In desktop OpenGL and
OpenGL ES 3.0 it's common to render to @ref TextureFormat "TextureFormat::R8". OpenGL ES 3.0 it's common to render to @ref TextureFormat::R8. In OpenGL ES
In OpenGL ES 2.0 you can use @ref TextureFormat "TextureFormat::Red" if 2.0 you can use @ref TextureFormat::Red if @es_extension{EXT,texture_rg} is
@es_extension{EXT,texture_rg} is available, if not, the smallest but still available, if not, the smallest but still inefficient supported format is
inefficient supported format is in most cases @ref TextureFormat "TextureFormat::RGB", in most cases @ref TextureFormat::RGB, rendering to @ref TextureFormat::Luminance
rendering to @ref TextureFormat "TextureFormat::Luminance" is not supported is not supported in most cases.
in most cases.
@bug ES (and maybe GL < 3.20) implementation behaves slightly different @bug ES (and maybe GL < 3.20) implementation behaves slightly different
(jaggies, visible e.g. when rendering outlined fonts) (jaggies, visible e.g. when rendering outlined fonts)

22
src/Trade/AbstractImageConverter.h

@ -51,9 +51,8 @@ supported.
You don't need to do most of the redundant sanity checks, these things are You don't need to do most of the redundant sanity checks, these things are
checked by the implementation: checked by the implementation:
- Functions doExportToImage() or doExportToData() are called only if - Functions @ref doExportToImage() or @ref doExportToData() are called only
@ref Feature "Feature::ConvertImage" or @ref Feature "Feature::ConvertData" if @ref Feature::ConvertImage or @ref Feature::ConvertData is supported.
is supported.
*/ */
class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractPlugin { class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractPlugin {
CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Trade.AbstractImageConverter/0.2.1") CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Trade.AbstractImageConverter/0.2.1")
@ -91,18 +90,18 @@ class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractPlugin
/** /**
* @brief Convert image to different format * @brief Convert image to different format
* *
* Available only if @ref Feature "Feature::ConvertImage" is supported. * Available only if @ref Feature::ConvertImage is supported. Returns
* Returns converted image on success, `nullptr` otherwise. * converted image on success, `nullptr` otherwise.
* @see features(), exportToData(), exportToFile() * @see @ref features(), @ref exportToData(), @ref exportToFile()
*/ */
Image2D* exportToImage(const ImageReference2D& image) const; Image2D* exportToImage(const ImageReference2D& image) const;
/** /**
* @brief Export image to raw data * @brief Export image to raw data
* *
* Available only if @ref Feature "Feature::ConvertData" is supported. * Available only if @ref Feature::ConvertData is supported. Returns
* Returns data on success, zero-sized array otherwise. * data on success, zero-sized array otherwise.
* @see features(), exportToImage(), exportToFile() * @see @ref features(), @ref exportToImage(), @ref exportToFile()
*/ */
Containers::Array<unsigned char> exportToData(const ImageReference2D& image) const; Containers::Array<unsigned char> exportToData(const ImageReference2D& image) const;
@ -131,9 +130,8 @@ class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractPlugin
/** /**
* @brief Implementation of exportToFile() * @brief Implementation of exportToFile()
* *
* If @ref Feature "Feature::ConvertData" is supported, default * If @ref Feature::ConvertData is supported, default implementation
* implementation calls doExportToData() and saves the result to given * calls @ref doExportToData() and saves the result to given file.
* file.
*/ */
virtual bool doExportToFile(const ImageReference2D& image, const std::string& filename) const; virtual bool doExportToFile(const ImageReference2D& image, const std::string& filename) const;
}; };

22
src/Trade/AbstractImporter.h

@ -58,12 +58,13 @@ as the file contains all data user wants to import.
You don't need to do most of the redundant sanity checks, these things are You don't need to do most of the redundant sanity checks, these things are
checked by the implementation: checked by the implementation:
- Functions doOpenData() and doOpenFile() are called after the previous file - Functions @ref doOpenData() and @ref doOpenFile() are called after the
was closed, function doClose() is called only if there is any file opened. previous file was closed, function @ref doClose() is called only if there
- Function doOpenData() is called only if @ref Feature "Feature::OpenData" is any file opened.
is supported. - Function @ref doOpenData() is called only if @ref Feature::OpenData is
- All `do*()` implementations working on opened file are called only if supported.
there is any file opened. - All `do*()` implementations working on opened file are called only if there
is any file opened.
- All `do*()` implementations taking data ID as parameter are called only if - All `do*()` implementations taking data ID as parameter are called only if
the ID is from valid range. the ID is from valid range.
*/ */
@ -100,8 +101,8 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
* @brief Open raw data * @brief Open raw data
* *
* Closes previous file, if it was opened, and tries to open given * Closes previous file, if it was opened, and tries to open given
* file. Available only if @ref Feature "Feature::OpenData" is * file. Available only if @ref Feature::OpenData is supported. Returns
* supported. Returns `true` on success, `false` otherwise. * `true` on success, `false` otherwise.
* @see features(), openFile() * @see features(), openFile()
*/ */
bool openData(Containers::ArrayReference<const unsigned char> data); bool openData(Containers::ArrayReference<const unsigned char> data);
@ -488,9 +489,8 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractPlugin {
/** /**
* @brief Implementation for openFile() * @brief Implementation for openFile()
* *
* If @ref Feature "Feature::OpenData" is supported, default * If @ref Feature::OpenData is supported, default implementation opens
* implementation opens the file and calls doOpenData() with its * the file and calls @ref doOpenData() with its contents.
* contents.
*/ */
virtual void doOpenFile(const std::string& filename); virtual void doOpenFile(const std::string& filename);

12
src/Trade/PhongMaterialData.h

@ -79,7 +79,7 @@ class MAGNUM_EXPORT PhongMaterialData: public AbstractMaterialData {
/** /**
* @brief Ambient color * @brief Ambient color
* *
* Available only if the material doesn't have @ref Flag "Flag::AmbientTexture". * Available only if the material doesn't have @ref Flag::AmbientTexture.
* @see @ref flags() * @see @ref flags()
*/ */
Vector3& ambientColor(); Vector3& ambientColor();
@ -88,7 +88,7 @@ class MAGNUM_EXPORT PhongMaterialData: public AbstractMaterialData {
/** /**
* @brief Ambient texture ID * @brief Ambient texture ID
* *
* Available only if the material has @ref Flag "Flag::AmbientTexture". * Available only if the material has @ref Flag::AmbientTexture.
* @see @ref flags(), @ref AbstractImporter::texture() * @see @ref flags(), @ref AbstractImporter::texture()
*/ */
UnsignedInt& ambientTexture(); UnsignedInt& ambientTexture();
@ -97,7 +97,7 @@ class MAGNUM_EXPORT PhongMaterialData: public AbstractMaterialData {
/** /**
* @brief Diffuse color * @brief Diffuse color
* *
* Available only if the material doesn't have @ref Flag "Flag::DiffuseTexture". * Available only if the material doesn't have @ref Flag::DiffuseTexture.
* @see @ref flags() * @see @ref flags()
*/ */
Vector3& diffuseColor(); Vector3& diffuseColor();
@ -106,7 +106,7 @@ class MAGNUM_EXPORT PhongMaterialData: public AbstractMaterialData {
/** /**
* @brief Diffuse texture ID * @brief Diffuse texture ID
* *
* Available only if the material has @ref Flag "Flag::DiffuseTexture". * Available only if the material has @ref Flag::DiffuseTexture.
* @see @ref flags(), @ref AbstractImporter::texture() * @see @ref flags(), @ref AbstractImporter::texture()
*/ */
UnsignedInt& diffuseTexture(); UnsignedInt& diffuseTexture();
@ -115,7 +115,7 @@ class MAGNUM_EXPORT PhongMaterialData: public AbstractMaterialData {
/** /**
* @brief Specular color * @brief Specular color
* *
* Available only if the material doesn't have @ref Flag "Flag::SpecularTexture". * Available only if the material doesn't have @ref Flag::SpecularTexture.
* @see @ref flags() * @see @ref flags()
*/ */
Vector3& specularColor(); Vector3& specularColor();
@ -124,7 +124,7 @@ class MAGNUM_EXPORT PhongMaterialData: public AbstractMaterialData {
/** /**
* @brief Specular texture ID * @brief Specular texture ID
* *
* Available only if the material has @ref Flag "Flag::SpecularTexture". * Available only if the material has @ref Flag::SpecularTexture.
* @see @ref flags(), @ref AbstractImporter::texture() * @see @ref flags(), @ref AbstractImporter::texture()
*/ */
UnsignedInt& specularTexture(); UnsignedInt& specularTexture();

2
src/Trade/TextureData.h

@ -93,7 +93,7 @@ class TextureData {
* @brief Image ID * @brief Image ID
* *
* ID of 1D, 2D or 3D image based on texture type. If type is * ID of 1D, 2D or 3D image based on texture type. If type is
* @ref Type "Type::Cube" the function returns first of six consecutive * @ref Type::Cube the function returns first of six consecutive
* IDs of cube map sides, ordered +X, -X, +Y, -Y, +Z, -Z. * IDs of cube map sides, ordered +X, -X, +Y, -Y, +Z, -Z.
* @see @ref type(), @ref AbstractImporter::image1D(), * @see @ref type(), @ref AbstractImporter::image1D(),
* @ref AbstractImporter::image2D(), @ref AbstractImporter::image3D() * @ref AbstractImporter::image2D(), @ref AbstractImporter::image3D()

Loading…
Cancel
Save