Browse Source

Added some C++14 TODOs.

pull/277/head
Vladimír Vondruš 13 years ago
parent
commit
8a2d769dd1
  1. 3
      src/DefaultFramebuffer.cpp
  2. 3
      src/Framebuffer.cpp

3
src/DefaultFramebuffer.cpp

@ -44,6 +44,7 @@ DefaultFramebuffer* DefaultFramebuffer::mapForDraw(std::initializer_list<std::pa
if(attachment.first > max) max = attachment.first;
/* 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);
for(const auto& attachment: attachments)
@ -56,6 +57,7 @@ DefaultFramebuffer* DefaultFramebuffer::mapForDraw(std::initializer_list<std::pa
#endif
void DefaultFramebuffer::invalidate(std::initializer_list<InvalidationAttachment> attachments) {
/** @todo C++14: use VLA to avoid heap allocation */
GLenum* _attachments = new GLenum[attachments.size()];
for(std::size_t i = 0; i != attachments.size(); ++i)
_attachments[i] = GLenum(*(attachments.begin()+i));
@ -66,6 +68,7 @@ void DefaultFramebuffer::invalidate(std::initializer_list<InvalidationAttachment
}
void DefaultFramebuffer::invalidate(std::initializer_list<InvalidationAttachment> attachments, const Rectanglei& rectangle) {
/** @todo C++14: use VLA to avoid heap allocation */
GLenum* _attachments = new GLenum[attachments.size()];
for(std::size_t i = 0; i != attachments.size(); ++i)
_attachments[i] = GLenum(*(attachments.begin()+i));

3
src/Framebuffer.cpp

@ -74,6 +74,7 @@ Framebuffer* Framebuffer::mapForDraw(std::initializer_list<std::pair<UnsignedInt
if(attachment.first > max) max = attachment.first;
/* 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);
for(const auto& attachment: attachments)
@ -85,6 +86,7 @@ Framebuffer* Framebuffer::mapForDraw(std::initializer_list<std::pair<UnsignedInt
}
void Framebuffer::invalidate(std::initializer_list<InvalidationAttachment> attachments) {
/** @todo C++14: use VLA to avoid heap allocation */
GLenum* _attachments = new GLenum[attachments.size()];
for(std::size_t i = 0; i != attachments.size(); ++i)
_attachments[i] = GLenum(*(attachments.begin()+i));
@ -95,6 +97,7 @@ void Framebuffer::invalidate(std::initializer_list<InvalidationAttachment> attac
}
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()];
for(std::size_t i = 0; i != attachments.size(); ++i)
_attachments[i] = GLenum(*(attachments.begin()+i));

Loading…
Cancel
Save