diff --git a/src/Magnum/GL/Buffer.cpp b/src/Magnum/GL/Buffer.cpp index 6ef69744e..d916a6ed4 100644 --- a/src/Magnum/GL/Buffer.cpp +++ b/src/Magnum/GL/Buffer.cpp @@ -151,13 +151,11 @@ void Buffer::unbind(const Target target, const UnsignedInt firstIndex, const std Context::current().state().buffer.bindBasesImplementation(target, firstIndex, {nullptr, count}); } -/** @todoc const std::initializer_list makes Doxygen grumpy */ -void Buffer::bind(const Target target, const UnsignedInt firstIndex, std::initializer_list> buffers) { +void Buffer::bind(const Target target, const UnsignedInt firstIndex, Containers::ArrayView> buffers) { Context::current().state().buffer.bindRangesImplementation(target, firstIndex, {buffers.begin(), buffers.size()}); } -/** @todoc const std::initializer_list makes Doxygen grumpy */ -void Buffer::bind(const Target target, const UnsignedInt firstIndex, std::initializer_list buffers) { +void Buffer::bind(const Target target, const UnsignedInt firstIndex, Containers::ArrayView buffers) { Context::current().state().buffer.bindBasesImplementation(target, firstIndex, {buffers.begin(), buffers.size()}); } @@ -406,7 +404,6 @@ void Buffer::bindImplementationMulti(const Target target, const GLuint firstInde } #endif -/** @todoc const Containers::ArrayView makes Doxygen grumpy */ void Buffer::bindImplementationFallback(const Target target, const GLuint firstIndex, Containers::ArrayView> buffers) { for(std::size_t i = 0; i != buffers.size(); ++i) { if(buffers && std::get<0>(buffers[i])) @@ -416,7 +413,6 @@ void Buffer::bindImplementationFallback(const Target target, const GLuint firstI } #ifndef MAGNUM_TARGET_GLES -/** @todoc const Containers::ArrayView makes Doxygen grumpy */ void Buffer::bindImplementationMulti(const Target target, const GLuint firstIndex, Containers::ArrayView> buffers) { /** @todo use ArrayTuple */ Containers::Array ids{buffers ? buffers.size() : 0}; diff --git a/src/Magnum/GL/Buffer.h b/src/Magnum/GL/Buffer.h index 43c534537..3867178c5 100644 --- a/src/Magnum/GL/Buffer.h +++ b/src/Magnum/GL/Buffer.h @@ -766,7 +766,12 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { * WebGL 1.0, see particular @ref Target values for version * requirements. */ - static void bind(Target target, UnsignedInt firstIndex, std::initializer_list> buffers); + static void bind(Target target, UnsignedInt firstIndex, Containers::ArrayView> buffers); + + /** @overload */ + static void bind(Target target, UnsignedInt firstIndex, std::initializer_list> buffers) { + return bind(target, firstIndex, Containers::arrayView(buffers)); + } /** * @brief Bind buffers to given range of indexed targets @@ -796,7 +801,12 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { * WebGL 1.0, see particular @ref Target values for version * requirements. */ - static void bind(Target target, UnsignedInt firstIndex, std::initializer_list buffers); + static void bind(Target target, UnsignedInt firstIndex, Containers::ArrayView buffers); + + /** @overload */ + static void bind(Target target, UnsignedInt firstIndex, std::initializer_list buffers) { + return bind(target, firstIndex, Containers::arrayView(buffers)); + } /** * @brief Copy one buffer to another @@ -1002,7 +1012,7 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { * @note This function is meant to be used only internally from * @ref AbstractShaderProgram subclasses. See its documentation * for more information. - * @see @ref bind(Target, UnsignedInt, std::initializer_list>), + * @see @ref bind(Target, UnsignedInt, Containers::ArrayView>), * @ref maxAtomicCounterBindings(), @ref maxShaderStorageBindings(), * @ref maxUniformBindings(), @ref shaderStorageOffsetAlignment(), * @ref uniformOffsetAlignment(), @ref TransformFeedback::attachBuffer(), @@ -1028,7 +1038,7 @@ class MAGNUM_GL_EXPORT Buffer: public AbstractObject { * @note This function is meant to be used only internally from * @ref AbstractShaderProgram subclasses. See its documentation * for more information. - * @see @ref bind(Target, UnsignedInt, std::initializer_list), + * @see @ref bind(Target, UnsignedInt, Containers::ArrayView), * @ref maxAtomicCounterBindings(), @ref maxShaderStorageBindings(), * @ref maxUniformBindings(), @ref TransformFeedback::attachBuffer(), * @fn_gl_keyword{BindBufferBase} diff --git a/src/Magnum/GL/Implementation/TransformFeedbackState.h b/src/Magnum/GL/Implementation/TransformFeedbackState.h index 0b356a835..7f157584c 100644 --- a/src/Magnum/GL/Implementation/TransformFeedbackState.h +++ b/src/Magnum/GL/Implementation/TransformFeedbackState.h @@ -63,8 +63,8 @@ struct TransformFeedbackState { void(TransformFeedback::*createImplementation)(); void(TransformFeedback::*attachRangeImplementation)(GLuint, Buffer&, GLintptr, GLsizeiptr); void(TransformFeedback::*attachBaseImplementation)(GLuint, Buffer&); - void(TransformFeedback::*attachRangesImplementation)(GLuint, std::initializer_list>); - void(TransformFeedback::*attachBasesImplementation)(GLuint, std::initializer_list); + void(TransformFeedback::*attachRangesImplementation)(GLuint, Containers::ArrayView>); + void(TransformFeedback::*attachBasesImplementation)(GLuint, Containers::ArrayView); }; }}} diff --git a/src/Magnum/GL/TransformFeedback.cpp b/src/Magnum/GL/TransformFeedback.cpp index 181e360b0..086fac7bc 100644 --- a/src/Magnum/GL/TransformFeedback.cpp +++ b/src/Magnum/GL/TransformFeedback.cpp @@ -207,27 +207,23 @@ void TransformFeedback::attachImplementationDSA(const GLuint index, Buffer& buff } #endif -/** @todoc const std::initializer_list makes Doxygen grumpy */ -TransformFeedback& TransformFeedback::attachBuffers(const UnsignedInt firstIndex, std::initializer_list> buffers) { +TransformFeedback& TransformFeedback::attachBuffers(const UnsignedInt firstIndex, Containers::ArrayView> buffers) { (this->*Context::current().state().transformFeedback.attachRangesImplementation)(firstIndex, buffers); return *this; } -/** @todoc const std::initializer_list makes Doxygen grumpy */ -TransformFeedback& TransformFeedback::attachBuffers(const UnsignedInt firstIndex, std::initializer_list buffers) { +TransformFeedback& TransformFeedback::attachBuffers(const UnsignedInt firstIndex, Containers::ArrayView buffers) { (this->*Context::current().state().transformFeedback.attachBasesImplementation)(firstIndex, buffers); return *this; } -/** @todoc const std::initializer_list makes Doxygen grumpy */ -void TransformFeedback::attachImplementationFallback(const GLuint firstIndex, std::initializer_list> buffers) { +void TransformFeedback::attachImplementationFallback(const GLuint firstIndex, Containers::ArrayView> buffers) { bindInternal(); Buffer::bind(Buffer::Target(GL_TRANSFORM_FEEDBACK_BUFFER), firstIndex, buffers); } #ifndef MAGNUM_TARGET_GLES -/** @todoc const Containers::ArrayView makes Doxygen grumpy */ -void TransformFeedback::attachImplementationDSA(const GLuint firstIndex, std::initializer_list> buffers) { +void TransformFeedback::attachImplementationDSA(const GLuint firstIndex, Containers::ArrayView> buffers) { for(std::size_t i = 0; i != buffers.size(); ++i) { Buffer* buffer; GLintptr offset; @@ -239,15 +235,13 @@ void TransformFeedback::attachImplementationDSA(const GLuint firstIndex, std::in } #endif -/** @todoc const Containers::ArrayView makes Doxygen grumpy */ -void TransformFeedback::attachImplementationFallback(const GLuint firstIndex, std::initializer_list buffers) { +void TransformFeedback::attachImplementationFallback(const GLuint firstIndex, Containers::ArrayView buffers) { bindInternal(); Buffer::bind(Buffer::Target(GL_TRANSFORM_FEEDBACK_BUFFER), firstIndex, buffers); } #ifndef MAGNUM_TARGET_GLES -/** @todoc const Containers::ArrayView makes Doxygen grumpy */ -void TransformFeedback::attachImplementationDSA(const GLuint firstIndex, std::initializer_list buffers) { +void TransformFeedback::attachImplementationDSA(const GLuint firstIndex, Containers::ArrayView buffers) { for(std::size_t i = 0; i != buffers.size(); ++i) glTransformFeedbackBufferBase(_id, firstIndex + i, *(buffers.begin() + i) ? (*(buffers.begin() + i))->id() : 0); } diff --git a/src/Magnum/GL/TransformFeedback.h b/src/Magnum/GL/TransformFeedback.h index 6c397770b..6b9eaa717 100644 --- a/src/Magnum/GL/TransformFeedback.h +++ b/src/Magnum/GL/TransformFeedback.h @@ -340,7 +340,12 @@ class MAGNUM_GL_EXPORT TransformFeedback: public AbstractObject { * eventually @fn_gl{BindTransformFeedback} and * @fn_gl_keyword{BindBuffersRange} or @fn_gl_keyword{BindBufferRange} */ - TransformFeedback& attachBuffers(UnsignedInt firstIndex, std::initializer_list> buffers); + TransformFeedback& attachBuffers(UnsignedInt firstIndex, Containers::ArrayView> buffers); + + /** @overload */ + TransformFeedback& attachBuffers(UnsignedInt firstIndex, std::initializer_list> buffers) { + return attachBuffers(firstIndex, Containers::arrayView(buffers)); + } /** * @brief Attach buffers @@ -363,7 +368,12 @@ class MAGNUM_GL_EXPORT TransformFeedback: public AbstractObject { * eventually @fn_gl{BindTransformFeedback} and * @fn_gl_keyword{BindBuffersBase} or @fn_gl_keyword{BindBufferBase} */ - TransformFeedback& attachBuffers(UnsignedInt firstIndex, std::initializer_list buffers); + TransformFeedback& attachBuffers(UnsignedInt firstIndex, Containers::ArrayView buffers); + + /** @overload */ + TransformFeedback& attachBuffers(UnsignedInt firstIndex, std::initializer_list buffers) { + return attachBuffers(firstIndex, Containers::arrayView(buffers)); + } /** * @brief Begin transform feedback @@ -429,11 +439,11 @@ class MAGNUM_GL_EXPORT TransformFeedback: public AbstractObject { void MAGNUM_GL_LOCAL attachImplementationDSA(GLuint index, Buffer& buffer); #endif - void MAGNUM_GL_LOCAL attachImplementationFallback(GLuint firstIndex, std::initializer_list> buffers); - void MAGNUM_GL_LOCAL attachImplementationFallback(GLuint firstIndex, std::initializer_list buffers); + void MAGNUM_GL_LOCAL attachImplementationFallback(GLuint firstIndex, Containers::ArrayView> buffers); + void MAGNUM_GL_LOCAL attachImplementationFallback(GLuint firstIndex, Containers::ArrayView buffers); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_GL_LOCAL attachImplementationDSA(GLuint firstIndex, std::initializer_list> buffers); - void MAGNUM_GL_LOCAL attachImplementationDSA(GLuint firstIndex, std::initializer_list buffers); + void MAGNUM_GL_LOCAL attachImplementationDSA(GLuint firstIndex, Containers::ArrayView> buffers); + void MAGNUM_GL_LOCAL attachImplementationDSA(GLuint firstIndex, Containers::ArrayView buffers); #endif GLuint _id;