]> git.tdb.fi Git - libs/gl.git/commitdiff
Renderer no longer needs to track vertex array changes
authorMikko Rasa <tdb@tdb.fi>
Mon, 3 Sep 2012 09:14:49 +0000 (12:14 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 3 Sep 2012 09:14:49 +0000 (12:14 +0300)
source/renderer.cpp
source/renderer.h

index 6734edc4bd20458be56563bdddfd57a2589ab203..442728135274576129ff0da16c82531ae9837b07 100644 (file)
@@ -23,7 +23,6 @@ Renderer::Renderer(const Camera *c):
        camera(c),
        state_stack(1),
        vertex_array(0),
-       vertex_array_changed(false),
        element_buffer(0)
 {
        state_stack.reserve(16);
@@ -92,7 +91,6 @@ void Renderer::add_shader_data(const ProgramData &d)
 
 void Renderer::set_vertex_array(const VertexArray *a)
 {
-       vertex_array_changed = (a!=vertex_array);
        vertex_array = a;
 }
 
@@ -156,12 +154,7 @@ void Renderer::draw(const Batch &batch)
 
        apply_state();
 
-       // Until VertexArray acquires VAO support and becomes Bindable
-       if(vertex_array_changed)
-       {
-               vertex_array->apply();
-               vertex_array_changed = false;
-       }
+       vertex_array->apply();
 
        if(element_buffer)
                element_buffer->bind_to(ELEMENT_ARRAY_BUFFER);
index 91d20674a2c5a476a390c9d63c9ab9404adb93ec..088b5710ad6a31b6b79b1e1941ff10ef88e810c9 100644 (file)
@@ -91,7 +91,6 @@ private:
        std::vector<const ProgramData *> shdata_stack;
        bool shdata_changed;
        const VertexArray *vertex_array;
-       bool vertex_array_changed;
        const Buffer *element_buffer;
        std::set<const Renderable *> excluded;