Only slightly totally broken SVG transformations
[ipdf/code.git] / src / graphicsbuffer.h
index 9513cb7..fd89771 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _GRAPHICSBUFFER_H
 #define _GRAPHICSBUFFER_H
 
-#include <SDL.h>
+#include "SDL.h"
 #include "gl_core44.h"
 
 
@@ -20,7 +20,8 @@ namespace IPDF
                        BufferTypePixelPack,            // Pixel Pack buffer
                        BufferTypePixelUnpack,
                        BufferTypeUniform,              // Uniform/Constant buffer
-                       BufferTypeDrawIndirect,
+                       BufferTypeTexture,              // I was hoping to avoid this one.
+                       BufferTypeDrawIndirect
                };
                
                enum BufferUsage
@@ -54,10 +55,16 @@ namespace IPDF
                const size_t GetSize() const { return m_buffer_size; }
 
                void Invalidate();
+
+               // WARNING: The buffer handle can change for (almost) no reason.
+               // If you do _anything_ to the buffer, you'll need to call this
+               // again to see if we've recreated it in a vain attempt to outsmart
+               // the driver.
+               GLuint GetHandle() const { return m_buffer_handle; }
                
                void Bind() const;
        private:
-               bool RecreateBuffer(const void *data = nullptr);
+               bool RecreateBuffer(const void *data = NULL);
                GLuint m_buffer_handle;
                BufferType m_buffer_type;
                BufferUsage m_buffer_usage;

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