From d23880571efc16dff1cfeeb92f35fe54c8f64c3d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 23 Jul 2008 01:39:40 +0000 Subject: [PATCH] Unbind vertex buffer after updating array data Use glBlendEquation through extension mechanism --- source/blend.cpp | 3 +++ source/vertexarray.cpp | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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 -- 2.45.2