From d108cd5fc13aca16e38b54c1946c65797a869073 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 3 Sep 2012 12:14:49 +0300 Subject: [PATCH] Renderer no longer needs to track vertex array changes --- source/renderer.cpp | 9 +-------- source/renderer.h | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/source/renderer.cpp b/source/renderer.cpp index 6734edc4..44272813 100644 --- a/source/renderer.cpp +++ b/source/renderer.cpp @@ -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); diff --git a/source/renderer.h b/source/renderer.h index 91d20674..088b5710 100644 --- a/source/renderer.h +++ b/source/renderer.h @@ -91,7 +91,6 @@ private: std::vector shdata_stack; bool shdata_changed; const VertexArray *vertex_array; - bool vertex_array_changed; const Buffer *element_buffer; std::set excluded; -- 2.45.2