From: Mikko Rasa Date: Wed, 23 Jul 2008 01:39:40 +0000 (+0000) Subject: Unbind vertex buffer after updating array data X-Git-Tag: 0.9~2 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d23880571efc16dff1cfeeb92f35fe54c8f64c3d;p=libs%2Fgl.git Unbind vertex buffer after updating array data Use glBlendEquation through extension mechanism --- diff --git a/source/blend.cpp b/source/blend.cpp index c9407c21..899ccf59 100644 --- a/source/blend.cpp +++ b/source/blend.cpp @@ -7,12 +7,15 @@ Distributed under the LGPL #define GL_GLEXT_PROTOTYPES #include "blend.h" +#include "extension.h" +#include "version_1_2.h" namespace Msp { namespace GL { void blend_equation(BlendEquation eq) { + require_version(1, 2); glBlendEquation(eq); } diff --git a/source/vertexarray.cpp b/source/vertexarray.cpp index 0d4fd919..81a2acd5 100644 --- a/source/vertexarray.cpp +++ b/source/vertexarray.cpp @@ -118,7 +118,8 @@ void VertexArray::apply() const set_array(GL_TEXTURE_COORD_ARRAY, found&4, 4); set_array(GL_COLOR_ARRAY, found&8, 8); - VertexBuffer::unbind(); + if(vbuf) + VertexBuffer::unbind(); } /** @@ -127,7 +128,10 @@ Updates the VertexArray data to the VertexBuffer tied to the array, if any. void VertexArray::update_data() { if(vbuf) + { vbuf->data(data.size()*sizeof(float), &data[0]); + VertexBuffer::unbind(); + } } void VertexArray::set_array(unsigned array, unsigned bit, unsigned mask) const