diff --git a/src/Magnum/BufferTexture.cpp b/src/Magnum/BufferTexture.cpp index 4fbc8af09..1c91f129e 100644 --- a/src/Magnum/BufferTexture.cpp +++ b/src/Magnum/BufferTexture.cpp @@ -48,12 +48,14 @@ Int BufferTexture::offsetAlignment() { return value; } -void BufferTexture::setBuffer(const BufferTextureFormat internalFormat, Buffer& buffer) { +BufferTexture& BufferTexture::setBuffer(const BufferTextureFormat internalFormat, Buffer& buffer) { (this->*Context::current()->state().texture->setBufferImplementation)(internalFormat, buffer); + return *this; } -void BufferTexture::setBuffer(const BufferTextureFormat internalFormat, Buffer& buffer, const GLintptr offset, const GLsizeiptr size) { +BufferTexture& BufferTexture::setBuffer(const BufferTextureFormat internalFormat, Buffer& buffer, const GLintptr offset, const GLsizeiptr size) { (this->*Context::current()->state().texture->setBufferRangeImplementation)(internalFormat, buffer, offset, size); + return *this; } void BufferTexture::setBufferImplementationDefault(BufferTextureFormat internalFormat, Buffer& buffer) { diff --git a/src/Magnum/BufferTexture.h b/src/Magnum/BufferTexture.h index 46a5ae4be..d80dd0722 100644 --- a/src/Magnum/BufferTexture.h +++ b/src/Magnum/BufferTexture.h @@ -226,6 +226,7 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture { * @brief Set texture buffer * @param internalFormat Internal format * @param buffer %Buffer with data + * @return Reference to self (for method chaining) * * Binds given buffer to this texture. The buffer itself can be then * filled with data of proper format at any time using @ref Buffer "Buffer"'s @@ -233,7 +234,7 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture { * @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexBuffer} * or @fn_gl_extension{TextureBuffer,EXT,direct_state_access} */ - void setBuffer(BufferTextureFormat internalFormat, Buffer& buffer); + BufferTexture& setBuffer(BufferTextureFormat internalFormat, Buffer& buffer); /** * @brief Set texture buffer @@ -241,6 +242,7 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture { * @param buffer %Buffer * @param offset Offset * @param size Data size + * @return Reference to self (for method chaining) * * Binds range of given buffer to this texture. The buffer itself can * be then filled with data of proper format at any time using @ref Buffer "Buffer"'s @@ -249,7 +251,7 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture { * @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexBufferRange} * or @fn_gl_extension{TextureBufferRange,EXT,direct_state_access} */ - void setBuffer(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size); + BufferTexture& setBuffer(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size); /* Overloads to remove WTF-factor from method chaining order */ #ifndef DOXYGEN_GENERATING_OUTPUT