Disclaimer: I haven't used bgfx for anything serious, the below information is based on the public API and documentation. I have verified non-obvious cases by looking into bgfx's source, but please do let me know if you think I've misunderstood something.
BGFXTransform is required as an argument to:
You allocate a BGFXTransform, but you do not fill it with anything. The call to bgfx_alloc_transform will initialize the struct with a data pointer that's internal to bgfx. You then access the pointer with .data(), returning a FloatBuffer (wrapping 4 x 4 x .num() floats) which is obviously mutable.
BGFXInstanceDataBuffer is required as an argument to:
- bgfx_set_instance_data_buffer
BGFXInstanceDataBuffer instances are created with bgfx_alloc_instance_data_buffer. No member should be modified, except the contents of the .data() buffer. A BGFXInstanceDataBuffer instance is deallocated after a call to bgfx_set_instance_data_buffer.
BGFXTextureInfo is required as an argument to:
- bgfx_calc_texture_size
- bgfx_create_texture
In both functions, the _info parameter is an output parameter.
BGFXMemory is required as an argument to:
- bgfx_create_dynamic_index_buffer_mem
- bgfx_create_dynamic_vertex_buffer_mem
- bgfx_create_index_buffer
- bgfx_create_shader
- bgfx_create_texture_2d
- bgfx_create_texture_3d
- bgfx_create_texture
- bgfx_create_dynamic_vertex_buffer
- bgfx_update_dynamic_index_buffer
- bgfx_update_dynamic_vertex_buffer
- bgfx_update_texture_2d
- bgfx_update_texture_3d
- bgfx_update_texture_cube
BGFXMemory is already mutable. Note that there's a setter for data only, the size member is populated automatically based on the buffer size. If that is inconvenient somehow, you can use the "unsafe" static setters (ndata & nsize).
BGFXCallbackInterface is required as an argument to:
BGFXCallbackInterface is already mutable. See the vtbl(BGFXCallbackVtbl value) method.