Hideously useless buffer perf optimization.
[ipdf/code.git] / src / graphicsbuffer.h
index 15e5b42..47534c9 100644 (file)
@@ -9,7 +9,7 @@
 namespace IPDF
 {
        /*
 namespace IPDF
 {
        /*
-        * The "Screen" class handles managing the OS window (using SDL2).
+        * Implementation of an OpenGL buffer, with some extra cleverness.
         */
        class GraphicsBuffer
        {
         */
        class GraphicsBuffer
        {
@@ -52,15 +52,20 @@ namespace IPDF
                void UploadRange(size_t length, intptr_t offset, const void *data);
 
                void Resize(size_t length);
                void UploadRange(size_t length, intptr_t offset, const void *data);
 
                void Resize(size_t length);
+               const size_t GetSize() const { return m_buffer_size; }
+
+               void Invalidate();
                
                void Bind();
        private:
                
                void Bind();
        private:
+               void RecreateBuffer();
                GLuint m_buffer_handle;
                BufferType m_buffer_type;
                BufferUsage m_buffer_usage;
                void *m_map_pointer;
                size_t m_buffer_size;
                bool m_invalidated;
                GLuint m_buffer_handle;
                BufferType m_buffer_type;
                BufferUsage m_buffer_usage;
                void *m_map_pointer;
                size_t m_buffer_size;
                bool m_invalidated;
+               bool m_buffer_shape_dirty;
        };
 
 }
        };
 
 }

UCC git Repository :: git.ucc.asn.au