From 8a2d769dd139919f1a7e1a149506a0f21720f734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 30 Jul 2013 18:44:19 +0200 Subject: [PATCH] Added some C++14 TODOs. --- src/DefaultFramebuffer.cpp | 3 +++ src/Framebuffer.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/DefaultFramebuffer.cpp b/src/DefaultFramebuffer.cpp index fe7a7d75a..60a628f30 100644 --- a/src/DefaultFramebuffer.cpp +++ b/src/DefaultFramebuffer.cpp @@ -44,6 +44,7 @@ DefaultFramebuffer* DefaultFramebuffer::mapForDraw(std::initializer_list 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 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 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)); diff --git a/src/Framebuffer.cpp b/src/Framebuffer.cpp index ae727c33f..001f8d71a 100644 --- a/src/Framebuffer.cpp +++ b/src/Framebuffer.cpp @@ -74,6 +74,7 @@ Framebuffer* Framebuffer::mapForDraw(std::initializer_list 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 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 attac } void Framebuffer::invalidate(std::initializer_list 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));