RustAudio / baseview

low-level window system interface for audio plugin UIs
Apache License 2.0
259 stars 54 forks source link

simple wgpu example #191

Open andrew-r-thomas opened 2 months ago

andrew-r-thomas commented 2 months ago

this is a simple example using wgpu of a rainbow triangle that is centered at the mouse position.

it's probably not the cleanest way to do things on the wgpu side but it's a good starter example for people looking to use wgpu in baseview

some things to note:

andrew-r-thomas commented 2 months ago

@prokopyl not sure what the weird clippy error is for the windows test, looks like its coming from the baseview source. everything else should be fixed though!

murl-digital commented 1 month ago

fyi @andrew-r-thomas, i was able to get the latest version of wgpu working with your example, basically i remove the lifetime requirements, made Surface 'static, and converted directly between the raw window and display handle types between 05 and 0.6

andrew-r-thomas commented 1 month ago

fyi @andrew-r-thomas, i was able to get the latest version of wgpu working with your example, basically i remove the lifetime requirements, made Surface 'static, and converted directly between the raw window and display handle types between 05 and 0.6

sweet! I think there are a bunch of refactoring changes for baseview that are in progress that will allow for 0.6 to be more fully supported, but good to know that theres a fix in the meantime!