33 #include "opengl3.hpp"
34 #include "texture.hpp"
35 #include "noncopyable.hpp"
57 explicit fbo(GLenum
const p_target = GL_FRAMEBUFFER);
112 explicit renderbuffer(GLenum
const p_format, GLsizei
const p_width, GLsizei
const p_height, GLsizei
const p_num_antialiasing_samples);
147 void attach_to(fbo &p_fbo, GLenum
const p_attachment, renderbuffer
const &p_renderbuf);
154 void attach_to(fbo &p_fbo, GLenum
const p_attachment, texture
const &p_texture);
161 void detach_from(fbo &p_fbo, GLenum
const p_attachment, renderbuffer
const &p_renderbuf);
168 void detach_from(fbo &p_fbo, GLenum
const p_attachment, texture
const &p_texture);
175 void set_draw_buffer(GLenum
const p_buffer);
182 void set_draw_buffers(GLsizei
const p_num_buffers, GLenum
const * p_buffers);
189 template <
typename Buffers >
190 struct set_draw_buffers_impl
192 inline void operator()(Buffers
const &p_buffers)
const
194 std::vector < GLenum > buffers_array;
195 std::copy(p_buffers.begin(), p_buffers.end(), std::back_inserter(buffers_array));
196 set_draw_buffers(buffers_array.size(), &buffers_array[0]);
201 template <
typename T,
typename Alloc >
202 struct set_draw_buffers_impl < std::vector < T, Alloc > >
204 inline void operator()(std::vector < T, Alloc >
const &p_buffers)
const
206 set_draw_buffers(p_buffers.size(), &p_buffers[0]);
220 template <
typename Buffers >
221 inline void set_draw_buffers(Buffers
const &p_buffers)
223 detail::set_draw_buffers_impl < Buffers > ()(p_buffers);