| 76 | void Unbind() override { GLFunctions::glBindVertexArray(0); } |
| 77 | |
| 78 | void BindBuffers(BuffersMap const & buffers) const override |
| 79 | { |
| 80 | for (auto it = buffers.begin(); it != buffers.end(); ++it) |
| 81 | { |
| 82 | BindingInfo const & binding = it->first; |
| 83 | ref_ptr<DataBuffer> buffer = make_ref(it->second); |
| 84 | buffer->GetBuffer()->Bind(); |
| 85 | |
| 86 | for (uint16_t i = 0; i < binding.GetCount(); ++i) |
| 87 | { |
| 88 | BindingDecl const & decl = binding.GetBindingDecl(i); |
| 89 | int8_t attributeLocation = m_program->GetAttributeLocation(decl.m_attributeName); |
| 90 | assert(attributeLocation != -1); |
| 91 | GLFunctions::glEnableVertexAttribute(attributeLocation); |
| 92 | GLFunctions::glVertexAttributePointer(attributeLocation, decl.m_componentCount, decl.m_componentType, false, |
| 93 | decl.m_stride, decl.m_offset); |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | void RenderRange(ref_ptr<GraphicsContext> context, bool drawAsLine, IndicesRange const & range) override |
| 99 | { |