#include <stdexcept>
#include "buffer.h"
#include "bufferable.h"
+#include "error.h"
using namespace std;
void Bufferable::upload_data(char *target) const
{
+ if(!buffer)
+ throw invalid_operation("Bufferable::upload_data");
+
unsigned data_size = get_data_size();
if(location_dirty)
{
unsigned get_required_buffer_size() const;
/** Uploads new data into the buffer if necessary. */
- void refresh() const { if(buffer && dirty) upload_data(0); }
+ void refresh() const { if(dirty) upload_data(0); }
/** Returns an object which can be used to upload data to the buffer using
mapped memory. */