X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fbufferable.cpp;h=0a480e2527cfabbdf24241508d089acb5e8bd726;hb=f2bb1caa233930e1148613e9d5daa2c29b0fe271;hp=d07f57cc4e430f5d337c67cd7ebd47917eb3a456;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/core/bufferable.cpp b/source/core/bufferable.cpp index d07f57cc..0a480e25 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(); @@ -118,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; }