@ -94,36 +94,31 @@ Framebuffer& Framebuffer::mapForDraw(std::initializer_list<std::pair<UnsignedInt
/* Create linear array from associative */
/** @todo C++14: use VLA to avoid heap allocation */
GLenum * _attachments = new GLenum [ max + 1 ] ;
std : : fill_n ( _attachments , max , GL_NONE ) ;
static_assert ( GL_NONE = = 0 , " Expecting zero GL_NONE for zero-initialization " ) ;
auto _attachments = Containers : : Array < GLenum > : : zeroInitialized ( max + 1 ) ;
for ( const auto & attachment : attachments )
_attachments [ attachment . first ] = GLenum ( attachment . second ) ;
( this - > * drawBuffersImplementation ) ( max + 1 , _attachments ) ;
delete [ ] _attachments ;
return * this ;
}
void Framebuffer : : invalidate ( std : : initializer_list < InvalidationAttachment > attachments ) {
/** @todo C++14: use VLA to avoid heap allocation */
GLenum * _attachments = new GLenum [ attachments . size ( ) ] ;
Containers : : Array < GLenum > _attachments ( attachments . size ( ) ) ;
for ( std : : size_t i = 0 ; i ! = attachments . size ( ) ; + + i )
_attachments [ i ] = GLenum ( * ( attachments . begin ( ) + i ) ) ;
invalidateImplementation ( attachments . size ( ) , _attachments ) ;
delete [ ] _attachments ;
}
void Framebuffer : : invalidate ( std : : initializer_list < InvalidationAttachment > attachments , const Rectanglei & rectangle ) {
/** @todo C++14: use VLA to avoid heap allocation */
GLenum * _attachments = new GLenum [ attachments . size ( ) ] ;
Containers : : Array < GLenum > _attachments ( attachments . size ( ) ) ;
for ( std : : size_t i = 0 ; i ! = attachments . size ( ) ; + + i )
_attachments [ i ] = GLenum ( * ( attachments . begin ( ) + i ) ) ;
invalidateImplementation ( attachments . size ( ) , _attachments , rectangle ) ;
delete [ ] _attachments ;
}
Framebuffer & Framebuffer : : attachTexture2D ( BufferAttachment attachment , Texture2D & texture , Int mipLevel ) {