X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fbufferable.cpp;h=a0ff06c8f25802f782c37b599f583019073cffb6;hb=0fa506250545acb83bc86f1734826544d6f1eda6;hp=d07f57cc4e430f5d337c67cd7ebd47917eb3a456;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/core/bufferable.cpp b/source/core/bufferable.cpp index d07f57cc..a0ff06c8 100644 --- a/source/core/bufferable.cpp +++ b/source/core/bufferable.cpp @@ -1,24 +1,13 @@ #include -#include -#include -#include "bindable.h" #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(); @@ -71,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) @@ -118,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; }