X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fbufferable.cpp;h=3178e0adefa38f72e2d8aa22ecbae6769c50cdc7;hp=569ffb2f08a252cb1d153e591df420a1108dcf5a;hb=08e19bc2b4eba572bc7699378cf55cd8772ac67e;hpb=6c525eff3eaaa617648a869449ed3bddf9c1936d diff --git a/source/bufferable.cpp b/source/bufferable.cpp index 569ffb2f..3178e0ad 100644 --- a/source/bufferable.cpp +++ b/source/bufferable.cpp @@ -1,4 +1,6 @@ #include +#include +#include #include "bindable.h" #include "buffer.h" #include "bufferable.h" @@ -40,6 +42,7 @@ void Bufferable::use_buffer(Buffer *buf, Bufferable *prev) } } + dirty = true; update_offset(); } @@ -106,7 +109,8 @@ bool Bufferable::resize_buffer() const void Bufferable::update_buffer() const { - BindRestore bind(buffer, buffer->get_type()); + Conditional _bind(!ARB_direct_state_access, buffer, buffer->get_type()); + if(resize_buffer()) { /* Resizing the buffer invalidates its contents. Non-dirty data may