Merge branch 'master' of git.ucc.asn.au:ipdf/code
[ipdf/code.git] / src / graphicsbuffer.cpp
index 712caf8..da522dc 100644 (file)
@@ -185,6 +185,10 @@ void* GraphicsBuffer::MapRange(int offset, int length, bool read, bool write, bo
 void GraphicsBuffer::UnMap()
 {
        GLenum target = BufferTypeToGLType(m_buffer_type);
+       
+       // If we're not mapped, unmapping is a no-op.
+       if (!m_map_pointer)
+               return;
 
        if (m_faking_map)
        {
@@ -259,3 +263,7 @@ void GraphicsBuffer::Bind() const
                glBindBuffer(BufferTypeToGLType(m_buffer_type), m_buffer_handle);
 }
 
+void GraphicsBuffer::BindRange(size_t start, size_t size) const
+{
+       glBindBufferRange(BufferTypeToGLType(m_buffer_type), 0, m_buffer_handle, start, size);
+}

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