]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/bufferable.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / core / bufferable.h
index 25d29fd8f393021c6d6af4f86e624d77ec79705b..29acafe0f346c3e914bfe76d7ca4134e0c7822f6 100644 (file)
@@ -1,13 +1,13 @@
 #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.
@@ -26,11 +26,10 @@ public:
        {
        private:
                const Bufferable &bufferable;
-               char *mapped_address;
+               Buffer::AsyncTransfer transfer;
 
        public:
                AsyncUpdater(const Bufferable &);
-               ~AsyncUpdater();
 
                void upload_data();
        };
@@ -63,7 +62,7 @@ public:
        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. */