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: refactor usage_hint #55

Closed jfcameron closed 3 years ago

jfcameron commented 3 years ago

I have started writing higher level abstractions and realized usage_hint isnt appropriate as a vertex_data member, it should be an argument provided alongside vertex_data when updating or setting a model's vertex data.

make_model(vertex_data) will write to static storage. make_model() allocates an empty buffer. model::update_data(vertex_data, usage_hint).

this will allow an animator to specifiy streaming at update_data call. static dynamic text dynamic at update call, dynamic_batch dynamic or streaming etc. usage hint is about the vram copy not the vertex data residing in ram which can be uploaded to different buffers for different purposes.