glow icon indicating copy to clipboard operation
glow copied to clipboard

Glium support?

Open YaLTeR opened this issue 6 years ago • 1 comments

Is it possible to somehow hook glium up to use glow as a backend? As far as I can tell, that would mean providing a glium::backend::Backend implementation.

YaLTeR avatar Oct 11 '19 08:10 YaLTeR

Thanks for asking about this! It would be really interesting to try to make this work to bring Glium to the web. I think it should be possible and would mostly just require mapping types/function names across.

I think the best way for Glium to use glow as a backend is to replace Glium's gl_generator build dependency with a glow dependency. Then anywhere gl types/functions are used, we just replace with the equivalent glow type/function name. If it's helpful, there are some examples in the gfx repository which show how gfx moved to glow from gl_generator.

Afterwards it might still be necessary to implement that Backend type in Glium too. It looks like Backend is mostly to handle context creation and function loading. gfx also has a similar trait for handling context creation, so it wouldn't be too hard to implement this trait.

grovesNL avatar Oct 11 '19 11:10 grovesNL