RandyGaul / cute_framework

The *cutest* framework out there for creating 2D games in C++!
https://randygaul.github.io/cute_framework/#/
Other
534 stars 31 forks source link

Resize vertex buffer if necessary in cf_mesh_update_vertex_data #192

Closed waldnercharles closed 1 month ago

waldnercharles commented 1 month ago

I don't know if this is the right way to do this. It solved my problem so I figured I'd open a PR to discuss. Would it be better to instead do something like a pow2 resize?

RandyGaul commented 1 month ago

Looks good, though I would agree yes, a 2x size would be a bit better. Go ahead and just double the size if this if-statement is hit. The default size is very small like 5mb, so I would expect for games with lots of sprites for this to get hit a few times before settling.