]> git.tdb.fi Git - libs/gl.git/commitdiff
Unbind vertex buffer after updating array data
authorMikko Rasa <tdb@tdb.fi>
Wed, 23 Jul 2008 01:39:40 +0000 (01:39 +0000)
committerMikko Rasa <tdb@tdb.fi>
Wed, 23 Jul 2008 01:39:40 +0000 (01:39 +0000)
Use glBlendEquation through extension mechanism

source/blend.cpp
source/vertexarray.cpp

index c9407c2130fe3e7bb9d0770ee194ded9bd8d2649..899ccf599c255e8141fb14c2e3046af6fceaddbc 100644 (file)
@@ -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);
 }
 
index 0d4fd919cffa8daa210c416414024357a07d9d59..81a2acd5182a413777c39f0ebe944fe617b79b22 100644 (file)
@@ -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