]> git.tdb.fi Git - libs/gl.git/blobdiff - source/buffer.cpp
Run a tighter ship with extensions
[libs/gl.git] / source / buffer.cpp
index 93ef98db60ad32654309945d505726d9255414d0..1226dbe3223f41e438ddcc7ca1c2f9b107b0fd17 100644 (file)
@@ -1,7 +1,4 @@
 #include <stdexcept>
-#include <msp/gl/extensions/arb_pixel_buffer_object.h>
-#include <msp/gl/extensions/arb_uniform_buffer_object.h>
-#include <msp/gl/extensions/arb_vertex_buffer_object.h>
 #include "buffer.h"
 #include "error.h"
 #include "mesh.h"
@@ -160,9 +157,12 @@ void BufferRange::bind_to(BufferType t, unsigned i)
 {
        if(t!=buffer.type)
                Buffer::require_buffer_type(t);
-       // Intentionally using bitwise | to avoid short-circuiting
-       if(Buffer::set_current(t, &buffer) | set_current(t, i, this))
+       if(set_current(t, i, this))
+       {
+               // The buffer gets bound as a side effect
+               Buffer::set_current(t, &buffer);
                glBindBufferRange(t, i, buffer.id, offset, size);
+       }
 }
 
 void BufferRange::unbind_from(BufferType t, unsigned i)