public static void SetTransientVertexBuffer(byte stream, TransientVertexBuffer vertex_buffer, int start_vertex, int num_vertices) { unsafe { Bgfx.set_transient_vertex_buffer(stream, &vertex_buffer, (uint)start_vertex, (uint)num_vertices); } }
public static TransientVertexBuffer Create(Span <Vertex> vertices, VertexLayout layout) { var transient_vtx_buffer = new TransientVertexBuffer(vertices.Length, layout); var data_size = (uint)(vertices.Length * Unsafe.SizeOf <Vertex>()); Unsafe.CopyBlock((void *)transient_vtx_buffer.data, Unsafe.AsPointer(ref vertices[0]), data_size); return(transient_vtx_buffer); }
public static void AllocTransientVertexBuffer(out TransientVertexBuffer buffer, int vertex_count, ref VertexLayout layout) { Bgfx.alloc_transient_vertex_buffer(out buffer, (uint)vertex_count, ref layout.InternalHandle); }