C99 Hello Triangle:
https://github.com/gfx-rs/wgpu/blob/master/examples/hello_tr...
Rust Hello Triangle:
https://github.com/gfx-rs/wgpu/blob/master/examples/hello_tr...
Both look very neat and tidy IMHO.
The C99 version could also use nested designated initialization right in the function call, this would make it look very similar to the Rust version, e.g.:
WGPUBlendStateId blend_state_0 = wgpu_device_create_blend_state(
device,
&(WGPUBlendDescriptor) {
.blend_enabled = false,
.write_mask = WGPUColorWriteFlags_ALL,
.color = {
.src_factor = WGPUBlendFactor_One,
.dst_factor = WGPUBlendFactor_Zero,
.operation = WGPUBlendOperation_Add,
},
.alpha = {
.src_factor = WGPUBlendFactor_One,
.dst_factor = WGPUBlendFactor_Zero,
.operation = WGPUBlendOperation_Add,
}
});
But of course that's a matter of taste :)