]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/bufferable.cpp
Remove some unused and unnecessary things
[libs/gl.git] / source / core / bufferable.cpp
index abbde26381019db839d0064bfdee1de83f889fbc..0a480e2527cfabbdf24241508d089acb5e8bd726 100644 (file)
@@ -1,21 +1,13 @@
 #include <stdexcept>
 #include "buffer.h"
 #include "bufferable.h"
+#include "error.h"
 
 using namespace std;
 
 namespace Msp {
 namespace GL {
 
-Bufferable::Bufferable():
-       buffer(0),
-       offset(0),
-       next_in_buffer(0),
-       prev_in_buffer(0),
-       location_dirty(false),
-       dirty(false)
-{ }
-
 Bufferable::~Bufferable()
 {
        unlink_from_buffer();
@@ -115,11 +107,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;
        }