Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 538 Bytes

README.md

File metadata and controls

15 lines (11 loc) · 538 Bytes

Hello triangle

Based on the first half of https://learnopengl.com/Getting-started/Hello-Triangle

Note that instead of using device.create_buffer and then writing data to the buffer we could do this in a single step using wgpu::util::DeviceExt:

let vbo = device.create_buffer_init(&BufferInitDescriptor {
    label: None,
    contents: cast_slice(&vertices),
    usage: BufferUsages::VERTEX,
});

This is useful when the data is known at buffer creation time.