| 112 | } |
| 113 | |
| 114 | void UpdateIndexBuffer(ref_ptr<dp::GraphicsContext> context) override |
| 115 | { |
| 116 | UNUSED_VALUE(context); |
| 117 | CHECK(!m_mesh->m_indices.empty(), ()); |
| 118 | CHECK(m_indexBuffer, ("Index buffer was not created")); |
| 119 | GLFunctions::glBindBuffer(m_indexBuffer, gl_const::GLElementArrayBuffer); |
| 120 | GLFunctions::glBufferData(gl_const::GLElementArrayBuffer, |
| 121 | static_cast<uint32_t>(m_mesh->m_indices.size() * sizeof(uint16_t)), |
| 122 | m_mesh->m_indices.data(), gl_const::GLStaticDraw); |
| 123 | GLFunctions::glBindBuffer(0, gl_const::GLElementArrayBuffer); |
| 124 | } |
| 125 | |
| 126 | void Bind(ref_ptr<dp::GpuProgram> program) override { GLFunctions::glBindVertexArray(m_VAO); } |
| 127 | |