PistonDevelopers / conrod

An easy-to-use, 2D GUI library written entirely in Rust.
Other
3.35k stars 296 forks source link

Any plans in adding support on Webassembly? #1118

Open alanpoon opened 6 years ago

alanpoon commented 6 years ago

I am trying to pass the Vertex{pos,uv,color,mode} generated by conrod to javascript webgl2 using wasm. I am using the conrod::backend::glium's vertex and fragment sources. In webgl2, I am using gl.vertexAttribIPointer to add an array buffer of Uint32Array and specify the type to gl.UNSIGN_INT. In glsl I am trying write to "in uint mode;", assigning an array of multiple 1 (s), but it still matches with uint(0) in the glsl. Does anybody know how to resolve this?

Conrod --feature gfx_rs does compile in wasm32-unknown-unknown with the need of rand 0.3.18 and with a patch update. Not with glium. I think it is time for glium to start to support wasm since it claims to be able to support webgl. If not, I have to do some manual work myself.

mitchmindtree commented 6 years ago

Hey @alanpoon, thanks a lot for the issue! If the issue is currently within the glium crate itself, perhaps this issue might be better of under the glium repository? I'm happy to keep this open though to discuss the state of using conrod with WASM :+1:

lf94 commented 6 years ago

@alanpoon did you end up creating the issue there? Could you post the link here?

alanpoon commented 6 years ago

Nope, I was thinking of writing a new backend for webgl. Stuck at this issue: https://github.com/oussama/webgl-rs/issues/2. I am having difficulties converting the general webgl tutorial's into webgl-rs. Glium is very under developed in webgl in my opinion.

alanpoon commented 6 years ago

there is a gui library that supports wasm. https://github.com/ryanisaacg/quicksilver i think we can learn from it and port into conrod.