Browse Source

Various documentation fixes and updates.

{} in Matrix constructor caused Doxygen to forget all functions after
it.
pull/51/head
Vladimír Vondruš 13 years ago
parent
commit
46e2ca80cd
  1. 16
      src/AbstractFramebuffer.h
  2. 26
      src/AbstractShaderProgram.h
  3. 18
      src/Color.h
  4. 12
      src/DefaultFramebuffer.h
  5. 18
      src/Framebuffer.h
  6. 6
      src/Math/Matrix3.h
  7. 6
      src/Math/Matrix4.h
  8. 6
      src/Math/RectangularMatrix.h
  9. 2
      src/Math/Swizzle.h
  10. 2
      src/Test/AbstractShaderProgramGLTest.cpp
  11. 6
      src/Test/MeshGLTest.cpp
  12. 2
      src/Test/SampleQueryGLTest.cpp

16
src/AbstractFramebuffer.h

@ -25,7 +25,7 @@
*/ */
/** @file /** @file
* @brief Class @ref Magnum::AbstractFramebuffer, enum @ref Magnum::FramebufferClear, @ref Magnum::FramebufferBlit, @ref Magnum::FramebufferBlitFilter, @ref Magnum::FramebufferTarget, enum set @ref FramebufferClearMask * @brief Class @ref Magnum::AbstractFramebuffer, enum @ref Magnum::FramebufferClear, @ref Magnum::FramebufferBlit, @ref Magnum::FramebufferBlitFilter, @ref Magnum::FramebufferTarget, enum set @ref Magnum::FramebufferClearMask
*/ */
#include <Containers/EnumSet.h> #include <Containers/EnumSet.h>
@ -39,7 +39,7 @@ namespace Magnum {
/** /**
@brief Mask for framebuffer clearing @brief Mask for framebuffer clearing
@see AbstractFramebuffer, FramebufferClearMask @see @ref AbstractFramebuffer, @ref FramebufferClearMask
*/ */
enum class FramebufferClear: GLbitfield { enum class FramebufferClear: GLbitfield {
Color = GL_COLOR_BUFFER_BIT, /**< Color */ Color = GL_COLOR_BUFFER_BIT, /**< Color */
@ -50,7 +50,7 @@ enum class FramebufferClear: GLbitfield {
/** /**
@brief Mask for clearing @brief Mask for clearing
@see AbstractFramebuffer::clear() @see @ref AbstractFramebuffer::clear()
*/ */
typedef Containers::EnumSet<FramebufferClear, GLbitfield, typedef Containers::EnumSet<FramebufferClear, GLbitfield,
GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT> FramebufferClearMask; GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT> FramebufferClearMask;
@ -58,7 +58,7 @@ typedef Containers::EnumSet<FramebufferClear, GLbitfield,
/** /**
@brief Mask for framebuffer blitting @brief Mask for framebuffer blitting
@see AbstractFramebuffer, FramebufferBlitMask @see @ref AbstractFramebuffer, @ref FramebufferBlitMask
@requires_gl30 %Extension @extension{ARB,framebuffer_object} @requires_gl30 %Extension @extension{ARB,framebuffer_object}
@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}
@ -72,7 +72,7 @@ enum class FramebufferBlit: GLbitfield {
/** /**
@brief Mask for framebuffer blitting @brief Mask for framebuffer blitting
@see AbstractFramebuffer::blit() @see @ref AbstractFramebuffer::blit()
@requires_gl30 %Extension @extension{ARB,framebuffer_object} @requires_gl30 %Extension @extension{ARB,framebuffer_object}
@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}
@ -83,7 +83,7 @@ typedef Containers::EnumSet<FramebufferBlit, GLbitfield,
/** /**
@brief %Framebuffer blit filtering @brief %Framebuffer blit filtering
@see AbstractFramebuffer::blit() @see @ref AbstractFramebuffer::blit()
@requires_gl30 %Extension @extension{ARB,framebuffer_object} @requires_gl30 %Extension @extension{ARB,framebuffer_object}
@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}
@ -96,7 +96,7 @@ enum class FramebufferBlitFilter: GLenum {
/** /**
@brief Target for binding framebuffer @brief Target for binding framebuffer
@see DefaultFramebuffer::bind(), Framebuffer::bind() @see @ref DefaultFramebuffer::bind(), @ref Framebuffer::bind()
@requires_gl30 %Extension @extension{ARB,framebuffer_object} @requires_gl30 %Extension @extension{ARB,framebuffer_object}
*/ */
enum class FramebufferTarget: GLenum { enum class FramebufferTarget: GLenum {
@ -290,7 +290,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @param image %Buffer image where to put the data * @param image %Buffer image where to put the data
* @param usage %Buffer usage * @param usage %Buffer usage
* *
* See @ref read(const Vector2i&, const Vector2i&, Image2D*) for more * See @ref read(const Vector2i&, const Vector2i&, Image2D&) for more
* information. * information.
* @requires_gles30 Pixel buffer objects are not available in OpenGL ES 2.0. * @requires_gles30 Pixel buffer objects are not available in OpenGL ES 2.0.
*/ */

26
src/AbstractShaderProgram.h

@ -161,14 +161,17 @@ bindFragmentDataLocationIndexed(NormalOutput, 1, "normal");
@see @ref Mesh::maxVertexAttributes(), @ref AbstractFramebuffer::maxDrawBuffers() @see @ref Mesh::maxVertexAttributes(), @ref AbstractFramebuffer::maxDrawBuffers()
@requires_gl30 %Extension @extension{EXT,gpu_shader4} for using @requires_gl30 %Extension @extension{EXT,gpu_shader4} for using
@ref bindFragmentDataLocation(). @ref Magnum::AbstractShaderProgram::bindFragmentDataLocation() "bindFragmentDataLocation()".
@requires_gl33 %Extension @extension{ARB,blend_func_extended} for using @requires_gl33 %Extension @extension{ARB,blend_func_extended} for using
@ref bindFragmentDataLocationIndexed(). @ref Magnum::AbstractShaderProgram::bindFragmentDataLocationIndexed() "bindFragmentDataLocationIndexed()".
@requires_gl33 %Extension @extension{ARB,explicit_attrib_location} for @requires_gl33 %Extension @extension{ARB,explicit_attrib_location} for
explicit attribute location instead of using @ref bindAttributeLocation(), explicit attribute location instead of using
@ref bindFragmentDataLocation() or @ref bindFragmentDataLocationIndexed(). @ref Magnum::AbstractShaderProgram::bindAttributeLocation() "bindAttributeLocation()",
@ref Magnum::AbstractShaderProgram::bindFragmentDataLocation() "bindFragmentDataLocation()"
or @ref Magnum::AbstractShaderProgram::bindFragmentDataLocationIndexed() "bindFragmentDataLocationIndexed()".
@requires_gles30 Explicit location specification of input attributes is not @requires_gles30 Explicit location specification of input attributes is not
supported in OpenGL ES 2.0, use @ref bindAttributeLocation() instead. supported in OpenGL ES 2.0, use @ref Magnum::AbstractShaderProgram::bindAttributeLocation() "bindAttributeLocation()"
instead.
@requires_gles30 Multiple fragment shader outputs are not available in OpenGL @requires_gles30 Multiple fragment shader outputs are not available in OpenGL
ES 2.0, similar functionality is available in extension ES 2.0, similar functionality is available in extension
@es_extension{NV,draw_buffers}. @es_extension{NV,draw_buffers}.
@ -199,9 +202,11 @@ Int projectionUniform = uniformLocation("projection");
@see @ref maxUniformLocations() @see @ref maxUniformLocations()
@requires_gl43 %Extension @extension{ARB,explicit_uniform_location} for @requires_gl43 %Extension @extension{ARB,explicit_uniform_location} for
explicit uniform location instead of using @ref uniformLocation(). explicit uniform location instead of using
@ref Magnum::AbstractShaderProgram::uniformLocation() "uniformLocation()".
@requires_gl Explicit uniform location is not supported in OpenGL ES. Use @requires_gl Explicit uniform location is not supported in OpenGL ES. Use
@ref uniformLocation() instead. @ref Magnum::AbstractShaderProgram::uniformLocation() "uniformLocation()"
instead.
@subsection AbstractShaderProgram-texture-layer Binding texture layer uniforms @subsection AbstractShaderProgram-texture-layer Binding texture layer uniforms
@ -216,7 +221,7 @@ layout(binding = 1) uniform sampler2D specularTexture;
If you don't have the required extension (or if you want to change the layer If you don't have the required extension (or if you want to change the layer
later), declare the uniforms without the `layout()` qualifier and set the later), declare the uniforms without the `layout()` qualifier and set the
texture layer uniform using @ref Magnum::AbstractShaderProgram::setUniform(Int, const T&) "setUniform(Int, Int)". texture layer uniform using @ref setUniform(Int, const T&) "setUniform(Int, Int)".
Note that additional syntax changes may be needed for GLSL 1.20 and GLSL ES Note that additional syntax changes may be needed for GLSL 1.20 and GLSL ES
1.0. 1.0.
@code @code
@ -1155,7 +1160,7 @@ Template parameter @p T is the type which is used for shader attribute, e.g.
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::Int for @ref Vector4i). It's also possible to pass integer data @ref DataType::Int for @ref Vector4i). It's also possible to pass integer data
to floating-point shader inputs. In this case you may want to normalize the to floating-point shader inputs. In this case you may want to normalize the
values (e.g. color components from 0-255 to 0.0f - 1.0f) -- see @ref DataOption::Normalize. values (e.g. color components from 0-255 to 0.0f - 1.0f) -- see @ref DataOption::Normalized.
Only some types are allowed as attribute types, see @ref AbstractShaderProgram-types Only some types are allowed as attribute types, see @ref AbstractShaderProgram-types
for more information. for more information.
@ -1324,8 +1329,7 @@ template<UnsignedInt location, class T> class AbstractShaderProgram::Attribute {
* @brief Constructor * @brief Constructor
* @param components Component count * @param components Component count
* @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. @ref DataType::Integer for * type used in shader (e.g. @ref DataType::Int for @ref Vector4i).
* @ref Vector4i).
* @param dataOptions Data options. Default is no options. * @param dataOptions Data options. Default is no options.
*/ */
constexpr Attribute(Components components, DataType dataType = Implementation::Attribute<T>::DefaultDataType, DataOptions dataOptions = DataOptions()): _components(components), _dataType(dataType), _dataOptions(dataOptions) {} constexpr Attribute(Components components, DataType dataType = Implementation::Attribute<T>::DefaultDataType, DataOptions dataOptions = DataOptions()): _components(components), _dataType(dataType), _dataOptions(dataOptions) {}

18
src/Color.h

@ -25,7 +25,7 @@
*/ */
/** @file /** @file
* @brief Class Magnum::BasicColor3, Magnum::BasicColor4, typedef Magnum::Color3, Magnum::Color4 * @brief Class @ref Magnum::BasicColor3, @ref Magnum::BasicColor4, typedef @ref Magnum::Color3, @ref Magnum::Color4
*/ */
#include <tuple> #include <tuple>
@ -290,7 +290,7 @@ template<class T> class BasicColor3: public Math::Vector3<T> {
* std::tie(hue, saturation, value) = color.toHSV(); * std::tie(hue, saturation, value) = color.toHSV();
* @endcode * @endcode
* *
* @see hue(), saturation(), value(), fromHSV() * @see @ref hue(), @ref saturation(), @ref value(), @ref fromHSV()
*/ */
constexpr HSV toHSV() const { constexpr HSV toHSV() const {
return Implementation::toHSV<T>(*this); return Implementation::toHSV<T>(*this);
@ -300,7 +300,7 @@ template<class T> class BasicColor3: public Math::Vector3<T> {
* @brief Hue * @brief Hue
* @return Hue in range @f$ [0.0, 360.0] @f$. * @return Hue in range @f$ [0.0, 360.0] @f$.
* *
* @see saturation(), value(), toHSV(), fromHSV() * @see @ref saturation(), @ref value(), @ref toHSV(), @ref fromHSV()
*/ */
constexpr Math::Deg<FloatingPointType> hue() const { constexpr Math::Deg<FloatingPointType> hue() const {
return Math::Deg<FloatingPointType>(Implementation::hue<T>(*this)); return Math::Deg<FloatingPointType>(Implementation::hue<T>(*this));
@ -310,7 +310,7 @@ template<class T> class BasicColor3: public Math::Vector3<T> {
* @brief Saturation * @brief Saturation
* @return Saturation in range @f$ [0.0, 1.0] @f$. * @return Saturation in range @f$ [0.0, 1.0] @f$.
* *
* @see hue(), value(), toHSV(), fromHSV() * @see @ref hue(), @ref value(), @ref toHSV(), @ref fromHSV()
*/ */
constexpr FloatingPointType saturation() const { constexpr FloatingPointType saturation() const {
return Implementation::saturation<T>(*this); return Implementation::saturation<T>(*this);
@ -320,7 +320,7 @@ template<class T> class BasicColor3: public Math::Vector3<T> {
* @brief Value * @brief Value
* @return Value in range @f$ [0.0, 1.0] @f$. * @return Value in range @f$ [0.0, 1.0] @f$.
* *
* @see hue(), saturation(), toHSV(), fromHSV() * @see @ref hue(), @ref saturation(), @ref toHSV(), @ref fromHSV()
*/ */
constexpr FloatingPointType value() const { constexpr FloatingPointType value() const {
return Implementation::value<T>(*this); return Implementation::value<T>(*this);
@ -420,7 +420,7 @@ class BasicColor4: public Math::Vector4<T> {
/** /**
* @copydoc BasicColor3::fromHSV() * @copydoc BasicColor3::fromHSV()
* @param a Alpha value, defaults to 1.0 for floating-point types * @param a Alpha value, defaults to `1.0` for floating-point types
* and maximum positive value for integral types. * and maximum positive value for integral types.
*/ */
constexpr static BasicColor4<T> fromHSV(HSV hsv, T a = Implementation::fullChannel<T>()) { constexpr static BasicColor4<T> fromHSV(HSV hsv, T a = Implementation::fullChannel<T>()) {
@ -434,14 +434,14 @@ class BasicColor4: public Math::Vector4<T> {
/** /**
* @brief Default constructor * @brief Default constructor
* *
* RGB components are set to zero, A component is set to 1.0 for * RGB components are set to zero, A component is set to `1.0` for
* floating-point types and maximum positive value for integral types. * floating-point types and maximum positive value for integral types.
*/ */
constexpr /*implicit*/ BasicColor4(): Math::Vector4<T>(T(0), T(0), T(0), Implementation::fullChannel<T>()) {} constexpr /*implicit*/ BasicColor4(): Math::Vector4<T>(T(0), T(0), T(0), Implementation::fullChannel<T>()) {}
/** /**
* @copydoc BasicColor3::BasicColor3(T) * @copydoc BasicColor3::BasicColor3(T)
* @param alpha Alpha value, defaults to 1.0 for floating-point types * @param alpha Alpha value, defaults to `1.0` for floating-point types
* and maximum positive value for integral types. * and maximum positive value for integral types.
*/ */
constexpr explicit BasicColor4(T rgb, T alpha = Implementation::fullChannel<T>()): Math::Vector4<T>(rgb, rgb, rgb, alpha) {} constexpr explicit BasicColor4(T rgb, T alpha = Implementation::fullChannel<T>()): Math::Vector4<T>(rgb, rgb, rgb, alpha) {}
@ -451,7 +451,7 @@ class BasicColor4: public Math::Vector4<T> {
* @param r R value * @param r R value
* @param g G value * @param g G value
* @param b B value * @param b B value
* @param a A value, defaults to 1.0 for floating-point types and * @param a A value, defaults to `1.0` for floating-point types and
* maximum positive value for integral types. * maximum positive value for integral types.
*/ */
constexpr /*implicit*/ BasicColor4(T r, T g, T b, T a = Implementation::fullChannel<T>()): Math::Vector4<T>(r, g, b, a) {} constexpr /*implicit*/ BasicColor4(T r, T g, T b, T a = Implementation::fullChannel<T>()): Math::Vector4<T>(r, g, b, a) {}

12
src/DefaultFramebuffer.h

@ -393,9 +393,11 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* @see @fn_gl{InvalidateFramebuffer} or @fn_gles_extension{DiscardFramebuffer,EXT,discard_framebuffer} * @see @fn_gl{InvalidateFramebuffer} or @fn_gles_extension{DiscardFramebuffer,EXT,discard_framebuffer}
* on OpenGL ES 2.0 * on OpenGL ES 2.0
* @requires_gl43 %Extension @extension{ARB,invalidate_subdata}. Use * @requires_gl43 %Extension @extension{ARB,invalidate_subdata}. Use
* @ref clear() instead where the extension is not supported. * @ref Magnum::DefaultFramebuffer::clear() "clear()" instead
* where the extension is not supported.
* @requires_gles30 %Extension @es_extension{EXT,discard_framebuffer}. * @requires_gles30 %Extension @es_extension{EXT,discard_framebuffer}.
* Use @ref clear() instead where the extension is not supported. * Use @ref Magnum::DefaultFramebuffer::clear() "clear()" instead
* where the extension is not supported.
*/ */
void invalidate(std::initializer_list<InvalidationAttachment> attachments); void invalidate(std::initializer_list<InvalidationAttachment> attachments);
@ -409,9 +411,11 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer {
* @see @fn_gl{InvalidateSubFramebuffer} or @fn_gles_extension{DiscardSubFramebuffer,EXT,discard_framebuffer} * @see @fn_gl{InvalidateSubFramebuffer} or @fn_gles_extension{DiscardSubFramebuffer,EXT,discard_framebuffer}
* on OpenGL ES 2.0 * on OpenGL ES 2.0
* @requires_gl43 %Extension @extension{ARB,invalidate_subdata}. Use * @requires_gl43 %Extension @extension{ARB,invalidate_subdata}. Use
* @ref clear() instead where the extension is not supported. * @ref Magnum::DefaultFramebuffer::clear() "clear()" instead
* where the extension is not supported.
* @requires_gles30 %Extension @es_extension{EXT,discard_framebuffer}. * @requires_gles30 %Extension @es_extension{EXT,discard_framebuffer}.
* Use @ref clear() instead where the extension is not supported. * Use @ref Magnum::DefaultFramebuffer::clear() "clear()" instead
* where the extension is not supported.
*/ */
void invalidate(std::initializer_list<InvalidationAttachment> attachments, const Range2Di& rectangle); void invalidate(std::initializer_list<InvalidationAttachment> attachments, const Range2Di& rectangle);

18
src/Framebuffer.h

@ -107,7 +107,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
/** /**
* @brief Color attachment * @brief Color attachment
* *
* @see @ref Attachment, @ref attachRenderbuffer(), * @see @ref BufferAttachment, @ref attachRenderbuffer(),
* @ref attachTexture1D(), @ref attachTexture2D(), * @ref attachTexture1D(), @ref attachTexture2D(),
* @ref attachCubeMapTexture(), @ref attachTexture3D() * @ref attachCubeMapTexture(), @ref attachTexture3D()
*/ */
@ -176,7 +176,9 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* *
* @requires_gles30 Combined depth and stencil attachment is * @requires_gles30 Combined depth and stencil attachment is
* not available in OpenGL ES 2.0. Attach the same object * not available in OpenGL ES 2.0. Attach the same object
* to both @ref Depth and @ref Stencil instead. * to both @ref Magnum::Framebuffer::BufferAttachment::Depth
* "BufferAttachment::Depth" and @ref Magnum::Framebuffer::BufferAttachment::Stencil
* "BufferAttachment::Stencil" instead.
* @todo Support this in ES2 (bind to both depth and stencil internally) * @todo Support this in ES2 (bind to both depth and stencil internally)
*/ */
static const BufferAttachment DepthStencil; static const BufferAttachment DepthStencil;
@ -438,9 +440,11 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @see @fn_gl{InvalidateFramebuffer} or @fn_gles_extension{DiscardFramebuffer,EXT,discard_framebuffer} * @see @fn_gl{InvalidateFramebuffer} or @fn_gles_extension{DiscardFramebuffer,EXT,discard_framebuffer}
* on OpenGL ES 2.0 * on OpenGL ES 2.0
* @requires_gl43 %Extension @extension{ARB,invalidate_subdata}. Use * @requires_gl43 %Extension @extension{ARB,invalidate_subdata}. Use
* @ref clear() instead where the extension is not supported. * @ref Magnum::Framebuffer::clear() "clear()" instead where the
* extension is not supported.
* @requires_gles30 %Extension @es_extension{EXT,discard_framebuffer}. * @requires_gles30 %Extension @es_extension{EXT,discard_framebuffer}.
* Use @ref clear() instead where the extension is not supported. * Use @ref Magnum::Framebuffer::clear() "clear()" instead where
* the extension is not supported.
*/ */
void invalidate(std::initializer_list<InvalidationAttachment> attachments); void invalidate(std::initializer_list<InvalidationAttachment> attachments);
@ -454,9 +458,11 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje
* @see @fn_gl{InvalidateSubFramebuffer} or @fn_gles_extension{DiscardSubFramebuffer,EXT,discard_framebuffer} * @see @fn_gl{InvalidateSubFramebuffer} or @fn_gles_extension{DiscardSubFramebuffer,EXT,discard_framebuffer}
* on OpenGL ES 2.0 * on OpenGL ES 2.0
* @requires_gl43 %Extension @extension{ARB,invalidate_subdata}. Use * @requires_gl43 %Extension @extension{ARB,invalidate_subdata}. Use
* @ref clear() instead where the extension is not supported. * @ref Magnum::Framebuffer::clear() "clear()" instead where the
* extension is not supported.
* @requires_gles30 %Extension @es_extension{EXT,discard_framebuffer}. * @requires_gles30 %Extension @es_extension{EXT,discard_framebuffer}.
* Use @ref clear() instead where the extension is not supported. * Use @ref Magnum::Framebuffer::clear() "clear()" instead where
* the extension is not supported.
*/ */
void invalidate(std::initializer_list<InvalidationAttachment> attachments, const Range2Di& rectangle); void invalidate(std::initializer_list<InvalidationAttachment> attachments, const Range2Di& rectangle);

6
src/Math/Matrix3.h

@ -129,7 +129,7 @@ template<class T> class Matrix3: public Matrix<3, T> {
* constructor with `Matrix3 m(Matrix3::Identity);`. Optional parameter * constructor with `Matrix3 m(Matrix3::Identity);`. Optional parameter
* @p value allows you to specify value on diagonal. * @p value allows you to specify value on diagonal.
*/ */
constexpr /*implicit*/ Matrix3(typename Matrix<3, T>::IdentityType identity = (Matrix<3, T>::Identity), T value = T(1)): Matrix<3, T>(identity, value) {} constexpr /*implicit*/ Matrix3(typename Matrix<3, T>::IdentityType = (Matrix<3, T>::Identity), T value = T(1)): Matrix<3, T>(Matrix<3, T>::Identity, value) {}
/** @brief %Matrix from column vectors */ /** @brief %Matrix from column vectors */
constexpr /*implicit*/ Matrix3(const Vector3<T>& first, const Vector3<T>& second, const Vector3<T>& third): Matrix<3, T>(first, second, third) {} constexpr /*implicit*/ Matrix3(const Vector3<T>& first, const Vector3<T>& second, const Vector3<T>& third): Matrix<3, T>(first, second, third) {}
@ -206,7 +206,7 @@ template<class T> class Matrix3: public Matrix<3, T> {
* to @ref uniformScaling(), because it doesn't compute the square * to @ref uniformScaling(), because it doesn't compute the square
* root. * root.
* @see @ref rotationScaling(), @ref rotation(), * @see @ref rotationScaling(), @ref rotation(),
* @ref rotationNormalized(), @ref scaling(const Vector2&), * @ref rotationNormalized(), @ref scaling(const Vector2<T>&),
* @ref Matrix4::uniformScaling() * @ref Matrix4::uniformScaling()
*/ */
T uniformScalingSquared() const { T uniformScalingSquared() const {
@ -223,7 +223,7 @@ template<class T> class Matrix3: public Matrix<3, T> {
* the scaling is the same in all axes. Use faster alternative * the scaling is the same in all axes. Use faster alternative
* @ref uniformScalingSquared() where possible. * @ref uniformScalingSquared() where possible.
* @see @ref rotationScaling(), @ref rotation(), * @see @ref rotationScaling(), @ref rotation(),
* @ref rotationNormalized(), @ref scaling(const Vector2&), * @ref rotationNormalized(), @ref scaling(const Vector2<T>&),
* @ref Matrix4::uniformScaling() * @ref Matrix4::uniformScaling()
*/ */
T uniformScaling() const { return std::sqrt(uniformScalingSquared()); } T uniformScaling() const { return std::sqrt(uniformScalingSquared()); }

6
src/Math/Matrix4.h

@ -191,7 +191,7 @@ template<class T> class Matrix4: public Matrix<4, T> {
* constructor with `Matrix4 m(Matrix4::Identity);`. Optional parameter * constructor with `Matrix4 m(Matrix4::Identity);`. Optional parameter
* @p value allows you to specify value on diagonal. * @p value allows you to specify value on diagonal.
*/ */
constexpr /*implicit*/ Matrix4(typename Matrix<4, T>::IdentityType = (Matrix<4, T>::Identity), T value = T(1)): Matrix<4, T>({}, value) {} constexpr /*implicit*/ Matrix4(typename Matrix<4, T>::IdentityType = (Matrix<4, T>::Identity), T value = T(1)): Matrix<4, T>(Matrix<4, T>::Identity, value) {}
/** @brief %Matrix from column vectors */ /** @brief %Matrix from column vectors */
constexpr /*implicit*/ Matrix4(const Vector4<T>& first, const Vector4<T>& second, const Vector4<T>& third, const Vector4<T>& fourth): Matrix<4, T>(first, second, third, fourth) {} constexpr /*implicit*/ Matrix4(const Vector4<T>& first, const Vector4<T>& second, const Vector4<T>& third, const Vector4<T>& fourth): Matrix<4, T>(first, second, third, fourth) {}
@ -269,7 +269,7 @@ template<class T> class Matrix4: public Matrix<4, T> {
* to @ref uniformScaling(), because it doesn't compute the square * to @ref uniformScaling(), because it doesn't compute the square
* root. * root.
* @see @ref rotationScaling(), @ref rotation(), * @see @ref rotationScaling(), @ref rotation(),
* @ref rotationNormalized(), @ref scaling(const Vector3&), * @ref rotationNormalized(), @ref scaling(const Vector3<T>&),
* @ref Matrix3::uniformScaling() * @ref Matrix3::uniformScaling()
*/ */
T uniformScalingSquared() const; T uniformScalingSquared() const;
@ -281,7 +281,7 @@ template<class T> class Matrix4: public Matrix<4, T> {
* the scaling is the same in all axes. Use faster alternative * the scaling is the same in all axes. Use faster alternative
* @ref uniformScalingSquared() where possible. * @ref uniformScalingSquared() where possible.
* @see @ref rotationScaling(), @ref rotation(), * @see @ref rotationScaling(), @ref rotation(),
* @ref rotationNormalized(), @ref scaling(const Vector3&), * @ref rotationNormalized(), @ref scaling(const Vector3<T>&),
* @ref Matrix3::uniformScaling() * @ref Matrix3::uniformScaling()
*/ */
T uniformScaling() const { return std::sqrt(uniformScalingSquared()); } T uniformScaling() const { return std::sqrt(uniformScalingSquared()); }

6
src/Math/RectangularMatrix.h

@ -359,7 +359,11 @@ template<std::size_t cols, std::size_t rows, class T> class RectangularMatrix {
return *reinterpret_cast<const Vector<rows*cols, T>*>(data()); return *reinterpret_cast<const Vector<rows*cols, T>*>(data());
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
protected: protected:
#else
private:
#endif
/* Implementation for RectangularMatrix<cols, rows, T>::fromDiagonal() and Matrix<size, T>(T) */ /* Implementation for RectangularMatrix<cols, rows, T>::fromDiagonal() and Matrix<size, T>(T) */
template<std::size_t ...sequence> constexpr explicit RectangularMatrix(Implementation::Sequence<sequence...>, const Vector<DiagonalSize, T>& diagonal); template<std::size_t ...sequence> constexpr explicit RectangularMatrix(Implementation::Sequence<sequence...>, const Vector<DiagonalSize, T>& diagonal);
@ -654,9 +658,11 @@ template<std::size_t cols, std::size_t rows, class T> inline RectangularMatrix<r
template<std::size_t cols, std::size_t rows, class T> inline constexpr auto RectangularMatrix<cols, rows, T>::diagonal() const -> Vector<DiagonalSize, T> { return diagonalInternal(typename Implementation::GenerateSequence<DiagonalSize>::Type()); } template<std::size_t cols, std::size_t rows, class T> inline constexpr auto RectangularMatrix<cols, rows, T>::diagonal() const -> Vector<DiagonalSize, T> { return diagonalInternal(typename Implementation::GenerateSequence<DiagonalSize>::Type()); }
#ifndef DOXYGEN_GENERATING_OUTPUT
template<std::size_t cols, std::size_t rows, class T> template<std::size_t ...sequence> inline constexpr auto RectangularMatrix<cols, rows, T>::diagonalInternal(Implementation::Sequence<sequence...>) const -> Vector<DiagonalSize, T> { template<std::size_t cols, std::size_t rows, class T> template<std::size_t ...sequence> inline constexpr auto RectangularMatrix<cols, rows, T>::diagonalInternal(Implementation::Sequence<sequence...>) const -> Vector<DiagonalSize, T> {
return {(*this)[sequence][sequence]...}; return {(*this)[sequence][sequence]...};
} }
#endif
}} }}

2
src/Math/Swizzle.h

@ -77,7 +77,7 @@ four-component, corresponding @ref Math::Vector2, @ref Math::Vector3,
@ref Math::Vector4, @ref Color3 or @ref Color4 specialization is returned. @ref Math::Vector4, @ref Color3 or @ref Color4 specialization is returned.
@see @ref matrix-vector-component-access, @ref Vector4::xyz(), @see @ref matrix-vector-component-access, @ref Vector4::xyz(),
@ref Vector4::xy(), @ref Vector3::xy(), @ref Color4::rgb() @ref Vector4::xy(), @ref Vector3::xy(), @ref BasicColor4::rgb()
*/ */
template<char ...components, class T> constexpr typename Implementation::TypeForSize<sizeof...(components), T>::Type swizzle(const T& vector) { template<char ...components, class T> constexpr typename Implementation::TypeForSize<sizeof...(components), T>::Type swizzle(const T& vector) {
return {Implementation::Component<T::Size, components>::value(vector)...}; return {Implementation::Component<T::Size, components>::value(vector)...};

2
src/Test/AbstractShaderProgramGLTest.cpp

@ -297,6 +297,7 @@ namespace {
}; };
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
MyShader::MyShader() { MyShader::MyShader() {
Utility::Resource rs("AbstractShaderProgramGLTest"); Utility::Resource rs("AbstractShaderProgramGLTest");
@ -326,6 +327,7 @@ MyShader::MyShader() {
colorUniform = uniformLocation("color"); colorUniform = uniformLocation("color");
additionsUniform = uniformLocation("additions"); additionsUniform = uniformLocation("additions");
} }
#endif
void AbstractShaderProgramGLTest::uniform() { void AbstractShaderProgramGLTest::uniform() {
MyShader shader; MyShader shader;

6
src/Test/MeshGLTest.cpp

@ -277,6 +277,7 @@ namespace {
}; };
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
FloatShader::FloatShader(const std::string& type, const std::string& conversion) { FloatShader::FloatShader(const std::string& type, const std::string& conversion) {
/* We need special version for ES3, because GLSL in ES2 doesn't support /* We need special version for ES3, because GLSL in ES2 doesn't support
rectangle matrices */ rectangle matrices */
@ -403,6 +404,7 @@ template<class T> T Checker::get(ColorFormat format, ColorType type) {
framebuffer.read({}, Vector2i(1), image); framebuffer.read({}, Vector2i(1), image);
return image.data<T>()[0]; return image.data<T>()[0];
} }
#endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
void MeshGLTest::addVertexBufferUnsignedInt() { void MeshGLTest::addVertexBufferUnsignedInt() {
@ -982,6 +984,7 @@ namespace {
}; };
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
MultipleShader::MultipleShader() { MultipleShader::MultipleShader() {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Shader vert(Version::GL210, Shader::Type::Vertex); Shader vert(Version::GL210, Shader::Type::Vertex);
@ -1017,6 +1020,7 @@ MultipleShader::MultipleShader() {
CORRADE_INTERNAL_ASSERT_OUTPUT(link()); CORRADE_INTERNAL_ASSERT_OUTPUT(link());
} }
#endif
void MeshGLTest::addVertexBufferMultiple() { void MeshGLTest::addVertexBufferMultiple() {
const Float data[] = { const Float data[] = {
@ -1132,6 +1136,7 @@ namespace {
constexpr Color4ub indexedResult(64 + 15 + 97, 17 + 164 + 28, 56 + 17, 255); constexpr Color4ub indexedResult(64 + 15 + 97, 17 + 164 + 28, 56 + 17, 255);
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
IndexChecker::IndexChecker(Mesh& mesh): framebuffer({{}, Vector2i(1)}) { IndexChecker::IndexChecker(Mesh& mesh): framebuffer({{}, Vector2i(1)}) {
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
renderbuffer.setStorage(RenderbufferFormat::RGBA8, Vector2i(1)); renderbuffer.setStorage(RenderbufferFormat::RGBA8, Vector2i(1));
@ -1156,6 +1161,7 @@ Color4ub IndexChecker::get() {
framebuffer.read({}, Vector2i(1), image); framebuffer.read({}, Vector2i(1), image);
return image.data<Color4ub>()[0]; return image.data<Color4ub>()[0];
} }
#endif
void MeshGLTest::setIndexBuffer() { void MeshGLTest::setIndexBuffer() {
Buffer vertices; Buffer vertices;

2
src/Test/SampleQueryGLTest.cpp

@ -64,6 +64,7 @@ namespace {
}; };
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
MyShader::MyShader() { MyShader::MyShader() {
Utility::Resource rs("QueryGLTest"); Utility::Resource rs("QueryGLTest");
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -86,6 +87,7 @@ MyShader::MyShader() {
CORRADE_INTERNAL_ASSERT_OUTPUT(link()); CORRADE_INTERNAL_ASSERT_OUTPUT(link());
} }
#endif
void SampleQueryGLTest::querySamplesPassed() { void SampleQueryGLTest::querySamplesPassed() {
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2

Loading…
Cancel
Save