Browse Source

Trade: doc++

I spent some time wondering if as<PbrClearCoatMaterialData>() can be
used on a material that doesn't neccessarily have that layer. It can, so
hint that in the docs.
pull/601/head
Vladimír Vondruš 3 years ago
parent
commit
f0b4459ce3
  1. 14
      src/Magnum/Trade/MaterialData.h

14
src/Magnum/Trade/MaterialData.h

@ -1827,11 +1827,11 @@ best type for a particular use case.
Because retrieving everything through the @ref attribute() APIs can get verbose Because retrieving everything through the @ref attribute() APIs can get verbose
and complex, the @ref Trade library provides a set of accessor APIs for common and complex, the @ref Trade library provides a set of accessor APIs for common
material types such as @ref FlatMaterialData, @ref PhongMaterialData, material types such as @ref FlatMaterialData, @ref PhongMaterialData,
@ref PbrMetallicRoughnessMaterialData or @ref PbrSpecularGlossinessMaterialData. @ref PbrMetallicRoughnessMaterialData, @ref PbrSpecularGlossinessMaterialData
Using @ref as() you can convert any @ref MaterialData instance to a reference as well as material layers like @ref PbrClearCoatMaterialData. Using @ref as()
to one of those. These convenience APIs then take care of default values when you can convert any @ref MaterialData instance to a reference to one of those.
an attribute isn't present or handle fallbacks when an attribute can be defined These convenience APIs then take care of default values when an attribute isn't
in multiple ways: present or handle fallbacks when an attribute can be defined in multiple ways:
@snippet MagnumTrade.cpp MaterialData-usage-types @snippet MagnumTrade.cpp MaterialData-usage-types
@ -2178,8 +2178,8 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* *
* Returns a reference to @cpp *this @ce cast to given type. @p T is * Returns a reference to @cpp *this @ce cast to given type. @p T is
* expected to be a subclass of the same size such as * expected to be a subclass of the same size such as
* @ref PbrMetallicRoughnessMaterialData, * @ref PhongMaterialData or @ref PbrMetallicRoughnessMaterialData, as
* @ref PbrSpecularGlossinessMaterialData or @ref PhongMaterialData. * well as layers like @ref PbrClearCoatMaterialData.
*/ */
/* MSVC needs the & here, otherwise it complains that "cannot overload /* MSVC needs the & here, otherwise it complains that "cannot overload
a member function with ref-qualifier with a member function without a member function with ref-qualifier with a member function without

Loading…
Cancel
Save