X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fgraphicsbuffer.h;h=4053f9079ab67e0b1b89b7ad5504671241fbdf6b;hp=3dbb6fb9d136776b900474551b294c33645d5c07;hb=e35bf651e7ebfe4932e877780bb00397c41a7ec2;hpb=09fc4981be389620d3c269beacf0630de45871bb diff --git a/src/graphicsbuffer.h b/src/graphicsbuffer.h index 3dbb6fb..4053f90 100644 --- a/src/graphicsbuffer.h +++ b/src/graphicsbuffer.h @@ -1,7 +1,7 @@ #ifndef _GRAPHICSBUFFER_H #define _GRAPHICSBUFFER_H -#include +#include "SDL.h" #include "gl_core44.h" @@ -21,7 +21,7 @@ namespace IPDF BufferTypePixelUnpack, BufferTypeUniform, // Uniform/Constant buffer BufferTypeTexture, // I was hoping to avoid this one. - BufferTypeDrawIndirect, + BufferTypeDrawIndirect }; enum BufferUsage @@ -40,6 +40,7 @@ namespace IPDF GraphicsBuffer(); ~GraphicsBuffer(); + void SetName(const char *name); void SetType(BufferType bufType); void SetUsage(BufferUsage bufUsage); @@ -63,8 +64,9 @@ namespace IPDF GLuint GetHandle() const { return m_buffer_handle; } void Bind() const; + void BindRange(size_t start, size_t size) 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; @@ -73,6 +75,7 @@ namespace IPDF bool m_invalidated; bool m_buffer_shape_dirty; bool m_faking_map; + const char *m_name; }; }