コード例 #1
0
ファイル: Shader.cs プロジェクト: tboogh/bgfx.Xamarin
 /// <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);
 }