*/
class Bufferable
{
+public:
+ class AsyncUpdater
+ {
+ private:
+ const Bufferable &bufferable;
+ char *mapped_address;
+ bool buffer_resized;
+
+ public:
+ AsyncUpdater(const Bufferable &);
+ ~AsyncUpdater();
+
+ void upload_data();
+ };
+
private:
Buffer *buffer;
unsigned offset;
/** Uploads new data into the buffer if necessary. */
void refresh() const { if(dirty) update_buffer(); }
+ AsyncUpdater *refresh_async() const;
+
private:
void unlink_from_buffer();
/** Resizes the buffer if necessary and calls upload_data(). */
void update_buffer() const;
- /** Uploads data to the buffer. */
- virtual void upload_data() const;
+ /** Uploads data to the buffer. Receives pointer to mapped buffer memory as
+ parameter. If null, buffer interface should be used instead. */
+ virtual void upload_data(char *) const;
};
} // namespace GL