Browse Source

Trade: document that MaterialAttributeData expect a non-empty name.

It's good to have that explicitly mentioned to not have to guess (or,
worse, browse the code).
pull/601/head
Vladimír Vondruš 3 years ago
parent
commit
6ab446f7ed
  1. 17
      src/Magnum/Trade/MaterialData.h

17
src/Magnum/Trade/MaterialData.h

@ -1395,8 +1395,9 @@ class MAGNUM_TRADE_EXPORT MaterialAttributeData {
* @param name Attribute name * @param name Attribute name
* @param value Attribute value * @param value Attribute value
* *
* The @p name together with @p value is expected to fit into 62 bytes. * The @p name is expected to be non-empty and together with @p value
* @ref MaterialAttributeType is inferred from the type passed. * is expected to fit into 62 bytes. @ref MaterialAttributeType is
* inferred from the type passed.
* *
* This function is useful in @cpp constexpr @ce contexts and for * This function is useful in @cpp constexpr @ce contexts and for
* creating custom material attributes. For known attributes prefer to * creating custom material attributes. For known attributes prefer to
@ -1415,8 +1416,9 @@ class MAGNUM_TRADE_EXPORT MaterialAttributeData {
* @param name Attribute name * @param name Attribute name
* @param value Attribute value * @param value Attribute value
* *
* The combined length of @p name and @p value is expected to fit into * The @p name is expected to be non-empty and the combined length of
* 60 bytes. Type is set to @ref MaterialAttributeType::String. * @p name and @p value is expected to fit into 60 bytes. Type is set
* to @ref MaterialAttributeType::String.
* *
* This function is useful in @cpp constexpr @ce contexts and for * This function is useful in @cpp constexpr @ce contexts and for
* creating custom material attributes. For known attributes prefer to * creating custom material attributes. For known attributes prefer to
@ -1431,8 +1433,9 @@ class MAGNUM_TRADE_EXPORT MaterialAttributeData {
* @param name Attribute name * @param name Attribute name
* @param value Attribute value * @param value Attribute value
* *
* The combined length of @p name and @p value is expected to fit into * The @p name is expected to be non-empty and the combined length of
* 61 bytes. Type is set to @ref MaterialAttributeType::Buffer. * @p name and @p value is expected to fit into 61 bytes. Type is set
* to @ref MaterialAttributeType::Buffer.
* *
* This function is useful for creating custom material attributes. * This function is useful for creating custom material attributes.
* Currently there isn't any builtin @ref MaterialAttribute with a * Currently there isn't any builtin @ref MaterialAttribute with a
@ -1488,6 +1491,8 @@ class MAGNUM_TRADE_EXPORT MaterialAttributeData {
* @param type Attribute type * @param type Attribute type
* @param value Type-erased value * @param value Type-erased value
* *
* The @p name is expected to be non-empty.
*
* In case @p type is neither @ref MaterialAttributeType::String nor * In case @p type is neither @ref MaterialAttributeType::String nor
* @ref MaterialAttributeType::Buffer, copies a number of bytes * @ref MaterialAttributeType::Buffer, copies a number of bytes
* according to @ref materialAttributeTypeSize() from @p value. The * according to @ref materialAttributeTypeSize() from @p value. The

Loading…
Cancel
Save