jfcameron / gdk-graphics

3D Rendering using OpenGLES 2.0/WebGL1.0. Platforms: Linux, Windows, Mac, x86 64bit, arm64, wasm
MIT License
1 stars 1 forks source link

vertex_data: push_back, +=, in-place access #58

Closed jfcameron closed 3 years ago

jfcameron commented 3 years ago

decide on some nonconst methods that let users modify vertex data. operator +=, etc. push_back(other)? etc.

goal is to be able to insert at index, rewrite a range, remove data.

// insert new data at index eg back, front, index
// format must match
insert(index, data) 

// removes specified verticies data
remove({start, end}) // remove range
remove(index) // remove 1

// start at index, write till end of new vertex data
// attrib format must match
overwrite({starting index}, {new vertex data})

this is required for higher level abstractions that transform vertex data directly. specifically came up while writing a "batch_model" (model composed of many instances of the same thing) and a tile renderer