fschutt / azul

Desktop GUI Framework
https://azul.rs/
Mozilla Public License 2.0
5.89k stars 220 forks source link

Integration into non Azul programs #209

Open nico-abram opened 5 years ago

nico-abram commented 5 years ago

Is there (Or are there plans) to be able to use azul within a non-azul program? (By just using software rendering and getting a texture to render, or doing something similar to what imgui does and just provide a function to execute DrawCommands through a renderer of choice)

I'm also a bit curious if it'd be possible to use azul within wasm.

fschutt commented 5 years ago

Currently azul depends on OpenGL (but not azul-layout or azul-core, as they are separate crates). No, there will probably not be a native Vulkan port in the near future - if webrender is ported to Vulkan or gfx-rs, then we can talk, but the current Vulkan fork of WR is still very WIP.

The first goal is to get Azul running at all and to release a 0.1 version. The second step is to get the layout system to be compatible with the web (so that Azuls CSS is W3C-conform). The third step would then be to make azul-core WASM-ready and to write the necessary JS code to actually make it run on the web, but not using WebGL as a target, but the regular browser DOM. The fourth step is to document how to integrate Azul with Vulkan applications (for using it in games / interactive applications).

All of this will likely take years though, so don't hold your breath.

nico-abram commented 5 years ago

Thank you for the detailed response! That addresses all my questions

fschutt commented 5 years ago

@nico-abram Just an update, but there is now a headless example that shows you how to use azul without webrender (to use just the layout solver, for a custom renderer - for example to export layouts to PDF or SVG). The API isn't great, but you can use it by just depending on azul-core instead of having to depend on azul, i.e. better build times because of reduced dependencies.