Browse Source

ShaderTools,Text: update plugin interface docs accordingly to Trade.

Don't care about Audio, that thing will be gone eventually anyway.
pull/529/head
Vladimír Vondruš 5 years ago
parent
commit
6eb0a52228
  1. 47
      src/Magnum/ShaderTools/AbstractConverter.h
  2. 8
      src/Magnum/Text/AbstractFont.h
  3. 5
      src/Magnum/Text/AbstractFontConverter.h

47
src/Magnum/ShaderTools/AbstractConverter.h

@ -273,22 +273,53 @@ MAGNUM_SHADERTOOLS_EXPORT Debug& operator<<(Debug& debug, Format value);
@brief Base for shader converter plugins
@m_since_latest
@m_keywords{AbstractShaderConverter}
Provides functionality for validating and converting shader code between
different representations or performing optimizations and other operations on
them. See @ref plugins for more information and `*ShaderConverter` classes in
the @ref ShaderTools namespace for available scene converter plugins.
them.
The interface supports three main kinds of operation, with implementations
advertising support for a subset of them via @ref features():
- Shader validation using @ref validateFile() / @ref validateData(). Checking
for compile errors, against platform limits etc. Advertised with
@ref ConverterFeature::ValidateFile / @ref ConverterFeature::ValidateData.
- Shader conversion using @ref convertFileToFile() / @ref convertFileToData()
/ @ref convertDataToData(). Most commonly compilation of source code to an
immediate representation but also (dis)assembly, transpiling or
optimization. Advertised with @ref ConverterFeature::ConvertFile /
@ref ConverterFeature::ConvertData.
- Linking shaders together using @ref linkFilesToFile() / @ref linkFilesToData()
/ @ref linkDataToData(). For example combining code for multiple shader
stages into a single binary with deduplicated definitions of common inputs
and outputs. Advertised with @ref ConverterFeature::LinkFile /
@ref ConverterFeature::LinkData.
@section ShaderTools-AbstractConverter-usage Usage
Shader converters are most commonly implemented as plugins, which means the
concrete converter implementation is loaded and instantiated through a
@relativeref{Corrade,PluginManager::Manager}. See @ref plugins for more
information about general plugin usage, @ref file-formats to compare
implementations for common file formats and the list of
@m_class{m-doc} [derived classes](#derived-classes) for all available shader
converter plugins.
As each converter has different requirements on the source, its format and
options set, you're expected to perform error handling on the application side
--- if a conversion or linking fails, you get an empty
@relativeref{Corrade,Containers::Optional} /
@relativeref{Corrade,Containers::Array} or @cpp false @ce and a reason printed
to the error output. Everything else (using a feature not implemented in the
converter, ...) is treated as a programmer error and will produce the usual
assertions.
@m_class{m-note m-success}
@par
There's also a @ref magnum-shaderconverter "magnum-shaderconverter" tool, exposing functionality of all shader converter plugins on a command line.
@section ShaderTools-AbstractConverter-usage Usage
Shader converters are most commonly implemented as plugins. Depending on
exposed @ref features(), a plugin can support shader validation, conversion or
linking.
@m_class{m-block m-warning}
@par Multiple shader sources

8
src/Magnum/Text/AbstractFont.h

@ -111,10 +111,10 @@ needed glyphs can be done like this, completely with all error handling:
@snippet MagnumText.cpp AbstractFont-usage
See @ref plugins for more information about general plugin usage and `*Font`
classes in the @ref Text namespace for available font plugins. See
@ref GlyphCache for more information about glyph caches and @ref Renderer for
information about actual text rendering.
See @ref plugins for more information about general plugin usage and the list
of @m_class{m-doc} [derived classes](#derived-classes) for available font
plugins. See @ref GlyphCache for more information about glyph caches and
@ref Renderer for information about actual text rendering.
@subsection Text-AbstractFont-usage-callbacks Loading data from memory, using file callbacks

5
src/Magnum/Text/AbstractFontConverter.h

@ -119,8 +119,9 @@ MAGNUM_TEXT_EXPORT Debug& operator<<(Debug& debug, FontConverterFeatures value);
@brief Base for font converter plugins
Provides functionality for converting arbitrary font to different format. See
@ref plugins for more information and `*FontConverter` classes in @ref Text
namespace for available font converter plugins.
@ref plugins for more information and the list of
@m_class{m-doc} [derived classes](#derived-classes) for available font
converter plugins.
You can use the @ref magnum-fontconverter "magnum-fontconverter" utility to do
font conversion on command-line.

Loading…
Cancel
Save