X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fgraphicsbuffer.h;h=466534531d8e5ab1b665d37aa5414a6e2e71de38;hb=e0cd98bdff7f026b92f2c0e5b08639e08b98874e;hp=dd256178a48969948b227ccccc51fea82ac2d5d8;hpb=ddf7783ce69eb619f5a6b12e779c134279aa2ac6;p=ipdf%2Fcode.git diff --git a/src/graphicsbuffer.h b/src/graphicsbuffer.h index dd25617..4665345 100644 --- a/src/graphicsbuffer.h +++ b/src/graphicsbuffer.h @@ -7,7 +7,7 @@ namespace IPDF { - /* + /** * Implementation of an OpenGL buffer, with some extra cleverness. */ class GraphicsBuffer @@ -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;