]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/framebuffer_backend.cpp
Adjust access to main class members from backend classes
[libs/gl.git] / source / backends / opengl / framebuffer_backend.cpp
index de8a9c6eabd2274cceb83b7c087b570b06149d16..18566ac3c2553fd82ea1dd71ab735dc0f3cd3168 100644 (file)
@@ -76,23 +76,24 @@ void OpenGLFramebuffer::require_layered()
 
 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)