C++ - OpenGL - glBufferData with std::vector -


this question has answer here:

i want use function glbufferdata fill indices/vertices. have arrays in std::vector , glbufferdata allows char*.

glbufferdata(gl_element_array_buffer, sizeof(m_indicesebo), m_indicesebo, gl_static_draw); 

how can use std::vector here?

you can way, assuming m_indicesebo std::vector.

glbufferdata(gl_element_array_buffer, m_indicesebo.size() * sizeof(<data type>), &m_indicesebo[0], gl_static_draw); 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -