Skip to content

Dynamic Vertex Problem #3683

Answered by prideout
xtl-murphy asked this question in Q&A
Mar 23, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

You can't change the VBO size, but you can change the active range of indices in the index buffer by calling setGeometryAt. This is useful if you know the maximum size ahead of time.

Alternatively you can simply create a brand new VertexBuffer when your required size changes beyond the initial capacity. For an example of this, check out ImGuiHelper.cpp. It grows the buffer by 2x each time by recreating the VertexBuffer.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@xtl-murphy
Comment options

Answer selected by prideout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants