X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbufferable.h;h=f47ef4cabf17c1664838195778910886fcda778b;hb=9f00daecc2517aa8fd5a6e4545b2db3f2fff985d;hp=a88f7b07a719535d426e262157fc8ef10879bd80;hpb=9f25c3632cfd5c669a2ad24255e2e85dfa1cb460;p=libs%2Fgl.git diff --git a/source/bufferable.h b/source/bufferable.h index a88f7b07..f47ef4ca 100644 --- a/source/bufferable.h +++ b/source/bufferable.h @@ -46,16 +46,20 @@ public: void use_buffer(Buffer *buf, Bufferable *prev = 0); /** Uploads new data into the buffer if necessary. */ - void refresh() const { if(dirty) update_buffer(); } + void refresh() const { if(buffer && dirty) update_buffer(); } AsyncUpdater *refresh_async() const; private: void unlink_from_buffer(); +public: + /** Returns the buffer in which the data is stored. */ + const Buffer *get_buffer() const { return buffer; } + protected: /** Returns the buffer in which the data is stored. */ - Buffer *get_buffer() const { return buffer; } + Buffer *get_mutable_buffer() const { return buffer; } /** Returns the amount of data to be stored in the buffer, in bytes. */ virtual unsigned get_data_size() const = 0;