예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicVertexBuffer"/> struct.
 /// </summary>
 /// <param name="memory">The initial vertex data with which to populate the buffer.</param>
 /// <param name="layout">The layout of the vertex data.</param>
 /// <param name="flags">Flags used to control buffer behavior.</param>
 public DynamicVertexBuffer(MemoryBlock memory, VertexLayout layout, BufferFlags flags = BufferFlags.None)
 {
     handle = NativeMethods.bgfx_create_dynamic_vertex_buffer_mem(memory.ptr, ref layout.data, flags);
 }
예제 #2
0
 /// <summary>
 /// Updates the data in the buffer.
 /// </summary>
 /// <param name="startVertex">Index of the first vertex to update.</param>
 /// <param name="memory">The new vertex data with which to fill the buffer.</param>
 public void Update(int startVertex, MemoryBlock memory)
 {
     NativeMethods.bgfx_update_dynamic_vertex_buffer(handle, startVertex, memory.ptr);
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="IndexBuffer"/> struct.
 /// </summary>
 /// <param name="memory">The 16-bit index data used to populate the buffer.</param>
 /// <param name="flags">Flags used to control buffer behavior.</param>
 public IndexBuffer(MemoryBlock memory, BufferFlags flags = BufferFlags.None)
 {
     handle = NativeMethods.bgfx_create_index_buffer(memory.ptr, flags);
 }