#ifndef MSP_GL_BUFFERABLE_H_
#define MSP_GL_BUFFERABLE_H_
+#include <cstddef>
#include <msp/core/noncopyable.h>
+#include "buffer.h"
namespace Msp {
namespace GL {
-class Buffer;
-
/**
Base class for things that can store data in buffers. Multiple Bufferables
may be put in the same buffer.
{
private:
const Bufferable &bufferable;
- char *mapped_address;
+ Buffer::AsyncTransfer transfer;
public:
AsyncUpdater(const Bufferable &);
- ~AsyncUpdater();
void upload_data();
};
std::size_t get_required_buffer_size(bool = false) const;
/** Uploads new data into the buffer if necessary. */
- void refresh(unsigned f) const { if(dirty&(1<<f)) upload_data(f, 0); }
+ void refresh(unsigned f) const { if(dirty) upload_data(f, 0); }
/** Returns an object which can be used to upload data to the buffer using
mapped memory. If data is not dirty, returns null. */