Browse Source

GL: minor code reordering, doc++.

Getter and setter *should* be next to each other. I was horrified for 9
seconds that there's no setViewport().
pull/364/head
Vladimír Vondruš 7 years ago
parent
commit
c0a206d5f4
  1. 26
      src/Magnum/GL/AbstractFramebuffer.h
  2. 2
      src/Magnum/GL/Framebuffer.h

26
src/Magnum/GL/AbstractFramebuffer.h

@ -263,6 +263,19 @@ class MAGNUM_GL_EXPORT AbstractFramebuffer {
/** @brief Viewport rectangle */
Range2Di viewport() const { return _viewport; }
/**
* @brief Set viewport
* @return Reference to self (for method chaining)
*
* Saves the viewport to be used at later time in @ref bind(). If the
* framebuffer is currently bound, updates the viewport to given
* rectangle. Initial value in @ref DefaultFramebuffer is set to cover
* whole window, in @ref Framebuffer the initial value is specified in
* constructor.
* @see @ref maxViewportSize(), @fn_gl_keyword{Viewport}
*/
AbstractFramebuffer& setViewport(const Range2Di& rectangle);
/**
* @brief Implementation-specific color read format
*
@ -295,19 +308,6 @@ class MAGNUM_GL_EXPORT AbstractFramebuffer {
*/
PixelType implementationColorReadType();
/**
* @brief Set viewport
* @return Reference to self (for method chaining)
*
* Saves the viewport to be used at later time in @ref bind(). If the
* framebuffer is currently bound, updates the viewport to given
* rectangle. Initial value in @ref DefaultFramebuffer is set to cover
* whole window, in @ref Framebuffer the initial value is specified in
* constructor.
* @see @ref maxViewportSize(), @fn_gl_keyword{Viewport}
*/
AbstractFramebuffer& setViewport(const Range2Di& rectangle);
/**
* @brief Clear specified buffers in the framebuffer
* @param mask Which buffers to clear

2
src/Magnum/GL/Framebuffer.h

@ -502,7 +502,7 @@ class MAGNUM_GL_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractO
Framebuffer& mapForDraw(std::initializer_list<std::pair<UnsignedInt, DrawAttachment>> attachments);
/**
* @brief Map shader output to attachment
* @brief Map shader output to an attachment
* @param attachment Draw attachment
* @return Reference to self (for method chaining)
*

Loading…
Cancel
Save