Browse Source

Allow method chaining also on BufferTexture.

There is only one configuring function now, but still, be consistent
with the rest.
pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
0e87886ac4
  1. 6
      src/Magnum/BufferTexture.cpp
  2. 6
      src/Magnum/BufferTexture.h

6
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) {

6
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

Loading…
Cancel
Save