]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/bufferable.cpp
Make it an error to try to refresh a Bufferable without a buffer
[libs/gl.git] / source / core / bufferable.cpp
index 8f967df7a89967cf0d83ece6778d6a6ed3640539..24c0f2789f4bae1bf256237587509ff40c408e68 100644 (file)
@@ -1,6 +1,7 @@
 #include <stdexcept>
 #include "buffer.h"
 #include "bufferable.h"
+#include "error.h"
 
 using namespace std;
 
@@ -106,6 +107,9 @@ 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)
        {