}
}
+OpenGLFramebuffer::OpenGLFramebuffer(OpenGLFramebuffer &&other):
+ id(other.id),
+ status(other.status)
+{
+ other.id = 0;
+}
+
OpenGLFramebuffer::~OpenGLFramebuffer()
{
if(id)
void OpenGLFramebuffer::resize_system(unsigned w, unsigned h)
{
- Framebuffer *self = static_cast<Framebuffer *>(this);
- self->width = w;
- self->height = h;
+ Framebuffer &self = *static_cast<Framebuffer *>(this);
+ self.width = w;
+ self.height = h;
}
void OpenGLFramebuffer::update(unsigned mask) const
{
- const FrameFormat &format = static_cast<const Framebuffer *>(this)->format;
+ const Framebuffer &self = *static_cast<const Framebuffer *>(this);
+
vector<GLenum> color_bufs;
- color_bufs.reserve(format.size());
+ color_bufs.reserve(self.format.size());
unsigned i = 0;
- for(FrameAttachment a: format)
+ for(FrameAttachment a: self.format)
{
GLenum gl_attach_point = get_gl_attachment(a);
if(mask&(1<<i))
{
- const Framebuffer::Attachment &attch = static_cast<const Framebuffer *>(this)->attachments[i];
+ const Framebuffer::Attachment &attch = self.attachments[i];
if(attch.tex)
{
if(ARB_direct_state_access)