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

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

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

StringGrid issue in Delphi XE8 firemonkey mobile app -