| 161 | } |
| 162 | |
| 163 | void VertexArrayBuffer::RenderRange(ref_ptr<GraphicsContext> context, bool drawAsLine, IndicesRange const & range) |
| 164 | { |
| 165 | if (HasBuffers() && GetIndexCount() > 0) |
| 166 | { |
| 167 | // If OES_vertex_array_object is supported than all bindings have already saved in VAO |
| 168 | // and we need only bind VAO. |
| 169 | if (!Bind()) |
| 170 | BindStaticBuffers(); |
| 171 | |
| 172 | BindDynamicBuffers(); |
| 173 | GetIndexBuffer()->Bind(); |
| 174 | |
| 175 | CHECK(m_impl != nullptr, ()); |
| 176 | m_impl->RenderRange(context, drawAsLine, range); |
| 177 | |
| 178 | Unbind(); |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | void VertexArrayBuffer::Build(ref_ptr<GraphicsContext> context, ref_ptr<GpuProgram> program) |
| 183 | { |