+ if (m_colour.a < 1.0f)
+ {
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ }
+ glColor4f(m_colour.r, m_colour.g, m_colour.b, m_colour.a);
+ m_vertex_buffer.Bind();
+ m_index_buffer.Bind();
+ glEnable(GL_PRIMITIVE_RESTART);
+ glPrimitiveRestartIndex(0xFFFFFFFF);
+ glVertexPointer(2, GL_FLOAT, 0, 0);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glDrawElements(GL_TRIANGLE_STRIP, m_rendered_filled * 5, GL_UNSIGNED_INT, 0);
+ glDrawElements(GL_LINE_LOOP, m_rendered_outline*5, GL_UNSIGNED_INT,(void*)(sizeof(uint32_t)*m_rendered_filled*5));
+ glDisable(GL_PRIMITIVE_RESTART);
+ if (m_colour.a < 1.0f)
+ {
+ glDisable(GL_BLEND);
+ }
+ m_cached_display.UnBind();
+ m_cached_display.Blit();
+
+}
+
+void View::ReRender()
+{
+ static bool debug_output_done = false;
+ if (!debug_output_done)
+ {
+ //m_document.DebugDumpObjects();
+ debug_output_done = true;
+
+ m_vertex_buffer.SetType(GraphicsBuffer::BufferTypeVertex);
+ m_index_buffer.SetUsage(GraphicsBuffer::BufferUsageStaticDraw);
+ m_index_buffer.SetType(GraphicsBuffer::BufferTypeIndex);
+
+ m_vertex_buffer.Upload(m_document.ObjectCount() * 8 * sizeof(float), NULL);
+ m_index_buffer.Upload(m_document.ObjectCount() * 5 * sizeof(uint32_t), NULL);
+ }
+ m_rendered_filled = m_rendered_outline = 0;
+
+ if (m_use_gpu_transform)
+ {
+ m_vertex_buffer.SetUsage(GraphicsBuffer::BufferUsageStaticDraw);
+ }
+ else
+ {
+ m_vertex_buffer.SetUsage(GraphicsBuffer::BufferUsageDynamicDraw);
+ }
+
+
+ //DrawGrid(); // Draw the gridlines
+
+
+
+ float *vertexData = (float*)m_vertex_buffer.Map(false, true, true);
+ uint32_t *indexData = (uint32_t*)m_index_buffer.Map(false, true, true);