]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/bufferable.cpp
Move Bufferable::refresh_async's definition to the header
[libs/gl.git] / source / core / bufferable.cpp
index 8f967df7a89967cf0d83ece6778d6a6ed3640539..a0ff06c8f25802f782c37b599f583019073cffb6 100644 (file)
@@ -1,6 +1,7 @@
 #include <stdexcept>
 #include "buffer.h"
 #include "bufferable.h"
+#include "error.h"
 
 using namespace std;
 
@@ -59,11 +60,6 @@ unsigned Bufferable::get_required_buffer_size() const
        return last->offset+last->get_data_size();
 }
 
-Bufferable::AsyncUpdater *Bufferable::refresh_async() const
-{
-       return dirty ? new AsyncUpdater(*this) : 0;
-}
-
 void Bufferable::unlink_from_buffer()
 {
        if(prev_in_buffer)
@@ -106,11 +102,13 @@ void Bufferable::update_offset()
 
 void Bufferable::upload_data(char *target) const
 {
+       if(!buffer)
+               throw invalid_operation("Bufferable::upload_data");
+
        unsigned data_size = get_data_size();
        if(location_dirty)
        {
                buffer->require_size(offset+data_size);
-               location_changed(buffer, offset, data_size);
                location_dirty = false;
        }