예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Shader"/> struct.
 /// </summary>
 /// <param name="memory">The compiled shader memory.</param>
 public Shader(MemoryBlock memory)
 {
     handle   = NativeMethods.bgfx_create_shader(memory.ptr);
     uniforms = null;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicIndexBuffer"/> struct.
 /// </summary>
 /// <param name="memory">The initial index data with which to populate the buffer.</param>
 /// <param name="flags">Flags used to control buffer behavior.</param>
 public DynamicIndexBuffer(MemoryBlock memory, BufferFlags flags = BufferFlags.None)
 {
     handle = NativeMethods.bgfx_create_dynamic_index_buffer_mem(memory.ptr, flags);
 }
예제 #3
0
 /// <summary>
 /// Updates the data in the buffer.
 /// </summary>
 /// <param name="startIndex">Index of the first index to update.</param>
 /// <param name="memory">The new index data with which to fill the buffer.</param>
 public void Update(int startIndex, MemoryBlock memory)
 {
     NativeMethods.bgfx_update_dynamic_index_buffer(handle, startIndex, memory.ptr);
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VertexBuffer"/> struct.
 /// </summary>
 /// <param name="memory">The 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 VertexBuffer(MemoryBlock memory, VertexLayout layout, BufferFlags flags = BufferFlags.None)
 {
     handle = NativeMethods.bgfx_create_vertex_buffer(memory.ptr, ref layout.data, flags);
 }