Exemple #1
0
 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);
     }
 }
Exemple #2
0
        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);
        }
Exemple #3
0
 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);
 }